Skip to content

Commit 0f8038e

Browse files
kdaviduikpi-mono
andcommitted
chore: bump node from v18 to v24.19.0 (latest LTS)
Node 18 reached end of life in April 2025. This bumps all node version references to v24.19.0 (Krypton), the current active LTS. Why dev.yml can't just read .nvmrc: the Shopify 'dev' tool requires an explicit exact version in dev.yml (the 'version' field is required and used to run 'nvm install <version>'), so we can't eliminate it and rely on .nvmrc alone. .nvmrc uses the flexible major version 'v24' (for nvm users who want the latest patch automatically) while dev.yml pins the exact v24.19.0 that the dev tool installs. To enforce sync between these two files, a new 'check-node-version' CI job validates that the major version in .nvmrc matches the one in dev.yml on every PR. This catches drift even when contributors don't run 'dev up' locally (the dev tool does its own .nvmrc↔dev.yml check during 'dev up', but that only runs when someone remembers to run it). Co-authored-by: AI (Pi/GLM 5.2 Fast (Fireworks) [1m]) <noreply@pi.dev>
1 parent 7ff6d3b commit 0f8038e

5 files changed

Lines changed: 83 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 79 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,94 @@ on:
66
pull_request:
77

88
jobs:
9+
check-node-version:
10+
name: Node version sync
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 1
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Validate .nvmrc matches dev.yml
18+
run: |
19+
NVMRC_VERSION=$(tr -d 'v\n' < .nvmrc)
20+
# Expects dev.yml format:
21+
# - node:
22+
# version: vXX.YY.ZZ
23+
DEV_YML_RAW=$(grep -A3 '^\s*- node:' dev.yml | grep 'version:' | grep -oE 'v?[0-9]+\.[0-9]+\.[0-9]+' | head -1)
24+
DEV_YML_VERSION=$(echo "$DEV_YML_RAW" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
25+
26+
if [ -z "$NVMRC_VERSION" ]; then
27+
echo "::error::Could not parse version from .nvmrc"
28+
echo " .nvmrc contents: '$(cat .nvmrc)'"
29+
echo " dev.yml raw: '$DEV_YML_RAW'"
30+
exit 1
31+
fi
32+
33+
if [ -z "$DEV_YML_RAW" ]; then
34+
echo "::error::Could not find node version in dev.yml"
35+
echo " .nvmrc version: '$NVMRC_VERSION'"
36+
echo " Searched for: '- node:' followed by 'version:' line in dev.yml"
37+
echo " Relevant dev.yml lines:"
38+
grep -A3 'node:' dev.yml | sed 's/^/ /'
39+
exit 1
40+
fi
41+
42+
if [ -z "$DEV_YML_VERSION" ]; then
43+
echo "::error::dev.yml must specify a FULL Node version (X.Y.Z format)"
44+
echo ""
45+
echo "Found: '$DEV_YML_RAW'"
46+
echo ".nvmrc version: '$NVMRC_VERSION'"
47+
echo "Expected format: 'vX.Y.Z' (e.g., 'v24.19.0')"
48+
echo ""
49+
echo "The Shopify 'dev' tool requires a specific installable version,"
50+
echo "not just a major version like 'v24'. Nix needs the exact version"
51+
echo "to fetch from its package cache."
52+
exit 1
53+
fi
54+
55+
NVMRC_MAJOR=$(echo "$NVMRC_VERSION" | cut -d. -f1)
56+
DEV_YML_MAJOR=$(echo "$DEV_YML_VERSION" | cut -d. -f1)
57+
58+
if [ "$NVMRC_MAJOR" != "$DEV_YML_MAJOR" ]; then
59+
echo "::error::Node version mismatch between .nvmrc and dev.yml"
60+
echo ""
61+
echo "┌─────────────────────────────────────────────────────────────────┐"
62+
echo "│ IMPORTANT: This is NOT a configuration oversight! │"
63+
echo "│ │"
64+
echo "│ The Shopify 'dev' tool CANNOT read from .nvmrc - it requires │"
65+
echo "│ an explicit version. These files serve different tools: │"
66+
echo "│ • .nvmrc → used by nvm (flexible major version like 'v24') │"
67+
echo "│ • dev.yml → used by dev tool (needs exact version 'v24.x.x') │"
68+
echo "│ │"
69+
echo "│ Both files MUST be updated TOGETHER when changing Node version.│"
70+
echo "└─────────────────────────────────────────────────────────────────┘"
71+
echo ""
72+
echo "Current state:"
73+
echo " .nvmrc major version: v$NVMRC_MAJOR"
74+
echo " dev.yml major version: v$DEV_YML_MAJOR"
75+
echo ""
76+
echo "To fix: Update both files to use the same Node major version."
77+
exit 1
78+
fi
79+
80+
echo "✅ Node versions in sync (major version: v$NVMRC_MAJOR)"
81+
982
test:
1083
name: Test
1184
runs-on: ubuntu-latest
1285

1386
steps:
1487
- name: Checkout code
15-
uses: actions/checkout@v3
88+
uses: actions/checkout@v4
1689

1790
- name: Setup pnpm
1891
uses: pnpm/action-setup@v4
1992

2093
- name: Setup Node.js
21-
uses: actions/setup-node@v3
94+
uses: actions/setup-node@v4
2295
with:
23-
node-version: '18'
96+
node-version: '24'
2497
cache: 'pnpm'
2598

2699
- name: Install dependencies
@@ -45,15 +118,15 @@ jobs:
45118

46119
steps:
47120
- name: Checkout code
48-
uses: actions/checkout@v3
121+
uses: actions/checkout@v4
49122

50123
- name: Setup pnpm
51124
uses: pnpm/action-setup@v4
52125

53126
- name: Setup Node.js
54-
uses: actions/setup-node@v3
127+
uses: actions/setup-node@v4
55128
with:
56-
node-version: '18'
129+
node-version: '24'
57130
cache: 'pnpm'
58131

59132
- name: Install dependencies

.github/workflows/npm-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Setup Node.js
3232
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3333
with:
34-
node-version: "18.20"
34+
node-version: "24"
3535
cache: 'pnpm'
3636

3737
- name: Install dependencies

.github/workflows/snapit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Setup Node.js
2525
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2626
with:
27-
node-version: '18'
27+
node-version: '24'
2828
cache: 'pnpm'
2929

3030
- name: Install dependencies

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18.20.0
1+
v24

dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: buy-button-js
33

44
up:
55
- node:
6-
version: v18.20.0
6+
version: v24.19.0 # .nvmrc uses 'v24' for nvm flexibility; dev tool needs specific version
77
pnpm: 10.16.1
88

99
commands:

0 commit comments

Comments
 (0)