Skip to content

The design language that makes your AI harness better at design.

JavaScript

Fix: keep npx on the current CLI for Node 18.19 to 22.17 (#850) (#926)

Abdul Wahab7b2e8e6a2ab4
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a68db51e4..7213104c8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -70,6 +70,7 @@ jobs:
strategy:
fail-fast: false
matrix:
+ # The workspace's floor (package.json devEngines); the published shim's is held by cli-shim-floor (#850).
node-version: [22.18.0, 24]
steps:
- name: Checkout repository
@@ -249,6 +250,32 @@ jobs:
- name: Exercise Windows launcher downloads and verification
run: node --test tests/launcher-download.test.mjs
+ # The npm package ships only the shim (cli/bin/cli.js), and npm skips
+ # `latest` for a Node its engines reject, serving the newest version that
+ # admits it instead. So engines.node in package.json is the shim's floor, not
+ # the workspace's (that one is devEngines): raising it sends everyone below
+ # it to an older CLI that can no longer install (#361, #850). SHIM_FLOOR is
+ # the version this job proves, and engines.node must match it.
+ cli-shim-floor:
+ runs-on: ubuntu-latest
+ needs: changes
+ if: needs.changes.outputs.core == 'true'
+ env:
+ SHIM_FLOOR: 18.19.0
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ - name: Check the published Node floor
+ run: |
+ floor=$(jq -r .engines.node package.json)
+ [ "$floor" = ">=$SHIM_FLOOR" ] || { echo "::error::package.json engines.node is $floor, but the shim is proven on >=$SHIM_FLOOR. Raise SHIM_FLOOR only when the shim itself needs a newer Node."; exit 1; }
+ - name: Setup Node
+ uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
+ with:
+ node-version: ${{ env.SHIM_FLOOR }}
+ - name: Exercise the npm shim on its Node floor
+ run: node --test tests/cli-shim.test.mjs
+
# Behavior gate: replays the tests/oracle/ goldens against a release build
# of the engine from THIS checkout (so a PR is judged on its own source,
# not on the last published binary). Without this job the oracle only ever
diff --git a/README.npm.md b/README.npm.md
index 5250caf36..798a5ba2e 100644
--- a/README.npm.md
+++ b/README.npm.md
@@ -79,7 +79,7 @@ impeccable detect [options] [file-or-dir-or-url...]
## Requirements
-- Node.js 22.18+ to run `npx impeccable`. The engine itself is a self-contained binary and needs no runtime; the skill installed into your harness calls it directly.
+- Node.js 18.19+ to run `npx impeccable`. The engine itself is a self-contained binary and needs no runtime; the skill installed into your harness calls it directly.
- For URL scans, an installed Chrome, Chromium, or Edge (set `IMPECCABLE_BROWSER` to point at one).
- Behind a TLS-inspecting proxy, downloads trust your OS certificate store as well as the bundled Mozilla roots. Set `SSL_CERT_FILE` or `SSL_CERT_DIR` to use a specific CA bundle instead.
diff --git a/package.json b/package.json
index c793f835f..1d48e5d09 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,14 @@
"url": "git+https://github.com/pbakaus/impeccable.git"
},
"engines": {
- "node": ">=22.18.0"
+ "node": ">=18.19.0"
+ },
+ "devEngines": {
+ "runtime": {
+ "name": "node",
+ "version": ">=22.18.0",
+ "onFail": "warn"
+ }
},
"type": "module",
"bin": {