Skip to content

Latest commit

 

History

History
100 lines (63 loc) · 4.13 KB

CONTRIBUTING.md

File metadata and controls

100 lines (63 loc) · 4.13 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.

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.
    • Note the next version number will be determined by the commit messages history since the last release.
  • Track the RELEASE tag build on circle-ci.
  • Once the tag build has finished successfully inspect the npm registry to see the new versions for all the changed packages of this mono-repo.
    • npm view [package-name] version

Developer Certificate of Origin (DCO)

Due to legal reasons, contributors will be asked to accept a DCO before they submit the first pull request to this projects, this happens in an automated fashion during the submission process. SAP uses the standard DCO text of the Linux Foundation.