Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Files

Latest commit

7627b0c · Oct 25, 2020

History

History
101 lines (62 loc) · 3.84 KB

CONTRIBUTING.md

File metadata and controls

101 lines (62 loc) · 3.84 KB

Contribution Guide

This is the common top-level contribution guide for this monorepo. A sub-package may have an additional CONTRIBUTING.md file if needed.

Legal

All contributors must sign the DCO

This is managed automatically via https://cla-assistant.io/ pull request voter.

Development Environment

pre-requisites

Initial Setup

The initial setup is trivial:

  • clone this repo
  • yarn

Commit Messages format.

This project enforces the conventional-commits commit message formats. The possible commits types prefixes are limited to those defined by conventional-commit-types. This promotes a clean project history and enabled automatically generating a changelog.

The commit message format will be inspected both on a git pre-commit hook and during the central CI build and will fail the build if issues are found.

It is recommended to use git cz to construct valid conventional commit messages.

Formatting.

Prettier is used to ensure consistent code formatting in this repository. This is normally transparent as it automatically activated in a pre-commit hook using lint-staged. However, this does mean that dev flows that do not use a full dev env (e.g editing directly on github) may result in voter failures due to formatting errors.

Compiling

Use the following npm scripts at the repo's root to compile all the TypeScript sub-packages.

  • yarn compile
  • yarn compile:watch (will watch files for changes and re-compile as needed)

These scripts may also be available inside the sub-packages. However, it is recommended to use the top-level compilation scripts to avoid forgetting to (re-)compile a sub-package's dependency.

Testing

Mocha and Chai are used for unit-testing and Istanbul/Nyc for coverage reports.

  • To run the tests execute yarn test in a specific sub-package.
  • To run the tests with coverage run yarn coverage in a specific sub-package.

Code Coverage

100%* Code Coverage is enforced for all productive code in this mono repo.

  • Specific statements/functions may be excluded from the report.
    • However, the reason for each exclusion must be documented.

Full Build

To run the full Continuous Integration build run yarn ci in either the top-level package or a specific subpackage.

Release Life-Cycle.

This monorepo uses Lerna's Fixed/Locked which means all the sub-packages share the same version number.

Release Process

Performing a release requires push permissions to the repository.

  • Ensure you are on the default branch and synced with origin.
  • yarn run release:version
  • Follow the lerna CLI instructions.
  • Track the newly pushed tag (/^v[0-9]+(\.[0-9]+)*/) build in the build system until successful completion.
  • Inspect the newly artifacts published on npmjs.com / Github Releases / other relevant release targets.