@spaced-out/ui-design-system 0.5.18 → 0.5.19
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/.cspell/custom-words.txt +2 -0
- package/.github/workflows/publish-mcp.yml +81 -0
- package/CHANGELOG.md +9 -0
- package/COMPONENT_PROMPT_TEMPLATE.md +223 -0
- package/lib/components/PromptChip/PromptChip.d.ts +1 -0
- package/lib/components/PromptChip/PromptChip.d.ts.map +1 -1
- package/lib/components/PromptChip/PromptChip.js +14 -12
- package/lib/components/PromptChip/PromptChip.module.css +69 -37
- package/lib/components/TemplateCard/TemplateCard.d.ts +29 -0
- package/lib/components/TemplateCard/TemplateCard.d.ts.map +1 -0
- package/lib/components/TemplateCard/TemplateCard.js +92 -0
- package/lib/components/TemplateCard/TemplateCard.module.css +170 -0
- package/lib/components/TemplateCard/index.d.ts +2 -0
- package/lib/components/TemplateCard/index.d.ts.map +1 -0
- package/lib/components/TemplateCard/index.js +16 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +11 -0
- package/mcp/README.md +306 -0
- package/mcp/build-mcp-data.js +247 -0
- package/mcp/index.js +1239 -0
- package/mcp/package.json +44 -0
- package/mcp/test-server.js +65 -0
- package/package.json +1 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
@value (
|
|
2
|
+
colorBorderPrimary,
|
|
3
|
+
colorBackgroundTertiary,
|
|
4
|
+
colorNeutralLightest,
|
|
5
|
+
colorNeutral,
|
|
6
|
+
colorInformationLightest,
|
|
7
|
+
colorInformation,
|
|
8
|
+
colorSuccessLightest,
|
|
9
|
+
colorSuccess,
|
|
10
|
+
colorDangerLightest,
|
|
11
|
+
colorDanger,
|
|
12
|
+
colorWarningLightest,
|
|
13
|
+
colorWarning
|
|
14
|
+
) from '../../styles/variables/_color.css';
|
|
15
|
+
|
|
16
|
+
@value (
|
|
17
|
+
size58,
|
|
18
|
+
sizeFluid
|
|
19
|
+
) from '../../styles/variables/_size.css';
|
|
20
|
+
|
|
21
|
+
@value (
|
|
22
|
+
spaceSmall,
|
|
23
|
+
spaceMedium,
|
|
24
|
+
spaceLarge
|
|
25
|
+
) from '../../styles/variables/_space.css';
|
|
26
|
+
|
|
27
|
+
@value (
|
|
28
|
+
borderRadiusSmall,
|
|
29
|
+
borderRadiusCircle,
|
|
30
|
+
borderWidthPrimary,
|
|
31
|
+
borderWidthSecondary
|
|
32
|
+
) from '../../styles/variables/_border.css';
|
|
33
|
+
|
|
34
|
+
.wrapper {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
width: sizeFluid;
|
|
38
|
+
background-color: colorBackgroundTertiary;
|
|
39
|
+
border-radius: borderRadiusSmall;
|
|
40
|
+
border: borderWidthPrimary solid colorBorderPrimary;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.header {
|
|
45
|
+
position: relative;
|
|
46
|
+
width: sizeFluid;
|
|
47
|
+
height: 49px;
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: flex-start;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Header background colors for each state */
|
|
53
|
+
.header.neutral {
|
|
54
|
+
background-color: colorNeutralLightest;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.header.information {
|
|
58
|
+
background-color: colorInformationLightest;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.header.success {
|
|
62
|
+
background-color: colorSuccessLightest;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.header.warning {
|
|
66
|
+
background-color: colorWarningLightest;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.header.error {
|
|
70
|
+
background-color: colorDangerLightest;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.header.pending {
|
|
74
|
+
background-color: colorWarningLightest;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.iconContainer {
|
|
78
|
+
position: absolute;
|
|
79
|
+
left: spaceSmall;
|
|
80
|
+
top: spaceSmall;
|
|
81
|
+
width: size58;
|
|
82
|
+
height: size58;
|
|
83
|
+
min-width: size58;
|
|
84
|
+
min-height: size58;
|
|
85
|
+
border-radius: borderRadiusCircle;
|
|
86
|
+
border: borderWidthSecondary solid colorBackgroundTertiary;
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Icon container background colors for each state */
|
|
93
|
+
.iconContainer.neutral {
|
|
94
|
+
background-color: colorNeutralLightest;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.iconContainer.information {
|
|
98
|
+
background-color: colorInformationLightest;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.iconContainer.success {
|
|
102
|
+
background-color: colorSuccessLightest;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.iconContainer.warning {
|
|
106
|
+
background-color: colorWarningLightest;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.iconContainer.error {
|
|
110
|
+
background-color: colorDangerLightest;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.iconContainer.pending {
|
|
114
|
+
background-color: colorWarningLightest;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Icon colors using descendant selectors */
|
|
118
|
+
.iconContainer .neutral {
|
|
119
|
+
color: colorNeutral;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.iconContainer .information {
|
|
123
|
+
color: colorInformation;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.iconContainer .success {
|
|
127
|
+
color: colorSuccess;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.iconContainer .warning {
|
|
131
|
+
color: colorWarning;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.iconContainer .error {
|
|
135
|
+
color: colorDanger;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.iconContainer .pending {
|
|
139
|
+
color: colorWarning;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.content {
|
|
143
|
+
display: flex;
|
|
144
|
+
flex-direction: column;
|
|
145
|
+
background-color: colorBackgroundTertiary;
|
|
146
|
+
padding: spaceSmall spaceMedium;
|
|
147
|
+
padding-top: spaceLarge;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.footer {
|
|
151
|
+
display: flex;
|
|
152
|
+
flex-direction: column;
|
|
153
|
+
background-color: colorBackgroundTertiary;
|
|
154
|
+
padding: spaceSmall spaceMedium;
|
|
155
|
+
padding-top: 0;
|
|
156
|
+
gap: spaceSmall;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.footerSeparator {
|
|
160
|
+
width: sizeFluid;
|
|
161
|
+
height: 0;
|
|
162
|
+
composes: borderTopPrimary from '../../styles/border.module.css';
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.footerContent {
|
|
166
|
+
display: flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
justify-content: space-between;
|
|
169
|
+
width: sizeFluid;
|
|
170
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TemplateCard/index.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _TemplateCard = require("./TemplateCard");
|
|
7
|
+
Object.keys(_TemplateCard).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _TemplateCard[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _TemplateCard[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -63,6 +63,7 @@ export * from '../components/StickyBar';
|
|
|
63
63
|
export * from '../components/SubMenu';
|
|
64
64
|
export * from '../components/Table';
|
|
65
65
|
export * from '../components/Tabs';
|
|
66
|
+
export * from '../components/TemplateCard';
|
|
66
67
|
export * from '../components/Text';
|
|
67
68
|
export * from '../components/Textarea';
|
|
68
69
|
export * from '../components/TextTile';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mDAAmD,CAAC;AAClE,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC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CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yCAAyC,CAAC;AACxD,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC"}
|
package/lib/components/index.js
CHANGED
|
@@ -718,6 +718,17 @@ Object.keys(_Tabs).forEach(function (key) {
|
|
|
718
718
|
}
|
|
719
719
|
});
|
|
720
720
|
});
|
|
721
|
+
var _TemplateCard = require("./TemplateCard");
|
|
722
|
+
Object.keys(_TemplateCard).forEach(function (key) {
|
|
723
|
+
if (key === "default" || key === "__esModule") return;
|
|
724
|
+
if (key in exports && exports[key] === _TemplateCard[key]) return;
|
|
725
|
+
Object.defineProperty(exports, key, {
|
|
726
|
+
enumerable: true,
|
|
727
|
+
get: function () {
|
|
728
|
+
return _TemplateCard[key];
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
});
|
|
721
732
|
var _Text = require("./Text");
|
|
722
733
|
Object.keys(_Text).forEach(function (key) {
|
|
723
734
|
if (key === "default" || key === "__esModule") return;
|
package/mcp/README.md
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# Genesis UI Design System MCP Server
|
|
2
|
+
|
|
3
|
+
A Model Context Protocol (MCP) server that provides AI assistants (Claude, Cursor, etc.) with access to the Genesis UI Design System.
|
|
4
|
+
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
- 📦 **Component Discovery**: List and search all available components
|
|
8
|
+
- 🎨 **Design Tokens**: Access colors, spacing, typography, shadows, and more
|
|
9
|
+
- 📚 **Documentation**: Browse component stories and TypeScript definitions
|
|
10
|
+
- 🔍 **Dependency Analysis**: Understand component dependencies
|
|
11
|
+
- 🚀 **Onboarding Templates**: Get starter templates for new components
|
|
12
|
+
- 🪝 **Hooks Information**: Query available React hooks
|
|
13
|
+
|
|
14
|
+
## 🎯 No Local Dependencies Required!
|
|
15
|
+
|
|
16
|
+
Unlike traditional MCP servers that require a local copy of the design system, this server **bundles all data at build time**. Users only need to run `npx` - no cloning, no environment variables!
|
|
17
|
+
|
|
18
|
+
## 📦 Installation for Users
|
|
19
|
+
|
|
20
|
+
### With Cursor
|
|
21
|
+
|
|
22
|
+
Add to your Cursor MCP settings:
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"mcpServers": {
|
|
27
|
+
"genesis-design-system": {
|
|
28
|
+
"command": "npx",
|
|
29
|
+
"args": ["-y", "@spaced-out/genesis-mcp-server@latest"]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### With Claude Desktop
|
|
36
|
+
|
|
37
|
+
Add to your Claude config file:
|
|
38
|
+
|
|
39
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
40
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
41
|
+
**Linux**: `~/.config/Claude/claude_desktop_config.json`
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"mcpServers": {
|
|
46
|
+
"genesis-design-system": {
|
|
47
|
+
"command": "npx",
|
|
48
|
+
"args": ["-y", "@spaced-out/genesis-mcp-server@latest"]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Then restart Cursor or Claude Desktop.
|
|
55
|
+
|
|
56
|
+
## 💬 Usage Examples
|
|
57
|
+
|
|
58
|
+
Once configured, you can ask:
|
|
59
|
+
|
|
60
|
+
**Component Discovery:**
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
"List all components in Genesis"
|
|
64
|
+
"Search for dropdown components"
|
|
65
|
+
"Show me the Button component implementation"
|
|
66
|
+
"What types does the Icon component export?"
|
|
67
|
+
"Show me the Icon component with its exported types"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Design Tokens:**
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
"Show me all color tokens"
|
|
74
|
+
"What spacing tokens are available?"
|
|
75
|
+
"List all shadow/elevation tokens"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Component Onboarding:**
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
"I want to create a new Toast component, show me the template"
|
|
82
|
+
"Help me onboard an Alert component"
|
|
83
|
+
"What's the standard structure for a Genesis component?"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Design Token Imports:**
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
"How do I import design tokens in CSS Module files?"
|
|
90
|
+
"Show me the correct way to import color and spacing tokens"
|
|
91
|
+
"What token files are available and how do I import them?"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**CSS Module Guidelines:**
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
"Show me CSS Module styling guidelines for Genesis"
|
|
98
|
+
"What are the class naming conventions for CSS Modules?"
|
|
99
|
+
"How should I style child elements in CSS Modules?"
|
|
100
|
+
"What's the correct pattern for state-based styling in CSS?"
|
|
101
|
+
"Show me common CSS mistakes to avoid"
|
|
102
|
+
"How do I apply colors to child elements like text, icons, or buttons?"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Dependencies:**
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
"What components does Modal depend on?"
|
|
109
|
+
"Show me the dependencies of Dropdown"
|
|
110
|
+
"What hooks does the Table component use?"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## 🔧 Development
|
|
114
|
+
|
|
115
|
+
### Building the Data
|
|
116
|
+
|
|
117
|
+
This server extracts design system metadata at build time. To build:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Install dependencies
|
|
121
|
+
yarn install
|
|
122
|
+
|
|
123
|
+
# Build the data bundle
|
|
124
|
+
yarn build
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
This creates `data/design-system.json` with all component, hook, and token information.
|
|
128
|
+
|
|
129
|
+
### Testing Locally
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# After building, test the server
|
|
133
|
+
node index.js
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Or test with MCP Inspector:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
npx @modelcontextprotocol/inspector node index.js
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Publishing
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# The prepublishOnly script runs yarn build automatically
|
|
146
|
+
yarn publish
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## 📊 How It Works
|
|
150
|
+
|
|
151
|
+
### Build Time (CI/CD)
|
|
152
|
+
|
|
153
|
+
1. `build-mcp-data.js` scans the design system:
|
|
154
|
+
|
|
155
|
+
- Reads all components from `src/components/`
|
|
156
|
+
- Reads all hooks from `src/hooks/`
|
|
157
|
+
- Reads all design tokens from `design-tokens/`
|
|
158
|
+
|
|
159
|
+
2. Extracts file contents and metadata
|
|
160
|
+
|
|
161
|
+
3. Bundles everything into `data/design-system.json`
|
|
162
|
+
|
|
163
|
+
4. Package is published to npm with bundled data
|
|
164
|
+
|
|
165
|
+
### Runtime (User's Machine)
|
|
166
|
+
|
|
167
|
+
1. User runs `npx @spaced-out/genesis-mcp-server`
|
|
168
|
+
|
|
169
|
+
2. Server loads pre-bundled `data/design-system.json`
|
|
170
|
+
|
|
171
|
+
3. Serves data via MCP protocol (stdio)
|
|
172
|
+
|
|
173
|
+
4. AI assistant queries the server for design system info
|
|
174
|
+
|
|
175
|
+
**Result:** No local design system needed! ✨
|
|
176
|
+
|
|
177
|
+
## 🏗️ Architecture
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
ui-design-system/
|
|
181
|
+
├── src/
|
|
182
|
+
│ ├── components/ # Source components
|
|
183
|
+
│ └── hooks/ # Source hooks
|
|
184
|
+
├── design-tokens/ # Source tokens
|
|
185
|
+
└── mcp/ # 👈 MCP Server
|
|
186
|
+
├── index.js # MCP server (reads from data/)
|
|
187
|
+
├── build-mcp-data.js # Build script (extracts from ../)
|
|
188
|
+
├── data/
|
|
189
|
+
│ └── design-system.json # Bundled data (git-ignored)
|
|
190
|
+
├── package.json
|
|
191
|
+
└── README.md
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## 📝 Available Tools
|
|
195
|
+
|
|
196
|
+
The MCP server provides these tools to AI assistants:
|
|
197
|
+
|
|
198
|
+
- `list_components` - List all available components
|
|
199
|
+
- `get_component` - Get detailed component information **including exported types** (e.g., IconType, IconSize from Icon component)
|
|
200
|
+
- `search_components` - Search components by name
|
|
201
|
+
- `list_hooks` - List all available hooks
|
|
202
|
+
- `get_hook` - Get detailed hook information
|
|
203
|
+
- `get_design_tokens` - Get all or filtered design tokens
|
|
204
|
+
- `get_component_template` - Get template for new components
|
|
205
|
+
- `get_design_token_import_guidelines` - Get guidelines for importing design tokens in CSS Module files with correct paths and examples
|
|
206
|
+
- `get_css_module_guidelines` - **NEW!** Get comprehensive CSS Module styling guidelines including class naming conventions (BEM patterns), token usage, icon color patterns, and common mistakes to avoid
|
|
207
|
+
- `analyze_component_dependencies` - Analyze component dependencies
|
|
208
|
+
|
|
209
|
+
## 🔄 CI/CD Integration
|
|
210
|
+
|
|
211
|
+
### Automatic Publishing
|
|
212
|
+
|
|
213
|
+
The MCP server is automatically published to npm via GitHub Actions (`.github/workflows/publish-mcp.yml`).
|
|
214
|
+
|
|
215
|
+
**Triggers:**
|
|
216
|
+
|
|
217
|
+
- Push to `master` branch when files change in:
|
|
218
|
+
- `src/**` (component/hook changes)
|
|
219
|
+
- `design-tokens/**` (token changes)
|
|
220
|
+
- `mcp/**` (MCP server changes)
|
|
221
|
+
- Manual workflow dispatch
|
|
222
|
+
|
|
223
|
+
**Process:**
|
|
224
|
+
|
|
225
|
+
1. **Auto-version bump**: If `src/` or `design-tokens/` changed, automatically bumps patch version
|
|
226
|
+
2. **Build**: Generates fresh MCP data bundle with latest design system changes
|
|
227
|
+
3. **Commit**: Pushes version bump back to master (with `[skip ci]` to avoid loops)
|
|
228
|
+
4. **Publish**: Publishes new version to npm
|
|
229
|
+
|
|
230
|
+
**What this means for you:**
|
|
231
|
+
|
|
232
|
+
✅ Update a component → Merge to master → New MCP version automatically published!
|
|
233
|
+
|
|
234
|
+
No need to manually bump versions when changing design system files. The workflow handles it for you.
|
|
235
|
+
|
|
236
|
+
### Version Management
|
|
237
|
+
|
|
238
|
+
**Automatic (recommended):**
|
|
239
|
+
|
|
240
|
+
- Changes to `src/` or `design-tokens/` → patch version bumped automatically
|
|
241
|
+
- E.g., `1.0.5` → `1.0.6`
|
|
242
|
+
|
|
243
|
+
**Manual (for major/minor releases):**
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
cd mcp
|
|
247
|
+
yarn version --minor # or --major
|
|
248
|
+
git push --follow-tags
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Manual MCP-only changes:**
|
|
252
|
+
|
|
253
|
+
- If you only change files in `mcp/`, manually bump the version to publish
|
|
254
|
+
|
|
255
|
+
## 📈 Data Size
|
|
256
|
+
|
|
257
|
+
The bundled JSON includes:
|
|
258
|
+
|
|
259
|
+
- Full TypeScript component implementations
|
|
260
|
+
- Storybook stories
|
|
261
|
+
- CSS modules
|
|
262
|
+
- Design tokens
|
|
263
|
+
- Hook implementations
|
|
264
|
+
|
|
265
|
+
Typical size: 5-15 MB (cached by npm, so only downloaded once)
|
|
266
|
+
|
|
267
|
+
## 🔐 Private Packages
|
|
268
|
+
|
|
269
|
+
If publishing to a private npm registry:
|
|
270
|
+
|
|
271
|
+
```json
|
|
272
|
+
{
|
|
273
|
+
"publishConfig": {
|
|
274
|
+
"registry": "https://your-private-registry.com"
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Users configure their registry:
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
npm config set @spaced-out:registry https://your-private-registry.com
|
|
283
|
+
# or with yarn
|
|
284
|
+
yarn config set registry https://your-private-registry.com
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## 🤝 Contributing
|
|
288
|
+
|
|
289
|
+
When updating the design system:
|
|
290
|
+
|
|
291
|
+
1. Changes to components/hooks/tokens are automatically detected
|
|
292
|
+
2. CI/CD runs `npm run build` to regenerate data
|
|
293
|
+
3. New version is published to npm
|
|
294
|
+
4. Users get updates on next `npx` run (or immediately with `@latest`)
|
|
295
|
+
|
|
296
|
+
## 📚 Additional Resources
|
|
297
|
+
|
|
298
|
+
- [MCP Documentation](https://modelcontextprotocol.io)
|
|
299
|
+
|
|
300
|
+
## 📄 License
|
|
301
|
+
|
|
302
|
+
UNLICENSED - Internal use only
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
**Built with ❤️ by the Central UI team**
|