Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 2.13 KB

File metadata and controls

49 lines (37 loc) · 2.13 KB

Contributing to @nrfcloud/fetch-with-debug

Thanks for contributing! This is a published library; new versions are released to NPM automatically on merge to main.

Development setup

  1. Ensure you have GitHub push access.
  2. Get your environment set up by running npm ci.
  3. Make your changes locally in a git clone of the repo in your own branch.
  4. As you go, commit along the way so that you get type checking, testing, etc. to run.

Testing

  1. Run npx tsc to type-check the project.
  2. Run npm test for the unit tests. They run the *.spec.ts files directly with the Node.js built-in test runner.

Building the NPM package

The package is published as compiled JavaScript with type declarations in the npm/ folder, which is created by the prepublishOnly hook:

  1. .npm/compile.ts transpiles the TypeScript sources using @swc/core and rewrites the .ts import specifiers to .js.
  2. TypeScript 7 emits the type declarations, using .npm/tsconfig.npm.json.

Run npm run prepublishOnly to build it locally.

Releasing a new version

  1. Finally, create a commit that packages up all the changes.
  2. Use conventional commits (e.g. fix:, feat:, etc.) to prefix the title.
  3. Reference any applicable Jira tickets (e.g. NPE-123) in the commit message.
  4. Push your branch and create a pull request.
  5. Get the code reviewed.
  6. Once approved and CI passes, rebase or squash away!
  7. semantic-release in the Test&Release workflow takes care of creating a new GitHub release and publishing the package to NPM.

Once the new version is published, consumers can bump their dependency on @nrfcloud/fetch-with-debug to pick it up.