@domainlang/language 0.1.81
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/README.md +32 -0
- package/out/ast-augmentation.d.ts +6 -0
- package/out/ast-augmentation.js +2 -0
- package/out/ast-augmentation.js.map +1 -0
- package/out/domain-lang-module.d.ts +55 -0
- package/out/domain-lang-module.js +59 -0
- package/out/domain-lang-module.js.map +1 -0
- package/out/generated/ast.d.ts +770 -0
- package/out/generated/ast.js +565 -0
- package/out/generated/ast.js.map +1 -0
- package/out/generated/grammar.d.ts +6 -0
- package/out/generated/grammar.js +2502 -0
- package/out/generated/grammar.js.map +1 -0
- package/out/generated/module.d.ts +13 -0
- package/out/generated/module.js +21 -0
- package/out/generated/module.js.map +1 -0
- package/out/index.d.ts +13 -0
- package/out/index.js +17 -0
- package/out/index.js.map +1 -0
- package/out/lsp/domain-lang-completion.d.ts +37 -0
- package/out/lsp/domain-lang-completion.js +452 -0
- package/out/lsp/domain-lang-completion.js.map +1 -0
- package/out/lsp/domain-lang-formatter.d.ts +15 -0
- package/out/lsp/domain-lang-formatter.js +43 -0
- package/out/lsp/domain-lang-formatter.js.map +1 -0
- package/out/lsp/domain-lang-naming.d.ts +34 -0
- package/out/lsp/domain-lang-naming.js +49 -0
- package/out/lsp/domain-lang-naming.js.map +1 -0
- package/out/lsp/domain-lang-scope.d.ts +59 -0
- package/out/lsp/domain-lang-scope.js +102 -0
- package/out/lsp/domain-lang-scope.js.map +1 -0
- package/out/lsp/hover/ddd-pattern-explanations.d.ts +50 -0
- package/out/lsp/hover/ddd-pattern-explanations.js +196 -0
- package/out/lsp/hover/ddd-pattern-explanations.js.map +1 -0
- package/out/lsp/hover/domain-lang-hover.d.ts +19 -0
- package/out/lsp/hover/domain-lang-hover.js +306 -0
- package/out/lsp/hover/domain-lang-hover.js.map +1 -0
- package/out/lsp/hover/domain-lang-keywords.d.ts +13 -0
- package/out/lsp/hover/domain-lang-keywords.js +47 -0
- package/out/lsp/hover/domain-lang-keywords.js.map +1 -0
- package/out/main-browser.d.ts +1 -0
- package/out/main-browser.js +11 -0
- package/out/main-browser.js.map +1 -0
- package/out/main.d.ts +1 -0
- package/out/main.js +74 -0
- package/out/main.js.map +1 -0
- package/out/sdk/ast-augmentation.d.ts +136 -0
- package/out/sdk/ast-augmentation.js +62 -0
- package/out/sdk/ast-augmentation.js.map +1 -0
- package/out/sdk/index.d.ts +94 -0
- package/out/sdk/index.js +97 -0
- package/out/sdk/index.js.map +1 -0
- package/out/sdk/indexes.d.ts +16 -0
- package/out/sdk/indexes.js +97 -0
- package/out/sdk/indexes.js.map +1 -0
- package/out/sdk/loader-node.d.ts +47 -0
- package/out/sdk/loader-node.js +104 -0
- package/out/sdk/loader-node.js.map +1 -0
- package/out/sdk/loader.d.ts +49 -0
- package/out/sdk/loader.js +85 -0
- package/out/sdk/loader.js.map +1 -0
- package/out/sdk/patterns.d.ts +93 -0
- package/out/sdk/patterns.js +123 -0
- package/out/sdk/patterns.js.map +1 -0
- package/out/sdk/query.d.ts +90 -0
- package/out/sdk/query.js +679 -0
- package/out/sdk/query.js.map +1 -0
- package/out/sdk/resolution.d.ts +52 -0
- package/out/sdk/resolution.js +68 -0
- package/out/sdk/resolution.js.map +1 -0
- package/out/sdk/types.d.ts +301 -0
- package/out/sdk/types.js +8 -0
- package/out/sdk/types.js.map +1 -0
- package/out/services/dependency-analyzer.d.ts +94 -0
- package/out/services/dependency-analyzer.js +279 -0
- package/out/services/dependency-analyzer.js.map +1 -0
- package/out/services/dependency-resolver.d.ts +123 -0
- package/out/services/dependency-resolver.js +252 -0
- package/out/services/dependency-resolver.js.map +1 -0
- package/out/services/git-url-resolver.browser.d.ts +18 -0
- package/out/services/git-url-resolver.browser.js +15 -0
- package/out/services/git-url-resolver.browser.js.map +1 -0
- package/out/services/git-url-resolver.d.ts +192 -0
- package/out/services/git-url-resolver.js +382 -0
- package/out/services/git-url-resolver.js.map +1 -0
- package/out/services/governance-validator.d.ts +80 -0
- package/out/services/governance-validator.js +159 -0
- package/out/services/governance-validator.js.map +1 -0
- package/out/services/import-resolver.d.ts +18 -0
- package/out/services/import-resolver.js +22 -0
- package/out/services/import-resolver.js.map +1 -0
- package/out/services/performance-optimizer.d.ts +60 -0
- package/out/services/performance-optimizer.js +140 -0
- package/out/services/performance-optimizer.js.map +1 -0
- package/out/services/relationship-inference.d.ts +11 -0
- package/out/services/relationship-inference.js +98 -0
- package/out/services/relationship-inference.js.map +1 -0
- package/out/services/workspace-manager.d.ts +76 -0
- package/out/services/workspace-manager.js +323 -0
- package/out/services/workspace-manager.js.map +1 -0
- package/out/syntaxes/domain-lang.monarch.d.ts +76 -0
- package/out/syntaxes/domain-lang.monarch.js +29 -0
- package/out/syntaxes/domain-lang.monarch.js.map +1 -0
- package/out/utils/import-utils.d.ts +57 -0
- package/out/utils/import-utils.js +228 -0
- package/out/utils/import-utils.js.map +1 -0
- package/out/validation/bounded-context.d.ts +11 -0
- package/out/validation/bounded-context.js +79 -0
- package/out/validation/bounded-context.js.map +1 -0
- package/out/validation/classification.d.ts +3 -0
- package/out/validation/classification.js +3 -0
- package/out/validation/classification.js.map +1 -0
- package/out/validation/constants.d.ts +77 -0
- package/out/validation/constants.js +96 -0
- package/out/validation/constants.js.map +1 -0
- package/out/validation/domain-lang-validator.d.ts +2 -0
- package/out/validation/domain-lang-validator.js +27 -0
- package/out/validation/domain-lang-validator.js.map +1 -0
- package/out/validation/domain.d.ts +11 -0
- package/out/validation/domain.js +18 -0
- package/out/validation/domain.js.map +1 -0
- package/out/validation/import.d.ts +44 -0
- package/out/validation/import.js +135 -0
- package/out/validation/import.js.map +1 -0
- package/out/validation/maps.d.ts +21 -0
- package/out/validation/maps.js +56 -0
- package/out/validation/maps.js.map +1 -0
- package/out/validation/metadata.d.ts +7 -0
- package/out/validation/metadata.js +12 -0
- package/out/validation/metadata.js.map +1 -0
- package/out/validation/model.d.ts +12 -0
- package/out/validation/model.js +29 -0
- package/out/validation/model.js.map +1 -0
- package/out/validation/relationships.d.ts +12 -0
- package/out/validation/relationships.js +94 -0
- package/out/validation/relationships.js.map +1 -0
- package/out/validation/shared.d.ts +6 -0
- package/out/validation/shared.js +12 -0
- package/out/validation/shared.js.map +1 -0
- package/package.json +97 -0
- package/src/ast-augmentation.ts +5 -0
- package/src/domain-lang-module.ts +100 -0
- package/src/domain-lang.langium +356 -0
- package/src/generated/ast.ts +999 -0
- package/src/generated/grammar.ts +2504 -0
- package/src/generated/module.ts +25 -0
- package/src/index.ts +17 -0
- package/src/lsp/domain-lang-completion.ts +514 -0
- package/src/lsp/domain-lang-formatter.ts +51 -0
- package/src/lsp/domain-lang-naming.ts +56 -0
- package/src/lsp/domain-lang-scope.ts +137 -0
- package/src/lsp/hover/ddd-pattern-explanations.ts +237 -0
- package/src/lsp/hover/domain-lang-hover.ts +340 -0
- package/src/lsp/hover/domain-lang-keywords.ts +50 -0
- package/src/main-browser.ts +15 -0
- package/src/main.ts +85 -0
- package/src/sdk/README.md +297 -0
- package/src/sdk/ast-augmentation.ts +157 -0
- package/src/sdk/index.ts +128 -0
- package/src/sdk/indexes.ts +155 -0
- package/src/sdk/loader-node.ts +126 -0
- package/src/sdk/loader.ts +99 -0
- package/src/sdk/patterns.ts +147 -0
- package/src/sdk/query.ts +802 -0
- package/src/sdk/resolution.ts +78 -0
- package/src/sdk/types.ts +346 -0
- package/src/services/dependency-analyzer.ts +381 -0
- package/src/services/dependency-resolver.ts +334 -0
- package/src/services/git-url-resolver.browser.ts +31 -0
- package/src/services/git-url-resolver.ts +524 -0
- package/src/services/governance-validator.ts +219 -0
- package/src/services/import-resolver.ts +30 -0
- package/src/services/performance-optimizer.ts +170 -0
- package/src/services/relationship-inference.ts +121 -0
- package/src/services/workspace-manager.ts +416 -0
- package/src/syntaxes/domain-lang.monarch.ts +29 -0
- package/src/utils/import-utils.ts +274 -0
- package/src/validation/bounded-context.ts +99 -0
- package/src/validation/classification.ts +5 -0
- package/src/validation/constants.ts +124 -0
- package/src/validation/domain-lang-validator.ts +33 -0
- package/src/validation/domain.ts +24 -0
- package/src/validation/import.ts +171 -0
- package/src/validation/maps.ts +72 -0
- package/src/validation/metadata.ts +14 -0
- package/src/validation/model.ts +37 -0
- package/src/validation/relationships.ts +154 -0
- package/src/validation/shared.ts +14 -0
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# domain-lang-language
|
|
2
|
+
|
|
3
|
+
This package contains the DomainLang grammar, language services (parsing, linking, validation), and the Model Query SDK.
|
|
4
|
+
|
|
5
|
+
## Key paths
|
|
6
|
+
|
|
7
|
+
- src/domain-lang.langium: grammar
|
|
8
|
+
- src/generated/: generated output from Langium (do not edit)
|
|
9
|
+
- src/validation/: semantic validation rules
|
|
10
|
+
- src/lsp/: LSP features (hover, completion, formatting)
|
|
11
|
+
- src/sdk/README.md: Model Query SDK documentation
|
|
12
|
+
|
|
13
|
+
## Common workflows
|
|
14
|
+
|
|
15
|
+
From the workspace root (dsl/domain-lang/):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# After editing packages/language/src/domain-lang.langium
|
|
19
|
+
npm run langium:generate
|
|
20
|
+
|
|
21
|
+
# Build just this package
|
|
22
|
+
npm run build --workspace packages/language
|
|
23
|
+
|
|
24
|
+
# Run tests
|
|
25
|
+
npm test --workspace packages/language
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Testing
|
|
29
|
+
|
|
30
|
+
Tests live in test/ and cover parsing, linking, validation, scoping, and services.
|
|
31
|
+
|
|
32
|
+
If you change the grammar or validation behavior, add or update tests alongside the change.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast-augmentation.js","sourceRoot":"","sources":["../src/ast-augmentation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Module } from 'langium';
|
|
2
|
+
import type { DefaultSharedModuleContext, LangiumServices, LangiumSharedServices, PartialLangiumServices } from 'langium/lsp';
|
|
3
|
+
import { QualifiedNameProvider } from './lsp/domain-lang-naming.js';
|
|
4
|
+
import { DomainLangFormatter } from './lsp/domain-lang-formatter.js';
|
|
5
|
+
import { DomainLangHoverProvider } from './lsp/hover/domain-lang-hover.js';
|
|
6
|
+
import { DomainLangCompletionProvider } from './lsp/domain-lang-completion.js';
|
|
7
|
+
import { ImportResolver } from './services/import-resolver.js';
|
|
8
|
+
import { WorkspaceManager } from './services/workspace-manager.js';
|
|
9
|
+
/**
|
|
10
|
+
* Declaration of custom services - add your own service classes here.
|
|
11
|
+
*/
|
|
12
|
+
export type DomainLangAddedServices = {
|
|
13
|
+
imports: {
|
|
14
|
+
ImportResolver: ImportResolver;
|
|
15
|
+
WorkspaceManager: WorkspaceManager;
|
|
16
|
+
};
|
|
17
|
+
references: {
|
|
18
|
+
QualifiedNameProvider: QualifiedNameProvider;
|
|
19
|
+
};
|
|
20
|
+
lsp: {
|
|
21
|
+
Formatter: DomainLangFormatter;
|
|
22
|
+
HoverProvider: DomainLangHoverProvider;
|
|
23
|
+
CompletionProvider: DomainLangCompletionProvider;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Union of Langium default services and your custom services - use this as constructor parameter
|
|
28
|
+
* of custom service classes.
|
|
29
|
+
*/
|
|
30
|
+
export type DomainLangServices = LangiumServices & DomainLangAddedServices;
|
|
31
|
+
/**
|
|
32
|
+
* Dependency injection module that overrides Langium default services and contributes the
|
|
33
|
+
* declared custom services. The Langium defaults can be partially specified to override only
|
|
34
|
+
* selected services, while the custom services must be fully specified.
|
|
35
|
+
*/
|
|
36
|
+
export declare const DomainLangModule: Module<DomainLangServices, PartialLangiumServices & DomainLangAddedServices>;
|
|
37
|
+
/**
|
|
38
|
+
* Create the full set of services required by Langium.
|
|
39
|
+
*
|
|
40
|
+
* First inject the shared services by merging two modules:
|
|
41
|
+
* - Langium default shared services
|
|
42
|
+
* - Services generated by langium-cli
|
|
43
|
+
*
|
|
44
|
+
* Then inject the language-specific services by merging three modules:
|
|
45
|
+
* - Langium default language-specific services
|
|
46
|
+
* - Services generated by langium-cli
|
|
47
|
+
* - Services specified in this file
|
|
48
|
+
*
|
|
49
|
+
* @param context Optional module context with the LSP connection
|
|
50
|
+
* @returns An object wrapping the shared services and the language-specific services
|
|
51
|
+
*/
|
|
52
|
+
export declare function createDomainLangServices(context: DefaultSharedModuleContext): {
|
|
53
|
+
shared: LangiumSharedServices;
|
|
54
|
+
DomainLang: DomainLangServices;
|
|
55
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { inject } from 'langium';
|
|
2
|
+
import { createDefaultModule, createDefaultSharedModule } from 'langium/lsp';
|
|
3
|
+
import { DomainLangGeneratedModule, DomainLangGeneratedSharedModule } from './generated/module.js';
|
|
4
|
+
import { registerValidationChecks } from './validation/domain-lang-validator.js';
|
|
5
|
+
import { QualifiedNameProvider } from './lsp/domain-lang-naming.js';
|
|
6
|
+
import { DomainLangScopeComputation } from './lsp/domain-lang-scope.js';
|
|
7
|
+
import { DomainLangFormatter } from './lsp/domain-lang-formatter.js';
|
|
8
|
+
import { DomainLangHoverProvider } from './lsp/hover/domain-lang-hover.js';
|
|
9
|
+
import { DomainLangCompletionProvider } from './lsp/domain-lang-completion.js';
|
|
10
|
+
import { ImportResolver } from './services/import-resolver.js';
|
|
11
|
+
import { WorkspaceManager } from './services/workspace-manager.js';
|
|
12
|
+
/**
|
|
13
|
+
* Dependency injection module that overrides Langium default services and contributes the
|
|
14
|
+
* declared custom services. The Langium defaults can be partially specified to override only
|
|
15
|
+
* selected services, while the custom services must be fully specified.
|
|
16
|
+
*/
|
|
17
|
+
export const DomainLangModule = {
|
|
18
|
+
imports: {
|
|
19
|
+
ImportResolver: (services) => new ImportResolver(services),
|
|
20
|
+
WorkspaceManager: () => new WorkspaceManager()
|
|
21
|
+
},
|
|
22
|
+
references: {
|
|
23
|
+
ScopeComputation: (services) => new DomainLangScopeComputation(services),
|
|
24
|
+
QualifiedNameProvider: () => new QualifiedNameProvider()
|
|
25
|
+
},
|
|
26
|
+
lsp: {
|
|
27
|
+
Formatter: () => new DomainLangFormatter(),
|
|
28
|
+
HoverProvider: (services) => new DomainLangHoverProvider(services),
|
|
29
|
+
CompletionProvider: (services) => new DomainLangCompletionProvider(services)
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Create the full set of services required by Langium.
|
|
34
|
+
*
|
|
35
|
+
* First inject the shared services by merging two modules:
|
|
36
|
+
* - Langium default shared services
|
|
37
|
+
* - Services generated by langium-cli
|
|
38
|
+
*
|
|
39
|
+
* Then inject the language-specific services by merging three modules:
|
|
40
|
+
* - Langium default language-specific services
|
|
41
|
+
* - Services generated by langium-cli
|
|
42
|
+
* - Services specified in this file
|
|
43
|
+
*
|
|
44
|
+
* @param context Optional module context with the LSP connection
|
|
45
|
+
* @returns An object wrapping the shared services and the language-specific services
|
|
46
|
+
*/
|
|
47
|
+
export function createDomainLangServices(context) {
|
|
48
|
+
const shared = inject(createDefaultSharedModule(context), DomainLangGeneratedSharedModule);
|
|
49
|
+
const DomainLang = inject(createDefaultModule({ shared }), DomainLangGeneratedModule, DomainLangModule);
|
|
50
|
+
shared.ServiceRegistry.register(DomainLang);
|
|
51
|
+
registerValidationChecks(DomainLang);
|
|
52
|
+
if (!context.connection) {
|
|
53
|
+
// We don't run inside a language server
|
|
54
|
+
// Therefore, initialize the configuration provider instantly
|
|
55
|
+
shared.workspace.ConfigurationProvider.initialized({});
|
|
56
|
+
}
|
|
57
|
+
return { shared, DomainLang };
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=domain-lang-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-lang-module.js","sourceRoot":"","sources":["../src/domain-lang-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAE,MAAM,SAAS,CAAC;AAO9C,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CA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