chore: workaround npm/cli#3466 when bundling internal deps #9536
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.
Works around npm/cli#3466 when bundling internal dependencies using the bundleDependencies package.json property.
This change works in tandem with the npm pack/publish process -- when we run
developer/src/kmc/build.sh publish
(orpack
), we end up withnpm version
stomping on all our package.json files, so the repo is dirty after this. We need a copy of the top-level package.json before this stomping happens, in order to get a simple map of the location of each of our internal dependencies, from thedependencies
property (it would be possible to figure this out with a lot more parsing of our package.json files, but this is simpler).This means, in future, we should avoid publishing our internal dependencies such as those under common/ to npm, as they serve no practical purpose there.
I will cherry-pick this commit onto my epic-package-metadata branch in order to move it forward, but felt like this belonged separately.
Note: there are not packages making use of this functionality in this branch; see #9535 for this in use in kmc-keyboard-info, kmc-model-info.
@keymanapp-test-bot skip