Skip to content

Commit f0d3918

Browse files
committed
docs: fix links to settings
1 parent 035cd4d commit f0d3918

File tree

10 files changed

+46
-60
lines changed

10 files changed

+46
-60
lines changed

docs/catalogs.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ This is equivalent to writing a version range (e.g. `^18.3.1`) directly.
4545
}
4646
```
4747

48-
You may use the `catalog:` protocol in the next fields of your `package.json`:
49-
50-
* `dependencies`
51-
* `devDependencies`
52-
* `peerDependencies`
53-
* `optionalDependencies`
54-
* `pnpm.overrides`
48+
You may use the `catalog:` protocol in the next fields:
49+
50+
* `package.json`:
51+
* `dependencies`
52+
* `devDependencies`
53+
* `peerDependencies`
54+
* `optionalDependencies`
55+
* `pnpm-workspace.yaml`
56+
* `overrides`
5557

5658
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.
5759

docs/cli/add.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Example:
224224
pnpm --allow-build=esbuild add my-bundler
225225
```
226226

227-
This will run `esbuild`'s postinstall script and also add it to the `pnpm.onlyBuiltDependencies` field of `package.json`. So, `esbuild` will always be allowed to run its scripts in the future.
227+
This will run `esbuild`'s postinstall script and also add it to the `onlyBuiltDependencies` field of `pnpm-workspace.yaml`. So, `esbuild` will always be allowed to run its scripts in the future.
228228

229229
### --filter <package_selector\>
230230

docs/cli/audit.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,17 @@ If a simple update does not fix all the issues, use [overrides] to force
1010
versions that are not vulnerable. For instance, if `lodash@<2.1.0` is vulnerable,
1111
use this overrides to force `lodash@^2.1.0`:
1212

13-
```json title="package.json"
14-
{
15-
"pnpm": {
16-
"overrides": {
17-
"lodash@<2.1.0": "^2.1.0"
18-
}
19-
}
20-
}
13+
```yaml title="pnpm-workspace.yaml"
14+
overrides:
15+
"lodash@<2.1.0": "^2.1.0"
2116
```
2217
2318
Or alternatively, run `pnpm audit --fix`.
2419

25-
If you want to tolerate some vulnerabilities as they don't affect your project, you may use the [`pnpm.auditConfig.ignoreCves`] setting.
20+
If you want to tolerate some vulnerabilities as they don't affect your project, you may use the [`auditConfig.ignoreCves`] setting.
2621

27-
[overrides]: ../package_json.md#pnpmoverrides
28-
[`pnpm.auditConfig.ignoreCves`]: ../package_json.md#pnpmauditconfigignorecves
22+
[overrides]: ../settings.md#overrides
23+
[`auditConfig.ignoreCves`]: ../settings.md#auditconfigignorecves
2924

3025
## Options
3126

docs/cli/patch-commit.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "pnpm patch-commit <path>"
55

66
Generate a patch out of a directory and save it (inspired by a similar command in Yarn).
77

8-
This command will compare the changes from `path` to the package it was supposed to patch, generate a patch file, save the a patch file to `patchesDir` (which can be customized by the `--patches-dir` option), and add an entry to `patchesDependencies` in the top level manifest file.
8+
This command will compare the changes from `path` to the package it was supposed to patch, generate a patch file, save the a patch file to `patchesDir` (which can be customized by the `--patches-dir` option), and add an entry to [`patchedDependencies`].
99

1010
Usage:
1111

@@ -20,3 +20,5 @@ pnpm patch-commit <path>
2020
### ---patches-dir &lt;patchesDir>
2121

2222
The generated patch file will be saved to this directory. By default, patches are saved to the `patches` directory in the root of the project.
23+
24+
[`patchedDependencies`]: ../settings.md#patcheddependencies

docs/cli/patch-remove.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: patch-remove
33
title: "pnpm patch-remove <pkg...>"
44
---
55

6-
Remove existing patch files and settings in `pnpm.patchedDependencies`.
6+
Remove existing patch files and settings in `patchedDependencies`.
77

88
```sh
99

docs/cli/patch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ Usage:
1515
pnpm patch <pkg name>@<version>
1616
```
1717

18-
[`patchedDependencies`]: ../package_json.md#pnpmpatcheddependencies
18+
[`patchedDependencies`]: ../settings.md#patcheddependencies
1919

2020
:::note
2121

2222
If you want to change the dependencies of a package, don't use patching to modify the `package.json` file of the package. For overriding dependencies, use [overrides] or a [package hook].
2323

2424
:::
2525

26-
[overrides]: ../package_json#pnpmoverrides
26+
[overrides]: ../settings.md#overrides
2727
[package hook]: ../pnpmfile#hooksreadpackagepkg-context-pkg--promisepkg
2828

2929
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/0GjLqRGRbcY" title="The pnpm patch command demo" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen"></iframe>

docs/config-dependencies.md

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,16 @@ Configurational dependencies are installed before all the other types of depende
77

88
Configurational dependencies cannot have dependencies of their own or lifecycle scripts. They should be added using exact version and the integrity checksum. Example:
99

10-
```json
11-
{
12-
"pnpm": {
13-
"configDependencies": {
14-
"my-configs": "1.0.0+sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw=="
15-
}
16-
}
17-
}
10+
```yaml title="pnpm-workspace.yaml"
11+
configDependencies:
12+
my-configs: "1.0.0+sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw=="
1813
```
1914
2015
## Usage
2116
2217
### Loading an allow list of built dependencies
2318
24-
You may load a list of package names that are allowed to be built via configurational dependencies and the [`pnpm.onlyBuiltDependenciesFile`] setting. For example, you may publish a package with an `allow.json` file in its root directory:
19+
You may load a list of package names that are allowed to be built via configurational dependencies and the [`onlyBuiltDependenciesFile`] setting. For example, you may publish a package with an `allow.json` file in its root directory:
2520

2621
```json
2722
[
@@ -30,22 +25,17 @@ You may load a list of package names that are allowed to be built via configurat
3025
]
3126
```
3227

33-
Let's say this package is called `my-configs`, then your project's `package.json` will look like this:
28+
Let's say this package is called `my-configs`, then your project's `pnpm-workspace.yaml` will look like this:
3429

35-
```json
36-
{
37-
"pnpm": {
38-
"configDependencies": {
39-
"my-configs": "1.0.0+sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw=="
40-
},
41-
"onlyBuiltDependenciesFile": "node_modules/.pnpm-config/my-configs/allow.json"
42-
}
43-
}
30+
```yaml
31+
configDependencies:
32+
my-configs: "1.0.0+sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw=="
33+
onlyBuiltDependenciesFile: "node_modules/.pnpm-config/my-configs/allow.json"
4434
```
4535

4636
This way your project will load the list of packages that are allowed to be built from `my-configs`.
4737

48-
[`pnpm.onlyBuiltDependenciesFile`]: package_json.md#pnpmonlybuiltdependenciesfile
38+
[`onlyBuiltDependenciesFile`]: settings.md#onlybuiltdependenciesfile
4939

5040
### Installing dependencies used in hooks
5141

@@ -69,17 +59,11 @@ module.exports = {
6959

7060
You can reference [patch files] installed via configurational dependencies. For instance, if you have a configurational dependency called "my-patches", you can load patches from it:
7161

72-
```json
73-
{
74-
"pnpm": {
75-
"configDependencies": {
76-
"my-patches": "1.0.0+sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw=="
77-
},
78-
"patchedDependencies": {
79-
"react": "node_modules/.pnpm-config/my-patches/react.patch"
80-
}
81-
}
82-
}
62+
```yaml
63+
configDependencies:
64+
my-patches: "1.0.0+sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw=="
65+
patchedDependencies:
66+
react: "node_modules/.pnpm-config/my-patches/react.patch"
8367
```
8468

8569
[patch files]: ./cli/patch.md

docs/errors.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ To fix this error, all dependencies that use the [workspace protocol] should be
3535

3636
`pnpm install` will fail if the project has unresolved peer dependencies or the peer dependencies are not matching the wanted ranges. To fix this, install the missing peer dependencies.
3737

38-
You may also selectively ignore these errors using the [pnpm.peerDependencyRules.ignoreMissing](package_json#pnpmpeerdependencyrulesignoremissing) and [pnpm.peerDependencyRules.allowedVersions](package_json#pnpmpeerdependencyrulesallowedversions) fields in `package.json`.
38+
You may also selectively ignore these errors using the [peerDependencyRules.ignoreMissing] and [peerDependencyRules.allowedVersions] settings.
39+
40+
[peerDependencyRules.ignoreMissing]: settings#peerdependencyrulesignoremissing
41+
[peerDependencyRules.allowedVersions]: settings#peerdependencyrulesallowedversions
3942

4043
## ERR_PNPM_OUTDATED_LOCKFILE
4144

docs/pnpmfile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Removing the `scripts` field from a dependency's manifest via `readPackage` will
7979
not prevent pnpm from building the dependency. When building a dependency, pnpm
8080
reads the `package.json` of the package from the package's archive, which is not
8181
affected by the hook. In order to ignore a package's build, use the
82-
[pnpm.neverBuiltDependencies](package_json.md#pnpmneverbuiltdependencies) field.
82+
[neverBuiltDependencies](settings.md#neverbuiltdependencies) field.
8383

8484
### `hooks.afterAllResolved(lockfile, context): lockfile | Promise<lockfile>`
8585

docs/settings.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,11 +1048,11 @@ Do not execute any scripts of the installed packages. Scripts of the projects ar
10481048

10491049
:::note
10501050

1051-
Since v10, pnpm doesn't run the lifecycle scripts of dependencies unless they are listed in the [`pnpm.onlyBuiltDependencies`] field of `package.json`.
1051+
Since v10, pnpm doesn't run the lifecycle scripts of dependencies unless they are listed in [`onlyBuiltDependencies`].
10521052

10531053
:::
10541054

1055-
[`pnpm.onlyBuiltDependencies`]: package_json.md#pnpmonlybuiltdependencies
1055+
[`onlyBuiltDependencies`]: settings.md#onlybuiltdependencies
10561056

10571057
### childConcurrency
10581058

@@ -1193,9 +1193,9 @@ Use this `pnpm-workspace.yaml` file:
11931193
useNodeVersion: 16.16.0
11941194
```
11951195

1196-
This setting works only in a `pnpm-workspace.yaml` 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.
1196+
This setting works only in a `pnpm-workspace.yaml` 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 [`executionEnv.nodeVersion`] field of `package.json` instead.
11971197

1198-
[`pnpm.executionEnv.nodeVersion`]: ./package_json.md#pnpmexecutionenvnodeversion
1198+
[`executionEnv.nodeVersion`]: ./settings.md.md#pnpmexecutionenvnodeversion
11991199

12001200
### nodeVersion
12011201

0 commit comments

Comments
 (0)