Appearance
ADR-2274: Modular pnpm Workspace for Frontend Development
Status
Accepted
Context
Our platform requires a cohesive user interface for the web client to render standard clinical forms compiled by the backend translation engine. Previously, developers could not build, lint, or test frontend components because the codebase lacked Node.js tooling and a standardized structure. To enable rapid development and sharing of design components, we need a unified package management and validation strategy for the frontend.
Decision
We have decided to introduce a pnpm workspace at the repository root to manage frontend packages.
- Workspace Structure: We will maintain the
apps/webapplication and thepackages/uishared component library within the pnpm workspace. - Unified Validation: We will use a unified
checkscript leveragingESLint,Prettier, andVitestacross all frontend projects to ensure code quality. - XML Form Rendering: The web client will parse and render standard clinical forms using XML payloads generated by the backend translation engine, ensuring compliance with existing architecture.
- CI Integration: The unified script is integrated into the GitHub Actions CI workflow to block pull requests containing unformatted or syntactically invalid frontend files.
Alternatives Considered
- Yarn/npm workspaces: While functional, pnpm provides better disk space efficiency and faster installation times.
- Monorepo tools (Turborepo/Nx): Considered overkill for the current size of the frontend codebase.
Trade-offs
- Positive: UI developers can now rapidly build, test, and import shared components without complex rebuilds. Frontend quality is enforced automatically in CI.
- Negative: Requires Python developers to install Node.js and pnpm locally if they want to run the full end-to-end
pnpm checkcommand, though CI will handle verification automatically.
This decision implements requirements under Trace-8.
Amendment (2026-10-15): one copy of each component
A component lives in one package. SkeletonLoader.vue had an unused copy in packages/ui (exported from packages/ui/src/index.js, which the published library entry does not include) beside the copy apps/web imports. The packages/ui copy was removed so the two cannot drift apart under different lint rules; apps/web/src/components/common/SkeletonLoader.vue is the only one.