From 01d6a5fd19ef55495261643d64725dc30407d50e Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 19 Apr 2023 01:31:23 +0200 Subject: [PATCH 1/3] chore: update supported Node.js versions BREAKING CHANGE: remove support for Node.js 14.x --- .github/workflows/ci.yml | 2 +- .github/workflows/update-nock-files.yml | 2 +- README.md | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 333746f26..c05eaf210 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,9 +46,9 @@ jobs: fail-fast: false matrix: node: - - 14 - 16 - 18 + - 20 platform: - ubuntu-latest - macos-latest diff --git a/.github/workflows/update-nock-files.yml b/.github/workflows/update-nock-files.yml index 22c1a55f5..aa154f1cf 100644 --- a/.github/workflows/update-nock-files.yml +++ b/.github/workflows/update-nock-files.yml @@ -25,7 +25,7 @@ jobs: with: # Let's use the oldest version supported to be sure the V8 # serialization is compatible with all supported versions. - node-version: 14.x + node-version: 16.x - name: Get the Yarn cache directory path id: yarn-cache-dir-path diff --git a/README.md b/README.md index a68555daf..8c7ec0173 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ use npm. ### Default Installs -Corepack is distributed by default with Node.js 14.19.0 and 16.9.0, but is +Corepack is distributed by default with all recent Node.js versions, but is opt-in for the time being. Run `corepack enable` to install the required shims. ### Manual Installs diff --git a/package.json b/package.json index 9f38e3623..50ec9b27e 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "url": "https://github.com/nodejs/corepack.git" }, "engines": { - "node": ">=14.14.0" + "node": ">=16.20.0" }, "exports": { "./package.json": "./package.json" From fda2ead7e13127e6bc71d62026fd9d5e3fc4d92b Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 19 Apr 2023 12:51:07 +0200 Subject: [PATCH 2/3] fix build command --- package.json | 2 +- tsconfig.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 50ec9b27e..032524d2b 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ }, "scripts": { "build": "rm -rf dist shims && run build:bundle && ts-node ./mkshims.ts", - "build:bundle": "esbuild ./sources/_entryPoint.ts --bundle --platform=node --target=node14.14.0 --external:corepack --outfile='./dist/corepack.js' --resolve-extensions='.ts,.mjs,.js'", + "build:bundle": "esbuild ./sources/_entryPoint.ts --bundle --platform=node --target=node16.20.0 --external:corepack --outfile='./dist/corepack.js' --resolve-extensions='.ts,.mjs,.js'", "corepack": "ts-node ./sources/_entryPoint.ts", "lint": "eslint .", "prepack": "yarn build", diff --git a/tsconfig.json b/tsconfig.json index 144f644f9..b623ce212 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,12 +7,12 @@ "moduleResolution": "node", "noEmit": true, "forceConsistentCasingInFileNames": true, - "lib": ["ES2020"], + "lib": ["ES2021"], "module": "commonjs", "resolveJsonModule": true, "skipLibCheck": true, "strict": true, - "target": "ES2020" + "target": "ES2021" }, "ts-node": { "transpileOnly": true From 44bb2c7b32f345b4f1cdb5e506ade984a85a4ccb Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 19 Apr 2023 17:52:41 +0200 Subject: [PATCH 3/3] link to Node.js docs, clean up README --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8c7ec0173..893bc052a 100644 --- a/README.md +++ b/README.md @@ -2,26 +2,20 @@ Corepack is a zero-runtime-dependency Node.js script that acts as a bridge between Node.js projects and the package managers they are intended to be used -with during development. In practical terms, **Corepack will let you use Yarn -and pnpm without having to install them** - just like what currently happens -with npm, which is shipped by Node.js by default. - -**Important:** At the moment, Corepack only covers Yarn and pnpm. Given that we -have little control on the npm project, we prefer to focus on the Yarn and pnpm -use cases. As a result, Corepack doesn't have any effect at all on the way you -use npm. +with during development. In practical terms, **Corepack lets you use Yarn, npm, +and pnpm without having to install them**. ## How to Install ### Default Installs -Corepack is distributed by default with all recent Node.js versions, but is -opt-in for the time being. Run `corepack enable` to install the required shims. +Corepack is [distributed by default with all recent Node.js versions](https://nodejs.org/api/corepack.html). +Run `corepack enable` to install the required Yarn and pnpm binaries on your path. ### Manual Installs
-Click here to see how to install Corepack using npm +Install Corepack using npm First uninstall your global Yarn and pnpm binaries (just leave npm). In general, you'd do this by running the following command: @@ -45,6 +39,12 @@ is distributed along with Node.js itself.
+
Install Corepack from source + +See [`CONTRIBUTING.md`](./CONTRIBUTING.md). + +
+ ## Usage ### When Building Packages