feat: add pnpm docs command and home alias#11244
Merged
Merged
Conversation
3b9618f to
c005529
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the pnpm CLI with new registry/inspection commands, primarily introducing pnpm docs (alias pnpm home) to open a package URL in the browser, and also adding native registry “starring” commands (star, unstar, stars, whoami).
Changes:
- Add
pnpm docs/pnpm homecommand that looks up registry metadata and opens a derived URL. - Add native
star,unstar,stars, andwhoamicommands and wire them into the pnpm CLI. - Refactor
pnpm viewto reuse shared registry metadata fetching logic (fetchPackageInfo).
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| deps/inspection/commands/src/docs/index.ts | Implements the new docs/home command. |
| deps/inspection/commands/test/docs.ts | Adds tests for docs command behavior (mocking open). |
| deps/inspection/commands/src/fetchPackageInfo.ts | Introduces shared helper to fetch/shape registry package info. |
| deps/inspection/commands/src/view/index.ts | Refactors view to use fetchPackageInfo. |
| deps/inspection/commands/src/index.ts | Exports the new docs command module. |
| deps/inspection/commands/package.json | Adds open dependency for browser launching. |
| registry-access/commands/src/star.ts | Implements star, unstar, stars, and whoami handlers. |
| registry-access/commands/test/star.ts | Adds integration tests for whoami and star/unstar. |
| registry-access/commands/src/index.ts | Exports the new registry-access command definitions. |
| pnpm/src/cmd/index.ts | Registers docs, star, unstar, stars, whoami in the CLI. |
| pnpm/src/cmd/notImplemented.ts | Removes star-related commands from the “not implemented” list. |
| package.json | Adds Verdaccio plugin dependencies at repo root. |
| pnpm-workspace.yaml | Adds Verdaccio plugin versions to the catalog. |
| pnpm-lock.yaml | Lockfile updates for new dependencies/plugins. |
| .changeset/fast-cars-find.md | Changeset for docs/home. |
| .changeset/feat-star-commands.md | Changeset for star-related commands. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c005529 to
530ad49
Compare
- Remove 'docs' and 'home' from NOT_IMPLEMENTED_COMMANDS to prevent not-implemented handlers from overriding the real implementations - Change fallback URL from npmjs.com to npmx.dev - Remove bugs URL as a docs fallback (it's an issue tracker, not docs) - Fix ESM mock in tests: use jest.unstable_mockModule instead of jest.mock
Replace the hand-rolled platform-specific execFile logic with the open npm package, which handles WSL, Docker-in-WSL, and Windows edge cases better. This removes the execFile dependency injection from promptBrowserOpen, OtpContext, LoginContext, and SharedContext.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 20 changed files in this pull request and generated 4 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- docs: use www.npmjs.com fallback (not npmx.dev) and validate homepage URL is http(s) before opening - promptBrowserOpen: validate authUrl protocol before passing to open(), and guard against synchronous throws from open()
zkochan
approved these changes
Apr 14, 2026
kairosci
added a commit
to kairosci/pnpm
that referenced
this pull request
Apr 22, 2026
* feat: add pnpm docs command and home alias * chore: update manifests * fix: address review comments for pnpm docs command - Remove 'docs' and 'home' from NOT_IMPLEMENTED_COMMANDS to prevent not-implemented handlers from overriding the real implementations - Change fallback URL from npmjs.com to npmx.dev - Remove bugs URL as a docs fallback (it's an issue tracker, not docs) - Fix ESM mock in tests: use jest.unstable_mockModule instead of jest.mock * refactor: use open package for browser opening in promptBrowserOpen Replace the hand-rolled platform-specific execFile logic with the open npm package, which handles WSL, Docker-in-WSL, and Windows edge cases better. This removes the execFile dependency injection from promptBrowserOpen, OtpContext, LoginContext, and SharedContext. * fix: address copilot review comments - docs: use www.npmjs.com fallback (not npmx.dev) and validate homepage URL is http(s) before opening - promptBrowserOpen: validate authUrl protocol before passing to open(), and guard against synchronous throws from open() * fix: restore npmx.dev fallback for pnpm docs * chore: expand changeset with web-auth refactor impact --------- Co-authored-by: Zoltan Kochan <z@kochan.io>
zkochan
added a commit
that referenced
this pull request
May 6, 2026
…geset issue link normalizeRepositoryUrl now strips trailing slashes so a repository URL like `https://github.com/foo/bar/` becomes `https://github.com/foo/bar/issues` rather than `...//issues`. Added a regression test. The changeset previously linked to #11244, which is the docs-command PR, not bugs — removed the bogus reference.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the 'pnpm docs' command and its alias 'pnpm home'. This command fetches package metadata from the registry and opens the homepage or documentation URL in the default browser. When the package has no valid homepage, it falls back to https://npmx.dev/package/.