This is a Nova UI monorepo — an enterprise React component library with two workspaces:
packages/ui— the publishable@wuyangfan/nova-uiNPM package (~80 source files, 6 component categories)docs— a VitePress documentation site with live React playground (viareact-live)
No databases, Docker, or backend services are required. Only Node.js 20+ and npm.
- 目录:
openspec/(specs/、changes/、config.yaml)。首次迭代可从/opsx:propose开始; slash 命令定义在.cursor/commands/,技能在.cursor/skills/。 - 官方文档与 CLI:https://github.com/Fission-AI/OpenSpec;本地更新模板可运行全局安装后的
openspec update,或使用npx @fission-ai/openspec@latest。
All commands run from the workspace root unless noted.
| Task | Command |
|---|---|
| Install deps | npm install |
| Build UI lib | npm run build:ui |
| Lint UI | npm run lint:ui |
| Typecheck UI | npm run typecheck:ui |
| Test UI (Vitest + Testing Library) | npm run test:ui |
| UI test coverage report | npm run test:coverage:ui |
| New component scaffold | npm run new:component -- <category[/subfolders]> <PascalName> |
| Docs dev server | npm run dev:docs (port 5173) |
| UI dev server | cd packages/ui && npm run dev (port 5174 if docs running) |
| Build docs | npm run build:docs |
| Full build | npm run build |
npm run new:component -- layout Widget— createspackages/ui/src/components/layout/Widget/npm run new:component -- form Foo— creates underform/controls/Foo(default for top-levelform)npm run new:component -- form/pickers Foo— creates underform/pickers/Foonpm run new:component -- feedback/overlays Sheet— creates underfeedback/overlays/Sheet
The script appends exports to the category barrel (packages/ui/src/components/<layout|basic|…>/index.ts). Run npm run lint:ui and npm run typecheck:ui after scaffolding.
- 二级分类:
form/controls、form/pickers、feedback/overlays等子目录已落地;新增组件优先用npm run new:component -- <category/sub> Name落到对应桶,避免再平铺一大坨。 - 脚手架:
packages/ui/scripts/new-component.mjs为块 8 交付物;与上表 Scaffold examples 一致。
- Build order matters: the docs workspace has a
file:dependency on../packages/ui. You must runnpm run build:uibeforenpm run dev:docsornpm run build:docs— otherwise the docs site will fail to resolve the component library. - Tests: component tests live next to source as
*.test.tsxinpackages/ui; usenpm run test:uifrom the repo root (ornpm run test/npm run test:watchinpackages/ui). Conventions and coverage notes: packages/ui/TESTING.md. - The docs dev server runs at
http://localhost:5173/react-ui-library/(note the base path). - The standalone UI dev server at
packages/uiuses Vite and serves athttp://localhost:5174/(or the next available port).
- You must run
npm run build:uibeforenpm run dev:docsso the docs package can resolve@wuyangfan/nova-ui(it uses afile:reference to the local build output). - No databases, Docker, or external services are required.