@likec4/language-server 1.40.0 → 1.42.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/browser/package.json +4 -0
- package/browser-worker/package.json +4 -0
- package/dist/LikeC4LanguageServices.d.ts +1 -1
- package/dist/LikeC4LanguageServices.mjs +3 -2
- package/dist/Rpc.mjs +30 -24
- package/dist/ast.d.ts +4 -9
- package/dist/ast.mjs +0 -10
- package/dist/bundled.mjs +4158 -3687
- package/dist/documentation/documentation-provider.mjs +1 -1
- package/dist/filesystem/FileSystemWatcher.d.ts +2 -2
- package/dist/filesystem/index.d.ts +1 -1
- package/dist/formatting/LikeC4Formatter.mjs +42 -10
- package/dist/formatting/utils.d.ts +3 -3
- package/dist/formatting/utils.mjs +1 -1
- package/dist/generated/ast.d.ts +40 -19
- package/dist/generated/ast.mjs +71 -26
- package/dist/generated/grammar.mjs +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.mjs +3 -0
- package/dist/lsp/CompletionProvider.mjs +1 -1
- package/dist/lsp/DocumentLinkProvider.d.ts +1 -1
- package/dist/lsp/DocumentLinkProvider.mjs +1 -1
- package/dist/lsp/DocumentSymbolProvider.mjs +1 -1
- package/dist/lsp/HoverProvider.mjs +14 -2
- package/dist/mcp/NoopLikeC4MCPServer.d.ts +1 -1
- package/dist/mcp/NoopLikeC4MCPServer.mjs +1 -1
- package/dist/mcp/server/StdioLikeC4MCPServer.mjs +4 -1
- package/dist/mcp/server/StreamableLikeC4MCPServer.mjs +3 -3
- package/dist/mcp/server/WithMCPServer.mjs +2 -2
- package/dist/mcp/tools/_common.mjs +2 -2
- package/dist/model/builder/MergedSpecification.d.ts +3 -3
- package/dist/model/builder/MergedSpecification.mjs +37 -59
- package/dist/model/builder/buildModel.mjs +14 -17
- package/dist/model/model-builder.d.ts +1 -1
- package/dist/model/model-builder.mjs +12 -9
- package/dist/model/model-locator.d.ts +5 -0
- package/dist/model/model-locator.mjs +40 -3
- package/dist/model/model-parser-where.mjs +1 -2
- package/dist/model/model-parser.d.ts +91 -47
- package/dist/model/parser/Base.d.ts +13 -7
- package/dist/model/parser/Base.mjs +32 -21
- package/dist/model/parser/DeploymentModelParser.d.ts +9 -5
- package/dist/model/parser/DeploymentModelParser.mjs +49 -47
- package/dist/model/parser/DeploymentViewParser.d.ts +9 -5
- package/dist/model/parser/DeploymentViewParser.mjs +1 -2
- package/dist/model/parser/FqnRefParser.d.ts +12 -6
- package/dist/model/parser/FqnRefParser.mjs +28 -15
- package/dist/model/parser/GlobalsParser.d.ts +16 -7
- package/dist/model/parser/GlobalsParser.mjs +5 -3
- package/dist/model/parser/ImportsParser.d.ts +8 -5
- package/dist/model/parser/ImportsParser.mjs +4 -2
- package/dist/model/parser/ModelParser.d.ts +9 -5
- package/dist/model/parser/ModelParser.mjs +42 -42
- package/dist/model/parser/PredicatesParser.d.ts +9 -5
- package/dist/model/parser/SpecificationParser.d.ts +8 -5
- package/dist/model/parser/SpecificationParser.mjs +17 -23
- package/dist/model/parser/ValueConverter.mjs +1 -1
- package/dist/model/parser/ViewsParser.d.ts +20 -7
- package/dist/model/parser/ViewsParser.mjs +125 -35
- package/dist/model-change/ModelChanges.d.ts +1 -1
- package/dist/module.mjs +3 -2
- package/dist/protocol.d.ts +28 -4
- package/dist/references/scope-computation.mjs +2 -3
- package/dist/references/scope-provider.d.ts +2 -2
- package/dist/references/scope-provider.mjs +8 -15
- package/dist/test/testServices.d.ts +2 -0
- package/dist/test/testServices.mjs +32 -35
- package/dist/utils/disposable.mjs +2 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/validation/_shared.d.ts +1 -1
- package/dist/validation/deployment-checks.d.ts +1 -1
- package/dist/validation/deployment-checks.mjs +4 -1
- package/dist/validation/dynamic-view.d.ts +3 -2
- package/dist/validation/dynamic-view.mjs +21 -2
- package/dist/validation/element-ref.d.ts +2 -2
- package/dist/validation/element-ref.mjs +1 -1
- package/dist/validation/imports.d.ts +0 -1
- package/dist/validation/imports.mjs +0 -5
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.mjs +19 -13
- package/dist/validation/view-predicates/relation-with.d.ts +1 -1
- package/dist/validation/view.d.ts +1 -1
- package/dist/view-utils/index.d.ts +0 -1
- package/dist/view-utils/index.mjs +0 -1
- package/dist/views/likec4-views.d.ts +6 -0
- package/dist/views/likec4-views.mjs +31 -18
- package/dist/workspace/ProjectsManager.d.ts +23 -31
- package/dist/workspace/ProjectsManager.mjs +78 -89
- package/dist/workspace/WorkspaceManager.mjs +1 -1
- package/likec4lib/package.json +4 -0
- package/package.json +25 -29
- package/protocol/package.json +4 -0
- package/dist/view-utils/resolve-relative-paths.d.ts +0 -2
- package/dist/view-utils/resolve-relative-paths.mjs +0 -78
|
@@ -24,7 +24,12 @@ declare const DocumentParserFromMixins: {
|
|
|
24
24
|
parseDynamicViewRule(astRule: import("../generated/ast").DynamicViewRule): ProjectId;
|
|
25
25
|
parseDynamicViewIncludePredicate(astRule: import("../generated/ast").DynamicViewIncludePredicate): ProjectId;
|
|
26
26
|
parseDynamicParallelSteps(node: import("../generated/ast").DynamicViewParallelSteps): ProjectId;
|
|
27
|
-
parseDynamicStep(node: import("../generated/ast").DynamicViewStep): ProjectId;
|
|
27
|
+
parseDynamicStep(node: import("../generated/ast").DynamicViewStep): ProjectId | ProjectId;
|
|
28
|
+
recursiveParseDynamicStepChain(node: import("../generated/ast").DynamicStepChain, callstack?: Array<[source: ProjectId, target: ProjectId]>): ProjectId[];
|
|
29
|
+
parseDynamicStepSingle(node: import("../generated/ast").DynamicStepSingle): ProjectId;
|
|
30
|
+
parseAbstractDynamicStep(astnode: import("../generated/ast").AbstractDynamicStep): import("type-fest").Writable<import("type-fest").Except<ProjectId, "source", {
|
|
31
|
+
requireExactProps: true;
|
|
32
|
+
}>>;
|
|
28
33
|
parsePredicate(astNode: import("../generated/ast").ExpressionV2): ProjectId;
|
|
29
34
|
parseElementPredicate(astNode: import("../generated/ast").FqnExprOrWith): ProjectId;
|
|
30
35
|
parseElementPredicateOrWhere(astNode: import("../generated/ast").FqnExprOrWhere): ProjectId;
|
|
@@ -47,6 +52,7 @@ declare const DocumentParserFromMixins: {
|
|
|
47
52
|
parseFqnExpressions(astNode: import("../generated/ast").FqnExpressions): ProjectId[];
|
|
48
53
|
parseRelationExprOrWith(astNode: import("../generated/ast").RelationExprOrWith): ProjectId;
|
|
49
54
|
parseRelationExprWith(astNode: import("../generated/ast").RelationExprWith): ProjectId;
|
|
55
|
+
parseCustomRelationProperties(custom: import("../generated/ast").CustomRelationProperties | undefined): import("type-fest").Except<ProjectId["customRelation"], "expr">;
|
|
50
56
|
parseRelationExprOrWhere(astNode: import("../generated/ast").RelationExprOrWhere): ProjectId;
|
|
51
57
|
parseRelationExprWhere(astNode: import("../generated/ast").RelationExprWhere): ProjectId;
|
|
52
58
|
parseRelationExpr(astNode: import("../generated/ast").RelationExpr): ProjectId;
|
|
@@ -75,16 +81,19 @@ declare const DocumentParserFromMixins: {
|
|
|
75
81
|
parseColorLiteral(astNode: import("../generated/ast").ColorLiteral): ProjectId | undefined;
|
|
76
82
|
parseElementStyle(elementProps: Array<import("../generated/ast").ElementProperty> | import("../generated/ast").ElementStyleProperty | undefined): import("../ast").ParsedElementStyle;
|
|
77
83
|
parseStyleProps(styleProps: Array<import("../generated/ast").StyleProperty> | undefined): import("../ast").ParsedElementStyle;
|
|
78
|
-
|
|
79
|
-
title?: string | undefined;
|
|
80
|
-
description?: string | undefined;
|
|
81
|
-
technology?: string | undefined;
|
|
82
|
-
}, bodyProps: {
|
|
84
|
+
parseBaseProps(props: {
|
|
83
85
|
title?: import("../generated/ast").MarkdownOrString | undefined;
|
|
86
|
+
summary?: import("../generated/ast").MarkdownOrString | undefined;
|
|
84
87
|
description?: import("../generated/ast").MarkdownOrString | undefined;
|
|
85
88
|
technology?: import("../generated/ast").MarkdownOrString | undefined;
|
|
89
|
+
}, override?: {
|
|
90
|
+
title?: string | undefined;
|
|
91
|
+
summary?: string | undefined;
|
|
92
|
+
description?: string | undefined;
|
|
93
|
+
technology?: string | undefined;
|
|
86
94
|
}): {
|
|
87
95
|
title?: string;
|
|
96
|
+
summary?: ProjectId;
|
|
88
97
|
description?: ProjectId;
|
|
89
98
|
technology?: string;
|
|
90
99
|
};
|
|
@@ -114,7 +123,12 @@ declare const DocumentParserFromMixins: {
|
|
|
114
123
|
parseDynamicViewRule(astRule: import("../generated/ast").DynamicViewRule): ProjectId;
|
|
115
124
|
parseDynamicViewIncludePredicate(astRule: import("../generated/ast").DynamicViewIncludePredicate): ProjectId;
|
|
116
125
|
parseDynamicParallelSteps(node: import("../generated/ast").DynamicViewParallelSteps): ProjectId;
|
|
117
|
-
parseDynamicStep(node: import("../generated/ast").DynamicViewStep): ProjectId;
|
|
126
|
+
parseDynamicStep(node: import("../generated/ast").DynamicViewStep): ProjectId | ProjectId;
|
|
127
|
+
recursiveParseDynamicStepChain(node: import("../generated/ast").DynamicStepChain, callstack?: Array<[source: ProjectId, target: ProjectId]>): ProjectId[];
|
|
128
|
+
parseDynamicStepSingle(node: import("../generated/ast").DynamicStepSingle): ProjectId;
|
|
129
|
+
parseAbstractDynamicStep(astnode: import("../generated/ast").AbstractDynamicStep): import("type-fest").Writable<import("type-fest").Except<ProjectId, "source", {
|
|
130
|
+
requireExactProps: true;
|
|
131
|
+
}>>;
|
|
118
132
|
parsePredicate(astNode: import("../generated/ast").ExpressionV2): ProjectId;
|
|
119
133
|
parseElementPredicate(astNode: import("../generated/ast").FqnExprOrWith): ProjectId;
|
|
120
134
|
parseElementPredicateOrWhere(astNode: import("../generated/ast").FqnExprOrWhere): ProjectId;
|
|
@@ -137,6 +151,7 @@ declare const DocumentParserFromMixins: {
|
|
|
137
151
|
parseFqnExpressions(astNode: import("../generated/ast").FqnExpressions): ProjectId[];
|
|
138
152
|
parseRelationExprOrWith(astNode: import("../generated/ast").RelationExprOrWith): ProjectId;
|
|
139
153
|
parseRelationExprWith(astNode: import("../generated/ast").RelationExprWith): ProjectId;
|
|
154
|
+
parseCustomRelationProperties(custom: import("../generated/ast").CustomRelationProperties | undefined): import("type-fest").Except<ProjectId["customRelation"], "expr">;
|
|
140
155
|
parseRelationExprOrWhere(astNode: import("../generated/ast").RelationExprOrWhere): ProjectId;
|
|
141
156
|
parseRelationExprWhere(astNode: import("../generated/ast").RelationExprWhere): ProjectId;
|
|
142
157
|
parseRelationExpr(astNode: import("../generated/ast").RelationExpr): ProjectId;
|
|
@@ -165,16 +180,19 @@ declare const DocumentParserFromMixins: {
|
|
|
165
180
|
parseColorLiteral(astNode: import("../generated/ast").ColorLiteral): ProjectId | undefined;
|
|
166
181
|
parseElementStyle(elementProps: Array<import("../generated/ast").ElementProperty> | import("../generated/ast").ElementStyleProperty | undefined): import("../ast").ParsedElementStyle;
|
|
167
182
|
parseStyleProps(styleProps: Array<import("../generated/ast").StyleProperty> | undefined): import("../ast").ParsedElementStyle;
|
|
168
|
-
|
|
169
|
-
title?: string | undefined;
|
|
170
|
-
description?: string | undefined;
|
|
171
|
-
technology?: string | undefined;
|
|
172
|
-
}, bodyProps: {
|
|
183
|
+
parseBaseProps(props: {
|
|
173
184
|
title?: import("../generated/ast").MarkdownOrString | undefined;
|
|
185
|
+
summary?: import("../generated/ast").MarkdownOrString | undefined;
|
|
174
186
|
description?: import("../generated/ast").MarkdownOrString | undefined;
|
|
175
187
|
technology?: import("../generated/ast").MarkdownOrString | undefined;
|
|
188
|
+
}, override?: {
|
|
189
|
+
title?: string | undefined;
|
|
190
|
+
summary?: string | undefined;
|
|
191
|
+
description?: string | undefined;
|
|
192
|
+
technology?: string | undefined;
|
|
176
193
|
}): {
|
|
177
194
|
title?: string;
|
|
195
|
+
summary?: ProjectId;
|
|
178
196
|
description?: ProjectId;
|
|
179
197
|
technology?: string;
|
|
180
198
|
};
|
|
@@ -217,16 +235,19 @@ declare const DocumentParserFromMixins: {
|
|
|
217
235
|
parseColorLiteral(astNode: import("../generated/ast").ColorLiteral): ProjectId | undefined;
|
|
218
236
|
parseElementStyle(elementProps: Array<import("../generated/ast").ElementProperty> | import("../generated/ast").ElementStyleProperty | undefined): import("../ast").ParsedElementStyle;
|
|
219
237
|
parseStyleProps(styleProps: Array<import("../generated/ast").StyleProperty> | undefined): import("../ast").ParsedElementStyle;
|
|
220
|
-
|
|
221
|
-
title?: string | undefined;
|
|
222
|
-
description?: string | undefined;
|
|
223
|
-
technology?: string | undefined;
|
|
224
|
-
}, bodyProps: {
|
|
238
|
+
parseBaseProps(props: {
|
|
225
239
|
title?: import("../generated/ast").MarkdownOrString | undefined;
|
|
240
|
+
summary?: import("../generated/ast").MarkdownOrString | undefined;
|
|
226
241
|
description?: import("../generated/ast").MarkdownOrString | undefined;
|
|
227
242
|
technology?: import("../generated/ast").MarkdownOrString | undefined;
|
|
243
|
+
}, override?: {
|
|
244
|
+
title?: string | undefined;
|
|
245
|
+
summary?: string | undefined;
|
|
246
|
+
description?: string | undefined;
|
|
247
|
+
technology?: string | undefined;
|
|
228
248
|
}): {
|
|
229
249
|
title?: string;
|
|
250
|
+
summary?: ProjectId;
|
|
230
251
|
description?: ProjectId;
|
|
231
252
|
technology?: string;
|
|
232
253
|
};
|
|
@@ -255,6 +276,7 @@ declare const DocumentParserFromMixins: {
|
|
|
255
276
|
parseFqnExpressions(astNode: import("../generated/ast").FqnExpressions): ProjectId[];
|
|
256
277
|
parseRelationExprOrWith(astNode: import("../generated/ast").RelationExprOrWith): ProjectId;
|
|
257
278
|
parseRelationExprWith(astNode: import("../generated/ast").RelationExprWith): ProjectId;
|
|
279
|
+
parseCustomRelationProperties(custom: import("../generated/ast").CustomRelationProperties | undefined): import("type-fest").Except<ProjectId["customRelation"], "expr">;
|
|
258
280
|
parseRelationExprOrWhere(astNode: import("../generated/ast").RelationExprOrWhere): ProjectId;
|
|
259
281
|
parseRelationExprWhere(astNode: import("../generated/ast").RelationExprWhere): ProjectId;
|
|
260
282
|
parseRelationExpr(astNode: import("../generated/ast").RelationExpr): ProjectId;
|
|
@@ -283,16 +305,19 @@ declare const DocumentParserFromMixins: {
|
|
|
283
305
|
parseColorLiteral(astNode: import("../generated/ast").ColorLiteral): ProjectId | undefined;
|
|
284
306
|
parseElementStyle(elementProps: Array<import("../generated/ast").ElementProperty> | import("../generated/ast").ElementStyleProperty | undefined): import("../ast").ParsedElementStyle;
|
|
285
307
|
parseStyleProps(styleProps: Array<import("../generated/ast").StyleProperty> | undefined): import("../ast").ParsedElementStyle;
|
|
286
|
-
|
|
287
|
-
title?: string | undefined;
|
|
288
|
-
description?: string | undefined;
|
|
289
|
-
technology?: string | undefined;
|
|
290
|
-
}, bodyProps: {
|
|
308
|
+
parseBaseProps(props: {
|
|
291
309
|
title?: import("../generated/ast").MarkdownOrString | undefined;
|
|
310
|
+
summary?: import("../generated/ast").MarkdownOrString | undefined;
|
|
292
311
|
description?: import("../generated/ast").MarkdownOrString | undefined;
|
|
293
312
|
technology?: import("../generated/ast").MarkdownOrString | undefined;
|
|
313
|
+
}, override?: {
|
|
314
|
+
title?: string | undefined;
|
|
315
|
+
summary?: string | undefined;
|
|
316
|
+
description?: string | undefined;
|
|
317
|
+
technology?: string | undefined;
|
|
294
318
|
}): {
|
|
295
319
|
title?: string;
|
|
320
|
+
summary?: ProjectId;
|
|
296
321
|
description?: ProjectId;
|
|
297
322
|
technology?: string;
|
|
298
323
|
};
|
|
@@ -314,6 +339,7 @@ declare const DocumentParserFromMixins: {
|
|
|
314
339
|
parseFqnExpressions(astNode: import("../generated/ast").FqnExpressions): ProjectId[];
|
|
315
340
|
parseRelationExprOrWith(astNode: import("../generated/ast").RelationExprOrWith): ProjectId;
|
|
316
341
|
parseRelationExprWith(astNode: import("../generated/ast").RelationExprWith): ProjectId;
|
|
342
|
+
parseCustomRelationProperties(custom: import("../generated/ast").CustomRelationProperties | undefined): import("type-fest").Except<ProjectId["customRelation"], "expr">;
|
|
317
343
|
parseRelationExprOrWhere(astNode: import("../generated/ast").RelationExprOrWhere): ProjectId;
|
|
318
344
|
parseRelationExprWhere(astNode: import("../generated/ast").RelationExprWhere): ProjectId;
|
|
319
345
|
parseRelationExpr(astNode: import("../generated/ast").RelationExpr): ProjectId;
|
|
@@ -342,16 +368,19 @@ declare const DocumentParserFromMixins: {
|
|
|
342
368
|
parseColorLiteral(astNode: import("../generated/ast").ColorLiteral): ProjectId | undefined;
|
|
343
369
|
parseElementStyle(elementProps: Array<import("../generated/ast").ElementProperty> | import("../generated/ast").ElementStyleProperty | undefined): import("../ast").ParsedElementStyle;
|
|
344
370
|
parseStyleProps(styleProps: Array<import("../generated/ast").StyleProperty> | undefined): import("../ast").ParsedElementStyle;
|
|
345
|
-
|
|
346
|
-
title?: string | undefined;
|
|
347
|
-
description?: string | undefined;
|
|
348
|
-
technology?: string | undefined;
|
|
349
|
-
}, bodyProps: {
|
|
371
|
+
parseBaseProps(props: {
|
|
350
372
|
title?: import("../generated/ast").MarkdownOrString | undefined;
|
|
373
|
+
summary?: import("../generated/ast").MarkdownOrString | undefined;
|
|
351
374
|
description?: import("../generated/ast").MarkdownOrString | undefined;
|
|
352
375
|
technology?: import("../generated/ast").MarkdownOrString | undefined;
|
|
376
|
+
}, override?: {
|
|
377
|
+
title?: string | undefined;
|
|
378
|
+
summary?: string | undefined;
|
|
379
|
+
description?: string | undefined;
|
|
380
|
+
technology?: string | undefined;
|
|
353
381
|
}): {
|
|
354
382
|
title?: string;
|
|
383
|
+
summary?: ProjectId;
|
|
355
384
|
description?: ProjectId;
|
|
356
385
|
technology?: string;
|
|
357
386
|
};
|
|
@@ -381,6 +410,7 @@ declare const DocumentParserFromMixins: {
|
|
|
381
410
|
parseFqnExpressions(astNode: import("../generated/ast").FqnExpressions): ProjectId[];
|
|
382
411
|
parseRelationExprOrWith(astNode: import("../generated/ast").RelationExprOrWith): ProjectId;
|
|
383
412
|
parseRelationExprWith(astNode: import("../generated/ast").RelationExprWith): ProjectId;
|
|
413
|
+
parseCustomRelationProperties(custom: import("../generated/ast").CustomRelationProperties | undefined): import("type-fest").Except<ProjectId["customRelation"], "expr">;
|
|
384
414
|
parseRelationExprOrWhere(astNode: import("../generated/ast").RelationExprOrWhere): ProjectId;
|
|
385
415
|
parseRelationExprWhere(astNode: import("../generated/ast").RelationExprWhere): ProjectId;
|
|
386
416
|
parseRelationExpr(astNode: import("../generated/ast").RelationExpr): ProjectId;
|
|
@@ -409,16 +439,19 @@ declare const DocumentParserFromMixins: {
|
|
|
409
439
|
parseColorLiteral(astNode: import("../generated/ast").ColorLiteral): ProjectId | undefined;
|
|
410
440
|
parseElementStyle(elementProps: Array<import("../generated/ast").ElementProperty> | import("../generated/ast").ElementStyleProperty | undefined): import("../ast").ParsedElementStyle;
|
|
411
441
|
parseStyleProps(styleProps: Array<import("../generated/ast").StyleProperty> | undefined): import("../ast").ParsedElementStyle;
|
|
412
|
-
|
|
413
|
-
title?: string | undefined;
|
|
414
|
-
description?: string | undefined;
|
|
415
|
-
technology?: string | undefined;
|
|
416
|
-
}, bodyProps: {
|
|
442
|
+
parseBaseProps(props: {
|
|
417
443
|
title?: import("../generated/ast").MarkdownOrString | undefined;
|
|
444
|
+
summary?: import("../generated/ast").MarkdownOrString | undefined;
|
|
418
445
|
description?: import("../generated/ast").MarkdownOrString | undefined;
|
|
419
446
|
technology?: import("../generated/ast").MarkdownOrString | undefined;
|
|
447
|
+
}, override?: {
|
|
448
|
+
title?: string | undefined;
|
|
449
|
+
summary?: string | undefined;
|
|
450
|
+
description?: string | undefined;
|
|
451
|
+
technology?: string | undefined;
|
|
420
452
|
}): {
|
|
421
453
|
title?: string;
|
|
454
|
+
summary?: ProjectId;
|
|
422
455
|
description?: ProjectId;
|
|
423
456
|
technology?: string;
|
|
424
457
|
};
|
|
@@ -441,6 +474,7 @@ declare const DocumentParserFromMixins: {
|
|
|
441
474
|
parseFqnExpressions(astNode: import("../generated/ast").FqnExpressions): ProjectId[];
|
|
442
475
|
parseRelationExprOrWith(astNode: import("../generated/ast").RelationExprOrWith): ProjectId;
|
|
443
476
|
parseRelationExprWith(astNode: import("../generated/ast").RelationExprWith): ProjectId;
|
|
477
|
+
parseCustomRelationProperties(custom: import("../generated/ast").CustomRelationProperties | undefined): import("type-fest").Except<ProjectId["customRelation"], "expr">;
|
|
444
478
|
parseRelationExprOrWhere(astNode: import("../generated/ast").RelationExprOrWhere): ProjectId;
|
|
445
479
|
parseRelationExprWhere(astNode: import("../generated/ast").RelationExprWhere): ProjectId;
|
|
446
480
|
parseRelationExpr(astNode: import("../generated/ast").RelationExpr): ProjectId;
|
|
@@ -469,16 +503,19 @@ declare const DocumentParserFromMixins: {
|
|
|
469
503
|
parseColorLiteral(astNode: import("../generated/ast").ColorLiteral): ProjectId | undefined;
|
|
470
504
|
parseElementStyle(elementProps: Array<import("../generated/ast").ElementProperty> | import("../generated/ast").ElementStyleProperty | undefined): import("../ast").ParsedElementStyle;
|
|
471
505
|
parseStyleProps(styleProps: Array<import("../generated/ast").StyleProperty> | undefined): import("../ast").ParsedElementStyle;
|
|
472
|
-
|
|
473
|
-
title?: string | undefined;
|
|
474
|
-
description?: string | undefined;
|
|
475
|
-
technology?: string | undefined;
|
|
476
|
-
}, bodyProps: {
|
|
506
|
+
parseBaseProps(props: {
|
|
477
507
|
title?: import("../generated/ast").MarkdownOrString | undefined;
|
|
508
|
+
summary?: import("../generated/ast").MarkdownOrString | undefined;
|
|
478
509
|
description?: import("../generated/ast").MarkdownOrString | undefined;
|
|
479
510
|
technology?: import("../generated/ast").MarkdownOrString | undefined;
|
|
511
|
+
}, override?: {
|
|
512
|
+
title?: string | undefined;
|
|
513
|
+
summary?: string | undefined;
|
|
514
|
+
description?: string | undefined;
|
|
515
|
+
technology?: string | undefined;
|
|
480
516
|
}): {
|
|
481
517
|
title?: string;
|
|
518
|
+
summary?: ProjectId;
|
|
482
519
|
description?: ProjectId;
|
|
483
520
|
technology?: string;
|
|
484
521
|
};
|
|
@@ -509,16 +546,19 @@ declare const DocumentParserFromMixins: {
|
|
|
509
546
|
parseColorLiteral(astNode: import("../generated/ast").ColorLiteral): ProjectId | undefined;
|
|
510
547
|
parseElementStyle(elementProps: Array<import("../generated/ast").ElementProperty> | import("../generated/ast").ElementStyleProperty | undefined): import("../ast").ParsedElementStyle;
|
|
511
548
|
parseStyleProps(styleProps: Array<import("../generated/ast").StyleProperty> | undefined): import("../ast").ParsedElementStyle;
|
|
512
|
-
|
|
513
|
-
title?: string | undefined;
|
|
514
|
-
description?: string | undefined;
|
|
515
|
-
technology?: string | undefined;
|
|
516
|
-
}, bodyProps: {
|
|
549
|
+
parseBaseProps(props: {
|
|
517
550
|
title?: import("../generated/ast").MarkdownOrString | undefined;
|
|
551
|
+
summary?: import("../generated/ast").MarkdownOrString | undefined;
|
|
518
552
|
description?: import("../generated/ast").MarkdownOrString | undefined;
|
|
519
553
|
technology?: import("../generated/ast").MarkdownOrString | undefined;
|
|
554
|
+
}, override?: {
|
|
555
|
+
title?: string | undefined;
|
|
556
|
+
summary?: string | undefined;
|
|
557
|
+
description?: string | undefined;
|
|
558
|
+
technology?: string | undefined;
|
|
520
559
|
}): {
|
|
521
560
|
title?: string;
|
|
561
|
+
summary?: ProjectId;
|
|
522
562
|
description?: ProjectId;
|
|
523
563
|
technology?: string;
|
|
524
564
|
};
|
|
@@ -536,6 +576,7 @@ declare const DocumentParserFromMixins: {
|
|
|
536
576
|
parseFqnExpressions(astNode: import("../generated/ast").FqnExpressions): ProjectId[];
|
|
537
577
|
parseRelationExprOrWith(astNode: import("../generated/ast").RelationExprOrWith): ProjectId;
|
|
538
578
|
parseRelationExprWith(astNode: import("../generated/ast").RelationExprWith): ProjectId;
|
|
579
|
+
parseCustomRelationProperties(custom: import("../generated/ast").CustomRelationProperties | undefined): import("type-fest").Except<ProjectId["customRelation"], "expr">;
|
|
539
580
|
parseRelationExprOrWhere(astNode: import("../generated/ast").RelationExprOrWhere): ProjectId;
|
|
540
581
|
parseRelationExprWhere(astNode: import("../generated/ast").RelationExprWhere): ProjectId;
|
|
541
582
|
parseRelationExpr(astNode: import("../generated/ast").RelationExpr): ProjectId;
|
|
@@ -564,16 +605,19 @@ declare const DocumentParserFromMixins: {
|
|
|
564
605
|
parseColorLiteral(astNode: import("../generated/ast").ColorLiteral): ProjectId | undefined;
|
|
565
606
|
parseElementStyle(elementProps: Array<import("../generated/ast").ElementProperty> | import("../generated/ast").ElementStyleProperty | undefined): import("../ast").ParsedElementStyle;
|
|
566
607
|
parseStyleProps(styleProps: Array<import("../generated/ast").StyleProperty> | undefined): import("../ast").ParsedElementStyle;
|
|
567
|
-
|
|
568
|
-
title?: string | undefined;
|
|
569
|
-
description?: string | undefined;
|
|
570
|
-
technology?: string | undefined;
|
|
571
|
-
}, bodyProps: {
|
|
608
|
+
parseBaseProps(props: {
|
|
572
609
|
title?: import("../generated/ast").MarkdownOrString | undefined;
|
|
610
|
+
summary?: import("../generated/ast").MarkdownOrString | undefined;
|
|
573
611
|
description?: import("../generated/ast").MarkdownOrString | undefined;
|
|
574
612
|
technology?: import("../generated/ast").MarkdownOrString | undefined;
|
|
613
|
+
}, override?: {
|
|
614
|
+
title?: string | undefined;
|
|
615
|
+
summary?: string | undefined;
|
|
616
|
+
description?: string | undefined;
|
|
617
|
+
technology?: string | undefined;
|
|
575
618
|
}): {
|
|
576
619
|
title?: string;
|
|
620
|
+
summary?: ProjectId;
|
|
577
621
|
description?: ProjectId;
|
|
578
622
|
technology?: string;
|
|
579
623
|
};
|
|
@@ -44,19 +44,25 @@ export declare class BaseParser {
|
|
|
44
44
|
parseElementStyle(elementProps: Array<ast.ElementProperty> | ast.ElementStyleProperty | undefined): ParsedElementStyle;
|
|
45
45
|
parseStyleProps(styleProps: Array<ast.StyleProperty> | undefined): ParsedElementStyle;
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
47
|
+
* Parse base properties: title, description and technology
|
|
48
|
+
*
|
|
49
|
+
* @param props - body properties (inside '{...}')
|
|
50
|
+
* @param override - optional, inline properties (right on the node)
|
|
51
|
+
* have higher priority and override body properties
|
|
49
52
|
*/
|
|
50
|
-
|
|
51
|
-
title?: string | undefined;
|
|
52
|
-
description?: string | undefined;
|
|
53
|
-
technology?: string | undefined;
|
|
54
|
-
}, bodyProps: {
|
|
53
|
+
parseBaseProps(props: {
|
|
55
54
|
title?: ast.MarkdownOrString | undefined;
|
|
55
|
+
summary?: ast.MarkdownOrString | undefined;
|
|
56
56
|
description?: ast.MarkdownOrString | undefined;
|
|
57
57
|
technology?: ast.MarkdownOrString | undefined;
|
|
58
|
+
}, override?: {
|
|
59
|
+
title?: string | undefined;
|
|
60
|
+
summary?: string | undefined;
|
|
61
|
+
description?: string | undefined;
|
|
62
|
+
technology?: string | undefined;
|
|
58
63
|
}): {
|
|
59
64
|
title?: string;
|
|
65
|
+
summary?: c4.MarkdownOrString;
|
|
60
66
|
description?: c4.MarkdownOrString;
|
|
61
67
|
technology?: string;
|
|
62
68
|
};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
exact,
|
|
3
|
+
GlobalFqn,
|
|
4
|
+
isNonEmptyArray,
|
|
5
|
+
nonexhaustive,
|
|
6
|
+
nonNullable
|
|
7
|
+
} from "@likec4/core";
|
|
2
8
|
import {
|
|
3
9
|
filter,
|
|
4
10
|
flatMap,
|
|
@@ -23,10 +29,11 @@ import {
|
|
|
23
29
|
parseMarkdownAsString,
|
|
24
30
|
toColor
|
|
25
31
|
} from "../../ast.mjs";
|
|
26
|
-
import {
|
|
32
|
+
import { serverLogger } from "../../logger.mjs";
|
|
27
33
|
import { projectIdFrom } from "../../utils/index.mjs";
|
|
28
34
|
import { readStrictFqn } from "../../utils/elementRef.mjs";
|
|
29
35
|
import { checksFromDiagnostics } from "../../validation/index.mjs";
|
|
36
|
+
const logger = serverLogger.getChild("BaseParser");
|
|
30
37
|
export function toSingleLine(str) {
|
|
31
38
|
if (str === null || str === void 0) {
|
|
32
39
|
return void 0;
|
|
@@ -104,10 +111,9 @@ export class BaseParser {
|
|
|
104
111
|
metadataAstNode.props,
|
|
105
112
|
map((p) => [p.key, removeIndent(p.value)]),
|
|
106
113
|
map(([key, value]) => [key, value.md || value.txt]),
|
|
107
|
-
filter(([_, value]) => isTruthy(value))
|
|
108
|
-
fromEntries()
|
|
114
|
+
filter(([_, value]) => isTruthy(value))
|
|
109
115
|
);
|
|
110
|
-
return
|
|
116
|
+
return data.length > 0 ? fromEntries(data) : void 0;
|
|
111
117
|
}
|
|
112
118
|
parseMarkdownOrString(markdownOrString) {
|
|
113
119
|
if (ast.isMarkdownOrString(markdownOrString)) {
|
|
@@ -132,7 +138,7 @@ export class BaseParser {
|
|
|
132
138
|
tags.push(...values);
|
|
133
139
|
}
|
|
134
140
|
}
|
|
135
|
-
} catch
|
|
141
|
+
} catch {
|
|
136
142
|
}
|
|
137
143
|
iter = iter.prev;
|
|
138
144
|
}
|
|
@@ -204,7 +210,7 @@ export class BaseParser {
|
|
|
204
210
|
const slashIndex = value.indexOf("/");
|
|
205
211
|
const aliasName = slashIndex > 0 ? value.substring(0, slashIndex) : value;
|
|
206
212
|
const remainingPath = slashIndex > 0 ? value.substring(slashIndex + 1) : "";
|
|
207
|
-
const imageAliases = { "@": "./images", ...this.project.config.imageAliases
|
|
213
|
+
const imageAliases = { "@": "./images", ...this.project.config.imageAliases };
|
|
208
214
|
const aliasPath = imageAliases[aliasName];
|
|
209
215
|
if (!aliasPath) {
|
|
210
216
|
logger.warn(`Image alias "${aliasName}" not found in project configuration`);
|
|
@@ -237,8 +243,8 @@ export class BaseParser {
|
|
|
237
243
|
return {};
|
|
238
244
|
}
|
|
239
245
|
if (isArray(elementProps)) {
|
|
240
|
-
const style = this.parseStyleProps(elementProps
|
|
241
|
-
const iconProp = this.parseIconProperty(elementProps
|
|
246
|
+
const style = this.parseStyleProps(elementProps.find(ast.isElementStyleProperty)?.props);
|
|
247
|
+
const iconProp = this.parseIconProperty(elementProps.find(ast.isIconProperty));
|
|
242
248
|
if (iconProp) {
|
|
243
249
|
style.icon = iconProp;
|
|
244
250
|
}
|
|
@@ -312,20 +318,25 @@ export class BaseParser {
|
|
|
312
318
|
nonexhaustive(prop);
|
|
313
319
|
}
|
|
314
320
|
}
|
|
315
|
-
return result;
|
|
321
|
+
return exact(result);
|
|
316
322
|
}
|
|
317
323
|
/**
|
|
318
|
-
*
|
|
319
|
-
*
|
|
324
|
+
* Parse base properties: title, description and technology
|
|
325
|
+
*
|
|
326
|
+
* @param props - body properties (inside '{...}')
|
|
327
|
+
* @param override - optional, inline properties (right on the node)
|
|
328
|
+
* have higher priority and override body properties
|
|
320
329
|
*/
|
|
321
|
-
|
|
322
|
-
const title = removeIndent(
|
|
323
|
-
const description =
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
+
parseBaseProps(props, override) {
|
|
331
|
+
const title = removeIndent(override?.title ?? parseMarkdownAsString(props.title));
|
|
332
|
+
const description = override?.description ? { txt: removeIndent(override.description) } : this.parseMarkdownOrString(props.description);
|
|
333
|
+
const summary = override?.summary ? { txt: removeIndent(override.summary) } : this.parseMarkdownOrString(props.summary);
|
|
334
|
+
const technology = toSingleLine(override?.technology) ?? removeIndent(parseMarkdownAsString(props.technology));
|
|
335
|
+
return exact({
|
|
336
|
+
title,
|
|
337
|
+
summary,
|
|
338
|
+
description,
|
|
339
|
+
technology
|
|
340
|
+
});
|
|
330
341
|
}
|
|
331
342
|
}
|
|
@@ -22,6 +22,7 @@ export declare function DeploymentModelParser<TBase extends WithExpressionV2>(B:
|
|
|
22
22
|
parseFqnExpressions(astNode: ast.FqnExpressions): c4.FqnExpr[];
|
|
23
23
|
parseRelationExprOrWith(astNode: ast.RelationExprOrWith): c4.RelationExpr.Any;
|
|
24
24
|
parseRelationExprWith(astNode: ast.RelationExprWith): c4.RelationExpr.Custom;
|
|
25
|
+
parseCustomRelationProperties(custom: ast.CustomRelationProperties | undefined): import("type-fest").Except<c4.RelationExpr.Custom["customRelation"], "expr">;
|
|
25
26
|
parseRelationExprOrWhere(astNode: ast.RelationExprOrWhere): c4.RelationExpr.OrWhere;
|
|
26
27
|
parseRelationExprWhere(astNode: ast.RelationExprWhere): c4.RelationExpr.Where;
|
|
27
28
|
parseRelationExpr(astNode: ast.RelationExpr): c4.RelationExpr.OrWhere;
|
|
@@ -50,16 +51,19 @@ export declare function DeploymentModelParser<TBase extends WithExpressionV2>(B:
|
|
|
50
51
|
parseColorLiteral(astNode: ast.ColorLiteral): c4.ColorLiteral | undefined;
|
|
51
52
|
parseElementStyle(elementProps: Array<ast.ElementProperty> | ast.ElementStyleProperty | undefined): import("../../ast").ParsedElementStyle;
|
|
52
53
|
parseStyleProps(styleProps: Array<ast.StyleProperty> | undefined): import("../../ast").ParsedElementStyle;
|
|
53
|
-
|
|
54
|
-
title?: string | undefined;
|
|
55
|
-
description?: string | undefined;
|
|
56
|
-
technology?: string | undefined;
|
|
57
|
-
}, bodyProps: {
|
|
54
|
+
parseBaseProps(props: {
|
|
58
55
|
title?: ast.MarkdownOrString | undefined;
|
|
56
|
+
summary?: ast.MarkdownOrString | undefined;
|
|
59
57
|
description?: ast.MarkdownOrString | undefined;
|
|
60
58
|
technology?: ast.MarkdownOrString | undefined;
|
|
59
|
+
}, override?: {
|
|
60
|
+
title?: string | undefined;
|
|
61
|
+
summary?: string | undefined;
|
|
62
|
+
description?: string | undefined;
|
|
63
|
+
technology?: string | undefined;
|
|
61
64
|
}): {
|
|
62
65
|
title?: string;
|
|
66
|
+
summary?: c4.MarkdownOrString;
|
|
63
67
|
description?: c4.MarkdownOrString;
|
|
64
68
|
technology?: string;
|
|
65
69
|
};
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
exact,
|
|
3
|
+
FqnRef,
|
|
4
|
+
invariant,
|
|
5
|
+
isNonEmptyArray,
|
|
6
|
+
LinkedList,
|
|
7
|
+
nameFromFqn,
|
|
8
|
+
nonexhaustive,
|
|
9
|
+
nonNullable
|
|
10
|
+
} from "@likec4/core";
|
|
11
|
+
import { loggable } from "@likec4/log";
|
|
12
|
+
import { filter, first, isDefined, isEmpty, isTruthy, mapToObj, pipe } from "remeda";
|
|
3
13
|
import {
|
|
4
14
|
ast,
|
|
5
|
-
|
|
15
|
+
toRelationshipStyle
|
|
6
16
|
} from "../../ast.mjs";
|
|
7
|
-
import {
|
|
17
|
+
import { serverLogger } from "../../logger.mjs";
|
|
8
18
|
import { stringHash } from "../../utils/stringHash.mjs";
|
|
19
|
+
const logger = serverLogger.getChild("DeploymentModelParser");
|
|
9
20
|
function* streamDeploymentModel(doc) {
|
|
10
21
|
const traverseStack = LinkedList.from(
|
|
11
22
|
doc.parseResult.value.deployments.flatMap((m) => m.elements)
|
|
@@ -58,7 +69,7 @@ export function DeploymentModelParser(B) {
|
|
|
58
69
|
nonexhaustive(el);
|
|
59
70
|
}
|
|
60
71
|
} catch (e) {
|
|
61
|
-
|
|
72
|
+
logger.warn(loggable(e));
|
|
62
73
|
}
|
|
63
74
|
}
|
|
64
75
|
}
|
|
@@ -75,23 +86,21 @@ export function DeploymentModelParser(B) {
|
|
|
75
86
|
filter(ast.isElementStringProperty),
|
|
76
87
|
mapToObj((p) => [p.key, p.value])
|
|
77
88
|
);
|
|
78
|
-
const { title, ...descAndTech } = this.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
bodyProps
|
|
83
|
-
);
|
|
89
|
+
const { title, ...descAndTech } = this.parseBaseProps(bodyProps, {
|
|
90
|
+
title: astNode.title,
|
|
91
|
+
summary: astNode.summary
|
|
92
|
+
});
|
|
84
93
|
const links = this.convertLinks(astNode.body);
|
|
85
|
-
return {
|
|
94
|
+
return exact({
|
|
86
95
|
id,
|
|
87
96
|
kind,
|
|
88
97
|
title: title ?? nameFromFqn(id),
|
|
89
|
-
...metadata && { metadata },
|
|
90
|
-
...tags && { tags },
|
|
91
|
-
...links && isNonEmptyArray(links) && { links },
|
|
92
98
|
...descAndTech,
|
|
93
|
-
|
|
94
|
-
|
|
99
|
+
tags: tags ?? void 0,
|
|
100
|
+
...links && isNonEmptyArray(links) && { links },
|
|
101
|
+
style,
|
|
102
|
+
metadata
|
|
103
|
+
});
|
|
95
104
|
}
|
|
96
105
|
parseDeployedInstance(astNode) {
|
|
97
106
|
const isValid = this.isValid;
|
|
@@ -107,22 +116,20 @@ export function DeploymentModelParser(B) {
|
|
|
107
116
|
filter(ast.isElementStringProperty),
|
|
108
117
|
mapToObj((p) => [p.key, p.value])
|
|
109
118
|
);
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
bodyProps
|
|
115
|
-
);
|
|
119
|
+
const baseProps = this.parseBaseProps(bodyProps, {
|
|
120
|
+
title: astNode.title,
|
|
121
|
+
summary: astNode.summary
|
|
122
|
+
});
|
|
116
123
|
const links = this.convertLinks(astNode.body);
|
|
117
|
-
return {
|
|
124
|
+
return exact({
|
|
118
125
|
id,
|
|
119
126
|
element: target,
|
|
120
|
-
|
|
121
|
-
...tags && { tags },
|
|
127
|
+
tags: tags ?? void 0,
|
|
122
128
|
...links && isNonEmptyArray(links) && { links },
|
|
123
|
-
...
|
|
124
|
-
style
|
|
125
|
-
|
|
129
|
+
...baseProps,
|
|
130
|
+
style,
|
|
131
|
+
metadata
|
|
132
|
+
});
|
|
126
133
|
}
|
|
127
134
|
parseExtendDeployment(astNode) {
|
|
128
135
|
if (!this.isValid(astNode)) {
|
|
@@ -140,8 +147,8 @@ export function DeploymentModelParser(B) {
|
|
|
140
147
|
id,
|
|
141
148
|
astPath,
|
|
142
149
|
...metadata && { metadata },
|
|
143
|
-
|
|
144
|
-
|
|
150
|
+
tags,
|
|
151
|
+
links: isNonEmptyArray(links) ? links : null
|
|
145
152
|
};
|
|
146
153
|
}
|
|
147
154
|
_resolveDeploymentRelationSource(node) {
|
|
@@ -175,16 +182,11 @@ export function DeploymentModelParser(B) {
|
|
|
175
182
|
const navigateTo = pipe(
|
|
176
183
|
astNode.body?.props ?? [],
|
|
177
184
|
filter(ast.isRelationNavigateToProperty),
|
|
178
|
-
map((p) => p.value.view.ref?.name),
|
|
179
|
-
filter(isTruthy),
|
|
180
185
|
first()
|
|
181
|
-
);
|
|
182
|
-
const titleDescAndTech = this.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
},
|
|
186
|
-
bodyProps
|
|
187
|
-
);
|
|
186
|
+
)?.value.view.ref?.name;
|
|
187
|
+
const titleDescAndTech = this.parseBaseProps(bodyProps, {
|
|
188
|
+
title: astNode.title
|
|
189
|
+
});
|
|
188
190
|
const styleProp = astNode.body?.props.find(ast.isRelationStyleProperty);
|
|
189
191
|
const id = stringHash(
|
|
190
192
|
"deployment",
|
|
@@ -192,19 +194,19 @@ export function DeploymentModelParser(B) {
|
|
|
192
194
|
source.deployment,
|
|
193
195
|
target.deployment
|
|
194
196
|
);
|
|
195
|
-
return {
|
|
197
|
+
return exact({
|
|
196
198
|
id,
|
|
197
199
|
source,
|
|
198
200
|
target,
|
|
199
201
|
...titleDescAndTech,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
202
|
+
metadata,
|
|
203
|
+
kind,
|
|
204
|
+
tags: tags ?? void 0,
|
|
203
205
|
...isNonEmptyArray(links) && { links },
|
|
204
|
-
...
|
|
205
|
-
|
|
206
|
+
...toRelationshipStyle(styleProp?.props, isValid),
|
|
207
|
+
navigateTo,
|
|
206
208
|
astPath
|
|
207
|
-
};
|
|
209
|
+
});
|
|
208
210
|
}
|
|
209
211
|
};
|
|
210
212
|
}
|