-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
feat: add support for linking js_library as 1p npm deps #1646
Merged
Conversation
This file contains 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
gregmagolan
force-pushed
the
FR_link_js_library
branch
5 times, most recently
from
April 13, 2024 22:11
9ecf058
to
0811375
Compare
This was referenced Apr 13, 2024
Closed
gregmagolan
force-pushed
the
FR_link_js_library
branch
7 times, most recently
from
April 14, 2024 16:50
6e33874
to
3ba6560
Compare
jbedard
reviewed
Apr 14, 2024
gregmagolan
commented
Apr 14, 2024
gregmagolan
force-pushed
the
FR_link_js_library
branch
from
April 14, 2024 17:09
3ba6560
to
aaf9a93
Compare
Doesn't that expose the entire |
jbedard
reviewed
Apr 14, 2024
gregmagolan
force-pushed
the
FR_link_js_library
branch
2 times, most recently
from
April 15, 2024 16:26
90bb9c8
to
90ea1bc
Compare
gregmagolan
force-pushed
the
FR_link_js_library
branch
from
April 15, 2024 16:28
90ea1bc
to
df3238b
Compare
jbedard
approved these changes
Apr 15, 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
jbedard
pushed a commit
to jbedard/rules_js
that referenced
this pull request
May 16, 2024
gregmagolan
added a commit
that referenced
this pull request
May 20, 2024
gregmagolan
added a commit
that referenced
this pull request
May 20, 2024
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_library
targets at 1p deps in addition tonpm_package
targets. Usingjs_library
to link results in a symlink into thejs_library
package directory in the output tree instead of acopy_to_directory
of thenpm_package
TreeArtifact. 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:test9
illustrates how the//examples/npm_package/packages/pkg_d:pkg_d
js_library
that is linkedexamples/npm_deps/package.json
as 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-d
can be resolved back to the output-tree package of thejs_library
targetexamples/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_package
and so makes for simpler code to support both modes.Type of change
Test plan