sonance-brand-mcp 1.3.10 → 1.3.11

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 +37 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -300,9 +300,26 @@ function runDevToolsInstaller() {
300
300
  console.log(" └─────────────────────────────────────────────────┘");
301
301
  console.log("");
302
302
  const targetDir = process.cwd();
303
- // Detect project structure (src/ vs root)
304
- const useSrcDir = fs.existsSync(path.join(targetDir, "src/app")) ||
305
- fs.existsSync(path.join(targetDir, "src/components"));
303
+ // Detect project structure by checking where layout.tsx actually lives
304
+ const hasRootLayout = fs.existsSync(path.join(targetDir, "app/layout.tsx"));
305
+ const hasSrcLayout = fs.existsSync(path.join(targetDir, "src/app/layout.tsx"));
306
+ let useSrcDir;
307
+ if (hasRootLayout) {
308
+ // Root layout exists - use root structure (even if src/ also exists)
309
+ useSrcDir = false;
310
+ if (hasSrcLayout) {
311
+ console.log(" ⚠️ Found both app/ and src/app/ layouts - using root app/");
312
+ }
313
+ }
314
+ else if (hasSrcLayout) {
315
+ // Only src layout exists
316
+ useSrcDir = true;
317
+ }
318
+ else {
319
+ // No layout found - fall back to directory detection
320
+ useSrcDir = fs.existsSync(path.join(targetDir, "src/app")) ||
321
+ fs.existsSync(path.join(targetDir, "src/components"));
322
+ }
306
323
  const baseDir = useSrcDir ? "src" : "";
307
324
  console.log(` 📁 Detected structure: ${useSrcDir ? "src/" : "root"}`);
308
325
  // Dynamic paths based on detected structure
@@ -726,9 +743,23 @@ function runDevToolsUninstaller() {
726
743
  }
727
744
  }
728
745
  // --- 3. Delete installed directories/files ---
729
- // Detect project structure (src/ vs root)
730
- const useSrcDir = fs.existsSync(path.join(targetDir, "src/app")) ||
731
- fs.existsSync(path.join(targetDir, "src/components"));
746
+ // Detect project structure by checking where layout.tsx actually lives
747
+ const hasRootLayout = fs.existsSync(path.join(targetDir, "app/layout.tsx"));
748
+ const hasSrcLayout = fs.existsSync(path.join(targetDir, "src/app/layout.tsx"));
749
+ let useSrcDir;
750
+ if (hasRootLayout) {
751
+ // Root layout exists - use root structure (even if src/ also exists)
752
+ useSrcDir = false;
753
+ }
754
+ else if (hasSrcLayout) {
755
+ // Only src layout exists
756
+ useSrcDir = true;
757
+ }
758
+ else {
759
+ // No layout found - fall back to directory detection
760
+ useSrcDir = fs.existsSync(path.join(targetDir, "src/app")) ||
761
+ fs.existsSync(path.join(targetDir, "src/components"));
762
+ }
732
763
  const baseDir = useSrcDir ? "src" : "";
733
764
  const pathPrefix = baseDir ? `${baseDir}/` : "";
734
765
  const itemsToDelete = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonance-brand-mcp",
3
- "version": "1.3.10",
3
+ "version": "1.3.11",
4
4
  "description": "MCP Server for Sonance Brand Guidelines and Component Library - gives Claude instant access to brand colors, typography, and UI components.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",