Skip to content

chore(mcp): test against Node 22 and 24, and declare an engines range - #11

Merged
tobydoescode merged 1 commit into
mainfrom
chore/node-matrix-and-engines
Jul 28, 2026
Merged

chore(mcp): test against Node 22 and 24, and declare an engines range#11
tobydoescode merged 1 commit into
mainfrom
chore/node-matrix-and-engines

Conversation

@tobydoescode

Copy link
Copy Markdown
Owner

Follow-up to #10. Two related gaps that bump surfaced.

Node matrix

mcp/ is published to npm as @evoio/apple-bridge-mcp, so it runs on whatever Node a consumer has — but CI only ever exercised one version. #10 moved that from 22 to 24, which silently dropped 22 from coverage entirely.

-    name: MCP server
+    name: MCP server (node ${{ matrix.node }})
     runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        node: [22, 24]

22 and 24 are the two lines still receiving updates now that 20 is EOL. fail-fast: false so a break on one version doesn't mask the other's result. Both legs are ~15s Linux jobs.

engines

"engines": {
  "node": ">=22"
},

The package previously made no claim at all, so consumers got no signal at install time.

This is a support statement, not a technical floor. src/index.ts needs global fetch and nothing more exotic — no top-level await — so it may well run on older releases. 22 is simply the oldest version CI actually covers. If you want the real floor, add 20 to the matrix temporarily and see what breaks.

Also note npm only warns on an engines mismatch unless the consumer sets engine-strict=true.

package-lock.json picked up the matching engines entry via npm install --package-lock-only, so the lock doesn't drift on the next install.

Two consequences worth knowing

Renovate loses this pin. #10 worked because node-version: 24 was a plain scalar it could regex. It cannot bump a matrix list, so these versions are hand-maintained now — there's a comment in the workflow saying so, pointing at the engines range to keep them in step.

Check names change from MCP server to MCP server (node 22) / MCP server (node 24). No effect today, but that's what you'd name if required status checks are ever configured on main.

Verification

  • npx js-yaml parses the workflow; matrix resolves to [22, 24], node-version wired to ${{ matrix.node }}
  • Locally on Node 22.22.2 (the lower matrix leg): npm ci clean, typecheck clean, 21/21 tests
  • Node 24 leg was already proven green in Update dependency node to v24 #10

🤖 Generated with Claude Code

The MCP server is published to npm, so it runs on whatever Node a
consumer has, but CI only ever exercised a single version and the
package made no claim about what it supports.

Run the mcp job as a matrix over Node 22 and 24 - the two lines still
receiving updates now that 20 is end of life - with fail-fast disabled
so a break on one version doesn't mask the result on the other. Both
legs are short Linux jobs, so the added cost is negligible.

Declare "engines": { "node": ">=22" } to match. This is a support
statement rather than a technical floor: src/index.ts needs global
fetch and nothing more exotic, so it may well run on older releases,
but 22 is the oldest version actually covered by CI.

Renovate bumped this pin in #10 while it was a plain scalar; it cannot
do the same for a matrix list, so the versions are now maintained by
hand and a comment says so.

Note that the check names change from "MCP server" to
"MCP server (node 22)" and "MCP server (node 24)", which matters if
required status checks are ever configured on main.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tobydoescode
tobydoescode merged commit d85303f into main Jul 28, 2026
3 checks passed
@tobydoescode
tobydoescode deleted the chore/node-matrix-and-engines branch July 28, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant