Contributing to Monodeploy
Quick Setup (Optional)
Just for initial setup.
. script/bootstrap
Getting Started
Optionally install nvm to ensure you're using the correct version of node. You can find the node version in the .nvmrc file.
Install dependencies.
yarn
and then install the git hooks:
yarn husky install
This project uses Typescript and Yarn Berry.
Tests
Start the mock registry:
yarn test:registry
and then run the tests:
yarn test
You can run yarn test:registry:logs to see a live stream of the registry logs.
During development, you can usue the watch mode to have tests autorun on file changes:
yarn test:watch
Build
You can execute yarn build to generate the build assets that ultimately gets uploaded to the NPM registry. It will also leave the intermediate lib artifacts, which contain the transpiled code.
You can use yarn workspaces foreach --worktree -p build:watch to rebuild the lib directory (minus typescript definitions) on source file change.
To regenerate typescript definition files (and to catch type violations):
yarn workspaces foreach --worktree -p types:watch
Using Example Monorepo
After building the code (via above watch commands), run:
yarn node packages/cli/lib/cli.js --cwd <PATH_TO_EXAMPLE_MONOREPO> \--dry-run --log-level 0 \--conventional-changelog-config @tophat/conventional-changelog-config
Tips
Configuring Your IDE
VSCode
You'll need to download the ZipFS extension to be able to use functionality such as "Go To Definition" with the zipped npm packages.
In a Typescript file, Cmd + Shift + P will open the command menu. Select "TypeScript: Select Typescript Version..." and use the version from the workspace.
Debugging Yarn API Packages
You can unpack all yarn zips via:
yarn unplug @yarnpkg/*
This will let you inspect yarn source code to debug stack traces.