pnpm
is used to maintain all the packages, You should install it first- Run
pnpm i
to install dependencies andpnpm test
to test your setup. If all testing are passed and nothing go wrong, you are good to go.
- First of all add the git submoudle to
modules
dir.`
For example: git submodule add https://github.com/sindresorhus/escape-goat modules/escape-goat
pnpm run add:package
to generate a template code inpackages/<package name>
- Finish
package-patch.json
and usepnpx 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.
- Finish
build-cjs.js
to building a working commonjs bundle. You can use either tsup, tsc or rollup to do the job. - Write unit test in
packages/<package name>/test/pkg.test.js
- generate README by
pnpx generate-readme
Now you can make a pull request to add a new pacakge