From 5cc02f1c914fc35e02c70ebcc560dea6e4d8f3b3 Mon Sep 17 00:00:00 2001 From: Nicolas Borges Date: Thu, 5 Nov 2026 16:23:19 -0500 Subject: [PATCH] fix(ci): test CLI on supported Node 22 floor --- .github/workflows/release-main-and-preview.yml | 4 ++-- .github/workflows/verify.yml | 7 +++++++ AGENTS.md | 2 +- README.md | 2 +- package.json | 2 +- src/io/source.test.ts | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-main-and-preview.yml b/.github/workflows/release-main-and-preview.yml index 5e94d5f3a..e66a53531 100644 --- a/.github/workflows/release-main-and-preview.yml +++ b/.github/workflows/release-main-and-preview.yml @@ -72,9 +72,9 @@ jobs: - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: - node-version: 20.x + node-version: "22" registry-url: https://registry.npmjs.org - # npm trusted publishing needs npm 11.5.1 or newer, Node 20 bundles npm 10. + # npm trusted publishing needs npm 11.5.1 or newer, Node 22 bundles npm 10. - run: npm install -g npm@11 - run: bun install --frozen-lockfile --os="*" --cpu="*" diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 61ee9f203..f93e27301 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -45,6 +45,10 @@ jobs: ref: ${{ inputs.ref }} persist-credentials: false - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 + # The stdin regression test spawns Node and imports Ink, which requires Node 22 or newer. + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version: "22" - run: bun install --frozen-lockfile # Every static check reports even when an earlier one fails. Build and tests only run when all pass. @@ -90,6 +94,9 @@ jobs: ref: ${{ inputs.ref }} persist-credentials: false - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version: "22" - run: bun install --frozen-lockfile - run: bun run build - run: bun pm pack --ignore-scripts diff --git a/AGENTS.md b/AGENTS.md index c2e2fa873..6b4c44e00 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -36,7 +36,7 @@ Before finishing a change run `bun test`, `bun run typecheck`, `bun run lint:che ## Critical gotchas - **No `Bun` global in `src/`.** oxlint's `no-restricted-globals` bans it because the npm bundle - runs on Node (`engines.node >= 20.12`). Use `node:*` APIs in `src/`. `Bun.*` is allowed only in + runs on Node (`engines.node >= 22`). Use `node:*` APIs in `src/`. `Bun.*` is allowed only in `scripts/**`, `src/testing/**`, `**/*.test.*`, and `**/*-test-support.ts`. Generic Bun advice (Bun.serve, Bun.file, bun:sqlite, Bun.$) does **not** apply to shipped code. - **Two test runners.** Unit tests use `bun test` (`import { test, expect, describe } from "bun:test"`). diff --git a/README.md b/README.md index 07988524a..c5ded5b52 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ invoke agents from your terminal. ## Installation -You need Node.js 20.12 or later and AWS credentials configured as for the AWS CLI. Python templates +You need Node.js 22 or later and AWS credentials configured as for the AWS CLI. Python templates also need [`uv`](https://docs.astral.sh/uv/getting-started/installation/). ```bash diff --git a/package.json b/package.json index bf72be793..46671a513 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ }, "main": "./dist/index.js", "engines": { - "node": ">=20.12.0" + "node": ">=22" }, "files": [ "dist", diff --git a/src/io/source.test.ts b/src/io/source.test.ts index c29bfa662..3228c6dc7 100644 --- a/src/io/source.test.ts +++ b/src/io/source.test.ts @@ -109,8 +109,8 @@ describe("SourceResolver bytes", () => { child.stdin.end("late value"); const [code] = await once(child, "close"); - expect(code).toBe(0); expect(errors).toBe("READY\n"); + expect(code).toBe(0); expect(output).toBe("late value"); }, );