Skip to content

Commit d97be13

Browse files
authored
Update to Node 24 (#1331)
* version * update asdf * bump pnpm * update CI versions * increase cli test timeout * runtime: tweak linker to prefer ESM support * runtime: even better exports tracking After working with claude and closely tracking the docs * skip tests which won#t run on node24 * update tests * update tests * remove lightning mock stuff * Node24: add custom module loader for back-compat with older modules (#1343) * add a custom module loader to handle older imports without .js extensions * types * typo * fix module loader path * fix module import and update tests * use esmhook in metadata * remove stupid logging * remove debug flag from tests * add more mock paths * fix test * update module path * format * use unidici fetch, not native fetch Hoping this will fix failures in CI * types * tests: fix error messages
1 parent 002869e commit d97be13

File tree

27 files changed

+140
-129
lines changed

27 files changed

+140
-129
lines changed

.changeset/plain-taxis-prove.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@openfn/runtime': minor
3+
---
4+
5+
- Enable full compatibility with node 24
6+
- When loading modules, prefer ESM targets over CJS targets

.circleci/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
88
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
99
docker:
10-
- image: cimg/node:22.20
10+
- image: cimg/node:24.14
1111
resource_class: medium
1212
# Add steps to the job
1313
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
@@ -35,7 +35,7 @@ jobs:
3535

3636
build:
3737
docker:
38-
- image: cimg/node:22.20
38+
- image: cimg/node:24.14
3939
resource_class: medium
4040
steps:
4141
- attach_workspace:
@@ -50,7 +50,7 @@ jobs:
5050

5151
unit_test:
5252
docker:
53-
- image: cimg/node:22.20
53+
- image: cimg/node:24.14
5454
resource_class: medium
5555
parallelism: 1
5656
steps:
@@ -62,7 +62,7 @@ jobs:
6262

6363
format:
6464
docker:
65-
- image: cimg/node:22.20
65+
- image: cimg/node:24.14
6666
resource_class: medium
6767
steps:
6868
- attach_workspace:
@@ -73,7 +73,7 @@ jobs:
7373

7474
type_check:
7575
docker:
76-
- image: cimg/node:22.20
76+
- image: cimg/node:24.14
7777
resource_class: medium
7878
steps:
7979
- attach_workspace:
@@ -131,6 +131,6 @@ workflows:
131131
- integration_test:
132132
matrix:
133133
parameters:
134-
node_version: ['22.20']
134+
node_version: ['22.20', '24.14.0']
135135
requires:
136136
- build

.github/workflows/project-integration-tests.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
runs-on: ubuntu-latest
1515
if: github.event_name != 'pull_request' || github.event.label.name == 'run_project_tests'
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v6
1818
- name: Checkout Integration Test Repo
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v6
2020
with:
2121
repository: openfn/project-integration-tests
2222
path: resources/repo
23-
- uses: actions/setup-node@v3
23+
- uses: actions/setup-node@v6
2424
with:
25-
node-version: '22.12'
25+
node-version: '24.14'
2626
- uses: pnpm/action-setup@v4
2727
- run: pnpm install
2828
- run: pnpm install:openfnx

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fetch-depth: 1
1616
- uses: actions/setup-node@v6
1717
with:
18-
node-version: '22.12'
18+
node-version: '24.14'
1919
- uses: pnpm/action-setup@v4
2020
- run: pnpm install
2121
- run: pnpm build

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nodejs 22.12.0
1+
nodejs 24.14.0

integration-tests/cli/modules/test/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@openfn/language-test",
33
"version": "0.0.1",
44
"type": "module",
5-
"module": "index.js",
5+
"main": "index.js",
66
"private": true,
77
"devDependencies": {}
88
}

integration-tests/cli/test/autoinstall.test.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,22 @@ test.serial(
7979
}
8080
);
8181

82+
/***
83+
* Important: these tests are skipped because the old @openfn/language-testing package,
84+
* which has been deprecated and removed from adaptors repo, depends on a version of
85+
* language-common which just happens to be incompatible with node24
86+
*
87+
* Since the pre-release stuff is sitting unreleased these tests will just sit on skipped
88+
* We should work out how to build a new version of this package (not in the adaptors repo)
89+
* And probably remove the common dependency
90+
*/
91+
8292
// Ignore the @next version if present but we asked for latest
83-
test.serial(
93+
test.serial.skip(
8494
`openfn ${jobsPath}/simple.js -a testing@latest ${repoDir} ${log}`,
8595
async (t) => {
8696
const { stdout, err } = await run(t.title);
97+
console.log(stdout);
8798

8899
// t.falsy(err); // TODO I think this is a broken adaptor build?
89100
t.regex(stdout, /Auto-installing language adaptors/);
@@ -109,7 +120,7 @@ test.serial(
109120
);
110121

111122
// Ignore @next if present but we asked for no version
112-
test.serial(
123+
test.serial.skip(
113124
`openfn ${jobsPath}/simple.js -a testing ${repoDir} ${log}`,
114125
async (t) => {
115126
const { stdout, err } = await run(t.title);
@@ -126,7 +137,7 @@ test.serial(
126137

127138
// TODO we need to fix the version of testing
128139
// maybe after release we can push next onto 2.0 and leave latest on 1.0
129-
test.serial(
140+
test.serial.skip(
130141
`openfn ${jobsPath}/simple.js -a testing@next ${repoDir} ${log}`,
131142
async (t) => {
132143
const { stdout, stderr } = await run(t.title);

integration-tests/cli/test/deploy.v2.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ test.serial('pull a project', async (t) => {
140140
t.regex(yaml, /id\: test-project/);
141141
});
142142

143-
test.serial.only('pull, change and re-deploy', async (t) => {
143+
test.serial('pull, change and re-deploy', async (t) => {
144144
const projectId = 'aaaaaaaa';
145145
server.addProject(makeProject(projectId) as any);
146146

integration-tests/cli/test/errors.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ test.serial('job with reference error', async (t) => {
158158
'ref aborted with error (SSSms)',
159159
`TypeError: Cannot read properties of undefined (reading 'y')
160160
at vm:module(0):1:23
161-
@openfn/language-common_2.1.1/dist/index.cjs:333:12`,
161+
@openfn/language-common_2.1.1/dist/index.js:270:12`,
162162
'Error occurred at: ref',
163163
'1: fn((state) => state.x.y)',
164164
' ^ ',
@@ -178,7 +178,7 @@ test.serial('job with not a function error', async (t) => {
178178
'not-function aborted with error (SSSms)',
179179
`TypeError: state is not a function
180180
at vm:module(0):1:15
181-
@openfn/language-common_2.1.1/dist/index.cjs:333:12`,
181+
@openfn/language-common_2.1.1/dist/index.js:270:12`,
182182
'Error occurred at: not-function',
183183
'1: fn((state) => state())',
184184
' ^ ',
@@ -198,7 +198,7 @@ test.serial('job with assign-to-const error', async (t) => {
198198
'assign-const aborted with error (SSSms)',
199199
`TypeError: Assignment to constant variable.
200200
at vm:module(0):1:33
201-
@openfn/language-common_2.1.1/dist/index.cjs:333:12`,
201+
@openfn/language-common_2.1.1/dist/index.js:270:12`,
202202
'Error occurred at: assign-const',
203203
'1: fn((state) => { const x = 10; x = 20; })',
204204
' ^ ',
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 24.14.0

0 commit comments

Comments
 (0)