-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
[FR]: Automatically generate binary and library targets #1728
Comments
The desired API in your example above is nice but its not currently possible since the pnpm-lock.yaml file only says that bins exist and not what the bins are. This means that we can only generate a generic |
We had an old FR to pnpm to do this but the pnpm team preferred not to include the list of bins in the lock file: pnpm/pnpm#5131 |
I see. How about library dependencies? Also, how does rules_js generate |
The shape of the For the |
Would it be non-sense to allow users to eagerly fetch the npm packages for all of this? This solution wouldn't be very different from |
With Bazel I don't think that is the right shape as it is canonical to have fetches of 3p deps be lazy. If you're in a large monorepo, for example, and only working on go, you shouldn't need to fetch any of the deps of the typescript part of the repo. There is room, however, for a tool to be run outside of Bazel and create a manifest of "bin" files as well as "lifecycle hooks" (which are now needed as of pnpm v9 -- see #1734) and have that manifest checked into the repository along with the pnpm lock file. In the pnpm issue linked above re: bin entries, one of the maintainers suggested that approach as preferable to putting bin entry details into the lockfile. That could be a change made upstream in pnpm itself where it creates both the lock file and a manifest file which rules_js then uses. Or it could be a stand-alone tool that could be optional to run for users who want better "bin" aliases and automatic lifecycle hook detection. |
That does sound reasonable! A kind of package-lock-metadata.json. I guess this could be run as a workspace post-install hook. |
What is the current behavior?
For library targets, users must use
npm_link_all_packages
to link libraries before using:node_modules
. For binary targets, users need to import thebin
object for a library and manually declare it.Describe the feature
Instead of:
let's do
The text was updated successfully, but these errors were encountered: