@omnifyjp/mcp-design-system 0.4.3 → 0.4.5
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/README.md +2 -2
- package/dist/setup.js +4 -4
- package/dist/setup.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ The `postinstall` script automatically creates `.mcp.json` in your project root:
|
|
|
42
42
|
```json
|
|
43
43
|
{
|
|
44
44
|
"mcpServers": {
|
|
45
|
-
"omnify-
|
|
45
|
+
"omnify-ui": {
|
|
46
46
|
"type": "stdio",
|
|
47
47
|
"command": "npx",
|
|
48
48
|
"args": ["@omnifyjp/mcp-design-system"]
|
|
@@ -51,7 +51,7 @@ The `postinstall` script automatically creates `.mcp.json` in your project root:
|
|
|
51
51
|
}
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
If `.mcp.json` already exists, it merges the `omnify-
|
|
54
|
+
If `.mcp.json` already exists, it merges the `omnify-ui` entry without overwriting your other MCP servers.
|
|
55
55
|
|
|
56
56
|
That's it. No server to run, no environment variables, no manual configuration.
|
|
57
57
|
|
package/dist/setup.js
CHANGED
|
@@ -5,7 +5,7 @@ import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
|
5
5
|
import { resolve } from "path";
|
|
6
6
|
var MCP_CONFIG = {
|
|
7
7
|
mcpServers: {
|
|
8
|
-
"omnify-
|
|
8
|
+
"omnify-ui": {
|
|
9
9
|
type: "stdio",
|
|
10
10
|
command: "npx",
|
|
11
11
|
args: ["@omnifyjp/mcp-design-system"]
|
|
@@ -45,7 +45,7 @@ function setup() {
|
|
|
45
45
|
if (existsSync(mcpPath)) {
|
|
46
46
|
try {
|
|
47
47
|
const existing = JSON.parse(readFileSync(mcpPath, "utf-8"));
|
|
48
|
-
if (existing.mcpServers?.["omnify-
|
|
48
|
+
if (existing.mcpServers?.["omnify-ui"]) {
|
|
49
49
|
console.log("[mcp-design-system] Already configured in .mcp.json");
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
@@ -54,14 +54,14 @@ function setup() {
|
|
|
54
54
|
...MCP_CONFIG.mcpServers
|
|
55
55
|
};
|
|
56
56
|
writeFileSync(mcpPath, JSON.stringify(existing, null, 2) + "\n");
|
|
57
|
-
console.log("[mcp-design-system] Added omnify-
|
|
57
|
+
console.log("[mcp-design-system] Added omnify-ui to existing .mcp.json");
|
|
58
58
|
} catch {
|
|
59
59
|
console.log("[mcp-design-system] Could not parse .mcp.json, skipping");
|
|
60
60
|
}
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
writeFileSync(mcpPath, JSON.stringify(MCP_CONFIG, null, 2) + "\n");
|
|
64
|
-
console.log("[mcp-design-system] Created .mcp.json with omnify-
|
|
64
|
+
console.log("[mcp-design-system] Created .mcp.json with omnify-ui MCP server");
|
|
65
65
|
console.log("[mcp-design-system] AI tools (Claude Code, Cursor) will auto-detect design system rules");
|
|
66
66
|
}
|
|
67
67
|
setup();
|
package/dist/setup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/setup.ts"],"sourcesContent":["import { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\nconst MCP_CONFIG = {\n mcpServers: {\n 'omnify-
|
|
1
|
+
{"version":3,"sources":["../src/setup.ts"],"sourcesContent":["import { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\nconst MCP_CONFIG = {\n mcpServers: {\n 'omnify-ui': {\n type: 'stdio',\n command: 'npx',\n args: ['@omnifyjp/mcp-design-system'],\n },\n },\n};\n\n/** Markers that indicate a project root (not a sub-package) */\nconst ROOT_MARKERS = [\n 'pnpm-workspace.yaml',\n 'pnpm-lock.yaml',\n 'yarn.lock',\n 'package-lock.json',\n 'bun.lockb',\n '.git',\n];\n\n/**\n * Find the consumer's project root by walking up from cwd.\n * - Skips anything inside node_modules\n * - Prefers directories with lockfiles or .git (true project root)\n * - Falls back to first package.json outside node_modules\n */\nfunction findProjectRoot(): string {\n let dir = process.cwd();\n let firstPkg: string | null = null;\n\n while (dir !== '/' && dir !== resolve(dir, '..')) {\n if (dir.includes('/node_modules')) {\n dir = resolve(dir, '..');\n continue;\n }\n\n const hasPkg = existsSync(resolve(dir, 'package.json'));\n\n if (hasPkg && !firstPkg) {\n firstPkg = dir;\n }\n\n // Check for root markers — this is the true project root\n if (hasPkg && ROOT_MARKERS.some(m => existsSync(resolve(dir, m)))) {\n return dir;\n }\n\n dir = resolve(dir, '..');\n }\n\n return firstPkg ?? process.cwd();\n}\n\nfunction setup() {\n const root = findProjectRoot();\n const mcpPath = resolve(root, '.mcp.json');\n\n if (existsSync(mcpPath)) {\n try {\n const existing = JSON.parse(readFileSync(mcpPath, 'utf-8'));\n if (existing.mcpServers?.['omnify-ui']) {\n console.log('[mcp-design-system] Already configured in .mcp.json');\n return;\n }\n existing.mcpServers = {\n ...existing.mcpServers,\n ...MCP_CONFIG.mcpServers,\n };\n writeFileSync(mcpPath, JSON.stringify(existing, null, 2) + '\\n');\n console.log('[mcp-design-system] Added omnify-ui to existing .mcp.json');\n } catch {\n console.log('[mcp-design-system] Could not parse .mcp.json, skipping');\n }\n return;\n }\n\n writeFileSync(mcpPath, JSON.stringify(MCP_CONFIG, null, 2) + '\\n');\n console.log('[mcp-design-system] Created .mcp.json with omnify-ui MCP server');\n console.log('[mcp-design-system] AI tools (Claude Code, Cursor) will auto-detect design system rules');\n}\n\nsetup();\n"],"mappings":";;;AAAA,SAAS,YAAY,cAAc,qBAAqB;AACxD,SAAS,eAAe;AAExB,IAAM,aAAa;AAAA,EACjB,YAAY;AAAA,IACV,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,MACT,MAAM,CAAC,6BAA6B;AAAA,IACtC;AAAA,EACF;AACF;AAGA,IAAM,eAAe;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAQA,SAAS,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