Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v16.9.0 release proposal #40011

Merged
merged 67 commits into from Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
f43c292
deps: update V8 to 9.3.345.16
targos Aug 30, 2021
2170346
build: reset embedder string to "-node.0"
targos Aug 30, 2021
3ce6f72
deps: V8: un-cherry-pick bd019bd
refack Mar 27, 2019
10ba1cb
deps: V8: patch register-arm64.h
refack May 22, 2019
54f4f1a
deps: V8: forward declaration of `Rtl*FunctionTable`
refack May 22, 2019
068824d
deps: make v8.h compatible with VS2015
joaocgreis Nov 1, 2019
b83cab7
deps: fix V8 build issue with inline methods
gengjiawen Oct 14, 2020
cd9b03e
deps: silence irrelevant V8 warnings
targos Jan 30, 2021
d9d0104
deps: silence irrelevant V8 warning
targos May 1, 2021
3e1053e
deps: V8: cherry-pick 81814ed44574
Qard Aug 9, 2021
0140fac
deps: V8: cherry-pick 00bb1a77c03e
RaisinTen Aug 21, 2021
92d83d1
deps: make V8 9.3 abi-compatible with 9.0
targos Aug 30, 2021
7470db0
deps: restore minimum ICU version to 68
targos Jul 20, 2021
9f105c7
tools: update V8 gypfiles for 9.3
targos Jun 12, 2021
beca890
build: adapt v8_pch.h to V8 9.3
targos Jun 20, 2021
105bff9
test: adapt test-v8-flags to V8 9.3
targos Jun 20, 2021
644b25e
test: adapt test-util-inspect to V8 9.3
targos Jul 3, 2021
549d717
test: adapt test-fs-read to V8 9.3
targos Jul 17, 2021
79ce096
src: remove extra semicolons outside fns
codebytere Aug 18, 2021
71659fd
deps: add corepack
arcanis Sep 28, 2020
3b1ce93
worker: add brand checks for detached MessageEvent accessors
jasnell Aug 15, 2021
cfbe906
events: add brand checks for detached accessors
jasnell Aug 15, 2021
a4b8c13
events: protect property defs against prototype polution
jasnell Aug 16, 2021
20cf470
crypto: fix JWK RSA-PSS SubtleCrypto.exportKey
panva Aug 21, 2021
d33ab96
cluster: fix comment regarding child_process file
yashLadha Jul 8, 2021
bc236a6
meta: update .mailmap to remove duplicate AUTHORS entry for addaleax
Trott Aug 25, 2021
20da0a5
module: support pattern trailers
guybedford Aug 2, 2021
4e7212c
test: update error message keywords
leeight Aug 21, 2021
4b5bbec
deps: upgrade openssl sources to OpenSSL_1_1_1l+quic
richardlau Aug 24, 2021
9270684
deps: update archs files for OpenSSL-1.1.1l+quic
richardlau Aug 24, 2021
16271d2
worker: remove file extension check
Ayase-252 Aug 17, 2021
4861505
doc: move ERR_WORKER_UNSPPORTED_EXTENSION to legacy
Ayase-252 Aug 17, 2021
00529b0
test: add test to verify other extension can be loaded by worker
Ayase-252 Aug 17, 2021
d059a51
doc: update maintaining openssl guide
richardlau Aug 25, 2021
4ac703c
doc: add Mesteery to triagers
Mesteery Aug 25, 2021
1dd9158
crypto: fix rsa-pss one-shot sign/verify error handling
panva Aug 20, 2021
259e0cf
meta: add mailmap entry for branisha
Trott Aug 26, 2021
e25dc8e
deps: upgrade npm to 7.21.1
npm-robot Aug 26, 2021
007e285
test: use error code mapping in place of raw errno
RaisinTen May 13, 2021
3a8f77a
doc: document JavaScript tool for benchmark comparison
targos Aug 21, 2021
34c627e
crypto: add RSA-PSS params to asymmetricKeyDetails
tniessen Aug 23, 2021
112af69
fs: add docs and tests for `AsyncIterable` support in `fh.writeFile`
aduh95 Aug 21, 2021
8b68f8e
doc: add VoltrexMaster to triagers
VoltrexKeyva Aug 27, 2021
bc2b73e
doc: add FrankQiu to a triager
iam-frankqiu Aug 28, 2021
8ea4bef
doc: add docs for duplex.allowHalfOpen property
pimterry Jun 23, 2021
0ff88f3
build: update token used for pull requests
Trott Aug 27, 2021
afdb665
build: fix find-inactive-collaborators workflow token
Trott Aug 27, 2021
9eb4a70
doc: move reference to OpenSSL flags SSL_OP_*
tniessen Aug 29, 2021
3588f07
meta: add mailmap entry for Ethan-Arrowood
Trott Aug 29, 2021
29c4b07
doc: update WASI example to use import.meta.url
guybedford Aug 28, 2021
ca9b781
test: use `assert.match` instead of `regexp.test`
targos Aug 29, 2021
2343c39
async_hooks: use resource stack for AsyncLocalStorage run
Qard Aug 26, 2021
953f2e9
doc: add nodejs/tweet issue creation to sec. doc
danbev Aug 30, 2021
fc01dd9
doc: add missing changes to generateKeyPair(Sync)
tniessen Aug 31, 2021
5851994
crypto: fix regression in RSA-PSS keygen
tniessen Aug 29, 2021
9763561
tools: update gyp-next to v0.10.0
targos Aug 30, 2021
c49b0c0
build: add support for Visual Studio 2022
targos Aug 24, 2021
e783453
build: add windows-2022 to GitHub test matrix
targos Aug 24, 2021
d43b555
doc: remove danbev from TSC member list
danbev Sep 2, 2021
0095182
Revert "build: add windows-2022 to GitHub test matrix"
targos Sep 3, 2021
402071b
meta: remove duplicate AUTHORS entry for NigelKibodeaux
Trott Sep 1, 2021
7857e9c
doc: add descriptions about when `options.mode` is ignored
rayw000 Aug 25, 2021
879dc46
src: remove usage of AllocatedBuffer from src/node_buffer.cc
RaisinTen Aug 30, 2021
d92bd9a
tools: add support for import assertions in linter
aduh95 Aug 28, 2021
9e782eb
doc: remove {C,Dec}ompressionStream documentation
lpinca Aug 26, 2021
cb44781
stream: add stream.compose
ronag Jun 18, 2021
b7c0d64
2021-09-07, Version 16.9.0 (Current)
targos Sep 6, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .eslintrc.js
Expand Up @@ -18,6 +18,7 @@ const hacks = [
'eslint-plugin-markdown',
'@babel/eslint-parser',
'@babel/plugin-syntax-class-properties',
'@babel/plugin-syntax-import-assertions',
'@babel/plugin-syntax-top-level-await',
];
Module._findPath = (request, paths, isMain) => {
Expand All @@ -41,6 +42,7 @@ module.exports = {
babelOptions: {
plugins: [
Module._findPath('@babel/plugin-syntax-class-properties'),
Module._findPath('@babel/plugin-syntax-import-assertions'),
Module._findPath('@babel/plugin-syntax-top-level-await'),
],
},
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/authors.yml
Expand Up @@ -12,11 +12,11 @@ jobs:
- run: "tools/update-authors.js" # run the AUTHORS tool
- uses: gr2m/create-or-update-pull-request-action@v1 # create a PR or update the Action's existing PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
with:
title: "meta: update AUTHORS"
author: Node.js GitHub Bot <github-bot@iojs.org>
body: "If this PR exists, there's presumably new additions to the AUTHORS file. This is an automatically generated PR by the `authors.yml` GitHub Action, which runs `tools/update-authors.js` and submits a new PR or updates an existing PR.\n\nPlease note that there might be duplicate entries. If there are, please remove them and add the duplicate emails to .mailmap directly to this PR."
branch: "actions/authors-update" # custom branch *just* for this Action.
commit-message: "meta: update AUTHORS"
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
labels: meta
title: "meta: update AUTHORS"
4 changes: 2 additions & 2 deletions .github/workflows/find-inactive-collaborators.yml
Expand Up @@ -32,9 +32,9 @@ jobs:
- name: Open pull request
uses: gr2m/create-or-update-pull-request-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
with:
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
author: Node.js GitHub Bot <github-bot@iojs.org>
body: This PR was generated by tools/find-inactive-collaborators.yml.
commit-message: "meta: move one or more collaborators to emeritus"
labels: meta
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -62,6 +62,7 @@ _UpgradeReport_Files/
*.wixobj
/tools/msvs/genfiles/
/npm.wxs
/corepack.wxs
/tools/msvs/msi/Release/
/tools/msvs/msi/obj/
/tools/msvs/msi/x64/
Expand Down
4 changes: 4 additions & 0 deletions .mailmap
Expand Up @@ -26,6 +26,7 @@ Andreas Offenhaeuser <offenhaeuser@gmail.com>
Andrew Hughes <Andrew.Hughes1@ibm.com> <andrew.hughes.101@outlook.com>
Andy Bettisworth <andy.bettisworth@accreu.com>
Angel Stoyanov <atstojanov@gmail.com>
Anna Henningsen <anna@addaleax.net> <anna.henningsen@mongodb.com>
Anna Henningsen <anna@addaleax.net> <github@addaleax.net>
Anna Henningsen <anna@addaleax.net> <sqrt@entless.org>
Anna Magdalena Kedzierska <anna.mag.kedzierska@gmail.com> <AnnaMag@users.noreply.github.com>
Expand Down Expand Up @@ -122,6 +123,7 @@ Elliott Cable <me@ell.io>
Eric Phetteplace <phette23@gmail.com>
Ernesto Salazar <ernestoalbertosalazar@gmail.com>
Erwin W. Ramadhan <erwinwahyuramadhan@gmail.com>
Ethan Arrowood <ethan@arrowood.dev> <ethan.arrowood@gmail.com>
Eugene Obrezkov <ghaiklor@gmail.com>
Eugene Ostroukhov <eostroukhov@google.com> <eostroukhov@chromium.org>
Eugene Ostroukhov <eostroukhov@google.com> <eostroukhov@gmail.com>
Expand Down Expand Up @@ -299,6 +301,8 @@ Nebu Pookins <nebu@nebupookins.net>
Netto Farah <nettofarah@gmail.com>
Nicholas Kinsey <pyrotechnick@feistystudios.com>
Nick Soggin <nicksoggin@gmail.com> <iSkore@users.noreply.github.com>
Nigel Kibodeaux <nigelmail@gmail.com> <nigel@team.about.me>
Nikola Glavina <glavina.nikola5@gmail.com> <nikola.glavina@student.um.si>
Nikolai Vavilov <vvnicholas@gmail.com>
Nils Kuhnhenn <lain@volafile.io>
Nitzan Uziely <linkgoron@gmail.com> <nitzan@testim.io>
Expand Down
9 changes: 3 additions & 6 deletions AUTHORS
Expand Up @@ -1237,12 +1237,12 @@ Josh Mays <josh.mays@creditcards.com>
Matt Crummey <mcrummey@validusa.com>
michael6 <michaelf614@gmail.com>
Raja Panidepu <rpanidepu@lmdv-rpani.jomax.paholdings.com>
Ethan Arrowood <ethan.arrowood@gmail.com>
Ethan Arrowood <ethan@arrowood.dev>
Dan Villa <danielavilla02@gmail.com>
CodeTheInternet <edlerner+github@protonmail.com>
Eric Gonzalez <ericxgonzalez@gmail.com>
rgoodwin <rjngoodwin@gmial.com>
Nigel Kibodeaux <nigel@team.about.me>
Nigel Kibodeaux <nigelmail@gmail.com>
fmizzell <fmizzell@1312210.no-reply.drupal.org>
cdnadmin <cdnadmin@collaborare.net>
Paul Lucas <pjl.paul@gmail.com>
Expand Down Expand Up @@ -1772,7 +1772,6 @@ Guilherme Akio Sakae <akio.xd@gmail.com>
Martin Michaelis <code@mgjm.de>
Christopher Sidebottom <chris@damouse.co.uk>
Edward Andrew Robinson <earobinson@gmail.com>
Nigel Kibodeaux <nigelmail@gmail.com>
Shakeel Mohamed <contact@shakeel.xyz>
Tobias Kieslich <tobias.kieslich@gmail.com>
Ruy Adorno <ruyadorno@hotmail.com>
Expand Down Expand Up @@ -3088,7 +3087,7 @@ Anentropic <ego@anentropic.com>
Saleem <hamids2@asme.org>
Julien Poissonnier <julien@caffeine.lu>
zombieleet <zombieleetnca@gmail.com>
Nikola Glavina <nikola.glavina@student.um.si>
Nikola Glavina <glavina.nikola5@gmail.com>
Johannes Schöpp <schoepp@rz.uni-frankfurt.de>
Francisco Ryan Tolmasky I <tolmasky@gmail.com>
Ye-hyoung Kang <keepyourhonor@gmail.com>
Expand Down Expand Up @@ -3167,9 +3166,7 @@ FeelyChau <feely@outlook.com>
Darcy Clarke <darcy@darcyclarke.me>
mayank agarwal <mayankagarwal44442@gmail.com>
woodfairy <d.schmit@m3connect.de>
Nikola Glavina <glavina.nikola5@gmail.com>
Rishabh Mehan <darkrishabh@gmail.com>
Anna Henningsen <anna.henningsen@mongodb.com>
Andrew Casey <andrew.casey@microsoft.com>
Anders Kaseorg <andersk@mit.edu>
Hollow Man <hollowman@hollowman.ml>
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -32,7 +32,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V16.md#16.8.0">16.8.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V16.md#16.9.0">16.9.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.8.0">16.8.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.7.0">16.7.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.6.2">16.6.2</a><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.6.1">16.6.1</a><br/>
Expand Down
11 changes: 11 additions & 0 deletions LICENSE
Expand Up @@ -625,6 +625,17 @@ The externally maintained libraries used by Node.js are:
USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

- corepack, located at deps/corepack, is licensed as follows:
"""
**Copyright © Corepack contributors**

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

- OpenSSL, located at deps/openssl, is licensed as follows:
"""
Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved.
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Expand Up @@ -1054,6 +1054,14 @@ endif
# Builds the macOS installer for releases.
pkg: $(PKG)

corepack-update:
rm -rf /tmp/node-corepack-clone
git clone 'https://github.com/nodejs/corepack.git' /tmp/node-corepack-clone
cd /tmp/node-corepack-clone && yarn pack
rm -rf deps/corepack && mkdir -p deps/corepack
cd deps/corepack && tar xf /tmp/node-corepack-clone/package.tgz --strip-components=1
chmod +x deps/corepack/shims/*

# Note: this is strictly for release builds on release machines only.
pkg-upload: pkg
ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
Expand Down
10 changes: 8 additions & 2 deletions README.md
Expand Up @@ -171,8 +171,6 @@ For information about the governance of the Node.js project, see
**Colin Ihrig** &lt;cjihrig@gmail.com&gt; (he/him)
* [codebytere](https://github.com/codebytere) -
**Shelley Vohr** &lt;shelley.vohr@gmail.com&gt; (she/her)
* [danbev](https://github.com/danbev) -
**Daniel Bevenius** &lt;daniel.bevenius@gmail.com&gt; (he/him)
* [danielleadams](https://github.com/danielleadams) -
**Danielle Adams** &lt;adamzdanielle@gmail.com&gt; (she/her)
* [fhinkel](https://github.com/fhinkel) -
Expand Down Expand Up @@ -214,6 +212,8 @@ For information about the governance of the Node.js project, see
**Ben Noordhuis** &lt;info@bnoordhuis.nl&gt;
* [chrisdickinson](https://github.com/chrisdickinson) -
**Chris Dickinson** &lt;christopher.s.dickinson@gmail.com&gt;
* [danbev](https://github.com/danbev) -
**Daniel Bevenius** &lt;daniel.bevenius@gmail.com&gt; (he/him)
* [evanlucas](https://github.com/evanlucas) -
**Evan Lucas** &lt;evanlucas@me.com&gt; (he/him)
* [Fishrock123](https://github.com/Fishrock123) -
Expand Down Expand Up @@ -622,12 +622,18 @@ maintaining the Node.js project.
**Qingyu Deng** &lt;i@ayase-lab.com&gt;
* [himadriganguly](https://github.com/himadriganguly) -
**Himadri Ganguly** &lt;himadri.tech@gmail.com&gt; (he/him)
* [iam-frankqiu](https://github.com/iam-frankqiu) -
**Frank Qiu** &lt;iam.frankqiu@gmail.com&gt; (he/him)
* [marsonya](https://github.com/marsonya) -
**Akhil Marsonya** &lt;akhil.marsonya27@gmail.com&gt; (he/him)
* [Mesteery](https://github.com/Mesteery) -
**Mestery** &lt;mestery@pm.me&gt;
* [PoojaDurgad](https://github.com/PoojaDurgad) -
**Pooja Durgad** &lt;Pooja.D.P@ibm.com&gt;
* [RaisinTen](https://github.com/RaisinTen) -
**Darshan Sen** &lt;raisinten@gmail.com&gt;
* [VoltrexMaster](https://github.com/VoltrexMaster) -
**Voltrex** &lt;mohammadkeyvanzade94@gmail.com&gt; (he/him)

### Release keys

Expand Down
21 changes: 21 additions & 0 deletions benchmark/async_hooks/async-local-storage-run.js
@@ -0,0 +1,21 @@
'use strict';
const common = require('../common.js');
const { AsyncLocalStorage } = require('async_hooks');

const bench = common.createBenchmark(main, {
n: [1e7]
});

async function run(store, n) {
for (let i = 0; i < n; i++) {
await new Promise((resolve) => store.run(i, resolve));
}
}

function main({ n }) {
const store = new AsyncLocalStorage();
bench.start();
run(store, n).then(() => {
bench.end(n);
});
}
2 changes: 1 addition & 1 deletion common.gypi
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.20',
'v8_embedder_string': '-node.11',

##### V8 defaults for Node.js #####

Expand Down
7 changes: 7 additions & 0 deletions deps/corepack/LICENSE.md
@@ -0,0 +1,7 @@
**Copyright © Corepack contributors**

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
147 changes: 147 additions & 0 deletions deps/corepack/README.md
@@ -0,0 +1,147 @@
# <img src="./icon.svg" height="25" /> corepack

Corepack is a zero-runtime-dependency Node script that acts as a bridge between Node 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 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.

## How to Install

### Default Installs

Corepack isn't intended to be installed manually. While it's certainly possible, we're working with the Node TSC to provide Corepack by default starting from Node 15, thus ensuring that all package managers can be used with little to no friction.

### Manual Installs

<details>
<summary>Click here to see how to install Corepack using npm</summary>

First uninstall your global Yarn and pnpm binaries (just leave npm). In general, you'd do this by running the following command:

```shell
npm uninstall -g yarn pnpm

# That should be enough, but if you installed Yarn without going through npm it might
# be more tedious - for example, you might need to run `brew uninstall yarn` as well.
```

Then install Corepack:

```shell
npm install -g corepack
```

We do acknowledge the irony and overhead of using npm to install Corepack, which is at least part of why the preferred option is to use the Corepack version that will be distributed along with Node itself.

</details>

### Prebuilt Binaries

<details>
<summary>Click here to see how to download prebuilt Corepack Node distributions</summary>

We have a few prebuilt Node binaries (based on the [following branch](https://github.com/arcanis/node/tree/mael/pmm)) that you can just download, unpack somewhere, and add to your `PATH` environment variable.

1. Go to [this page](https://github.com/arcanis/pmm/actions?query=workflow%3ABuild)
2. Open the latest build (the one at the top)
3. Download the right artifact (Linux or Darwin)
4. Unzip the artifact, then untar it
5. Add the `node-v15.0.0-nightlyYYYY-MM-DDXXXX-linux-x64/bin` directory to your `$PATH`

</details>

## Usage

Just use your package managers as you usually would. Run `yarn install` in Yarn projects, `pnpm install` in pnpm projects, and `npm` in npm projects. Corepack will catch these calls, and depending on the situation:

- **If the local project is configured for the package manager you're using**, Corepack will silently download and cache the latest compatible version.

- **If the local project is configured for a different package manager**, Corepack will request you to run the command again using the right package manager - thus avoiding corruptions of your install artifacts.

- **If the local project isn't configured for any package manager**, Corepack will assume that you know what you're doing, and will use whatever package manager version has been pinned as "known good release". Check the relevant section for more details.

## Known Good Releases

When running Yarn or pnpm within projects that don't list a supported package manager, Corepack will default to a set of Known Good Releases. In a way, you can compare this to Node, where each version ships with a specific version of npm.

The Known Good Releases can be updated system-wide using the `--activate` flag from the `corepack prepare` and `corepack hydrate` commands.

## Offline Workflow

The utility commands detailed in the next section.

- Either you can use the network while building your container image, in which case you'll simply run `corepack prepare` to make sure that your image includes the Last Known Good release for the specified package manager.

- If you want to have *all* Last Known Good releases for all package managers, just use the `--all` flag which will do just that.

- Or you're publishing your project to a system where the network is unavailable, in which case you'll preemptively generate a package manager archive from your local computer (using `corepack prepare -o`) before storing it somewhere your container will be able to access (for example within your repository). After that it'll just be a matter of running `corepack hydrate <path/to/corepack.tgz>` to setup the cache.

## Utility Commands

### `corepack <binary name>[@<version>] [... args]`

This meta-command runs the specified package manager in the local folder. You can use it to force an install to run with a given version, which can be useful when looking for regressions.

Note that those commands still check whether the local project is configured for the given package manager (ie you won't be able to run `corepack yarn install` on a project where the `packageManager` field references `pnpm`).

### `corepack enable [... name]`

| Option | Description |
| --- | --- |
| `--install-directory` | Add the shims to the specified location |

This command will detect where Node is installed and will create shims next to it for each of the specified package managers (or all of them if the command is called without parameters). Note that the npm shims will not be installed unless explicitly requested, as npm is currently distributed with Node through other means.

### `corepack disable [... name]`

| Option | Description |
| --- | --- |
| `--install-directory` | Remove the shims to the specified location |

This command will detect where Node is installed and will remove the shims from there.

### `corepack prepare [... name@version]`

| Option | Description |
| --- | --- |
| `--all` | Prepare the "Last Known Good" version of all supported package managers |
| `-o,--output` | Also generate an archive containing the package managers |
| `--activate` | Also update the "Last Known Good" release |

This command will download the given package managers (or the one configured for the local project if no argument is passed in parameter) and store it within the Corepack cache. If the `-o,--output` flag is set (optionally with a path as parameter), an archive will also be generated that can be used by the `corepack hydrate` command.

### `corepack hydrate <path/to/corepack.tgz>`

| Option | Description |
| --- | --- |
| `--activate` | Also update the "Last Known Good" release |

This command will retrieve the given package manager from the specified archive and will install it within the Corepack cache, ready to be used without further network interaction.

## Environment Variables

- `COREPACK_ENABLED` has no functional impact on Corepack itself; it's automatically being set in your environment by Corepack when it shells out to the underlying package managers, so that they can feature-detect its presence (useful for commands like `yarn init`).

## Contributing

If you want to build corepack yourself, you can build the project like this:

1. Clone this repository
2. Run `yarn build` (no need for `yarn install`)
3. The `dist/` directory now contains the corepack build and the shims
4. Call `node ./dist/corepack --help` and behold

You can also run the tests with `yarn jest` (still no install needed).

## Design

Various tidbits about Corepack's design are explained in more details in [DESIGN.md](/DESIGN.md).

## License (MIT)

> **Copyright © Corepack contributors**
>
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.