@primer/mcp 0.0.0-20250812005457

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/src/primer.ts ADDED
@@ -0,0 +1,75 @@
1
+ import componentsMetadata from '@primer/react/generated/components.json' with {type: 'json'}
2
+
3
+ type Component = {
4
+ id: string
5
+ name: string
6
+ importPath: string
7
+ slug: string
8
+ }
9
+
10
+ const components: Array<Component> = Object.entries(componentsMetadata.components).map(([id, component]) => {
11
+ return {
12
+ id,
13
+ name: component.name,
14
+ importPath: component.importPath,
15
+ slug: id.replaceAll('_', '-'),
16
+ }
17
+ })
18
+
19
+ function listComponents(): Array<Component> {
20
+ return components
21
+ }
22
+
23
+ type Pattern = {
24
+ id: string
25
+ name: string
26
+ }
27
+
28
+ const patterns: Array<Pattern> = [
29
+ {
30
+ id: 'data-visualization',
31
+ name: 'Data Visualization',
32
+ },
33
+ {
34
+ id: 'degraded-experiences',
35
+ name: 'Degraded Experiences',
36
+ },
37
+ {
38
+ id: 'empty-states',
39
+ name: 'Empty States',
40
+ },
41
+ {
42
+ id: 'feature-onboarding',
43
+ name: 'Feature Onboarding',
44
+ },
45
+ {
46
+ id: 'forms',
47
+ name: 'Forms',
48
+ },
49
+ {
50
+ id: 'loading',
51
+ name: 'Loading',
52
+ },
53
+ {
54
+ id: 'navigation',
55
+ name: 'Navigation',
56
+ },
57
+ {
58
+ id: 'notification-messaging',
59
+ name: 'Notification message',
60
+ },
61
+ {
62
+ id: 'progressive-disclosure',
63
+ name: 'Progressive disclosure',
64
+ },
65
+ {
66
+ id: 'saving',
67
+ name: 'Saving',
68
+ },
69
+ ]
70
+
71
+ function listPatterns(): Array<Pattern> {
72
+ return patterns
73
+ }
74
+
75
+ export {listComponents, listPatterns}