feat(node): support pnpm binaries in monorepo workspaces - #586
Open
iloveitaly wants to merge 2 commits into
Open
feat(node): support pnpm binaries in monorepo workspaces#586iloveitaly wants to merge 2 commits into
iloveitaly wants to merge 2 commits into
Conversation
- Add a new example project to reproduce an issue where pnpm workspace binaries are not correctly linked during build scripts. - Includes a basic monorepo structure with two packages, where package-b depends on a binary provided by package-a. Generated-by: aiautocommit
- Add Bin field to PackageJson model to detect executable definitions. - Update install logic to copy the full workspace layer when binaries are present, ensuring they are correctly linked. - Restrict secret exposure during install to only when lifecycle scripts are defined, excluding binary-only workspaces for improved security. Generated-by: aiautocommit
|
Hello @iloveitaly do you have instructions on how I can test it on my local repo and then maybe we can later get it merged? |
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.
Motivation
In pnpm monorepos, builds fail when one workspace package exposes a
binand another depends on it viaworkspace:*. Railpack runspnpm installbefore workspace source files are copied, so pnpm cannot link the binary and downstream build scripts cannot find it.Fixes #584
Description
Detect workspace packages with
binentries and copy the full workspace layer before install, matching the approach already used for lifecycle scripts and local file dependencies. Secret exposure during install is limited to workspaces that define lifecycle scripts, so binary-only workspaces do not receive secrets unnecessarily.Test
examples/node-pnpm-monorepo-binariesintegration test wherepackage-brunspackage-a'shello-clibin during buildPackageJson.HasBin()andWorkspace.HasPackageBins()