@maltjoy/mcp-server 0.2.0 → 0.3.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/README.md +34 -3
- package/dist/doc/VJoyAvailability/JoyAvailability.types.ts +1 -0
- package/dist/doc/VJoyAvatar/JoyAvatar.types.ts +6 -0
- package/dist/doc/VJoyAvatar/metadata.json +2 -1
- package/dist/doc/VJoyBadge/JoyBadge.types.ts +3 -0
- package/dist/doc/VJoyBadge/metadata.json +0 -14
- package/dist/doc/VJoyBadgeLevel/JoyBadgeLevel.types.ts +15 -0
- package/dist/doc/VJoyButton/JoyButton.types.ts +10 -0
- package/dist/doc/VJoyButton/metadata.json +1 -1
- package/dist/doc/VJoyCollapseItem/JoyCollapseItem.types.ts +8 -0
- package/dist/doc/VJoyCollapseItem/metadata.json +1 -1
- package/dist/doc/VJoyCompanyAvatar/JoyCompanyAvatar.types.ts +3 -0
- package/dist/doc/VJoyDialog/JoyDialog.types.ts +3 -0
- package/dist/doc/VJoyDot/VJoyDot.types.ts +1 -0
- package/dist/doc/VJoyDot/metadata.json +13 -14
- package/dist/doc/VJoyDrawer/JoyDrawer.types.ts +1 -0
- package/dist/doc/VJoyDropdown/JoyDropdown.types.ts +21 -0
- package/dist/doc/VJoyDropdownList/JoyDropdownList.types.ts +3 -0
- package/dist/doc/VJoyDropzone/metadata.json +11 -0
- package/dist/doc/VJoyFormError/metadata.json +16 -0
- package/dist/doc/VJoyFormGroup/metadata.json +14 -0
- package/dist/doc/VJoyFunnel/JoyFunnel.types.ts +5 -0
- package/dist/doc/VJoyHighlight/JoyHighlight.types.ts +4 -0
- package/dist/doc/VJoyHighlight/metadata.json +1 -1
- package/dist/doc/VJoyIcon/JoyIcon.types.ts +8 -0
- package/dist/doc/VJoyIcon/metadata.json +3 -3
- package/dist/doc/VJoyIndicators/JoyIndicators.types.ts +1 -0
- package/dist/doc/VJoyInput/JoyInput.types.ts +40 -0
- package/dist/doc/VJoyInput/metadata.json +5 -1
- package/dist/doc/VJoyInputDigit/JoyInputDigit.types.ts +14 -0
- package/dist/doc/VJoyInputDigit/metadata.json +154 -0
- package/dist/doc/VJoyInputPassword/metadata.json +257 -0
- package/dist/doc/VJoyLabel/JoyLabel.types.ts +4 -0
- package/dist/doc/VJoyLink/JoyLink.types.ts +2 -0
- package/dist/doc/VJoyLink/metadata.json +1 -1
- package/dist/doc/VJoyListItem/metadata.json +1 -1
- package/dist/doc/VJoyMenu/JoyMenu.types.ts +14 -0
- package/dist/doc/VJoyMenu/metadata.json +3 -0
- package/dist/doc/VJoyMenuItem/JoyMenuItem.types.ts +14 -0
- package/dist/doc/VJoyMenuItem/metadata.json +2 -2
- package/dist/doc/VJoyPanel/JoyPanel.types.ts +6 -0
- package/dist/doc/VJoyPasswordRequirement/JoyPasswordRequirement.types.ts +8 -0
- package/dist/doc/VJoyPasswordRequirement/metadata.json +39 -0
- package/dist/doc/VJoyProductTour/JoyProductTour.types.ts +45 -0
- package/dist/doc/VJoyProductTour/metadata.json +1 -1
- package/dist/doc/VJoyProgressBar/JoyProgressBar.types.ts +3 -0
- package/dist/doc/VJoyRadio/JoyRadio.types.ts +1 -0
- package/dist/doc/VJoyRadio/metadata.json +16 -0
- package/dist/doc/VJoyRadioGroup/JoyRadioGroup.types.ts +1 -0
- package/dist/doc/VJoyRadioGroup/metadata.json +16 -0
- package/dist/doc/VJoyRatingStars/JoyRatingStars.types.ts +3 -0
- package/dist/doc/VJoyScreenLoader/VJoyScreenLoader.types.ts +1 -0
- package/dist/doc/VJoySelect/JoySelect.types.ts +3 -0
- package/dist/doc/VJoySelectableItem/VJoySelectableItem.types.ts +10 -0
- package/dist/doc/VJoySelectableItem/metadata.json +1 -1
- package/dist/doc/VJoySeparator/JoySeparator.types.ts +4 -0
- package/dist/doc/VJoySnackbar/JoySnackbar.types.ts +23 -0
- package/dist/doc/VJoySpinner/JoySpinner.types.ts +1 -0
- package/dist/doc/VJoyStep/TJoyStep.types.ts +1 -0
- package/dist/doc/VJoyTag/JoyTag.types.ts +19 -0
- package/dist/doc/VJoyTag/metadata.json +1 -0
- package/dist/doc/VJoyTagsInput/JoyTagsInput.types.ts +4 -0
- package/dist/doc/VJoyTagsInput/metadata.json +1 -0
- package/dist/doc/VJoyTagsList/JoyTagsList.types.ts +5 -0
- package/dist/doc/VJoyTagsList/metadata.json +1 -0
- package/dist/doc/VJoyTemplate/JoyTemplate.types.ts +1 -0
- package/dist/doc/VJoyText/JoyText.types.ts +14 -0
- package/dist/doc/VJoyWalkthrough/metadata.json +1 -1
- package/dist/doc/VJoyWalkthroughTrigger/metadata.json +1 -1
- package/dist/doc/VJoyWrapper/JoyWrapper.types.ts +9 -0
- package/dist/doc/index.json +44 -12
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/tools/get-component-types.d.ts +31 -0
- package/dist/tools/get-component-types.d.ts.map +1 -0
- package/dist/tools/get-component-types.js +60 -0
- package/dist/tools/get-component-types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TJoyTemplateSidebarSide = 'left' | 'right';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {PRIMARY_FONT_SIZES, SECONDARY_FONT_SIZES, PRIMARY_FONT_SIZES_BOLD, FontsFamilies} from '../../types';
|
|
2
|
+
|
|
3
|
+
const JOY_TEXT_FONT_PRIMARY_PRESET = PRIMARY_FONT_SIZES.map((s) => 'primary-' + s);
|
|
4
|
+
const JOY_TEXT_FONT_PRIMARY_BOLD_PRESET = PRIMARY_FONT_SIZES_BOLD;
|
|
5
|
+
const JOY_TEXT_FONT_SECONDARY_PRESET = SECONDARY_FONT_SIZES.map((s) => 'secondary-' + s);
|
|
6
|
+
|
|
7
|
+
export const JOY_TEXT_FONT_PRESET = [...JOY_TEXT_FONT_PRIMARY_PRESET, ...JOY_TEXT_FONT_PRIMARY_BOLD_PRESET, ...JOY_TEXT_FONT_SECONDARY_PRESET];
|
|
8
|
+
|
|
9
|
+
export type TJoyTextFontPreset =
|
|
10
|
+
| `${FontsFamilies.PRIMARY}-${(typeof PRIMARY_FONT_SIZES)[number]}`
|
|
11
|
+
| `${FontsFamilies.SECONDARY}-${(typeof SECONDARY_FONT_SIZES)[number]}`
|
|
12
|
+
| `${FontsFamilies.PRIMARY}-${(typeof PRIMARY_FONT_SIZES_BOLD)[number]}`;
|
|
13
|
+
|
|
14
|
+
export type TJoyTextTagName = 'p' | 'span' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'strong';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type TJoyWrapperJustify = 'center' | 'space-between' | 'flex-start' | 'flex-end';
|
|
2
|
+
|
|
3
|
+
export type TJoyWrapperAlign = 'center' | 'flex-start' | 'flex-end' | 'stretch';
|
|
4
|
+
|
|
5
|
+
export type TJoyWrapperDirection = 'row' | 'column';
|
|
6
|
+
|
|
7
|
+
export type TJoyWrapperWrap = 'nowrap' | 'wrap';
|
|
8
|
+
|
|
9
|
+
export type TJoyWrapperGap = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
|
package/dist/doc/index.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generated": "2026-
|
|
3
|
-
"version": "0.
|
|
2
|
+
"generated": "2026-03-05T13:53:47.737Z",
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"statistics": {
|
|
5
|
-
"totalComponents":
|
|
6
|
-
"totalProps":
|
|
7
|
-
"totalEvents":
|
|
8
|
-
"totalSlots":
|
|
9
|
-
"componentsWithVModel":
|
|
5
|
+
"totalComponents": 78,
|
|
6
|
+
"totalProps": 433,
|
|
7
|
+
"totalEvents": 62,
|
|
8
|
+
"totalSlots": 139,
|
|
9
|
+
"componentsWithVModel": 20,
|
|
10
10
|
"componentsWithErrors": 0,
|
|
11
11
|
"componentsWithPartialErrors": 1
|
|
12
12
|
},
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
{
|
|
47
47
|
"name": "VJoyBadge",
|
|
48
48
|
"path": "VJoyBadge/metadata.json",
|
|
49
|
-
"propsCount":
|
|
49
|
+
"propsCount": 3,
|
|
50
50
|
"eventsCount": 0,
|
|
51
51
|
"slotsCount": 1,
|
|
52
52
|
"hasError": false
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
{
|
|
183
183
|
"name": "VJoyDropzone",
|
|
184
184
|
"path": "VJoyDropzone/metadata.json",
|
|
185
|
-
"propsCount":
|
|
185
|
+
"propsCount": 11,
|
|
186
186
|
"eventsCount": 0,
|
|
187
187
|
"slotsCount": 4,
|
|
188
188
|
"hasError": false
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
{
|
|
207
207
|
"name": "VJoyFormError",
|
|
208
208
|
"path": "VJoyFormError/metadata.json",
|
|
209
|
-
"propsCount":
|
|
209
|
+
"propsCount": 4,
|
|
210
210
|
"eventsCount": 0,
|
|
211
211
|
"slotsCount": 1,
|
|
212
212
|
"hasError": false
|
|
@@ -219,6 +219,14 @@
|
|
|
219
219
|
"slotsCount": 0,
|
|
220
220
|
"hasError": false
|
|
221
221
|
},
|
|
222
|
+
{
|
|
223
|
+
"name": "VJoyFormGroup",
|
|
224
|
+
"path": "VJoyFormGroup/metadata.json",
|
|
225
|
+
"propsCount": 0,
|
|
226
|
+
"eventsCount": 0,
|
|
227
|
+
"slotsCount": 1,
|
|
228
|
+
"hasError": false
|
|
229
|
+
},
|
|
222
230
|
{
|
|
223
231
|
"name": "VJoyFunnel",
|
|
224
232
|
"path": "VJoyFunnel/metadata.json",
|
|
@@ -280,6 +288,22 @@
|
|
|
280
288
|
"path": "VJoyInput/metadata.json",
|
|
281
289
|
"propsCount": 19,
|
|
282
290
|
"eventsCount": 1,
|
|
291
|
+
"slotsCount": 2,
|
|
292
|
+
"hasError": false
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "VJoyInputDigit",
|
|
296
|
+
"path": "VJoyInputDigit/metadata.json",
|
|
297
|
+
"propsCount": 6,
|
|
298
|
+
"eventsCount": 4,
|
|
299
|
+
"slotsCount": 0,
|
|
300
|
+
"hasError": false
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"name": "VJoyInputPassword",
|
|
304
|
+
"path": "VJoyInputPassword/metadata.json",
|
|
305
|
+
"propsCount": 15,
|
|
306
|
+
"eventsCount": 1,
|
|
283
307
|
"slotsCount": 1,
|
|
284
308
|
"hasError": false
|
|
285
309
|
},
|
|
@@ -355,6 +379,14 @@
|
|
|
355
379
|
"slotsCount": 2,
|
|
356
380
|
"hasError": false
|
|
357
381
|
},
|
|
382
|
+
{
|
|
383
|
+
"name": "VJoyPasswordRequirement",
|
|
384
|
+
"path": "VJoyPasswordRequirement/metadata.json",
|
|
385
|
+
"propsCount": 2,
|
|
386
|
+
"eventsCount": 0,
|
|
387
|
+
"slotsCount": 0,
|
|
388
|
+
"hasError": false
|
|
389
|
+
},
|
|
358
390
|
{
|
|
359
391
|
"name": "VJoyProductTour",
|
|
360
392
|
"path": "VJoyProductTour/metadata.json",
|
|
@@ -382,7 +414,7 @@
|
|
|
382
414
|
{
|
|
383
415
|
"name": "VJoyRadio",
|
|
384
416
|
"path": "VJoyRadio/metadata.json",
|
|
385
|
-
"propsCount":
|
|
417
|
+
"propsCount": 8,
|
|
386
418
|
"eventsCount": 1,
|
|
387
419
|
"slotsCount": 5,
|
|
388
420
|
"hasError": false
|
|
@@ -390,7 +422,7 @@
|
|
|
390
422
|
{
|
|
391
423
|
"name": "VJoyRadioGroup",
|
|
392
424
|
"path": "VJoyRadioGroup/metadata.json",
|
|
393
|
-
"propsCount":
|
|
425
|
+
"propsCount": 4,
|
|
394
426
|
"eventsCount": 0,
|
|
395
427
|
"slotsCount": 2,
|
|
396
428
|
"hasError": false
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { listComponentsTool, handleListComponents } from './tools/list-component
|
|
|
9
9
|
import { getComponentInfoTool, handleGetComponentInfo } from './tools/get-component-info.js';
|
|
10
10
|
import { listDesignTokensTool, handleListDesignTokens } from './tools/list-design-tokens.js';
|
|
11
11
|
import { listCssClassesTool, handleListCssClasses } from './tools/list-css-classes.js';
|
|
12
|
+
import { getComponentTypesTool, handleGetComponentTypes } from './tools/get-component-types.js';
|
|
12
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
14
|
const __dirname = dirname(__filename);
|
|
14
15
|
/**
|
|
@@ -20,7 +21,7 @@ class JoyMcpServer {
|
|
|
20
21
|
constructor() {
|
|
21
22
|
this.server = new Server({
|
|
22
23
|
name: 'joy-design-system',
|
|
23
|
-
version: '0.
|
|
24
|
+
version: '0.2.0',
|
|
24
25
|
}, {
|
|
25
26
|
capabilities: {
|
|
26
27
|
tools: {},
|
|
@@ -33,7 +34,7 @@ class JoyMcpServer {
|
|
|
33
34
|
// List available tools
|
|
34
35
|
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
35
36
|
return {
|
|
36
|
-
tools: [listComponentsTool, getComponentInfoTool, listDesignTokensTool, listCssClassesTool],
|
|
37
|
+
tools: [listComponentsTool, getComponentInfoTool, getComponentTypesTool, listDesignTokensTool, listCssClassesTool],
|
|
37
38
|
};
|
|
38
39
|
});
|
|
39
40
|
// Handle tool calls
|
|
@@ -64,6 +65,18 @@ class JoyMcpServer {
|
|
|
64
65
|
],
|
|
65
66
|
};
|
|
66
67
|
}
|
|
68
|
+
case 'joy_get_component_types': {
|
|
69
|
+
const componentName = args?.componentName;
|
|
70
|
+
const result = await handleGetComponentTypes(componentName);
|
|
71
|
+
return {
|
|
72
|
+
content: [
|
|
73
|
+
{
|
|
74
|
+
type: 'text',
|
|
75
|
+
text: JSON.stringify(result, null, 2),
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
67
80
|
case 'joy_list_design_tokens': {
|
|
68
81
|
const result = handleListDesignTokens();
|
|
69
82
|
return {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC7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ting TypeScript types associated with a Joy Vue component
|
|
3
|
+
*/
|
|
4
|
+
export declare const getComponentTypesTool: {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: string;
|
|
9
|
+
properties: {
|
|
10
|
+
componentName: {
|
|
11
|
+
type: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
required: string[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export interface ComponentTypesResult {
|
|
19
|
+
componentName: string;
|
|
20
|
+
files: {
|
|
21
|
+
filename: string;
|
|
22
|
+
content: string;
|
|
23
|
+
}[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Handler for the get component types tool
|
|
27
|
+
*/
|
|
28
|
+
export declare function handleGetComponentTypes(componentName: string): Promise<ComponentTypesResult | {
|
|
29
|
+
error: string;
|
|
30
|
+
}>;
|
|
31
|
+
//# sourceMappingURL=get-component-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-component-types.d.ts","sourceRoot":"","sources":["../../src/tools/get-component-types.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;CAgBjC,CAAC;AAcF,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAChD;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,oBAAoB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAwBnD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { readFileSync, readdirSync } from 'fs';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import { dirname, join } from 'path';
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = dirname(__filename);
|
|
6
|
+
/**
|
|
7
|
+
* Tool definition for getting TypeScript types associated with a Joy Vue component
|
|
8
|
+
*/
|
|
9
|
+
export const getComponentTypesTool = {
|
|
10
|
+
name: 'joy_get_component_types',
|
|
11
|
+
description: 'Retrieves the TypeScript types definition file associated with a specific Joy Vue3 component. ' +
|
|
12
|
+
'These types define the allowed values for props (variants, sizes, etc.). ' +
|
|
13
|
+
'Provide the exact component name (e.g., VJoyButton).',
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
componentName: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'The exact name of the component (e.g., VJoyButton, VJoyAvatar)',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
required: ['componentName'],
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Find all *.types.ts files in a component doc directory.
|
|
27
|
+
*/
|
|
28
|
+
function findTypesFiles(componentDir) {
|
|
29
|
+
try {
|
|
30
|
+
const entries = readdirSync(componentDir);
|
|
31
|
+
return entries.filter((f) => f.endsWith('.types.ts'));
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Handler for the get component types tool
|
|
39
|
+
*/
|
|
40
|
+
export async function handleGetComponentTypes(componentName) {
|
|
41
|
+
if (!componentName || typeof componentName !== 'string') {
|
|
42
|
+
return {
|
|
43
|
+
error: 'Invalid component name. Please provide a valid component name (e.g., VJoyButton).',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const componentDir = join(__dirname, '..', 'doc', componentName);
|
|
47
|
+
const typesFiles = findTypesFiles(componentDir);
|
|
48
|
+
if (typesFiles.length === 0) {
|
|
49
|
+
return {
|
|
50
|
+
error: `No types file found for component "${componentName}". ` +
|
|
51
|
+
'Use joy_list_components to get a list of available components.',
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const files = typesFiles.map((filename) => ({
|
|
55
|
+
filename,
|
|
56
|
+
content: readFileSync(join(componentDir, filename), 'utf-8'),
|
|
57
|
+
}));
|
|
58
|
+
return { componentName, files };
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=get-component-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-component-types.js","sourceRoot":"","sources":["../../src/tools/get-component-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAErC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EACT,gGAAgG;QAChG,2EAA2E;QAC3E,sDAAsD;IACxD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gEAAgE;aAC9E;SACF;QACD,QAAQ,EAAE,CAAC,eAAe,CAAC;KAC5B;CACF,CAAC;AAEF;;GAEG;AACH,SAAS,cAAc,CAAC,YAAoB;IAC1C,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;QAC1C,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;IACxD,CAAC;IAA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