Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/actions/install-npm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Install NPM
description: >
Installs the NPM version required by the `engines.npm` directive in
package.json, which is required for the project to build correctly.

runs:
using: composite
steps:
- name: Install NPM
shell: bash
run: |
npmVersion="$(node -p 'require(`${process.env.GITHUB_WORKSPACE}/package.json`).engines.npm')"
echo "Installing npm@${npmVersion}"
npm install -g "npm@${npmVersion}"
7 changes: 5 additions & 2 deletions .github/workflows/test-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ jobs:

- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "24.x"
node-version: ">=24.18.1 <25"
cache: "npm"

- name: Install NPM version specified in package.json
uses: ./.github/actions/install-npm

- name: Install dependencies
run: npm ci --no-audit

- run: npx tsgo
- run: npx tsc

- run: npm test

Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@jsr:registry=https://npm.jsr.io
allow-remote=root
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ for AWS Lambda functions used in nRF Cloud and is published to

## Testing

1. Run `npx tsgo` to type-check the project.
1. Run `npx tsc` to type-check the project.
1. Run `npm test` to run the unit tests.

## Releasing a new version
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ export const handler = middy()
track("some:metric", MetricUnit.Count, 1);
});
```

## TypeScript 6 and 7

This repo
[runs TypeScript 6 and 7 side by side](https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/#running-side-by-side-with-typescript-6.0),
[so that eslint works](https://github.com/typescript-eslint/typescript-eslint/issues/10940#issuecomment-4922812181).
Loading