@tu-design/cli 0.4.3 → 0.5.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.mjs +86 -46
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -217,35 +217,60 @@ const RUNTIME_DEPS = [
|
|
|
217
217
|
* 与 @tu-design/vue/src/styles/tokens.css 保持一致(init-core.test.ts 有防漂移守卫)。
|
|
218
218
|
* 来源:packages/vue/src/styles/tokens.css
|
|
219
219
|
*/
|
|
220
|
-
const TOKENS_CSS_SOURCE =
|
|
220
|
+
const TOKENS_CSS_SOURCE = `/* tu-design 官方 tokens —— Tailwind CSS v4 主题(shadcn v4 集合扩展)。
|
|
221
|
+
*
|
|
222
|
+
* 主题桥接:语义色优先消费应用级 --app-* CSS 变量(应用主题系统写入),
|
|
223
|
+
* 未定义时回落官方 oklch 值 —— 无主题系统的项目观感与上游一致,零破坏。
|
|
224
|
+
* 契约(--app-* 全集见各项目主题包,如 @repo/themes):
|
|
225
|
+
* - --app-bg-page/surface/raised/hover → --background/--card/--popover/--muted/--accent
|
|
226
|
+
* - --app-text-1/2/3 → --foreground 及各 *-foreground/--muted-foreground
|
|
227
|
+
* (text-3 上游零消费,供应用侧直接使用)
|
|
228
|
+
* - --app-accent/-contrast → --primary(+foreground)/--ring
|
|
229
|
+
* - --app-border → --border/--input(dark 模式建议低不透明度值,如 #FFFFFF1A,对齐上游风格)
|
|
230
|
+
* - --secondary/-foreground 有意不桥接(上游定位即中性灰)
|
|
231
|
+
* - --app-destructive/success/warning/info → 状态色三件套:实色、-soft 浅底(未定义回落
|
|
232
|
+
* color-mix 派生)、-foreground 前景(深色实色场景如 dark destructive 白字对比 borderline,
|
|
233
|
+
* 建议应用侧显式定义覆盖)
|
|
234
|
+
* - .dark 块同样桥接,兜底为官方暗色 oklch;--*-soft 在 .dark 内重复声明:
|
|
235
|
+
* 自定义属性按声明处求值后继承,不在 .dark 重声明将无法响应暗色的实色变化。
|
|
236
|
+
*/
|
|
237
|
+
@import "tw-animate-css";
|
|
221
238
|
|
|
222
239
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
223
240
|
|
|
224
241
|
:root {
|
|
225
|
-
--background: oklch(1 0 0);
|
|
226
|
-
--foreground: oklch(0.145 0 0);
|
|
227
|
-
--card: oklch(1 0 0);
|
|
228
|
-
--card-foreground: oklch(0.145 0 0);
|
|
229
|
-
--popover: oklch(1 0 0);
|
|
230
|
-
--popover-foreground: oklch(0.145 0 0);
|
|
231
|
-
--primary: oklch(0.205 0 0);
|
|
232
|
-
--primary-foreground: oklch(0.985 0 0);
|
|
242
|
+
--background: var(--app-bg-page, oklch(1 0 0));
|
|
243
|
+
--foreground: var(--app-text-1, oklch(0.145 0 0));
|
|
244
|
+
--card: var(--app-bg-raised, oklch(1 0 0));
|
|
245
|
+
--card-foreground: var(--app-text-1, oklch(0.145 0 0));
|
|
246
|
+
--popover: var(--app-bg-raised, oklch(1 0 0));
|
|
247
|
+
--popover-foreground: var(--app-text-1, oklch(0.145 0 0));
|
|
248
|
+
--primary: var(--app-accent, oklch(0.205 0 0));
|
|
249
|
+
--primary-foreground: var(--app-accent-contrast, oklch(0.985 0 0));
|
|
233
250
|
--secondary: oklch(0.97 0 0);
|
|
234
251
|
--secondary-foreground: oklch(0.205 0 0);
|
|
235
|
-
--muted: oklch(0.97 0 0);
|
|
236
|
-
--muted-foreground: oklch(0.556 0 0);
|
|
237
|
-
--accent: oklch(0.97 0 0);
|
|
238
|
-
--accent-foreground: oklch(0.205 0 0);
|
|
239
|
-
--destructive: oklch(0.577 0.245 27.325);
|
|
240
|
-
--
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
--
|
|
245
|
-
--
|
|
246
|
-
--
|
|
247
|
-
--
|
|
248
|
-
--
|
|
252
|
+
--muted: var(--app-bg-surface, oklch(0.97 0 0));
|
|
253
|
+
--muted-foreground: var(--app-text-2, oklch(0.556 0 0));
|
|
254
|
+
--accent: var(--app-bg-hover, oklch(0.97 0 0));
|
|
255
|
+
--accent-foreground: var(--app-text-1, oklch(0.205 0 0));
|
|
256
|
+
--destructive: var(--app-destructive, oklch(0.577 0.245 27.325));
|
|
257
|
+
--destructive-soft: var(
|
|
258
|
+
--app-destructive-soft,
|
|
259
|
+
color-mix(in oklab, var(--destructive) 10%, transparent)
|
|
260
|
+
);
|
|
261
|
+
--destructive-foreground: var(--app-destructive-foreground, oklch(0.985 0 0));
|
|
262
|
+
--success: var(--app-success, oklch(0.596 0.145 163.225));
|
|
263
|
+
--success-soft: var(--app-success-soft, color-mix(in oklab, var(--success) 10%, transparent));
|
|
264
|
+
--success-foreground: var(--app-success-foreground, oklch(0.985 0 0));
|
|
265
|
+
--warning: var(--app-warning, oklch(0.666 0.179 58.318));
|
|
266
|
+
--warning-soft: var(--app-warning-soft, color-mix(in oklab, var(--warning) 12%, transparent));
|
|
267
|
+
--warning-foreground: var(--app-warning-foreground, oklch(0.985 0 0));
|
|
268
|
+
--info: var(--app-info, oklch(0.546 0.245 262.881));
|
|
269
|
+
--info-soft: var(--app-info-soft, color-mix(in oklab, var(--info) 12%, transparent));
|
|
270
|
+
--info-foreground: var(--app-info-foreground, oklch(0.985 0 0));
|
|
271
|
+
--border: var(--app-border, oklch(0.922 0 0));
|
|
272
|
+
--input: var(--app-border, oklch(0.922 0 0));
|
|
273
|
+
--ring: var(--app-accent, oklch(0.708 0 0));
|
|
249
274
|
--radius: 0.625rem;
|
|
250
275
|
/* 层叠序:表体 sticky < 表头 sticky < 浮层/弹窗(同级浮层按 DOM 挂载次序叠放) */
|
|
251
276
|
--z-sticky: 10;
|
|
@@ -254,30 +279,38 @@ const TOKENS_CSS_SOURCE = `@import "tw-animate-css";
|
|
|
254
279
|
}
|
|
255
280
|
|
|
256
281
|
.dark {
|
|
257
|
-
--background: oklch(0.145 0 0);
|
|
258
|
-
--foreground: oklch(0.985 0 0);
|
|
259
|
-
--card: oklch(0.205 0 0);
|
|
260
|
-
--card-foreground: oklch(0.985 0 0);
|
|
261
|
-
--popover: oklch(0.269 0 0);
|
|
262
|
-
--popover-foreground: oklch(0.985 0 0);
|
|
263
|
-
--primary: oklch(0.922 0 0);
|
|
264
|
-
--primary-foreground: oklch(0.205 0 0);
|
|
282
|
+
--background: var(--app-bg-page, oklch(0.145 0 0));
|
|
283
|
+
--foreground: var(--app-text-1, oklch(0.985 0 0));
|
|
284
|
+
--card: var(--app-bg-raised, oklch(0.205 0 0));
|
|
285
|
+
--card-foreground: var(--app-text-1, oklch(0.985 0 0));
|
|
286
|
+
--popover: var(--app-bg-raised, oklch(0.269 0 0));
|
|
287
|
+
--popover-foreground: var(--app-text-1, oklch(0.985 0 0));
|
|
288
|
+
--primary: var(--app-accent, oklch(0.922 0 0));
|
|
289
|
+
--primary-foreground: var(--app-accent-contrast, oklch(0.205 0 0));
|
|
265
290
|
--secondary: oklch(0.269 0 0);
|
|
266
291
|
--secondary-foreground: oklch(0.985 0 0);
|
|
267
|
-
--muted: oklch(0.269 0 0);
|
|
268
|
-
--muted-foreground: oklch(0.708 0 0);
|
|
269
|
-
--accent: oklch(0.371 0 0);
|
|
270
|
-
--accent-foreground: oklch(0.985 0 0);
|
|
271
|
-
--destructive: oklch(0.704 0.191 22.216);
|
|
272
|
-
--
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
--
|
|
277
|
-
--
|
|
278
|
-
--
|
|
279
|
-
--
|
|
280
|
-
--
|
|
292
|
+
--muted: var(--app-bg-surface, oklch(0.269 0 0));
|
|
293
|
+
--muted-foreground: var(--app-text-2, oklch(0.708 0 0));
|
|
294
|
+
--accent: var(--app-bg-hover, oklch(0.371 0 0));
|
|
295
|
+
--accent-foreground: var(--app-text-1, oklch(0.985 0 0));
|
|
296
|
+
--destructive: var(--app-destructive, oklch(0.704 0.191 22.216));
|
|
297
|
+
--destructive-soft: var(
|
|
298
|
+
--app-destructive-soft,
|
|
299
|
+
color-mix(in oklab, var(--destructive) 10%, transparent)
|
|
300
|
+
);
|
|
301
|
+
--destructive-foreground: var(--app-destructive-foreground, oklch(0.985 0 0));
|
|
302
|
+
--success: var(--app-success, oklch(0.696 0.17 162.48));
|
|
303
|
+
--success-soft: var(--app-success-soft, color-mix(in oklab, var(--success) 10%, transparent));
|
|
304
|
+
--success-foreground: var(--app-success-foreground, oklch(0.985 0 0));
|
|
305
|
+
--warning: var(--app-warning, oklch(0.769 0.188 70.08));
|
|
306
|
+
--warning-soft: var(--app-warning-soft, color-mix(in oklab, var(--warning) 12%, transparent));
|
|
307
|
+
--warning-foreground: var(--app-warning-foreground, oklch(0.205 0 0));
|
|
308
|
+
--info: var(--app-info, oklch(0.623 0.214 259.815));
|
|
309
|
+
--info-soft: var(--app-info-soft, color-mix(in oklab, var(--info) 12%, transparent));
|
|
310
|
+
--info-foreground: var(--app-info-foreground, oklch(0.985 0 0));
|
|
311
|
+
--border: var(--app-border, oklch(1 0 0 / 10%));
|
|
312
|
+
--input: var(--app-border, oklch(1 0 0 / 15%));
|
|
313
|
+
--ring: var(--app-accent, oklch(0.556 0 0));
|
|
281
314
|
}
|
|
282
315
|
|
|
283
316
|
@theme inline {
|
|
@@ -285,6 +318,7 @@ const TOKENS_CSS_SOURCE = `@import "tw-animate-css";
|
|
|
285
318
|
--radius-md: calc(var(--radius) - 2px);
|
|
286
319
|
--radius-lg: var(--radius);
|
|
287
320
|
--radius-xl: calc(var(--radius) + 4px);
|
|
321
|
+
--radius-2xl: calc(var(--radius) + 6px);
|
|
288
322
|
--color-background: var(--background);
|
|
289
323
|
--color-foreground: var(--foreground);
|
|
290
324
|
--color-card: var(--card);
|
|
@@ -300,12 +334,17 @@ const TOKENS_CSS_SOURCE = `@import "tw-animate-css";
|
|
|
300
334
|
--color-accent: var(--accent);
|
|
301
335
|
--color-accent-foreground: var(--accent-foreground);
|
|
302
336
|
--color-destructive: var(--destructive);
|
|
337
|
+
--color-destructive-soft: var(--destructive-soft);
|
|
338
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
303
339
|
--color-success: var(--success);
|
|
304
340
|
--color-success-foreground: var(--success-foreground);
|
|
341
|
+
--color-success-soft: var(--success-soft);
|
|
305
342
|
--color-warning: var(--warning);
|
|
306
343
|
--color-warning-foreground: var(--warning-foreground);
|
|
344
|
+
--color-warning-soft: var(--warning-soft);
|
|
307
345
|
--color-info: var(--info);
|
|
308
346
|
--color-info-foreground: var(--info-foreground);
|
|
347
|
+
--color-info-soft: var(--info-soft);
|
|
309
348
|
--color-border: var(--border);
|
|
310
349
|
--color-input: var(--input);
|
|
311
350
|
--color-ring: var(--ring);
|
|
@@ -317,7 +356,8 @@ const TOKENS_CSS_SOURCE = `@import "tw-animate-css";
|
|
|
317
356
|
* {
|
|
318
357
|
border-color: var(--color-border);
|
|
319
358
|
}
|
|
320
|
-
}
|
|
359
|
+
}
|
|
360
|
+
`;
|
|
321
361
|
/** cn 工具模板,等价 @tu-design/vue/src/lib/utils.ts。 */
|
|
322
362
|
const CN_UTIL_SOURCE = `import { clsx, type ClassValue } from "clsx";
|
|
323
363
|
import { twMerge } from "tailwind-merge";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tu-design/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "tu-design CLI:初始化并按 registry 分发组件源码到用户项目(shadcn 模式)。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
38
|
-
"@tu-design/vue": "0.
|
|
38
|
+
"@tu-design/vue": "0.5.0",
|
|
39
39
|
"commander": "^15",
|
|
40
40
|
"picocolors": "^1",
|
|
41
41
|
"prompts": "^2",
|