Skip to content

Commit 6e3aee7

Browse files
fix(dagger): build web packages in dependency order
Bun's --filter runs packages in parallel without respecting dependency order. Build @mux/shared, then @mux/client, then @mux/frontend sequentially so each has access to its dependencies' dist/ output for type declarations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f70c712 commit 6e3aee7

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.dagger/src/index.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,19 @@ export class Monorepo {
205205
await container.sync();
206206
outputs.push("✓ Prisma setup");
207207

208-
// Run build FIRST, then typecheck
209-
// Build must run first because workspace packages (@mux/client, @mux/frontend)
210-
// depend on @mux/shared's dist/ for type declarations
208+
// Build web packages in dependency order first
209+
// Bun's --filter runs packages in parallel, which breaks when packages depend on
210+
// each other's dist/ output for type declarations
211+
await container.withExec(["bun", "run", "--filter", "@mux/shared", "build"]).sync();
212+
await container.withExec(["bun", "run", "--filter", "@mux/client", "build"]).sync();
213+
await container.withExec(["bun", "run", "--filter", "@mux/frontend", "build"]).sync();
214+
215+
// Now build remaining packages (web packages already built, will be skipped or fast)
211216
// Note: Skip tests here - bun-decompile tests fail in CI (requires `bun build --compile`)
212-
// Individual package tests will run in the birmelCi() call below
213217
await container.withExec(["bun", "run", "build"]).sync();
214218
outputs.push("✓ Build");
219+
220+
// Typecheck all packages
215221
await container.withExec(["bun", "run", "typecheck"]).sync();
216222
outputs.push("✓ Typecheck");
217223

0 commit comments

Comments
 (0)