Skip to content

Commit 04ae270

Browse files
committed
Add agents.md
1 parent 3ee8df8 commit 04ae270

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# esm.sh
2+
3+
A _no-build_ JavaScript CDN for modern web development.
4+
5+
## Project Structure
6+
7+
- `cli/`: Command-line interface (releases as the npm `esm.sh` CLI).
8+
- `internal/`: Shared Go packages reused by both the server and the CLI—NPM resolution, storage, build helpers, and related utilities.
9+
- `server/`: Main HTTP service: request handling, bundling, and CDN behavior.
10+
- `test/`: Deno-based integration suites; each subdirectory exercises imports against a running server (`test/.template` is the scaffold for new cases).
11+
- `web/`: Landing site and docs: static assets plus Go handlers that serve them alongside the CDN.
12+
13+
## Running the Server in Debug Mode
14+
15+
```bash
16+
make run/server
17+
```
18+
19+
Then you can import `React` from "http://localhost:8080/react"
20+
21+
## Running Server Integration Tests
22+
23+
We use [Deno](https://deno.land) to run all the integration testing cases. Make sure you have Deno installed on your computer.
24+
25+
```bash
26+
# Run all tests
27+
make test/server
28+
29+
# Run a specific test
30+
make test/server dir=react-18
31+
```
32+
33+
To add a new integration test case, copy the [test/.template](./test/.template) directory and rename it to your case name.
34+
35+
```bash
36+
# copy the testing template
37+
cp -r test/.template test/test-case-name
38+
# edit the test code
39+
vi test/test-case-name/test.ts
40+
# run the test
41+
make test/server dir=test-case-name
42+
```

0 commit comments

Comments
 (0)