@idealyst/mcp-server 1.0.93 → 1.0.94

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 (182) hide show
  1. package/dist/data/cli-commands.d.ts +2 -0
  2. package/dist/data/cli-commands.d.ts.map +1 -0
  3. package/dist/data/cli-commands.js +100 -0
  4. package/dist/data/cli-commands.js.map +1 -0
  5. package/dist/data/components/Accordion.d.ts +15 -0
  6. package/dist/data/components/Accordion.d.ts.map +1 -0
  7. package/{src/data/components/Accordion.ts → dist/data/components/Accordion.js} +26 -28
  8. package/dist/data/components/Accordion.js.map +1 -0
  9. package/dist/data/components/ActivityIndicator.d.ts +15 -0
  10. package/dist/data/components/ActivityIndicator.d.ts.map +1 -0
  11. package/{src/data/components/ActivityIndicator.ts → dist/data/components/ActivityIndicator.js} +26 -28
  12. package/dist/data/components/ActivityIndicator.js.map +1 -0
  13. package/dist/data/components/Alert.d.ts +15 -0
  14. package/dist/data/components/Alert.d.ts.map +1 -0
  15. package/{src/data/components/Alert.ts → dist/data/components/Alert.js} +28 -30
  16. package/dist/data/components/Alert.js.map +1 -0
  17. package/dist/data/components/Avatar.d.ts +15 -0
  18. package/dist/data/components/Avatar.d.ts.map +1 -0
  19. package/{src/data/components/Avatar.ts → dist/data/components/Avatar.js} +26 -28
  20. package/dist/data/components/Avatar.js.map +1 -0
  21. package/dist/data/components/Badge.d.ts +15 -0
  22. package/dist/data/components/Badge.d.ts.map +1 -0
  23. package/{src/data/components/Badge.ts → dist/data/components/Badge.js} +16 -15
  24. package/dist/data/components/Badge.js.map +1 -0
  25. package/dist/data/components/Breadcrumb.d.ts +15 -0
  26. package/dist/data/components/Breadcrumb.d.ts.map +1 -0
  27. package/{src/data/components/Breadcrumb.ts → dist/data/components/Breadcrumb.js} +27 -29
  28. package/dist/data/components/Breadcrumb.js.map +1 -0
  29. package/dist/data/components/Button.d.ts +15 -0
  30. package/dist/data/components/Button.d.ts.map +1 -0
  31. package/{src/data/components/Button.ts → dist/data/components/Button.js} +18 -17
  32. package/dist/data/components/Button.js.map +1 -0
  33. package/dist/data/components/Card.d.ts +15 -0
  34. package/dist/data/components/Card.d.ts.map +1 -0
  35. package/{src/data/components/Card.ts → dist/data/components/Card.js} +16 -15
  36. package/dist/data/components/Card.js.map +1 -0
  37. package/dist/data/components/Checkbox.d.ts +15 -0
  38. package/dist/data/components/Checkbox.d.ts.map +1 -0
  39. package/{src/data/components/Checkbox.ts → dist/data/components/Checkbox.js} +27 -29
  40. package/dist/data/components/Checkbox.js.map +1 -0
  41. package/dist/data/components/Chip.d.ts +15 -0
  42. package/dist/data/components/Chip.d.ts.map +1 -0
  43. package/{src/data/components/Chip.ts → dist/data/components/Chip.js} +19 -18
  44. package/dist/data/components/Chip.js.map +1 -0
  45. package/dist/data/components/Dialog.d.ts +15 -0
  46. package/dist/data/components/Dialog.d.ts.map +1 -0
  47. package/{src/data/components/Dialog.ts → dist/data/components/Dialog.js} +18 -17
  48. package/dist/data/components/Dialog.js.map +1 -0
  49. package/dist/data/components/Divider.d.ts +15 -0
  50. package/dist/data/components/Divider.d.ts.map +1 -0
  51. package/{src/data/components/Divider.ts → dist/data/components/Divider.js} +26 -28
  52. package/dist/data/components/Divider.js.map +1 -0
  53. package/dist/data/components/Icon.d.ts +15 -0
  54. package/dist/data/components/Icon.d.ts.map +1 -0
  55. package/{src/data/components/Icon.ts → dist/data/components/Icon.js} +26 -28
  56. package/dist/data/components/Icon.js.map +1 -0
  57. package/dist/data/components/Image.d.ts +15 -0
  58. package/dist/data/components/Image.d.ts.map +1 -0
  59. package/{src/data/components/Image.ts → dist/data/components/Image.js} +29 -31
  60. package/dist/data/components/Image.js.map +1 -0
  61. package/dist/data/components/Input.d.ts +15 -0
  62. package/dist/data/components/Input.d.ts.map +1 -0
  63. package/{src/data/components/Input.ts → dist/data/components/Input.js} +20 -19
  64. package/dist/data/components/Input.js.map +1 -0
  65. package/dist/data/components/List.d.ts +15 -0
  66. package/dist/data/components/List.d.ts.map +1 -0
  67. package/{src/data/components/List.ts → dist/data/components/List.js} +18 -17
  68. package/dist/data/components/List.js.map +1 -0
  69. package/dist/data/components/Menu.d.ts +15 -0
  70. package/dist/data/components/Menu.d.ts.map +1 -0
  71. package/{src/data/components/Menu.ts → dist/data/components/Menu.js} +27 -29
  72. package/dist/data/components/Menu.js.map +1 -0
  73. package/dist/data/components/Popover.d.ts +15 -0
  74. package/dist/data/components/Popover.d.ts.map +1 -0
  75. package/{src/data/components/Popover.ts → dist/data/components/Popover.js} +28 -30
  76. package/dist/data/components/Popover.js.map +1 -0
  77. package/dist/data/components/Pressable.d.ts +15 -0
  78. package/dist/data/components/Pressable.d.ts.map +1 -0
  79. package/{src/data/components/Pressable.ts → dist/data/components/Pressable.js} +27 -29
  80. package/dist/data/components/Pressable.js.map +1 -0
  81. package/dist/data/components/Progress.d.ts +15 -0
  82. package/dist/data/components/Progress.d.ts.map +1 -0
  83. package/{src/data/components/Progress.ts → dist/data/components/Progress.js} +27 -29
  84. package/dist/data/components/Progress.js.map +1 -0
  85. package/dist/data/components/RadioButton.d.ts +15 -0
  86. package/dist/data/components/RadioButton.d.ts.map +1 -0
  87. package/{src/data/components/RadioButton.ts → dist/data/components/RadioButton.js} +28 -30
  88. package/dist/data/components/RadioButton.js.map +1 -0
  89. package/dist/data/components/SVGImage.d.ts +15 -0
  90. package/dist/data/components/SVGImage.d.ts.map +1 -0
  91. package/{src/data/components/SVGImage.ts → dist/data/components/SVGImage.js} +27 -29
  92. package/dist/data/components/SVGImage.js.map +1 -0
  93. package/dist/data/components/Screen.d.ts +15 -0
  94. package/dist/data/components/Screen.d.ts.map +1 -0
  95. package/{src/data/components/Screen.ts → dist/data/components/Screen.js} +27 -29
  96. package/dist/data/components/Screen.js.map +1 -0
  97. package/dist/data/components/Select.d.ts +15 -0
  98. package/dist/data/components/Select.d.ts.map +1 -0
  99. package/{src/data/components/Select.ts → dist/data/components/Select.js} +30 -32
  100. package/dist/data/components/Select.js.map +1 -0
  101. package/dist/data/components/Skeleton.d.ts +15 -0
  102. package/dist/data/components/Skeleton.d.ts.map +1 -0
  103. package/{src/data/components/Skeleton.ts → dist/data/components/Skeleton.js} +27 -29
  104. package/dist/data/components/Skeleton.js.map +1 -0
  105. package/dist/data/components/Slider.d.ts +15 -0
  106. package/dist/data/components/Slider.d.ts.map +1 -0
  107. package/{src/data/components/Slider.ts → dist/data/components/Slider.js} +31 -33
  108. package/dist/data/components/Slider.js.map +1 -0
  109. package/dist/data/components/Switch.d.ts +15 -0
  110. package/dist/data/components/Switch.d.ts.map +1 -0
  111. package/{src/data/components/Switch.ts → dist/data/components/Switch.js} +28 -30
  112. package/dist/data/components/Switch.js.map +1 -0
  113. package/dist/data/components/TabBar.d.ts +15 -0
  114. package/dist/data/components/TabBar.d.ts.map +1 -0
  115. package/{src/data/components/TabBar.ts → dist/data/components/TabBar.js} +27 -29
  116. package/dist/data/components/TabBar.js.map +1 -0
  117. package/dist/data/components/Table.d.ts +15 -0
  118. package/dist/data/components/Table.d.ts.map +1 -0
  119. package/{src/data/components/Table.ts → dist/data/components/Table.js} +29 -31
  120. package/dist/data/components/Table.js.map +1 -0
  121. package/dist/data/components/Tabs.d.ts +15 -0
  122. package/dist/data/components/Tabs.d.ts.map +1 -0
  123. package/{src/data/components/Tabs.ts → dist/data/components/Tabs.js} +28 -30
  124. package/dist/data/components/Tabs.js.map +1 -0
  125. package/dist/data/components/Text.d.ts +15 -0
  126. package/dist/data/components/Text.d.ts.map +1 -0
  127. package/{src/data/components/Text.ts → dist/data/components/Text.js} +27 -29
  128. package/dist/data/components/Text.js.map +1 -0
  129. package/dist/data/components/TextArea.d.ts +15 -0
  130. package/dist/data/components/TextArea.d.ts.map +1 -0
  131. package/{src/data/components/TextArea.ts → dist/data/components/TextArea.js} +31 -33
  132. package/dist/data/components/TextArea.js.map +1 -0
  133. package/dist/data/components/Tooltip.d.ts +15 -0
  134. package/dist/data/components/Tooltip.d.ts.map +1 -0
  135. package/{src/data/components/Tooltip.ts → dist/data/components/Tooltip.js} +28 -30
  136. package/dist/data/components/Tooltip.js.map +1 -0
  137. package/dist/data/components/Video.d.ts +15 -0
  138. package/dist/data/components/Video.d.ts.map +1 -0
  139. package/{src/data/components/Video.ts → dist/data/components/Video.js} +31 -33
  140. package/dist/data/components/Video.js.map +1 -0
  141. package/dist/data/components/View.d.ts +15 -0
  142. package/dist/data/components/View.d.ts.map +1 -0
  143. package/{src/data/components/View.ts → dist/data/components/View.js} +28 -30
  144. package/dist/data/components/View.js.map +1 -0
  145. package/dist/data/components/index.d.ts +37 -0
  146. package/dist/data/components/index.d.ts.map +1 -0
  147. package/{src/data/components/index.ts → dist/data/components/index.js} +37 -38
  148. package/dist/data/components/index.js.map +1 -0
  149. package/dist/data/framework-guides.d.ts +2 -0
  150. package/dist/data/framework-guides.d.ts.map +1 -0
  151. package/{src/data/framework-guides.ts → dist/data/framework-guides.js} +8 -12
  152. package/dist/data/framework-guides.js.map +1 -0
  153. package/dist/data/icon-guide.d.ts +2 -0
  154. package/dist/data/icon-guide.d.ts.map +1 -0
  155. package/{src/data/icon-guide.ts → dist/data/icon-guide.js} +1 -0
  156. package/dist/data/icon-guide.js.map +1 -0
  157. package/dist/data/icons.json +7452 -0
  158. package/dist/data/navigation-guides.d.ts +2 -0
  159. package/dist/data/navigation-guides.d.ts.map +1 -0
  160. package/{src/data/navigation-guides.ts → dist/data/navigation-guides.js} +7 -10
  161. package/dist/data/navigation-guides.js.map +1 -0
  162. package/dist/generated/types.json +2556 -0
  163. package/dist/index.d.ts +3 -0
  164. package/dist/index.d.ts.map +1 -0
  165. package/dist/index.js.map +1 -0
  166. package/dist/tools/get-types.d.ts +26 -0
  167. package/dist/tools/get-types.d.ts.map +1 -0
  168. package/dist/tools/get-types.js +123 -0
  169. package/dist/tools/get-types.js.map +1 -0
  170. package/package.json +7 -2
  171. package/ARCHITECTURE.md +0 -313
  172. package/TYPE-SYSTEM.md +0 -397
  173. package/scripts/extract-types.ts +0 -71
  174. package/scripts/type-extractor.ts +0 -286
  175. package/scripts/validate-examples.ts +0 -142
  176. package/src/data/cli-commands.ts +0 -103
  177. package/src/data/icons.json +0 -7452
  178. package/src/index.ts +0 -653
  179. package/src/tools/get-types.ts +0 -169
  180. package/test-client.js +0 -86
  181. package/tsconfig.examples.json +0 -14
  182. package/tsconfig.json +0 -20
package/TYPE-SYSTEM.md DELETED
@@ -1,397 +0,0 @@
1
- # Type-Driven Documentation System
2
-
3
- ## Overview
4
-
5
- The Idealyst MCP Server uses a **type-driven architecture** to ensure documentation accuracy. Instead of manually maintaining prop definitions, we extract TypeScript types directly from the source packages and validate all examples against them.
6
-
7
- ## Architecture
8
-
9
- ```
10
- ┌──────────────────────────────────────────────────────────┐
11
- │ Source Packages (Single Source of Truth) │
12
- │ • @idealyst/components/src/*/types.ts │
13
- │ • @idealyst/theme/src/theme/*.ts │
14
- │ • @idealyst/navigation/src/routing/types.ts │
15
- └────────────────┬─────────────────────────────────────────┘
16
-
17
-
18
- ┌──────────────────────────────────────────────────────────┐
19
- │ Build-Time Type Extraction │
20
- │ • scripts/extract-types.ts │
21
- │ • scripts/type-extractor.ts │
22
- │ Uses TypeScript Compiler API (ts-morph) │
23
- └────────────────┬─────────────────────────────────────────┘
24
-
25
-
26
- ┌──────────────────────────────────────────────────────────┐
27
- │ Generated Type Definitions │
28
- │ • src/generated/types.json │
29
- │ Contains all extracted types and props │
30
- └────────────────┬─────────────────────────────────────────┘
31
-
32
-
33
- ┌──────────────────────────────────────────────────────────┐
34
- │ MCP Server Tools │
35
- │ • get_component_types(component, format) │
36
- │ • get_theme_types(format) │
37
- │ • get_navigation_types(format) │
38
- │ • get_component_examples_ts(component) │
39
- └──────────────────────────────────────────────────────────┘
40
- ```
41
-
42
- ## Type Extraction
43
-
44
- ### What Gets Extracted
45
-
46
- From **@idealyst/components**:
47
- - Component props interfaces (`ButtonProps`, `CardProps`, etc.)
48
- - All related types (enums, unions, type aliases)
49
- - Individual prop details (name, type, required, description)
50
-
51
- From **@idealyst/theme**:
52
- - `Size` type: `'xs' | 'sm' | 'md' | 'lg' | 'xl'`
53
- - `Intent` type: `'primary' | 'success' | 'error' | 'warning' | 'neutral' | 'info'`
54
- - `Color` type: `Pallet.Shade` format
55
- - `Pallet` and `Shade` types
56
-
57
- From **@idealyst/navigation**:
58
- - Navigator types (Stack, Tab, Drawer, Modal)
59
- - Route configuration types
60
- - Screen options types
61
-
62
- ### Running Type Extraction
63
-
64
- ```bash
65
- # Extract types from all packages
66
- yarn extract-types
67
-
68
- # Output: src/generated/types.json
69
- ```
70
-
71
- This generates a JSON file containing all type information structured for easy consumption by the MCP server.
72
-
73
- ## Example Validation
74
-
75
- ### TypeScript Example Files
76
-
77
- All examples are stored as real TypeScript files in `examples/components/`:
78
-
79
- ```typescript
80
- // examples/components/Button.examples.tsx
81
- import React from 'react';
82
- import { Button } from '@idealyst/components';
83
-
84
- export function BasicButton() {
85
- return (
86
- <Button type="contained" intent="primary">
87
- Save
88
- </Button>
89
- );
90
- }
91
- ```
92
-
93
- ### Running Validation
94
-
95
- ```bash
96
- # Validate all examples against actual types
97
- yarn validate-examples
98
-
99
- # This runs TypeScript compiler on all example files
100
- # Fails if any examples have type errors
101
- ```
102
-
103
- ### Benefits
104
-
105
- ✅ **Guaranteed Correctness**: Examples won't compile if they use wrong prop names or values
106
- ✅ **Auto-Discovery**: Type errors are caught immediately during build
107
- ✅ **Real Code**: Examples are actual TypeScript, not strings in documentation
108
- ✅ **IDE Support**: Examples can be developed with full autocomplete and type checking
109
-
110
- ## MCP Server Tools
111
-
112
- ### get_component_types
113
-
114
- Get TypeScript type definitions for a component.
115
-
116
- ```typescript
117
- // Request
118
- {
119
- component: "Button",
120
- format: "both" // or "typescript" or "json"
121
- }
122
-
123
- // Response
124
- {
125
- component: "Button",
126
- typescript: "export interface ButtonProps { ... }",
127
- schema: {
128
- propsInterface: "ButtonProps",
129
- props: [
130
- { name: "type", type: "ButtonType", required: false },
131
- { name: "size", type: "Size", required: false },
132
- { name: "leftIcon", type: "IconName | React.ReactNode", required: false }
133
- ],
134
- relatedTypes: {
135
- "ButtonType": "export type ButtonType = 'contained' | 'outlined' | 'text';"
136
- }
137
- }
138
- }
139
- ```
140
-
141
- **Formats:**
142
- - `typescript`: Raw TypeScript interface definitions
143
- - `json`: Parsed JSON schema with prop details
144
- - `both`: Combined output (default)
145
-
146
- ### get_theme_types
147
-
148
- Get all theme types (Size, Intent, Color, etc.)
149
-
150
- ```typescript
151
- // Request
152
- { format: "json" }
153
-
154
- // Response
155
- {
156
- name: "Theme Types",
157
- schema: {
158
- "Size": {
159
- name: "Size",
160
- definition: "export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';",
161
- values: ["xs", "sm", "md", "lg", "xl"]
162
- },
163
- "Intent": {
164
- name: "Intent",
165
- definition: "export type Intent = 'primary' | 'success' | ...",
166
- values: ["primary", "success", "error", "warning", "neutral", "info"]
167
- }
168
- }
169
- }
170
- ```
171
-
172
- ### get_navigation_types
173
-
174
- Get navigation type definitions.
175
-
176
- ```typescript
177
- // Request
178
- { format: "typescript" }
179
-
180
- // Response
181
- {
182
- name: "Navigation Types",
183
- typescript: "export type NavigatorParam = ...\nexport type RouteParam = ..."
184
- }
185
- ```
186
-
187
- ### get_component_examples_ts
188
-
189
- Get validated TypeScript examples for a component.
190
-
191
- ```typescript
192
- // Request
193
- { component: "Button" }
194
-
195
- // Response: Full content of examples/components/Button.examples.tsx
196
- ```
197
-
198
- ## Development Workflow
199
-
200
- ### Adding a New Component
201
-
202
- 1. **Create the component** in `@idealyst/components`
203
- 2. **Define types** in `ComponentName/types.ts`
204
- 3. **Run extraction** to generate types:
205
- ```bash
206
- yarn extract-types
207
- ```
208
- 4. **Create examples** in `examples/components/ComponentName.examples.tsx`
209
- 5. **Validate examples**:
210
- ```bash
211
- yarn validate-examples
212
- ```
213
- 6. **Build MCP server**:
214
- ```bash
215
- yarn build
216
- ```
217
-
218
- ### Updating Component Types
219
-
220
- When you change a component's types:
221
-
222
- 1. **Edit types** in `@idealyst/components/src/ComponentName/types.ts`
223
- 2. **Rebuild packages** if necessary
224
- 3. **Run type extraction**:
225
- ```bash
226
- cd packages/mcp-server
227
- yarn extract-types
228
- ```
229
- 4. **Validation will catch** any examples that are now broken:
230
- ```bash
231
- yarn validate-examples
232
- ```
233
- 5. **Fix broken examples** if needed
234
- 6. **Rebuild** MCP server
235
-
236
- ## Build Process
237
-
238
- The build process ensures type accuracy:
239
-
240
- ```json
241
- {
242
- "scripts": {
243
- "prebuild": "yarn extract-types && yarn validate-examples",
244
- "build": "tsc && chmod +x dist/index.js"
245
- }
246
- }
247
- ```
248
-
249
- ### What Happens
250
-
251
- 1. **Extract Types**: Parse TypeScript files from packages, generate `types.json`
252
- 2. **Validate Examples**: Type-check all example files
253
- 3. **Build Fails**: If examples have type errors
254
- 4. **Build Succeeds**: Only if all examples are type-correct
255
-
256
- ## CI/CD Integration
257
-
258
- ### Recommended GitHub Actions
259
-
260
- ```yaml
261
- name: Validate MCP Documentation
262
-
263
- on: [push, pull_request]
264
-
265
- jobs:
266
- validate:
267
- runs-on: ubuntu-latest
268
- steps:
269
- - uses: actions/checkout@v3
270
-
271
- - name: Setup Node
272
- uses: actions/setup-node@v3
273
- with:
274
- node-version: '20'
275
-
276
- - name: Install dependencies
277
- run: yarn install
278
-
279
- - name: Extract types
280
- run: |
281
- cd packages/mcp-server
282
- yarn extract-types
283
-
284
- - name: Validate examples
285
- run: |
286
- cd packages/mcp-server
287
- yarn validate-examples
288
-
289
- - name: Build
290
- run: |
291
- cd packages/mcp-server
292
- yarn build
293
- ```
294
-
295
- ## File Structure
296
-
297
- ```
298
- packages/mcp-server/
299
- ├── scripts/
300
- │ ├── extract-types.ts # Main extraction script
301
- │ ├── type-extractor.ts # Type extraction utilities
302
- │ └── validate-examples.ts # Example validation script
303
- ├── src/
304
- │ ├── generated/
305
- │ │ └── types.json # Auto-generated (gitignored)
306
- │ ├── tools/
307
- │ │ └── get-types.ts # Type export tools
308
- │ └── index.ts # MCP server entry
309
- ├── examples/
310
- │ └── components/
311
- │ ├── Button.examples.tsx # Type-checked examples
312
- │ ├── Card.examples.tsx
313
- │ └── ...
314
- ├── tsconfig.json # Main TypeScript config
315
- ├── tsconfig.examples.json # Config for validating examples
316
- └── package.json
317
- ```
318
-
319
- ## Benefits
320
-
321
- ### For Component Library Developers
322
- - ✅ Change types → Documentation updates automatically
323
- - ✅ No manual synchronization required
324
- - ✅ Build fails if examples become invalid
325
-
326
- ### For AI Assistants (Claude, etc.)
327
- - ✅ Access to raw TypeScript types
328
- - ✅ Validated examples guaranteed to work
329
- - ✅ Both human-readable and machine-readable formats
330
-
331
- ### For End Users
332
- - ✅ Documentation always matches reality
333
- - ✅ Examples compile on first try
334
- - ✅ No "property doesn't exist" errors
335
-
336
- ## Troubleshooting
337
-
338
- ### Build Fails: "Types file not found"
339
-
340
- Run type extraction first:
341
- ```bash
342
- yarn extract-types
343
- ```
344
-
345
- ### Validation Fails: Type Errors in Examples
346
-
347
- The examples have type errors. This is intentional! Fix the examples to match the actual types:
348
- ```bash
349
- # See specific errors
350
- yarn validate-examples
351
-
352
- # Fix the examples, then re-validate
353
- yarn validate-examples
354
- ```
355
-
356
- ### Types Are Out of Date
357
-
358
- Re-extract after changing component types:
359
- ```bash
360
- yarn extract-types
361
- ```
362
-
363
- ### Can't Find Component Types
364
-
365
- Ensure the component has a `types.ts` file in its directory:
366
- ```
367
- packages/components/src/
368
- Button/
369
- types.ts ← Required
370
- Button.tsx
371
- ...
372
- ```
373
-
374
- ## Future Enhancements
375
-
376
- ### Planned Features
377
-
378
- 1. **Auto-Generate Prop Documentation**: Generate human-readable prop tables from types
379
- 2. **Visual Type Inspector**: Web UI to browse extracted types
380
- 3. **Incremental Extraction**: Only re-extract changed components
381
- 4. **Cross-Package Type Resolution**: Better handling of types imported from other packages
382
- 5. **Markdown Generation**: Auto-generate markdown docs from types
383
-
384
- ### Contributing
385
-
386
- To contribute to the type system:
387
-
388
- 1. Follow the architecture in `ARCHITECTURE.md`
389
- 2. Add tests for new extractors
390
- 3. Ensure all examples remain valid
391
- 4. Update this documentation
392
-
393
- ## References
394
-
395
- - [TypeScript Compiler API](https://github.com/microsoft/TypeScript/wiki/Using-the-Compiler-API)
396
- - [ts-morph Documentation](https://ts-morph.com/)
397
- - [Model Context Protocol](https://modelcontextprotocol.io/)
@@ -1,71 +0,0 @@
1
- #!/usr/bin/env tsx
2
-
3
- /**
4
- * Extract Types Script
5
- *
6
- * Extracts TypeScript type information from @idealyst packages
7
- * and generates a JSON file for use by the MCP server.
8
- */
9
-
10
- import { TypeExtractor } from './type-extractor.js';
11
- import * as fs from 'fs';
12
- import * as path from 'path';
13
- import { fileURLToPath } from 'url';
14
-
15
- const __filename = fileURLToPath(import.meta.url);
16
- const __dirname = path.dirname(__filename);
17
-
18
- async function main() {
19
- console.log('🔍 Extracting types from Idealyst packages...\n');
20
-
21
- const extractor = new TypeExtractor();
22
-
23
- // Extract all component types
24
- console.log('📦 Extracting component types...');
25
- const components = extractor.extractAllComponents();
26
- console.log(` Found ${Object.keys(components).length} components\n`);
27
-
28
- // Extract theme types
29
- console.log('🎨 Extracting theme types...');
30
- const themeTypes = extractor.extractThemeTypes();
31
- console.log(` Found ${Object.keys(themeTypes).length} theme types\n`);
32
-
33
- // Extract navigation types
34
- console.log('🧭 Extracting navigation types...');
35
- const navigationTypes = extractor.extractNavigationTypes();
36
- console.log(` Found ${Object.keys(navigationTypes).length} navigation types\n`);
37
-
38
- // Create output structure
39
- const output = {
40
- version: '1.0.93',
41
- extractedAt: new Date().toISOString(),
42
- components,
43
- theme: themeTypes,
44
- navigation: navigationTypes,
45
- };
46
-
47
- // Ensure output directory exists
48
- const outputDir = path.join(__dirname, '../src/generated');
49
- if (!fs.existsSync(outputDir)) {
50
- fs.mkdirSync(outputDir, { recursive: true });
51
- }
52
-
53
- // Write JSON file
54
- const outputPath = path.join(outputDir, 'types.json');
55
- fs.writeFileSync(outputPath, JSON.stringify(output, null, 2));
56
-
57
- console.log(`✅ Type extraction complete!`);
58
- console.log(` Output: ${outputPath}\n`);
59
-
60
- // Print summary
61
- console.log('📊 Summary:');
62
- console.log(` Components: ${Object.keys(components).length}`);
63
- console.log(` Theme Types: ${Object.keys(themeTypes).length}`);
64
- console.log(` Navigation Types: ${Object.keys(navigationTypes).length}`);
65
- console.log(` Total Props: ${Object.values(components).reduce((sum, c) => sum + c.props.length, 0)}`);
66
- }
67
-
68
- main().catch(error => {
69
- console.error('❌ Type extraction failed:', error);
70
- process.exit(1);
71
- });