feat: add support for linking js_library as 1p npm deps#1646
Merged
Conversation
9ecf058 to
0811375
Compare
This was referenced Apr 13, 2024
Closed
6e33874 to
3ba6560
Compare
jbedard
reviewed
Apr 14, 2024
gregmagolan
commented
Apr 14, 2024
3ba6560 to
aaf9a93
Compare
Member
Doesn't that expose the entire |
jbedard
reviewed
Apr 14, 2024
90bb9c8 to
90ea1bc
Compare
90ea1bc to
df3238b
Compare
jbedard
approved these changes
Apr 15, 2024
gregmagolan
added a commit
that referenced
this pull request
Apr 19, 2024
jbedard
pushed a commit
that referenced
this pull request
Apr 19, 2024
gregmagolan
added a commit
that referenced
this pull request
Apr 20, 2024
gregmagolan
added a commit
that referenced
this pull request
Apr 21, 2024
gregmagolan
added a commit
that referenced
this pull request
Apr 21, 2024
gregmagolan
added a commit
that referenced
this pull request
Apr 22, 2024
gregmagolan
added a commit
that referenced
this pull request
Apr 23, 2024
gregmagolan
added a commit
that referenced
this pull request
Apr 24, 2024
gregmagolan
added a commit
that referenced
this pull request
Apr 26, 2024
gregmagolan
added a commit
that referenced
this pull request
Apr 28, 2024
gregmagolan
added a commit
that referenced
this pull request
Apr 28, 2024
gregmagolan
added a commit
that referenced
this pull request
Apr 29, 2024
gregmagolan
added a commit
that referenced
this pull request
May 6, 2024
jbedard
pushed a commit
that referenced
this pull request
May 6, 2024
gregmagolan
added a commit
that referenced
this pull request
May 7, 2024
gregmagolan
added a commit
that referenced
this pull request
May 7, 2024
gregmagolan
added a commit
that referenced
this pull request
May 7, 2024
gregmagolan
added a commit
that referenced
this pull request
May 7, 2024
gregmagolan
added a commit
that referenced
this pull request
May 7, 2024
This was referenced May 7, 2024
jbedard
pushed a commit
that referenced
this pull request
May 8, 2024
gregmagolan
added a commit
that referenced
this pull request
May 10, 2024
gregmagolan
added a commit
that referenced
this pull request
May 10, 2024
gregmagolan
added a commit
that referenced
this pull request
May 13, 2024
jbedard
pushed a commit
to jbedard/rules_js
that referenced
this pull request
May 14, 2024
jbedard
pushed a commit
that referenced
this pull request
May 14, 2024
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1092.
This PR adds the ability to link
js_librarytargets at 1p deps in addition tonpm_packagetargets. Usingjs_libraryto link results in a symlink into thejs_librarypackage directory in the output tree instead of acopy_to_directoryof thenpm_packageTreeArtifact. This more closely matches how pnpm handles 1p linked deps and it fixes the long standing bug with 1p peer deps reported in #1092.The new test case
//examples/npm_deps:test9illustrates how the//examples/npm_package/packages/pkg_d:pkg_djs_librarythat is linkedexamples/npm_deps/package.jsonas a"@mycorp/pkg-d": "workspace:*"1p npm package in the pnpm lock file.This is one extra level of indirection vs. what pnpm does but the result is the same in that the npm package 1p symlink
examples/npm_deps/node_modules/@mycorp/pkg-dcan be resolved back to the output-tree package of thejs_librarytargetexamples/npm_package/packages/pkg_d. In pnpm, the symlinks goes directly there and not through the package store and, of course, it points into the source tree since there is no concept of an bazel output tree outside of bazel. Under rules_js the extra level of indirection fits nicer into the current support fornpm_packageand so makes for simpler code to support both modes.Type of change
Test plan