Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 1.58 KB

CONTRIBUTING.md

File metadata and controls

59 lines (42 loc) · 1.58 KB

Contributing to esm.sh

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

Development Setup

You will need Golang(1.22+) and Deno(1.40+) installed on a Linux or macOS machine.

  1. Fork this repository to your own GitHub account.
  2. Clone the repository to your local device.
  3. Create a new branch (git checkout -b BRANCH_NAME).
  4. Change code then run tests
  5. Push your branch to GitHub after all tests passed.
  6. Make a pull request.
  7. Merge to master branch by our maintainers.

Configration

Create a config.json file in the project root directory following the example below:

// config.json
{
  "port": 8080,
  "workDir": ".esmd",
  "npmRegistry": "https://registry.npmjs.org/", // change to your own registry if needed
  "npmToken": "xxxxxx", // remove this line if you don't have one
}

More server options please check config.exmaple.jsonc.

Running the Server from Source Code

go run main.go --debug

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

Running Integration Tests

We use Deno to run all the integration testing cases. Make sure you have Deno installed on your computer.

# Run all tests
make test

# Run a specific test
make dir=react-18

To add a new integration test case, copy the test/_template directory and rename it to your case name.

cp -r test/_template test/new_test
nvim test/new_test/test.ts
make dir=new_test