Skip to content

Commit 2374112

Browse files
authored
chore(deps): drop Node 20 support, pin CI Node 24 for docs build (#817)
## Summary Node 20 reached EOL in April 2026. This PR drops it from the supported set and cleans up the Astro 6 engine-check workaround that #816 left in place. ## Changes ### `package.json` — tighten engines - `engines.node`: `>=22` → `>=22.12` (matches Astro 6 and reflects Node 20 EOL). ### `docs/package.json` — revert `bun --bun astro` workaround - Scripts are back to plain `astro dev / build / preview`. - #816 prefixed them with `bun --bun` only to route around the GHA runner's Node 20 shipping below Astro 6's `engines.node: ">=22.12"`. With a real Node pin in CI (below) and Node 24 locally, there's no reason to keep it. ### Workflows — pin Node 24 for docs jobs - `ci.yml` `Build Docs` and `docs-preview.yml` `preview` now both run `actions/setup-node@v6` with `node-version: "24"` before the docs build. - Dropped the `# works on Node < 22.12 …` comments. ### Unchanged - `Build npm Package` CI matrix stays at `["22", "24"]`. Node 22 is still LTS (EOL April 2027) and above the new 22.12 minimum. - Other jobs already pinning `node-version: 22` (release workflows) are fine as-is. ## Verification ```sh cd docs && rm -rf node_modules && bun install --frozen-lockfile && bun run build # 29 pages built in ~6s ```
1 parent 6607eec commit 2374112

6 files changed

Lines changed: 20 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,11 @@ jobs:
709709
steps:
710710
- uses: actions/checkout@v6
711711
- uses: oven-sh/setup-bun@v2
712+
# Astro 6 requires Node >= 22.12. Pin an explicit version so the docs
713+
# build doesn't rely on whatever ships on the runner image.
714+
- uses: actions/setup-node@v6
715+
with:
716+
node-version: "24"
712717
- uses: actions/cache@v5
713718
id: cache
714719
with:
@@ -736,9 +741,6 @@ jobs:
736741
PUBLIC_SENTRY_RELEASE: ${{ steps.version.outputs.version }}
737742
run: |
738743
bun install --frozen-lockfile
739-
# The `build` script itself invokes `bun --bun astro …` so this
740-
# works on Node < 22.12 (CI runners ship Node 20, but Astro 6's
741-
# `#!/usr/bin/env node` shebang trips the engine check).
742744
bun run build
743745
# Inject debug IDs and upload sourcemaps. The inject step adds
744746
# //# debugId= and the _sentryDebugIds IIFE to deployed JS files.

.github/workflows/docs-preview.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ jobs:
3535

3636
- uses: oven-sh/setup-bun@v2
3737

38+
# Astro 6 requires Node >= 22.12. Pin an explicit version so the docs
39+
# build doesn't rely on whatever ships on the runner image.
40+
- uses: actions/setup-node@v6
41+
with:
42+
node-version: "24"
43+
3844
- uses: actions/cache@v5
3945
id: cache
4046
with:
@@ -62,9 +68,6 @@ jobs:
6268
PUBLIC_SENTRY_RELEASE: ${{ steps.version.outputs.version }}
6369
run: |
6470
bun install --frozen-lockfile
65-
# The `build` script itself invokes `bun --bun astro …` so this
66-
# works on Node < 22.12 (CI runners ship Node 20, but Astro 6's
67-
# `#!/usr/bin/env node` shebang trips the engine check).
6871
bun run build
6972
7073
- name: Inject debug IDs and upload sourcemaps

.github/workflows/sentry-release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ jobs:
3434
with:
3535
fetch-depth: 0
3636

37-
# The sentry npm package requires Node.js >= 22 (ubuntu-latest ships 20).
37+
# The sentry npm package requires Node.js >= 22.12 — pin an explicit
38+
# version so this job doesn't depend on the runner image's default.
3839
- name: Setup Node.js
3940
uses: actions/setup-node@v6
4041
with:

docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"version": "1.0.0",
44
"private": true,
55
"scripts": {
6-
"dev": "bun --bun astro dev",
7-
"build": "bun --bun astro build",
8-
"preview": "bun --bun astro preview"
6+
"dev": "astro dev",
7+
"build": "astro build",
8+
"preview": "astro preview"
99
},
1010
"dependencies": {
1111
"@astrojs/starlight": "^0.38.3",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
},
5858
"description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5959
"engines": {
60-
"node": ">=22"
60+
"node": ">=22.12"
6161
},
6262
"files": [
6363
"dist/bin.cjs",

script/bundle.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,10 @@ const result = await build({
221221
plugins,
222222
});
223223

224-
// Write the CLI bin wrapper (tiny — shebang + version check + dispatch)
224+
// Write the CLI bin wrapper (tiny — shebang + version check + dispatch).
225+
// Version floor must track `engines.node` in package.json.
225226
const BIN_WRAPPER = `#!/usr/bin/env node
226-
if(parseInt(process.versions.node)<22){console.error("Error: sentry requires Node.js 22 or later (found "+process.version+").\\n\\nEither upgrade Node.js, or install the standalone binary instead:\\n curl -fsSL https://cli.sentry.dev/install | bash\\n");process.exit(1)}
227+
{let v=process.versions.node.split(".").map(Number);if(v[0]<22||(v[0]===22&&v[1]<12)){console.error("Error: sentry requires Node.js 22.12 or later (found "+process.version+").\\n\\nEither upgrade Node.js, or install the standalone binary instead:\\n curl -fsSL https://cli.sentry.dev/install | bash\\n");process.exit(1)}}
227228
{let e=process.emit;process.emit=function(n,...a){return n==="warning"?!1:e.apply(this,[n,...a])}}
228229
require('./index.cjs')._cli().catch(()=>{process.exitCode=1});
229230
`;

0 commit comments

Comments
 (0)