Just for initial setup.
Optionally install nvm to ensure you're using the correct version of node. You can find the node version in the
and then install the git hooks:
yarn husky install
Start the mock registry:
and then run the tests:
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:
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 -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 -p types:watch
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
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.
You can unpack all yarn zips via:
yarn unplug @yarnpkg/*
This will let you inspect yarn source code to debug stack traces.