refactor(turbo): consume workspace package exports #37

Merged
vince merged 2 commits from codex/turbo-package-exports into main 2026-06-20 07:27:51 +02:00
Owner

Summary

Tightens the workspace package boundary so the web app consumes internal packages through their package exports instead of direct source aliases.

Why

The app already declares @dimensionlab/ui and @dimensionlab/dashboard-model as workspace dependencies, but Vite and TypeScript still mapped those imports to packages/*/src. That bypassed the reusable package contract and made the Turborepo graph less authoritative.

Changes

  • Removes @dimensionlab/* source aliases from apps/web/tsconfig.json.
  • Removes package source aliases from apps/web/vite.config.ts.
  • Keeps only the app-local $lib alias.
  • Makes dev depend on ^build so package export artifacts exist before the web dev server starts.
  • Adds a workspace boundary test that locks this behavior.

Testing

  • Red/green: bun run --cwd apps/web test:unit src/lib/workspace-boundary.test.ts
  • rm -rf packages/dashboard-model/dist packages/ui/dist apps/web/build apps/web/dist && bun run build
  • bun run check
  • bun run test:unit
  • bunx turbo run dev --filter=@dimensionlab/web --dry=json
  • bun run test:qa
  • bun run db:check
  • podman build -f apps/web/Containerfile -t localhost/dimensionlab-website:codex-package-exports .
  • Runtime smoke for the container served / and /api/dashboard.
  • Root bun run dev smoke served / and /api/dashboard after dependency package builds.

Notes

This intentionally follows the compiled-package pattern already implied by the package exports maps and Turbo ^build dependencies.

## Summary Tightens the workspace package boundary so the web app consumes internal packages through their package exports instead of direct source aliases. ## Why The app already declares `@dimensionlab/ui` and `@dimensionlab/dashboard-model` as workspace dependencies, but Vite and TypeScript still mapped those imports to `packages/*/src`. That bypassed the reusable package contract and made the Turborepo graph less authoritative. ## Changes - Removes `@dimensionlab/*` source aliases from `apps/web/tsconfig.json`. - Removes package source aliases from `apps/web/vite.config.ts`. - Keeps only the app-local `$lib` alias. - Makes `dev` depend on `^build` so package export artifacts exist before the web dev server starts. - Adds a workspace boundary test that locks this behavior. ## Testing - Red/green: `bun run --cwd apps/web test:unit src/lib/workspace-boundary.test.ts` - `rm -rf packages/dashboard-model/dist packages/ui/dist apps/web/build apps/web/dist && bun run build` - `bun run check` - `bun run test:unit` - `bunx turbo run dev --filter=@dimensionlab/web --dry=json` - `bun run test:qa` - `bun run db:check` - `podman build -f apps/web/Containerfile -t localhost/dimensionlab-website:codex-package-exports .` - Runtime smoke for the container served `/` and `/api/dashboard`. - Root `bun run dev` smoke served `/` and `/api/dashboard` after dependency package builds. ## Notes This intentionally follows the compiled-package pattern already implied by the package `exports` maps and Turbo `^build` dependencies.
vince added 1 commit 2026-06-20 07:20:35 +02:00
vince added 1 commit 2026-06-20 07:26:31 +02:00
vince merged commit 243d05cef7 into main 2026-06-20 07:27:51 +02:00
Sign in to join this conversation.
No description provided.