@wneng/create-keel 0.2.1 → 0.3.0
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/dist/index.js +497 -38
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/standards/templates/coding-style-dart.md.eta +49 -0
- package/src/standards/templates/coding-style-go.md.eta +52 -0
- package/src/standards/templates/coding-style-java.md.eta +50 -0
- package/src/standards/templates/coding-style-python.md.eta +51 -0
- package/src/standards/templates/coding-style-rust.md.eta +52 -0
- package/src/standards/templates/coding-style-typescript.md.eta +50 -0
- package/src/standards/templates/dependency-cruiser.config.cjs.eta +57 -0
- package/src/standards/templates/design-tokens.ts.eta +37 -0
- package/src/standards/templates/module-boundaries.md.eta +82 -0
- package/src/standards/templates/tech-stack-agent.md.eta +35 -0
- package/src/standards/templates/tech-stack-miniapp.md.eta +34 -0
- package/src/standards/templates/tech-stack-mobile.md.eta +36 -0
- package/src/standards/templates/tech-stack-server.md.eta +50 -0
- package/src/standards/templates/tech-stack-web.md.eta +36 -0
- package/src/standards/templates/ui-design-system.md.eta +70 -0
- package/src/templates/docs-skeleton/files/usage-quickstart.md +11 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
runtime: <%= it.standards.env %>
|
|
3
|
+
language: <%= it.standards.language %>
|
|
4
|
+
packageManager: <%= it.standards.packageManager %>
|
|
5
|
+
manifestPath: <%= it.standards.manifestPath %>
|
|
6
|
+
lastReviewed: <%= it.standards.lastReviewed %>
|
|
7
|
+
dependencies:
|
|
8
|
+
<% for (const dep of it.standards.dependencies) { %> - name: "<%= dep.name %>"
|
|
9
|
+
version: "<%= dep.version %>"
|
|
10
|
+
policy: <%= dep.policy %>
|
|
11
|
+
<% } %>---
|
|
12
|
+
|
|
13
|
+
# 前端 / Web 技术栈钉版本表
|
|
14
|
+
|
|
15
|
+
> frontmatter 是机器真值;governance-lint 会把上面 `dependencies` 与 `<%= it.standards.manifestPath %>` 的实际版本逐条比对。
|
|
16
|
+
|
|
17
|
+
## 为什么钉版本
|
|
18
|
+
|
|
19
|
+
- **审计可追溯**:升级历史进 git,PR review 看得到
|
|
20
|
+
- **可重现构建**:CI cache 一致;六个月后能装出同一棵 lockfile
|
|
21
|
+
|
|
22
|
+
## policy 三档
|
|
23
|
+
|
|
24
|
+
policy 字段的语义、调整流程、不钉的例外,与 [tech-stack-server.md](tech-stack-server.md) 一致。本文件不重复。
|
|
25
|
+
|
|
26
|
+
## Web 特有的考虑
|
|
27
|
+
|
|
28
|
+
- React / Vue 的 minor 升级常带 hooks API 改动;新增 `policy: minor` 表示"先发 warning,看到再合"
|
|
29
|
+
- `typescript` 单独列为 minor:tsc 主版本变化几乎一定要改代码
|
|
30
|
+
- bundler(Vite / Webpack)和 polyfill 工具链版本若进 production bundle,必须钉;纯 dev 工具不进本表
|
|
31
|
+
|
|
32
|
+
## 关联
|
|
33
|
+
|
|
34
|
+
- 编码规范:[coding-style-typescript.md](coding-style-typescript.md)
|
|
35
|
+
- UI 设计系统:[../05-前端客户端详细设计/ui-design-system.md](../05-前端客户端详细设计/ui-design-system.md)(启用 design 角色或 full 档时存在)
|
|
36
|
+
- 依赖安全:[../governance/security.md](../governance/security.md)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# UI 设计系统
|
|
2
|
+
|
|
3
|
+
> 这是 UI / 视觉真值的入口。设计稿仍在 Figma;本文件 + `web/src/design-tokens.ts` 是工程侧能消费的版本。
|
|
4
|
+
>
|
|
5
|
+
> governance-lint 的 `GOV.UI.TOKEN_DRIFT` 检查会比对本文件 token 表与 `design-tokens.ts` 的 export 名集合,发现差异即阻断。
|
|
6
|
+
|
|
7
|
+
## Token 表
|
|
8
|
+
|
|
9
|
+
下面三类 token 是 design-tokens.ts 的真值;改一项,必须同 PR 改 ts 文件中对应 export。
|
|
10
|
+
|
|
11
|
+
### 颜色
|
|
12
|
+
|
|
13
|
+
| name | 值 | 用途 |
|
|
14
|
+
|------|-----|------|
|
|
15
|
+
| `colorPrimary` | `#2563EB` | 主操作按钮、链接 |
|
|
16
|
+
| `colorSurface` | `#FFFFFF` | 卡片 / 模态背景 |
|
|
17
|
+
| `colorTextDefault` | `#0F172A` | 默认文本 |
|
|
18
|
+
| `colorTextMuted` | `#64748B` | 次要 / 辅助文本 |
|
|
19
|
+
| `colorBorder` | `#E2E8F0` | 分隔线 / 输入框边框 |
|
|
20
|
+
| `colorDanger` | `#DC2626` | 错误状态、危险操作 |
|
|
21
|
+
|
|
22
|
+
### 间距(spacing scale)
|
|
23
|
+
|
|
24
|
+
按 4px 基线倍数;**禁止**使用任意像素值。
|
|
25
|
+
|
|
26
|
+
| name | 值 | 用途 |
|
|
27
|
+
|------|-----|------|
|
|
28
|
+
| `space1` | `4px` | 紧凑(图标到文字) |
|
|
29
|
+
| `space2` | `8px` | 表单字段内 |
|
|
30
|
+
| `space3` | `12px` | 默认内边距 |
|
|
31
|
+
| `space4` | `16px` | 卡片内边距 |
|
|
32
|
+
| `space6` | `24px` | 卡片间距 |
|
|
33
|
+
| `space8` | `32px` | 区块间距 |
|
|
34
|
+
|
|
35
|
+
### 字号(typography)
|
|
36
|
+
|
|
37
|
+
| name | 值 | 用途 |
|
|
38
|
+
|------|-----|------|
|
|
39
|
+
| `fontHeading1` | `32px / 1.25 / 600` | 页面 H1 |
|
|
40
|
+
| `fontHeading2` | `24px / 1.3 / 600` | 区块标题 |
|
|
41
|
+
| `fontBody` | `14px / 1.5 / 400` | 正文 |
|
|
42
|
+
| `fontCaption` | `12px / 1.4 / 400` | 辅助说明 |
|
|
43
|
+
|
|
44
|
+
## 组件命名
|
|
45
|
+
|
|
46
|
+
组件库统一前缀,避免与第三方库冲突:
|
|
47
|
+
|
|
48
|
+
- `KButton` —— 主按钮 / 次按钮 / 危险按钮三态由 prop 切换
|
|
49
|
+
- `KModal` —— 模态对话框;标题 / 内容 / footer 三槽位
|
|
50
|
+
- `KFormItem` —— 表单单项;label + 控件 + 错误提示
|
|
51
|
+
|
|
52
|
+
新增组件命名遵循同前缀;超过组件库范围(业务组件)走 PascalCase 不加前缀。
|
|
53
|
+
|
|
54
|
+
## 调整流程
|
|
55
|
+
|
|
56
|
+
1. 设计在 Figma 改 token;导出 SVG / PNG 到 `docs/design/figma-exports/`
|
|
57
|
+
2. 同 PR 改本文件 token 表 + `web/src/design-tokens.ts` 中对应 export
|
|
58
|
+
3. CI 跑 `governance-lint`:本表 token 名集合必须等于 design-tokens.ts 的 export 集合
|
|
59
|
+
4. 若故意要让两边不同(极少见),删除本文件,改用其他 token 真值(需要新 ADR)
|
|
60
|
+
|
|
61
|
+
## 何时**不**用本系统
|
|
62
|
+
|
|
63
|
+
- 第三方组件库自带的 token:直接用;不要 wrap 一层把它们重命名成 K 前缀
|
|
64
|
+
- 一次性的展示页(活动 banner、营销页):可以脱离本系统,但不要把脱离的 token 散播到通用组件中
|
|
65
|
+
|
|
66
|
+
## 关联
|
|
67
|
+
|
|
68
|
+
- 配色无障碍要求:所有 `colorText*` 与对应 `colorSurface*` 的对比度必须 ≥ 4.5:1(WCAG AA)
|
|
69
|
+
- 设计稿源:`docs/design/figma-exports/`
|
|
70
|
+
- 二进制 Figma 源文件:走 LFS(见 [`docs/governance/assets.md`](../governance/assets.md))
|
|
@@ -35,9 +35,20 @@ npx @wneng/create-keel create my-full \
|
|
|
35
35
|
--agent rust-desktop --deploy kubernetes --contract rest+events \
|
|
36
36
|
--ai kiro --license apache-2.0 --gitLfs --integrations \
|
|
37
37
|
--ci github --roles qa,field,data,legal-security,marketing,design \
|
|
38
|
+
--engineering-standards full \
|
|
38
39
|
--yes
|
|
39
40
|
```
|
|
40
41
|
|
|
42
|
+
### 0.1.1 工程规范是另一个正交维度
|
|
43
|
+
|
|
44
|
+
档位决定 *目录与角色* 的启用范围;`--engineering-standards <tier>` 决定 *栈版本钉死、编码风格、模块边界、UI 设计系统* 的生成范围:
|
|
45
|
+
|
|
46
|
+
| `--engineering-standards` | 启用 | 默认 |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| `lite` | 仅每语言 `coding-style-<lang>.md` + 对应 lint 配置 | —— |
|
|
49
|
+
| `standard` | + `tech-stack-<env>.md` + `module-boundaries.md` + (multi-app + JS/TS)`dependency-cruiser.config.cjs` | ✓ `--yes` 默认 |
|
|
50
|
+
| `full` | + `ui-design-system.md` + `web/src/design-tokens.ts`(启用 frontend 时) | —— |
|
|
51
|
+
|
|
41
52
|
**已有项目升档**:
|
|
42
53
|
|
|
43
54
|
| 升档动作 | 操作 |
|