diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f2fdba8..fbb0458 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,11 +34,44 @@ jobs: with: skipOnCommitMsg: "[skip_build]" githubToken: ${{ secrets.GITHUB_TOKEN }} - build: + test: runs-on: ubuntu-latest needs: checkExecution # only execute if not skipped by commit message if: needs.checkExecution.outputs.shouldExecute == 'true' + strategy: + matrix: + # Test with Node.js v20 and v22 + node: + - 20 + - 22 + name: Node.js v${{ matrix.node }} + steps: + # checkout branch + - name: Checkout + uses: actions/checkout@v4 + with: + # 0 indicates all history, because publish requires tag information + fetch-depth: 0 + # we need privileged access to publish to protected branch + token: ${{ secrets.GH_TOKEN_PUBLIC_REPO }} + # setup node and dependency cache + - name: Setup Node and NPM Cache + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: 'npm' + # install dependencies + - name: Install + run: HUSKY=0 npm ci + # test + - name: Test + run: npm run test:ci + build: + runs-on: ubuntu-latest + needs: [checkExecution, test] + # only execute if not skipped by commit message + if: needs.checkExecution.outputs.shouldExecute == 'true' steps: # checkout branch - name: Checkout @@ -63,9 +96,6 @@ jobs: # lint - name: Lint run: npm run lint:ci - # test - - name: Test - run: npm run test:ci # build - name: Build run: npm run build:ci diff --git a/.nvmrc b/.nvmrc index ee09fac..deed13c 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v20.11.1 +lts/jod diff --git a/README.md b/README.md index 47cd71b..0e97930 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,8 @@ We use lerna to manage the packages. ## ES Version We support two runtimes: `node` and `latest browser versions`. -### Node 20 -Node 20 (which is also supported by AWS Lambda) supports [97%](https://node.green/#ES2022) of `es2022` features +### Node 22 +Node 22 (which is also supported by AWS Lambda) supports [97%](https://node.green/#ES2022) of `es2022` features (no version supports 100%) and [100%](https://node.green/#ES2023) of `es2023` features. The only `es2022` feature that is currently not supported and needs a polyfill when using it is [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). diff --git a/package-lock.json b/package-lock.json index de42c6a..4f548d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@commitlint/config-angular": "^19.3.0", "@commitlint/prompt-cli": "^19.3.1", "@types/jest": "^29.5.12", - "@types/node": "^20.11.1", + "@types/node": "^22.15.0", "eslint": "^8.56.0", "husky": "^9.0.11", "jest": "^29.7.0", @@ -29,7 +29,7 @@ "typescript": "^5.5.3" }, "engines": { - "node": ">=20.11.1" + "node": "^22.15.0" } }, "node_modules/@ampproject/remapping": { @@ -3075,12 +3075,13 @@ "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==" }, "node_modules/@types/node": { - "version": "20.17.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.46.tgz", - "integrity": "sha512-0PQHLhZPWOxGW4auogW0eOQAuNIlCYvibIpG67ja0TOJ6/sehu+1en7sfceUn+QQtx4Rk3GxbLNwPh0Cav7TWw==", + "version": "22.15.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.17.tgz", + "integrity": "sha512-wIX2aSZL5FE+MR0JlvF87BNVrtFWf6AE6rxSE9X7OwnVvoyCQjpzSRJ+M87se/4QCkCiebQAqrJ0y6fwIyi7nw==", "dev": true, + "license": "MIT", "dependencies": { - "undici-types": "~6.19.2" + "undici-types": "~6.21.0" } }, "node_modules/@types/normalize-package-data": { @@ -14288,10 +14289,11 @@ } }, "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", - "dev": true + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" }, "node_modules/unicorn-magic": { "version": "0.1.0", @@ -14834,18 +14836,21 @@ }, "packages/branch-utilities": { "name": "@shiftcode/branch-utilities", - "version": "3.1.0", + "version": "4.0.0-pr45.2", "license": "MIT", + "engines": { + "node": "^20.0.0 || ^22.0.0" + }, "peerDependencies": { "tslib": "^2.3.0" } }, "packages/eslint-config-recommended": { "name": "@shiftcode/eslint-config-recommended", - "version": "3.0.0", + "version": "4.0.0-pr45.2", "license": "UNLICENSED", "dependencies": { - "@shiftcode/eslint-plugin-rules": "^3.0.0", + "@shiftcode/eslint-plugin-rules": "^4.0.0-pr45.2", "@typescript-eslint/eslint-plugin": "^8.18.0", "@typescript-eslint/parser": "^8.18.0", "eslint": "^8.56.0", @@ -14853,6 +14858,9 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-unused-imports": "^4.1.4" }, + "engines": { + "node": "^20.0.0 || ^22.0.0" + }, "peerDependencies": { "@angular-eslint/builder": "^19.0.0", "@angular-eslint/eslint-plugin": "^19.0.0", @@ -14880,7 +14888,7 @@ }, "packages/eslint-plugin-rules": { "name": "@shiftcode/eslint-plugin-rules", - "version": "3.0.0", + "version": "4.0.0-pr45.2", "license": "UNLICENSED", "dependencies": { "@eslint/eslintrc": "^2.1.4", @@ -14890,21 +14898,30 @@ "@typescript-eslint/parser": "^8.18.0", "@typescript-eslint/rule-tester": "^8.18.0" }, + "engines": { + "node": "^20.0.0 || ^22.0.0" + }, "peerDependencies": { "eslint": "^8.56.0" } }, "packages/logger": { "name": "@shiftcode/logger", - "version": "1.1.0", + "version": "2.0.0-pr45.2", "license": "UNLICENSED", + "devDependencies": { + "@shiftcode/utilities": "^4.0.0-pr45.2" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0" + }, "peerDependencies": { - "@shiftcode/utilities": "^3.0.0 || ^3.0.0-pr28.3" + "@shiftcode/utilities": "^4.0.0 || ^4.0.0-pr45" } }, "packages/publish-helper": { "name": "@shiftcode/publish-helper", - "version": "3.1.0", + "version": "4.0.0-pr45.2", "license": "MIT", "dependencies": { "conventional-changelog-angular": "^8.0.0", @@ -14915,11 +14932,14 @@ "publish-lib": "dist/publish-lib.js" }, "devDependencies": { - "@shiftcode/branch-utilities": "^3.1.0", + "@shiftcode/branch-utilities": "^4.0.0-pr45.2", "@types/yargs": "^17.0.32" }, + "engines": { + "node": "^20.0.0 || ^22.0.0" + }, "peerDependencies": { - "@shiftcode/branch-utilities": "^3.0.0 || ^3.0.0-pr28", + "@shiftcode/branch-utilities": "^4.0.0 || ^4.0.0-pr45", "lerna": "^8.1.6", "tslib": "^2.3.0" } @@ -14937,8 +14957,11 @@ }, "packages/utilities": { "name": "@shiftcode/utilities", - "version": "3.0.0", + "version": "4.0.0-pr45.2", "license": "MIT", + "engines": { + "node": "^20.0.0 || ^22.0.0" + }, "peerDependencies": { "tslib": "^2.3.0" } diff --git a/package.json b/package.json index 02f65b8..17ba8b8 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@commitlint/config-angular": "^19.3.0", "@commitlint/prompt-cli": "^19.3.1", "@types/jest": "^29.5.12", - "@types/node": "^20.11.1", + "@types/node": "^22.15.0", "eslint": "^8.56.0", "husky": "^9.0.11", "jest": "^29.7.0", @@ -37,6 +37,6 @@ "typescript": "^5.5.3" }, "engines": { - "node": ">=20.11.1" + "node": "^22.15.0" } } diff --git a/packages/branch-utilities/jest.config.js b/packages/branch-utilities/jest.config.js index 78ad18a..684e4a1 100644 --- a/packages/branch-utilities/jest.config.js +++ b/packages/branch-utilities/jest.config.js @@ -1,5 +1,9 @@ -import {pathsToModuleNameMapper} from 'ts-jest' -import tsConfig from './tsconfig.jest.json' assert {type: 'json'} +/* eslint-env node,es2023 */ +/* eslint-disable import/no-extraneous-dependencies */ +import { pathsToModuleNameMapper } from 'ts-jest' +import { readFileSync } from 'node:fs' + +const tsConfig = JSON.parse(readFileSync('./tsconfig.jest.json', 'utf-8')) export default { testEnvironment: 'node', diff --git a/packages/branch-utilities/package.json b/packages/branch-utilities/package.json index a19c9b4..79ffbfe 100644 --- a/packages/branch-utilities/package.json +++ b/packages/branch-utilities/package.json @@ -1,6 +1,6 @@ { "name": "@shiftcode/branch-utilities", - "version": "3.1.0", + "version": "4.0.0-pr45.2", "description": "Utilities for local and ci to get branch name and stage", "repository": "https://github.com/shiftcode/sc-commons-public", "license": "MIT", @@ -31,6 +31,9 @@ "peerDependencies": { "tslib": "^2.3.0" }, + "engines": { + "node": "^20.0.0 || ^22.0.0" + }, "publishConfig": { "directory": "dist" } diff --git a/packages/eslint-config-recommended/package.json b/packages/eslint-config-recommended/package.json index 442f707..20447c5 100644 --- a/packages/eslint-config-recommended/package.json +++ b/packages/eslint-config-recommended/package.json @@ -1,6 +1,6 @@ { "name": "@shiftcode/eslint-config-recommended", - "version": "3.0.0", + "version": "4.0.0-pr45.2", "description": "default shiftcode config for eslint", "repository": "https://github.com/shiftcode/sc-commons-public", "license": "UNLICENSED", @@ -36,7 +36,7 @@ "test:ci": "npm run test" }, "dependencies": { - "@shiftcode/eslint-plugin-rules": "^3.0.0", + "@shiftcode/eslint-plugin-rules": "^4.0.0-pr45.2", "@typescript-eslint/eslint-plugin": "^8.18.0", "@typescript-eslint/parser": "^8.18.0", "eslint": "^8.56.0", @@ -68,6 +68,9 @@ "optional": true } }, + "engines": { + "node": "^20.0.0 || ^22.0.0" + }, "publishConfig": { "directory": "dist" } diff --git a/packages/eslint-plugin-rules/package.json b/packages/eslint-plugin-rules/package.json index 76e2b49..6ec1896 100644 --- a/packages/eslint-plugin-rules/package.json +++ b/packages/eslint-plugin-rules/package.json @@ -1,6 +1,6 @@ { "name": "@shiftcode/eslint-plugin-rules", - "version": "3.0.0", + "version": "4.0.0-pr45.2", "description": "eslint-rules for shiftcode-specific eslint rules", "repository": "https://github.com/shiftcode/sc-commons-public", "license": "UNLICENSED", @@ -36,6 +36,9 @@ "peerDependencies": { "eslint": "^8.56.0" }, + "engines": { + "node": "^20.0.0 || ^22.0.0" + }, "publishConfig": { "directory": "dist" } diff --git a/packages/logger/jest.config.js b/packages/logger/jest.config.js index a67eb3e..bf4a5d7 100644 --- a/packages/logger/jest.config.js +++ b/packages/logger/jest.config.js @@ -1,5 +1,5 @@ /* eslint-env node,es2023 */ -// eslint-disable-next-line import/no-extraneous-dependencies +/* eslint-disable import/no-extraneous-dependencies */ import { pathsToModuleNameMapper } from 'ts-jest' import { readFileSync } from 'node:fs' diff --git a/packages/logger/package.json b/packages/logger/package.json index b856342..8979115 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -1,6 +1,6 @@ { "name": "@shiftcode/logger", - "version": "1.1.0", + "version": "2.0.0-pr45.2", "description": "logger for local and aws lambda execution", "repository": "https://github.com/shiftcode/sc-commons-public", "license": "UNLICENSED", @@ -34,8 +34,14 @@ "test:ci": "npm run test", "test:watch": "npm run test -- --watch" }, + "devDependencies": { + "@shiftcode/utilities": "^4.0.0-pr45.2" + }, "peerDependencies": { - "@shiftcode/utilities": "^3.0.0 || ^3.0.0-pr28.3" + "@shiftcode/utilities": "^4.0.0 || ^4.0.0-pr45" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0" }, "publishConfig": { "directory": "dist" diff --git a/packages/publish-helper/jest.config.js b/packages/publish-helper/jest.config.js index 367c99f..2d5dba7 100644 --- a/packages/publish-helper/jest.config.js +++ b/packages/publish-helper/jest.config.js @@ -1,5 +1,9 @@ -import {pathsToModuleNameMapper} from 'ts-jest' -import tsConfig from './tsconfig.jest.json' assert {type: 'json'} +/* eslint-env node,es2023 */ +/* eslint-disable import/no-extraneous-dependencies */ +import { pathsToModuleNameMapper } from 'ts-jest' +import { readFileSync } from 'node:fs' + +const tsConfig = JSON.parse(readFileSync('./tsconfig.jest.json', 'utf-8')) export default { testEnvironment: 'node', diff --git a/packages/publish-helper/package.json b/packages/publish-helper/package.json index 6bd4442..3b4e511 100644 --- a/packages/publish-helper/package.json +++ b/packages/publish-helper/package.json @@ -1,6 +1,6 @@ { "name": "@shiftcode/publish-helper", - "version": "3.1.0", + "version": "4.0.0-pr45.2", "description": "scripts for conventional (pre)releases", "repository": "https://github.com/shiftcode/sc-commons-public", "license": "MIT", @@ -30,14 +30,17 @@ "yargs": "^17.7.2" }, "devDependencies": { - "@shiftcode/branch-utilities": "^3.1.0", + "@shiftcode/branch-utilities": "^4.0.0-pr45.2", "@types/yargs": "^17.0.32" }, "peerDependencies": { - "@shiftcode/branch-utilities": "^3.0.0 || ^3.0.0-pr28", + "@shiftcode/branch-utilities": "^4.0.0 || ^4.0.0-pr45", "lerna": "^8.1.6", "tslib": "^2.3.0" }, + "engines": { + "node": "^20.0.0 || ^22.0.0" + }, "publishConfig": { "directory": "dist" } diff --git a/packages/utilities/jest.config.js b/packages/utilities/jest.config.js index ac2a165..ffa6f9c 100644 --- a/packages/utilities/jest.config.js +++ b/packages/utilities/jest.config.js @@ -1,5 +1,9 @@ -import {pathsToModuleNameMapper} from 'ts-jest' -import tsConfig from './tsconfig.jest.json' assert {type: 'json'} +/* eslint-env node,es2023 */ +/* eslint-disable import/no-extraneous-dependencies */ +import { pathsToModuleNameMapper } from 'ts-jest' +import { readFileSync } from 'node:fs' + +const tsConfig = JSON.parse(readFileSync('./tsconfig.jest.json', 'utf-8')) export default { testEnvironment: 'node', diff --git a/packages/utilities/package.json b/packages/utilities/package.json index 778c4d0..651d545 100644 --- a/packages/utilities/package.json +++ b/packages/utilities/package.json @@ -1,6 +1,6 @@ { "name": "@shiftcode/utilities", - "version": "3.0.0", + "version": "4.0.0-pr45.2", "description": "Contains some utilities", "repository": "https://github.com/shiftcode/sc-commons-public", "license": "MIT", @@ -31,6 +31,9 @@ "peerDependencies": { "tslib": "^2.3.0" }, + "engines": { + "node": "^20.0.0 || ^22.0.0" + }, "publishConfig": { "directory": "dist" }