Skip to content

Expose pnpm and bun workspace packages as individual build targets#1689

Draft
jagonalez wants to merge 1 commit intomasterfrom
feat/pnpm-bun-workspace-build-targets
Draft

Expose pnpm and bun workspace packages as individual build targets#1689
jagonalez wants to merge 1 commit intomasterfrom
feat/pnpm-bun-workspace-build-targets

Conversation

@jagonalez
Copy link
Copy Markdown
Contributor

Summary

Extends workspace build target support to pnpm and bun projects, completing the set for all Node.js lockfile formats (yarn, npm, pnpm, bun). Follow-up to #1643.

  • Adds resolveImporterPaths to map package names (build targets) to pnpm lockfile importer paths (e.g. ".", "packages/a")
  • Adds resolveBunWorkspacePaths to map package names to bun lockfile workspace keys (uses "" for root, relative paths for members)
  • Updates buildGraph in PnpmLock.hs and BunLock.hs to accept an optional filter, scoping analysis to selected workspace members
  • Preserves the existing v9 environment propagation logic in PnpmLock.buildGraph, with filtering applied to the importer list

Combines and supersedes #1644 and #1654.

Test plan

  • resolveImporterPaths tests: root → ".", workspace members → relative paths, Nothing for ProjectWithoutTargets
  • resolveBunWorkspacePaths tests: root → "", workspace members → relative paths, Nothing for ProjectWithoutTargets
  • buildGraph filtering tests for pnpm: root-only filter excludes workspace deps, workspace-only filter excludes root deps
  • buildGraph filtering tests for bun: root-only filter excludes workspace deps, workspace-only filter excludes root deps
  • Existing v9 env propagation tests (shared deps, local dep, multi-version) still pass
  • cabal build clean
  • Manual test with a real pnpm workspace project
  • Manual test with a real bun workspace project

🤖 Generated with Claude Code

Extends workspace build target support to pnpm and bun projects,
completing the set for all Node.js lockfile formats (yarn, npm, pnpm, bun).

- Adds `resolveImporterPaths` to map package names (build targets) to
  pnpm lockfile importer paths (e.g. `"."`, `"packages/a"`)
- Adds `resolveBunWorkspacePaths` to map package names to bun lockfile
  workspace keys (uses `""` for root, relative paths for members)
- Updates `buildGraph` in `PnpmLock.hs` and `BunLock.hs` to accept an
  optional filter, scoping analysis to selected workspace members
- Preserves the existing v9 environment propagation logic in
  `PnpmLock.buildGraph`, with filtering applied to the importer list

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant