Skip to content

Commit 19c4e29

Browse files
authored
Merge pull request #47 from shiftcode/#45-upgrade-node
Upgrade to node 22
2 parents da43386 + 267e7ba commit 19c4e29

15 files changed

Lines changed: 132 additions & 46 deletions

File tree

.github/workflows/main.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,44 @@ jobs:
3434
with:
3535
skipOnCommitMsg: "[skip_build]"
3636
githubToken: ${{ secrets.GITHUB_TOKEN }}
37-
build:
37+
test:
3838
runs-on: ubuntu-latest
3939
needs: checkExecution
4040
# only execute if not skipped by commit message
4141
if: needs.checkExecution.outputs.shouldExecute == 'true'
42+
strategy:
43+
matrix:
44+
# Test with Node.js v20 and v22
45+
node:
46+
- 20
47+
- 22
48+
name: Node.js v${{ matrix.node }}
49+
steps:
50+
# checkout branch
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
with:
54+
# 0 indicates all history, because publish requires tag information
55+
fetch-depth: 0
56+
# we need privileged access to publish to protected branch
57+
token: ${{ secrets.GH_TOKEN_PUBLIC_REPO }}
58+
# setup node and dependency cache
59+
- name: Setup Node and NPM Cache
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version: ${{ matrix.node }}
63+
cache: 'npm'
64+
# install dependencies
65+
- name: Install
66+
run: HUSKY=0 npm ci
67+
# test
68+
- name: Test
69+
run: npm run test:ci
70+
build:
71+
runs-on: ubuntu-latest
72+
needs: [checkExecution, test]
73+
# only execute if not skipped by commit message
74+
if: needs.checkExecution.outputs.shouldExecute == 'true'
4275
steps:
4376
# checkout branch
4477
- name: Checkout
@@ -63,9 +96,6 @@ jobs:
6396
# lint
6497
- name: Lint
6598
run: npm run lint:ci
66-
# test
67-
- name: Test
68-
run: npm run test:ci
6999
# build
70100
- name: Build
71101
run: npm run build:ci

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.11.1
1+
lts/jod

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ We use lerna to manage the packages.
5252
## ES Version
5353
We support two runtimes: `node` and `latest browser versions`.
5454

55-
### Node 20
56-
Node 20 (which is also supported by AWS Lambda) supports [97%](https://node.green/#ES2022) of `es2022` features
55+
### Node 22
56+
Node 22 (which is also supported by AWS Lambda) supports [97%](https://node.green/#ES2022) of `es2022` features
5757
(no version supports 100%) and [100%](https://node.green/#ES2023) of `es2023` features.
5858
The only `es2022` feature that is currently not supported and needs a polyfill when using it is
5959
[RegExp Match Indices (shows up in flags)](https://node.green/#ES2022-features-RegExp-Match-Indices---hasIndices-----d--flag-) (see [2ality blog](https://2ality.com/2019/12/regexp-match-indices.html) for insights).

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@commitlint/config-angular": "^19.3.0",
2727
"@commitlint/prompt-cli": "^19.3.1",
2828
"@types/jest": "^29.5.12",
29-
"@types/node": "^20.11.1",
29+
"@types/node": "^22.15.0",
3030
"eslint": "^8.56.0",
3131
"husky": "^9.0.11",
3232
"jest": "^29.7.0",
@@ -37,6 +37,6 @@
3737
"typescript": "^5.5.3"
3838
},
3939
"engines": {
40-
"node": ">=20.11.1"
40+
"node": "^22.15.0"
4141
}
4242
}

packages/branch-utilities/jest.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
import {pathsToModuleNameMapper} from 'ts-jest'
2-
import tsConfig from './tsconfig.jest.json' assert {type: 'json'}
1+
/* eslint-env node,es2023 */
2+
/* eslint-disable import/no-extraneous-dependencies */
3+
import { pathsToModuleNameMapper } from 'ts-jest'
4+
import { readFileSync } from 'node:fs'
5+
6+
const tsConfig = JSON.parse(readFileSync('./tsconfig.jest.json', 'utf-8'))
37

48
export default {
59
testEnvironment: 'node',

packages/branch-utilities/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@shiftcode/branch-utilities",
3-
"version": "3.1.0",
3+
"version": "4.0.0-pr45.2",
44
"description": "Utilities for local and ci to get branch name and stage",
55
"repository": "https://github.com/shiftcode/sc-commons-public",
66
"license": "MIT",
@@ -31,6 +31,9 @@
3131
"peerDependencies": {
3232
"tslib": "^2.3.0"
3333
},
34+
"engines": {
35+
"node": "^20.0.0 || ^22.0.0"
36+
},
3437
"publishConfig": {
3538
"directory": "dist"
3639
}

packages/eslint-config-recommended/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@shiftcode/eslint-config-recommended",
3-
"version": "3.0.0",
3+
"version": "4.0.0-pr45.2",
44
"description": "default shiftcode config for eslint",
55
"repository": "https://github.com/shiftcode/sc-commons-public",
66
"license": "UNLICENSED",
@@ -36,7 +36,7 @@
3636
"test:ci": "npm run test"
3737
},
3838
"dependencies": {
39-
"@shiftcode/eslint-plugin-rules": "^3.0.0",
39+
"@shiftcode/eslint-plugin-rules": "^4.0.0-pr45.2",
4040
"@typescript-eslint/eslint-plugin": "^8.18.0",
4141
"@typescript-eslint/parser": "^8.18.0",
4242
"eslint": "^8.56.0",
@@ -68,6 +68,9 @@
6868
"optional": true
6969
}
7070
},
71+
"engines": {
72+
"node": "^20.0.0 || ^22.0.0"
73+
},
7174
"publishConfig": {
7275
"directory": "dist"
7376
}

packages/eslint-plugin-rules/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@shiftcode/eslint-plugin-rules",
3-
"version": "3.0.0",
3+
"version": "4.0.0-pr45.2",
44
"description": "eslint-rules for shiftcode-specific eslint rules",
55
"repository": "https://github.com/shiftcode/sc-commons-public",
66
"license": "UNLICENSED",
@@ -36,6 +36,9 @@
3636
"peerDependencies": {
3737
"eslint": "^8.56.0"
3838
},
39+
"engines": {
40+
"node": "^20.0.0 || ^22.0.0"
41+
},
3942
"publishConfig": {
4043
"directory": "dist"
4144
}

packages/logger/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-env node,es2023 */
2-
// eslint-disable-next-line import/no-extraneous-dependencies
2+
/* eslint-disable import/no-extraneous-dependencies */
33
import { pathsToModuleNameMapper } from 'ts-jest'
44
import { readFileSync } from 'node:fs'
55

0 commit comments

Comments
 (0)