@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
|
@@ -1,67 +1,11 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { URI } from 'langium';
|
|
3
|
-
import { ManifestManager } from '../services/workspace-manager.js';
|
|
4
|
-
import { ImportResolver } from '../services/import-resolver.js';
|
|
5
|
-
/**
|
|
6
|
-
* Lazily initialized workspace manager for standalone (non-LSP) usage.
|
|
7
|
-
* Used by import graph building when no DI-injected ImportResolver is available.
|
|
8
|
-
*
|
|
9
|
-
* @deprecated Prefer passing an ImportResolver from the DI container.
|
|
10
|
-
* These singletons exist only for backwards compatibility with callers
|
|
11
|
-
* that haven't been updated to pass through DI services.
|
|
12
|
-
*/
|
|
13
|
-
let standaloneManifestManager;
|
|
14
|
-
let standaloneImportResolver;
|
|
15
|
-
let lastInitializedDir;
|
|
16
|
-
/**
|
|
17
|
-
* Gets or creates a standalone import resolver for non-LSP contexts.
|
|
18
|
-
* Creates its own ManifestManager if not previously initialized for this directory.
|
|
19
|
-
*
|
|
20
|
-
* @deprecated Prefer using services.imports.ImportResolver directly.
|
|
21
|
-
* @param startDir - Directory to start workspace search from
|
|
22
|
-
* @returns Promise resolving to the import resolver
|
|
23
|
-
*/
|
|
24
|
-
async function getStandaloneImportResolver(startDir) {
|
|
25
|
-
// Re-initialize if directory changed (workspace boundary)
|
|
26
|
-
if (lastInitializedDir !== startDir || !standaloneImportResolver) {
|
|
27
|
-
standaloneManifestManager = new ManifestManager();
|
|
28
|
-
try {
|
|
29
|
-
await standaloneManifestManager.initialize(startDir);
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
console.warn(`Failed to initialize workspace: ${error instanceof Error ? error.message : String(error)}`);
|
|
33
|
-
}
|
|
34
|
-
const services = {
|
|
35
|
-
imports: { ManifestManager: standaloneManifestManager }
|
|
36
|
-
};
|
|
37
|
-
standaloneImportResolver = new ImportResolver(services);
|
|
38
|
-
lastInitializedDir = startDir;
|
|
39
|
-
}
|
|
40
|
-
return standaloneImportResolver;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Resolves an import path to an absolute file URI.
|
|
44
|
-
*
|
|
45
|
-
* @deprecated Prefer using ImportResolver.resolveForDocument() from the DI container.
|
|
46
|
-
* This function creates standalone instances outside the DI system.
|
|
47
|
-
*
|
|
48
|
-
* @param importingDoc - The document containing the import statement
|
|
49
|
-
* @param rawImportPath - The raw import path from the import statement
|
|
50
|
-
* @returns Resolved URI to the imported file
|
|
51
|
-
* @throws {Error} If the import cannot be resolved
|
|
52
|
-
*/
|
|
53
|
-
export async function resolveImportPath(importingDoc, rawImportPath) {
|
|
54
|
-
const baseDir = path.dirname(importingDoc.uri.fsPath);
|
|
55
|
-
const resolver = await getStandaloneImportResolver(baseDir);
|
|
56
|
-
return resolver.resolveFrom(baseDir, rawImportPath);
|
|
57
|
-
}
|
|
58
3
|
/**
|
|
59
4
|
* Ensures the import graph is loaded from an entry file.
|
|
60
5
|
*
|
|
61
6
|
* @param entryFilePath - Absolute or workspace-relative path to entry file
|
|
62
7
|
* @param langiumDocuments - The Langium documents manager
|
|
63
|
-
* @param importResolver -
|
|
64
|
-
* uses it instead of creating standalone instances. Recommended for LSP contexts.
|
|
8
|
+
* @param importResolver - DI-injected ImportResolver from the language services
|
|
65
9
|
* @returns Set of URIs (as strings) for all documents in the import graph
|
|
66
10
|
* @throws {Error} If entry file cannot be resolved or loaded
|
|
67
11
|
*/
|
|
@@ -75,8 +19,7 @@ export async function ensureImportGraphFromEntryFile(entryFilePath, langiumDocum
|
|
|
75
19
|
*
|
|
76
20
|
* @param document - The starting document
|
|
77
21
|
* @param langiumDocuments - The Langium documents manager
|
|
78
|
-
* @param importResolver -
|
|
79
|
-
* uses it instead of creating standalone instances. Recommended for LSP contexts.
|
|
22
|
+
* @param importResolver - DI-injected ImportResolver from the language services
|
|
80
23
|
* @returns Set of URIs (as strings) for all documents in the import graph
|
|
81
24
|
*/
|
|
82
25
|
export async function ensureImportGraphFromDocument(document, langiumDocuments, importResolver) {
|
|
@@ -91,10 +34,7 @@ export async function ensureImportGraphFromDocument(document, langiumDocuments,
|
|
|
91
34
|
if (!imp.uri)
|
|
92
35
|
continue;
|
|
93
36
|
try {
|
|
94
|
-
|
|
95
|
-
const resolvedUri = importResolver
|
|
96
|
-
? await importResolver.resolveForDocument(doc, imp.uri)
|
|
97
|
-
: await resolveImportPath(doc, imp.uri);
|
|
37
|
+
const resolvedUri = await importResolver.resolveForDocument(doc, imp.uri);
|
|
98
38
|
const childDoc = await langiumDocuments.getOrCreateDocument(resolvedUri);
|
|
99
39
|
await visit(childDoc);
|
|
100
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-utils.js","sourceRoot":"","sources":["../../src/utils/import-utils.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,GAAG,EAA+C,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"import-utils.js","sourceRoot":"","sources":["../../src/utils/import-utils.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,GAAG,EAA+C,MAAM,SAAS,CAAC;AAI3E;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,aAAqB,EACrB,gBAAkC,EAClC,cAA8B;IAE9B,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACtE,OAAO,6BAA6B,CAAC,QAAQ,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;AACnF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,QAAyB,EACzB,gBAAkC,EAClC,cAA8B;IAE9B,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAElC,KAAK,UAAU,KAAK,CAAC,GAAoB;QACvC,MAAM,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QACrC,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;YAAE,OAAO;QACnC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAEvB,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,CAAC,KAAyB,CAAC;QACxD,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;YACtC,IAAI,CAAC,GAAG,CAAC,GAAG;gBAAE,SAAS;YAEvB,IAAI,CAAC;gBACH,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;gBAC1E,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;gBACzE,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;YACxB,CAAC;YAAC,MAAM,CAAC;gBACP,8DAA8D;YAChE,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;IACtB,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -35,9 +35,12 @@ export declare const IssueCodes: {
|
|
|
35
35
|
readonly BoundedContextNoDomain: "bounded-context-no-domain";
|
|
36
36
|
readonly BoundedContextClassificationConflict: "bounded-context-classification-conflict";
|
|
37
37
|
readonly BoundedContextTeamConflict: "bounded-context-team-conflict";
|
|
38
|
-
readonly SharedKernelNotBidirectional: "shared-kernel-not-bidirectional";
|
|
39
38
|
readonly AclOnWrongSide: "acl-on-wrong-side";
|
|
40
39
|
readonly ConformistOnWrongSide: "conformist-on-wrong-side";
|
|
40
|
+
readonly OhsOnWrongSide: "ohs-on-wrong-side";
|
|
41
|
+
readonly SupplierOnWrongSide: "supplier-on-wrong-side";
|
|
42
|
+
readonly CustomerOnWrongSide: "customer-on-wrong-side";
|
|
43
|
+
readonly SelfSymmetricRelationship: "self-symmetric-relationship";
|
|
41
44
|
readonly TooManyPatterns: "too-many-patterns";
|
|
42
45
|
readonly ContextMapNoContexts: "context-map-no-contexts";
|
|
43
46
|
readonly ContextMapNoRelationships: "context-map-no-relationships";
|
|
@@ -96,11 +99,6 @@ export declare const ValidationMessages: {
|
|
|
96
99
|
* @param fqn - The fully qualified name of the duplicate element
|
|
97
100
|
*/
|
|
98
101
|
readonly DUPLICATE_ELEMENT: (fqn: string) => string;
|
|
99
|
-
/**
|
|
100
|
-
* Warning when SharedKernel pattern uses incorrect arrow direction.
|
|
101
|
-
* SharedKernel requires bidirectional relationship.
|
|
102
|
-
*/
|
|
103
|
-
readonly SHARED_KERNEL_MUST_BE_BIDIRECTIONAL: (leftContext: string, rightContext: string, arrow: string) => string;
|
|
104
102
|
/**
|
|
105
103
|
* Warning when Anti-Corruption Layer is on the wrong side of relationship.
|
|
106
104
|
* ACL should protect the consuming context (downstream).
|
|
@@ -111,6 +109,25 @@ export declare const ValidationMessages: {
|
|
|
111
109
|
* Conformist accepts upstream model without translation.
|
|
112
110
|
*/
|
|
113
111
|
readonly CONFORMIST_ON_WRONG_SIDE: (context: string, side: "left" | "right") => string;
|
|
112
|
+
/**
|
|
113
|
+
* Warning when Open Host Service is on the wrong side of relationship.
|
|
114
|
+
* OHS should be on the upstream (providing) side.
|
|
115
|
+
*/
|
|
116
|
+
readonly OHS_ON_WRONG_SIDE: (context: string, side: "left" | "right") => string;
|
|
117
|
+
/**
|
|
118
|
+
* Error when Supplier is on the wrong side of relationship.
|
|
119
|
+
* Supplier must always be upstream.
|
|
120
|
+
*/
|
|
121
|
+
readonly SUPPLIER_ON_WRONG_SIDE: (context: string, _side: "left" | "right") => string;
|
|
122
|
+
/**
|
|
123
|
+
* Error when Customer is on the wrong side of relationship.
|
|
124
|
+
* Customer must always be downstream.
|
|
125
|
+
*/
|
|
126
|
+
readonly CUSTOMER_ON_WRONG_SIDE: (context: string, _side: "left" | "right") => string;
|
|
127
|
+
/**
|
|
128
|
+
* Warning when a symmetric relationship references the same context on both sides.
|
|
129
|
+
*/
|
|
130
|
+
readonly SELF_SYMMETRIC_RELATIONSHIP: (context: string) => string;
|
|
114
131
|
/**
|
|
115
132
|
* Info message when relationship has too many integration patterns.
|
|
116
133
|
* Suggests possible syntax confusion.
|
|
@@ -41,9 +41,12 @@ export const IssueCodes = {
|
|
|
41
41
|
BoundedContextClassificationConflict: 'bounded-context-classification-conflict',
|
|
42
42
|
BoundedContextTeamConflict: 'bounded-context-team-conflict',
|
|
43
43
|
// Integration Pattern Issues
|
|
44
|
-
SharedKernelNotBidirectional: 'shared-kernel-not-bidirectional',
|
|
45
44
|
AclOnWrongSide: 'acl-on-wrong-side',
|
|
46
45
|
ConformistOnWrongSide: 'conformist-on-wrong-side',
|
|
46
|
+
OhsOnWrongSide: 'ohs-on-wrong-side',
|
|
47
|
+
SupplierOnWrongSide: 'supplier-on-wrong-side',
|
|
48
|
+
CustomerOnWrongSide: 'customer-on-wrong-side',
|
|
49
|
+
SelfSymmetricRelationship: 'self-symmetric-relationship',
|
|
47
50
|
TooManyPatterns: 'too-many-patterns',
|
|
48
51
|
// Context/Domain Map Issues
|
|
49
52
|
ContextMapNoContexts: 'context-map-no-contexts',
|
|
@@ -135,11 +138,6 @@ export const ValidationMessages = {
|
|
|
135
138
|
// ========================================================================
|
|
136
139
|
// Integration Pattern & Relationship Validation
|
|
137
140
|
// ========================================================================
|
|
138
|
-
/**
|
|
139
|
-
* Warning when SharedKernel pattern uses incorrect arrow direction.
|
|
140
|
-
* SharedKernel requires bidirectional relationship.
|
|
141
|
-
*/
|
|
142
|
-
SHARED_KERNEL_MUST_BE_BIDIRECTIONAL: (leftContext, rightContext, arrow) => `SharedKernel between '${leftContext}' and '${rightContext}' requires bidirectional arrow '<->', not '${arrow}'.`,
|
|
143
141
|
/**
|
|
144
142
|
* Warning when Anti-Corruption Layer is on the wrong side of relationship.
|
|
145
143
|
* ACL should protect the consuming context (downstream).
|
|
@@ -150,6 +148,25 @@ export const ValidationMessages = {
|
|
|
150
148
|
* Conformist accepts upstream model without translation.
|
|
151
149
|
*/
|
|
152
150
|
CONFORMIST_ON_WRONG_SIDE: (context, side) => `Conformist (CF) on '${context}' should be on downstream (consuming) side, not ${side} side.`,
|
|
151
|
+
/**
|
|
152
|
+
* Warning when Open Host Service is on the wrong side of relationship.
|
|
153
|
+
* OHS should be on the upstream (providing) side.
|
|
154
|
+
*/
|
|
155
|
+
OHS_ON_WRONG_SIDE: (context, side) => `Open Host Service (OHS) on '${context}' should be on upstream (providing) side, not ${side} side.`,
|
|
156
|
+
/**
|
|
157
|
+
* Error when Supplier is on the wrong side of relationship.
|
|
158
|
+
* Supplier must always be upstream.
|
|
159
|
+
*/
|
|
160
|
+
SUPPLIER_ON_WRONG_SIDE: (context, _side) => `Supplier (S) on '${context}' must be on the upstream side. Supplier is always the provider in a Customer/Supplier relationship.`,
|
|
161
|
+
/**
|
|
162
|
+
* Error when Customer is on the wrong side of relationship.
|
|
163
|
+
* Customer must always be downstream.
|
|
164
|
+
*/
|
|
165
|
+
CUSTOMER_ON_WRONG_SIDE: (context, _side) => `Customer (C) on '${context}' must be on the downstream side. Customer is always the consumer in a Customer/Supplier relationship.`,
|
|
166
|
+
/**
|
|
167
|
+
* Warning when a symmetric relationship references the same context on both sides.
|
|
168
|
+
*/
|
|
169
|
+
SELF_SYMMETRIC_RELATIONSHIP: (context) => `Symmetric relationship with self: '${context}' has a symmetric relationship with itself. This is likely unintended.`,
|
|
153
170
|
/**
|
|
154
171
|
* Info message when relationship has too many integration patterns.
|
|
155
172
|
* Suggests possible syntax confusion.
|
|
@@ -244,7 +261,7 @@ export const ValidationMessages = {
|
|
|
244
261
|
* @param count - Number of contexts
|
|
245
262
|
*/
|
|
246
263
|
CONTEXT_MAP_NO_RELATIONSHIPS: (name, count) => `Context Map '${name}' contains ${count} contexts but no documented relationships.\n` +
|
|
247
|
-
`Hint: Add relationships to show how contexts integrate (e.g., '[OHS]
|
|
264
|
+
`Hint: Add relationships to show how contexts integrate (e.g., 'A [OHS] -> [CF] B').`,
|
|
248
265
|
/**
|
|
249
266
|
* Warning when a context map contains duplicate relationships.
|
|
250
267
|
* @param leftContext - Name of the left context
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/validation/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,+EAA+E;AAC/E,+BAA+B;AAC/B,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,6BAA6B;IAC7B,gBAAgB,EAAE,oBAAoB;IACtC,sBAAsB,EAAE,0BAA0B;IAClD,mBAAmB,EAAE,wBAAwB;IAC7C,kBAAkB,EAAE,sBAAsB;IAC1C,2BAA2B,EAAE,gCAAgC;IAC7D,yBAAyB,EAAE,+BAA+B;IAC1D,gBAAgB,EAAE,oBAAoB;IACtC,kBAAkB,EAAE,sBAAsB;IAC1C,sBAAsB,EAAE,0BAA0B;IAClD,gBAAgB,EAAE,mBAAmB;IACrC,mBAAmB,EAAE,uBAAuB;IAE5C,gBAAgB;IAChB,cAAc,EAAE,kBAAkB;IAClC,uBAAuB,EAAE,2BAA2B;IAEpD,yBAAyB;IACzB,2BAA2B,EAAE,gCAAgC;IAC7D,sBAAsB,EAAE,2BAA2B;IACnD,oCAAoC,EAAE,yCAAyC;IAC/E,0BAA0B,EAAE,+BAA+B;IAE3D,6BAA6B;IAC7B,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/validation/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,+EAA+E;AA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IACH,qBAAqB,EAAE,CAAC,YAAoB,EAAE,EAAE,CAC5C,0BAA0B,YAAY,KAAK;QAC3C,8EAA8E;IAElF,2EAA2E;IAC3E,sCAAsC;IACtC,2EAA2E;IAE3E;;;OAGG;IACH,uBAAuB,EAAE,CAAC,IAAY,EAAE,EAAE,CACtC,gBAAgB,IAAI,mCAAmC;QACvD,mFAAmF;IAEvF;;;;OAIG;IACH,4BAA4B,EAAE,CAAC,IAAY,EAAE,KAAa,EAAE,EAAE,CAC1D,gBAAgB,IAAI,cAAc,KAAK,8CAA8C;QACrF,qFAAqF;IAEzF;;;;OAIG;IACH,kCAAkC,EAAE,CAAC,WAAmB,EAAE,YAAoB,EAAE,EAAE,CAC9E,mCAAmC,WAAW,UAAU,YAAY,mBAAmB;IAE3F;;;OAGG;IACH,qBAAqB,EAAE,CAAC,IAAY,EAAE,EAAE,CACpC,eAAe,IAAI,0BAA0B;QAC7C,gFAAgF;IAEpF,2EAA2E;IAC3E,kCAAkC;IAClC,2EAA2E;IAE3E;;;;OAIG;IACH,oBAAoB,EAAE,CAAC,IAAY,EAAE,IAAY,EAAE,EAAE,CACjD,kCAAkC,IAAI,WAAW,IAAI,IAAI;IAE7D,2EAA2E;IAC3E,sBAAsB;IACtB,2EAA2E;IAE3E;;OAEG;IACH,qBAAqB,EAAE,GAAG,EAAE,CACxB,8BAA8B;QAC9B,yDAAyD;CACvD,CAAC"}
|
package/out/validation/maps.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isThisRef } from '../generated/ast.js';
|
|
1
|
+
import { isDirectionalRelationship, isSymmetricRelationship, isThisRef } from '../generated/ast.js';
|
|
2
2
|
import { ValidationMessages, buildCodeDescription, IssueCodes } from './constants.js';
|
|
3
3
|
/**
|
|
4
4
|
* Validates that a context map contains at least one bounded context.
|
|
@@ -114,9 +114,15 @@ function getRefKey(ref) {
|
|
|
114
114
|
function buildRelationshipKey(rel) {
|
|
115
115
|
const left = getRefKey(rel.left);
|
|
116
116
|
const right = getRefKey(rel.right);
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
const arrow = rel.arrow ?? '';
|
|
118
|
+
if (isDirectionalRelationship(rel)) {
|
|
119
|
+
const leftPatterns = rel.leftPatterns.map(p => p.$type).sort().join(',');
|
|
120
|
+
const rightPatterns = rel.rightPatterns.map(p => p.$type).sort().join(',');
|
|
121
|
+
return `[${leftPatterns}]${left}${arrow}[${rightPatterns}]${right}`;
|
|
122
|
+
}
|
|
123
|
+
// Symmetric relationship
|
|
124
|
+
const pattern = isSymmetricRelationship(rel) && rel.pattern ? rel.pattern.$type : '';
|
|
125
|
+
return `[${pattern}]${left}${arrow}${right}`;
|
|
120
126
|
}
|
|
121
127
|
/**
|
|
122
128
|
* Validates that a context map does not contain duplicate relationships.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maps.js","sourceRoot":"","sources":["../../src/validation/maps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"maps.js","sourceRoot":"","sources":["../../src/validation/maps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEtF;;;;;;GAMG;AACH,SAAS,6BAA6B,CAClC,GAAe,EACf,MAA0B;IAE1B,IAAI,CAAC,GAAG,CAAC,eAAe,IAAI,GAAG,CAAC,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,MAAM,CAAC,SAAS,EAAE,kBAAkB,CAAC,uBAAuB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACpE,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,UAAU;YACnB,eAAe,EAAE,oBAAoB,CAAC,aAAa,EAAE,cAAc,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C,EAAE,EAAE,CAAC;QAChD,MAAM,GAAG,GAAG,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,GAAG,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;QAEtC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAChB,MAAM,CAAC,SAAS,EAAE,kBAAkB,CAAC,kCAAkC,CACnE,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAC5C,EAAE;gBACC,IAAI,EAAE,GAAG;gBACT,QAAQ,EAAE,OAAO;gBACjB,eAAe,EAAE,oBAAoB,CAAC,aAAa,EAAE,cAAc,CAAC;aACvE,CAAC,CAAC;QACP,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACrB,CAAC;IACL,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,6BAA6B;IAC7B,4BAA4B;IAC5B,kCAAkC;IAClC,gCAAgC;CACnC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,2BAA2B;IAC3B,2BAA2B;CAC9B,CAAC"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import type { ValidationAcceptor } from 'langium';
|
|
2
2
|
import type { Relationship } from '../generated/ast.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @param relationship - The relationship to validate
|
|
8
|
-
* @param accept - The validation acceptor for reporting issues
|
|
4
|
+
* All relationship validation checks.
|
|
5
|
+
* Each function receives a Relationship (DirectionalRelationship | SymmetricRelationship)
|
|
6
|
+
* and guards internally for the correct subtype.
|
|
9
7
|
*/
|
|
10
|
-
declare
|
|
11
|
-
export declare const relationshipChecks: (typeof validateSharedKernelBidirectional)[];
|
|
12
|
-
export {};
|
|
8
|
+
export declare const relationshipChecks: Array<(relationship: Relationship, accept: ValidationAcceptor) => void>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { isThisRef } from '../generated/ast.js';
|
|
1
|
+
import { isThisRef, isDirectionalRelationship, isSymmetricRelationship, isAntiCorruptionLayer, isConformist, isOpenHostService, isSupplier, isCustomer, } from '../generated/ast.js';
|
|
2
2
|
import { ValidationMessages, buildCodeDescription } from './constants.js';
|
|
3
|
-
/**
|
|
4
|
-
* Gets a display name for a BoundedContextRef (handles 'this' and regular refs).
|
|
5
|
-
*/
|
|
6
3
|
function getContextName(ref) {
|
|
7
4
|
if (isThisRef(ref)) {
|
|
8
5
|
return 'this';
|
|
@@ -10,74 +7,106 @@ function getContextName(ref) {
|
|
|
10
7
|
return ref.link?.$refText ?? 'unknown';
|
|
11
8
|
}
|
|
12
9
|
/**
|
|
13
|
-
* Validates that
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @param relationship - The relationship to validate
|
|
17
|
-
* @param accept - The validation acceptor for reporting issues
|
|
18
|
-
*/
|
|
19
|
-
function validateSharedKernelBidirectional(relationship, accept) {
|
|
20
|
-
// Check if SharedKernel pattern exists on either side
|
|
21
|
-
const hasSharedKernelLeft = relationship.leftPatterns?.some(pattern => pattern === 'SK' || pattern === 'SharedKernel');
|
|
22
|
-
const hasSharedKernelRight = relationship.rightPatterns?.some(pattern => pattern === 'SK' || pattern === 'SharedKernel');
|
|
23
|
-
if ((hasSharedKernelLeft || hasSharedKernelRight) && relationship.arrow !== '<->') {
|
|
24
|
-
const leftName = getContextName(relationship.left);
|
|
25
|
-
const rightName = getContextName(relationship.right);
|
|
26
|
-
accept('warning', ValidationMessages.SHARED_KERNEL_MUST_BE_BIDIRECTIONAL(leftName, rightName, relationship.arrow), { node: relationship, property: 'arrow', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Validates that Anti-Corruption Layer (ACL) is on the consuming side.
|
|
31
|
-
* ACL protects downstream context from upstream changes.
|
|
32
|
-
*
|
|
33
|
-
* @param relationship - The relationship to validate
|
|
34
|
-
* @param accept - The validation acceptor for reporting issues
|
|
10
|
+
* Validates that ACL is on the downstream (consuming) side.
|
|
11
|
+
* ACL on upstream side of -> is a warning. ACL on upstream side of <- is also a warning.
|
|
35
12
|
*/
|
|
36
13
|
function validateACLPlacement(relationship, accept) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
14
|
+
if (!isDirectionalRelationship(relationship))
|
|
15
|
+
return;
|
|
16
|
+
const hasACLLeft = relationship.leftPatterns.some(isAntiCorruptionLayer);
|
|
17
|
+
const hasACLRight = relationship.rightPatterns.some(isAntiCorruptionLayer);
|
|
18
|
+
// For ->, left is upstream. ACL on upstream side is wrong.
|
|
40
19
|
if (hasACLLeft && relationship.arrow === '->') {
|
|
41
20
|
const leftName = getContextName(relationship.left);
|
|
42
21
|
accept('warning', ValidationMessages.ACL_ON_WRONG_SIDE(leftName, 'left'), { node: relationship, property: 'leftPatterns', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
43
22
|
}
|
|
44
|
-
//
|
|
23
|
+
// For <-, right is upstream. ACL on upstream side is wrong.
|
|
45
24
|
if (hasACLRight && relationship.arrow === '<-') {
|
|
46
25
|
const rightName = getContextName(relationship.right);
|
|
47
26
|
accept('warning', ValidationMessages.ACL_ON_WRONG_SIDE(rightName, 'right'), { node: relationship, property: 'rightPatterns', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
48
27
|
}
|
|
49
28
|
}
|
|
50
29
|
/**
|
|
51
|
-
* Validates that
|
|
52
|
-
* Conformist means accepting upstream model without translation.
|
|
53
|
-
*
|
|
54
|
-
* @param relationship - The relationship to validate
|
|
55
|
-
* @param accept - The validation acceptor for reporting issues
|
|
30
|
+
* Validates that CF is on the downstream (consuming) side.
|
|
56
31
|
*/
|
|
57
32
|
function validateConformistPlacement(relationship, accept) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
33
|
+
if (!isDirectionalRelationship(relationship))
|
|
34
|
+
return;
|
|
35
|
+
const hasCFLeft = relationship.leftPatterns.some(isConformist);
|
|
36
|
+
const hasCFRight = relationship.rightPatterns.some(isConformist);
|
|
61
37
|
if (hasCFLeft && relationship.arrow === '->') {
|
|
62
38
|
const leftName = getContextName(relationship.left);
|
|
63
39
|
accept('warning', ValidationMessages.CONFORMIST_ON_WRONG_SIDE(leftName, 'left'), { node: relationship, property: 'leftPatterns', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
64
40
|
}
|
|
65
|
-
// CF on right side with <- arrow means upstream is conformist (incorrect)
|
|
66
41
|
if (hasCFRight && relationship.arrow === '<-') {
|
|
67
42
|
const rightName = getContextName(relationship.right);
|
|
68
43
|
accept('warning', ValidationMessages.CONFORMIST_ON_WRONG_SIDE(rightName, 'right'), { node: relationship, property: 'rightPatterns', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
69
44
|
}
|
|
70
45
|
}
|
|
71
46
|
/**
|
|
72
|
-
* Validates that
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
47
|
+
* Validates that OHS is on the upstream (providing) side.
|
|
48
|
+
*/
|
|
49
|
+
function validateOHSPlacement(relationship, accept) {
|
|
50
|
+
if (!isDirectionalRelationship(relationship))
|
|
51
|
+
return;
|
|
52
|
+
// For ->, right is downstream. OHS on downstream side is wrong.
|
|
53
|
+
const hasOHSRight = relationship.rightPatterns.some(isOpenHostService);
|
|
54
|
+
if (hasOHSRight && relationship.arrow === '->') {
|
|
55
|
+
const rightName = getContextName(relationship.right);
|
|
56
|
+
accept('warning', ValidationMessages.OHS_ON_WRONG_SIDE(rightName, 'right'), { node: relationship, property: 'rightPatterns', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
57
|
+
}
|
|
58
|
+
// For <-, left is downstream. OHS on downstream side is wrong.
|
|
59
|
+
const hasOHSLeft = relationship.leftPatterns.some(isOpenHostService);
|
|
60
|
+
if (hasOHSLeft && relationship.arrow === '<-') {
|
|
61
|
+
const leftName = getContextName(relationship.left);
|
|
62
|
+
accept('warning', ValidationMessages.OHS_ON_WRONG_SIDE(leftName, 'left'), { node: relationship, property: 'leftPatterns', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Validates that Supplier is on the upstream side and Customer is on the downstream side.
|
|
67
|
+
* These are errors, not warnings — S/C have fixed placement.
|
|
68
|
+
*/
|
|
69
|
+
function validateCustomerSupplierPlacement(relationship, accept) {
|
|
70
|
+
if (!isDirectionalRelationship(relationship))
|
|
71
|
+
return;
|
|
72
|
+
// For ->, left is upstream, right is downstream
|
|
73
|
+
// Supplier must be upstream, Customer must be downstream
|
|
74
|
+
if (relationship.arrow === '->') {
|
|
75
|
+
if (relationship.rightPatterns.some(isSupplier)) {
|
|
76
|
+
accept('error', ValidationMessages.SUPPLIER_ON_WRONG_SIDE(getContextName(relationship.right), 'right'), { node: relationship, property: 'rightPatterns', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
77
|
+
}
|
|
78
|
+
if (relationship.leftPatterns.some(isCustomer)) {
|
|
79
|
+
accept('error', ValidationMessages.CUSTOMER_ON_WRONG_SIDE(getContextName(relationship.left), 'left'), { node: relationship, property: 'leftPatterns', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// For <-, right is upstream, left is downstream
|
|
83
|
+
if (relationship.arrow === '<-') {
|
|
84
|
+
if (relationship.leftPatterns.some(isSupplier)) {
|
|
85
|
+
accept('error', ValidationMessages.SUPPLIER_ON_WRONG_SIDE(getContextName(relationship.left), 'left'), { node: relationship, property: 'leftPatterns', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
86
|
+
}
|
|
87
|
+
if (relationship.rightPatterns.some(isCustomer)) {
|
|
88
|
+
accept('error', ValidationMessages.CUSTOMER_ON_WRONG_SIDE(getContextName(relationship.right), 'right'), { node: relationship, property: 'rightPatterns', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// <-> is bidirectional — Customer/Supplier is inherently directional and must not appear on a <-> arrow
|
|
92
|
+
if (relationship.arrow === '<->') {
|
|
93
|
+
const allPatterns = [...relationship.leftPatterns, ...relationship.rightPatterns];
|
|
94
|
+
if (allPatterns.some(isSupplier)) {
|
|
95
|
+
accept('error', 'Supplier [S] cannot be used on a bidirectional (<->) relationship — Customer/Supplier is inherently directional.', { node: relationship, property: relationship.leftPatterns.some(isSupplier) ? 'leftPatterns' : 'rightPatterns', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
96
|
+
}
|
|
97
|
+
if (allPatterns.some(isCustomer)) {
|
|
98
|
+
accept('error', 'Customer [C] cannot be used on a bidirectional (<->) relationship — Customer/Supplier is inherently directional.', { node: relationship, property: relationship.leftPatterns.some(isCustomer) ? 'leftPatterns' : 'rightPatterns', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Validates pattern count per side (info if > 3).
|
|
77
104
|
*/
|
|
78
105
|
function validatePatternCount(relationship, accept) {
|
|
79
|
-
|
|
80
|
-
|
|
106
|
+
if (!isDirectionalRelationship(relationship))
|
|
107
|
+
return;
|
|
108
|
+
const leftCount = relationship.leftPatterns.length;
|
|
109
|
+
const rightCount = relationship.rightPatterns.length;
|
|
81
110
|
if (leftCount > 3) {
|
|
82
111
|
accept('info', ValidationMessages.TOO_MANY_PATTERNS(leftCount, 'left'), { node: relationship, property: 'leftPatterns', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
83
112
|
}
|
|
@@ -85,10 +114,29 @@ function validatePatternCount(relationship, accept) {
|
|
|
85
114
|
accept('info', ValidationMessages.TOO_MANY_PATTERNS(rightCount, 'right'), { node: relationship, property: 'rightPatterns', codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
86
115
|
}
|
|
87
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Validates that symmetric relationships with self-reference produce a warning.
|
|
119
|
+
*/
|
|
120
|
+
function validateSelfSymmetric(relationship, accept) {
|
|
121
|
+
if (!isSymmetricRelationship(relationship))
|
|
122
|
+
return;
|
|
123
|
+
const leftName = getContextName(relationship.left);
|
|
124
|
+
const rightName = getContextName(relationship.right);
|
|
125
|
+
if (leftName === rightName) {
|
|
126
|
+
accept('warning', ValidationMessages.SELF_SYMMETRIC_RELATIONSHIP(leftName), { node: relationship, codeDescription: buildCodeDescription('language.md', 'integration-patterns') });
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* All relationship validation checks.
|
|
131
|
+
* Each function receives a Relationship (DirectionalRelationship | SymmetricRelationship)
|
|
132
|
+
* and guards internally for the correct subtype.
|
|
133
|
+
*/
|
|
88
134
|
export const relationshipChecks = [
|
|
89
|
-
validateSharedKernelBidirectional,
|
|
90
135
|
validateACLPlacement,
|
|
91
136
|
validateConformistPlacement,
|
|
92
|
-
|
|
137
|
+
validateOHSPlacement,
|
|
138
|
+
validateCustomerSupplierPlacement,
|
|
139
|
+
validatePatternCount,
|
|
140
|
+
validateSelfSymmetric,
|
|
93
141
|
];
|
|
94
142
|
//# sourceMappingURL=relationships.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relationships.js","sourceRoot":"","sources":["../../src/validation/relationships.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"relationships.js","sourceRoot":"","sources":["../../src/validation/relationships.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,SAAS,EACT,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,UAAU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
|
|
4
4
|
"displayName": "DomainLang Language",
|
|
5
5
|
"description": "Core language library for DomainLang - parse, validate, and query Domain-Driven Design models programmatically",
|
|
6
6
|
"author": "larsbaunwall",
|
package/src/ast-augmentation.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
declare module './generated/ast.js' {
|
|
2
|
-
interface
|
|
3
|
-
|
|
2
|
+
interface DirectionalRelationship {
|
|
3
|
+
/** SDK-inferred relationship kind based on patterns and arrow */
|
|
4
|
+
inferredKind?: string;
|
|
5
|
+
}
|
|
6
|
+
interface SymmetricRelationship {
|
|
7
|
+
/** SDK-inferred relationship kind from pattern or >< arrow */
|
|
8
|
+
inferredKind?: string;
|
|
4
9
|
}
|
|
5
10
|
}
|