Skip to content

docs: update docs about settings #651

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

Merged
merged 4 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/cli/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ the installation progress.

If you want to change what type of information is printed, use the [loglevel] setting.

[loglevel]: ../npmrc.md#loglevel
[loglevel]: ../settings.md#loglevel

### --use-store-server

Expand Down Expand Up @@ -177,7 +177,7 @@ dependencies.

:::warning

Filter currently does not work properly with v8 default config, you have to implicitly set [dedupe-peer-dependents](../npmrc.md#dedupe-peer-dependents) to `false` to have that work. For more info and progress please refer to [#6300](https://github.com/pnpm/pnpm/issues/6300)
Filter currently does not work properly with v8 default config, you have to implicitly set [dedupe-peer-dependents](../settings.md#dedupe-peer-dependents) to `false` to have that work. For more info and progress please refer to [#6300](https://github.com/pnpm/pnpm/issues/6300)

:::

Expand Down
2 changes: 1 addition & 1 deletion docs/cli/recursive.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ pnpm -r --reverse run clean

[Read more about filtering.](../filtering.md)

[include-workspace-root]: ../npmrc.md#include-workspace-root
[include-workspace-root]: ../settings.md#include-workspace-root
4 changes: 2 additions & 2 deletions docs/package_json.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ You can specify the version of Node and pnpm that your software works on:
During local development, pnpm will always fail with an error message
if its version does not match the one specified in the `engines` field.

Unless the user has set the `engine-strict` config flag (see [.npmrc]), this
Unless the user has set the `engine-strict` config flag (see [settings]), this
field is advisory only and will only produce warnings when your package is
installed as a dependency.

[.npmrc]: ./npmrc.md#engine-strict
[settings]: ./settings.md#engine-strict

## dependenciesMeta

Expand Down
26 changes: 13 additions & 13 deletions docs/npmrc.md → docs/settings.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
id: npmrc
title: "Settings (.npmrc)"
id: settings
title: "Settings (pnpm-workspace.yaml)"
---

pnpm gets its configuration from the command line, environment variables, and
pnpm gets its configuration from the command line, environment variables, `pnpm-workspace.yaml`, and
`.npmrc` files.

The `pnpm config` command can be used to update and edit the contents of the
user and global `.npmrc` files.
The `pnpm config` command can be used to read and edit the contents of the project and global configuration files.

The four relevant files are:
The relevant configuration files are:

* per-project configuration file (`/path/to/my/project/.npmrc`)
* per-workspace configuration file (the directory that contains the
`pnpm-workspace.yaml` file)
* per-user configuration file (`~/.npmrc`)
* global configuration file (`/etc/npmrc`)
* Per-project configuration file: `/path/to/my/project/pnpm-workspace.yaml`
* Global configuration file: `~/.config/pnpm/rc` (an [INI-formatted] list of `key = value` parameters)

All `.npmrc` files are an [INI-formatted] list of `key = value` parameters.
:::note

Authorization-related settings are handled by npm's configuration system. So, `pnpm config set registry=<value>` will actually save the setting to npm's global configuration file.

:::

Values in the `.npmrc` files may contain env variables using the `${NAME}` syntax. The env variables may also be specified with default values. Using `${NAME-fallback}` will return `fallback` if `NAME` isn't set. `${NAME:-fallback}` will return `fallback` if `NAME` isn't set, or is an empty string.
Values in the configuration files may contain env variables using the `${NAME}` syntax. The env variables may also be specified with default values. Using `${NAME-fallback}` will return `fallback` if `NAME` isn't set. `${NAME:-fallback}` will return `fallback` if `NAME` isn't set, or is an empty string.

[INI-formatted]: https://en.wikipedia.org/wiki/INI_file

Expand Down
5 changes: 2 additions & 3 deletions docs/workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ multi-project repositories, or monolithic repositories). You can create a
workspace to unite multiple projects inside a single repository.

A workspace must have a [`pnpm-workspace.yaml`] file in its
root. A workspace also may have an [`.npmrc`] in its root.
root.

[`pnpm-workspace.yaml`]: pnpm-workspace_yaml.md
[`.npmrc`]: npmrc.md

:::tip

Expand Down Expand Up @@ -41,7 +40,7 @@ This protocol is especially useful when the [link-workspace-packages] option is
set to `false`. In that case, pnpm will only link packages from the workspace if
the `workspace:` protocol is used.

[link-workspace-packages]: npmrc.md#link-workspace-packages
[link-workspace-packages]: settings.md#link-workspace-packages

### Referencing workspace packages through aliases

Expand Down
2 changes: 1 addition & 1 deletion sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
],
"Configuration": [
"package_json",
"npmrc",
"settings",
"pnpm-workspace_yaml",
"pnpmfile"
],
Expand Down
10 changes: 10 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
"destination": "/:splat*",
"permanent": false
},
{
"source": "/npmrc",
"destination": "/settings",
"permanent": true
},
{
"source": "/next/npmrc",
"destination": "/next/settings",
"permanent": true
},
{
"source": "/en/:splat*",
"destination": "/:splat*",
Expand Down
2 changes: 1 addition & 1 deletion versioned_sidebars/version-10.x-sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
},
{
"type": "doc",
"id": "npmrc"
"id": "settings"
},
{
"type": "doc",
Expand Down