Skip to content

feat: PNPM workspace - #8973

Draft
bshaffer wants to merge 79 commits into
mainfrom
pnpm
Draft

feat: PNPM workspace#8973
bshaffer wants to merge 79 commits into
mainfrom
pnpm

Conversation

@bshaffer

@bshaffer bshaffer commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Migrate to PNPM workspace. This will speed up dependency installation, reduces disk space usage by globally hoisting packages, and provides stricter dependency resolution.

  • Added pnpm-workspace.yaml/pnpm-lock.yaml to manage all dependencies.
  • Udated presubmit.yaml and windows-presubmit.yaml to use pnpm install --frozen-lockfile
  • Modified ci/run_single_test.sh use PNPM workspace and ci/run_conditional_tests.sh to bypass deprecations on Node v22.
  • Removed nested npm execution chains from core/packages/gax/package.json, updated pack-n-play test fixtures
  • Fixed TypeScript discrepancies to ensure npm run compile passes with new PNPM dependency tree.
  • Removed package-lock.json from all .gitignore files as a best practice: since PNPM is now the source of truth, package-lock.json should never exist. If a developer accidentally runs npm install out of habit, the untracked lockfile will be highlighted by git status, which will hopefully be enough to indicate the mistake.
  • Updated CONTRIBUTING.md files to use pnpm install when setting up local development environments.
  • Updated root package.json to enforce pnpm as the strict package manager via only-allow and Corepack to prevent developers from accidentally running npm install and breaking the workspace

@bshaffer
bshaffer requested review from a team as code owners July 27, 2026 17:24
@bshaffer
bshaffer marked this pull request as draft July 27, 2026 17:24
@github-actions
github-actions Bot requested a review from shivanee-p July 27, 2026 17:24

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the repository to a pnpm workspace, updating numerous .gitignore and CONTRIBUTING.md files, adjusting CI scripts, and updating generated protobuf files. Feedback on these changes highlights several improvement opportunities: nested npm scripts in gax/package.json should be updated to pnpm, stubbed tests in pack-n-play should be explicitly skipped using it.skip rather than left empty, and relative file: paths in package dependencies should be replaced with the workspace: protocol. Additionally, the reviewer advises against using 'as any' type assertions in apirequest.ts and hapi.ts, recommending instead that workspace dependency versions be aligned or safer type casting be implemented to preserve TypeScript's type safety.

Comment thread core/packages/gax/package.json Outdated
Comment thread core/dev-packages/pack-n-play/test/test.ts Outdated
Comment thread core/packages/nodejs-googleapis-common/src/apirequest.ts Outdated
Comment thread core/dev-packages/pack-n-play/test/fixtures/esm-package/package.json Outdated
Comment on lines 105 to 108
.setUrl(urlString)
.setUserAgent(getSingleHeader(req!.headers['user-agent']))
.setReferrer(getSingleHeader(req!.headers.referrer))
.setUserAgent(getSingleHeader(req!.headers['user-agent'] as any))
.setReferrer(getSingleHeader(req!.headers.referrer as any))
.setStatusCode(attemptToExtractStatusCode(req!))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using as any here discards type safety. If the type mismatch is due to req.headers being typed as IncomingHttpHeaders (where header values can be string | string[] | undefined) and getSingleHeader expecting a specific type, it is safer to cast to the expected type (e.g., string | string[] or string) or handle the undefined case explicitly, rather than using as any.

bshaffer and others added 30 commits July 29, 2026 22:30
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
# Conflicts:
#	.github/workflows/bigtable-conformance.yaml
#	.github/workflows/conformance-test.yaml
#	.github/workflows/generator-tests.yaml
#	.github/workflows/issues-no-repro.yaml
#	.github/workflows/mandatory-conformance.yaml
#	.github/workflows/update-api-list.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant