draftgo-cli 3.0.44 → 3.0.48

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.
@@ -1,99 +0,0 @@
1
- ---
2
- read_when: 开发数据库页面时需要真实 shadcn/Radix 组件能力 · 了解 data-ui bridge 协议时
3
- ---
4
-
5
- # shadcn Page Runtime Bridge 协议
6
-
7
- ## 核心认知
8
-
9
- 数据库页面不进入 Vite/React 编译链,不能写 TSX、React import 或 shadcn 组件源码。
10
-
11
- DraftGo 页面默认写普通 HTML + Tailwind CSS + 页面级 CSS。只有显式带 `data-ui` 的节点会交给 shadcn page runtime bridge 接管,普通 `<table>`、`<button>`、自定义 HTML 不会被强制改造成 shadcn。
12
-
13
- ```
14
- 普通 HTML / Tailwind / CSS → 页面作者完全控制
15
- data-ui 节点 → DraftGo bridge 挂载真实 shadcn/Radix
16
- ```
17
-
18
- ## 当前稳定协议
19
-
20
- | 能力 | HTML 写法 | 底层 |
21
- |---|---|---|
22
- | Button | `<button data-ui="button">` | shadcn Button |
23
- | Static Table | `<div data-ui="table"><table>...</table></div>` | shadcn Table 样式增强 |
24
- | DropdownMenu | `data-ui="dropdown-menu-trigger/content/item/separator"` | Radix DropdownMenu |
25
- | DataTable | `<div data-ui="data-table" data-source="pages">` | DraftGo 数据源 + shadcn Table |
26
-
27
- ## 示例
28
-
29
- ```html
30
- <div data-ui="table">
31
- <table>
32
- <thead>
33
- <tr>
34
- <th>Product</th>
35
- <th>Price</th>
36
- <th data-align="right">Actions</th>
37
- </tr>
38
- </thead>
39
- <tbody>
40
- <tr>
41
- <td data-weight="medium">Wireless Mouse</td>
42
- <td>$29.99</td>
43
- <td data-align="right">
44
- <button data-ui="dropdown-menu-trigger" data-variant="ghost" data-size="icon">
45
- <span data-icon="more-horizontal"></span>
46
- <span class="sr-only">Open menu</span>
47
- </button>
48
- <div data-ui="dropdown-menu-content" data-align="end">
49
- <button data-ui="dropdown-menu-item">Edit</button>
50
- <button data-ui="dropdown-menu-item">Duplicate</button>
51
- <div data-ui="dropdown-menu-separator"></div>
52
- <button data-ui="dropdown-menu-item" data-variant="destructive">Delete</button>
53
- </div>
54
- </td>
55
- </tr>
56
- </tbody>
57
- </table>
58
- </div>
59
- ```
60
-
61
- ```html
62
- <div
63
- data-ui="data-table"
64
- data-source="pages"
65
- data-page-size="12"
66
- data-columns='[
67
- {"key":"id","title":"ID"},
68
- {"key":"title","title":"标题"},
69
- {"key":"route","title":"路由"},
70
- {"key":"status","title":"状态","type":"badge"}
71
- ]'>
72
- </div>
73
- ```
74
-
75
- ## Tailwind 规则
76
-
77
- Page 资产仍然以 Tailwind HTML 为主。完整页面需要任意 Tailwind 原子类时使用本地 `/assets/tailwindcss.js`;修改既有页面时保留其已验证的本地资源引用。禁止外部 CDN。
78
-
79
- bridge 注入的 CSS 只保证 `data-ui` 组件需要的 shadcn/Tailwind 样式,不负责动态编译数据库 HTML 中任意 Tailwind class。
80
-
81
- ## 主题规则
82
-
83
- DraftGo 主题变量是唯一主题源头。bridge 组件只消费由 DraftGo token 映射出的 shadcn CSS variables:
84
-
85
- - `--dg-bg-page` -> `--background`
86
- - `--dg-text-primary` -> `--foreground`
87
- - `--dg-bg-surface` -> `--card`
88
- - `--dg-modal-bg` -> `--popover`
89
- - `--dg-border` -> `--border`
90
- - `--dg-action` / `--dg-brand` / `--dg-accent` -> `--primary`
91
- - `--dg-action-fg` -> `--primary-foreground`
92
- - `--dg-error` -> `--destructive`
93
- - `--dg-radius` -> `--radius`
94
-
95
- ## 禁止
96
-
97
- - 不要把 `data-ui` 当成 Bootstrap、daisyUI、Ant Design 或 Element Plus。
98
- - 不要在数据库 HTML 里写 JSX/TSX/React import。
99
- - 不要把普通 HTML 强制包成 shadcn;只有用户明确需要组件能力时才加 `data-ui`。
@@ -1,10 +0,0 @@
1
- # Skill scripts
2
-
3
- DraftGo execution is provided by the installed `draftgo` CLI. Legacy Python pull, push, init, and delete helpers were
4
- removed because they depended on full local mirrors and bypassed the MCP plus checkout/commit safety model.
5
-
6
- Context orchestration belongs to the registered `draftgo context` CLI command. Do not duplicate it in Skill scripts and do not add an aggregate MCP tool for it.
7
-
8
- Do not add a script that downloads `.draftgo/*/index.json`, embeds SAT credentials, sends full pages/nav/docs content
9
- through MCP, or retries version conflicts with force. Reusable helpers added here must preserve the workflows in
10
- `references/mcp.md` and `references/checkout.md`.