@getcoherent/cli 0.6.39 → 0.6.41

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -8638,14 +8638,20 @@ async function fixCommand(opts = {}) {
8638
8638
  const sidebarConfigName = dsm?.getConfig().name ?? "";
8639
8639
  const hasWrongName = existingSidebarCode.includes("My App") && sidebarConfigName !== "My App";
8640
8640
  const hasTrigger = existingSidebarCode.includes("SidebarTrigger");
8641
- if (hasWrongName || hasTrigger) {
8641
+ const isBroken = !isValidTsx(existingSidebarCode, projectRoot);
8642
+ if (hasWrongName || hasTrigger || isBroken) {
8642
8643
  if (!dsm) {
8643
8644
  dsm = new DesignSystemManager9(project.configPath);
8644
8645
  await dsm.load();
8645
8646
  }
8646
8647
  const { PageGenerator } = await import("@getcoherent/core");
8647
8648
  const gen = new PageGenerator(dsm.getConfig());
8648
- const sidebarResult2 = safeWrite(sidebarComponentPath2, gen.generateSharedSidebarCode(), projectRoot, backups);
8649
+ const sidebarResult2 = safeWrite(
8650
+ sidebarComponentPath2,
8651
+ gen.generateSharedSidebarCode(),
8652
+ projectRoot,
8653
+ backups
8654
+ );
8649
8655
  if (sidebarResult2.ok) {
8650
8656
  fixes.push("Regenerated sidebar component");
8651
8657
  console.log(chalk15.green(" \u2714 Regenerated sidebar component"));
@@ -8821,7 +8827,9 @@ async function fixCommand(opts = {}) {
8821
8827
  } catch (err) {
8822
8828
  const isNotFound = err instanceof Error && "code" in err && err.code === "ENOENT";
8823
8829
  if (!isNotFound) {
8824
- console.log(chalk15.yellow(` \u26A0 Component manifest check skipped: ${err instanceof Error ? err.message : "unknown error"}`));
8830
+ console.log(
8831
+ chalk15.yellow(` \u26A0 Component manifest check skipped: ${err instanceof Error ? err.message : "unknown error"}`)
8832
+ );
8825
8833
  }
8826
8834
  }
8827
8835
  if (fixes.length === 0 && totalErrors === 0 && totalWarnings === 0 && remaining.length === 0) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.6.39",
6
+ "version": "0.6.41",
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.39"
46
+ "@getcoherent/core": "0.6.41"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/node": "^20.11.0",