Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: workaround npm/cli#3466 when bundling internal deps #9536

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

mcdurdin
Copy link
Member

@mcdurdin mcdurdin commented Sep 1, 2023

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 (or pack), we end up with npm 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 the dependencies 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

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` (or `pack`), we end up with
`npm 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 the `dependencies` 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.
@keymanapp-test-bot keymanapp-test-bot bot added this to the A17S21 milestone Sep 1, 2023
@mcdurdin mcdurdin marked this pull request as draft September 1, 2023 13:50
@mcdurdin mcdurdin marked this pull request as ready for review September 1, 2023 13:55
@mcdurdin mcdurdin modified the milestones: A17S21, A17S22 Sep 15, 2023
@mcdurdin mcdurdin merged commit cc82a3c into master Sep 26, 2023
@mcdurdin mcdurdin deleted the chore/npm-pack-bundling branch September 26, 2023 04:36
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 17.0.181-alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants