feat(npm): use pnpm publish for npm_package#2868
Conversation
32f95fc to
47e4ca9
Compare
|
I wonder if we should be using |
|
Some history, originally it was decided that IMO your reasons for this PR show that using @luciomartinez want to try just using |
47e4ca9 to
881c806
Compare
|
Thanks! I pushed fixes as suggested:
On using |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 881c8067a3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
CI note: two checks are currently failing:
The useful error I found in the failed job logs is: This looks unrelated to this PR: the changes here are limited to |
|
That might be github being flaky?
|
That's right. I'll re-trigger it by pushing fixes to the issue reported by Codex... |
|
I manually got the CI jobs to re-run and they appear to be passing 👍 |
881c806 to
b74889e
Compare
|
Regarding using pnpm publish 100% of the time... a robot (2 actually) told me that the CLI args are (intentionally) almost equivalent, the differences it did point out are things that I think are not applicable in bazel or which we handled such as If someone complains we (or I, using a robot) can maybe revert back to your |
b74889e to
af42cc4
Compare
|
@jbedard I'm with you buddy! I took that direction and pushed a simpler version:
|
456a525 to
a252556
Compare
a252556 to
0b29d7f
Compare
0b29d7f to
5d04f8c
Compare
What
Changes
npm_package(publishable = True)so the generated<name>.publishtarget runspnpm publishinstead ofnpm publish.This removes the proposed
publish_toolAPI and keeps the public target shape unchanged. Apnpm_binaryoverride remains available for custom pnpm repository names; by default it uses@pnpm//:pnpm.The publish wrapper now:
bazel-binBUILD_WORKSPACE_DIRECTORYis available, copying in onlypnpm-workspace.yamland.npmrcwhen present--no-git-checksbecause Bazel publishes generated outputinclude_npm = Truefor pnpm <=10, where registry operations may delegate to npmWhy
pnpm publishhandles pnpm workspace publishing semantics such as replacingcatalog:dependency specs before packing.npm publishdoes not understand those pnpm-specific specs.The isolated temporary cwd exposes the workspace-level pnpm settings required for publishing without making the source workspace the child process cwd. Using pnpm directly also avoids adding a new publish-tool selection API while preserving the existing
<name>.publishentrypoint for users.Notes
package.json, not only that dry-run publish exits successfully..npmrcand environment-based configuration remain available through the inherited process environment.