Skip to content

Commit 93cdaaa

Browse files
update node version (v18, v20, v22) (#833)
* chore: move from ts-node to swc-loader fix: integration tests fix: use swc for both v18 & v20 refactor: remove ts-node * ci: update CI to run tests for v18,v20,v22 fix: matrix on tests only chore: no parallelism ci: add node version 22 * fix: several tests & mocks test: fix mocked socket test: update thrown error message fix: update mocks fix: flaky test tests: load package.json via fs * fix: resolve mock-fs fix: update mock-fs tests: update override adaptor tests to use tmp-dir test: fix collections test * test: collection tests & flaky test * tests: fix date output in integration test * set node 22 and setup corepack on pnpm8 * update integration test matrix and use corepack * fix yaml * fix ndoe versions * worker: bump image to node 22 * cli: type fix * compiler: update test fixture with trivial diff * tests: tweak test matrix * runtime: await module import properly * cli: fix failing unit test * cli: skipped tests that are broken by mock fs * cli: try to make docgen test a bit more stable in CI Or at least fail better * cli: another attempt to stabilze docgen * cli: give up and skip the flaky test * cli: skip another flaky test * tests: remove logging * compiler: remove .only * versions: worker@1.8.7 cli@1.9.1 * worker: fix version number output * version: @openfn/ws-worker@1.8.8 * worker: typing * worker: fix package.json resolution * worker: typings * engine: update package json importer * version: worker@1.8.8 --------- Co-authored-by: Joe Clark <jclark@openfn.org>
1 parent 5b3e3e9 commit 93cdaaa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2554
-2696
lines changed

.circleci/config.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ 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:18.18
10+
- image: cimg/node:22.12
1111
resource_class: medium
1212
# Add steps to the job
1313
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
1414
steps:
1515
- run:
1616
name: Install pnpm
17-
command: sudo corepack enable && corepack prepare pnpm@8.6.9 --activate
17+
command: sudo corepack enable
1818
- checkout
1919
- restore_cache:
2020
# See the configuration reference documentation for more details on using restore_cache and save_cache steps
@@ -35,7 +35,7 @@ jobs:
3535

3636
build:
3737
docker:
38-
- image: cimg/node:18.18
38+
- image: cimg/node:22.12
3939
resource_class: medium
4040
steps:
4141
- attach_workspace:
@@ -50,8 +50,9 @@ jobs:
5050

5151
unit_test:
5252
docker:
53-
- image: cimg/node:18.18
53+
- image: cimg/node:22.12
5454
resource_class: medium
55+
parallelism: 1
5556
steps:
5657
- attach_workspace:
5758
at: ~/project
@@ -61,7 +62,7 @@ jobs:
6162

6263
format:
6364
docker:
64-
- image: cimg/node:18.18
65+
- image: cimg/node:22.12
6566
resource_class: medium
6667
steps:
6768
- attach_workspace:
@@ -72,7 +73,7 @@ jobs:
7273

7374
type_check:
7475
docker:
75-
- image: cimg/node:18.18
76+
- image: cimg/node:22.12
7677
resource_class: medium
7778
steps:
7879
- attach_workspace:
@@ -83,8 +84,12 @@ jobs:
8384

8485
integration_test:
8586
docker:
86-
- image: cimg/node:18.18
87+
- image: cimg/node:<< parameters.node_version >>
8788
resource_class: medium
89+
parallelism: 1
90+
parameters:
91+
node_version:
92+
type: string
8893
steps:
8994
- attach_workspace:
9095
at: ~/project
@@ -107,10 +112,10 @@ workflows:
107112
build_and_test:
108113
jobs:
109114
- install:
110-
filters:
111-
branches:
112-
ignore:
113-
- main
115+
filters:
116+
branches:
117+
ignore:
118+
- main
114119
- build:
115120
requires:
116121
- install
@@ -124,5 +129,10 @@ workflows:
124129
requires:
125130
- build
126131
- integration_test:
132+
matrix:
133+
parameters:
134+
# temporarily test against a range of versions while we get over teh 18x hump
135+
# We can reduce this later
136+
node_version: ['18.12.1', '18.18', '20.18.1', '22.12']
127137
requires:
128138
- build

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fetch-depth: 1
1414
- uses: actions/setup-node@v3
1515
with:
16-
node-version: '18.18'
16+
node-version: '22.12'
1717
- uses: pnpm/action-setup@v4
1818
with:
1919
version: 8

.tool-versions

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

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18-alpine AS base
1+
FROM node:22-alpine AS base
22
ENV PNPM_HOME="/pnpm"
33
ENV PATH="$PNPM_HOME:$PATH"
44
RUN corepack enable

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ We use [`pnpm`](https://pnpm.io/installation), a fast, disk space efficient pack
3939

4040
## Installing
4141

42-
- `$ pnpm run setup`
42+
This repo uses node corepack to ensure pnpm v8 is used.
43+
44+
- `$ corepack enable`
45+
- `$ pnpm install`
4346
- `$ pnpm build`
4447

4548
## Running Tests

ava.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
const semver = require("semver")
2+
3+
const loader_arg = semver.lte(process.version, 'v20.5.0') ? '--loader=@swc-node/register/esm' : '--import=@swc-node/register/esm-register'
14
module.exports = {
25
extensions: {
36
ts: 'module',
@@ -8,7 +11,7 @@ module.exports = {
811
},
912

1013
nodeArguments: [
11-
'--loader=ts-node/esm',
14+
loader_arg,
1215
'--no-warnings', // Disable experimental module warnings
1316
'--experimental-vm-modules',
1417
],

examples/dts-inspector/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# dts-inspector
22

3+
## 1.0.22
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @openfn/describe-package@0.1.4
9+
310
## 1.0.21
411

512
### Patch Changes

examples/dts-inspector/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dts-inspector",
3-
"version": "1.0.21",
3+
"version": "1.0.22",
44
"description": "",
55
"main": "index.js",
66
"type": "module",

integration-tests/cli/ava.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import semver from "semver"
2+
3+
const loader_arg = semver.lte(process.version, 'v20.5.0') ? '--loader=@swc-node/register/esm' : '--import=@swc-node/register/esm-register'
4+
15
export default {
26
extensions: {
37
ts: 'module',
@@ -7,7 +11,7 @@ export default {
711
TS_NODE_TRANSPILE_ONLY: 'true',
812
},
913

10-
nodeArguments: ['--loader=ts-node/esm', '--no-warnings'],
14+
nodeArguments: [loader_arg, '--no-warnings'],
1115

1216
files: ['test/**/*test.ts'],
1317
};

integration-tests/cli/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"ava": "5.3.1",
2020
"date-fns": "^2.30.0",
2121
"rimraf": "^3.0.2",
22-
"ts-node": "10.8.1",
2322
"tslib": "^2.4.0",
2423
"typescript": "^5.1.6"
2524
},

0 commit comments

Comments
 (0)