@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.
Files changed (48) hide show
  1. package/data/components-metadata.json +35 -29
  2. package/data/tokens-documentation.json +1 -1
  3. package/data/tokens.json +4848 -128
  4. package/dist/data/components/brick-actions.md +59 -0
  5. package/dist/data/components/brick-alt-teaser.md +264 -0
  6. package/dist/data/components/brick-avatar.md +299 -0
  7. package/dist/data/components/brick-button.md +373 -0
  8. package/dist/data/components/brick-card.md +359 -0
  9. package/dist/data/components/brick-carousel.md +355 -0
  10. package/dist/data/components/brick-classnames.md +147 -0
  11. package/dist/data/components/brick-countdown.md +180 -0
  12. package/dist/data/components/brick-dialog.md +458 -0
  13. package/dist/data/components/brick-fonts.md +389 -0
  14. package/dist/data/components/brick-helloworld.md +228 -0
  15. package/dist/data/components/brick-icon.md +274 -0
  16. package/dist/data/components/brick-icons.md +570 -0
  17. package/dist/data/components/brick-illustrations.md +604 -0
  18. package/dist/data/components/brick-image.md +361 -0
  19. package/dist/data/components/brick-input.md +557 -0
  20. package/dist/data/components/brick-mcp.json +6 -0
  21. package/dist/data/components/brick-nifs.md +164 -0
  22. package/dist/data/components/brick-pill.json +6 -0
  23. package/dist/data/components/brick-player.json +7 -0
  24. package/dist/data/components/brick-published.json +7 -0
  25. package/dist/data/components/brick-share.json +7 -0
  26. package/dist/data/components/brick-stepper.json +7 -0
  27. package/dist/data/components/brick-tab.json +7 -0
  28. package/dist/data/components/brick-tabs.json +9 -0
  29. package/dist/data/components/brick-tag.json +7 -0
  30. package/dist/data/components/brick-teaser-player.json +9 -0
  31. package/dist/data/components/brick-teaser-reels.json +9 -0
  32. package/dist/data/components/brick-teaser.json +9 -0
  33. package/dist/data/components/brick-template.json +9 -0
  34. package/dist/data/components/brick-textarea.json +7 -0
  35. package/dist/data/components/brick-themes.json +6 -0
  36. package/dist/data/components/brick-toast.json +9 -0
  37. package/dist/data/components/brick-toggle.json +7 -0
  38. package/dist/data/components/brick-tokens.json +8 -0
  39. package/dist/data/components/brick-tooltip.json +7 -0
  40. package/dist/data/components-metadata.json +234 -0
  41. package/dist/data/tokens-documentation.json +7 -0
  42. package/dist/data/tokens.json +4976 -0
  43. package/dist/http.js +314 -0
  44. package/dist/http.js.map +7 -0
  45. package/dist/index.js +26 -37
  46. package/dist/index.js.map +2 -2
  47. package/package.json +2 -2
  48. package/scripts/generate-data.js +15 -47
@@ -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 publicationsPath = join(tokensPath, 'publications', 'publication');
186
+ const tokensViewerPath = join(
187
+ tokensPath,
188
+ 'tokens-viewer',
189
+ 'tokens-viewer.json'
190
+ );
213
191
 
214
192
  try {
215
- const files = await readdir(publicationsPath);
216
- const themeFiles = files.filter((file) => file.endsWith('.json'));
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(allTokens, null, 2)
203
+ JSON.stringify(tokens, null, 2)
238
204
  );
239
205
 
240
- console.log(`✅ Generated ${allTokens.length} design tokens`);
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
  }