@mgdis/core-ui-helpers 1.2.2 → 1.3.0

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 (149) hide show
  1. package/dist/angular/index.cjs +27 -0
  2. package/dist/angular/index.cjs.map +1 -0
  3. package/dist/angular/index.d.ts +21 -0
  4. package/dist/angular/index.js +25 -0
  5. package/dist/angular/index.js.map +1 -0
  6. package/dist/angular/index.umd.js +33 -0
  7. package/dist/angular/index.umd.js.map +1 -0
  8. package/dist/locale/index.cjs +190 -0
  9. package/dist/locale/index.cjs.map +1 -0
  10. package/dist/locale/index.d.ts +110 -0
  11. package/dist/locale/index.js +181 -0
  12. package/dist/locale/index.js.map +1 -0
  13. package/dist/locale/index.umd.js +196 -0
  14. package/dist/locale/index.umd.js.map +1 -0
  15. package/dist/playwright/index.cjs +137 -0
  16. package/dist/playwright/index.cjs.map +1 -0
  17. package/dist/playwright/index.d.ts +39 -0
  18. package/dist/playwright/index.js +133 -0
  19. package/dist/playwright/index.js.map +1 -0
  20. package/dist/playwright/index.umd.js +143 -0
  21. package/dist/playwright/index.umd.js.map +1 -0
  22. package/dist/stencil/index.cjs +363 -0
  23. package/dist/stencil/index.cjs.map +1 -0
  24. package/dist/stencil/index.d.ts +222 -0
  25. package/dist/stencil/index.js +357 -0
  26. package/dist/stencil/index.js.map +1 -0
  27. package/dist/stencil/index.umd.js +369 -0
  28. package/dist/stencil/index.umd.js.map +1 -0
  29. package/dist/storybook/index.cjs +2335 -0
  30. package/dist/storybook/index.cjs.map +1 -0
  31. package/dist/storybook/index.d.ts +85 -0
  32. package/dist/storybook/index.js +2329 -0
  33. package/dist/storybook/index.js.map +1 -0
  34. package/dist/storybook/index.umd.js +2341 -0
  35. package/dist/storybook/index.umd.js.map +1 -0
  36. package/dist/tests/index.cjs +315 -0
  37. package/dist/tests/index.cjs.map +1 -0
  38. package/dist/tests/index.d.ts +100 -0
  39. package/dist/tests/index.js +309 -0
  40. package/dist/tests/index.js.map +1 -0
  41. package/dist/tests/index.umd.js +321 -0
  42. package/dist/tests/index.umd.js.map +1 -0
  43. package/dist/utils/index.cjs +441 -0
  44. package/dist/utils/index.cjs.map +1 -0
  45. package/dist/utils/index.d.ts +265 -0
  46. package/dist/utils/index.js +417 -0
  47. package/dist/utils/index.js.map +1 -0
  48. package/dist/utils/index.umd.js +447 -0
  49. package/dist/utils/index.umd.js.map +1 -0
  50. package/dist/vue/index.cjs +1935 -0
  51. package/dist/vue/index.cjs.map +1 -0
  52. package/dist/vue/index.d.ts +35 -0
  53. package/dist/vue/index.js +1933 -0
  54. package/dist/vue/index.js.map +1 -0
  55. package/dist/vue/index.umd.js +1941 -0
  56. package/dist/vue/index.umd.js.map +1 -0
  57. package/package.json +4 -1
  58. package/CHANGELOG.md +0 -101
  59. package/json-doc.test.json +0 -264
  60. package/rollup.config.mjs +0 -61
  61. package/src/angular/index.spec.ts +0 -8
  62. package/src/angular/index.ts +0 -1
  63. package/src/angular/mg-angular-logger/index.ts +0 -1
  64. package/src/angular/mg-angular-logger/mg-angular-logger.conf.ts +0 -3
  65. package/src/angular/mg-angular-logger/mg-angular-logger.spec.ts +0 -40
  66. package/src/angular/mg-angular-logger/mg-angular-logger.ts +0 -24
  67. package/src/locale/index.spec.ts +0 -24
  68. package/src/locale/index.ts +0 -1
  69. package/src/locale/locale.spec.ts +0 -291
  70. package/src/locale/locale.ts +0 -201
  71. package/src/playwright/config/index.ts +0 -43
  72. package/src/playwright/index.spec.ts +0 -16
  73. package/src/playwright/index.ts +0 -4
  74. package/src/playwright/utils/__snapshots__/utils.spec.ts.snap +0 -48
  75. package/src/playwright/utils/index.ts +0 -1
  76. package/src/playwright/utils/utils.spec.ts +0 -50
  77. package/src/playwright/utils/utils.ts +0 -77
  78. package/src/stencil/ide/__snapshots__/cem.spec.ts.snap +0 -248
  79. package/src/stencil/ide/__snapshots__/ide.spec.ts.snap +0 -414
  80. package/src/stencil/ide/cem.spec.ts +0 -35
  81. package/src/stencil/ide/cem.ts +0 -96
  82. package/src/stencil/ide/ide.spec.ts +0 -29
  83. package/src/stencil/ide/ide.ts +0 -221
  84. package/src/stencil/ide/index.ts +0 -2
  85. package/src/stencil/index.spec.ts +0 -16
  86. package/src/stencil/index.ts +0 -2
  87. package/src/stencil/normalize-boolean-attributes/index.ts +0 -1
  88. package/src/stencil/normalize-boolean-attributes/normalize-boolean-attributes.spec.ts +0 -63
  89. package/src/stencil/normalize-boolean-attributes/normalize-boolean-attributes.ts +0 -40
  90. package/src/storybook/index.spec.ts +0 -19
  91. package/src/storybook/index.ts +0 -1
  92. package/src/storybook/stencil/__snapshots__/stencil.spec.ts.snap +0 -329
  93. package/src/storybook/stencil/index.ts +0 -1
  94. package/src/storybook/stencil/stencil-shim.d.ts +0 -1
  95. package/src/storybook/stencil/stencil.conf.ts +0 -4
  96. package/src/storybook/stencil/stencil.spec.ts +0 -170
  97. package/src/storybook/stencil/stencil.ts +0 -377
  98. package/src/tests/index.spec.ts +0 -20
  99. package/src/tests/index.ts +0 -1
  100. package/src/tests/unit/__snapshots__/unit.spec.ts.snap +0 -52
  101. package/src/tests/unit/index.ts +0 -1
  102. package/src/tests/unit/unit.conf.ts +0 -16
  103. package/src/tests/unit/unit.spec.ts +0 -206
  104. package/src/tests/unit/unit.ts +0 -333
  105. package/src/utils/attributes/class-list/class-list.spec.ts +0 -36
  106. package/src/utils/attributes/class-list/class-list.ts +0 -51
  107. package/src/utils/attributes/class-list/index.ts +0 -1
  108. package/src/utils/attributes/id/id.spec.ts +0 -54
  109. package/src/utils/attributes/id/id.ts +0 -47
  110. package/src/utils/attributes/id/index.ts +0 -1
  111. package/src/utils/attributes/index.ts +0 -3
  112. package/src/utils/attributes/to-kebab-case/index.ts +0 -1
  113. package/src/utils/attributes/to-kebab-case/to-kebab-case.spec.ts +0 -29
  114. package/src/utils/attributes/to-kebab-case/to-kebab-case.ts +0 -23
  115. package/src/utils/components/__snapshots__/components.spec.ts.snap +0 -313
  116. package/src/utils/components/components.conf.ts +0 -11
  117. package/src/utils/components/components.spec.ts +0 -192
  118. package/src/utils/components/components.ts +0 -152
  119. package/src/utils/components/index.ts +0 -2
  120. package/src/utils/date/date.spec.ts +0 -12
  121. package/src/utils/date/date.ts +0 -20
  122. package/src/utils/date/index.ts +0 -1
  123. package/src/utils/elements/elements.spec.ts +0 -17
  124. package/src/utils/elements/elements.ts +0 -18
  125. package/src/utils/elements/index.ts +0 -1
  126. package/src/utils/index.spec.ts +0 -84
  127. package/src/utils/index.ts +0 -8
  128. package/src/utils/number/index.ts +0 -1
  129. package/src/utils/number/number.spec.ts +0 -14
  130. package/src/utils/number/number.ts +0 -6
  131. package/src/utils/object/index.ts +0 -2
  132. package/src/utils/object/object.conf.ts +0 -4
  133. package/src/utils/object/object.spec.ts +0 -110
  134. package/src/utils/object/object.ts +0 -27
  135. package/src/utils/string/index.ts +0 -1
  136. package/src/utils/string/string.spec.ts +0 -54
  137. package/src/utils/string/string.ts +0 -39
  138. package/src/utils/windows/index.ts +0 -1
  139. package/src/utils/windows/windows.spec.ts +0 -69
  140. package/src/utils/windows/windows.ts +0 -50
  141. package/src/vue/index.spec.ts +0 -8
  142. package/src/vue/index.ts +0 -1
  143. package/src/vue/mg-model/index.ts +0 -1
  144. package/src/vue/mg-model/mg-model.conf.ts +0 -6
  145. package/src/vue/mg-model/mg-model.spec.ts +0 -50
  146. package/src/vue/mg-model/mg-model.ts +0 -55
  147. package/tsconfig.json +0 -17
  148. package/typedoc.json +0 -14
  149. package/vitest.config.mts +0 -13
@@ -1,414 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`ide > vsCodeCssGenerator > Should generate VScode CSS custom data 1`] = `
4
- {
5
- "properties": [
6
- {
7
- "description": "Custom property documentation",
8
- "name": "--custom-property",
9
- },
10
- ],
11
- "version": 1.1,
12
- }
13
- `;
14
-
15
- exports[`ide > vsCodeGenerator > Should generate VScode HTML custom data 1`] = `
16
- {
17
- "globalAttributes": [],
18
- "tags": [
19
- {
20
- "attributes": [
21
- {
22
- "description": "docs
23
-
24
- Type: \`string\`",
25
- "name": "prop",
26
- "references": [
27
- {
28
- "name": "Storybook",
29
- "url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
30
- },
31
- {
32
- "name": "Sources",
33
- "url": "http://sources.test/src/components/atoms/my-comp/my-comp.tsx",
34
- },
35
- ],
36
- "values": undefined,
37
- },
38
- {
39
- "description": "docs
40
-
41
- Type: \`(string | number)[]\`",
42
- "name": "multionetype",
43
- "references": [
44
- {
45
- "name": "Storybook",
46
- "url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
47
- },
48
- {
49
- "name": "Sources",
50
- "url": "http://sources.test/src/components/atoms/my-comp/my-comp.tsx",
51
- },
52
- ],
53
- "values": undefined,
54
- },
55
- {
56
- "description": "docs
57
-
58
- Type: \`number\`",
59
- "name": "number",
60
- "references": [
61
- {
62
- "name": "Storybook",
63
- "url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
64
- },
65
- {
66
- "name": "Sources",
67
- "url": "http://sources.test/src/components/atoms/my-comp/my-comp.tsx",
68
- },
69
- ],
70
- "values": undefined,
71
- },
72
- {
73
- "description": "docs
74
-
75
- Type: \`boolean\`",
76
- "name": "boolean",
77
- "references": [
78
- {
79
- "name": "Storybook",
80
- "url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
81
- },
82
- {
83
- "name": "Sources",
84
- "url": "http://sources.test/src/components/atoms/my-comp/my-comp.tsx",
85
- },
86
- ],
87
- "values": undefined,
88
- },
89
- {
90
- "description": "docs
91
-
92
- Type: \`{ type: string, value: "blu" | "bli" }\`",
93
- "name": "objecttype",
94
- "references": [
95
- {
96
- "name": "Storybook",
97
- "url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
98
- },
99
- {
100
- "name": "Sources",
101
- "url": "http://sources.test/src/components/atoms/my-comp/my-comp.tsx",
102
- },
103
- ],
104
- "values": undefined,
105
- },
106
- {
107
- "description": "docs
108
-
109
- Type: \`"blu" | "bli"\`",
110
- "name": "multitype",
111
- "references": [
112
- {
113
- "name": "Storybook",
114
- "url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
115
- },
116
- {
117
- "name": "Sources",
118
- "url": "http://sources.test/src/components/atoms/my-comp/my-comp.tsx",
119
- },
120
- ],
121
- "values": [
122
- {
123
- "name": "blu",
124
- },
125
- {
126
- "name": "bli",
127
- },
128
- ],
129
- },
130
- {
131
- "description": "docs
132
-
133
- Type: \`number | string\`",
134
- "name": "multitypewithstring",
135
- "references": [
136
- {
137
- "name": "Storybook",
138
- "url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
139
- },
140
- {
141
- "name": "Sources",
142
- "url": "http://sources.test/src/components/atoms/my-comp/my-comp.tsx",
143
- },
144
- ],
145
- "values": undefined,
146
- },
147
- {
148
- "description": "docs
149
-
150
- Type: \`number[] | string[]\`",
151
- "name": "arraytypes",
152
- "references": [
153
- {
154
- "name": "Storybook",
155
- "url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
156
- },
157
- {
158
- "name": "Sources",
159
- "url": "http://sources.test/src/components/atoms/my-comp/my-comp.tsx",
160
- },
161
- ],
162
- "values": undefined,
163
- },
164
- ],
165
- "description": "Attributes:
166
- - \`prop\`: docs
167
- - \`multionetype\`: docs
168
- - \`number\`: docs
169
- - \`boolean\`: docs
170
- - \`objecttype\`: docs
171
- - \`multitype\`: docs
172
- - \`multitypewithstring\`: docs
173
- - \`arraytypes\`: docs
174
-
175
- Properties:
176
- - \`attr\`: docs
177
-
178
- Methods:
179
- - \`method\`: docs
180
-
181
- Events:
182
- - \`event\`: docs
183
-
184
- Listeners:
185
- - \`keydown\`
186
-
187
- Slots:
188
- - default:
189
- - \`title\`:
190
-
191
- ",
192
- "name": "my-comp",
193
- "references": [
194
- {
195
- "name": "Storybook",
196
- "url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
197
- },
198
- {
199
- "name": "Sources",
200
- "url": "http://sources.test/src/components/atoms/my-comp/my-comp.tsx",
201
- },
202
- ],
203
- },
204
- {
205
- "attributes": [],
206
- "description": "overview
207
-
208
- ",
209
- "name": "my-second-comp",
210
- "references": [
211
- {
212
- "name": "Storybook",
213
- "url": undefined,
214
- },
215
- {
216
- "name": "Sources",
217
- "url": undefined,
218
- },
219
- ],
220
- },
221
- ],
222
- "valueSets": [],
223
- "version": 1.1,
224
- }
225
- `;
226
-
227
- exports[`ide > webTypesGenerator > Should generate web types 1`] = `
228
- {
229
- "$schema": "https://json.schemastore.org/web-types",
230
- "contributions": {
231
- "html": {
232
- "elements": [
233
- {
234
- "attributes": [
235
- {
236
- "description": "docs
237
-
238
- Type: \`string\`",
239
- "doc-url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
240
- "name": "prop",
241
- "value": {
242
- "default": undefined,
243
- "required": true,
244
- "type": "string",
245
- },
246
- },
247
- {
248
- "description": "docs
249
-
250
- Type: \`(string | number)[]\`",
251
- "doc-url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
252
- "name": "multionetype",
253
- "value": {
254
- "default": undefined,
255
- "required": true,
256
- "type": "(string | number)[]",
257
- },
258
- },
259
- {
260
- "description": "docs
261
-
262
- Type: \`number\`",
263
- "doc-url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
264
- "name": "number",
265
- "value": {
266
- "default": undefined,
267
- "required": true,
268
- "type": "number",
269
- },
270
- },
271
- {
272
- "description": "docs
273
-
274
- Type: \`boolean\`",
275
- "doc-url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
276
- "name": "boolean",
277
- "value": {
278
- "default": "false",
279
- "required": true,
280
- "type": "boolean",
281
- },
282
- },
283
- {
284
- "description": "docs
285
-
286
- Type: \`{ type: string, value: "blu" | "bli" }\`",
287
- "doc-url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
288
- "name": "objecttype",
289
- "value": {
290
- "default": undefined,
291
- "required": true,
292
- "type": "{ type: string, value: "blu" | "bli" }",
293
- },
294
- },
295
- {
296
- "description": "docs
297
-
298
- Type: \`"blu" | "bli"\`",
299
- "doc-url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
300
- "name": "multitype",
301
- "value": {
302
- "default": undefined,
303
- "required": true,
304
- "type": ""blu" | "bli"",
305
- },
306
- },
307
- {
308
- "description": "docs
309
-
310
- Type: \`number | string\`",
311
- "doc-url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
312
- "name": "multitypewithstring",
313
- "value": {
314
- "default": undefined,
315
- "required": true,
316
- "type": "number | string",
317
- },
318
- },
319
- {
320
- "description": "docs
321
-
322
- Type: \`number[] | string[]\`",
323
- "doc-url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
324
- "name": "arraytypes",
325
- "value": {
326
- "default": undefined,
327
- "required": true,
328
- "type": "number[] | string[]",
329
- },
330
- },
331
- ],
332
- "css": {
333
- "properties": [
334
- {
335
- "description": "Custom property documentation",
336
- "name": "--custom-property",
337
- },
338
- ],
339
- },
340
- "description": "Attributes:
341
- - \`prop\`: docs
342
- - \`multionetype\`: docs
343
- - \`number\`: docs
344
- - \`boolean\`: docs
345
- - \`objecttype\`: docs
346
- - \`multitype\`: docs
347
- - \`multitypewithstring\`: docs
348
- - \`arraytypes\`: docs
349
-
350
- Properties:
351
- - \`attr\`: docs
352
-
353
- Methods:
354
- - \`method\`: docs
355
-
356
- Events:
357
- - \`event\`: docs
358
-
359
- Listeners:
360
- - \`keydown\`
361
-
362
- Slots:
363
- - default:
364
- - \`title\`:
365
-
366
- ",
367
- "doc-url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
368
- "js": {
369
- "events": [
370
- {
371
- "description": "docs",
372
- "name": "event",
373
- },
374
- ],
375
- "properties": [
376
- {
377
- "description": "docs
378
-
379
- Type: \`string\`",
380
- "doc-url": "http://sb.test/?path=/docs/atoms-my-comp--docs",
381
- "name": "attr",
382
- "value": {
383
- "default": undefined,
384
- "required": true,
385
- "type": "string",
386
- },
387
- },
388
- ],
389
- },
390
- "name": "my-comp",
391
- },
392
- {
393
- "attributes": [],
394
- "css": {
395
- "properties": [],
396
- },
397
- "description": "overview
398
-
399
- ",
400
- "doc-url": undefined,
401
- "js": {
402
- "events": [],
403
- "properties": [],
404
- },
405
- "name": "my-second-comp",
406
- },
407
- ],
408
- },
409
- },
410
- "description-markup": "markdown",
411
- "name": "test",
412
- "version": "1.0.0",
413
- }
414
- `;
@@ -1,35 +0,0 @@
1
- import { describe, expect, test, vi } from 'vitest';
2
- import { cemGenerator } from '.';
3
- import { JsonDocs } from '@stencil/core/internal';
4
- import jsonDocs from '../../../json-doc.test.json';
5
-
6
- vi.mock('@stencil/core/internal/client', () => ({
7
- renderVdom: vi.fn(),
8
- }));
9
-
10
- describe('cemGenerator', () => {
11
- test('Should generate Custom Elements Manifest v2', () => {
12
- const cem = cemGenerator(jsonDocs as JsonDocs);
13
- expect(cem).toMatchSnapshot();
14
- });
15
-
16
- test('Should map attribute-backed props to both attributes and members', () => {
17
- const cem = cemGenerator(jsonDocs as JsonDocs);
18
- const decl = cem.modules[0].declarations[0];
19
- const attrBackedProp = decl.attributes.find((a) => a.name === 'prop');
20
- expect(attrBackedProp).toBeDefined();
21
- expect(attrBackedProp?.fieldName).toBe('prop');
22
- const member = decl.members.find((m) => m.kind === 'field' && m.name === 'prop');
23
- expect(member).toBeDefined();
24
- expect((member as { attribute?: string }).attribute).toBe('prop');
25
- });
26
-
27
- test('Should map JS-only props to members only (not attributes)', () => {
28
- const cem = cemGenerator(jsonDocs as JsonDocs);
29
- const decl = cem.modules[0].declarations[0];
30
- expect(decl.attributes.find((a) => a.name === 'attr')).toBeUndefined();
31
- const member = decl.members.find((m) => m.kind === 'field' && m.name === 'attr');
32
- expect(member).toBeDefined();
33
- expect((member as { attribute?: string }).attribute).toBeUndefined();
34
- });
35
- });
@@ -1,96 +0,0 @@
1
- import type { JsonDocs, JsonDocsComponent } from '@stencil/core/internal';
2
-
3
- /**
4
- * Convert a Stencil component's JsonDocs into a CEM v2 module entry.
5
- * @param component - Stencil component doc
6
- * @returns CEM module
7
- */
8
- const componentToModule = (component: JsonDocsComponent) => {
9
- const className = component.tag
10
- .split('-')
11
- .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
12
- .join('');
13
-
14
- const attributes = component.props
15
- .filter((prop) => prop.attr !== undefined)
16
- .map((prop) => ({
17
- name: prop.attr,
18
- description: prop.docs,
19
- type: { text: prop.type },
20
- ...(prop.default !== undefined && { default: prop.default }),
21
- fieldName: prop.name,
22
- }));
23
-
24
- const fieldMembers = component.props.map((prop) => ({
25
- kind: 'field' as const,
26
- name: prop.name,
27
- description: prop.docs,
28
- type: { text: prop.type },
29
- ...(prop.default !== undefined && { default: prop.default }),
30
- ...(prop.attr !== undefined && { attribute: prop.attr }),
31
- }));
32
-
33
- const methodMembers = component.methods.map((method) => ({
34
- kind: 'method' as const,
35
- name: method.name,
36
- description: method.docs,
37
- }));
38
-
39
- return {
40
- kind: 'javascript-module' as const,
41
- path: component.filePath ?? '',
42
- declarations: [
43
- {
44
- kind: 'class' as const,
45
- name: className,
46
- tagName: component.tag,
47
- customElement: true,
48
- description: component.overview ?? '',
49
- attributes,
50
- members: [...fieldMembers, ...methodMembers],
51
- events: component.events.map((event) => ({
52
- name: event.event,
53
- description: event.docs,
54
- type: { text: `CustomEvent<${event.detail}>` },
55
- })),
56
- slots: component.slots.map((slot) => ({
57
- name: slot.name,
58
- description: slot.docs,
59
- })),
60
- cssProperties: component.styles.map((style) => ({
61
- name: style.name,
62
- description: style.docs,
63
- })),
64
- cssParts: component.parts.map((part) => ({
65
- name: part.name,
66
- description: part.docs,
67
- })),
68
- },
69
- ],
70
- exports: [
71
- {
72
- kind: 'custom-element-definition' as const,
73
- name: component.tag,
74
- declaration: {
75
- name: className,
76
- module: component.filePath ?? '',
77
- },
78
- },
79
- ],
80
- };
81
- };
82
-
83
- /**
84
- * Generate a Custom Elements Manifest v2 from Stencil JSON docs.
85
- * @param jsonDocs - Stencil JSON doc
86
- * @returns CEM v2
87
- * @example
88
- * ```ts
89
- * const cem = cemGenerator(jsonDocs);
90
- * ```
91
- */
92
- export const cemGenerator = (jsonDocs: JsonDocs) => ({
93
- schemaVersion: '2.0.0',
94
- readme: '',
95
- modules: jsonDocs.components.map(componentToModule),
96
- });
@@ -1,29 +0,0 @@
1
- import { describe, expect, test, vi } from 'vitest';
2
- import { webTypesGenerator, vsCodeGenerator, vsCodeCssGenerator } from '.';
3
- import { JsonDocs } from '@stencil/core/internal';
4
- import jsonDocs from '../../../json-doc.test.json';
5
-
6
- vi.mock('@stencil/core/internal/client', () => ({
7
- renderVdom: vi.fn(),
8
- }));
9
-
10
- describe('ide', () => {
11
- describe('webTypesGenerator', () => {
12
- test('Should generate web types', () => {
13
- const webTypes = webTypesGenerator('test', '1.0.0', jsonDocs as JsonDocs, 'http://sb.test/?path=/docs/');
14
- expect(webTypes).toMatchSnapshot();
15
- });
16
- });
17
- describe('vsCodeGenerator', () => {
18
- test('Should generate VScode HTML custom data', () => {
19
- const customData = vsCodeGenerator(jsonDocs as JsonDocs, 'http://sb.test/?path=/docs/', 'http://sources.test/');
20
- expect(customData).toMatchSnapshot();
21
- });
22
- });
23
- describe('vsCodeCssGenerator', () => {
24
- test('Should generate VScode CSS custom data', () => {
25
- const customData = vsCodeCssGenerator(jsonDocs as JsonDocs);
26
- expect(customData).toMatchSnapshot();
27
- });
28
- });
29
- });