This repository was archived by the owner on Nov 18, 2025. It is now read-only.
fix: improve package.json lookup for root name#1530
Merged
sofisl merged 2 commits intogoogleapis:mainfrom Mar 23, 2024
Merged
Conversation
orgads
commented
Dec 15, 2023
aed4208 to
2561e4e
Compare
Contributor
Author
|
Rebased. |
sofisl
suggested changes
Feb 1, 2024
7173d84 to
13576ae
Compare
Contributor
Author
|
@sofisl Please review. |
13576ae to
d209b24
Compare
compileProtos seeks for package.json one directory above the one it accepts as input (typically src). Running gapic-generator-typescript with --format=esm, generates the the sources in esm/src, then compileProtos can't find package.json. When package.json is not found, the root name falls back to default and all the packages have the same root. Use walk-up-path, which is also used by npm[1]. Fixes #1529. [1] https://github.com/npm/config/blob/77a48dbe22/lib/index.js#L632
d209b24 to
e808529
Compare
Contributor
Author
|
Rebased. @sofisl ping. |
e808529 to
8eb2919
Compare
sofisl
approved these changes
Mar 23, 2024
Merged
leahecole
pushed a commit
to leahecole/gax-nodejs
that referenced
this pull request
Mar 27, 2024
compileProtos seeks for package.json one directory above the one it accepts as input (typically src). Running gapic-generator-typescript with --format=esm, generates the the sources in esm/src, then compileProtos can't find package.json. When package.json is not found, the root name falls back to default and all the packages have the same root. Use walk-up-path, which is also used by npm[1]. Fixes #1529. [1] https://github.com/npm/config/blob/77a48dbe22/lib/index.js#L632 Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
compileProtos seeks for package.json one directory above the one it accepts as input (typically src).
Running gapic-generator-typescript with --format=esm, generates the the sources in esm/src, then compileProtos can't find package.json.
When package.json is not found, the root name falls back to default and all the packages have the same root.
Use walk-up-path, which is also used by npm[1].
Fixes googleapis/google-cloud-node-core#233.
[1] https://github.com/npm/config/blob/77a48dbe22/lib/index.js#L632
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: