Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 2.06 KB

File metadata and controls

48 lines (36 loc) · 2.06 KB

Contributing

@nrfcloud/lambda-helpers is a published library: it provides helper functions for AWS Lambda functions used in nRF Cloud and is published to NPM.

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 to run the unit tests.

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.

Now that you have a new version of @nrfcloud/lambda-helpers published, you can bump the dependency in the projects that consume it.