@getcoherent/cli 0.6.34 → 0.6.36
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.
|
@@ -2230,6 +2230,12 @@ async function regenerateLayout(config, projectRoot, options = {
|
|
|
2230
2230
|
await mkdirAsync(resolve3(projectRoot, "app", "(public)"), { recursive: true });
|
|
2231
2231
|
await writeFileAsync(publicLayoutPath, buildPublicLayoutCodeForSidebar(), "utf-8");
|
|
2232
2232
|
}
|
|
2233
|
+
const rootPagePath = resolve3(projectRoot, "app", "page.tsx");
|
|
2234
|
+
const publicPagePath = resolve3(projectRoot, "app", "(public)", "page.tsx");
|
|
2235
|
+
if (existsSync5(rootPagePath) && !existsSync5(publicPagePath)) {
|
|
2236
|
+
const { renameSync } = await import("fs");
|
|
2237
|
+
renameSync(rootPagePath, publicPagePath);
|
|
2238
|
+
}
|
|
2233
2239
|
const themeTogglePath = resolve3(projectRoot, "components", "shared", "theme-toggle.tsx");
|
|
2234
2240
|
if (!existsSync5(themeTogglePath)) {
|
|
2235
2241
|
await mkdirAsync(resolve3(projectRoot, "components", "shared"), { recursive: true });
|
package/dist/index.js
CHANGED
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
warnIfVolatile,
|
|
39
39
|
warnInlineDuplicates,
|
|
40
40
|
writeFile
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-TD2ZYIIC.js";
|
|
42
42
|
import {
|
|
43
43
|
COHERENT_REQUIRED_PACKAGES,
|
|
44
44
|
ensureUseClientIfNeeded,
|
|
@@ -2366,6 +2366,8 @@ For editing an existing shared component use type "modify-layout-block" with tar
|
|
|
2366
2366
|
const visualDepth = VISUAL_DEPTH;
|
|
2367
2367
|
const contextualRules = selectContextualRules(message);
|
|
2368
2368
|
const interactionPatterns = INTERACTION_PATTERNS;
|
|
2369
|
+
const light = config2.tokens.colors.light;
|
|
2370
|
+
const dark = config2.tokens.colors.dark;
|
|
2369
2371
|
return `You are a design-forward UI architect. Your goal is to create interfaces that are not just functional, but visually distinctive and memorable \u2014 while staying within shadcn/ui and Tailwind CSS.
|
|
2370
2372
|
|
|
2371
2373
|
Parse the user's natural language request into structured modification requests.
|
|
@@ -2383,6 +2385,16 @@ Current Design System:
|
|
|
2383
2385
|
- Pages: ${config2.pages.map((p) => `${p.name} (${p.route})`).join(", ")}
|
|
2384
2386
|
- Components: ${config2.components.length} components
|
|
2385
2387
|
|
|
2388
|
+
Current color tokens (#RRGGBB hex):
|
|
2389
|
+
Light theme:
|
|
2390
|
+
Brand: primary=${light.primary}, secondary=${light.secondary}, accent=${light.accent || "none"}
|
|
2391
|
+
Status: success=${light.success}, warning=${light.warning}, error=${light.error}, info=${light.info}
|
|
2392
|
+
Surface: background=${light.background}, foreground=${light.foreground}, muted=${light.muted}, border=${light.border}
|
|
2393
|
+
Dark theme:
|
|
2394
|
+
Brand: primary=${dark.primary}, secondary=${dark.secondary}, accent=${dark.accent || "none"}
|
|
2395
|
+
Status: success=${dark.success}, warning=${dark.warning}, error=${dark.error}, info=${dark.info}
|
|
2396
|
+
Surface: background=${dark.background}, foreground=${dark.foreground}, muted=${dark.muted}, border=${dark.border}
|
|
2397
|
+
|
|
2386
2398
|
EXISTING ROUTES IN THIS PROJECT:
|
|
2387
2399
|
${config2.pages.map((p) => p.route).join(", ") || "(no pages yet)"}
|
|
2388
2400
|
|
|
@@ -2414,7 +2426,7 @@ Parse this into one or more ModificationRequest objects. Each request should be:
|
|
|
2414
2426
|
5. For add-component with source "shadcn": include id, name, category, source: "shadcn", shadcnComponent, baseClassName (or omit for default), variants: [], sizes: [], usedInPages: [], createdAt, updatedAt
|
|
2415
2427
|
|
|
2416
2428
|
Available modification types:
|
|
2417
|
-
- "update-token": Change design token (e.g
|
|
2429
|
+
- "update-token": Change design token. target: dot-path (e.g. "colors.light.primary"). changes: { "value": "#RRGGBB" }. Color values MUST be 6-digit hex with # prefix (e.g. #4F46E5 for indigo, #DC2626 for red). When changing a color, ALWAYS update BOTH light and dark themes for consistency.
|
|
2418
2430
|
- "add-component": Add new component (check registry first for reuse!)
|
|
2419
2431
|
- "modify-component": Update existing component
|
|
2420
2432
|
- "modify-layout-block": Edit a shared layout component by ID or name (target: "CID-001" or "Header"). changes: { "instruction": "user instruction e.g. add a search button" }. Use when user says "in CID-001 add...", "update the header...", "change the footer...".
|
|
@@ -2986,6 +2998,7 @@ function fixGlobalsCss(projectRoot, config2) {
|
|
|
2986
2998
|
}
|
|
2987
2999
|
|
|
2988
3000
|
// src/commands/chat/request-parser.ts
|
|
3001
|
+
import { colorToHex } from "@getcoherent/core";
|
|
2989
3002
|
var AUTH_FLOW_PATTERNS = {
|
|
2990
3003
|
"/login": ["/signup", "/forgot-password"],
|
|
2991
3004
|
"/signin": ["/signup", "/forgot-password"],
|
|
@@ -3289,6 +3302,18 @@ function normalizeRequest(request, config2) {
|
|
|
3289
3302
|
}
|
|
3290
3303
|
break;
|
|
3291
3304
|
}
|
|
3305
|
+
case "update-token": {
|
|
3306
|
+
if (changes?.value && typeof changes.value === "string") {
|
|
3307
|
+
const isColorPath = request.target.includes("colors.");
|
|
3308
|
+
if (isColorPath) {
|
|
3309
|
+
const hex = colorToHex(changes.value);
|
|
3310
|
+
if (hex && hex !== changes.value) {
|
|
3311
|
+
return { ...request, changes: { ...changes, value: hex } };
|
|
3312
|
+
}
|
|
3313
|
+
}
|
|
3314
|
+
}
|
|
3315
|
+
break;
|
|
3316
|
+
}
|
|
3292
3317
|
}
|
|
3293
3318
|
return request;
|
|
3294
3319
|
}
|
|
@@ -8455,10 +8480,14 @@ async function fixCommand(opts = {}) {
|
|
|
8455
8480
|
}
|
|
8456
8481
|
try {
|
|
8457
8482
|
const { loadPlan: loadPlan2 } = await import("./plan-generator-625ZNUZF.js");
|
|
8458
|
-
const { ensurePlanGroupLayouts: ensurePlanGroupLayouts2 } = await import("./code-generator-
|
|
8483
|
+
const { ensurePlanGroupLayouts: ensurePlanGroupLayouts2 } = await import("./code-generator-D3ZHOO4M.js");
|
|
8459
8484
|
const plan = loadPlan2(projectRoot);
|
|
8460
8485
|
if (plan) {
|
|
8461
|
-
|
|
8486
|
+
if (!dsm) {
|
|
8487
|
+
dsm = new DesignSystemManager9(project.configPath);
|
|
8488
|
+
await dsm.load();
|
|
8489
|
+
}
|
|
8490
|
+
await ensurePlanGroupLayouts2(projectRoot, plan, {}, dsm.getConfig());
|
|
8462
8491
|
const layoutTypes = plan.groups.map((g) => `${g.id}:${g.layout}`).join(", ");
|
|
8463
8492
|
fixes.push(`Verified group layouts (${layoutTypes})`);
|
|
8464
8493
|
console.log(chalk15.green(` \u2714 Verified group layouts: ${layoutTypes}`));
|
|
@@ -8497,15 +8526,24 @@ async function fixCommand(opts = {}) {
|
|
|
8497
8526
|
const publicExists = existsSync16(publicLayoutPath);
|
|
8498
8527
|
const needsPublicLayout = !publicExists || !readFileSync12(publicLayoutPath, "utf-8").includes("<Header");
|
|
8499
8528
|
if (needsPublicLayout) {
|
|
8500
|
-
const { buildPublicLayoutCodeForSidebar } = await import("./code-generator-
|
|
8529
|
+
const { buildPublicLayoutCodeForSidebar } = await import("./code-generator-D3ZHOO4M.js");
|
|
8501
8530
|
mkdirSync7(resolve10(projectRoot, "app", "(public)"), { recursive: true });
|
|
8502
8531
|
writeFileSync10(publicLayoutPath, buildPublicLayoutCodeForSidebar(), "utf-8");
|
|
8503
8532
|
fixes.push("Added Header/Footer to (public) layout");
|
|
8504
8533
|
console.log(chalk15.green(" \u2714 Added Header/Footer to (public) layout"));
|
|
8505
8534
|
}
|
|
8535
|
+
const rootPagePath = resolve10(projectRoot, "app", "page.tsx");
|
|
8536
|
+
const publicPagePath = resolve10(projectRoot, "app", "(public)", "page.tsx");
|
|
8537
|
+
if (existsSync16(rootPagePath) && !existsSync16(publicPagePath)) {
|
|
8538
|
+
const { renameSync } = await import("fs");
|
|
8539
|
+
mkdirSync7(resolve10(projectRoot, "app", "(public)"), { recursive: true });
|
|
8540
|
+
renameSync(rootPagePath, publicPagePath);
|
|
8541
|
+
fixes.push("Moved app/page.tsx \u2192 app/(public)/page.tsx (sidebar mode)");
|
|
8542
|
+
console.log(chalk15.green(" \u2714 Moved app/page.tsx \u2192 app/(public)/page.tsx (gets Header/Footer)"));
|
|
8543
|
+
}
|
|
8506
8544
|
const themeTogglePath = resolve10(projectRoot, "components", "shared", "theme-toggle.tsx");
|
|
8507
8545
|
if (!existsSync16(themeTogglePath)) {
|
|
8508
|
-
const { generateThemeToggleCode } = await import("./code-generator-
|
|
8546
|
+
const { generateThemeToggleCode } = await import("./code-generator-D3ZHOO4M.js");
|
|
8509
8547
|
mkdirSync7(resolve10(projectRoot, "components", "shared"), { recursive: true });
|
|
8510
8548
|
writeFileSync10(themeTogglePath, generateThemeToggleCode(), "utf-8");
|
|
8511
8549
|
fixes.push("Generated ThemeToggle component (components/shared/theme-toggle.tsx)");
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.6.
|
|
6
|
+
"version": "0.6.36",
|
|
7
7
|
"description": "CLI interface for Coherent Design Method",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./dist/index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"ora": "^7.0.1",
|
|
44
44
|
"prompts": "^2.4.2",
|
|
45
45
|
"zod": "^3.22.4",
|
|
46
|
-
"@getcoherent/core": "0.6.
|
|
46
|
+
"@getcoherent/core": "0.6.36"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/node": "^20.11.0",
|