Skip to content

fix(generator): add long dependency to CJS template and update baselines#8685

Open
suztomo wants to merge 2 commits into
googleapis:mainfrom
suztomo:fix-generator-template-long
Open

fix(generator): add long dependency to CJS template and update baselines#8685
suztomo wants to merge 2 commits into
googleapis:mainfrom
suztomo:fix-generator-template-long

Conversation

@suztomo

@suztomo suztomo commented Jun 18, 2026

Copy link
Copy Markdown
Member

This PR adds the missing "long" dependency to the CommonJS package.json template in gapic-generator-typescript, and updates the baselines to match.

Why long is in devDependencies

long is only required during the compilation phase of the library itself to resolve type definitions in the generated protos/protos.d.ts (which has import Long = require("long");). It is not directly imported in the runtime JavaScript code. At runtime, long is transitively resolved via google-gax -> protobufjs, so it does not need to be a production dependency of the generated library.

GAX

It also updates the google-gax dependency version to ^5.0.0 in the template to match the recently introduced google-maps-mapmanagement package:
https://github.com/googleapis/google-cloud-node/blob/6f9710c504c5272dfb59a77c7da98235ed9cf3ff/packages/google-maps-mapmanagement/package.json. The latest (non-RC) GAX version is 5.0.7: https://www.npmjs.com/package/google-gax?activeTab=versions.

@suztomo suztomo requested a review from a team as a code owner June 18, 2026 18:05

@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 adds the long package to devDependencies in multiple baseline and template package.json files. The reviewer correctly points out that since long is used at runtime by the generated GAPIC code, it must be declared under dependencies rather than devDependencies to avoid runtime MODULE_NOT_FOUND errors for consumers.

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