Skip to content

Commit e083794

Browse files
committed
feat: add support for Node.js 22
1 parent 6716eca commit e083794

File tree

17 files changed

+56
-51
lines changed

17 files changed

+56
-51
lines changed

.circleci/config.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ references:
1414
- image: cimg/node:<< parameters.node-version >>
1515
parameters:
1616
node-version:
17-
default: "18.19" # We default to the highest active LTS
17+
default: "20.12" # We default to the highest active LTS
1818
type: string
1919

2020
workspace_root: &workspace_root ~/project
@@ -157,29 +157,29 @@ workflows:
157157
name: build-v<< matrix.node-version >>
158158
matrix:
159159
parameters:
160-
node-version: [ "20.10", "18.19" ]
160+
node-version: [ "22.0", "20.12", "18.20" ]
161161
- test:
162162
requires:
163163
- build-v<< matrix.node-version >>
164164
name: test-v<< matrix.node-version >>
165165
matrix:
166166
parameters:
167-
node-version: [ "20.10", "18.19" ]
167+
node-version: [ "22.0", "20.12", "18.20" ]
168168
- lint:
169169
requires:
170170
- build-v<< matrix.node-version >>
171171
name: lint-v<< matrix.node-version >>
172172
matrix:
173173
parameters:
174-
node-version: [ "20.10", "18.19" ]
174+
node-version: [ "22.0", "20.12", "18.20" ]
175175
- release-please:
176176
filters:
177177
<<: *filters_only_main
178178
requires:
179179
# We release on the highest active LTS version of
180180
# Node.js that we support
181-
- test-v20.10
182-
- lint-v20.10
181+
- test-v20.12
182+
- lint-v20.12
183183

184184
build-test-publish:
185185
jobs:
@@ -189,7 +189,7 @@ workflows:
189189
name: build-v<< matrix.node-version >>
190190
matrix:
191191
parameters:
192-
node-version: [ "20.10", "18.19" ]
192+
node-version: [ "22.0", "20.12", "18.20" ]
193193
- test:
194194
filters:
195195
<<: *filters_release_build
@@ -198,7 +198,7 @@ workflows:
198198
name: test-v<< matrix.node-version >>
199199
matrix:
200200
parameters:
201-
node-version: [ "20.10", "18.19" ]
201+
node-version: [ "22.0", "20.12", "18.20" ]
202202
- lint:
203203
filters:
204204
<<: *filters_release_build
@@ -207,16 +207,16 @@ workflows:
207207
name: lint-v<< matrix.node-version >>
208208
matrix:
209209
parameters:
210-
node-version: [ "20.10", "18.19" ]
210+
node-version: [ "22.0", "20.12", "18.20" ]
211211
- publish:
212212
context: npm-publish-token
213213
filters:
214214
<<: *filters_release_build
215215
requires:
216216
# We release on the highest active LTS version of
217217
# Node.js that we support
218-
- lint-v20.10
219-
- test-v20.10
218+
- lint-v20.12
219+
- test-v20.12
220220

221221
build-test-prepublish:
222222
jobs:
@@ -226,7 +226,7 @@ workflows:
226226
name: build-v<< matrix.node-version >>
227227
matrix:
228228
parameters:
229-
node-version: [ "20.10", "18.19" ]
229+
node-version: [ "22.0", "20.12", "18.20" ]
230230
- test:
231231
filters:
232232
<<: *filters_prerelease_build
@@ -235,7 +235,7 @@ workflows:
235235
name: test-v<< matrix.node-version >>
236236
matrix:
237237
parameters:
238-
node-version: [ "20.10", "18.19" ]
238+
node-version: [ "22.0", "20.12", "18.20" ]
239239
- lint:
240240
filters:
241241
<<: *filters_prerelease_build
@@ -244,16 +244,16 @@ workflows:
244244
name: lint-v<< matrix.node-version >>
245245
matrix:
246246
parameters:
247-
node-version: [ "20.10", "18.19" ]
247+
node-version: [ "22.0", "20.12", "18.20" ]
248248
- prepublish:
249249
context: npm-publish-token
250250
filters:
251251
<<: *filters_prerelease_build
252252
requires:
253253
# We release on the highest active LTS version of
254254
# Node.js that we support
255-
- lint-v20.10
256-
- test-v20.10
255+
- lint-v20.12
256+
- test-v20.12
257257

258258
nightly:
259259
triggers:
@@ -267,12 +267,12 @@ workflows:
267267
name: build-v<< matrix.node-version >>
268268
matrix:
269269
parameters:
270-
node-version: [ "20.10", "18.19" ]
270+
node-version: [ "22.0", "20.12", "18.20" ]
271271
- test:
272272
requires:
273273
- build-v<< matrix.node-version >>
274274
context: next-nightly-build
275275
name: test-v<< matrix.node-version >>
276276
matrix:
277277
parameters:
278-
node-version: [ "20.10", "18.19" ]
278+
node-version: [ "22.0", "20.12", "18.20" ]

package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"typescript": "^5.3.3"
5050
},
5151
"engines": {
52-
"node": "18.x || 20.x",
52+
"node": "18.x || 20.x || 22.x",
5353
"npm": "8.x || 9.x || 10.x"
5454
},
5555
"volta": {

packages/app-info/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"bugs": "https://github.com/Financial-Times/dotcom-reliability-kit/issues?q=label:\"package: app-info\"",
1212
"license": "MIT",
1313
"engines": {
14-
"node": "18.x || 20.x",
14+
"node": "18.x || 20.x || 22.x",
1515
"npm": "8.x || 9.x || 10.x"
1616
},
1717
"main": "lib/index.js",

packages/crash-handler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"bugs": "https://github.com/Financial-Times/dotcom-reliability-kit/issues?q=label:\"package: crash-handler\"",
1212
"license": "MIT",
1313
"engines": {
14-
"node": "18.x || 20.x",
14+
"node": "18.x || 20.x || 22.x",
1515
"npm": "8.x || 9.x || 10.x"
1616
},
1717
"main": "lib",

packages/errors/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"bugs": "https://github.com/Financial-Times/dotcom-reliability-kit/issues?q=label:\"package: errors\"",
1212
"license": "MIT",
1313
"engines": {
14-
"node": "18.x || 20.x",
14+
"node": "18.x || 20.x || 22.x",
1515
"npm": "8.x || 9.x || 10.x"
1616
},
1717
"main": "lib"

packages/eslint-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"bugs": "https://github.com/Financial-Times/dotcom-reliability-kit/issues?q=label:\"package: eslint-config\"",
1212
"license": "MIT",
1313
"engines": {
14-
"node": "18.x || 20.x",
14+
"node": "18.x || 20.x || 22.x",
1515
"npm": "8.x || 9.x || 10.x"
1616
},
1717
"main": "lib/index.js",

packages/fetch-error-handler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"bugs": "https://github.com/Financial-Times/dotcom-reliability-kit/issues?q=label:\"package: fetch-error-handler\"",
1212
"license": "MIT",
1313
"engines": {
14-
"node": "18.x || 20.x",
14+
"node": "18.x || 20.x || 22.x",
1515
"npm": "8.x || 9.x || 10.x"
1616
},
1717
"main": "lib",

packages/log-error/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"bugs": "https://github.com/Financial-Times/dotcom-reliability-kit/issues?q=label:\"package: log-error\"",
1212
"license": "MIT",
1313
"engines": {
14-
"node": "18.x || 20.x",
14+
"node": "18.x || 20.x || 22.x",
1515
"npm": "8.x || 9.x || 10.x"
1616
},
1717
"main": "lib",

packages/logger/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"bugs": "https://github.com/Financial-Times/dotcom-reliability-kit/issues?q=label:\"package: logger\"",
1212
"license": "MIT",
1313
"engines": {
14-
"node": "18.x || 20.x",
14+
"node": "18.x || 20.x || 22.x",
1515
"npm": "8.x || 9.x || 10.x"
1616
},
1717
"main": "lib",

packages/logger/test/end-to-end/helpers/split-and-parse-json-logs.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@
77
* Returns the parsed JSON logs as an array of log objects.
88
*/
99
function splitAndParseJsonLogs(logString) {
10-
return logString
11-
.trim()
12-
.split(/\n+/g)
13-
.filter((log) => log.trim())
14-
.map((log) => JSON.parse(log));
10+
return (
11+
logString
12+
.trim()
13+
.split(/\n+/g)
14+
.filter((log) => log.trim())
15+
// Node.js sometimes logs deprecation warnings which are not valid JSON.
16+
// We need to filter these out so we don't error in our JSON.parse map
17+
.filter((log) => !log.toLowerCase().includes('deprecation'))
18+
.map((log) => JSON.parse(log))
19+
);
1520
}
1621

1722
module.exports = splitAndParseJsonLogs;

packages/middleware-log-errors/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"bugs": "https://github.com/Financial-Times/dotcom-reliability-kit/issues?q=label:\"package: middleware-log-errors\"",
1212
"license": "MIT",
1313
"engines": {
14-
"node": "18.x || 20.x",
14+
"node": "18.x || 20.x || 22.x",
1515
"npm": "8.x || 9.x || 10.x"
1616
},
1717
"main": "lib",

packages/middleware-render-error-info/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"bugs": "https://github.com/Financial-Times/dotcom-reliability-kit/issues?q=label:\"package: middleware-render-error-info\"",
1212
"license": "MIT",
1313
"engines": {
14-
"node": "18.x || 20.x",
14+
"node": "18.x || 20.x || 22.x",
1515
"npm": "8.x || 9.x || 10.x"
1616
},
1717
"main": "lib",

packages/opentelemetry/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"bugs": "https://github.com/Financial-Times/dotcom-reliability-kit/issues?q=label:\"package: opentelemetry\"",
1212
"license": "MIT",
1313
"engines": {
14-
"node": "18.x || 20.x",
14+
"node": "18.x || 20.x || 22.x",
1515
"npm": "8.x || 9.x || 10.x"
1616
},
1717
"main": "lib",

packages/serialize-error/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"bugs": "https://github.com/Financial-Times/dotcom-reliability-kit/issues?q=label:\"package: serialize-error\"",
1212
"license": "MIT",
1313
"engines": {
14-
"node": "18.x || 20.x",
14+
"node": "18.x || 20.x || 22.x",
1515
"npm": "8.x || 9.x || 10.x"
1616
},
1717
"main": "lib/index.js",

packages/serialize-request/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"bugs": "https://github.com/Financial-Times/dotcom-reliability-kit/issues?q=label:\"package: serialize-request\"",
1212
"license": "MIT",
1313
"engines": {
14-
"node": "18.x || 20.x",
14+
"node": "18.x || 20.x || 22.x",
1515
"npm": "8.x || 9.x || 10.x"
1616
},
1717
"main": "lib/index.js",

0 commit comments

Comments
 (0)