@spaced-out/ui-design-system 0.5.34-beta.2 ā 0.5.35
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/.github/workflows/publish-mcp.yml +11 -10
- package/CHANGELOG.md +20 -0
- package/lib/components/Button/Button.d.ts +1 -0
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +7 -3
- package/lib/components/Button/Button.module.css +28 -1
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.d.ts +6 -1
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.d.ts.map +1 -1
- package/lib/components/ButtonDropdown/SimpleButtonDropdown.js +3 -1
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +2 -1
- package/lib/components/Icon/Icon.module.css +67 -0
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +3 -2
- package/lib/components/StatusIndicator/StatusIndicator.module.css +10 -10
- package/lib/components/Toast/Toast.d.ts +0 -1
- package/lib/components/Toast/Toast.d.ts.map +1 -1
- package/lib/components/Toast/Toast.js +2 -4
- package/lib/components/Toast/Toast.module.css +12 -1
- package/mcp/README.md +28 -494
- package/mcp/build-mcp-data.js +78 -72
- package/mcp/index.js +1 -1
- package/mcp/package.json +2 -2
- package/mcp/test-server.js +1 -1
- package/package.json +1 -1
package/mcp/build-mcp-data.js
CHANGED
|
@@ -70,72 +70,69 @@ function getAllFilesRecursively(dirPath, filesList = [], baseDir = dirPath) {
|
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* Extract all components with their files (including sub-components)
|
|
73
|
+
* For main component files and sub-components, we use .d.ts files from lib/
|
|
74
|
+
* to avoid exposing source code in the public npm package
|
|
73
75
|
*/
|
|
74
76
|
function buildComponentsData() {
|
|
75
77
|
console.log('š¦ Extracting components...');
|
|
76
|
-
const
|
|
78
|
+
const srcComponentsPath = join(DESIGN_SYSTEM_PATH, 'src/components');
|
|
79
|
+
const libComponentsPath = join(DESIGN_SYSTEM_PATH, 'lib/components');
|
|
77
80
|
const components = {};
|
|
78
81
|
|
|
79
|
-
if (!existsSync(
|
|
82
|
+
if (!existsSync(srcComponentsPath)) {
|
|
80
83
|
console.warn('ā ļø Components path not found');
|
|
81
84
|
return components;
|
|
82
85
|
}
|
|
83
86
|
|
|
84
|
-
const componentDirs = getDirectories(
|
|
87
|
+
const componentDirs = getDirectories(srcComponentsPath).filter(name => name !== 'index.ts');
|
|
85
88
|
|
|
86
89
|
for (const componentName of componentDirs) {
|
|
87
|
-
const
|
|
90
|
+
const srcComponentDir = join(srcComponentsPath, componentName);
|
|
91
|
+
const libComponentDir = join(libComponentsPath, componentName);
|
|
88
92
|
|
|
89
|
-
// Get all files in the component directory
|
|
90
|
-
const allFiles = getAllFilesRecursively(
|
|
93
|
+
// Get all files in the component directory (from src for reference)
|
|
94
|
+
const allFiles = getAllFilesRecursively(srcComponentDir);
|
|
91
95
|
|
|
92
|
-
// Extract main component
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
const mainContent = safeReadFile(mainTsx) || safeReadFile(mainTs);
|
|
96
|
+
// Extract main component .d.ts file from lib/ (type definitions only)
|
|
97
|
+
const mainDts = join(libComponentDir, `${componentName}.d.ts`);
|
|
98
|
+
const mainContent = safeReadFile(mainDts);
|
|
96
99
|
|
|
97
|
-
// Extract story files
|
|
98
|
-
const storyTsx = join(
|
|
99
|
-
const storyTs = join(
|
|
100
|
+
// Extract story files (keep from src - useful for usage examples)
|
|
101
|
+
const storyTsx = join(srcComponentDir, `${componentName}.stories.tsx`);
|
|
102
|
+
const storyTs = join(srcComponentDir, `${componentName}.stories.ts`);
|
|
100
103
|
const storyContent = safeReadFile(storyTsx) || safeReadFile(storyTs);
|
|
101
104
|
|
|
102
|
-
// Extract CSS file
|
|
103
|
-
const cssFile = join(
|
|
105
|
+
// Extract CSS file (keep from src - needed for styling reference)
|
|
106
|
+
const cssFile = join(srcComponentDir, `${componentName}.module.css`);
|
|
104
107
|
const cssContent = safeReadFile(cssFile);
|
|
105
108
|
|
|
106
|
-
// Extract index file
|
|
107
|
-
const
|
|
108
|
-
const indexContent = safeReadFile(
|
|
109
|
+
// Extract index .d.ts file from lib/
|
|
110
|
+
const indexDts = join(libComponentDir, 'index.d.ts');
|
|
111
|
+
const indexContent = safeReadFile(indexDts);
|
|
109
112
|
|
|
110
|
-
// Extract all additional
|
|
113
|
+
// Extract all additional sub-component .d.ts files from lib/
|
|
111
114
|
const additionalFiles = {};
|
|
112
|
-
|
|
115
|
+
const libAllFiles = existsSync(libComponentDir) ? getAllFilesRecursively(libComponentDir) : [];
|
|
116
|
+
|
|
117
|
+
for (const file of libAllFiles) {
|
|
113
118
|
// Skip main files we already extracted
|
|
114
119
|
if (
|
|
115
|
-
file === `${componentName}.
|
|
116
|
-
file ===
|
|
117
|
-
file
|
|
118
|
-
file
|
|
119
|
-
file === `${componentName}.module.css` ||
|
|
120
|
-
file === 'index.ts' ||
|
|
121
|
-
file.endsWith('.module.css') ||
|
|
122
|
-
file.endsWith('.stories.tsx') ||
|
|
123
|
-
file.endsWith('.stories.ts') ||
|
|
124
|
-
file.endsWith('.stories.module.css')
|
|
120
|
+
file === `${componentName}.d.ts` ||
|
|
121
|
+
file === 'index.d.ts' ||
|
|
122
|
+
!file.endsWith('.d.ts') ||
|
|
123
|
+
file.endsWith('.d.ts.map')
|
|
125
124
|
) {
|
|
126
125
|
continue;
|
|
127
126
|
}
|
|
128
127
|
|
|
129
|
-
//
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
};
|
|
138
|
-
}
|
|
128
|
+
// Include .d.ts files for sub-components
|
|
129
|
+
const fullPath = join(libComponentDir, file);
|
|
130
|
+
const content = safeReadFile(fullPath);
|
|
131
|
+
if (content) {
|
|
132
|
+
additionalFiles[file] = {
|
|
133
|
+
path: file,
|
|
134
|
+
content: content
|
|
135
|
+
};
|
|
139
136
|
}
|
|
140
137
|
}
|
|
141
138
|
|
|
@@ -143,10 +140,10 @@ function buildComponentsData() {
|
|
|
143
140
|
name: componentName,
|
|
144
141
|
path: `src/components/${componentName}`,
|
|
145
142
|
files: {
|
|
146
|
-
main: mainContent ? { path: `${componentName}.
|
|
143
|
+
main: mainContent ? { path: `${componentName}.d.ts`, content: mainContent } : null,
|
|
147
144
|
story: storyContent ? { path: `${componentName}.stories.tsx`, content: storyContent } : null,
|
|
148
145
|
css: cssContent ? { path: `${componentName}.module.css`, content: cssContent } : null,
|
|
149
|
-
index: indexContent ? { path: 'index.ts', content: indexContent } : null,
|
|
146
|
+
index: indexContent ? { path: 'index.d.ts', content: indexContent } : null,
|
|
150
147
|
additional: additionalFiles,
|
|
151
148
|
},
|
|
152
149
|
allFiles,
|
|
@@ -159,48 +156,50 @@ function buildComponentsData() {
|
|
|
159
156
|
|
|
160
157
|
/**
|
|
161
158
|
* Extract all hooks
|
|
159
|
+
* For main hook files, we use .d.ts files from lib/
|
|
160
|
+
* to avoid exposing source code in the public npm package
|
|
162
161
|
*/
|
|
163
162
|
function buildHooksData() {
|
|
164
163
|
console.log('šŖ Extracting hooks...');
|
|
165
|
-
const
|
|
164
|
+
const srcHooksPath = join(DESIGN_SYSTEM_PATH, 'src/hooks');
|
|
165
|
+
const libHooksPath = join(DESIGN_SYSTEM_PATH, 'lib/hooks');
|
|
166
166
|
const hooks = {};
|
|
167
167
|
|
|
168
|
-
if (!existsSync(
|
|
168
|
+
if (!existsSync(srcHooksPath)) {
|
|
169
169
|
console.warn('ā ļø Hooks path not found');
|
|
170
170
|
return hooks;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
const hookDirs = getDirectories(
|
|
173
|
+
const hookDirs = getDirectories(srcHooksPath).filter(name => name !== 'index.ts');
|
|
174
174
|
|
|
175
175
|
for (const hookName of hookDirs) {
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
// Read main hook file
|
|
179
|
-
const mainTs = join(hookDir, `${hookName}.ts`);
|
|
180
|
-
const mainTsx = join(hookDir, `${hookName}.tsx`);
|
|
176
|
+
const srcHookDir = join(srcHooksPath, hookName);
|
|
177
|
+
const libHookDir = join(libHooksPath, hookName);
|
|
181
178
|
|
|
182
|
-
// Read
|
|
183
|
-
const
|
|
184
|
-
const
|
|
179
|
+
// Read main hook .d.ts file from lib/ (type definitions only)
|
|
180
|
+
const mainDts = join(libHookDir, `${hookName}.d.ts`);
|
|
181
|
+
const mainContent = safeReadFile(mainDts);
|
|
185
182
|
|
|
186
|
-
// Read
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
const mainContent = safeReadFile(mainTs) || safeReadFile(mainTsx);
|
|
183
|
+
// Read story file (keep from src - useful for usage examples)
|
|
184
|
+
const storyTsx = join(srcHookDir, `${hookName}.stories.tsx`);
|
|
185
|
+
const storyTs = join(srcHookDir, `${hookName}.stories.ts`);
|
|
190
186
|
const storyContent = safeReadFile(storyTsx) || safeReadFile(storyTs);
|
|
191
|
-
const indexContent = safeReadFile(indexFile);
|
|
192
187
|
|
|
193
|
-
|
|
194
|
-
|
|
188
|
+
// Read index .d.ts file from lib/
|
|
189
|
+
const indexDts = join(libHookDir, 'index.d.ts');
|
|
190
|
+
const indexContent = safeReadFile(indexDts);
|
|
191
|
+
|
|
192
|
+
const allFiles = existsSync(srcHookDir)
|
|
193
|
+
? readdirSync(srcHookDir).filter(f => !f.startsWith('.'))
|
|
195
194
|
: [];
|
|
196
195
|
|
|
197
196
|
hooks[hookName] = {
|
|
198
197
|
name: hookName,
|
|
199
198
|
path: `src/hooks/${hookName}`,
|
|
200
199
|
files: {
|
|
201
|
-
main: mainContent ? { path: `${hookName}.ts`, content: mainContent } : null,
|
|
200
|
+
main: mainContent ? { path: `${hookName}.d.ts`, content: mainContent } : null,
|
|
202
201
|
story: storyContent ? { path: `${hookName}.stories.tsx`, content: storyContent } : null,
|
|
203
|
-
index: indexContent ? { path: 'index.ts', content: indexContent } : null,
|
|
202
|
+
index: indexContent ? { path: 'index.d.ts', content: indexContent } : null,
|
|
204
203
|
},
|
|
205
204
|
allFiles,
|
|
206
205
|
};
|
|
@@ -254,30 +253,37 @@ function buildTokensData() {
|
|
|
254
253
|
|
|
255
254
|
/**
|
|
256
255
|
* Extract all utils
|
|
256
|
+
* For util files, we use .d.ts files from lib/
|
|
257
|
+
* to avoid exposing source code in the public npm package
|
|
257
258
|
*/
|
|
258
259
|
function buildUtilsData() {
|
|
259
260
|
console.log('š§ Extracting utils...');
|
|
260
|
-
const
|
|
261
|
+
const srcUtilsPath = join(DESIGN_SYSTEM_PATH, 'src/utils');
|
|
262
|
+
const libUtilsPath = join(DESIGN_SYSTEM_PATH, 'lib/utils');
|
|
261
263
|
const utils = {};
|
|
262
264
|
|
|
263
|
-
if (!existsSync(
|
|
265
|
+
if (!existsSync(srcUtilsPath)) {
|
|
264
266
|
console.warn('ā ļø Utils path not found');
|
|
265
267
|
return utils;
|
|
266
268
|
}
|
|
267
269
|
|
|
268
|
-
const utilDirs = getDirectories(
|
|
270
|
+
const utilDirs = getDirectories(srcUtilsPath);
|
|
269
271
|
|
|
270
272
|
for (const utilName of utilDirs) {
|
|
271
|
-
const
|
|
273
|
+
const srcUtilDir = join(srcUtilsPath, utilName);
|
|
274
|
+
const libUtilDir = join(libUtilsPath, utilName);
|
|
272
275
|
|
|
273
|
-
// Get all files in the util directory
|
|
274
|
-
const allFiles = getAllFilesRecursively(
|
|
276
|
+
// Get all files in the util directory (from src for reference)
|
|
277
|
+
const allFiles = getAllFilesRecursively(srcUtilDir);
|
|
275
278
|
|
|
276
|
-
// Read all
|
|
279
|
+
// Read all .d.ts files from lib/
|
|
277
280
|
const files = {};
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
+
const libAllFiles = existsSync(libUtilDir) ? getAllFilesRecursively(libUtilDir) : [];
|
|
282
|
+
|
|
283
|
+
for (const file of libAllFiles) {
|
|
284
|
+
// Only include .d.ts files (skip .js and .d.ts.map)
|
|
285
|
+
if (file.endsWith('.d.ts') && !file.endsWith('.d.ts.map')) {
|
|
286
|
+
const fullPath = join(libUtilDir, file);
|
|
281
287
|
const content = safeReadFile(fullPath);
|
|
282
288
|
if (content) {
|
|
283
289
|
files[file] = {
|
package/mcp/index.js
CHANGED
package/mcp/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@spaced-out/genesis-mcp
|
|
3
|
-
"version": "1.0.
|
|
2
|
+
"name": "@spaced-out/genesis-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "MCP server for Genesis UI Design System - provides AI assistants with access to components, hooks, and design tokens",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
package/mcp/test-server.js
CHANGED
|
@@ -55,7 +55,7 @@ try {
|
|
|
55
55
|
console.log('\nš Next steps:');
|
|
56
56
|
console.log(' 1. Update package.json version if needed');
|
|
57
57
|
console.log(' 2. Publish: npm publish');
|
|
58
|
-
console.log(' 3. Users can run: npx @spaced-out/genesis-mcp
|
|
58
|
+
console.log(' 3. Users can run: npx @spaced-out/genesis-mcp@latest');
|
|
59
59
|
console.log('\nš MCP server is ready to use!\n');
|
|
60
60
|
|
|
61
61
|
} catch (error) {
|