Repository navigation
refactor(install): extract pnpm installation logic to internal/tool/pnpm - #7159
Merged
quirogas merged 6 commits intoAug 5, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the installation of Node.js tools by delegating PNPM tool installation logic from the nodejs and php packages to a centralized internal/tool/pnpm package. It exports several error variables from the pnpm package, adds robust test coverage for the refactored pnpm package, and introduces new tests for staging package movements in nodejs. There are no review comments, and I have no feedback to provide.
Extract generic `pnpm` package installation logic from `internal/librarian/nodejs/install.go` into a shared standalone package at `internal/tool/pnpm`. Previously, PHP client library generation (`internal/librarian/php/install.go`) invoked `nodejs.InstallPNPM`, creating an undesired cross-package coupling between the PHP and Node.js toolchains. Extracting this functionality into `internal/tool/pnpm`—patterned after `internal/tool/pip`—centralizes binary resolution, caching, and error handling into a dedicated tool package that both language generators consume independently. This modular foundation cleanly paves the way for upcoming declarative upgrades to pnpm v8+. For googleapis#6857
quirogas
force-pushed
the
refactor/6857-pnpm-install-tool
branch
from
August 1, 2026 06:08
d738d15 to
5ec853b
Compare
quirogas
marked this pull request as ready for review
August 1, 2026 06:13
JoeWang1127
reviewed
Aug 2, 2026
…nges Remove redundant comment in PHP installation routine, rename internal environment getter function to `env` to eliminate package naming stutter, return an explicit error when `SrcDir` is empty instead of relying on Node-specific fallbacks, and revert unrelated generation unit tests to preserve PR atomicity. For googleapis#6857
…l' into refactor/6857-pnpm-install-tool
Contributor
|
Can you fix the unit tests? |
JoeWang1127
approved these changes
Aug 4, 2026
quirogas
enabled auto-merge (squash)
August 5, 2026 20:01
sofisl
pushed a commit
to sofisl/librarian
that referenced
this pull request
Aug 10, 2026
…npm (googleapis#7159) Extract generic `pnpm` package installation logic from `internal/librarian/nodejs/install.go` into a shared standalone package at `internal/tool/pnpm`. Previously, PHP client library generation (`internal/librarian/php/install.go`) invoked `nodejs.InstallPNPM`, creating a cross-package dependency between PHP and Node.js toolchains. Extracting this functionality into `internal/tool/pnpm`—patterned after `internal/tool/pip`—centralizes binary resolution, caching, and error handling into a dedicated tool package that both language generators consume independently. This modular foundation cleanly paves the way for upcoming declarative upgrades to pnpm v8+. For googleapis#6857
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.
Extract generic
pnpmpackage installation logic frominternal/librarian/nodejs/install.gointo a shared standalone package atinternal/tool/pnpm.Previously, PHP client library generation (
internal/librarian/php/install.go) invokednodejs.InstallPNPM, creating a cross-package dependency between PHP and Node.js toolchains. Extracting this functionality intointernal/tool/pnpm—patterned afterinternal/tool/pip—centralizes binary resolution, caching, and error handling into a dedicated tool package that both language generators consume independently. This modular foundation cleanly paves the way for upcoming declarative upgrades to pnpm v8+.For #6857