From 69342ffc8a3fd88e7ddedda5450df5435e0f3347 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Fri, 15 Sep 2023 10:29:57 -0700 Subject: [PATCH] chore: set workspace engines This align all private workspaces to the same engines as the CLI and all public workspaces to ^16.14.0 || >=18.0.0 --- .github/workflows/ci-libnpmfund.yml | 4 +--- .github/workflows/ci-npmcli-config.yml | 4 +--- .github/workflows/ci-npmcli-mock-globals.yml | 5 ++--- .github/workflows/ci-npmcli-mock-registry.yml | 5 ++--- docs/package.json | 2 +- mock-globals/package.json | 2 +- mock-registry/package.json | 2 +- package-lock.json | 10 +++++----- scripts/template-oss/pkg.json | 14 ++++++++++++++ scripts/template-oss/root.js | 7 ++++++- 10 files changed, 34 insertions(+), 21 deletions(-) create mode 100644 scripts/template-oss/pkg.json diff --git a/.github/workflows/ci-libnpmfund.yml b/.github/workflows/ci-libnpmfund.yml index 6fffd304b2ce7..55c5523b7df6e 100644 --- a/.github/workflows/ci-libnpmfund.yml +++ b/.github/workflows/ci-libnpmfund.yml @@ -111,9 +111,7 @@ jobs: os: windows-latest shell: cmd node-version: - - 14.17.0 - - 14.x - - 16.13.0 + - 16.14.0 - 16.x - 18.0.0 - 18.x diff --git a/.github/workflows/ci-npmcli-config.yml b/.github/workflows/ci-npmcli-config.yml index 78028cd68e818..569e3ad51686f 100644 --- a/.github/workflows/ci-npmcli-config.yml +++ b/.github/workflows/ci-npmcli-config.yml @@ -111,9 +111,7 @@ jobs: os: windows-latest shell: cmd node-version: - - 14.17.0 - - 14.x - - 16.13.0 + - 16.14.0 - 16.x - 18.0.0 - 18.x diff --git a/.github/workflows/ci-npmcli-mock-globals.yml b/.github/workflows/ci-npmcli-mock-globals.yml index e2833c8b66935..1289238fda30a 100644 --- a/.github/workflows/ci-npmcli-mock-globals.yml +++ b/.github/workflows/ci-npmcli-mock-globals.yml @@ -66,10 +66,9 @@ jobs: os: windows-latest shell: cmd node-version: - - 16.14.0 - - 16.x - - 18.0.0 + - 18.17.0 - 18.x + - 20.5.0 - 20.x runs-on: ${{ matrix.platform.os }} defaults: diff --git a/.github/workflows/ci-npmcli-mock-registry.yml b/.github/workflows/ci-npmcli-mock-registry.yml index 744f28d3c09ad..2202c11265c25 100644 --- a/.github/workflows/ci-npmcli-mock-registry.yml +++ b/.github/workflows/ci-npmcli-mock-registry.yml @@ -66,10 +66,9 @@ jobs: os: windows-latest shell: cmd node-version: - - 16.14.0 - - 16.x - - 18.0.0 + - 18.17.0 - 18.x + - 20.5.0 - 20.x runs-on: ${{ matrix.platform.os }} defaults: diff --git a/docs/package.json b/docs/package.json index b6d52c5e79859..9068c9531ebfb 100644 --- a/docs/package.json +++ b/docs/package.json @@ -43,7 +43,7 @@ "lib/" ], "engines": { - "node": "^16.14.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" }, "tap": { "timeout": 600, diff --git a/mock-globals/package.json b/mock-globals/package.json index c157306d291c6..590f5b156c831 100644 --- a/mock-globals/package.json +++ b/mock-globals/package.json @@ -30,7 +30,7 @@ "lib/" ], "engines": { - "node": "^16.14.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", diff --git a/mock-registry/package.json b/mock-registry/package.json index 2b4b645ebfa82..ccd8eb6720d76 100644 --- a/mock-registry/package.json +++ b/mock-registry/package.json @@ -30,7 +30,7 @@ "lib/" ], "engines": { - "node": "^16.14.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", diff --git a/package-lock.json b/package-lock.json index a918c612542c8..93f52fef38f70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -203,7 +203,7 @@ "yaml": "^2.2.1" }, "engines": { - "node": "^16.14.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "mock-globals": { @@ -216,7 +216,7 @@ "tap": "^16.3.8" }, "engines": { - "node": "^16.14.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "mock-registry": { @@ -234,7 +234,7 @@ "tap": "^16.3.8" }, "engines": { - "node": "^16.14.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "mock-registry/node_modules/@npmcli/arborist": { @@ -17462,7 +17462,7 @@ "tap": "^16.3.8" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "workspaces/libnpmaccess": { @@ -17548,7 +17548,7 @@ "tap": "^16.3.8" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "workspaces/libnpmhook": { diff --git a/scripts/template-oss/pkg.json b/scripts/template-oss/pkg.json new file mode 100644 index 0000000000000..a70a944b171a1 --- /dev/null +++ b/scripts/template-oss/pkg.json @@ -0,0 +1,14 @@ +{ + "engines": { + "node": + {{! Set the CLI and private workspaces to the same version }} + {{~#if isRoot~}} + "^18.17.0 || >=20.5.0" + {{~else~}}{{~#if isPrivate~}} + "^18.17.0 || >=20.5.0" + {{~else~}} + {{! All public workspaces get this version }} + "^16.14.0 || >=18.0.0" + {{~/if~}}{{~/if~}} + } +} diff --git a/scripts/template-oss/root.js b/scripts/template-oss/root.js index 6c25488dd2b42..ec162e8fb9181 100644 --- a/scripts/template-oss/root.js +++ b/scripts/template-oss/root.js @@ -2,6 +2,7 @@ module.exports = { rootModule: { add: { 'CONTRIBUTING.md': false, + 'package.json': { file: 'pkg.json', overwrite: false }, }, }, rootRepo: { @@ -27,7 +28,11 @@ module.exports = { '.github/workflows/pull-request.yml': false, }, }, - ciVersions: ['18.17.0', '18.x', '20.5.0', '20.x'], + workspaceModule: { + add: { + 'package.json': { file: 'pkg.json', overwrite: false }, + }, + }, lockfile: true, npm: '.', defaultBranch: 'latest',