Hi! We're really excited and happy to see that you're contributing to Arclix. Before submitting your contribution, please read through the following guide.
- Make sure you have Node.js which includes
npm
greater than v12.
To develop and test the core Arclix
package:
- Run
npm i
in Arclix root folder. - Do the changes you want in the Arclix.
- Make sure you run
npm run test
and check whether all the tests are passed before raising the PR. - Also make sure you run
npm run build
before raising the PR. - You can also do both step 3 & 4 using
npm run verify
.
We do unit testing for all the module including core, utility, etc.
Unit tests are powered by vitest. The detailed configuration of vitest is inside vitest.config.cjs
file.
- Run unit tests under each module using:
npm run test
- Run unit tests with coverage using:
npm run test:coverage
Warning Do maintain the
branches
andfunctions
greater than50%
in the coverage.
-
Checkout a topic branch from a base branch (e.g.
master
), and merge back against that branch. -
If adding a new feature:
- Add accompanying test case.
- Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first, and have it approved before working on it.
-
If fixing a bug:
- If you are resolving a special issue, add
fix: remove something (#issue id) #PR id
in your PR title for a better release log (e.g.fix: remove something (#1) #2
). - Provide a detailed description of the bug in the PR. Live demo preferred.
- Add appropriate test coverage if applicable.
- If you are resolving a special issue, add
-
It's OK to have multiple small commits as you work on the PR. GitHub can automatically squash them before merging.
-
Make sure to run the following commands before raising the PR:
npm run format
npm run verify:pr
-
No need to worry about code style as long as you have installed the dev dependencies. Modified files are automatically formatted with Prettier on commit (by invoking Git Hooks via husky).
-
PR title must follow the commit message convention so that changelogs can be automatically generated.
Arclix aims to be lightweight, and this includes being aware of the number of npm dependencies and their size.
Most deps should be added to devDependencies
even if they are needed at runtime. Some exceptions are:
- Type packages. Example:
@types/*
. - Deps that cannot be properly bundled due to binary files. Example:
esbuild
.
Avoid deps with large transitive dependencies that result in bloated size compared to the functionality it provides. For example, http-proxy
itself plus @types/http-proxy
is a little over 1MB in size, but http-proxy-middleware
pulls in a ton of dependencies that make it 7MB(!) when a minimal custom middleware on top of http-proxy
only requires a couple of lines of code.