sonance-brand-mcp 1.3.4 → 1.3.6
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 +9 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -543,17 +543,23 @@ function runDevToolsInstaller() {
|
|
|
543
543
|
try {
|
|
544
544
|
let layoutContent = fs.readFileSync(layoutFullPath, "utf-8");
|
|
545
545
|
let modified = false;
|
|
546
|
+
// Calculate relative import path from layout to dev-tools
|
|
547
|
+
const devToolsTarget = path.join(targetDir, "src/components/dev-tools");
|
|
548
|
+
let devToolsImportPath = getRelativeImportPath(layoutFullPath, devToolsTarget);
|
|
549
|
+
// Remove trailing slash for JS/TS imports
|
|
550
|
+
devToolsImportPath = devToolsImportPath.replace(/\/$/, '');
|
|
551
|
+
const importLine = `import { SonanceDevTools } from '${devToolsImportPath}';`;
|
|
546
552
|
// Add import if not present
|
|
547
553
|
if (!layoutContent.includes("SonanceDevTools")) {
|
|
548
554
|
const importMatch = layoutContent.match(/^import .+$/gm);
|
|
549
555
|
if (importMatch && importMatch.length > 0) {
|
|
550
556
|
const lastImport = importMatch[importMatch.length - 1];
|
|
551
|
-
layoutContent = layoutContent.replace(lastImport, `${lastImport}\
|
|
557
|
+
layoutContent = layoutContent.replace(lastImport, `${lastImport}\n${importLine}`);
|
|
552
558
|
modified = true;
|
|
553
559
|
}
|
|
554
560
|
else {
|
|
555
561
|
// No imports found, add at the top
|
|
556
|
-
layoutContent =
|
|
562
|
+
layoutContent = `${importLine}\n${layoutContent}`;
|
|
557
563
|
modified = true;
|
|
558
564
|
}
|
|
559
565
|
}
|
|
@@ -578,7 +584,7 @@ function runDevToolsInstaller() {
|
|
|
578
584
|
}
|
|
579
585
|
}
|
|
580
586
|
else {
|
|
581
|
-
manualSteps.push("layout.tsx not found - add to your layout:\n import { SonanceDevTools } from '
|
|
587
|
+
manualSteps.push("layout.tsx not found - add to your layout:\n import { SonanceDevTools } from '[path-to]/src/components/dev-tools';\n {process.env.NODE_ENV === 'development' && <SonanceDevTools />}\n (adjust the path based on your layout file location)");
|
|
582
588
|
}
|
|
583
589
|
// --- Output results ---
|
|
584
590
|
console.log("");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sonance-brand-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
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",
|