-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
javascript: Add an explicit npm_distribution
target instead of coupling to node_package
#18925
javascript: Add an explicit npm_distribution
target instead of coupling to node_package
#18925
Conversation
I do prefer this interface change regardless. |
882b004
to
919abae
Compare
To prepare for more targets having PackageJsonSourceField
919abae
to
d753b54
Compare
@stuhood sorry, not following what you are referring to as different in the Docker backend? Edit: ah, I looked at the code, now I see the disussion in the PR description, reading up on that... Edit2: right, think I get it now. Meaning, that perhaps the docker backend should only work on direct dependencies, not transitive, which would've also avoided this issue. I think that could make sense, but would rule out the use of things like grouping a set of packageables using |
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
The coupling of
node_package
(generated from thepackage_json
target) with thepackage
goal caused some unwanted side effects when trying to integrate with other backends,docker
to be exact.Because of the way the dependency graph is constructed between in-repo nodejs packages, this caused package:able targets to always be included.
See this bit of code:
pants/src/python/pants/backend/docker/util_rules/docker_build_context.py
Line 280 in f95ed94
The transitive dependencies of the
docker_image
currently causes packaging of workspace packages, even though you probably do not want to include the resulting tarballs at all.Even worse, some package manager + workspace combinations are flat out broken, see pnpm/pnpm#4351.
This solution "moves" the package:able target out of the dependency graph by placing it as standalone thing, outside of the automagically constructed dependencies.
Fixes #18922
This PR does not provide a work-around for the linked PNPM issue.