From 18efb8e7a4bccf315ece153977c841fcce647421 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Sun, 23 Mar 2025 02:21:14 +0100 Subject: [PATCH 1/4] docs: update docs about settings --- docs/{npmrc.md => settings.md} | 18 +++++++----------- vercel.json | 5 +++++ 2 files changed, 12 insertions(+), 11 deletions(-) rename docs/{npmrc.md => settings.md} (98%) diff --git a/docs/npmrc.md b/docs/settings.md similarity index 98% rename from docs/npmrc.md rename to docs/settings.md index b368d594de9c..f5859084ff79 100644 --- a/docs/npmrc.md +++ b/docs/settings.md @@ -1,21 +1,17 @@ --- -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`) All `.npmrc` files are an [INI-formatted] list of `key = value` parameters. diff --git a/vercel.json b/vercel.json index d5b2055e5299..2097d75b20a4 100644 --- a/vercel.json +++ b/vercel.json @@ -26,6 +26,11 @@ "destination": "/:splat*", "permanent": false }, + { + "source": "/npmrc", + "destination": "/settings", + "permanent": true + }, { "source": "/en/:splat*", "destination": "/:splat*", From ae7337d897c177c30613aa8e2828a63c2ec3a386 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Tue, 1 Apr 2025 14:19:12 +0200 Subject: [PATCH 2/4] add more details --- docs/settings.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/settings.md b/docs/settings.md index f5859084ff79..b6dc920447fb 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -10,12 +10,16 @@ The `pnpm config` command can be used to read and edit the contents of the proje The relevant configuration files are: -* per-project configuration file (`/path/to/my/project/pnpm-workspace.yaml`) -* global configuration file (`~/.config/pnpm/rc`) +* 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=` 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 From 8931083124940b0a94d74f5341323a5bea10d645 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Tue, 1 Apr 2025 14:20:13 +0200 Subject: [PATCH 3/4] add redirect --- vercel.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vercel.json b/vercel.json index 2097d75b20a4..cdfe1230c131 100644 --- a/vercel.json +++ b/vercel.json @@ -31,6 +31,11 @@ "destination": "/settings", "permanent": true }, + { + "source": "/next/npmrc", + "destination": "/next/settings", + "permanent": true + }, { "source": "/en/:splat*", "destination": "/:splat*", From a3b064e3803961499940a572ffb7a307b9eb4f0b Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Tue, 1 Apr 2025 14:25:56 +0200 Subject: [PATCH 4/4] fix links to settings page --- docs/cli/install.md | 4 ++-- docs/cli/recursive.md | 2 +- docs/package_json.md | 4 ++-- docs/workspaces.md | 5 ++--- sidebars.json | 2 +- versioned_sidebars/version-10.x-sidebars.json | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/cli/install.md b/docs/cli/install.md index b1c9eecc94a6..5cb2400fd2b1 100644 --- a/docs/cli/install.md +++ b/docs/cli/install.md @@ -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 @@ -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) ::: diff --git a/docs/cli/recursive.md b/docs/cli/recursive.md index 23166dc5579f..31d61b6063f4 100644 --- a/docs/cli/recursive.md +++ b/docs/cli/recursive.md @@ -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 diff --git a/docs/package_json.md b/docs/package_json.md index c7b42e396d1c..a95984a303b9 100644 --- a/docs/package_json.md +++ b/docs/package_json.md @@ -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 diff --git a/docs/workspaces.md b/docs/workspaces.md index 4cba197da1be..afaf207fbf29 100644 --- a/docs/workspaces.md +++ b/docs/workspaces.md @@ -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 @@ -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 diff --git a/sidebars.json b/sidebars.json index 4d2aa679fe16..2c8b20b7f661 100644 --- a/sidebars.json +++ b/sidebars.json @@ -102,7 +102,7 @@ ], "Configuration": [ "package_json", - "npmrc", + "settings", "pnpm-workspace_yaml", "pnpmfile" ], diff --git a/versioned_sidebars/version-10.x-sidebars.json b/versioned_sidebars/version-10.x-sidebars.json index ed912ff4c3d9..aa5cb861d5ed 100644 --- a/versioned_sidebars/version-10.x-sidebars.json +++ b/versioned_sidebars/version-10.x-sidebars.json @@ -307,7 +307,7 @@ }, { "type": "doc", - "id": "npmrc" + "id": "settings" }, { "type": "doc",