Arwes LogotypeArwes Logotext

Contribution Workflow

The project uses Node.js v14.x LTS.

This is a monorepo maintained with Lerna.

Setting up

To install repository dependencies and bootstrap repository packages:

bash
npm install

Post-installation, the packages source code is compiled.

Compiling

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.

bash
npm run compile-commonjs

The UMD compiled code is only required when the project is to be released.

bash
npm run compile-umd

Testing

jest, and @testing-library/react are used for tools and components unit testing.

bash
npm run test # test once
npm run test-watch # test with watcher
npm run test-coverage # test with coverage

ESLint and markdownlint are used for linting.

bash
# lint all JS/TS/MD files
npm run lint
# JavaScript/TypeScript linting
npm run lint-js # lint
npm run lint-js-fix # fix lint issues
# Markdown linting
npm run lint-md # lint
npm run lint-md-fix # fix lint issues

For a continuous integration environment, the installation, setup, linting, and testing processes can be executed with:

bash
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.

Releasing

The following conditions are required to release the project:

  • Current git branch is main.
  • 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:

bash
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+C to 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:

bash
npm run changelog
git add CHANGELOG.md
git commit -m "chore: changelog"