@domainlang/language 0.12.0 → 0.13.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/out/ast-augmentation.d.ts +7 -2
- package/out/diagram/context-map-diagram-generator.d.ts +9 -2
- package/out/diagram/context-map-diagram-generator.js +112 -63
- package/out/diagram/context-map-diagram-generator.js.map +1 -1
- package/out/generated/ast.d.ts +323 -51
- package/out/generated/ast.js +194 -33
- package/out/generated/ast.js.map +1 -1
- package/out/generated/grammar.js +418 -172
- package/out/generated/grammar.js.map +1 -1
- package/out/lsp/domain-lang-completion.js +39 -15
- package/out/lsp/domain-lang-completion.js.map +1 -1
- package/out/lsp/domain-lang-formatter.js +32 -0
- package/out/lsp/domain-lang-formatter.js.map +1 -1
- package/out/lsp/domain-lang-index-manager.d.ts +2 -3
- package/out/lsp/domain-lang-index-manager.js +5 -8
- package/out/lsp/domain-lang-index-manager.js.map +1 -1
- package/out/lsp/domain-lang-workspace-manager.d.ts +1 -1
- package/out/lsp/domain-lang-workspace-manager.js +2 -26
- package/out/lsp/domain-lang-workspace-manager.js.map +1 -1
- package/out/lsp/explain.js +9 -3
- package/out/lsp/explain.js.map +1 -1
- package/out/lsp/hover/domain-lang-hover.js +13 -11
- package/out/lsp/hover/domain-lang-hover.js.map +1 -1
- package/out/lsp/hover/domain-lang-keywords.js +29 -26
- package/out/lsp/hover/domain-lang-keywords.js.map +1 -1
- package/out/sdk/ast-augmentation.d.ts +29 -21
- package/out/sdk/ast-augmentation.js +11 -7
- package/out/sdk/ast-augmentation.js.map +1 -1
- package/out/sdk/index.d.ts +2 -2
- package/out/sdk/index.js +1 -1
- package/out/sdk/index.js.map +1 -1
- package/out/sdk/loader-node.js +2 -2
- package/out/sdk/loader-node.js.map +1 -1
- package/out/sdk/patterns.d.ts +50 -61
- package/out/sdk/patterns.js +92 -62
- package/out/sdk/patterns.js.map +1 -1
- package/out/sdk/query.js +54 -43
- package/out/sdk/query.js.map +1 -1
- package/out/sdk/serializers.js +20 -7
- package/out/sdk/serializers.js.map +1 -1
- package/out/sdk/types.d.ts +87 -18
- package/out/sdk/types.js.map +1 -1
- package/out/sdk/validator.js +48 -64
- package/out/sdk/validator.js.map +1 -1
- package/out/services/performance-optimizer.d.ts +3 -3
- package/out/services/performance-optimizer.js +1 -3
- package/out/services/performance-optimizer.js.map +1 -1
- package/out/services/relationship-inference.d.ts +4 -4
- package/out/services/relationship-inference.js +34 -46
- package/out/services/relationship-inference.js.map +1 -1
- package/out/syntaxes/domain-lang.monarch.js +1 -1
- package/out/syntaxes/domain-lang.monarch.js.map +1 -1
- package/out/utils/import-utils.d.ts +6 -20
- package/out/utils/import-utils.js +3 -63
- package/out/utils/import-utils.js.map +1 -1
- package/out/validation/constants.d.ts +23 -6
- package/out/validation/constants.js +24 -7
- package/out/validation/constants.js.map +1 -1
- package/out/validation/maps.js +10 -4
- package/out/validation/maps.js.map +1 -1
- package/out/validation/relationships.d.ts +4 -8
- package/out/validation/relationships.js +96 -48
- package/out/validation/relationships.js.map +1 -1
- package/package.json +1 -1
- package/src/ast-augmentation.ts +7 -2
- package/src/diagram/context-map-diagram-generator.ts +132 -70
- package/src/domain-lang.langium +62 -26
- package/src/generated/ast.ts +413 -63
- package/src/generated/grammar.ts +418 -172
- package/src/lsp/domain-lang-completion.ts +42 -15
- package/src/lsp/domain-lang-formatter.ts +34 -0
- package/src/lsp/domain-lang-index-manager.ts +6 -9
- package/src/lsp/domain-lang-workspace-manager.ts +3 -29
- package/src/lsp/explain.ts +10 -2
- package/src/lsp/hover/domain-lang-hover.ts +10 -8
- package/src/lsp/hover/domain-lang-keywords.ts +27 -24
- package/src/sdk/ast-augmentation.ts +30 -21
- package/src/sdk/index.ts +11 -1
- package/src/sdk/loader-node.ts +2 -2
- package/src/sdk/patterns.ts +114 -76
- package/src/sdk/query.ts +57 -48
- package/src/sdk/serializers.ts +20 -7
- package/src/sdk/types.ts +92 -17
- package/src/sdk/validator.ts +52 -69
- package/src/services/performance-optimizer.ts +4 -6
- package/src/services/relationship-inference.ts +43 -54
- package/src/utils/import-utils.ts +9 -74
- package/src/validation/constants.ts +32 -9
- package/src/validation/maps.ts +12 -4
- package/src/validation/relationships.ts +150 -71
package/out/sdk/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Provides interfaces for fluent query operations on DomainLang models.
|
|
4
4
|
*/
|
|
5
5
|
import type { AstNode, URI } from 'langium';
|
|
6
|
-
import type { BoundedContext, Classification, ContextMap, Domain, DomainMap, Model, NamespaceDeclaration, Relationship, Team } from '../generated/ast.js';
|
|
6
|
+
import type { BoundedContext, Classification, ContextMap, Domain, DomainMap, Model, NamespaceDeclaration, Relationship, SidePattern, Team } from '../generated/ast.js';
|
|
7
7
|
import type { DomainLangServices } from '../domain-lang-module.js';
|
|
8
8
|
import './ast-augmentation.js';
|
|
9
9
|
/**
|
|
@@ -239,29 +239,98 @@ export interface BcQueryBuilder extends QueryBuilder<BoundedContext> {
|
|
|
239
239
|
withMetadata(key: string, value?: string): BcQueryBuilder;
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
242
|
-
*
|
|
243
|
-
*
|
|
242
|
+
* One side of a relationship: the bounded context and its annotated integration patterns.
|
|
243
|
+
* For symmetric relationships `patterns` is always empty — the pattern lives on the relationship itself.
|
|
244
|
+
*/
|
|
245
|
+
export interface RelationshipSide {
|
|
246
|
+
/** The bounded context on this side */
|
|
247
|
+
readonly context: BoundedContext;
|
|
248
|
+
/** Integration patterns annotated on this side (directional relationships only) */
|
|
249
|
+
readonly patterns: readonly SidePattern[];
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* DDD kind of a directional relationship.
|
|
253
|
+
* Fully discriminates all three structural cases.
|
|
254
|
+
*/
|
|
255
|
+
export type DirectionalKind = 'UpstreamDownstream' | 'CustomerSupplier' | 'Bidirectional';
|
|
256
|
+
/**
|
|
257
|
+
* Directional relationship: has an arrow expressing dependency between two contexts.
|
|
258
|
+
* Discriminate on `type` to access directional or symmetric properties.
|
|
259
|
+
* Discriminate on `kind` to handle upstream/downstream vs customer/supplier vs bidirectional.
|
|
260
|
+
*/
|
|
261
|
+
export interface DirectionalRelationshipView {
|
|
262
|
+
readonly type: 'directional';
|
|
263
|
+
/** DDD semantic kind — determines which roles each side plays */
|
|
264
|
+
readonly kind: DirectionalKind;
|
|
265
|
+
/** Arrow as written in source (use for display/serialization) */
|
|
266
|
+
readonly arrow: '->' | '<-' | '<->';
|
|
267
|
+
/** Left side as written in source — always defined */
|
|
268
|
+
readonly left: RelationshipSide;
|
|
269
|
+
/** Right side as written in source — always defined */
|
|
270
|
+
readonly right: RelationshipSide;
|
|
271
|
+
/**
|
|
272
|
+
* The upstream (provider) side with its patterns.
|
|
273
|
+
* Defined when `kind` is `'UpstreamDownstream'` or `'CustomerSupplier'`.
|
|
274
|
+
* `undefined` when `kind` is `'Bidirectional'` — no upstream role exists.
|
|
275
|
+
*/
|
|
276
|
+
readonly upstream: RelationshipSide | undefined;
|
|
277
|
+
/**
|
|
278
|
+
* The downstream (consumer) side with its patterns.
|
|
279
|
+
* Defined when `kind` is `'UpstreamDownstream'` or `'CustomerSupplier'`.
|
|
280
|
+
* `undefined` when `kind` is `'Bidirectional'` — no downstream role exists.
|
|
281
|
+
*/
|
|
282
|
+
readonly downstream: RelationshipSide | undefined;
|
|
283
|
+
/** Source of the relationship definition */
|
|
284
|
+
readonly source: 'BoundedContext' | 'ContextMap';
|
|
285
|
+
/** Original AST relationship node */
|
|
286
|
+
readonly astNode: Relationship;
|
|
287
|
+
}
|
|
288
|
+
/** Resolved symmetric integration pattern kind. */
|
|
289
|
+
export type SymmetricKind = 'SharedKernel' | 'Partnership' | 'SeparateWays';
|
|
290
|
+
/**
|
|
291
|
+
* Symmetric relationship: no arrow; neither context is upstream or downstream.
|
|
292
|
+
* Discriminate on `type` to access directional or symmetric properties.
|
|
244
293
|
*/
|
|
245
|
-
export interface
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
readonly
|
|
252
|
-
/**
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
294
|
+
export interface SymmetricRelationshipView {
|
|
295
|
+
readonly type: 'symmetric';
|
|
296
|
+
/**
|
|
297
|
+
* Always-resolved symmetric integration pattern.
|
|
298
|
+
* `><` resolves to `'SeparateWays'`.
|
|
299
|
+
*/
|
|
300
|
+
readonly kind: SymmetricKind;
|
|
301
|
+
/**
|
|
302
|
+
* Left side as written in source.
|
|
303
|
+
* `patterns` is always empty — symmetric patterns attach to the relationship, not each side.
|
|
304
|
+
*/
|
|
305
|
+
readonly left: RelationshipSide;
|
|
306
|
+
/**
|
|
307
|
+
* Right side as written in source.
|
|
308
|
+
* `patterns` is always empty — symmetric patterns attach to the relationship, not each side.
|
|
309
|
+
*/
|
|
310
|
+
readonly right: RelationshipSide;
|
|
260
311
|
/** Source of the relationship definition */
|
|
261
312
|
readonly source: 'BoundedContext' | 'ContextMap';
|
|
262
313
|
/** Original AST relationship node */
|
|
263
314
|
readonly astNode: Relationship;
|
|
264
315
|
}
|
|
316
|
+
/**
|
|
317
|
+
* Unified view of a relationship between two BoundedContexts.
|
|
318
|
+
* Relationships can be defined in BoundedContext blocks or ContextMap.
|
|
319
|
+
* Discriminate on `type` to access directional or symmetric properties.
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* ```typescript
|
|
323
|
+
* for (const rel of query.relationships()) {
|
|
324
|
+
* if (rel.type === 'symmetric') {
|
|
325
|
+
* console.log(rel.kind); // 'SharedKernel' | 'Partnership' | 'SeparateWays'
|
|
326
|
+
* } else {
|
|
327
|
+
* console.log(rel.kind); // 'UpstreamDownstream' | 'CustomerSupplier' | 'Bidirectional'
|
|
328
|
+
* console.log(rel.arrow); // '->' | '<-' | '<->'
|
|
329
|
+
* }
|
|
330
|
+
* }
|
|
331
|
+
* ```
|
|
332
|
+
*/
|
|
333
|
+
export type RelationshipView = DirectionalRelationshipView | SymmetricRelationshipView;
|
|
265
334
|
/**
|
|
266
335
|
* Internal index structure for O(1) lookups.
|
|
267
336
|
* Not exported from public API.
|
package/out/sdk/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sdk/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sdk/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,oDAAoD;AACpD,iFAAiF;AACjF,OAAO,uBAAuB,CAAC"}
|
package/out/sdk/validator.js
CHANGED
|
@@ -27,6 +27,48 @@ function toValidationDiagnostic(diagnostic, file) {
|
|
|
27
27
|
column: diagnostic.range.start.character + 1,
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Collect errors and warnings from an array of Langium documents.
|
|
32
|
+
*/
|
|
33
|
+
function collectDiagnostics(allDocuments) {
|
|
34
|
+
const errors = [];
|
|
35
|
+
const warnings = [];
|
|
36
|
+
for (const doc of allDocuments) {
|
|
37
|
+
const diagnostics = doc.diagnostics ?? [];
|
|
38
|
+
const docPath = doc.uri.fsPath;
|
|
39
|
+
for (const diagnostic of diagnostics) {
|
|
40
|
+
const validationDiag = toValidationDiagnostic(diagnostic, docPath);
|
|
41
|
+
if (diagnostic.severity === 1) {
|
|
42
|
+
errors.push(validationDiag);
|
|
43
|
+
}
|
|
44
|
+
else if (diagnostic.severity === 2) {
|
|
45
|
+
warnings.push(validationDiag);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return { errors, warnings };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Count Domain and BoundedContext elements across all documents.
|
|
53
|
+
*/
|
|
54
|
+
function countModelElements(allDocuments) {
|
|
55
|
+
let domainCount = 0;
|
|
56
|
+
let bcCount = 0;
|
|
57
|
+
for (const doc of allDocuments) {
|
|
58
|
+
const model = doc.parseResult?.value;
|
|
59
|
+
if (isModel(model)) {
|
|
60
|
+
for (const element of model.children ?? []) {
|
|
61
|
+
if (element.$type === 'Domain') {
|
|
62
|
+
domainCount++;
|
|
63
|
+
}
|
|
64
|
+
else if (element.$type === 'BoundedContext') {
|
|
65
|
+
bcCount++;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return { domainCount, bcCount };
|
|
71
|
+
}
|
|
30
72
|
/**
|
|
31
73
|
* Validates a DomainLang model file and all its imports.
|
|
32
74
|
*
|
|
@@ -88,38 +130,9 @@ export async function validateFile(filePath, options = {}) {
|
|
|
88
130
|
// Build all documents with validation enabled
|
|
89
131
|
const allDocuments = Array.from(shared.workspace.LangiumDocuments.all);
|
|
90
132
|
await shared.workspace.DocumentBuilder.build(allDocuments, { validation: true });
|
|
91
|
-
// Collect diagnostics from all loaded documents (entry + imports)
|
|
92
|
-
const errors =
|
|
93
|
-
const
|
|
94
|
-
for (const doc of allDocuments) {
|
|
95
|
-
const diagnostics = doc.diagnostics ?? [];
|
|
96
|
-
const diagnosticFile = doc.uri.fsPath;
|
|
97
|
-
for (const diagnostic of diagnostics) {
|
|
98
|
-
const validationDiag = toValidationDiagnostic(diagnostic, diagnosticFile);
|
|
99
|
-
if (diagnostic.severity === 1) {
|
|
100
|
-
errors.push(validationDiag);
|
|
101
|
-
}
|
|
102
|
-
else if (diagnostic.severity === 2) {
|
|
103
|
-
warnings.push(validationDiag);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
// Count model elements across all documents
|
|
108
|
-
let domainCount = 0;
|
|
109
|
-
let bcCount = 0;
|
|
110
|
-
for (const doc of allDocuments) {
|
|
111
|
-
const model = doc.parseResult?.value;
|
|
112
|
-
if (isModel(model)) {
|
|
113
|
-
for (const element of model.children ?? []) {
|
|
114
|
-
if (element.$type === 'Domain') {
|
|
115
|
-
domainCount++;
|
|
116
|
-
}
|
|
117
|
-
else if (element.$type === 'BoundedContext') {
|
|
118
|
-
bcCount++;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
133
|
+
// Collect diagnostics and count elements from all loaded documents (entry + imports)
|
|
134
|
+
const { errors, warnings } = collectDiagnostics(allDocuments);
|
|
135
|
+
const { domainCount, bcCount } = countModelElements(allDocuments);
|
|
123
136
|
return {
|
|
124
137
|
valid: errors.length === 0,
|
|
125
138
|
fileCount: allDocuments.length,
|
|
@@ -207,38 +220,9 @@ export async function validateWorkspace(workspaceDir) {
|
|
|
207
220
|
// Build all documents with validation enabled
|
|
208
221
|
const allDocuments = Array.from(shared.workspace.LangiumDocuments.all);
|
|
209
222
|
await shared.workspace.DocumentBuilder.build(allDocuments, { validation: true });
|
|
210
|
-
// Collect diagnostics from ALL documents (not just entry)
|
|
211
|
-
const errors =
|
|
212
|
-
const
|
|
213
|
-
for (const doc of allDocuments) {
|
|
214
|
-
const diagnostics = doc.diagnostics ?? [];
|
|
215
|
-
const docPath = doc.uri.fsPath;
|
|
216
|
-
for (const diagnostic of diagnostics) {
|
|
217
|
-
const validationDiag = toValidationDiagnostic(diagnostic, docPath);
|
|
218
|
-
if (diagnostic.severity === 1) {
|
|
219
|
-
errors.push(validationDiag);
|
|
220
|
-
}
|
|
221
|
-
else if (diagnostic.severity === 2) {
|
|
222
|
-
warnings.push(validationDiag);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
// Count model elements across all documents
|
|
227
|
-
let domainCount = 0;
|
|
228
|
-
let bcCount = 0;
|
|
229
|
-
for (const doc of allDocuments) {
|
|
230
|
-
const model = doc.parseResult?.value;
|
|
231
|
-
if (isModel(model)) {
|
|
232
|
-
for (const element of model.children ?? []) {
|
|
233
|
-
if (element.$type === 'Domain') {
|
|
234
|
-
domainCount++;
|
|
235
|
-
}
|
|
236
|
-
else if (element.$type === 'BoundedContext') {
|
|
237
|
-
bcCount++;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
223
|
+
// Collect diagnostics and count elements from ALL documents (not just entry)
|
|
224
|
+
const { errors, warnings } = collectDiagnostics(allDocuments);
|
|
225
|
+
const { domainCount, bcCount } = countModelElements(allDocuments);
|
|
242
226
|
return {
|
|
243
227
|
valid: errors.length === 0,
|
|
244
228
|
fileCount: allDocuments.length,
|
package/out/sdk/validator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/sdk/validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA4CrC;;GAEG;AACH,SAAS,sBAAsB,CAC3B,UAAyG,EACzG,IAAY;IAEZ,OAAO;QACH,QAAQ,EAAE,UAAU,CAAC,QAAQ,IAAI,CAAC;QAClC,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,IAAI;QACJ,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC;QACrC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC;KAC/C,CAAC;AACN,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,KAAK,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
|
*/
|
|
21
21
|
export declare class PerformanceOptimizer {
|
|
22
|
-
private lockFileCache;
|
|
23
|
-
private manifestCache;
|
|
22
|
+
private readonly lockFileCache;
|
|
23
|
+
private readonly manifestCache;
|
|
24
24
|
/**
|
|
25
25
|
* Gets a lock file from cache or loads it from disk.
|
|
26
26
|
*/
|
|
@@ -28,7 +28,7 @@ export declare class PerformanceOptimizer {
|
|
|
28
28
|
/**
|
|
29
29
|
* Gets a manifest file from cache or loads it from disk.
|
|
30
30
|
*/
|
|
31
|
-
getCachedManifest(manifestPath: string): Promise<unknown
|
|
31
|
+
getCachedManifest(manifestPath: string): Promise<unknown>;
|
|
32
32
|
/**
|
|
33
33
|
* Invalidates cache for a specific workspace.
|
|
34
34
|
* Called when model.lock or model.yaml changes (event-based, PRS-017 R15).
|
|
@@ -106,9 +106,7 @@ let globalOptimizer;
|
|
|
106
106
|
* Gets the global performance optimizer instance.
|
|
107
107
|
*/
|
|
108
108
|
export function getGlobalOptimizer() {
|
|
109
|
-
|
|
110
|
-
globalOptimizer = new PerformanceOptimizer();
|
|
111
|
-
}
|
|
109
|
+
globalOptimizer ?? (globalOptimizer = new PerformanceOptimizer());
|
|
112
110
|
return globalOptimizer;
|
|
113
111
|
}
|
|
114
112
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performance-optimizer.js","sourceRoot":"","sources":["../../src/services/performance-optimizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAElC;;;;;;;;;GASG;AACH,MAAM,OAAO,oBAAoB;IAAjC;
|
|
1
|
+
{"version":3,"file":"performance-optimizer.js","sourceRoot":"","sources":["../../src/services/performance-optimizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAElC;;;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{ Model } from '../generated/ast.js';
|
|
2
2
|
/**
|
|
3
|
-
* Enriches relationships in the model by inferring relationship
|
|
4
|
-
* from
|
|
3
|
+
* Enriches relationships in the model by inferring relationship kinds
|
|
4
|
+
* from AST node type, patterns, and arrow direction.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* With the entity–relationship–entity grammar, symmetric relationships
|
|
7
|
+
* derive their kind directly from the AST node type (no heuristics).
|
|
8
8
|
*
|
|
9
9
|
* @param model - The root model to process
|
|
10
10
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { isBoundedContext, isContextMap, isNamespaceDeclaration } from '../generated/ast.js';
|
|
1
|
+
import { isBoundedContext, isContextMap, isNamespaceDeclaration, isDirectionalRelationship, isSymmetricRelationship, isSupplier, isCustomer } from '../generated/ast.js';
|
|
2
2
|
/**
|
|
3
|
-
* Enriches relationships in the model by inferring relationship
|
|
4
|
-
* from
|
|
3
|
+
* Enriches relationships in the model by inferring relationship kinds
|
|
4
|
+
* from AST node type, patterns, and arrow direction.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* With the entity–relationship–entity grammar, symmetric relationships
|
|
7
|
+
* derive their kind directly from the AST node type (no heuristics).
|
|
8
8
|
*
|
|
9
9
|
* @param model - The root model to process
|
|
10
10
|
*/
|
|
@@ -13,14 +13,11 @@ export function setInferredRelationshipTypes(model) {
|
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Recursively walks structure elements to find and enrich relationships.
|
|
16
|
-
*
|
|
17
|
-
* @param elements - Array of structure elements to process
|
|
18
|
-
* @param containerBc - Optional container bounded context (for nested contexts)
|
|
19
16
|
*/
|
|
20
|
-
function walkStructureElements(elements = [],
|
|
17
|
+
function walkStructureElements(elements = [], _containerBc) {
|
|
21
18
|
for (const element of elements) {
|
|
22
19
|
if (isNamespaceDeclaration(element)) {
|
|
23
|
-
walkStructureElements(element.children,
|
|
20
|
+
walkStructureElements(element.children, _containerBc);
|
|
24
21
|
}
|
|
25
22
|
else if (isBoundedContext(element)) {
|
|
26
23
|
processContextRelationships(element);
|
|
@@ -32,8 +29,6 @@ function walkStructureElements(elements = [], containerBc) {
|
|
|
32
29
|
}
|
|
33
30
|
/**
|
|
34
31
|
* Processes relationships within a bounded context.
|
|
35
|
-
*
|
|
36
|
-
* @param context - The bounded context to process
|
|
37
32
|
*/
|
|
38
33
|
function processContextRelationships(context) {
|
|
39
34
|
for (const rel of context.relationships) {
|
|
@@ -42,8 +37,6 @@ function processContextRelationships(context) {
|
|
|
42
37
|
}
|
|
43
38
|
/**
|
|
44
39
|
* Processes relationships within a context map.
|
|
45
|
-
*
|
|
46
|
-
* @param map - The context map to process
|
|
47
40
|
*/
|
|
48
41
|
function processMapRelationships(map) {
|
|
49
42
|
if (map.relationships) {
|
|
@@ -53,46 +46,41 @@ function processMapRelationships(map) {
|
|
|
53
46
|
}
|
|
54
47
|
}
|
|
55
48
|
/**
|
|
56
|
-
* Enriches a single relationship by inferring its
|
|
57
|
-
*
|
|
58
|
-
* @param rel - The relationship to enrich
|
|
49
|
+
* Enriches a single relationship by inferring its kind.
|
|
59
50
|
*/
|
|
60
51
|
function enrichRelationship(rel) {
|
|
61
|
-
if (
|
|
62
|
-
rel.
|
|
52
|
+
if (isSymmetricRelationship(rel)) {
|
|
53
|
+
rel.inferredKind = inferSymmetricKind(rel);
|
|
54
|
+
}
|
|
55
|
+
else if (isDirectionalRelationship(rel)) {
|
|
56
|
+
rel.inferredKind = inferDirectionalKind(rel);
|
|
63
57
|
}
|
|
64
58
|
}
|
|
65
59
|
/**
|
|
66
|
-
* Infers
|
|
67
|
-
*
|
|
68
|
-
* Inference rules:
|
|
69
|
-
* - `><` → SeparateWays
|
|
70
|
-
* - `<->` with P roles → Partnership
|
|
71
|
-
* - `<->` with SK roles → SharedKernel
|
|
72
|
-
* - `->` or `<-` → UpstreamDownstream
|
|
73
|
-
*
|
|
74
|
-
* @param relationship - The relationship to analyze
|
|
75
|
-
* @returns The inferred type or undefined if no rule matches
|
|
60
|
+
* Infers kind for symmetric relationships — derived from AST node type.
|
|
61
|
+
* No heuristics needed: the pattern is structurally part of the relationship.
|
|
76
62
|
*/
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (relationship.arrow === '><') {
|
|
81
|
-
return 'SeparateWays';
|
|
63
|
+
function inferSymmetricKind(rel) {
|
|
64
|
+
if (rel.pattern) {
|
|
65
|
+
return rel.pattern.$type; // 'SharedKernel', 'Partnership', or 'SeparateWays'
|
|
82
66
|
}
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
const bothPartners = leftPatterns.includes('P') && rightPatterns.includes('P');
|
|
86
|
-
if (noPatterns || bothPartners) {
|
|
87
|
-
return 'Partnership';
|
|
88
|
-
}
|
|
89
|
-
if (leftPatterns.includes('SK') && rightPatterns.includes('SK')) {
|
|
90
|
-
return 'SharedKernel';
|
|
91
|
-
}
|
|
67
|
+
if (rel.arrow === '><') {
|
|
68
|
+
return 'SeparateWays';
|
|
92
69
|
}
|
|
93
|
-
|
|
94
|
-
|
|
70
|
+
return 'SeparateWays'; // `><` is the only non-pattern symmetric form
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Infers kind for directional relationships from side patterns.
|
|
74
|
+
*
|
|
75
|
+
* - Customer/Supplier: has [S] or [C] patterns
|
|
76
|
+
* - UpstreamDownstream: default for all directional relationships
|
|
77
|
+
*/
|
|
78
|
+
function inferDirectionalKind(rel) {
|
|
79
|
+
const hasSupplier = rel.leftPatterns.some(isSupplier) || rel.rightPatterns.some(isSupplier);
|
|
80
|
+
const hasCustomer = rel.leftPatterns.some(isCustomer) || rel.rightPatterns.some(isCustomer);
|
|
81
|
+
if (hasSupplier || hasCustomer) {
|
|
82
|
+
return 'CustomerSupplier';
|
|
95
83
|
}
|
|
96
|
-
return
|
|
84
|
+
return 'UpstreamDownstream';
|
|
97
85
|
}
|
|
98
86
|
//# sourceMappingURL=relationship-inference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relationship-inference.js","sourceRoot":"","sources":["../../src/services/relationship-inference.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"relationship-inference.js","sourceRoot":"","sources":["../../src/services/relationship-inference.ts"],"names":[],"mappings":"AASA,OAAO,EACH,gBAAgB,EAChB,YAAY,EACZ,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,UAAU,EACV,UAAU,EACb,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;GAQG;AACH,MAAM,UAAU,4BAA4B,CAAC,KAAY;IACrD,qBAAqB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,SAAS,qBAAqB,CAC1B,WAA+B,EAAE,EACjC,YAA6B;IAE7B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC7B,IAAI,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;YAClC,qBAAqB,CAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC1D,CAAC;aAAM,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;YACnC,2BAA2B,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC;aAAM,IAAI,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;YAC/B,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;IACL,CAAC;AACL,CAAC;AAED;;GAEG;AACH,SAAS,2BAA2B,CAAC,OAAuB;IACxD,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;QACtC,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;AACL,CAAC;AAED;;GAEG;AACH,SAAS,uBAAuB,CAAC,GAAe;IAC5C,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC;QACpB,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,aAA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: [
|
|
4
|
-
'ACL', 'AntiCorruptionLayer', 'BBoM', 'BigBallOfMud', 'BoundedContext', 'CF', 'Classification', 'Conformist', 'ContextMap', '
|
|
4
|
+
'ACL', 'AntiCorruptionLayer', 'BBoM', 'BigBallOfMud', 'BoundedContext', 'C', 'CF', 'Classification', 'Conformist', 'ContextMap', 'Customer', 'Decision', 'Domain', 'DomainMap', 'Import', 'Metadata', 'Namespace', 'OHS', 'OpenHostService', 'P', 'PL', 'Partnership', 'Policy', 'PublishedLanguage', 'Rule', 'S', 'SK', 'SW', 'SeparateWays', 'SharedKernel', 'Supplier', 'Team', 'Term', 'aka', 'archetype', 'as', 'bc', 'businessModel', 'by', 'classification', 'cmap', 'contains', 'decision', 'decisions', 'description', 'dmap', 'dom', 'evolution', 'examples', 'for', 'glossary', 'import', 'in', 'integrations', 'is', 'meta', 'metadata', 'ns', 'policy', 'relationships', 'rule', 'rules', 'synonyms', 'team', 'term', 'terminology', 'this', 'type', 'vision'
|
|
5
5
|
],
|
|
6
6
|
operators: [
|
|
7
7
|
',', '->', '.', ':', '<-', '<->', '=', '><'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-lang.monarch.js","sourceRoot":"","sources":["../../src/syntaxes/domain-lang.monarch.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,eAAe;IACX,QAAQ,EAAE;QACN,KAAK,EAAC,qBAAqB,EAAC,MAAM,EAAC,cAAc,EAAC,gBAAgB,EAAC,IAAI,EAAC,gBAAgB,EAAC,YAAY,EAAC,YAAY,EAAC,
|
|
1
|
+
{"version":3,"file":"domain-lang.monarch.js","sourceRoot":"","sources":["../../src/syntaxes/domain-lang.monarch.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,eAAe;IACX,QAAQ,EAAE;QACN,KAAK,EAAC,qBAAqB,EAAC,MAAM,EAAC,cAAc,EAAC,gBAAgB,EAAC,GAAG,EAAC,IAAI,EAAC,gBAAgB,EAAC,YAAY,EAAC,Y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E,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,EAAC,OAAO,EAAC,UAAU,EAAC,EAAE,UAAU,EAAE,EAAC,OAAO,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE;SAC5G;QACD,UAAU,EAAE;YACR,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,OAAO,EAAC,OAAO,EAAC,EAAE;YAC3C,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAC,OAAO,EAAC,SAAS,EAAC,MAAM,EAAC,UAAU,EAAC,EAAE;YAChE,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,EAAC,OAAO,EAAC,SAAS,EAAC,EAAE;SACzD;QACD,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,EAAC,OAAO,EAAC,SAAS,EAAC,EAAE;YACjD,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAC,OAAO,EAAC,SAAS,EAAC,MAAM,EAAC,MAAM,EAAC,EAAE;YAC5D,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAC,OAAO,EAAC,SAAS,EAAC,EAAE;SAClD;KACJ;CACJ,CAAC"}
|
|
@@ -1,35 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ImportResolver } from '../services/import-resolver.js';
|
|
3
|
-
/**
|
|
4
|
-
* Resolves an import path to an absolute file URI.
|
|
5
|
-
*
|
|
6
|
-
* @deprecated Prefer using ImportResolver.resolveForDocument() from the DI container.
|
|
7
|
-
* This function creates standalone instances outside the DI system.
|
|
8
|
-
*
|
|
9
|
-
* @param importingDoc - The document containing the import statement
|
|
10
|
-
* @param rawImportPath - The raw import path from the import statement
|
|
11
|
-
* @returns Resolved URI to the imported file
|
|
12
|
-
* @throws {Error} If the import cannot be resolved
|
|
13
|
-
*/
|
|
14
|
-
export declare function resolveImportPath(importingDoc: LangiumDocument, rawImportPath: string): Promise<URI>;
|
|
1
|
+
import { type LangiumDocument, type LangiumDocuments } from 'langium';
|
|
2
|
+
import type { ImportResolver } from '../services/import-resolver.js';
|
|
15
3
|
/**
|
|
16
4
|
* Ensures the import graph is loaded from an entry file.
|
|
17
5
|
*
|
|
18
6
|
* @param entryFilePath - Absolute or workspace-relative path to entry file
|
|
19
7
|
* @param langiumDocuments - The Langium documents manager
|
|
20
|
-
* @param importResolver -
|
|
21
|
-
* uses it instead of creating standalone instances. Recommended for LSP contexts.
|
|
8
|
+
* @param importResolver - DI-injected ImportResolver from the language services
|
|
22
9
|
* @returns Set of URIs (as strings) for all documents in the import graph
|
|
23
10
|
* @throws {Error} If entry file cannot be resolved or loaded
|
|
24
11
|
*/
|
|
25
|
-
export declare function ensureImportGraphFromEntryFile(entryFilePath: string, langiumDocuments: LangiumDocuments, importResolver
|
|
12
|
+
export declare function ensureImportGraphFromEntryFile(entryFilePath: string, langiumDocuments: LangiumDocuments, importResolver: ImportResolver): Promise<Set<string>>;
|
|
26
13
|
/**
|
|
27
14
|
* Recursively builds the import graph from a document.
|
|
28
15
|
*
|
|
29
16
|
* @param document - The starting document
|
|
30
17
|
* @param langiumDocuments - The Langium documents manager
|
|
31
|
-
* @param importResolver -
|
|
32
|
-
* uses it instead of creating standalone instances. Recommended for LSP contexts.
|
|
18
|
+
* @param importResolver - DI-injected ImportResolver from the language services
|
|
33
19
|
* @returns Set of URIs (as strings) for all documents in the import graph
|
|
34
20
|
*/
|
|
35
|
-
export declare function ensureImportGraphFromDocument(document: LangiumDocument, langiumDocuments: LangiumDocuments, importResolver
|
|
21
|
+
export declare function ensureImportGraphFromDocument(document: LangiumDocument, langiumDocuments: LangiumDocuments, importResolver: ImportResolver): Promise<Set<string>>;
|