Skip to content

Commit

Permalink
document changes in pnpm 9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
zkochan committed Jul 22, 2024
1 parent 0a59fd0 commit b167c21
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/catalogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ This is equivalent to writing a version range (e.g. `^18.3.1`) directly.
}
```

You may use the `catalog:` protocol in the next fields of your `package.json`:

* `dependencies`
* `devDependencies`
* `optionalDependencies`
* `pnpm.overrides`

The `catalog:` protocol allows an optional name after the colon (ex: `catalog:name`) to specify which catalog should be used. When a name is omitted, the default catalog is used.

Depending on the scenario, the `catalog:` protocol offers a few [advantages](#advantages) compared to writing version ranges directly that are detailed next.
Expand Down
4 changes: 4 additions & 0 deletions docs/npmrc.md
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,10 @@ Use this `.npmrc` file:
use-node-version=16.16.0
```

This setting works only in a `.npmrc` file that is in the root of your workspace. If you need to specify a custom Node.js for a project in the workspace, use the [`pnpm.executionEnv.nodeVersion`] field of `package.json` instead.

[`pnpm.executionEnv.nodeVersion`]: ./package_json.md#pnpmexecutionenvnodeversion

### node-version

* Default: the value returned by **node -v**, without the v prefix
Expand Down
20 changes: 20 additions & 0 deletions docs/package_json.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,26 @@ If an optional dependency has its name included in this array, it will be skippe
}
```

## pnpm.executionEnv.nodeVersion

Added in: v9.6.0

Specifies which exact Node.js version should be used for the project's runtime.
pnpm will automatically install the specified version of Node.js and use it for
running `pnpm run` commands or the `pnpm node` command.

For example:

```json
{
"pnpm": {
"executionEnv": {
"nodeVersion": "16.16.0"
}
}
}
```

## resolutions

Functionally identical to [`pnpm.overrides`], this field is intended to make it easier to migrate from Yarn.
Expand Down

0 comments on commit b167c21

Please sign in to comment.