@domainlang/language 0.5.2 → 0.6.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/domain-lang-module.js +3 -1
- package/out/domain-lang-module.js.map +1 -1
- package/out/generated/ast.d.ts +24 -0
- package/out/generated/ast.js.map +1 -1
- package/out/generated/grammar.js +22 -32
- package/out/generated/grammar.js.map +1 -1
- package/out/index.d.ts +2 -5
- package/out/index.js +10 -6
- package/out/index.js.map +1 -1
- package/out/lsp/domain-lang-code-actions.js +14 -8
- package/out/lsp/domain-lang-code-actions.js.map +1 -1
- package/out/lsp/domain-lang-completion.d.ts +3 -0
- package/out/lsp/domain-lang-completion.js +41 -13
- package/out/lsp/domain-lang-completion.js.map +1 -1
- package/out/lsp/domain-lang-formatter.js +24 -18
- package/out/lsp/domain-lang-formatter.js.map +1 -1
- package/out/lsp/domain-lang-index-manager.d.ts +102 -0
- package/out/lsp/domain-lang-index-manager.js +221 -0
- package/out/lsp/domain-lang-index-manager.js.map +1 -0
- package/out/lsp/domain-lang-scope.js +31 -17
- package/out/lsp/domain-lang-scope.js.map +1 -1
- package/out/lsp/domain-lang-workspace-manager.d.ts +51 -9
- package/out/lsp/domain-lang-workspace-manager.js +86 -63
- package/out/lsp/domain-lang-workspace-manager.js.map +1 -1
- package/out/lsp/hover/domain-lang-hover.d.ts +45 -1
- package/out/lsp/hover/domain-lang-hover.js +308 -232
- package/out/lsp/hover/domain-lang-hover.js.map +1 -1
- package/out/lsp/hover/domain-lang-keywords.d.ts +3 -7
- package/out/lsp/hover/domain-lang-keywords.js +115 -38
- package/out/lsp/hover/domain-lang-keywords.js.map +1 -1
- package/out/lsp/manifest-diagnostics.js +95 -50
- package/out/lsp/manifest-diagnostics.js.map +1 -1
- package/out/main.js +109 -17
- package/out/main.js.map +1 -1
- package/out/services/import-resolver.d.ts +16 -2
- package/out/services/import-resolver.js +37 -11
- package/out/services/import-resolver.js.map +1 -1
- package/out/services/types.d.ts +2 -2
- package/out/services/workspace-manager.d.ts +33 -31
- package/out/services/workspace-manager.js +92 -148
- package/out/services/workspace-manager.js.map +1 -1
- package/out/utils/document-utils.d.ts +41 -0
- package/out/utils/document-utils.js +64 -0
- package/out/utils/document-utils.js.map +1 -0
- package/out/utils/import-utils.d.ts +0 -17
- package/out/utils/import-utils.js +2 -32
- package/out/utils/import-utils.js.map +1 -1
- package/out/utils/manifest-utils.d.ts +56 -0
- package/out/utils/manifest-utils.js +119 -0
- package/out/utils/manifest-utils.js.map +1 -0
- package/out/validation/import.d.ts +1 -2
- package/out/validation/import.js +33 -20
- package/out/validation/import.js.map +1 -1
- package/package.json +1 -1
- package/src/domain-lang-module.ts +4 -1
- package/src/domain-lang.langium +37 -13
- package/src/generated/ast.ts +24 -0
- package/src/generated/grammar.ts +22 -32
- package/src/index.ts +12 -6
- package/src/lsp/domain-lang-code-actions.ts +13 -8
- package/src/lsp/domain-lang-completion.ts +61 -13
- package/src/lsp/domain-lang-formatter.ts +28 -23
- package/src/lsp/domain-lang-index-manager.ts +256 -0
- package/src/lsp/domain-lang-scope.ts +29 -17
- package/src/lsp/domain-lang-workspace-manager.ts +89 -66
- package/src/lsp/hover/domain-lang-hover.ts +332 -226
- package/src/lsp/hover/domain-lang-keywords.ts +129 -43
- package/src/lsp/manifest-diagnostics.ts +100 -59
- package/src/main.ts +127 -16
- package/src/services/import-resolver.ts +39 -11
- package/src/services/types.ts +2 -2
- package/src/services/workspace-manager.ts +101 -175
- package/src/utils/document-utils.ts +80 -0
- package/src/utils/import-utils.ts +2 -40
- package/src/utils/manifest-utils.ts +132 -0
- package/src/validation/import.ts +32 -22
- package/out/lsp/hover/ddd-pattern-explanations.d.ts +0 -50
- package/out/lsp/hover/ddd-pattern-explanations.js +0 -196
- package/out/lsp/hover/ddd-pattern-explanations.js.map +0 -1
- package/out/services/dependency-analyzer.d.ts +0 -58
- package/out/services/dependency-analyzer.js +0 -254
- package/out/services/dependency-analyzer.js.map +0 -1
- package/out/services/dependency-resolver.d.ts +0 -146
- package/out/services/dependency-resolver.js +0 -452
- package/out/services/dependency-resolver.js.map +0 -1
- package/out/services/git-url-resolver.browser.d.ts +0 -10
- package/out/services/git-url-resolver.browser.js +0 -19
- package/out/services/git-url-resolver.browser.js.map +0 -1
- package/out/services/git-url-resolver.d.ts +0 -158
- package/out/services/git-url-resolver.js +0 -416
- package/out/services/git-url-resolver.js.map +0 -1
- package/out/services/governance-validator.d.ts +0 -44
- package/out/services/governance-validator.js +0 -153
- package/out/services/governance-validator.js.map +0 -1
- package/out/services/semver.d.ts +0 -98
- package/out/services/semver.js +0 -195
- package/out/services/semver.js.map +0 -1
- package/src/lsp/hover/ddd-pattern-explanations.ts +0 -237
- package/src/services/dependency-analyzer.ts +0 -321
- package/src/services/dependency-resolver.ts +0 -551
- package/src/services/git-url-resolver.browser.ts +0 -26
- package/src/services/git-url-resolver.ts +0 -517
- package/src/services/governance-validator.ts +0 -177
- package/src/services/semver.ts +0 -213
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ModelManifest } from '../services/types.js';
|
|
2
|
+
declare const DEFAULT_MANIFEST_FILENAME = "model.yaml";
|
|
3
|
+
declare const DEFAULT_ENTRY_FILE = "index.dlang";
|
|
4
|
+
/**
|
|
5
|
+
* Checks if a file exists at the given path.
|
|
6
|
+
*/
|
|
7
|
+
export declare function fileExists(targetPath: string): Promise<boolean>;
|
|
8
|
+
/**
|
|
9
|
+
* Finds the nearest model.yaml manifest by walking up from startPath.
|
|
10
|
+
*
|
|
11
|
+
* @param startPath - Directory to start searching from
|
|
12
|
+
* @returns Absolute path to model.yaml, or undefined if not found
|
|
13
|
+
*/
|
|
14
|
+
export declare function findNearestManifest(startPath: string): Promise<string | undefined>;
|
|
15
|
+
/**
|
|
16
|
+
* Finds the workspace root (directory containing model.yaml).
|
|
17
|
+
*
|
|
18
|
+
* @param startPath - Directory to start searching from
|
|
19
|
+
* @returns Absolute path to workspace root, or undefined if no manifest found
|
|
20
|
+
*/
|
|
21
|
+
export declare function findWorkspaceRoot(startPath: string): Promise<string | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* Reads and parses a model.yaml manifest.
|
|
24
|
+
*
|
|
25
|
+
* @param manifestPath - Absolute path to model.yaml
|
|
26
|
+
* @returns Parsed manifest, or undefined if file doesn't exist
|
|
27
|
+
* @throws Error if file exists but cannot be parsed
|
|
28
|
+
*/
|
|
29
|
+
export declare function readManifest(manifestPath: string): Promise<ModelManifest | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* Reads the entry point from a manifest file.
|
|
32
|
+
*
|
|
33
|
+
* @param manifestPath - Absolute path to model.yaml
|
|
34
|
+
* @returns Entry file path (relative), defaults to 'index.dlang'
|
|
35
|
+
*/
|
|
36
|
+
export declare function readEntryFromManifest(manifestPath: string): Promise<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Gets the absolute entry file path for a manifest.
|
|
39
|
+
*
|
|
40
|
+
* @param manifestPath - Absolute path to model.yaml
|
|
41
|
+
* @returns Absolute path to the entry file
|
|
42
|
+
*/
|
|
43
|
+
export declare function getEntryPath(manifestPath: string): Promise<string>;
|
|
44
|
+
/**
|
|
45
|
+
* Discovers all manifest files within given directories.
|
|
46
|
+
* Only checks direct children, not recursive subdirectories.
|
|
47
|
+
*
|
|
48
|
+
* @param directories - Array of absolute directory paths to search
|
|
49
|
+
* @returns Array of manifest info objects
|
|
50
|
+
*/
|
|
51
|
+
export declare function findManifestsInDirectories(directories: string[]): Promise<Array<{
|
|
52
|
+
manifestPath: string;
|
|
53
|
+
entryPath: string;
|
|
54
|
+
}>>;
|
|
55
|
+
/** Default manifest filename */
|
|
56
|
+
export { DEFAULT_MANIFEST_FILENAME, DEFAULT_ENTRY_FILE };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import YAML from 'yaml';
|
|
4
|
+
const DEFAULT_MANIFEST_FILENAME = 'model.yaml';
|
|
5
|
+
const DEFAULT_ENTRY_FILE = 'index.dlang';
|
|
6
|
+
/**
|
|
7
|
+
* Checks if a file exists at the given path.
|
|
8
|
+
*/
|
|
9
|
+
export async function fileExists(targetPath) {
|
|
10
|
+
try {
|
|
11
|
+
await fs.access(targetPath);
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
if (error?.code === 'ENOENT') {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Finds the nearest model.yaml manifest by walking up from startPath.
|
|
23
|
+
*
|
|
24
|
+
* @param startPath - Directory to start searching from
|
|
25
|
+
* @returns Absolute path to model.yaml, or undefined if not found
|
|
26
|
+
*/
|
|
27
|
+
export async function findNearestManifest(startPath) {
|
|
28
|
+
let current = path.resolve(startPath);
|
|
29
|
+
const { root } = path.parse(current);
|
|
30
|
+
while (true) {
|
|
31
|
+
const candidate = path.join(current, DEFAULT_MANIFEST_FILENAME);
|
|
32
|
+
if (await fileExists(candidate)) {
|
|
33
|
+
return candidate;
|
|
34
|
+
}
|
|
35
|
+
if (current === root) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const parent = path.dirname(current);
|
|
39
|
+
if (parent === current) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
current = parent;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Finds the workspace root (directory containing model.yaml).
|
|
47
|
+
*
|
|
48
|
+
* @param startPath - Directory to start searching from
|
|
49
|
+
* @returns Absolute path to workspace root, or undefined if no manifest found
|
|
50
|
+
*/
|
|
51
|
+
export async function findWorkspaceRoot(startPath) {
|
|
52
|
+
const manifestPath = await findNearestManifest(startPath);
|
|
53
|
+
return manifestPath ? path.dirname(manifestPath) : undefined;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Reads and parses a model.yaml manifest.
|
|
57
|
+
*
|
|
58
|
+
* @param manifestPath - Absolute path to model.yaml
|
|
59
|
+
* @returns Parsed manifest, or undefined if file doesn't exist
|
|
60
|
+
* @throws Error if file exists but cannot be parsed
|
|
61
|
+
*/
|
|
62
|
+
export async function readManifest(manifestPath) {
|
|
63
|
+
try {
|
|
64
|
+
const content = await fs.readFile(manifestPath, 'utf-8');
|
|
65
|
+
return (YAML.parse(content) ?? {});
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
if (error?.code === 'ENOENT') {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Reads the entry point from a manifest file.
|
|
76
|
+
*
|
|
77
|
+
* @param manifestPath - Absolute path to model.yaml
|
|
78
|
+
* @returns Entry file path (relative), defaults to 'index.dlang'
|
|
79
|
+
*/
|
|
80
|
+
export async function readEntryFromManifest(manifestPath) {
|
|
81
|
+
try {
|
|
82
|
+
const manifest = await readManifest(manifestPath);
|
|
83
|
+
return manifest?.model?.entry ?? DEFAULT_ENTRY_FILE;
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return DEFAULT_ENTRY_FILE;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Gets the absolute entry file path for a manifest.
|
|
91
|
+
*
|
|
92
|
+
* @param manifestPath - Absolute path to model.yaml
|
|
93
|
+
* @returns Absolute path to the entry file
|
|
94
|
+
*/
|
|
95
|
+
export async function getEntryPath(manifestPath) {
|
|
96
|
+
const entry = await readEntryFromManifest(manifestPath);
|
|
97
|
+
return path.resolve(path.dirname(manifestPath), entry);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Discovers all manifest files within given directories.
|
|
101
|
+
* Only checks direct children, not recursive subdirectories.
|
|
102
|
+
*
|
|
103
|
+
* @param directories - Array of absolute directory paths to search
|
|
104
|
+
* @returns Array of manifest info objects
|
|
105
|
+
*/
|
|
106
|
+
export async function findManifestsInDirectories(directories) {
|
|
107
|
+
const results = [];
|
|
108
|
+
for (const dir of directories) {
|
|
109
|
+
const manifestPath = await findNearestManifest(dir);
|
|
110
|
+
if (manifestPath) {
|
|
111
|
+
const entryPath = await getEntryPath(manifestPath);
|
|
112
|
+
results.push({ manifestPath, entryPath });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return results;
|
|
116
|
+
}
|
|
117
|
+
/** Default manifest filename */
|
|
118
|
+
export { DEFAULT_MANIFEST_FILENAME, DEFAULT_ENTRY_FILE };
|
|
119
|
+
//# sourceMappingURL=manifest-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-utils.js","sourceRoot":"","sources":["../../src/utils/manifest-utils.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,MAAM,yBAAyB,GAAG,YAAY,CAAC;AAC/C,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,UAAkB;IAC/C,IAAI,CAAC;QACD,MAAM,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,IAAK,KAA+B,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtD,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,MAAM,KAAK,CAAC;IAChB,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,SAAiB;IACvD,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACtC,MAAM,EAAE,IAAI,EAAE,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AU,qBAAqB,CAAC,YAAoB;IAC5D,IAAI,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC,CAAC;QAClD,OAAO,QAAQ,EAAE,KAAK,EAAE,KAAK,IAAI,kBAAkB,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,kBAAkB,CAAC;IAC9B,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,YAAoB;IACnD,MAAM,KAAK,GAAG,MAAM,qBAAqB,CAAC,YAAY,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC5C,WAAqB;IAErB,MAAM,OAAO,GAAuD,EAAE,CAAC;IAEvE,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC5B,MAAM,YAAY,GAAG,MAAM,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACpD,IAAI,YAAY,EAAE,CAAC;YACf,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC,CAAC;YACnD,OAAO,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAC;QAC9C,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,gCAAgC;AAChC,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { ValidationAcceptor, ValidationChecks } from 'langium';
|
|
1
|
+
import type { ValidationAcceptor, ValidationChecks, LangiumDocument } from 'langium';
|
|
2
2
|
import { Cancellation } from 'langium';
|
|
3
3
|
import type { DomainLangAstType, ImportStatement } from '../generated/ast.js';
|
|
4
4
|
import type { DomainLangServices } from '../domain-lang-module.js';
|
|
5
|
-
import type { LangiumDocument } from 'langium';
|
|
6
5
|
/**
|
|
7
6
|
* Validates import statements in DomainLang.
|
|
8
7
|
*
|
package/out/validation/import.js
CHANGED
|
@@ -155,16 +155,23 @@ export class ImportValidator {
|
|
|
155
155
|
});
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
158
|
+
try {
|
|
159
|
+
const workspaceRoot = this.workspaceManager.getWorkspaceRoot();
|
|
160
|
+
const resolvedPath = path.resolve(workspaceRoot, dependencyPath);
|
|
161
|
+
const relativeToWorkspace = path.relative(workspaceRoot, resolvedPath);
|
|
162
|
+
if (relativeToWorkspace.startsWith('..') || path.isAbsolute(relativeToWorkspace)) {
|
|
163
|
+
accept('error', ValidationMessages.IMPORT_ESCAPES_WORKSPACE(alias), {
|
|
164
|
+
node: imp,
|
|
165
|
+
property: 'uri',
|
|
166
|
+
codeDescription: buildCodeDescription('language.md', 'imports'),
|
|
167
|
+
data: { code: IssueCodes.ImportEscapesWorkspace, alias }
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
// WorkspaceManager not initialized - skip workspace boundary check
|
|
173
|
+
// This can happen for standalone files without model.yaml
|
|
174
|
+
console.warn(`Could not validate workspace boundary for path dependency: ${error}`);
|
|
168
175
|
}
|
|
169
176
|
}
|
|
170
177
|
/**
|
|
@@ -183,16 +190,22 @@ export class ImportValidator {
|
|
|
183
190
|
});
|
|
184
191
|
return;
|
|
185
192
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
try {
|
|
194
|
+
const workspaceRoot = this.workspaceManager.getWorkspaceRoot();
|
|
195
|
+
const cacheDir = this.getCacheDirectory(workspaceRoot, packageKey, lockedDep.commit);
|
|
196
|
+
const cacheExists = await this.directoryExists(cacheDir);
|
|
197
|
+
if (!cacheExists) {
|
|
198
|
+
accept('error', ValidationMessages.IMPORT_NOT_INSTALLED(alias), {
|
|
199
|
+
node: imp,
|
|
200
|
+
property: 'uri',
|
|
201
|
+
codeDescription: buildCodeDescription('language.md', 'imports'),
|
|
202
|
+
data: { code: IssueCodes.ImportNotInstalled, alias }
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
// WorkspaceManager not initialized - log warning but continue
|
|
208
|
+
console.warn(`Could not validate cached package for ${alias}: ${error}`);
|
|
196
209
|
}
|
|
197
210
|
}
|
|
198
211
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/validation/import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/validation/import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAO7B,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEtF;;;;;;;;;;GAUG;AACH,MAAM,OAAO,eAAe;IAGxB,YAAY,QAA4B;QACpC,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC;IAC9D,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,eAAe,CACjB,GAAoB,EACpB,MAA0B,EAC1B,QAAyB,EACzB,YAA4C;QAE5C,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;YACX,MAAM,CAAC,OAAO,EAAE,kBA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CAAC;YACpC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QAC9B,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;CACJ;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAA4B;IAC3D,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC;IAEhD,OAAO;QACH,+DAA+D;QAC/D,eAAe,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE;YAChD,MAAM,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC;YAC/B,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAEtB,MAAM,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;QACxE,CAAC;KACJ,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domainlang/language",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
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",
|
|
@@ -18,6 +18,7 @@ import { DomainLangCodeActionProvider } from './lsp/domain-lang-code-actions.js'
|
|
|
18
18
|
import { ImportResolver } from './services/import-resolver.js';
|
|
19
19
|
import { WorkspaceManager } from './services/workspace-manager.js';
|
|
20
20
|
import { DomainLangWorkspaceManager } from './lsp/domain-lang-workspace-manager.js';
|
|
21
|
+
import { DomainLangIndexManager } from './lsp/domain-lang-index-manager.js';
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Declaration of custom services - add your own service classes here.
|
|
@@ -46,7 +47,8 @@ export type DomainLangServices = LangiumServices & DomainLangAddedServices
|
|
|
46
47
|
|
|
47
48
|
const DomainLangSharedModule: Module<LangiumSharedServices, PartialLangiumSharedServices> = {
|
|
48
49
|
workspace: {
|
|
49
|
-
WorkspaceManager: (services: LangiumSharedServices) => new DomainLangWorkspaceManager(services)
|
|
50
|
+
WorkspaceManager: (services: LangiumSharedServices) => new DomainLangWorkspaceManager(services),
|
|
51
|
+
IndexManager: (services: LangiumSharedServices) => new DomainLangIndexManager(services)
|
|
50
52
|
}
|
|
51
53
|
};
|
|
52
54
|
|
|
@@ -103,6 +105,7 @@ export function createDomainLangServices(context: DefaultSharedModuleContext): {
|
|
|
103
105
|
);
|
|
104
106
|
shared.ServiceRegistry.register(DomainLang);
|
|
105
107
|
registerValidationChecks(DomainLang);
|
|
108
|
+
|
|
106
109
|
if (!context.connection) {
|
|
107
110
|
// We don't run inside a language server
|
|
108
111
|
// Therefore, initialize the configuration provider instantly
|
package/src/domain-lang.langium
CHANGED
|
@@ -64,9 +64,11 @@ Type:
|
|
|
64
64
|
* Can be nested via `in` to show subdomain hierarchy.
|
|
65
65
|
* The `type` property indicates strategic importance (Core, Supporting, Generic) per Bounded Context Canvas.
|
|
66
66
|
* Body is optional - allows header-only Domain definitions.
|
|
67
|
+
*
|
|
68
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#domains)
|
|
67
69
|
*/
|
|
68
70
|
Domain:
|
|
69
|
-
(
|
|
71
|
+
('Domain' | 'dom') name=ID ('in' parent=[Domain:QualifiedName])?
|
|
70
72
|
('{'
|
|
71
73
|
(
|
|
72
74
|
('description' Assignment description=STRING) |
|
|
@@ -84,9 +86,11 @@ Domain:
|
|
|
84
86
|
* The `classification` property indicates strategic importance per Bounded Context Canvas.
|
|
85
87
|
* The `evolution` property indicates maturity stage per Wardley Maps/BC Canvas.
|
|
86
88
|
* The `archetype` property indicates behavioral role per DDD archetypes (Gateway, Execution, etc).
|
|
89
|
+
*
|
|
90
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#bounded-contexts)
|
|
87
91
|
*/
|
|
88
92
|
BoundedContext:
|
|
89
|
-
(
|
|
93
|
+
('BoundedContext' | 'bc') name=ID
|
|
90
94
|
('for' domain=[Domain:QualifiedName])?
|
|
91
95
|
(
|
|
92
96
|
('as' classification+=[Classification:QualifiedName])?
|
|
@@ -101,7 +105,7 @@ BoundedContext:
|
|
|
101
105
|
('evolution' Assignment evolution=[Classification:QualifiedName]) |
|
|
102
106
|
('archetype' Assignment archetype=[Classification:QualifiedName]) |
|
|
103
107
|
(('metadata' | 'meta') '{' (metadata+=MetadataEntry)* '}') |
|
|
104
|
-
(('relationships' | 'integrations') '{'
|
|
108
|
+
(('relationships' | 'integrations') '{'
|
|
105
109
|
(relationships += Relationship ((",")? relationships += Relationship)*)*
|
|
106
110
|
'}') |
|
|
107
111
|
(('terminology' | 'glossary') '{'
|
|
@@ -126,26 +130,32 @@ MetadataEntry:
|
|
|
126
130
|
/**
|
|
127
131
|
* Team - People responsible for a Bounded Context or Domain.
|
|
128
132
|
* Represents organizational boundaries in DDD.
|
|
133
|
+
*
|
|
134
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#teams)
|
|
129
135
|
*/
|
|
130
136
|
Team:
|
|
131
|
-
|
|
137
|
+
'Team' name=ID
|
|
132
138
|
;
|
|
133
139
|
|
|
134
140
|
/**
|
|
135
141
|
* Classification - Reusable label for categorizing elements.
|
|
136
142
|
* Examples: Core, Supporting, Generic, Strategic, Commodity, Architectural, Business, Technical.
|
|
143
|
+
*
|
|
144
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#classifications)
|
|
137
145
|
*/
|
|
138
146
|
Classification:
|
|
139
|
-
|
|
147
|
+
'Classification' name=ID
|
|
140
148
|
;
|
|
141
149
|
|
|
142
150
|
/**
|
|
143
151
|
* Metadata - Defines a key that can be used in metadata blocks.
|
|
144
152
|
* Examples: Language, Framework, Database, Repository.
|
|
145
153
|
* Can be defined locally or imported from stdlib.
|
|
154
|
+
*
|
|
155
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#metadata)
|
|
146
156
|
*/
|
|
147
157
|
Metadata:
|
|
148
|
-
|
|
158
|
+
'Metadata' name=ID
|
|
149
159
|
;
|
|
150
160
|
|
|
151
161
|
|
|
@@ -164,9 +174,11 @@ ObjectMap:
|
|
|
164
174
|
/**
|
|
165
175
|
* Context Map - Visualizes relationships between Bounded Contexts.
|
|
166
176
|
* Shows integration patterns and team interactions.
|
|
177
|
+
*
|
|
178
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#context-maps)
|
|
167
179
|
*/
|
|
168
180
|
ContextMap:
|
|
169
|
-
(
|
|
181
|
+
('ContextMap' | 'cmap') name=ID
|
|
170
182
|
'{'
|
|
171
183
|
('contains' boundedContexts += [+BoundedContext:QualifiedName] ((",")? boundedContexts += [+BoundedContext:QualifiedName])*)*
|
|
172
184
|
(relationships += Relationship ((",")? relationships += Relationship)*)*
|
|
@@ -176,9 +188,11 @@ ContextMap:
|
|
|
176
188
|
/**
|
|
177
189
|
* Domain Map - Visualizes relationships between Domains.
|
|
178
190
|
* Shows high-level domain organization and subdomain structure.
|
|
191
|
+
*
|
|
192
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#domain-maps)
|
|
179
193
|
*/
|
|
180
194
|
DomainMap:
|
|
181
|
-
(
|
|
195
|
+
('DomainMap' | 'dmap') name=ID
|
|
182
196
|
'{'
|
|
183
197
|
('contains' domains += [+Domain:QualifiedName] ((",")? domains += [+Domain:QualifiedName])*)*
|
|
184
198
|
'}'
|
|
@@ -191,6 +205,8 @@ DomainMap:
|
|
|
191
205
|
/**
|
|
192
206
|
* Relationship - Connection between two Bounded Contexts.
|
|
193
207
|
* Supports DDD integration patterns (ACL, OHS, PL, etc.) and relationship types.
|
|
208
|
+
*
|
|
209
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#relationships)
|
|
194
210
|
*/
|
|
195
211
|
Relationship:
|
|
196
212
|
('[' leftPatterns+=IntegrationPattern (',' leftPatterns+=IntegrationPattern)* ']')?
|
|
@@ -252,6 +268,8 @@ RelationshipType returns string:
|
|
|
252
268
|
/**
|
|
253
269
|
* Domain Terminology - Ubiquitous language terms with definitions.
|
|
254
270
|
* Supports synonyms and examples for richer glossaries.
|
|
271
|
+
*
|
|
272
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#terminology)
|
|
255
273
|
*/
|
|
256
274
|
DomainTerm:
|
|
257
275
|
('Term' | 'term') name=ID (Assignment meaning=STRING)?
|
|
@@ -262,6 +280,8 @@ DomainTerm:
|
|
|
262
280
|
/**
|
|
263
281
|
* Decisions, Policies, and Business Rules.
|
|
264
282
|
* All types are interchangeable - use what reads best for your domain.
|
|
283
|
+
*
|
|
284
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#decisions-policies-rules)
|
|
265
285
|
*/
|
|
266
286
|
AbstractDecision:
|
|
267
287
|
Decision |
|
|
@@ -270,19 +290,19 @@ AbstractDecision:
|
|
|
270
290
|
;
|
|
271
291
|
|
|
272
292
|
Decision:
|
|
273
|
-
(
|
|
293
|
+
('Decision' | 'decision')
|
|
274
294
|
('[' classification=[Classification:QualifiedName] ']')?
|
|
275
295
|
name=ID Assignment value=STRING
|
|
276
296
|
;
|
|
277
297
|
|
|
278
298
|
Policy:
|
|
279
|
-
(
|
|
299
|
+
('Policy' | 'policy')
|
|
280
300
|
('[' classification=[Classification:QualifiedName] ']')?
|
|
281
301
|
name=ID Assignment value=STRING
|
|
282
302
|
;
|
|
283
303
|
|
|
284
304
|
BusinessRule:
|
|
285
|
-
(
|
|
305
|
+
('Rule' | 'rule')
|
|
286
306
|
('[' classification=[Classification:QualifiedName] ']')?
|
|
287
307
|
name=ID Assignment value=STRING
|
|
288
308
|
;
|
|
@@ -301,17 +321,21 @@ BusinessRule:
|
|
|
301
321
|
*
|
|
302
322
|
* All resolution details (source, version, integrity) live in model.yaml manifest.
|
|
303
323
|
* Named imports and inline integrity checks have been removed per PRS-010.
|
|
324
|
+
*
|
|
325
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#imports)
|
|
304
326
|
*/
|
|
305
327
|
ImportStatement:
|
|
306
|
-
|
|
328
|
+
('Import' | 'import') uri=STRING ('as' alias=ID)?
|
|
307
329
|
;
|
|
308
330
|
|
|
309
331
|
/**
|
|
310
332
|
* Namespace Declaration - Hierarchical namespacing for organizing models.
|
|
311
333
|
* Combines package modularity with group-style nesting.
|
|
334
|
+
*
|
|
335
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#namespaces)
|
|
312
336
|
*/
|
|
313
337
|
NamespaceDeclaration:
|
|
314
|
-
(
|
|
338
|
+
('Namespace' | 'ns') name=QualifiedName '{'
|
|
315
339
|
(children+=StructureElement)*
|
|
316
340
|
'}'
|
|
317
341
|
;
|
package/src/generated/ast.ts
CHANGED
|
@@ -101,6 +101,8 @@ export type DomainLangTokenNames = DomainLangTerminalNames | DomainLangKeywordNa
|
|
|
101
101
|
/**
|
|
102
102
|
* Decisions, Policies, and Business Rules.
|
|
103
103
|
* All types are interchangeable - use what reads best for your domain.
|
|
104
|
+
*
|
|
105
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#decisions-policies-rules)
|
|
104
106
|
*/
|
|
105
107
|
export type AbstractDecision = BusinessRule | Decision | Policy;
|
|
106
108
|
|
|
@@ -129,6 +131,8 @@ export function isAssignment(item: unknown): item is Assignment {
|
|
|
129
131
|
* The `classification` property indicates strategic importance per Bounded Context Canvas.
|
|
130
132
|
* The `evolution` property indicates maturity stage per Wardley Maps/BC Canvas.
|
|
131
133
|
* The `archetype` property indicates behavioral role per DDD archetypes (Gateway, Execution, etc).
|
|
134
|
+
*
|
|
135
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#bounded-contexts)
|
|
132
136
|
*/
|
|
133
137
|
export interface BoundedContext extends langium.AstNode {
|
|
134
138
|
readonly $container: Model | NamespaceDeclaration;
|
|
@@ -206,6 +210,8 @@ export function isBusinessRule(item: unknown): item is BusinessRule {
|
|
|
206
210
|
/**
|
|
207
211
|
* Classification - Reusable label for categorizing elements.
|
|
208
212
|
* Examples: Core, Supporting, Generic, Strategic, Commodity, Architectural, Business, Technical.
|
|
213
|
+
*
|
|
214
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#classifications)
|
|
209
215
|
*/
|
|
210
216
|
export interface Classification extends langium.AstNode {
|
|
211
217
|
readonly $container: Model | NamespaceDeclaration;
|
|
@@ -235,6 +241,8 @@ export function isContainer(item: unknown): item is Container {
|
|
|
235
241
|
/**
|
|
236
242
|
* Context Map - Visualizes relationships between Bounded Contexts.
|
|
237
243
|
* Shows integration patterns and team interactions.
|
|
244
|
+
*
|
|
245
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#context-maps)
|
|
238
246
|
*/
|
|
239
247
|
export interface ContextMap extends langium.AstNode {
|
|
240
248
|
readonly $container: Model | NamespaceDeclaration;
|
|
@@ -279,6 +287,8 @@ export function isDecision(item: unknown): item is Decision {
|
|
|
279
287
|
* Can be nested via `in` to show subdomain hierarchy.
|
|
280
288
|
* The `type` property indicates strategic importance (Core, Supporting, Generic) per Bounded Context Canvas.
|
|
281
289
|
* Body is optional - allows header-only Domain definitions.
|
|
290
|
+
*
|
|
291
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#domains)
|
|
282
292
|
*/
|
|
283
293
|
export interface Domain extends langium.AstNode {
|
|
284
294
|
readonly $container: Model | NamespaceDeclaration;
|
|
@@ -306,6 +316,8 @@ export function isDomain(item: unknown): item is Domain {
|
|
|
306
316
|
/**
|
|
307
317
|
* Domain Map - Visualizes relationships between Domains.
|
|
308
318
|
* Shows high-level domain organization and subdomain structure.
|
|
319
|
+
*
|
|
320
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#domain-maps)
|
|
309
321
|
*/
|
|
310
322
|
export interface DomainMap extends langium.AstNode {
|
|
311
323
|
readonly $container: Model | NamespaceDeclaration;
|
|
@@ -327,6 +339,8 @@ export function isDomainMap(item: unknown): item is DomainMap {
|
|
|
327
339
|
/**
|
|
328
340
|
* Domain Terminology - Ubiquitous language terms with definitions.
|
|
329
341
|
* Supports synonyms and examples for richer glossaries.
|
|
342
|
+
*
|
|
343
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#terminology)
|
|
330
344
|
*/
|
|
331
345
|
export interface DomainTerm extends langium.AstNode {
|
|
332
346
|
readonly $container: BoundedContext;
|
|
@@ -359,6 +373,8 @@ export function isDomainTerm(item: unknown): item is DomainTerm {
|
|
|
359
373
|
*
|
|
360
374
|
* All resolution details (source, version, integrity) live in model.yaml manifest.
|
|
361
375
|
* Named imports and inline integrity checks have been removed per PRS-010.
|
|
376
|
+
*
|
|
377
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#imports)
|
|
362
378
|
*/
|
|
363
379
|
export interface ImportStatement extends langium.AstNode {
|
|
364
380
|
readonly $container: Model;
|
|
@@ -390,6 +406,8 @@ export function isIntegrationPattern(item: unknown): item is IntegrationPattern
|
|
|
390
406
|
* Metadata - Defines a key that can be used in metadata blocks.
|
|
391
407
|
* Examples: Language, Framework, Database, Repository.
|
|
392
408
|
* Can be defined locally or imported from stdlib.
|
|
409
|
+
*
|
|
410
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#metadata)
|
|
393
411
|
*/
|
|
394
412
|
export interface Metadata extends langium.AstNode {
|
|
395
413
|
readonly $container: Model | NamespaceDeclaration;
|
|
@@ -446,6 +464,8 @@ export function isModel(item: unknown): item is Model {
|
|
|
446
464
|
/**
|
|
447
465
|
* Namespace Declaration - Hierarchical namespacing for organizing models.
|
|
448
466
|
* Combines package modularity with group-style nesting.
|
|
467
|
+
*
|
|
468
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#namespaces)
|
|
449
469
|
*/
|
|
450
470
|
export interface NamespaceDeclaration extends langium.AstNode {
|
|
451
471
|
readonly $container: Model | NamespaceDeclaration;
|
|
@@ -508,6 +528,8 @@ export function isQualifiedName(item: unknown): item is QualifiedName {
|
|
|
508
528
|
/**
|
|
509
529
|
* Relationship - Connection between two Bounded Contexts.
|
|
510
530
|
* Supports DDD integration patterns (ACL, OHS, PL, etc.) and relationship types.
|
|
531
|
+
*
|
|
532
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#relationships)
|
|
511
533
|
*/
|
|
512
534
|
export interface Relationship extends langium.AstNode {
|
|
513
535
|
readonly $container: BoundedContext | ContextMap;
|
|
@@ -575,6 +597,8 @@ export function isStructureElement(item: unknown): item is StructureElement {
|
|
|
575
597
|
/**
|
|
576
598
|
* Team - People responsible for a Bounded Context or Domain.
|
|
577
599
|
* Represents organizational boundaries in DDD.
|
|
600
|
+
*
|
|
601
|
+
* [Read more on domainlang.net](https://domainlang.net/reference/language#teams)
|
|
578
602
|
*/
|
|
579
603
|
export interface Team extends langium.AstNode {
|
|
580
604
|
readonly $container: Model | NamespaceDeclaration;
|