Skip to content

Add first-class Bun workspace manager support to workspace-tools#1113

Open
RafalFilipek wants to merge 7 commits into
microsoft:mainfrom
RafalFilipek:main
Open

Add first-class Bun workspace manager support to workspace-tools#1113
RafalFilipek wants to merge 7 commits into
microsoft:mainfrom
RafalFilipek:main

Conversation

@RafalFilipek
Copy link
Copy Markdown

workspace-tools could not reliably recognize Bun monorepos and the local patch approach (case "bun" mapped to npm) was incomplete. This change adds explicit Bun support across manager detection, utility resolution, and test fixtures.

  • Workspace manager model

    • Extended public WorkspaceManager union with "bun".
  • Manager detection

    • Added Bun lockfile detection in getWorkspaceManagerAndRoot with support for both:
      • bun.lock
      • bun.lockb
    • Updated lookup logic to handle managers mapped to multiple marker files.
  • Workspace utilities wiring

    • Added workspaces/implementations/bun.ts.
    • Wired Bun into getWorkspaceUtilities as a dedicated manager path.
    • Bun workspace pattern resolution uses package.json#workspaces semantics (same workspace-shape behavior as npm).
  • Coverage and fixtures

    • Added monorepo-basic-bun fixture.
    • Extended workspace manager detection and workspace info tests to include Bun scenarios.
  • Docs and API surface

    • Updated workspace-tools README supported managers + PREFERRED_WORKSPACE_MANAGER values.
    • Updated API report for the exported WorkspaceManager type.
export const managerFiles = {
  lerna: "lerna.json",
  rush: "rush.json",
  yarn: "yarn.lock",
  pnpm: "pnpm-workspace.yaml",
  bun: ["bun.lock", "bun.lockb"],
  npm: "package-lock.json",
} as const;

Copilot AI and others added 6 commits April 21, 2026 12:01
Agent-Logs-Url: https://github.com/RafalFilipek/lage/sessions/39cec0ca-a9e9-41f4-8f1b-984c06efbb2d

Co-authored-by: RafalFilipek <80960+RafalFilipek@users.noreply.github.com>
Agent-Logs-Url: https://github.com/RafalFilipek/lage/sessions/39cec0ca-a9e9-41f4-8f1b-984c06efbb2d

Co-authored-by: RafalFilipek <80960+RafalFilipek@users.noreply.github.com>
…EADME.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/RafalFilipek/lage/sessions/b81e1d79-1a38-41b4-bc3b-d9b148a333cf

Co-authored-by: RafalFilipek <80960+RafalFilipek@users.noreply.github.com>
…manager

Add first-class Bun workspace manager support to workspace-tools
Copilot AI review requested due to automatic review settings April 21, 2026 12:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class Bun workspace manager support to workspace-tools, so Bun monorepos can be detected and have workspace patterns resolved reliably (instead of treating Bun as npm implicitly).

Changes:

  • Extend the public WorkspaceManager type and utilities wiring to support "bun".
  • Update manager-root detection to recognize both bun.lock and bun.lockb (including multi-marker manager lookup).
  • Add Bun test coverage and a new Bun monorepo fixture; update docs + API report accordingly.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/workspace-tools/src/workspaces/implementations/getWorkspaceUtilities.ts Adds lazy-loaded Bun utilities path in the manager switch.
packages/workspace-tools/src/workspaces/implementations/getWorkspaceManagerAndRoot.ts Adds Bun lockfile markers and updates detection logic to support managers with multiple marker files.
packages/workspace-tools/src/workspaces/implementations/bun.ts Introduces Bun-specific utilities (workspace patterns via package.json#workspaces).
packages/workspace-tools/src/types/WorkspaceManager.ts Extends the exported WorkspaceManager union with "bun".
packages/workspace-tools/src/tests/workspaces/getWorkspaces.test.ts Adds Bun scenario to workspace info tests.
packages/workspace-tools/src/tests/workspaces/getWorkspaceManagerAndRoot.test.ts Adds Bun detection scenario + explicit bun.lockb detection test.
packages/workspace-tools/src/tests/setupFixture.ts Registers the new Bun fixture name in the fixture typing.
packages/workspace-tools/src/fixtures/monorepo-basic-bun/package.json Adds Bun monorepo root fixture with workspaces config.
packages/workspace-tools/src/fixtures/monorepo-basic-bun/bun.lock Adds Bun lockfile marker fixture.
packages/workspace-tools/src/fixtures/monorepo-basic-bun/README.md Documents the Bun fixture intent and expected structure.
packages/workspace-tools/src/fixtures/monorepo-basic-bun/packages/package-a/package.json Fixture workspace package A (deps to mirror other monorepo-basic fixtures).
packages/workspace-tools/src/fixtures/monorepo-basic-bun/packages/package-b/package.json Fixture workspace package B.
packages/workspace-tools/src/fixtures/monorepo-basic-bun/individual/package.json Fixture for a non-nested workspace package.
packages/workspace-tools/etc/workspace-tools.api.md Updates API report to reflect the new WorkspaceManager union member.
packages/workspace-tools/README.md Updates supported managers + PREFERRED_WORKSPACE_MANAGER docs to include Bun.
change/change-bun-workspace-tools.json Adds a patch change entry for releasing workspace-tools with Bun support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@RafalFilipek
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

3 participants