@getcoherent/cli 0.6.26 → 0.6.27
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-H644LLXJ.js → chunk-4WTUPW2L.js} +7 -3
- package/dist/chunk-EUE5UIOI.js +2468 -0
- package/dist/{chunk-CC3ARMGS.js → chunk-VNDQ4DYQ.js} +1 -1
- package/dist/code-generator-7RUQTKXA.js +30 -0
- package/dist/index.js +1274 -3635
- package/dist/{plan-generator-WPYWUA7U.js → plan-generator-HRULTJ55.js} +2 -2
- package/dist/{quality-validator-VDQXXDAV.js → quality-validator-BCN2ECNV.js} +1 -1
- package/package.json +2 -2
|
@@ -715,9 +715,10 @@ async function autoFixCode(code, context) {
|
|
|
715
715
|
if (fixed !== beforeEntityFix) {
|
|
716
716
|
fixes.push("Fixed syntax issues");
|
|
717
717
|
}
|
|
718
|
+
const isJsExpr = (text) => /[().;=&|!?]/.test(text);
|
|
718
719
|
const beforeLtFix = fixed;
|
|
719
|
-
fixed = fixed.replace(/>([^<{}\n]*)<(\d)/g,
|
|
720
|
-
fixed = fixed.replace(/>([^<{}\n]*)<([^/a-zA-Z!{>\n])/g,
|
|
720
|
+
fixed = fixed.replace(/>([^<{}\n]*)<(\d)/g, (m, text, d) => isJsExpr(text) ? m : `>${text}<${d}`);
|
|
721
|
+
fixed = fixed.replace(/>([^<{}\n]*)<([^/a-zA-Z!{>\n])/g, (m, text, ch) => isJsExpr(text) ? m : `>${text}<${ch}`);
|
|
721
722
|
if (fixed !== beforeLtFix) {
|
|
722
723
|
fixes.push("escaped < in JSX text content");
|
|
723
724
|
}
|
|
@@ -1132,7 +1133,10 @@ ${selectImport}`
|
|
|
1132
1133
|
if (lucideExports2) {
|
|
1133
1134
|
const allImportedNames = /* @__PURE__ */ new Set();
|
|
1134
1135
|
for (const m of fixed.matchAll(/import\s*\{([^}]+)\}\s*from/g)) {
|
|
1135
|
-
m[1].split(",").map((s) => s.trim()).filter(Boolean).forEach((n) =>
|
|
1136
|
+
m[1].split(",").map((s) => s.trim()).filter(Boolean).forEach((n) => {
|
|
1137
|
+
const alias = n.split(/\s+as\s+/).pop().trim();
|
|
1138
|
+
allImportedNames.add(alias);
|
|
1139
|
+
});
|
|
1136
1140
|
}
|
|
1137
1141
|
for (const m of fixed.matchAll(/import\s+([A-Z]\w+)\s+from/g)) {
|
|
1138
1142
|
allImportedNames.add(m[1]);
|