@lark-apaas/coding-templates
v0.1.43
Published
OpenClaw project templates for mclaw CLI
Readme
@lark-apaas/coding-templates
OpenClaw 项目模板包,供 mclaw CLI 使用。
模板列表
| 模板 | 目录 | 类型 | 说明 |
|---|---|---|---|
| html | template-html/ | 纯前端 | 纯 HTML,零依赖,原型验证 |
| vite-react | template-vite-react/ | 纯前端 | Vite + React 19 + Tailwind CSS + shadcn/ui |
| apex | template-apex/ | 全栈 | Vite + React + Express + Drizzle + PostgreSQL |
包结构
coding-templates/
├── package.json
├── meta.json # 模板元数据
├── template-html/
├── template-vite-react/
└── template-apex/
├── client/ # 前端(Vite + React)
│ ├── index.html
│ └── src/
├── server/ # 后端(Express + Drizzle)
│ ├── index.ts
│ ├── db/
│ └── routes/
├── shared/ # 前后端共享类型和 API 契约
├── scripts/build.sh # 构建脚本
├── tsconfig.server.json # 服务端 CJS 编译配置
└── vite.config.ts特殊文件命名
npm publish 会忽略 .gitignore 和 .env*,因此模板中使用 _ 前缀:
| 模板中的文件名 | CLI 复制后的文件名 |
|---|---|
| _gitignore | .gitignore |
| _env.local | .env.local |
模板元数据
每个模板的 package.json 包含 mclaw 字段:
{
"mclaw": {
"stack": "apex",
"stackVersion": "0.1.0",
"features": ["client", "server"]
}
}| 字段 | 说明 |
|---|---|
| stack | 技术栈标识 |
| stackVersion | 模板版本 |
| features | 应用能力,init 时自动推导 archType |
技术栈
apex(全栈)
- 前端: Vite 8 + React 19 + TypeScript 5.9 + Tailwind CSS 4 + shadcn/ui
- 后端: Express 5 + Drizzle ORM + PostgreSQL
- 平台集成: @lark-apaas/express-core(用户上下文、CSRF、RLS、viewContext)
- 开发: Vite middleware mode 集成到 Express,单进程 HMR
- 构建: 前端 Vite build,服务端 tsc CJS 输出
- 部署: server.zip(服务端 + 裁剪 node_modules + run.sh)→ FaaS
vite-react(纯前端)
- Vite 8 + React 19 + TypeScript 5 + Tailwind CSS 4 + shadcn/ui
- ESLint 9 flat config + react-router-dom
html(纯前端)
- 纯 HTML + Tailwind CDN,零构建依赖
发版
cd packages/openclaw/coding-templates
npm version patch
npm publish