Skip to content

fix: synchronize default registry from pnpm-workspace.yaml for login/logout commands#11744

Merged
zkochan merged 1 commit into
pnpm:mainfrom
minijus:10099
May 19, 2026
Merged

fix: synchronize default registry from pnpm-workspace.yaml for login/logout commands#11744
zkochan merged 1 commit into
pnpm:mainfrom
minijus:10099

Conversation

@minijus

@minijus minijus commented May 19, 2026

Copy link
Copy Markdown
Contributor

Closes #10099

Summary by CodeRabbit

Bug Fixes

  • pnpm login and pnpm logout now correctly respect the default registry configuration specified in pnpm-workspace.yaml, ensuring consistent registry behavior across workspace commands.

Review Change Stack

@minijus minijus requested a review from zkochan as a code owner May 19, 2026 11:50
@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f8d34b0a-ee02-4907-9a03-083a0e07c38f

📥 Commits

Reviewing files that changed from the base of the PR and between 9a8675d and 6d7d39b.

📒 Files selected for processing (5)
  • .changeset/login-workspace-registry.md
  • config/reader/src/index.ts
  • config/reader/test/index.ts
  • registry-access/commands/src/ping.ts
  • registry-access/commands/test/ping.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Compile & Lint
  • GitHub Check: Analyze (javascript)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Follow Standard Style with trailing commas, prefer functions over classes, declare functions after they are used (rely on hoisting), and use a single options object for functions with more than two or three arguments
Sort imports in three groups: standard libraries, external dependencies (alphabetically), then relative imports
Write code that explains itself through clear naming and types — do not write comments that merely restate what the code already says; use comments only for non-obvious reasons, hidden invariants, or workarounds

Files:

  • config/reader/test/index.ts
  • config/reader/src/index.ts
  • registry-access/commands/src/ping.ts
  • registry-access/commands/test/ping.ts
🧠 Learnings (1)
📚 Learning: 2026-05-14T09:04:00.133Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11622
File: resolving/npm-resolver/test/publishedBy.test.ts:350-354
Timestamp: 2026-05-14T09:04:00.133Z
Learning: In the pnpm/pnpm repository, ESLint is the authoritative style linter. Do not raise review findings for missing trailing commas in multiline function calls (e.g., `fs.writeFileSync(...)`) when this repo’s ESLint configuration does not report them and lint passes. Prefer deferring to the ESLint results for this specific trailing-comma rule rather than enforcing it manually in code review.

Applied to files:

  • config/reader/test/index.ts
  • config/reader/src/index.ts
  • registry-access/commands/src/ping.ts
  • registry-access/commands/test/ping.ts
🔇 Additional comments (5)
.changeset/login-workspace-registry.md (1)

1-8: LGTM!

config/reader/src/index.ts (1)

464-470: LGTM!

config/reader/test/index.ts (1)

625-660: LGTM!

registry-access/commands/src/ping.ts (1)

7-7: LGTM!

Also applies to: 49-49

registry-access/commands/test/ping.ts (1)

70-70: LGTM!


📝 Walkthrough

Walkthrough

This PR fixes pnpm login and pnpm logout to respect registries.default from pnpm-workspace.yaml. The config reader now synchronizes workspace-configured registry defaults to the top-level registry field, and the ping command API is simplified to use a direct registry parameter instead of a registries object.

Changes

Workspace Registry Support

Layer / File(s) Summary
Release documentation
.changeset/login-workspace-registry.md
Patch version bumps for @pnpm/config.reader, @pnpm/registry-access.commands, and pnpm recording the fix for login/logout command workspace registry support.
Config registry synchronization
config/reader/src/index.ts, config/reader/test/index.ts
Config reader adds post-processing to sync pnpmConfig.registry from registries.default when registry was not explicitly set; tests verify synchronization behavior and CLI flag precedence.
Ping command API simplification
registry-access/commands/src/ping.ts, registry-access/commands/test/ping.ts
PingOptions interface now accepts only registry?: string instead of registries?: Registries; handler derives registry URL directly from opts.registry with fallback to https://registry.npmjs.org/, and all test cases updated to use simplified API.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

area: cli/dlx

Suggested reviewers

  • zkochan

Poem

🐰 A workspace whispers its registry way,
Through config cascades, defaults now stay,
Ping commands lean down, simplified true,
Login respects what workspaces knew! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: synchronizing the default registry from pnpm-workspace.yaml for login/logout commands, which directly addresses the core problem in the changeset.
Linked Issues check ✅ Passed The PR implements the required fix: synchronizing default registry from pnpm-workspace.yaml [#10099] by updating config reader, ping command, and adding tests to ensure login/logout respect the workspace registry configuration.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the registry synchronization feature. The changeset, config reader updates, ping command changes, and tests all focus on the core objective of supporting workspace registry configuration for login/logout.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zkochan zkochan merged commit d1b340f into pnpm:main May 19, 2026
6 of 8 checks passed
zkochan added a commit that referenced this pull request May 19, 2026
…kspace contributes it (#11754)

The sync introduced in #11744 unconditionally overwrote the unnormalized
registry value parsed from .npmrc with the normalized registries.default,
causing a trailing slash to appear in config.registry when the user only
configured a registry in .npmrc.

Restrict the sync to cases where pnpm-workspace.yaml actually contributes
a default registry different from what .npmrc provided.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm login doesn't support registry in pnpm-workspace.yaml

2 participants