Files
pnpm/auth/commands/src
shiminshen 56f3851904 feat(auth): implement pnpm login --scope (#11727)
The online documentation has long listed `pnpm login [--registry <url>] [--scope <scope>]`,
but the CLI only ever accepted `--registry`. `pnpm login --scope foo` errored with
`Unknown option: 'scope'` and there was no way to associate a scope with a registry
through the login command — users had to edit `.npmrc` by hand.

This change wires `--scope` through:
  - `cliOptionsTypes` / `rcOptionsTypes` declare the option.
  - `help()` documents it.
  - After the token is written, `@<scope>:registry=<registry>` is written into the same
    auth file (`~/.config/pnpm/auth.ini`), which `config.reader` already accepts as a
    source of `@scope:registry=` mappings.
  - Scope normalization: `--scope foo` and `--scope @foo` both produce `@foo`. Blank
    values (`""`, `" "`, `"@"`) are treated as unset rather than writing a broken
    `@:registry=` entry.

Ref: #11716

Co-authored-by: shiminshen <16914659+shiminshen@users.noreply.github.com>
2026-05-19 23:07:09 +02:00
..
2026-04-07 11:19:42 +02:00
2026-04-07 11:19:42 +02:00
2026-04-07 11:19:42 +02:00