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