Skip to content

dogfood: link the workspace under Bun so monorepo apps resolve local @webjsdev/* + Prisma #521

Description

@vivek7405

Problem

After the dev hot-reload fix (#514), I tried running the in-repo apps under Bun (bun --bun run dev / start) and hit a resolution divergence: Bun resolves @webjsdev/* and @prisma/client from its OWN global install cache (~/.cache/.bun/install/cache/...) instead of the npm-linked workspace node_modules. Concretely, booting examples/blog under Bun loaded @webjsdev/server@0.8.27 from the Bun cache (not the workspace 0.8.28), and @prisma/client@7.8.0 from the Bun cache (not the npm-installed 5.22.0 with the generated client). A stray bun install had created a parallel, divergent dependency tree.

The effect: running the monorepo apps under Bun exercises STALE PUBLISHED packages, not the local framework, which defeats dogfooding (and crashed on an old un-guarded module.registerHooks seed-hook path that the current 0.8.28 already guards). This is the prerequisite for any Bun-app work: until Bun resolves the workspace, every Bun run is testing the wrong code.

Design / approach

Make the monorepo Bun-install-aware so a bun run resolves the LOCAL workspace packages (and the generated Prisma client) the same way npm does:

  • Confirm the root package.json workspaces are honoured by bun install (Bun supports workspaces; the divergence suggests an app-level bun install ran instead of a root one, or Bun’s isolated-cache linking needs configuring).
  • Decide the policy: either a committed Bun lockfile/workspace setup alongside npm, or a documented bun install flow at the repo root that links @webjsdev/* to the workspace.
  • Keep npm as the primary toolchain (no npm regression); Bun support is additive.

Acceptance criteria

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions