@amedia/brick-mcp 0.0.2 → 0.1.1
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/data/components-metadata.json +35 -29
- package/data/tokens-documentation.json +1 -1
- package/data/tokens.json +4848 -128
- package/dist/data/components/brick-actions.md +59 -0
- package/dist/data/components/brick-alt-teaser.md +264 -0
- package/dist/data/components/brick-avatar.md +299 -0
- package/dist/data/components/brick-button.md +373 -0
- package/dist/data/components/brick-card.md +359 -0
- package/dist/data/components/brick-carousel.md +355 -0
- package/dist/data/components/brick-classnames.md +147 -0
- package/dist/data/components/brick-countdown.md +180 -0
- package/dist/data/components/brick-dialog.md +458 -0
- package/dist/data/components/brick-fonts.md +389 -0
- package/dist/data/components/brick-helloworld.md +228 -0
- package/dist/data/components/brick-icon.md +274 -0
- package/dist/data/components/brick-icons.md +570 -0
- package/dist/data/components/brick-illustrations.md +604 -0
- package/dist/data/components/brick-image.md +361 -0
- package/dist/data/components/brick-input.md +557 -0
- package/dist/data/components/brick-mcp.json +6 -0
- package/dist/data/components/brick-nifs.md +164 -0
- package/dist/data/components/brick-pill.json +6 -0
- package/dist/data/components/brick-player.json +7 -0
- package/dist/data/components/brick-published.json +7 -0
- package/dist/data/components/brick-share.json +7 -0
- package/dist/data/components/brick-stepper.json +7 -0
- package/dist/data/components/brick-tab.json +7 -0
- package/dist/data/components/brick-tabs.json +9 -0
- package/dist/data/components/brick-tag.json +7 -0
- package/dist/data/components/brick-teaser-player.json +9 -0
- package/dist/data/components/brick-teaser-reels.json +9 -0
- package/dist/data/components/brick-teaser.json +9 -0
- package/dist/data/components/brick-template.json +9 -0
- package/dist/data/components/brick-textarea.json +7 -0
- package/dist/data/components/brick-themes.json +6 -0
- package/dist/data/components/brick-toast.json +9 -0
- package/dist/data/components/brick-toggle.json +7 -0
- package/dist/data/components/brick-tokens.json +8 -0
- package/dist/data/components/brick-tooltip.json +7 -0
- package/dist/data/components-metadata.json +234 -0
- package/dist/data/tokens-documentation.json +7 -0
- package/dist/data/tokens.json +4976 -0
- package/dist/http.js +314 -0
- package/dist/http.js.map +7 -0
- package/dist/index.js +26 -37
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
- package/scripts/generate-data.js +15 -47
package/scripts/generate-data.js
CHANGED
|
@@ -138,32 +138,6 @@ async function generateComponentMetadata() {
|
|
|
138
138
|
console.log(`✅ Generated metadata for ${metadataList.length} components`);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
/**
|
|
142
|
-
* Recursively extract tokens from nested token object
|
|
143
|
-
*/
|
|
144
|
-
function extractTokens(obj, prefix = '', category, theme, tokens = []) {
|
|
145
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
146
|
-
const tokenName = prefix ? `${prefix}-${key}` : key;
|
|
147
|
-
|
|
148
|
-
if (value && typeof value === 'object') {
|
|
149
|
-
if ('$value' in value && '$type' in value) {
|
|
150
|
-
tokens.push({
|
|
151
|
-
name: tokenName,
|
|
152
|
-
value: String(value.$value),
|
|
153
|
-
type: String(value.$type),
|
|
154
|
-
description: value.$description,
|
|
155
|
-
category,
|
|
156
|
-
theme,
|
|
157
|
-
});
|
|
158
|
-
} else {
|
|
159
|
-
extractTokens(value, tokenName, category, theme, tokens);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
return tokens;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
141
|
/**
|
|
168
142
|
* Generate design tokens documentation
|
|
169
143
|
*/
|
|
@@ -209,35 +183,29 @@ async function generateDesignTokens() {
|
|
|
209
183
|
console.log('Generating design tokens...');
|
|
210
184
|
|
|
211
185
|
const tokensPath = join(BRICK_ROOT, 'packages', 'brick-tokens');
|
|
212
|
-
const
|
|
186
|
+
const tokensViewerPath = join(
|
|
187
|
+
tokensPath,
|
|
188
|
+
'tokens-viewer',
|
|
189
|
+
'tokens-viewer.json'
|
|
190
|
+
);
|
|
213
191
|
|
|
214
192
|
try {
|
|
215
|
-
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
const allTokens = [];
|
|
219
|
-
|
|
220
|
-
for (const file of themeFiles) {
|
|
221
|
-
const themeName = file.replace('.json', '');
|
|
222
|
-
const themePath = join(publicationsPath, file);
|
|
223
|
-
|
|
224
|
-
try {
|
|
225
|
-
const content = await readFile(themePath, 'utf-8');
|
|
226
|
-
const tokenData = JSON.parse(content);
|
|
227
|
-
const tokens = extractTokens(tokenData, '', undefined, themeName);
|
|
228
|
-
allTokens.push(...tokens);
|
|
229
|
-
} catch (error) {
|
|
230
|
-
console.error(`Error reading theme ${themeName}:`, error.message);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
193
|
+
// Read the tokens-viewer.json file
|
|
194
|
+
const content = await readFile(tokensViewerPath, 'utf-8');
|
|
195
|
+
const tokens = JSON.parse(content);
|
|
233
196
|
|
|
197
|
+
// Ensure data directory exists
|
|
234
198
|
await mkdir(DATA_DIR, { recursive: true });
|
|
199
|
+
|
|
200
|
+
// Write tokens.json
|
|
235
201
|
await writeFile(
|
|
236
202
|
join(DATA_DIR, 'tokens.json'),
|
|
237
|
-
JSON.stringify(
|
|
203
|
+
JSON.stringify(tokens, null, 2)
|
|
238
204
|
);
|
|
239
205
|
|
|
240
|
-
console.log(
|
|
206
|
+
console.log(
|
|
207
|
+
`✅ Generated ${tokens.length} design tokens from tokens-viewer.json`
|
|
208
|
+
);
|
|
241
209
|
} catch (error) {
|
|
242
210
|
console.error('Error generating design tokens:', error.message);
|
|
243
211
|
}
|