feat: 插件检验器 plugin:check + L6/L7 教程 + 模板接入组件库——性能与样式标准成为机器关卡
This commit is contained in:
@@ -68,6 +68,11 @@
|
||||
|
||||
## 4. 标准模式(复制即用)
|
||||
|
||||
> **renderer 组件优先用组件库**:本节模式已在 `@aso/plugin-sdk/ui` 代码化
|
||||
> (`Button`/`SettingRow`/`EmptyState`/`LoadingState`/`ErrorState`/`Badge`…,
|
||||
> 见 [L6](./07-ui-components.md)),直接 import,不要手写。
|
||||
> 下面的 HTML 形态留给 iframe 插件页作者。
|
||||
|
||||
### 设置行(label 左 / 控件右)
|
||||
|
||||
```html
|
||||
@@ -116,14 +121,16 @@
|
||||
|
||||
## 6. renderer 组件附加规则
|
||||
|
||||
- 类名直接用宿主词汇(§2),无需引样式
|
||||
- 类名直接用宿主词汇(§2),无需引样式;**优先 import 公共组件库**([L6](./07-ui-components.md)),不要手写标准模式
|
||||
- React 必须来自 `ctx.react`(见 [L4](./05-renderer-components.md)),否则 hooks 失效
|
||||
- 禁止操作宿主 DOM(document 全局查询/改样式),一切交互限制在自己的组件子树
|
||||
- 机器关卡:`pnpm plugin:check <插件目录>`(hex 色值 / React 副本 / 三态缺失等,见 [L7](./08-performance.md))
|
||||
|
||||
## 7. 自检清单(提发布前)
|
||||
|
||||
- [ ] `pnpm plugin:check <插件目录>` 0 error(机器关卡,见 [L7](./08-performance.md))
|
||||
- [ ] 无硬编码色值/阴影/圆角(铁律 1)
|
||||
- [ ] 字号都在 §3 的阶上
|
||||
- [ ] 深浅色都检查过(切主题看一眼;token 正确时自动成立)
|
||||
- [ ] 复用了 §4 模式而非新造形态
|
||||
- [ ] 复用了 §4 模式(renderer 直接用组件库)而非新造形态
|
||||
- [ ] iframe 页引了 tokens.css 且无 `prefers-color-scheme`
|
||||
|
||||
Reference in New Issue
Block a user