Skip to content

Commit 220bfc3

Browse files
authored
chore(cli)!: Require node >=22.13 (#2256)
1 parent 6d795d0 commit 220bfc3

File tree

13 files changed

+1011
-337
lines changed

13 files changed

+1011
-337
lines changed

.github/workflows/build-js.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
ref: ${{ inputs.ref }}
4343

4444
- name: Setup node.js
45-
uses: actions/setup-node@v3.6.0
45+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
4646
with:
47-
node-version: ">=18.15 <19"
47+
node-version: ">=22.13 <23"
4848
check-latest: true
4949
cache: "npm"
5050

.github/workflows/build-native.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
ref: ${{ inputs.ref }}
4343

4444
- name: Setup node.js
45-
uses: actions/setup-node@v3.6.0
45+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
4646
with:
47-
node-version: ">=18.15 <19"
47+
node-version: ">=22.13 <23"
4848
check-latest: true
4949
cache: "npm"
5050

.github/workflows/dependencies.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ jobs:
2828
# we won't run esy in that case and we can defer setting it up until building grain
2929
- name: Setup node.js
3030
if: steps.esy-cache.outputs.cache-hit != 'true'
31-
uses: actions/setup-node@v3.6.0
31+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
3232
with:
33-
node-version: ">=18.15 <19"
33+
node-version: ">=22.13 <23"
3434
check-latest: true
3535
cache: "npm"
3636

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ jobs:
9494

9595
# Many of these steps are the same as building the compiler for tests
9696
- name: Setup Node.js
97-
uses: actions/setup-node@v3.6.0
97+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
9898
with:
99-
node-version: ">=18.15 <19"
99+
node-version: ">=22.13 <23"
100100
check-latest: true
101101
cache: "npm"
102102

@@ -164,9 +164,9 @@ jobs:
164164
runs-on: ubuntu-latest
165165
steps:
166166
- name: Setup NodeJS
167-
uses: actions/setup-node@v3.6.0
167+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
168168
with:
169-
node-version: ">=18.15 <19"
169+
node-version: ">=22.13 <23"
170170
check-latest: true
171171
registry-url: "https://registry.npmjs.org"
172172

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.13.1

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This Dockerfile constructs an environment in which the Grain compiler can be built and used.
22

3-
FROM ospencer/esy:alpine as esy
4-
FROM node:18
3+
FROM ospencer/esy:alpine AS esy
4+
FROM node:22
55

66
LABEL name="Grain"
77
LABEL description="Grain CLI"

Dockerfile-slim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# This Dockerfile constructs a minimal environment in which Grain programs can be compiled.
22
# The environment is only meant to build Grain programs, not develop the compiler.
33

4-
FROM ospencer/esy:alpine as esy
5-
FROM node:18 as builder
4+
FROM ospencer/esy:alpine AS esy
5+
FROM node:22 AS builder
66

77
LABEL name="Grain"
88
LABEL description="Grain CLI"
@@ -31,7 +31,7 @@ RUN npm run compiler build \
3131
# Remove build files
3232
&& rm -rf compiler/_esy
3333

34-
FROM node:18-slim
34+
FROM node:22-slim
3535

3636
COPY --from=builder /grain /grain
3737
WORKDIR /grain

cli/bin/grainrun.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
require("./pkg");
22

3-
// https://github.com/grain-lang/grain/issues/1816
4-
const v8 = require("v8");
5-
/* From the Node.js docs:
6-
*
7-
* The v8.setFlagsFromString() method can be used to programmatically set V8 command-line flags.
8-
* This method should be used with care. Changing settings after the VM has started may result
9-
* in unpredictable behavior, including crashes and data loss; or it may simply do nothing.
10-
*
11-
* This is valid in Node 18, 19, 20, and 21.
12-
*/
13-
if (process.version.match(/^v(18|19|20|21)\./))
14-
v8.setFlagsFromString("--experimental-wasm-return-call");
15-
163
const { readFile } = require("fs/promises");
174
const { WASI } = require("wasi");
185
const { argv, env } = require("process");

cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "A command line tool for the Grain language.",
55
"main": "index.js",
66
"engines": {
7-
"node": ">=18.15"
7+
"node": ">=22.13"
88
},
99
"scripts": {
1010
"clean": "del-cli \"bin/*.exe\" \"bin/*.bc.js\"",
@@ -38,7 +38,7 @@
3838
"commander": "^8.1.0"
3939
},
4040
"devDependencies": {
41-
"@phated/pkg": "5.9.1-grain",
41+
"@grain/pkg": "6.5.0",
4242
"del-cli": "^4.0.1",
4343
"prettier": "^2.3.2"
4444
}

compiler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"grainc": "_esy/default/build/install/default/bin/grainc"
77
},
88
"engines": {
9-
"node": ">=18.15"
9+
"node": ">=22.13"
1010
},
1111
"devDependencies": {
1212
"esy": "0.6.12",

0 commit comments

Comments
 (0)