The project uses Node.js v14.x LTS.
This is a monorepo maintained with Lerna.
To install repository dependencies and bootstrap repository packages:
Post-installation, the packages source code is compiled.
The packages interdependencies, testing, the playground, and the website use the compiled/transpiled CommonJS code of the packages, not the actual source code.
So the packages need to be compiled for the packages dependencies, testing, and the applications to work.
npm run compile-commonjs
The UMD compiled code is only required when the project is to be released.
npm run compile-umd
jest, and @testing-library/react are used for tools and components unit testing.
npm run test # test oncenpm run test-watch # test with watchernpm run test-coverage # test with coverage
ESLint and markdownlint are used for linting.
For a continuous integration environment, the installation, setup, linting, and testing processes can be executed with:
npm run ci
Git commit messages
Conventional Commits v1.0.0 is used for commit message format along with the Conventional Changelog specification.
An interactive git commit message guide is already setup to ensure the convention is followed every time there is a new commit.
The following conditions are required to release the project:
- Current git branch is
- Local branch is synced with remote branch.
- Git working directory is clean.
- User is located at project root path.
- Lints and tests must pass to prevent issues.
Then the release can be started:
npm run release
As of writing, Lerna v3.22.1 has an issue with the commit message linter so the process gets blocked halfway. The solution is to wait a minute until this happens and press
Ctrl+Cto skip the linter.
It will execute the following processes:
- Bootstrap packages.
- Compile the code.
- Run linter.
- Run tests.
- Lerna publish.
Lerna will take care of publishing to NPM and releasing in GitHub.
To update the changelog after release:
npm run changeloggit add CHANGELOG.mdgit commit -m "chore: changelog"