Developing
July 1, 2021 ยท View on GitHub
Pre-requisites
- We use the active NodeJS LTS. If you need to work with multiple versions of Node, you might consider using nvm.
- This repository uses yarn to manage node dependencies. Please install yarn globally using
npm install --global yarn. - Tests are executed on the latest NodeJS as well as all active and maintained NodeJS LTS versions.
Structure
Packages
The packages directory contains the different npm packages.
Typical workflow
You would only do this once after you cloned the repository.
- Clone this repository from git.
cdintocommand.- We develop using feature brances off
mainand release from themainbranch. At this point, it should be set tomainby default. If not, rungit checkout -t origin/main. yarnto bring in all the top-level dependencies.- Open the project in your editor of choice.
When you are ready to commit
- We enforce commit message format. We recommend using commitizen by installing it with
yarn global add commitizenthen commit usinggit czwhich will prompt you questions to format the commit message. - Before commit and push, husky will run several hooks to ensure the message and that everything lints and compiles properly.
List of Useful commands
yarn compile
This compiles the typescript to javascript.
yarn clean
This cleans all generated files and directories. Run yarn clean-all to also clean up the node_module directories.
yarn test
This tests the typescript using ts-node.
yarn docs
This generates documentation into docs.
yarn lint
This lints all the typescript. If there are no errors/warnings from tslint, then you get clean output. But, if there are errors from tslint, you will see a long error that can be confusing โ just focus on the tslint errors. The results of this are deeper than what the tslint extension in VS Code does because of semantic lint rules which requires a tsconfig.json to be passed to tslint.