Skip to content

Commit 7125ee2

Browse files
committed
Update contributing docs
1 parent bc21ae2 commit 7125ee2

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

CONTRIBUTING.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,61 @@
22

33
Welcome, and thank you for taking time in contributing to esm.sh project!
44

5-
## Development setup
5+
## Development Setup
66

7-
You will need [Golang](https://golang.org/) 1.18+ and [Deno](https://deno.land) to run the server and tests.
7+
You will need [Golang](https://golang.org/)(1.21+) and [Deno](https://deno.land)(1.40+) installed on a Linux or macOS machine.
88

99
1. Fork this repository to your own GitHub account.
1010
2. Clone the repository to your local device.
11-
3. Create a new branch `git checkout -b BRANCH_NAME`.
12-
4. Change code then run the testings.
11+
3. Create a new branch (`git checkout -b BRANCH_NAME`).
12+
4. Change code then run tests
1313
5. Push your branch to Github after **all tests passed**.
1414
6. Make a [pull request](https://github.com/esm-dev/esm.sh/pulls).
1515
7. Merge to master branch by our maintainers.
1616

1717
## Configration
1818

19-
To configure the server, create a `config.json` file in the project root directory. Here is an example:
19+
Create a `config.json` file in the project root directory following the example below:
2020

2121
```jsonc
2222
// config.json
2323
{
2424
"port": 8080,
2525
"workDir": ".esmd",
26-
"npmRegistry": "https://registry.npmjs.org",
27-
"npmToken": "xxxxxx"
26+
"npmRegistry": "https://registry.npmjs.org/", // change to your own registry if needed
27+
"npmToken": "xxxxxx" // remove this line if you don't need a token
2828
}
2929
```
3030

31-
You can find all the server options in [config.exmaple.jsonc](./config.example.jsonc).
31+
More server options please check [config.exmaple.jsonc](./config.example.jsonc).
3232

33-
## Run the sever in development mode
33+
## Running the Server from Source Code
3434

3535
```bash
3636
go run main.go --dev
3737
```
3838

3939
Then you can import `React` from "http://localhost:8080/react"
4040

41-
## Run testings
41+
## Running Integration Tests
42+
43+
We use [Deno](https://deno.land) to run all the integration tests. Make sure you have Deno installed on your machine.
4244

4345
```bash
4446
# Run all tests
45-
./test/bootstrap.sh
47+
./test/bootstrap.ts
4648

47-
# Run tests for a specific case (directory name)
48-
./test/bootstrap.sh preact
49+
# Run a test for a specific case (directory name)
50+
./test/bootstrap.ts preact
4951

5052
# Run tests with `clean` option (purge previous builds)
51-
./test/bootstrap.sh --clean
53+
./test/bootstrap.ts --clean
5254
```
5355

54-
All the tests are running in [Deno](https://deno.land), you can find them in [test/](./test) directory.
56+
To add a new integration test case, copy the [test/_template](./test/_template) directory and rename it to your case name.
57+
58+
```bash
59+
cp -r test/_template test/case_name
60+
nvim test/case_name/test.ts
61+
./test/bootstrap.ts case_name
62+
```

0 commit comments

Comments
 (0)