Skip to content

Commit

Permalink
deps: update corepack to 0.20.0
Browse files Browse the repository at this point in the history
PR-URL: #49464
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
nodejs-github-bot authored and targos committed Oct 26, 2023
1 parent 04227b2 commit 1cabb77
Show file tree
Hide file tree
Showing 4 changed files with 1,844 additions and 1,355 deletions.
8 changes: 8 additions & 0 deletions deps/corepack/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [0.20.0](https://github.com/nodejs/corepack/compare/v0.19.0...v0.20.0) (2023-08-29)


### Features

* refactor the CLI interface ([#291](https://github.com/nodejs/corepack/issues/291)) ([fe3e5cd](https://github.com/nodejs/corepack/commit/fe3e5cd86c45db0d87c7fdea87d57d59b0bdcb78))
* update package manager versions ([#292](https://github.com/nodejs/corepack/issues/292)) ([be9c286](https://github.com/nodejs/corepack/commit/be9c286846443ff03081e736fdf4a0ff031fbd38))

## [0.19.0](https://github.com/nodejs/corepack/compare/v0.18.1...v0.19.0) (2023-06-24)


Expand Down
70 changes: 46 additions & 24 deletions deps/corepack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,26 +92,25 @@ If there is no Known Good Release for the requested package manager, Corepack
looks up the npm registry for the latest available version and cache it for
future use.

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

## 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
case you'll simply run `corepack pack` 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
archive from your local computer (using `corepack pack -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.
`corepack install -g --cache-only <path/to/corepack.tgz>` to setup the cache.

## Utility Commands

Expand Down Expand Up @@ -171,29 +170,52 @@ echo "function npx { corepack npx `$args }" >> $PROFILE
This command will detect where Node.js is installed and will remove the shims
from there.

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

| 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 |
Download and install the package manager configured in the local project.
This command doesn't change the global version used when running the package
manager from outside the project (use the \`-g,--global\` flag if you wish
to do this).

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 install <-g,--global> [--all] [... name@version]`

### `corepack hydrate <path/to/corepack.tgz>`
| Option | Description |
| --------------------- | ------------------------------------------ |
| `--all` | Install all Last Known Good releases |

Install the selected package managers and install them on the system.

Package managers thus installed will be configured as the new default when
calling their respective binaries outside of projects defining the
`packageManager` field.

### `corepack pack [--all] [... name@version]`

| Option | Description |
| --------------------- | ------------------------------------------ |
| `--all` | Pack all Last Known Good releases |
| `--json ` | Print the output folder rather than logs |
| `-o,--output ` | Path where to generate the archive |

Download the selected package managers and store them inside a tarball
suitable for use with `corepack install -g`.

### `corepack use <name@version>`

When run, this command will retrieve the latest release matching the provided
descriptor, assign it to the project's package.json file, and automatically
perform an install.

### `corepack up`

| Option | Description |
| ------------ | ----------------------------------------- |
| `--activate` | Also update the "Last Known Good" release |
Retrieve the latest available version for the current major release line of
the package manager used in the local project, and update the project to use
it.

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.
Unlike `corepack use` this command doesn't take a package manager name nor a
version range, as it will always select the latest available version from the
same major line. Should you need to upgrade to a new major, use an explicit
`corepack use {name}@latest` call.

## Environment Variables

Expand All @@ -204,7 +226,7 @@ network interaction.
- `COREPACK_ENABLE_NETWORK` can be set to `0` to prevent Corepack from accessing
the network (in which case you'll be responsible for hydrating the package
manager versions that will be required for the projects you'll run, using
`corepack hydrate`).
`corepack install -g --cache-only`).

- `COREPACK_ENABLE_STRICT` can be set to `0` to prevent Corepack from throwing
error if the package manager does not correspond to the one defined for the
Expand Down
Loading

0 comments on commit 1cabb77

Please sign in to comment.