sonance-brand-mcp 1.3.10 → 1.3.12
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/index.js +40 -9
- 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
|
|
304
|
-
const
|
|
305
|
-
|
|
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
|
|
@@ -541,8 +558,8 @@ function runDevToolsInstaller() {
|
|
|
541
558
|
try {
|
|
542
559
|
let cssContent = fs.readFileSync(globalsFullPath, "utf-8");
|
|
543
560
|
// Calculate correct relative paths from globals.css to the target files
|
|
544
|
-
const stylesTarget = path.join(targetDir, "
|
|
545
|
-
const themeTarget = path.join(targetDir, "
|
|
561
|
+
const stylesTarget = path.join(targetDir, baseDir, "styles/brand-overrides.css");
|
|
562
|
+
const themeTarget = path.join(targetDir, baseDir, "theme/sonance-theme.css");
|
|
546
563
|
const import1 = `@import "${getRelativeImportPath(globalsFullPath, stylesTarget)}";`;
|
|
547
564
|
const import2 = `@import "${getRelativeImportPath(globalsFullPath, themeTarget)}";`;
|
|
548
565
|
// Prepend imports if not already present
|
|
@@ -571,7 +588,7 @@ function runDevToolsInstaller() {
|
|
|
571
588
|
let layoutContent = fs.readFileSync(layoutFullPath, "utf-8");
|
|
572
589
|
let modified = false;
|
|
573
590
|
// Calculate relative import path from layout to dev-tools
|
|
574
|
-
const devToolsTarget = path.join(targetDir, "
|
|
591
|
+
const devToolsTarget = path.join(targetDir, baseDir, "components/dev-tools");
|
|
575
592
|
let devToolsImportPath = getRelativeImportPath(layoutFullPath, devToolsTarget);
|
|
576
593
|
// Remove trailing slash for JS/TS imports
|
|
577
594
|
devToolsImportPath = devToolsImportPath.replace(/\/$/, '');
|
|
@@ -726,9 +743,23 @@ function runDevToolsUninstaller() {
|
|
|
726
743
|
}
|
|
727
744
|
}
|
|
728
745
|
// --- 3. Delete installed directories/files ---
|
|
729
|
-
// Detect project structure
|
|
730
|
-
const
|
|
731
|
-
|
|
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.
|
|
3
|
+
"version": "1.3.12",
|
|
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",
|