1.1 KiB
1.1 KiB
0006 pnpm workspaces with package.json exports
Status: Proposed · Area: architecture · Date: 2026-10-04 · Decided by: agent
Context
The workspace had no TypeScript or package wiring. The skill allows either package.json exports with workspaces or tsconfig.base.json path aliases.
Decision
- Every non-app project is a pnpm workspace package (
pnpm-workspace.yaml) named@lumina/<name>with subpathexportsthat point at its TypeScript sources (@lumina/island/atoms/button). - Third-party dependencies stay in the root package.json (one version policy); each package lists only the
@lumina/*packages it imports, asworkspace:*.tsconfig.base.jsonholds the shared compiler options, and each project'stsconfig.jsonextends it.
Alternatives
- Path aliases: CSS
@importcan't resolve them, so apps would importisland.cssby relative path.
Consequences
- Apps import
@lumina/island/styles/island.cssby package name, and Node, Next.js, and TypeScript resolve the same subpaths. - Each new package needs a package.json with
exportsandsideEffects.