docs: recommend pnpm-workspace.yaml for pnpm-registry config

The pnpm-registry setting is workspace-specific, not a global npm config.
Move it from pnpmConfigFileKeys to excludedPnpmKeys (workspace-only
settings) and update both READMEs to show pnpm-workspace.yaml usage.
This commit is contained in:
Zoltan Kochan
2026-04-08 16:13:35 +02:00
parent 04283c753e
commit cb92b01e95
3 changed files with 16 additions and 6 deletions

View File

@@ -41,7 +41,6 @@ export const pnpmConfigFileKeys = [
'npm-path',
'npmrc-auth-file',
'package-import-method',
'pnpm-registry',
'prefer-frozen-lockfile',
'prefer-offline',
'prefer-symlinked-executables',
@@ -103,6 +102,7 @@ export const excludedPnpmKeys = [
'pack-gzip-level',
'patches-dir',
'pnpmfile',
'pnpm-registry',
'package-manager-strict',
'package-manager-strict-version',
'prefer-workspace-packages',

View File

@@ -36,8 +36,8 @@ console.log(`${stats.alreadyInStore} cached, ${stats.filesToDownload} files down
## Configuration
Set in `.npmrc` to enable automatically during `pnpm install`:
Add to `pnpm-workspace.yaml` to enable automatically during `pnpm install`:
```ini
pnpm-registry=http://localhost:4000
```yaml
pnpmRegistry: http://localhost:4000
```

View File

@@ -70,11 +70,21 @@ Terminal 2 — use it from any project:
```bash
cd my-project
echo 'pnpm-registry=http://localhost:4873' >> .npmrc
```
Add to `pnpm-workspace.yaml`:
```yaml
pnpmRegistry: http://localhost:4873
```
Then run:
```bash
pnpm install
```
That's it. pnpm will resolve dependencies on the server, download only the files missing from your local store, and link `node_modules` as usual. Remove the `.npmrc` line to go back to normal behavior.
That's it. pnpm will resolve dependencies on the server, download only the files missing from your local store, and link `node_modules` as usual. Remove the `pnpmRegistry` line to go back to normal behavior.
## API