@likec4/generators 1.53.0 → 1.55.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.
- package/dist/index.d.mts +6 -2
- package/dist/index.mjs +9 -5
- package/dist/likec4/index.d.mts +35778 -35778
- package/dist/likec4/index.mjs +0 -1
- package/package.json +9 -9
- package/src/drawio/generate-drawio.ts +5 -5
- package/src/drawio/parse-drawio.ts +4 -0
- package/src/likec4/schemas/likec4data.ts +0 -1
package/dist/likec4/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/generators",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.55.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
6
6
|
"homepage": "https://likec4.dev",
|
|
@@ -47,25 +47,25 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"langium": "3.5.0",
|
|
49
49
|
"pako": "^2.1.0",
|
|
50
|
-
"remeda": "^2.33.
|
|
50
|
+
"remeda": "^2.33.7",
|
|
51
51
|
"immer": "^11.1.4",
|
|
52
52
|
"json5": "^2.2.3",
|
|
53
53
|
"type-fest": "^4.41.0",
|
|
54
54
|
"indent-string": "^5.0.0",
|
|
55
55
|
"strip-indent": "^4.1.1",
|
|
56
|
-
"zod": "^3.
|
|
57
|
-
"@likec4/core": "1.
|
|
58
|
-
"@likec4/
|
|
59
|
-
"@likec4/
|
|
56
|
+
"zod": "^4.3.6",
|
|
57
|
+
"@likec4/core": "1.55.0",
|
|
58
|
+
"@likec4/config": "1.55.0",
|
|
59
|
+
"@likec4/log": "1.55.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/node": "~22.19.15",
|
|
63
63
|
"@types/pako": "^2.0.4",
|
|
64
64
|
"typescript": "5.9.3",
|
|
65
65
|
"obuild": "0.4.31",
|
|
66
|
-
"vitest": "4.1.
|
|
67
|
-
"@likec4/
|
|
68
|
-
"@likec4/
|
|
66
|
+
"vitest": "4.1.3",
|
|
67
|
+
"@likec4/tsconfig": "1.55.0",
|
|
68
|
+
"@likec4/devops": "1.42.0"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
71
|
"typecheck": "tsc -b --verbose",
|
|
@@ -438,7 +438,7 @@ function buildLikec4StyleForNode(params: NodeLikec4StyleParams): string {
|
|
|
438
438
|
return parts.length > 0 ? parts.join(';') + ';' : ''
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
-
/** Bridge-managed style
|
|
441
|
+
/** Bridge-managed style for leanix profile (vertex): likec4Id, likec4Kind, likec4ViewId, projectId, leanixFactSheetType. */
|
|
442
442
|
function buildBridgeManagedStyleForNode(
|
|
443
443
|
nodeId: string,
|
|
444
444
|
nodeKind: string,
|
|
@@ -462,7 +462,7 @@ function buildBridgeManagedStyleForNode(
|
|
|
462
462
|
return parts.join(';') + ';'
|
|
463
463
|
}
|
|
464
464
|
|
|
465
|
-
/** Bridge-managed style
|
|
465
|
+
/** Bridge-managed style for leanix profile (edge): likec4RelationId, bridgeManaged. */
|
|
466
466
|
function buildBridgeManagedStyleForEdge(
|
|
467
467
|
relationId: string,
|
|
468
468
|
options: GenerateDrawioOptions | undefined,
|
|
@@ -891,7 +891,7 @@ function getViewDescriptionString(view: View): string {
|
|
|
891
891
|
return ''
|
|
892
892
|
}
|
|
893
893
|
|
|
894
|
-
/**
|
|
894
|
+
/** Root-cell style tokens for leanix profile (bridgeManaged, likec4ViewId, likec4ProjectId). */
|
|
895
895
|
function getLeanixRootStyleParts(view: View, options: GenerateDrawioOptions): string[] {
|
|
896
896
|
const parts = ['bridgeManaged=true;', `likec4ViewId=${encodeURIComponent(view.id)};`]
|
|
897
897
|
if (options.projectId != null && options.projectId !== '') {
|
|
@@ -1322,7 +1322,7 @@ ${diagramParts.join('\n')}
|
|
|
1322
1322
|
* Generate a single DrawIO file from one view.
|
|
1323
1323
|
*
|
|
1324
1324
|
* @param viewmodel - Layouted LikeC4 view model (from model.view(id))
|
|
1325
|
-
* @param options - Optional overrides for layout/colors (round-trip from comment blocks)
|
|
1325
|
+
* @param options - Optional overrides for layout/colors (round-trip from comment blocks); profile `leanix` adds bridge-managed metadata for LeanIX (see GenerateDrawioOptions).
|
|
1326
1326
|
* @returns DrawIO .drawio XML string
|
|
1327
1327
|
*/
|
|
1328
1328
|
export function generateDrawio(
|
|
@@ -1338,7 +1338,7 @@ export function generateDrawio(
|
|
|
1338
1338
|
* so all views open in one file with one tab per view.
|
|
1339
1339
|
*
|
|
1340
1340
|
* @param viewmodels - Layouted view models (e.g. from model.views())
|
|
1341
|
-
* @param optionsByViewId - Optional per-view options (
|
|
1341
|
+
* @param optionsByViewId - Optional per-view options (layout, compressed, profile leanix, etc.)
|
|
1342
1342
|
* @param modified - Optional ISO timestamp for mxfile modified attribute (for deterministic output)
|
|
1343
1343
|
* @returns DrawIO .drawio XML string with multiple <diagram> elements
|
|
1344
1344
|
*/
|
|
@@ -1611,6 +1611,8 @@ function emitLikeC4SourceFromSingleState(state: SingleDiagramState): string {
|
|
|
1611
1611
|
/**
|
|
1612
1612
|
* Convert DrawIO XML to LikeC4 source (.c4) string.
|
|
1613
1613
|
* Vertices → model elements (actor/container); edges → relations (->). Uses first diagram only.
|
|
1614
|
+
* Preserves likec4Id / likec4RelationId from leanix-profile exports when present on cells.
|
|
1615
|
+
*
|
|
1614
1616
|
* @param xml - Full .drawio mxfile XML (single or multi-tab).
|
|
1615
1617
|
* @returns LikeC4 .c4 source string (model + views + round-trip comments).
|
|
1616
1618
|
*/
|
|
@@ -1789,6 +1791,8 @@ function emitMultiDiagramModel(
|
|
|
1789
1791
|
/**
|
|
1790
1792
|
* Convert DrawIO XML to LikeC4 source when file has multiple diagrams (tabs).
|
|
1791
1793
|
* Merges elements by FQN and relations by (source, target); one view per diagram.
|
|
1794
|
+
* Same leanix bridge style fields as parseDrawioToLikeC4 when present.
|
|
1795
|
+
*
|
|
1792
1796
|
* @param xml - Full .drawio mxfile XML with multiple <diagram> elements.
|
|
1793
1797
|
* @returns LikeC4 .c4 source string (model + views + round-trip comments).
|
|
1794
1798
|
*/
|