@likec4/generators 1.39.1 → 1.39.2
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.
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import JSON5 from "json5";
|
|
2
|
-
import { capitalize } from "remeda";
|
|
3
2
|
import { generateAux } from "./generate-aux.js";
|
|
4
3
|
export function generateLikeC4Model(model) {
|
|
5
4
|
const aux = generateAux(model);
|
|
6
|
-
const ModelData = capitalize(model.stage) + "LikeC4ModelData";
|
|
7
5
|
return `
|
|
8
6
|
/* prettier-ignore-start */
|
|
9
7
|
/* eslint-disable */
|
|
@@ -14,10 +12,9 @@ export function generateLikeC4Model(model) {
|
|
|
14
12
|
******************************************************************************/
|
|
15
13
|
|
|
16
14
|
import { LikeC4Model } from '@likec4/core/model'
|
|
17
|
-
import type { ${ModelData} } from '@likec4/core/types'
|
|
18
15
|
${aux}
|
|
19
16
|
|
|
20
|
-
export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(
|
|
17
|
+
export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(${JSON5.stringify(model.$data, { space: 2, quote: "'" })} as any) as any
|
|
21
18
|
|
|
22
19
|
/* prettier-ignore-end */
|
|
23
20
|
`.trimStart();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/generators",
|
|
3
|
-
"version": "1.39.
|
|
3
|
+
"version": "1.39.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
6
6
|
"homepage": "https://likec4.dev",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"json5": "^2.2.3",
|
|
40
40
|
"langium": "3.5.0",
|
|
41
41
|
"remeda": "^2.23.1",
|
|
42
|
-
"@likec4/core": "1.39.
|
|
42
|
+
"@likec4/core": "1.39.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "~20.19.11",
|
|
46
46
|
"typescript": "5.9.2",
|
|
47
47
|
"unbuild": "3.5.0",
|
|
48
48
|
"vitest": "3.2.4",
|
|
49
|
-
"@likec4/tsconfig": "1.39.
|
|
49
|
+
"@likec4/tsconfig": "1.39.2"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"typecheck": "tsc -b --verbose",
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { LikeC4Model } from '@likec4/core/model'
|
|
2
2
|
import JSON5 from 'json5'
|
|
3
|
-
import { capitalize } from 'remeda'
|
|
4
3
|
import { generateAux } from './generate-aux'
|
|
5
4
|
|
|
6
5
|
export function generateLikeC4Model(model: LikeC4Model<any>) {
|
|
7
6
|
const aux = generateAux(model)
|
|
8
|
-
const ModelData = capitalize(model.stage) + 'LikeC4ModelData'
|
|
9
7
|
|
|
10
8
|
return `
|
|
11
9
|
/* prettier-ignore-start */
|
|
@@ -17,12 +15,11 @@ export function generateLikeC4Model(model: LikeC4Model<any>) {
|
|
|
17
15
|
******************************************************************************/
|
|
18
16
|
|
|
19
17
|
import { LikeC4Model } from '@likec4/core/model'
|
|
20
|
-
import type { ${ModelData} } from '@likec4/core/types'
|
|
21
18
|
${aux}
|
|
22
19
|
|
|
23
|
-
export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(
|
|
20
|
+
export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(${
|
|
24
21
|
JSON5.stringify(model.$data, { space: 2, quote: '\'' })
|
|
25
|
-
} as
|
|
22
|
+
} as any) as any
|
|
26
23
|
|
|
27
24
|
/* prettier-ignore-end */
|
|
28
25
|
`.trimStart()
|