chore: fix gapic-generator-typescript build scripts for easier local development#8103
chore: fix gapic-generator-typescript build scripts for easier local development#8103
Conversation
There was a problem hiding this comment.
Code Review
This pull request transitions the gapic-generator-typescript package from a Bazel-based build system to a standard TypeScript and npm workflow. Key changes include replacing Bazel commands with tsc and mocha, updating JSON import syntax to use the with keyword, and adjusting the protoc binary path validation. Review feedback identifies potential compilation errors caused by restricted type definitions in tsconfig.json, cross-platform compatibility issues with Unix-specific commands in the compile script, and potential file state inconsistencies during the prepack process.
GautamSharda
left a comment
There was a problem hiding this comment.
Do you expect this change in the generator to eventually change the libraries in google-cloud-node? If not, why not? If so, do you know whether the resulting changes would increase or decrease diffs produced by librarian generate?
|
There is one change which may have a meaningful (but actually desired) impact on generation output:
Other than that, none of the core generation logic has been modified. The changes are focused on:
|
Today, building the GAPIC generator depends on Bazel, which doesn't work in the packages default state.
This PR, removes the dependency on Bazel from the package.json and enables the following commands to work again:
npm run compilenow successfully builds the artifacts required to run the generator and places them in abuild/directory.npm linknow successfully creates executable scripts, puts them in yournode_modules/.binfolder, and adds them to your path so they can be run immediately.In addition to fixing the
compileandlinkfunctionality, I also fixed thenpm run testscript so we can verify our changes locally. I also deleted test scripts which point to files no longer defined in the source code.Example output from running locally: