@getcoherent/cli 0.6.31 → 0.6.33

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.
@@ -715,6 +715,11 @@ async function autoFixCode(code, context) {
715
715
  if (fixed !== beforeEntityFix) {
716
716
  fixes.push("Fixed syntax issues");
717
717
  }
718
+ const beforeTemplateFix = fixed;
719
+ fixed = fixed.replace(/`\)>/g, "`}>");
720
+ if (fixed !== beforeTemplateFix) {
721
+ fixes.push("Fixed syntax issues");
722
+ }
718
723
  const isJsExpr = (text) => /[().;=&|!?]/.test(text);
719
724
  const beforeLtFix = fixed;
720
725
  fixed = fixed.replace(/>([^<{}\n]*)<(\d)/g, (m, text, d) => isJsExpr(text) ? m : `>${text}&lt;${d}`);
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-5AHG4NNX.js";
6
6
  import {
7
7
  autoFixCode
8
- } from "./chunk-NP2CGABX.js";
8
+ } from "./chunk-4A4YYAGN.js";
9
9
 
10
10
  // src/commands/chat/plan-generator.ts
11
11
  import { z } from "zod";
@@ -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(/>([^<\n]*)<(\d)/g, ">$1&lt;$2");
229
- out = out.replace(/>([^<\n]*)<([^/a-zA-Z!{>\n])/g, ">$1&lt;$2");
229
+ out = out.replace(/>([^<{}\n]*)<(\d)/g, (m, text, d) => isJsExpr(text) ? m : `>${text}&lt;${d}`);
230
+ out = out.replace(/>([^<{}\n]*)<([^/a-zA-Z!{>\n])/g, (m, text, ch) => isJsExpr(text) ? m : `>${text}&lt;${ch}`);
230
231
  return out;
231
232
  }
232
233
 
@@ -6,7 +6,7 @@ import {
6
6
  getPageGroup,
7
7
  installPackages,
8
8
  sanitizeMetadataStrings
9
- } from "./chunk-RKXLSNDV.js";
9
+ } from "./chunk-QT5MRW4F.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-QKBYJB4A.js");
2152
+ const { loadPlan: loadPlanForPath } = await import("./plan-generator-625ZNUZF.js");
2153
2153
  const planForPath = loadPlanForPath(projectRoot);
2154
2154
  const filePath = routeToFsPath(projectRoot, route, planForPath || isAuth);
2155
2155
  await mkdir3(dirname3(filePath), { recursive: true });
@@ -10,10 +10,10 @@ import {
10
10
  regeneratePage,
11
11
  scanAndInstallSharedDeps,
12
12
  validateAndFixGeneratedCode
13
- } from "./chunk-HAOCJBHP.js";
14
- import "./chunk-RKXLSNDV.js";
13
+ } from "./chunk-WONZJJN5.js";
14
+ import "./chunk-QT5MRW4F.js";
15
15
  import "./chunk-5AHG4NNX.js";
16
- import "./chunk-NP2CGABX.js";
16
+ import "./chunk-4A4YYAGN.js";
17
17
  import "./chunk-3RG5ZIWI.js";
18
18
  export {
19
19
  buildAppLayoutCode,
package/dist/index.js CHANGED
@@ -38,7 +38,7 @@ import {
38
38
  warnIfVolatile,
39
39
  warnInlineDuplicates,
40
40
  writeFile
41
- } from "./chunk-HAOCJBHP.js";
41
+ } from "./chunk-WONZJJN5.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-RKXLSNDV.js";
59
+ } from "./chunk-QT5MRW4F.js";
60
60
  import {
61
61
  CORE_CONSTRAINTS,
62
62
  DESIGN_QUALITY,
@@ -74,7 +74,7 @@ import {
74
74
  formatIssues,
75
75
  validatePageQuality,
76
76
  verifyIncrementalEdit
77
- } from "./chunk-NP2CGABX.js";
77
+ } from "./chunk-4A4YYAGN.js";
78
78
  import {
79
79
  __require
80
80
  } from "./chunk-3RG5ZIWI.js";
@@ -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-QKBYJB4A.js");
4112
+ const { generateSharedComponentsFromPlan } = await import("./plan-generator-625ZNUZF.js");
4113
4113
  const generated = await generateSharedComponentsFromPlan(
4114
4114
  plan,
4115
4115
  styleContext,
@@ -5967,7 +5967,7 @@ async function chatCommand(message, options) {
5967
5967
  spinner.start(`Creating shared component: ${componentName}...`);
5968
5968
  const { createAIProvider: createAIProvider2 } = await import("./ai-provider-CGSIYFZT.js");
5969
5969
  const { generateSharedComponent: generateSharedComponent6 } = await import("@getcoherent/core");
5970
- const { autoFixCode: autoFixCode2 } = await import("./quality-validator-EC2QSVEM.js");
5970
+ const { autoFixCode: autoFixCode2 } = await import("./quality-validator-ONJCQ325.js");
5971
5971
  const { extractPropsInterface, extractDependencies } = await import("./component-extractor-VYJLT5NR.js");
5972
5972
  const aiProvider = await createAIProvider2(provider ?? "auto");
5973
5973
  const prompt = `Generate a React component called "${componentName}". Description: ${message}.
@@ -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-QKBYJB4A.js");
8447
- const { ensurePlanGroupLayouts: ensurePlanGroupLayouts2 } = await import("./code-generator-4PGW3SWR.js");
8446
+ const { loadPlan: loadPlan2 } = await import("./plan-generator-625ZNUZF.js");
8447
+ const { ensurePlanGroupLayouts: ensurePlanGroupLayouts2 } = await import("./code-generator-G7ABCFAD.js");
8448
8448
  const plan = loadPlan2(projectRoot);
8449
8449
  if (plan) {
8450
8450
  await ensurePlanGroupLayouts2(projectRoot, plan);
@@ -11,9 +11,9 @@ import {
11
11
  routeToKey,
12
12
  savePlan,
13
13
  updateArchitecturePlan
14
- } from "./chunk-RKXLSNDV.js";
14
+ } from "./chunk-QT5MRW4F.js";
15
15
  import "./chunk-5AHG4NNX.js";
16
- import "./chunk-NP2CGABX.js";
16
+ import "./chunk-4A4YYAGN.js";
17
17
  import "./chunk-3RG5ZIWI.js";
18
18
  export {
19
19
  ArchitecturePlanSchema,
@@ -4,7 +4,7 @@ import {
4
4
  formatIssues,
5
5
  validatePageQuality,
6
6
  verifyIncrementalEdit
7
- } from "./chunk-NP2CGABX.js";
7
+ } from "./chunk-4A4YYAGN.js";
8
8
  import "./chunk-3RG5ZIWI.js";
9
9
  export {
10
10
  autoFixCode,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.6.31",
6
+ "version": "0.6.33",
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.31"
46
+ "@getcoherent/core": "0.6.33"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/node": "^20.11.0",