@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.
@@ -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, ">$1&lt;$2");
720
- fixed = fixed.replace(/>([^<{}\n]*)<([^/a-zA-Z!{>\n])/g, ">$1&lt;$2");
720
+ fixed = fixed.replace(/>([^<{}\n]*)<(\d)/g, (m, text, d) => isJsExpr(text) ? m : `>${text}&lt;${d}`);
721
+ fixed = fixed.replace(/>([^<{}\n]*)<([^/a-zA-Z!{>\n])/g, (m, text, ch) => isJsExpr(text) ? m : `>${text}&lt;${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) => allImportedNames.add(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]);