From 638b89e30af818755b7b6bd23afa8db91c0eca6f Mon Sep 17 00:00:00 2001 From: Roger Chappel Date: Fri, 24 Jul 2026 20:28:45 +1000 Subject: [PATCH 1/4] fix: align Node engine support with dependencies --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index a4003c6..5cb27c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "vitest": "^3.0.0" }, "engines": { - "node": ">=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=22.0.0" } }, "node_modules/@ampproject/remapping": { diff --git a/package.json b/package.json index ea592fe..9ace9dc 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ }, "homepage": "https://github.com/rogerchappel/typegap#readme", "engines": { - "node": ">=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=22.0.0" }, "dependencies": { "@typescript-eslint/typescript-estree": "^8.0.0", From 5111e968bb0c7f452ad877dc4c142ccfcf059d7e Mon Sep 17 00:00:00 2001 From: Roger Chappel Date: Fri, 24 Jul 2026 20:28:57 +1000 Subject: [PATCH 2/4] test: smoke test the installed CLI package --- scripts/package-smoke.mjs | 46 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/scripts/package-smoke.mjs b/scripts/package-smoke.mjs index 60c4d84..65908a4 100644 --- a/scripts/package-smoke.mjs +++ b/scripts/package-smoke.mjs @@ -1,5 +1,7 @@ import { spawnSync } from "node:child_process"; -import { readFileSync } from "node:fs"; +import { mkdtempSync, readFileSync, rmSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; const result = spawnSync("npm", ["pack", "--dry-run", "--json"], { encoding: "utf8", @@ -64,4 +66,44 @@ if (!readFileSync(binPath, "utf8").startsWith("#!/usr/bin/env node")) { process.exit(1); } -console.log(`typegap package smoke passed with ${packument.files.length} packed file(s).`); +const smokeDir = mkdtempSync(join(tmpdir(), "typegap-package-smoke-")); + +try { + const packResult = spawnSync("npm", ["pack", "--json", "--pack-destination", smokeDir], { + encoding: "utf8", + }); + + if (packResult.status !== 0) { + process.stderr.write(packResult.stderr); + process.exit(packResult.status ?? 1); + } + + const [packed] = JSON.parse(packResult.stdout); + const tarballPath = join(smokeDir, packed.filename); + const installResult = spawnSync("npm", ["install", "--ignore-scripts", tarballPath], { + cwd: smokeDir, + encoding: "utf8", + }); + + if (installResult.status !== 0) { + process.stderr.write(installResult.stderr); + process.exit(installResult.status ?? 1); + } + + const cliResult = spawnSync(join(smokeDir, "node_modules", ".bin", "typegap"), ["--help"], { + cwd: smokeDir, + encoding: "utf8", + }); + + if (cliResult.status !== 0 || !cliResult.stdout.includes("Usage: typegap")) { + process.stderr.write(cliResult.stderr); + console.error("installed package smoke failed to run the typegap CLI."); + process.exit(cliResult.status ?? 1); + } + + console.log( + `typegap package smoke passed with ${packument.files.length} packed file(s) and an installed CLI invocation.`, + ); +} finally { + rmSync(smokeDir, { recursive: true, force: true }); +} From c84c05ec290ce15060f1b3c1f7314234ca5cbcfb Mon Sep 17 00:00:00 2001 From: Roger Chappel Date: Fri, 24 Jul 2026 20:28:57 +1000 Subject: [PATCH 3/4] ci: test the supported Node release matrix --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f98d78..73751ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,11 +11,15 @@ permissions: jobs: test: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [18.18.0, 20.9.0, 22, 24] steps: - uses: actions/checkout@v6 - uses: actions/setup-node@v4 with: - node-version: 22 + node-version: ${{ matrix.node-version }} cache: npm - run: npm ci - run: npm run release:check From b45e536c61bb1746d5c5819be87d508421b75582 Mon Sep 17 00:00:00 2001 From: Roger Chappel Date: Fri, 24 Jul 2026 20:28:57 +1000 Subject: [PATCH 4/4] docs: document supported Node releases --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index add7516..c1d998c 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,10 @@ MIT © [Roger Chappel](https://github.com/rogerchappel) ## Development +Typegap supports Node.js 18.18+, 20.9+, and 22 or newer. Node.js 19 and 21 +are not supported because the shipped runtime dependency set does not support +those releases. + Run the same release gate used by CI before opening a PR: ```bash