@likec4/generators 1.2.0 → 1.2.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.
Files changed (43) hide show
  1. package/dist/__mocks__/data.d.ts +5 -0
  2. package/dist/__mocks__/data.d.ts.map +1 -0
  3. package/dist/__mocks__/data.js +456 -0
  4. package/dist/d2/generate-d2.d.ts +1 -0
  5. package/dist/d2/generate-d2.d.ts.map +1 -0
  6. package/dist/d2/generate-d2.spec.d.ts +2 -0
  7. package/dist/d2/generate-d2.spec.d.ts.map +1 -0
  8. package/dist/d2/generate-d2.spec.js +12 -0
  9. package/dist/d2/index.d.ts +1 -0
  10. package/dist/d2/index.d.ts.map +1 -0
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/mmd/generate-mmd.d.ts +1 -0
  14. package/dist/mmd/generate-mmd.d.ts.map +1 -0
  15. package/dist/mmd/generate-mmd.spec.d.ts +2 -0
  16. package/dist/mmd/generate-mmd.spec.d.ts.map +1 -0
  17. package/dist/mmd/generate-mmd.spec.js +12 -0
  18. package/dist/mmd/index.d.ts +1 -0
  19. package/dist/mmd/index.d.ts.map +1 -0
  20. package/dist/react/generate-react.d.ts +1 -0
  21. package/dist/react/generate-react.d.ts.map +1 -0
  22. package/dist/react/generate-react.spec.d.ts +2 -0
  23. package/dist/react/generate-react.spec.d.ts.map +1 -0
  24. package/dist/react/generate-react.spec.js +6 -0
  25. package/dist/react/index.d.ts +1 -0
  26. package/dist/react/index.d.ts.map +1 -0
  27. package/dist/react-next/generate-react-next.d.ts +1 -0
  28. package/dist/react-next/generate-react-next.d.ts.map +1 -0
  29. package/dist/react-next/generate-react-next.spec.d.ts +2 -0
  30. package/dist/react-next/generate-react-next.spec.d.ts.map +1 -0
  31. package/dist/react-next/generate-react-next.spec.js +9 -0
  32. package/dist/react-next/index.d.ts +1 -0
  33. package/dist/react-next/index.d.ts.map +1 -0
  34. package/dist/views-data-ts/generate-views-data.d.ts +1 -0
  35. package/dist/views-data-ts/generate-views-data.d.ts.map +1 -0
  36. package/dist/views-data-ts/generate-views-data.spec.d.ts +2 -0
  37. package/dist/views-data-ts/generate-views-data.spec.d.ts.map +1 -0
  38. package/dist/views-data-ts/generate-views-data.spec.js +12 -0
  39. package/dist/views-data-ts/generateViewId.d.ts +1 -0
  40. package/dist/views-data-ts/generateViewId.d.ts.map +1 -0
  41. package/dist/views-data-ts/index.d.ts +1 -0
  42. package/dist/views-data-ts/index.d.ts.map +1 -0
  43. package/package.json +6 -6
@@ -0,0 +1,5 @@
1
+ import type { ComputedView, DiagramView } from '@likec4/core';
2
+ export declare const fakeDiagram: DiagramView;
3
+ export declare const fakeDiagram2: DiagramView;
4
+ export declare const fakeComputedView3Levels: ComputedView;
5
+ //# sourceMappingURL=data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/__mocks__/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE7D,eAAO,MAAM,WAAW,EAAE,WAiMlB,CAAA;AAER,eAAO,MAAM,YAAY,EAAE,WA8GnB,CAAA;AAER,eAAO,MAAM,uBAAuB,EAAE,YAsJ9B,CAAA"}
@@ -0,0 +1,456 @@
1
+ export const fakeDiagram = {
2
+ edges: [
3
+ {
4
+ headArrow: [
5
+ [294, 487],
6
+ [291, 496],
7
+ [288, 487]
8
+ ],
9
+ id: 'cloud.frontend:cloud.backend',
10
+ label: 'requests',
11
+ labelBox: {
12
+ align: 'left',
13
+ width: 62,
14
+ x: 295,
15
+ y: 459
16
+ },
17
+ points: [
18
+ [291, 406],
19
+ [291, 432],
20
+ [291, 461],
21
+ [291, 487]
22
+ ],
23
+ relations: [
24
+ 'cloud.frontend.dashboard:cloud.backend.graphql',
25
+ 'cloud.frontend.adminPanel:cloud.backend.graphql'
26
+ ],
27
+ source: 'cloud.frontend',
28
+ target: 'cloud.backend'
29
+ },
30
+ {
31
+ headArrow: [
32
+ [294, 701],
33
+ [291, 711],
34
+ [288, 701]
35
+ ],
36
+ id: 'cloud.backend:amazon',
37
+ label: null,
38
+ labelBox: null,
39
+ points: [
40
+ [291, 641],
41
+ [291, 660],
42
+ [291, 681],
43
+ [291, 702]
44
+ ],
45
+ relations: ['cloud.backend.storage:amazon.s3'],
46
+ source: 'cloud.backend',
47
+ target: 'amazon'
48
+ },
49
+ {
50
+ headArrow: [
51
+ [344, 257],
52
+ [336, 263],
53
+ [338, 253]
54
+ ],
55
+ id: 'support:cloud.frontend',
56
+ label: null,
57
+ labelBox: null,
58
+ points: [
59
+ [413, 141],
60
+ [391, 176],
61
+ [364, 218],
62
+ [342, 255]
63
+ ],
64
+ relations: ['support:cloud.frontend.adminPanel'],
65
+ source: 'support',
66
+ target: 'cloud.frontend'
67
+ },
68
+ {
69
+ headArrow: [
70
+ [244, 253],
71
+ [246, 263],
72
+ [239, 257]
73
+ ],
74
+ id: 'customer:cloud.frontend',
75
+ label: 'opens',
76
+ labelBox: {
77
+ align: 'left',
78
+ width: 44,
79
+ x: 208,
80
+ y: 193
81
+ },
82
+ points: [
83
+ [169, 141],
84
+ [191, 176],
85
+ [218, 218],
86
+ [241, 255]
87
+ ],
88
+ relations: ['customer:cloud.frontend.dashboard'],
89
+ source: 'customer',
90
+ target: 'cloud.frontend'
91
+ }
92
+ ],
93
+ height: 855,
94
+ id: 'fakeView',
95
+ nodes: [
96
+ {
97
+ children: [],
98
+ color: 'primary',
99
+ id: 'amazon',
100
+ parent: null,
101
+ position: [165, 715],
102
+ relative: [165, 715],
103
+ shape: 'rectangle',
104
+ size: {
105
+ height: 140,
106
+ width: 251
107
+ },
108
+ title: 'amazon'
109
+ },
110
+ {
111
+ children: ['cloud.backend', 'cloud.frontend'],
112
+ color: 'primary',
113
+ id: 'cloud',
114
+ parent: null,
115
+ position: [139, 210],
116
+ relative: [139, 210],
117
+ shape: 'rectangle',
118
+ size: {
119
+ height: 457,
120
+ width: 304
121
+ },
122
+ title: 'cloud'
123
+ },
124
+ {
125
+ children: [],
126
+ color: 'primary',
127
+ id: 'customer',
128
+ parent: null,
129
+ position: [0, 0],
130
+ relative: [0, 0],
131
+ shape: 'rectangle',
132
+ size: {
133
+ height: 140,
134
+ width: 251
135
+ },
136
+ title: 'customer'
137
+ },
138
+ {
139
+ children: [],
140
+ color: 'primary',
141
+ id: 'support',
142
+ parent: null,
143
+ position: [330, 0],
144
+ relative: [330, 0],
145
+ shape: 'rectangle',
146
+ size: {
147
+ height: 140,
148
+ width: 251
149
+ },
150
+ title: 'support'
151
+ },
152
+ {
153
+ children: [],
154
+ color: 'primary',
155
+ id: 'cloud.backend',
156
+ parent: 'cloud',
157
+ position: [165, 500],
158
+ relative: [26, 290],
159
+ shape: 'rectangle',
160
+ size: {
161
+ height: 140,
162
+ width: 251
163
+ },
164
+ title: 'backend'
165
+ },
166
+ {
167
+ children: [],
168
+ color: 'primary',
169
+ id: 'cloud.frontend',
170
+ parent: 'cloud',
171
+ position: [165, 266],
172
+ relative: [26, 56],
173
+ shape: 'rectangle',
174
+ size: {
175
+ height: 140,
176
+ width: 251
177
+ },
178
+ title: 'frontend'
179
+ }
180
+ ],
181
+ rules: [
182
+ {
183
+ exprs: [
184
+ {
185
+ wildcard: true
186
+ }
187
+ ],
188
+ isInclude: true
189
+ }
190
+ ],
191
+ title: '',
192
+ viewOf: 'cloud',
193
+ width: 582
194
+ };
195
+ export const fakeDiagram2 = {
196
+ edges: [
197
+ {
198
+ headArrow: [
199
+ [129, 456],
200
+ [126, 465],
201
+ [123, 456]
202
+ ],
203
+ id: 'system.frontend:system.backend',
204
+ label: 'requests',
205
+ labelBox: {
206
+ align: 'left',
207
+ width: 62,
208
+ x: 130,
209
+ y: 428
210
+ },
211
+ points: [
212
+ [126, 375],
213
+ [126, 400],
214
+ [126, 429],
215
+ [126, 456]
216
+ ],
217
+ relations: ['671e3db5eb605d5f245f247d95925bd0953e0e4c'],
218
+ source: 'system.frontend',
219
+ target: 'system.backend'
220
+ },
221
+ {
222
+ headArrow: [
223
+ [129, 221],
224
+ [126, 231],
225
+ [123, 221]
226
+ ],
227
+ id: 'client:system.frontend',
228
+ label: 'opens',
229
+ labelBox: {
230
+ align: 'left',
231
+ width: 44,
232
+ x: 130,
233
+ y: 193
234
+ },
235
+ points: [
236
+ [126, 141],
237
+ [126, 166],
238
+ [126, 195],
239
+ [126, 221]
240
+ ],
241
+ relations: ['99bffdfd5c78e024393e6223cd9b19225321a5e3'],
242
+ source: 'client',
243
+ target: 'system.frontend'
244
+ }
245
+ ],
246
+ height: 609,
247
+ id: '74f5364fa4b',
248
+ nodes: [
249
+ {
250
+ children: [],
251
+ color: 'primary',
252
+ id: 'client',
253
+ parent: null,
254
+ position: [0, 0],
255
+ relative: [0, 0],
256
+ shape: 'rectangle',
257
+ size: {
258
+ height: 140,
259
+ width: 251
260
+ },
261
+ title: 'client'
262
+ },
263
+ {
264
+ children: [],
265
+ color: 'primary',
266
+ id: 'system.backend',
267
+ parent: null,
268
+ position: [0, 469],
269
+ relative: [0, 469],
270
+ shape: 'rectangle',
271
+ size: {
272
+ height: 140,
273
+ width: 251
274
+ },
275
+ title: 'backend'
276
+ },
277
+ {
278
+ children: [],
279
+ color: 'primary',
280
+ id: 'system.frontend',
281
+ parent: null,
282
+ position: [0, 235],
283
+ relative: [0, 235],
284
+ shape: 'rectangle',
285
+ size: {
286
+ height: 140,
287
+ width: 251
288
+ },
289
+ title: 'frontend'
290
+ }
291
+ ],
292
+ rules: [
293
+ {
294
+ exprs: [
295
+ {
296
+ wildcard: true
297
+ }
298
+ ],
299
+ isInclude: true
300
+ }
301
+ ],
302
+ title: 'frontend',
303
+ viewOf: 'system.frontend',
304
+ width: 251
305
+ };
306
+ export const fakeComputedView3Levels = {
307
+ edges: [
308
+ {
309
+ id: 'cloud.frontend.dashboard:cloud.backend.graphql',
310
+ label: null,
311
+ relations: ['cloud.frontend.dashboard:cloud.backend.graphql'],
312
+ source: 'cloud.frontend.dashboard',
313
+ target: 'cloud.backend.graphql'
314
+ },
315
+ {
316
+ id: 'cloud.frontend.adminPanel:cloud.backend.graphql',
317
+ label: null,
318
+ relations: ['cloud.frontend.adminPanel:cloud.backend.graphql'],
319
+ source: 'cloud.frontend.adminPanel',
320
+ target: 'cloud.backend.graphql'
321
+ },
322
+ {
323
+ id: 'cloud.backend.storage:amazon',
324
+ label: null,
325
+ relations: ['cloud.backend.storage:amazon.s3'],
326
+ source: 'cloud.backend.storage',
327
+ target: 'amazon'
328
+ },
329
+ {
330
+ id: 'cloud.backend.graphql:cloud.backend.storage',
331
+ label: null,
332
+ relations: ['cloud.backend.graphql:cloud.backend.storage'],
333
+ source: 'cloud.backend.graphql',
334
+ target: 'cloud.backend.storage'
335
+ },
336
+ {
337
+ id: 'support:cloud.frontend.adminPanel',
338
+ label: null,
339
+ relations: ['support:cloud.frontend.adminPanel'],
340
+ source: 'support',
341
+ target: 'cloud.frontend.adminPanel'
342
+ },
343
+ {
344
+ id: 'customer:cloud.frontend.dashboard',
345
+ label: null,
346
+ relations: ['customer:cloud.frontend.dashboard'],
347
+ source: 'customer',
348
+ target: 'cloud.frontend.dashboard'
349
+ }
350
+ ],
351
+ id: 'cloud3levels',
352
+ nodes: [
353
+ {
354
+ children: [],
355
+ color: 'primary',
356
+ id: 'amazon',
357
+ parent: null,
358
+ shape: 'rectangle',
359
+ title: 'amazon'
360
+ },
361
+ {
362
+ children: ['cloud.backend', 'cloud.frontend.adminPanel', 'cloud.frontend.dashboard'],
363
+ color: 'primary',
364
+ id: 'cloud',
365
+ navigateTo: 'fakeView',
366
+ parent: null,
367
+ shape: 'rectangle',
368
+ title: 'cloud'
369
+ },
370
+ {
371
+ children: [],
372
+ color: 'primary',
373
+ id: 'customer',
374
+ parent: null,
375
+ shape: 'rectangle',
376
+ title: 'customer'
377
+ },
378
+ {
379
+ children: [],
380
+ color: 'primary',
381
+ id: 'support',
382
+ parent: null,
383
+ shape: 'rectangle',
384
+ title: 'support'
385
+ },
386
+ {
387
+ children: ['cloud.backend.graphql', 'cloud.backend.storage'],
388
+ color: 'primary',
389
+ id: 'cloud.backend',
390
+ parent: 'cloud',
391
+ shape: 'rectangle',
392
+ title: 'backend'
393
+ },
394
+ {
395
+ children: [],
396
+ color: 'primary',
397
+ id: 'cloud.backend.graphql',
398
+ parent: 'cloud.backend',
399
+ shape: 'rectangle',
400
+ title: 'graphql'
401
+ },
402
+ {
403
+ children: [],
404
+ color: 'primary',
405
+ id: 'cloud.backend.storage',
406
+ parent: 'cloud.backend',
407
+ shape: 'rectangle',
408
+ title: 'storage'
409
+ },
410
+ {
411
+ children: [],
412
+ color: 'primary',
413
+ id: 'cloud.frontend.adminPanel',
414
+ parent: 'cloud',
415
+ shape: 'rectangle',
416
+ title: 'adminPanel'
417
+ },
418
+ {
419
+ children: [],
420
+ color: 'primary',
421
+ id: 'cloud.frontend.dashboard',
422
+ parent: 'cloud',
423
+ shape: 'rectangle',
424
+ title: 'dashboard'
425
+ }
426
+ ],
427
+ rules: [
428
+ {
429
+ exprs: [
430
+ {
431
+ wildcard: true
432
+ },
433
+ {
434
+ element: 'cloud.frontend',
435
+ isDescedants: true
436
+ },
437
+ {
438
+ element: 'cloud.backend',
439
+ isDescedants: true
440
+ }
441
+ ],
442
+ isInclude: true
443
+ },
444
+ {
445
+ exprs: [
446
+ {
447
+ element: 'cloud.frontend',
448
+ isDescedants: false
449
+ }
450
+ ],
451
+ isInclude: false
452
+ }
453
+ ],
454
+ title: 'Context: Cloud',
455
+ viewOf: 'cloud'
456
+ };
@@ -1,2 +1,3 @@
1
1
  import type { ComputedView } from '@likec4/core';
2
2
  export declare function generateD2<V extends ComputedView>(view: V): string;
3
+ //# sourceMappingURL=generate-d2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-d2.d.ts","sourceRoot":"","sources":["../../src/d2/generate-d2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA8B,YAAY,EAAU,MAAM,cAAc,CAAA;AA+CpF,wBAAgB,UAAU,CAAC,CAAC,SAAS,YAAY,EAAE,IAAI,EAAE,CAAC,UA0DzD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-d2.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-d2.spec.d.ts","sourceRoot":"","sources":["../../src/d2/generate-d2.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { expect, test } from 'vitest';
2
+ import { fakeComputedView3Levels, fakeDiagram, fakeDiagram2 } from '../__mocks__/data';
3
+ import { generateD2 } from './generate-d2';
4
+ test('generate D2 - fakeDiagram', () => {
5
+ expect(generateD2(fakeDiagram)).toMatchSnapshot();
6
+ });
7
+ test('generate D2 - fakeDiagram2', () => {
8
+ expect(generateD2(fakeDiagram2)).toMatchSnapshot();
9
+ });
10
+ test('generate D2 - fakeComputedView 3 Levels', () => {
11
+ expect(generateD2(fakeComputedView3Levels)).toMatchSnapshot();
12
+ });
@@ -1 +1,2 @@
1
1
  export * from './generate-d2';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/d2/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
package/dist/index.d.ts CHANGED
@@ -3,3 +3,4 @@ export { generateMermaid } from './mmd/generate-mmd';
3
3
  export { generateReactNext } from './react-next/generate-react-next';
4
4
  export { generateReact } from './react/generate-react';
5
5
  export { generateViewsDataDTs, generateViewsDataJs, generateViewsDataTs } from './views-data-ts/generate-views-data';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA"}
@@ -1,2 +1,3 @@
1
1
  import type { ComputedView } from '@likec4/core';
2
2
  export declare function generateMermaid<V extends ComputedView>(view: V): string;
3
+ //# sourceMappingURL=generate-mmd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-mmd.d.ts","sourceRoot":"","sources":["../../src/mmd/generate-mmd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA8B,YAAY,EAAU,MAAM,cAAc,CAAA;AA8BpF,wBAAgB,eAAe,CAAC,CAAC,SAAS,YAAY,EAAE,IAAI,EAAE,CAAC,UA+E9D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-mmd.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-mmd.spec.d.ts","sourceRoot":"","sources":["../../src/mmd/generate-mmd.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { expect, test } from 'vitest';
2
+ import { fakeComputedView3Levels, fakeDiagram, fakeDiagram2 } from '../__mocks__/data';
3
+ import { generateMermaid } from './generate-mmd';
4
+ test('generate mermaid - fakeDiagram', () => {
5
+ expect(generateMermaid(fakeDiagram)).toMatchSnapshot();
6
+ });
7
+ test('generate mermaid - fakeDiagram2', () => {
8
+ expect(generateMermaid(fakeDiagram2)).toMatchSnapshot();
9
+ });
10
+ test('generate mermaid - fakeComputedView 3 Levels', () => {
11
+ expect(generateMermaid(fakeComputedView3Levels)).toMatchSnapshot();
12
+ });
@@ -1 +1,2 @@
1
1
  export * from './generate-mmd';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mmd/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
@@ -1,2 +1,3 @@
1
1
  import type { DiagramView } from '@likec4/core';
2
2
  export declare function generateReact(views: DiagramView[]): string;
3
+ //# sourceMappingURL=generate-react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-react.d.ts","sourceRoot":"","sources":["../../src/react/generate-react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAa/C,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,EAAE,UAqGjD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-react.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-react.spec.d.ts","sourceRoot":"","sources":["../../src/react/generate-react.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { expect, test } from 'vitest';
2
+ import { fakeDiagram, fakeDiagram2 } from '../__mocks__/data';
3
+ import { generateReact } from './generate-react';
4
+ test('generate react', () => {
5
+ expect(generateReact([fakeDiagram, fakeDiagram2])).toMatchSnapshot();
6
+ });
@@ -1 +1,2 @@
1
1
  export { generateReact as default } from './generate-react';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAA"}
@@ -15,3 +15,4 @@ export declare function generateReactNext(views: Iterable<DiagramView>): {
15
15
  dts: string;
16
16
  };
17
17
  };
18
+ //# sourceMappingURL=generate-react-next.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-react-next.d.ts","sourceRoot":"","sources":["../../src/react-next/generate-react-next.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAI/C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;EAa7D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-react-next.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-react-next.spec.d.ts","sourceRoot":"","sources":["../../src/react-next/generate-react-next.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { expect, test } from 'vitest';
2
+ import { fakeDiagram, fakeDiagram2 } from '../__mocks__/data';
3
+ import { generateReactNext } from './generate-react-next';
4
+ test('generate react-next', () => {
5
+ const { components, index, viewsData } = generateReactNext([fakeDiagram, fakeDiagram2]);
6
+ expect(index).toMatchSnapshot();
7
+ expect(components).toMatchSnapshot();
8
+ expect(viewsData).toMatchSnapshot();
9
+ });
@@ -1 +1,2 @@
1
1
  export { generateReactNext as default } from './generate-react-next';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react-next/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,MAAM,uBAAuB,CAAA"}
@@ -2,3 +2,4 @@ import type { DiagramView } from '@likec4/core';
2
2
  export declare function generateViewsDataJs(diagrams: Iterable<DiagramView>): string;
3
3
  export declare function generateViewsDataTs(diagrams: Iterable<DiagramView>): string;
4
4
  export declare function generateViewsDataDTs(diagrams: Iterable<DiagramView>): string;
5
+ //# sourceMappingURL=generate-views-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-views-data.d.ts","sourceRoot":"","sources":["../../src/views-data-ts/generate-views-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAK/C,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC,UAiDlE;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC,UA2DlE;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC,UA6BnE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-views-data.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-views-data.spec.d.ts","sourceRoot":"","sources":["../../src/views-data-ts/generate-views-data.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { expect, test } from 'vitest';
2
+ import { fakeDiagram, fakeDiagram2 } from '../__mocks__/data';
3
+ import { generateViewsDataDTs, generateViewsDataJs, generateViewsDataTs } from './generate-views-data';
4
+ test('generate generateViewsDataJs', () => {
5
+ expect(generateViewsDataJs([fakeDiagram, fakeDiagram2])).toMatchSnapshot();
6
+ });
7
+ test('generate generateViewsDataTs', () => {
8
+ expect(generateViewsDataTs([fakeDiagram, fakeDiagram2])).toMatchSnapshot();
9
+ });
10
+ test('generate generateViewsDataDTs', () => {
11
+ expect(generateViewsDataDTs([fakeDiagram, fakeDiagram2])).toMatchSnapshot();
12
+ });
@@ -1,2 +1,3 @@
1
1
  import type { DiagramView } from '@likec4/core';
2
2
  export declare function generateViewId(views: Iterable<DiagramView>): import("langium/generate").CompositeGeneratorNode | undefined;
3
+ //# sourceMappingURL=generateViewId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateViewId.d.ts","sourceRoot":"","sources":["../../src/views-data-ts/generateViewId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAG/C,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,iEAI1D"}
@@ -1 +1,2 @@
1
1
  export * from './generate-views-data';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/views-data-ts/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likec4/generators",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "license": "MIT",
5
5
  "bugs": "https://github.com/likec4/likec4/issues",
6
6
  "homepage": "https://likec4.dev",
@@ -34,22 +34,22 @@
34
34
  },
35
35
  "scripts": {
36
36
  "typecheck": "tsc --noEmit",
37
- "build": "tsc -b",
38
- "prepack": "tsc -p tsconfig.build.json",
37
+ "prepack": "tsc",
39
38
  "lint": "run -T eslint src/ --fix",
40
39
  "clean": "run -T rimraf dist",
41
40
  "test": "run -T vitest run"
42
41
  },
43
42
  "dependencies": {
44
- "@likec4/core": "1.2.0",
43
+ "@likec4/core": "1.2.1",
45
44
  "json5": "^2.2.3",
46
45
  "langium": "^3.0.0",
47
46
  "remeda": "^1.61.0"
48
47
  },
49
48
  "devDependencies": {
50
- "@types/node": "^20.13.0",
49
+ "@likec4/tsconfig": "1.2.1",
50
+ "@types/node": "^20.14.2",
51
51
  "typescript": "^5.4.5",
52
- "vitest": "~1.5.2"
52
+ "vitest": "~1.5.3"
53
53
  },
54
54
  "packageManager": "yarn@4.3.0"
55
55
  }