Skip to content

Latest commit

 

History

History
107 lines (73 loc) · 2.36 KB

File metadata and controls

107 lines (73 loc) · 2.36 KB

Contributing

Requirements

Install dependencies

yarn            # install npm dependencies
yarn bs         # bootstrap repository with lerna to link local dependencies
cd packages/sdk # go to the @saagie/sdk project
yarn link       # to use saagie-sdk everywhere ;)

Run tests

yarn test

Development

Run the dev command at the root of the project

yarn dev

Then go to your technology folder and run:

yarn link @saagie/sdk
export SAAGIE_ENV=development
yarn dev

Test NPM publish with Verdaccio

You can use Verdaccio (a local npm registry) to test dry-run package publication.

1. Install Verdaccio globally

yarn global add verdaccio

2. Run verdaccio

verdaccio

3. Run dry-run publish

yarn verdaccio:publish

Go to @saagie/sdk on Verdaccio to see your package published.

4. Testing with npx

npx @saagie/sdk init -- --registry http://localhost:4873/

5. Revert dry-run publish

yarn verdaccio:unpublish

Publishing

The published version will be automagically calculated using the recently closed PR that are not released yet. Each PR should have one (and only one) of the following label:

  • patch
  • minor
  • major

If a PR as the label release on it, then, the GitHub Actions CI will automatically create a new release on NPM and GitHub.

Publication Examples

  1. Suppose we are currently at version 0.3.0, and there are only 1 PR with the patch label, then the released version will be 0.3.1.
  2. Suppose we are currently at version 0.3.0, and there are 2 PR one with the patch label and the other one with the minor label, then the released version will be 0.4.0.

Troubleshooting

Windows

npm uses cmd that doesn't support command substitution that we use to get the git commit hash for the build. You need to tell npm to use powershell for this to work. Learn more here and here.

npm config set script-shell "C:\\windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"