@_tc/template-core 0.0.1-bate.48 → 0.0.1-bate.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENT_README.md +506 -0
- package/package.json +1 -1
package/AGENT_README.md
ADDED
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
# TemplateCore AI 助手速读
|
|
2
|
+
|
|
3
|
+
这份文档给在消费方项目中协助开发的 AI 助手/代码代理阅读。项目本身才是 `@_tc/template-core` 的使用方;AI 通过这份速读文档快速理解包的用法和边界。它是 `README.md` 的精简版,按渐进式披露组织:先用下面的最小信息完成常见任务,只有需要深入时再读末尾的参考文档。
|
|
4
|
+
|
|
5
|
+
## 1. 先看结论
|
|
6
|
+
|
|
7
|
+
TemplateCore 是一个 TypeScript + Koa + React 的后台框架包。它提供:
|
|
8
|
+
|
|
9
|
+
- Koa 服务启动和约定式后端加载。
|
|
10
|
+
- 内置 Dashboard、Schema CRUD 页面和 React UI 组件库。
|
|
11
|
+
- `model/` 配置驱动的菜单、项目和 CRUD 页面。
|
|
12
|
+
- 前端构建 `buildFE()` 和消费方 Node/backend 构建 `buildBE()`。
|
|
13
|
+
- 类型扩展机制,用于扩展 SchemaForm 字段、CallCom 组件和 Koa app 类型。
|
|
14
|
+
|
|
15
|
+
优先使用公开入口,不要从包内部源码路径导入。
|
|
16
|
+
|
|
17
|
+
| 入口 | 用途 |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `@_tc/template-core` | `serverStart`、`baseFn`、Koa/Controller/Service 类型。 |
|
|
20
|
+
| `@_tc/template-core/bundler` | `buildFE()`、`buildBE()`。 |
|
|
21
|
+
| `@_tc/template-core/fe` | 前端初始化、请求方法、Dashboard/Schema 类型、共享状态、业务前端组件。 |
|
|
22
|
+
| `@_tc/template-core/fe/rc` | React UI 组件和 SchemaForm 组件。 |
|
|
23
|
+
| `@_tc/template-core/fe/tailwind_ui.css` | 内置前端/UI 全局样式。 |
|
|
24
|
+
| `@_tc/template-core/model` | `ModelDataType` 等 model 配置类型。 |
|
|
25
|
+
|
|
26
|
+
## 2. 最小业务项目
|
|
27
|
+
|
|
28
|
+
推荐结构:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
my-admin/
|
|
32
|
+
├── app/
|
|
33
|
+
│ ├── controller/
|
|
34
|
+
│ │ └── product.ts
|
|
35
|
+
│ └── router/
|
|
36
|
+
│ └── product.ts
|
|
37
|
+
├── config/
|
|
38
|
+
│ └── config.default.ts
|
|
39
|
+
├── model/
|
|
40
|
+
│ └── product/
|
|
41
|
+
│ ├── mode.ts
|
|
42
|
+
│ └── project/
|
|
43
|
+
│ └── demo.ts
|
|
44
|
+
└── index.ts
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
启动入口:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { join } from 'path'
|
|
51
|
+
import { serverStart } from '@_tc/template-core'
|
|
52
|
+
import { buildFE } from '@_tc/template-core/bundler'
|
|
53
|
+
|
|
54
|
+
async function main() {
|
|
55
|
+
await serverStart({
|
|
56
|
+
name: 'my-admin',
|
|
57
|
+
baseDir: join(__dirname, '.'),
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
await buildFE('dev')
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
main().catch((error) => {
|
|
64
|
+
console.error(error)
|
|
65
|
+
process.exit(1)
|
|
66
|
+
})
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
只使用后端能力时,可以不调用 `buildFE('dev')`。
|
|
70
|
+
|
|
71
|
+
配置:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
// config/config.default.ts
|
|
75
|
+
export default {
|
|
76
|
+
port: 9000,
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
访问内置后台:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
http://localhost:9000/dash?projk=demo
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`projk` 对应 `model/{modelKey}/project/{projectKey}.ts`。
|
|
87
|
+
|
|
88
|
+
## 3. 后端约定
|
|
89
|
+
|
|
90
|
+
`serverStart({ baseDir })` 会按目录自动加载业务代码:
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
app/controller/**/*.(js|ts) -> app.controller
|
|
94
|
+
app/service/**/*.(js|ts) -> app.service
|
|
95
|
+
app/middleware/**/*.(js|ts) -> app.middlewares
|
|
96
|
+
app/router/**/*.(js|ts) -> Koa router
|
|
97
|
+
app/router-schema/**/*.(js|ts) -> app.routerSchema
|
|
98
|
+
app/extend/*.(js|ts) -> app.extends
|
|
99
|
+
config/config.default.(js|ts) -> app.config
|
|
100
|
+
config/config.{env}.(js|ts) -> app.config
|
|
101
|
+
model/**/*.(js|ts) -> 项目模型配置
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Controller 示例:
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import { baseFn, type ControllerFN, type Ctx } from '@_tc/template-core'
|
|
108
|
+
|
|
109
|
+
const products = [
|
|
110
|
+
{ product_id: '1', product_name: '商品 A', price: 100 },
|
|
111
|
+
]
|
|
112
|
+
|
|
113
|
+
const getProductController = ((app) => {
|
|
114
|
+
const BaseController = baseFn.baseControllerFn(app)
|
|
115
|
+
|
|
116
|
+
return class ProductController extends BaseController {
|
|
117
|
+
list = async (ctx: Ctx) => {
|
|
118
|
+
this.success(ctx, {
|
|
119
|
+
data: products,
|
|
120
|
+
page: Number(ctx.request.query.page || 1),
|
|
121
|
+
pageSize: Number(ctx.request.query.pageSize || 10),
|
|
122
|
+
total: products.length,
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
detail = async (ctx: Ctx) => {
|
|
127
|
+
const item = products.find((product) => {
|
|
128
|
+
return product.product_id === ctx.request.query.product_id
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
this.success(ctx, item ?? null)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}) satisfies ControllerFN
|
|
135
|
+
|
|
136
|
+
export default getProductController
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Router 示例:
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
import type { KoaApp, Router } from '@_tc/template-core'
|
|
143
|
+
|
|
144
|
+
export default (app: KoaApp, router: Router) => {
|
|
145
|
+
router.get('/api/product/list', app.controller.product.list)
|
|
146
|
+
router.get('/api/product', app.controller.product.detail)
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
路由挂载顺序:
|
|
151
|
+
|
|
152
|
+
- 每个 `app/router/*.ts` 文件都会获得独立的 `koa-router` 实例。
|
|
153
|
+
- 可以通过 `router.level = number` 控制挂载顺序,数值越小越早挂载。
|
|
154
|
+
- 默认 `level` 是 `0`,框架兜底 router 是 `99`。
|
|
155
|
+
- 通配、兜底、重定向类路由建议设置较大的 `level`,避免抢先匹配业务 API。
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
import type { KoaApp, Router } from '@_tc/template-core'
|
|
159
|
+
|
|
160
|
+
export default (app: KoaApp, router: Router) => {
|
|
161
|
+
router.level = 10
|
|
162
|
+
router.get('/api/fallback/:id', app.controller.fallback.detail)
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
内置响应约定:`BaseController.success(ctx, data)` 返回 `{ data, code: 0, message: 'ok' }`。
|
|
167
|
+
|
|
168
|
+
内置扩展:
|
|
169
|
+
|
|
170
|
+
- `app.extends.$fetch`:Node 侧 axios 风格 fetch 实例。
|
|
171
|
+
- `app.extends.db`:默认 SQLite 数据存储,可用业务 `app/extend/db.ts` 覆盖。
|
|
172
|
+
|
|
173
|
+
## 4. model 配置
|
|
174
|
+
|
|
175
|
+
`model` 是内置 Dashboard 和 Schema CRUD 的数据源。
|
|
176
|
+
|
|
177
|
+
```text
|
|
178
|
+
model/{modelKey}/mode.ts -> 模型模板
|
|
179
|
+
model/{modelKey}/project/{projectKey}.ts -> 项目覆盖
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
`mode.ts` 示例:
|
|
183
|
+
|
|
184
|
+
```ts
|
|
185
|
+
import type { ModelDataType } from '@_tc/template-core/model'
|
|
186
|
+
|
|
187
|
+
const model: ModelDataType = {
|
|
188
|
+
mode: 'MB',
|
|
189
|
+
name: '商品后台',
|
|
190
|
+
desc: '商品管理',
|
|
191
|
+
homePage: '/_sidebar_/product?projk=demo',
|
|
192
|
+
menuLayout: 'left',
|
|
193
|
+
menu: [
|
|
194
|
+
{
|
|
195
|
+
key: 'product',
|
|
196
|
+
name: '商品列表',
|
|
197
|
+
menuType: 'module',
|
|
198
|
+
moduleType: 'schema',
|
|
199
|
+
schemaConfig: {
|
|
200
|
+
api: '/api/product',
|
|
201
|
+
schema: {
|
|
202
|
+
type: 'object',
|
|
203
|
+
properties: {
|
|
204
|
+
product_id: {
|
|
205
|
+
type: 'string',
|
|
206
|
+
label: '商品 ID',
|
|
207
|
+
tableOption: { width: 160 },
|
|
208
|
+
detailPanelOption: {},
|
|
209
|
+
editFormOption: {
|
|
210
|
+
comType: 'input',
|
|
211
|
+
disabled: true,
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
product_name: {
|
|
215
|
+
type: 'string',
|
|
216
|
+
label: '商品名称',
|
|
217
|
+
tableOption: {},
|
|
218
|
+
searchOption: { comType: 'input' },
|
|
219
|
+
createFormOption: { comType: 'input' },
|
|
220
|
+
editFormOption: { comType: 'input' },
|
|
221
|
+
detailPanelOption: {},
|
|
222
|
+
},
|
|
223
|
+
price: {
|
|
224
|
+
type: 'number',
|
|
225
|
+
label: '价格',
|
|
226
|
+
tableOption: {},
|
|
227
|
+
createFormOption: { comType: 'inputNumber' },
|
|
228
|
+
editFormOption: { comType: 'inputNumber' },
|
|
229
|
+
detailPanelOption: {},
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
required: ['product_name'],
|
|
233
|
+
},
|
|
234
|
+
componentConfig: {
|
|
235
|
+
createForm: {
|
|
236
|
+
title: '新增商品',
|
|
237
|
+
saveBtnText: '创建',
|
|
238
|
+
},
|
|
239
|
+
editForm: {
|
|
240
|
+
title: '编辑商品',
|
|
241
|
+
saveBtnText: '保存',
|
|
242
|
+
fetchKey: 'product_id',
|
|
243
|
+
},
|
|
244
|
+
detailPanel: {
|
|
245
|
+
title: '商品详情',
|
|
246
|
+
fetchKey: 'product_id',
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
tableConfig: {
|
|
250
|
+
headerButtons: [
|
|
251
|
+
{
|
|
252
|
+
label: '新增',
|
|
253
|
+
eventKey: 'callComponent',
|
|
254
|
+
variant: 'primary',
|
|
255
|
+
eventOption: { comName: 'createForm' },
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
rowButtons: [
|
|
259
|
+
{
|
|
260
|
+
label: '编辑',
|
|
261
|
+
eventKey: 'callComponent',
|
|
262
|
+
eventOption: { comName: 'editForm' },
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
label: '详情',
|
|
266
|
+
eventKey: 'callComponent',
|
|
267
|
+
eventOption: { comName: 'detailPanel' },
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
label: '删除',
|
|
271
|
+
eventKey: 'remove',
|
|
272
|
+
eventOption: {
|
|
273
|
+
params: {
|
|
274
|
+
product_id: '$schema::product_id',
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
],
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export default model
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
`project/demo.ts` 示例:
|
|
289
|
+
|
|
290
|
+
```ts
|
|
291
|
+
export default {
|
|
292
|
+
name: 'Demo 企业',
|
|
293
|
+
desc: 'Demo 企业商品后台',
|
|
294
|
+
homePage: '/_sidebar_/product?projk=demo',
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
合并规则:
|
|
299
|
+
|
|
300
|
+
- `project` 会继承同目录上层 `mode`。
|
|
301
|
+
- 对象递归合并,`project` 覆盖 `mode`。
|
|
302
|
+
- 数组按 `key` 合并:同 key 覆盖,不同 key 新增。
|
|
303
|
+
- `model/index.ts` 和 `model/index.js` 会被 loader 跳过。
|
|
304
|
+
|
|
305
|
+
常见菜单模块:
|
|
306
|
+
|
|
307
|
+
| `moduleType` | 用途 |
|
|
308
|
+
| --- | --- |
|
|
309
|
+
| `schema` | 配置驱动 CRUD 页面,使用 `schemaConfig`。 |
|
|
310
|
+
| `custom` | 自定义前端页面,使用 `customConfig.path`。 |
|
|
311
|
+
| `iframe` | iframe 页面,使用 `iframeConfig.path`。 |
|
|
312
|
+
| `sidebar` | 顶部菜单下挂左侧菜单,使用 `sidebarConfig.menu`。 |
|
|
313
|
+
|
|
314
|
+
## 5. 前端使用
|
|
315
|
+
|
|
316
|
+
使用内置组件或自定义前端入口时,确保引入样式:
|
|
317
|
+
|
|
318
|
+
```ts
|
|
319
|
+
import '@_tc/template-core/fe/tailwind_ui.css'
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
前端公共能力优先从 `@_tc/template-core/fe` 导入:
|
|
323
|
+
|
|
324
|
+
```ts
|
|
325
|
+
import {
|
|
326
|
+
get,
|
|
327
|
+
post,
|
|
328
|
+
request,
|
|
329
|
+
schemaEventBus,
|
|
330
|
+
schemaStore,
|
|
331
|
+
useSchemaStore,
|
|
332
|
+
LanguageSwitch,
|
|
333
|
+
ThemeSwitch,
|
|
334
|
+
} from '@_tc/template-core/fe'
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
UI 组件从 `@_tc/template-core/fe/rc` 导入:
|
|
338
|
+
|
|
339
|
+
```tsx
|
|
340
|
+
import { Button, DataTable, Form, Input, Modal, Select } from '@_tc/template-core/fe/rc'
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
常用前端能力:
|
|
344
|
+
|
|
345
|
+
- 请求方法:`request`、`get`、`post`、`put`、`patch`、`del`。
|
|
346
|
+
- Schema 通信:`schemaEventBus`、`eventsInfo`、`merge`。
|
|
347
|
+
- 共享状态:`modeStore`、`schemaStore`、`apiFreezerStore` 及对应 hooks。
|
|
348
|
+
- 多语言:`i18nStore.addResources()`,配置文案可写 `$i18n::...`。
|
|
349
|
+
- 主题:`ThemeSwitch` 会同步根节点 `dark` class 和 `localStorage`。
|
|
350
|
+
|
|
351
|
+
不要直接依赖 `frontend/src/...`、`packages/react/ui/...` 这类包内部路径。
|
|
352
|
+
|
|
353
|
+
## 6. 构建
|
|
354
|
+
|
|
355
|
+
前端资源构建:
|
|
356
|
+
|
|
357
|
+
```ts
|
|
358
|
+
import { buildFE } from '@_tc/template-core/bundler'
|
|
359
|
+
|
|
360
|
+
await buildFE('dev')
|
|
361
|
+
await buildFE('prod', { output: 'run' })
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
`buildFE('dev')` 是构建一次并监听业务 `frontend/` 变化后重建,不是 Vite dev server/HMR。
|
|
365
|
+
|
|
366
|
+
Node/backend 构建:
|
|
367
|
+
|
|
368
|
+
```ts
|
|
369
|
+
import { buildBE } from '@_tc/template-core/bundler'
|
|
370
|
+
|
|
371
|
+
await buildBE()
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
`buildBE()` 默认:
|
|
375
|
+
|
|
376
|
+
- 构建当前工作目录的 `index.ts`、`index.js`、`app`、`config`、`model`。
|
|
377
|
+
- 输出到 `dist`。
|
|
378
|
+
- 输出格式为 `cjs`。
|
|
379
|
+
- 外部化 Node 内置模块和 npm 包。
|
|
380
|
+
- 默认不生成 `.d.ts`。
|
|
381
|
+
- 默认不注入 alias;需要时显式传 `alias`。
|
|
382
|
+
|
|
383
|
+
自定义示例:
|
|
384
|
+
|
|
385
|
+
```ts
|
|
386
|
+
await buildBE({
|
|
387
|
+
input: ['app', 'config', 'model/index.ts'],
|
|
388
|
+
outDir: 'dist',
|
|
389
|
+
format: ['es', 'cjs'],
|
|
390
|
+
dts: true,
|
|
391
|
+
alias: {
|
|
392
|
+
'@app': './app',
|
|
393
|
+
'@model': './model',
|
|
394
|
+
},
|
|
395
|
+
})
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
消费方脚本示例:
|
|
399
|
+
|
|
400
|
+
```js
|
|
401
|
+
// scripts/build-be.mjs
|
|
402
|
+
import { buildBE } from '@_tc/template-core/bundler'
|
|
403
|
+
|
|
404
|
+
await buildBE({
|
|
405
|
+
input: ['index.ts', 'index.js', 'app', 'config', 'model'],
|
|
406
|
+
outDir: 'dist',
|
|
407
|
+
format: 'cjs',
|
|
408
|
+
})
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
监听文件变化重新构建:
|
|
412
|
+
|
|
413
|
+
```js
|
|
414
|
+
// scripts/watch-be.mjs
|
|
415
|
+
import chokidar from 'chokidar'
|
|
416
|
+
import { buildBE } from '@_tc/template-core/bundler'
|
|
417
|
+
|
|
418
|
+
const input = ['index.ts', 'index.js', 'app', 'config', 'model']
|
|
419
|
+
|
|
420
|
+
let building = false
|
|
421
|
+
let pending = false
|
|
422
|
+
|
|
423
|
+
async function runBuild() {
|
|
424
|
+
if (building) {
|
|
425
|
+
pending = true
|
|
426
|
+
return
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
building = true
|
|
430
|
+
|
|
431
|
+
try {
|
|
432
|
+
await buildBE({ input, outDir: 'dist', format: 'cjs' })
|
|
433
|
+
} finally {
|
|
434
|
+
building = false
|
|
435
|
+
|
|
436
|
+
if (pending) {
|
|
437
|
+
pending = false
|
|
438
|
+
await runBuild()
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
await runBuild()
|
|
444
|
+
|
|
445
|
+
chokidar
|
|
446
|
+
.watch(input, {
|
|
447
|
+
ignored: ['dist/**', 'node_modules/**'],
|
|
448
|
+
ignoreInitial: true,
|
|
449
|
+
})
|
|
450
|
+
.on('all', runBuild)
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
```json
|
|
454
|
+
{
|
|
455
|
+
"scripts": {
|
|
456
|
+
"build:be": "node scripts/build-be.mjs",
|
|
457
|
+
"build:be:watch": "node scripts/watch-be.mjs"
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
## 7. 常见任务速查
|
|
463
|
+
|
|
464
|
+
新增后端接口:
|
|
465
|
+
|
|
466
|
+
1. 在 `app/controller/*.ts` 写 controller。
|
|
467
|
+
2. 在 `app/router/*.ts` 注册路由。
|
|
468
|
+
3. 返回数据时优先用 `this.success(ctx, data)`。
|
|
469
|
+
|
|
470
|
+
新增一个 Schema CRUD 页面:
|
|
471
|
+
|
|
472
|
+
1. 在 `model/{modelKey}/mode.ts` 或 `project/{projectKey}.ts` 添加菜单项。
|
|
473
|
+
2. 菜单项使用 `menuType: 'module'`、`moduleType: 'schema'`。
|
|
474
|
+
3. `schemaConfig.api` 指向后端资源 API。
|
|
475
|
+
4. 字段在 `schema.properties` 中配置 `tableOption`、`searchOption`、`createFormOption`、`editFormOption`、`detailPanelOption`。
|
|
476
|
+
5. 需要新增/编辑/详情时,在 `componentConfig` 和 `tableConfig` 配置按钮与弹层。
|
|
477
|
+
|
|
478
|
+
新增自定义前端页面:
|
|
479
|
+
|
|
480
|
+
1. 在业务 `frontend/` 下添加入口 `*.entry.tsx`。
|
|
481
|
+
2. 需要样式时引入 `@_tc/template-core/fe/tailwind_ui.css`。
|
|
482
|
+
3. 在 `model` 菜单中使用 `moduleType: 'custom'`,让 `customConfig.path` 指向页面路径。
|
|
483
|
+
4. 使用 `buildFE('dev')` 或 `buildFE('prod')` 生成资源。
|
|
484
|
+
|
|
485
|
+
扩展前端类型或组件:
|
|
486
|
+
|
|
487
|
+
1. SchemaForm 字段类型、CallCom 组件、Koa app 类型都支持 TypeScript 声明合并。
|
|
488
|
+
2. 运行时组件通常放在业务 `frontend/extended/`。
|
|
489
|
+
3. 优先查看公开入口 `.d.ts` 和 npm 包根目录 `README.md`;如果当前环境是源码仓库,再继续读 `docs/type-extension.md` 和 `docs/schema-form.md`。
|
|
490
|
+
|
|
491
|
+
## 8. 继续深入
|
|
492
|
+
|
|
493
|
+
需要更多信息时,按任务读取:
|
|
494
|
+
|
|
495
|
+
| 任务 | 建议阅读 |
|
|
496
|
+
| --- | --- |
|
|
497
|
+
| 完整安装和使用说明 | npm 包根目录 `README.md` |
|
|
498
|
+
| 生成项目、model、CRUD | `.skills/tc-generator/SKILL.md` |
|
|
499
|
+
| 组件选型和用法 | `.skills/tc-component-usage-skills/SKILL.md` |
|
|
500
|
+
| model/schema 配置细节 | `.skills/tc-generator/reference/model-schema.md` |
|
|
501
|
+
| 完整 CRUD 示例 | `.skills/tc-generator/reference/example.md` |
|
|
502
|
+
| 可复制项目骨架 | `.skills/tc-generator/reference/project-template/` |
|
|
503
|
+
| UI 组件现场预览 | 启动服务后访问 `/ui-components` |
|
|
504
|
+
| 已安装包的类型细节 | 查看对应公开入口的 `.d.ts` 文件 |
|
|
505
|
+
|
|
506
|
+
如果当前环境是源码仓库而不是 npm 安装目录,还可以继续读 `docs/`、`frontend/README.md`、`model/README.md`、`bundler/README.md` 和 `BUILD.md`。
|
package/package.json
CHANGED