@getcoherent/cli 0.6.30 → 0.6.32
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/{chunk-KUXMS2EF.js → chunk-KUCRJLLU.js} +6 -10
- package/dist/{chunk-RKXLSNDV.js → chunk-NK4G2DES.js} +3 -2
- package/dist/{code-generator-LTS6F77G.js → code-generator-GAUWEX3G.js} +2 -2
- package/dist/index.js +10 -16
- package/dist/{plan-generator-QKBYJB4A.js → plan-generator-HQAAV5S4.js} +1 -1
- package/package.json +2 -2
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getPageGroup,
|
|
7
7
|
installPackages,
|
|
8
8
|
sanitizeMetadataStrings
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NK4G2DES.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/chat/code-generator.ts
|
|
12
12
|
import { resolve as resolve3 } from "path";
|
|
@@ -2149,7 +2149,7 @@ async function regeneratePage(pageId, config, projectRoot) {
|
|
|
2149
2149
|
const code = await generator.generate(page, appType);
|
|
2150
2150
|
const route = page.route || "/";
|
|
2151
2151
|
const isAuth = isAuthRoute(route) || isAuthRoute(page.name || page.id || "");
|
|
2152
|
-
const { loadPlan: loadPlanForPath } = await import("./plan-generator-
|
|
2152
|
+
const { loadPlan: loadPlanForPath } = await import("./plan-generator-HQAAV5S4.js");
|
|
2153
2153
|
const planForPath = loadPlanForPath(projectRoot);
|
|
2154
2154
|
const filePath = routeToFsPath(projectRoot, route, planForPath || isAuth);
|
|
2155
2155
|
await mkdir3(dirname3(filePath), { recursive: true });
|
|
@@ -2209,14 +2209,10 @@ async function regenerateLayout(config, projectRoot, options = {
|
|
|
2209
2209
|
if (navType === "sidebar" || navType === "both") {
|
|
2210
2210
|
if (await canOverwriteShared(projectRoot, "components/shared/sidebar.tsx", hashes)) {
|
|
2211
2211
|
const sidebarCode = generator.generateSharedSidebarCode();
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
description: "Application sidebar using shadcn/ui Sidebar components",
|
|
2217
|
-
usedIn: ["app/(app)/layout.tsx"],
|
|
2218
|
-
overwrite: true
|
|
2219
|
-
});
|
|
2212
|
+
const sidebarPath = resolve3(projectRoot, "components", "shared", "sidebar.tsx");
|
|
2213
|
+
const { mkdir: mkdir4, writeFile: writeFile4 } = await import("fs/promises");
|
|
2214
|
+
await mkdir4(resolve3(projectRoot, "components", "shared"), { recursive: true });
|
|
2215
|
+
await writeFile4(sidebarPath, sidebarCode, "utf-8");
|
|
2220
2216
|
}
|
|
2221
2217
|
}
|
|
2222
2218
|
}
|
|
@@ -224,9 +224,10 @@ function fixEscapedClosingQuotes(code) {
|
|
|
224
224
|
return out;
|
|
225
225
|
}
|
|
226
226
|
function fixUnescapedLtInJsx(code) {
|
|
227
|
+
const isJsExpr = (text) => /[().;=&|!?]/.test(text);
|
|
227
228
|
let out = code;
|
|
228
|
-
out = out.replace(/>([
|
|
229
|
-
out = out.replace(/>([
|
|
229
|
+
out = out.replace(/>([^<{}\n]*)<(\d)/g, (m, text, d) => isJsExpr(text) ? m : `>${text}<${d}`);
|
|
230
|
+
out = out.replace(/>([^<{}\n]*)<([^/a-zA-Z!{>\n])/g, (m, text, ch) => isJsExpr(text) ? m : `>${text}<${ch}`);
|
|
230
231
|
return out;
|
|
231
232
|
}
|
|
232
233
|
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
regeneratePage,
|
|
11
11
|
scanAndInstallSharedDeps,
|
|
12
12
|
validateAndFixGeneratedCode
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-KUCRJLLU.js";
|
|
14
|
+
import "./chunk-NK4G2DES.js";
|
|
15
15
|
import "./chunk-5AHG4NNX.js";
|
|
16
16
|
import "./chunk-NP2CGABX.js";
|
|
17
17
|
import "./chunk-3RG5ZIWI.js";
|
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-KUCRJLLU.js";
|
|
42
42
|
import {
|
|
43
43
|
COHERENT_REQUIRED_PACKAGES,
|
|
44
44
|
ensureUseClientIfNeeded,
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
sanitizeMetadataStrings,
|
|
57
57
|
savePlan,
|
|
58
58
|
updateArchitecturePlan
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-NK4G2DES.js";
|
|
60
60
|
import {
|
|
61
61
|
CORE_CONSTRAINTS,
|
|
62
62
|
DESIGN_QUALITY,
|
|
@@ -4109,7 +4109,7 @@ async function splitGeneratePages(spinner, message, modCtx, provider, parseOpts)
|
|
|
4109
4109
|
if (plan && plan.sharedComponents.length > 0) {
|
|
4110
4110
|
spinner.start(`Phase 4.5/6 \u2014 Generating ${plan.sharedComponents.length} shared components from plan...`);
|
|
4111
4111
|
try {
|
|
4112
|
-
const { generateSharedComponentsFromPlan } = await import("./plan-generator-
|
|
4112
|
+
const { generateSharedComponentsFromPlan } = await import("./plan-generator-HQAAV5S4.js");
|
|
4113
4113
|
const generated = await generateSharedComponentsFromPlan(
|
|
4114
4114
|
plan,
|
|
4115
4115
|
styleContext,
|
|
@@ -8443,8 +8443,8 @@ async function fixCommand(opts = {}) {
|
|
|
8443
8443
|
console.log(chalk15.green(` \u2714 ${verb} syntax: ${syntaxFixed} file(s) (use client, metadata, quotes)`));
|
|
8444
8444
|
}
|
|
8445
8445
|
try {
|
|
8446
|
-
const { loadPlan: loadPlan2 } = await import("./plan-generator-
|
|
8447
|
-
const { ensurePlanGroupLayouts: ensurePlanGroupLayouts2 } = await import("./code-generator-
|
|
8446
|
+
const { loadPlan: loadPlan2 } = await import("./plan-generator-HQAAV5S4.js");
|
|
8447
|
+
const { ensurePlanGroupLayouts: ensurePlanGroupLayouts2 } = await import("./code-generator-GAUWEX3G.js");
|
|
8448
8448
|
const plan = loadPlan2(projectRoot);
|
|
8449
8449
|
if (plan) {
|
|
8450
8450
|
await ensurePlanGroupLayouts2(projectRoot, plan);
|
|
@@ -8458,19 +8458,13 @@ async function fixCommand(opts = {}) {
|
|
|
8458
8458
|
dsm = new DesignSystemManager9(project.configPath);
|
|
8459
8459
|
await dsm.load();
|
|
8460
8460
|
}
|
|
8461
|
-
const { PageGenerator
|
|
8461
|
+
const { PageGenerator } = await import("@getcoherent/core");
|
|
8462
8462
|
const generator = new PageGenerator(dsm.getConfig());
|
|
8463
8463
|
const sidebarCode = generator.generateSharedSidebarCode();
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
description: "Application sidebar using shadcn/ui Sidebar components",
|
|
8469
|
-
usedIn: ["app/(app)/layout.tsx"],
|
|
8470
|
-
overwrite: true
|
|
8471
|
-
});
|
|
8472
|
-
fixes.push("Generated AppSidebar shared component");
|
|
8473
|
-
console.log(chalk15.green(" \u2714 Generated AppSidebar shared component"));
|
|
8464
|
+
mkdirSync7(resolve10(projectRoot, "components", "shared"), { recursive: true });
|
|
8465
|
+
writeFileSync10(sidebarPath, sidebarCode, "utf-8");
|
|
8466
|
+
fixes.push("Generated AppSidebar component (components/shared/sidebar.tsx)");
|
|
8467
|
+
console.log(chalk15.green(" \u2714 Generated AppSidebar component"));
|
|
8474
8468
|
}
|
|
8475
8469
|
}
|
|
8476
8470
|
} catch {
|
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.32",
|
|
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.32"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/node": "^20.11.0",
|