@lark-apaas/coding-steering 0.1.54-alpha.20260918074819 → 0.1.55
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/package.json
CHANGED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mcp-ui-guide
|
|
3
|
-
description: "创建或修改 MCP Apps 的 TSX 界面、UI 检查配置及 shared 依赖时使用。Use when working on server/mcp/ui, MCP Apps UI, TypeScript or ESLint checks."
|
|
4
|
-
steering: true
|
|
5
|
-
steering-topic: mcp_ui_guide
|
|
6
|
-
match-template-name: nestjs-react-fullstack
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# MCP Apps UI 开发与检查
|
|
10
|
-
|
|
11
|
-
UI 是独立浏览器代码,入口为 `server/mcp/ui/<entry>/index.html`,交互逻辑使用独立 TS/TSX 文件。Vite 预设将每个入口构建为单文件 HTML,由 MCP 资源读取。不要将 UI 引入 NestJS 模块,也不要引用 client 业务代码、服务端模块或 Node.js API;可引用不依赖应用 Provider/Router/登录态的 shared 模块。
|
|
12
|
-
|
|
13
|
-
## 创建配置
|
|
14
|
-
|
|
15
|
-
只有创建 UI 时才生成下列两个文件;没有 UI 的应用不生成。已有配置应保留并按需调整,不能覆盖用户自定义规则。主工程 tsconfig.node.json 应排除 `server/mcp/ui`,原有 exclude 与继承语义必须保留;主工程 ESLint 排除由平台预设提供。不要为 UI 修改根目录 npm 检查命令或 scripts/lint.js。
|
|
16
|
-
|
|
17
|
-
`server/mcp/ui/tsconfig.json`:
|
|
18
|
-
|
|
19
|
-
```json
|
|
20
|
-
{
|
|
21
|
-
"compilerOptions": {
|
|
22
|
-
"target": "ES2020",
|
|
23
|
-
"module": "ESNext",
|
|
24
|
-
"moduleResolution": "Bundler",
|
|
25
|
-
"jsx": "react-jsx",
|
|
26
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
27
|
-
"types": [],
|
|
28
|
-
"strict": true,
|
|
29
|
-
"allowJs": true,
|
|
30
|
-
"checkJs": true,
|
|
31
|
-
"skipLibCheck": true,
|
|
32
|
-
"noEmit": true,
|
|
33
|
-
"baseUrl": "../../..",
|
|
34
|
-
"paths": { "@shared/*": ["shared/*"] }
|
|
35
|
-
},
|
|
36
|
-
"include": ["./**/*"],
|
|
37
|
-
"exclude": ["node_modules", "dist", "eslint.config.cjs"]
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
`server/mcp/ui/eslint.config.cjs`:
|
|
42
|
-
|
|
43
|
-
```js
|
|
44
|
-
module.exports = require('@lark-apaas/fullstack-presets/lib/mcp/eslint-ui');
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## 修改后必须执行
|
|
48
|
-
|
|
49
|
-
从工程根目录依次运行;修改 UI 使用的 shared 模块时也必须运行:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
npx --no-install tsc --noEmit --project server/mcp/ui/tsconfig.json
|
|
53
|
-
npx --no-install eslint --config server/mcp/ui/eslint.config.cjs "server/mcp/ui/**/*.{ts,tsx,js,jsx}" --max-warnings 0
|
|
54
|
-
npm run build:prod
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
检查命令退出码;失败必须修复并重新运行,不能通过关闭规则、增加 ignore 或跳过检查交付。确认 `dist/mcp-ui/<entry>.html` 已生成,继续在 MCP 宿主中验证资源加载、工具结果展示和交互。主工程 lint 通过不代表 UI 检查通过,构建成功也不代表类型检查通过。
|
|
58
|
-
|
|
59
|
-
旧版平台提供的 type:check:mcp-ui / eslint:mcp-ui 聚合或辅助脚本已弃用;使用上面的标准命令,无需新建辅助脚本。已有用户自定义检查命令可以保留。
|