Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 1.18 KB

CONTRIBUTING.md

File metadata and controls

23 lines (14 loc) · 1.18 KB

CONTRIBUTING

Before writing code

  1. pnpm is used to maintain all the packages, You should install it first
  2. Run pnpm i to install dependencies and pnpm test to test your setup. If all testing are passed and nothing go wrong, you are good to go.

Add a new package

  1. First of all add the git submoudle to modules dir.`

For example: git submodule add https://github.com/sindresorhus/escape-goat modules/escape-goat

  1. pnpm run add:package to generate a template code in packages/<package name>
  2. Finish package-patch.json and use pnpx patch-package-json <package name> to generate new package.sjon.

The package alias feature in pnpm can help you to change a package to commonjs one without changing the actual code.

  1. Finish build-cjs.js to building a working commonjs bundle. You can use either tsup, tsc or rollup to do the job.
  2. Write unit test in packages/<package name>/test/pkg.test.js
  3. generate README by pnpx generate-readme

Now you can make a pull request to add a new pacakge