Registry
归属和沉淀规则
Registry 只登记已经确认的可分发资产。当前保留 ModuleCard 和规则文档; Create、Playground、Charts 等内部页面不会默认作为 registry item。
items
2
blocks
0
files
1
json
3
Registry items
| 名称 | 类型 | 文件 | 输出 |
|---|---|---|---|
| smo-module-card | registry:component | 1 | public/r/smo-module-card.json |
| smo-ui-generation-rules | registry:file | 1 | public/r/smo-ui-generation-rules.json |
文件归属
| 路径 | 归属 | 用途 |
|---|---|---|
components/ui/* | shadcn 源码组件 | 由 shadcn/ui CLI 进入仓库,作为可审查、可版本化的 Web 组件底座。 |
components/smo/component-catalog/* | 组件文档 | 组件一览、详情、示例、API 和 SmoUI 使用规则。 |
components/smo/create/* | 创建工作台 | preset、theme 预览,用于对齐 shadcn Create 的调参体验;不默认作为可分发资产。 |
registry.json -> public/r | 代码分发 | 用 shadcn build 生成可被 CLI 消费的已确认 components、rules 等 JSON。 |
components/smo/constants.ts | 产品数据 | 产品边界、页面场景模板定义、token 和验证命令。 |
components/smo/site/* | 站点壳层 | 全站导航、搜索、侧栏和文档阅读体验。 |
app/**/page.tsx | 路由组合 | 仅导入页面组件并返回,不堆业务细节。 |
常用命令
终端命令
npx shadcn@latest init
npx shadcn@latest add https://smoui.xiaomolian.com/r/smo-module-card.json
npx shadcn@latest add @smo/smo-module-card
npx shadcn@latest view @smo/smo-module-card
npx shadcn@latest build --output ./public/r
npm.cmd run lint
npm.cmd run typecheck
npm.cmd run buildcomponents.json 摘要
{
"style": "base-nova",
"rsc": true,
"tsx": true,
"registries": {
"@smo": "./public/r/{name}.json"
},
"aliases": {
"ui": "@/components/ui",
"components": "@/components",
"smo": "@/components/smo",
"utils": "@/lib/utils"
}
}