@domainlang/language 0.1.20

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.
Files changed (212) hide show
  1. package/README.md +163 -0
  2. package/out/ast-augmentation.d.ts +6 -0
  3. package/out/ast-augmentation.js +2 -0
  4. package/out/ast-augmentation.js.map +1 -0
  5. package/out/domain-lang-module.d.ts +57 -0
  6. package/out/domain-lang-module.js +67 -0
  7. package/out/domain-lang-module.js.map +1 -0
  8. package/out/generated/ast.d.ts +759 -0
  9. package/out/generated/ast.js +556 -0
  10. package/out/generated/ast.js.map +1 -0
  11. package/out/generated/grammar.d.ts +6 -0
  12. package/out/generated/grammar.js +2407 -0
  13. package/out/generated/grammar.js.map +1 -0
  14. package/out/generated/module.d.ts +13 -0
  15. package/out/generated/module.js +21 -0
  16. package/out/generated/module.js.map +1 -0
  17. package/out/index.d.ts +16 -0
  18. package/out/index.js +22 -0
  19. package/out/index.js.map +1 -0
  20. package/out/lsp/domain-lang-code-actions.d.ts +55 -0
  21. package/out/lsp/domain-lang-code-actions.js +143 -0
  22. package/out/lsp/domain-lang-code-actions.js.map +1 -0
  23. package/out/lsp/domain-lang-completion.d.ts +37 -0
  24. package/out/lsp/domain-lang-completion.js +452 -0
  25. package/out/lsp/domain-lang-completion.js.map +1 -0
  26. package/out/lsp/domain-lang-formatter.d.ts +15 -0
  27. package/out/lsp/domain-lang-formatter.js +43 -0
  28. package/out/lsp/domain-lang-formatter.js.map +1 -0
  29. package/out/lsp/domain-lang-naming.d.ts +34 -0
  30. package/out/lsp/domain-lang-naming.js +49 -0
  31. package/out/lsp/domain-lang-naming.js.map +1 -0
  32. package/out/lsp/domain-lang-scope.d.ts +59 -0
  33. package/out/lsp/domain-lang-scope.js +102 -0
  34. package/out/lsp/domain-lang-scope.js.map +1 -0
  35. package/out/lsp/domain-lang-workspace-manager.d.ts +21 -0
  36. package/out/lsp/domain-lang-workspace-manager.js +93 -0
  37. package/out/lsp/domain-lang-workspace-manager.js.map +1 -0
  38. package/out/lsp/hover/ddd-pattern-explanations.d.ts +50 -0
  39. package/out/lsp/hover/ddd-pattern-explanations.js +196 -0
  40. package/out/lsp/hover/ddd-pattern-explanations.js.map +1 -0
  41. package/out/lsp/hover/domain-lang-hover.d.ts +19 -0
  42. package/out/lsp/hover/domain-lang-hover.js +302 -0
  43. package/out/lsp/hover/domain-lang-hover.js.map +1 -0
  44. package/out/lsp/hover/domain-lang-keywords.d.ts +13 -0
  45. package/out/lsp/hover/domain-lang-keywords.js +47 -0
  46. package/out/lsp/hover/domain-lang-keywords.js.map +1 -0
  47. package/out/lsp/manifest-diagnostics.d.ts +82 -0
  48. package/out/lsp/manifest-diagnostics.js +230 -0
  49. package/out/lsp/manifest-diagnostics.js.map +1 -0
  50. package/out/main-browser.d.ts +1 -0
  51. package/out/main-browser.js +11 -0
  52. package/out/main-browser.js.map +1 -0
  53. package/out/main.d.ts +1 -0
  54. package/out/main.js +74 -0
  55. package/out/main.js.map +1 -0
  56. package/out/sdk/ast-augmentation.d.ts +136 -0
  57. package/out/sdk/ast-augmentation.js +62 -0
  58. package/out/sdk/ast-augmentation.js.map +1 -0
  59. package/out/sdk/index.d.ts +94 -0
  60. package/out/sdk/index.js +97 -0
  61. package/out/sdk/index.js.map +1 -0
  62. package/out/sdk/indexes.d.ts +16 -0
  63. package/out/sdk/indexes.js +97 -0
  64. package/out/sdk/indexes.js.map +1 -0
  65. package/out/sdk/loader-node.d.ts +51 -0
  66. package/out/sdk/loader-node.js +119 -0
  67. package/out/sdk/loader-node.js.map +1 -0
  68. package/out/sdk/loader.d.ts +49 -0
  69. package/out/sdk/loader.js +85 -0
  70. package/out/sdk/loader.js.map +1 -0
  71. package/out/sdk/patterns.d.ts +93 -0
  72. package/out/sdk/patterns.js +123 -0
  73. package/out/sdk/patterns.js.map +1 -0
  74. package/out/sdk/query.d.ts +90 -0
  75. package/out/sdk/query.js +679 -0
  76. package/out/sdk/query.js.map +1 -0
  77. package/out/sdk/resolution.d.ts +52 -0
  78. package/out/sdk/resolution.js +68 -0
  79. package/out/sdk/resolution.js.map +1 -0
  80. package/out/sdk/types.d.ts +280 -0
  81. package/out/sdk/types.js +8 -0
  82. package/out/sdk/types.js.map +1 -0
  83. package/out/services/dependency-analyzer.d.ts +58 -0
  84. package/out/services/dependency-analyzer.js +254 -0
  85. package/out/services/dependency-analyzer.js.map +1 -0
  86. package/out/services/dependency-resolver.d.ts +146 -0
  87. package/out/services/dependency-resolver.js +452 -0
  88. package/out/services/dependency-resolver.js.map +1 -0
  89. package/out/services/git-url-resolver.browser.d.ts +10 -0
  90. package/out/services/git-url-resolver.browser.js +19 -0
  91. package/out/services/git-url-resolver.browser.js.map +1 -0
  92. package/out/services/git-url-resolver.d.ts +158 -0
  93. package/out/services/git-url-resolver.js +416 -0
  94. package/out/services/git-url-resolver.js.map +1 -0
  95. package/out/services/governance-validator.d.ts +44 -0
  96. package/out/services/governance-validator.js +153 -0
  97. package/out/services/governance-validator.js.map +1 -0
  98. package/out/services/import-resolver.d.ts +77 -0
  99. package/out/services/import-resolver.js +240 -0
  100. package/out/services/import-resolver.js.map +1 -0
  101. package/out/services/performance-optimizer.d.ts +60 -0
  102. package/out/services/performance-optimizer.js +140 -0
  103. package/out/services/performance-optimizer.js.map +1 -0
  104. package/out/services/relationship-inference.d.ts +11 -0
  105. package/out/services/relationship-inference.js +98 -0
  106. package/out/services/relationship-inference.js.map +1 -0
  107. package/out/services/semver.d.ts +98 -0
  108. package/out/services/semver.js +195 -0
  109. package/out/services/semver.js.map +1 -0
  110. package/out/services/types.d.ts +340 -0
  111. package/out/services/types.js +46 -0
  112. package/out/services/types.js.map +1 -0
  113. package/out/services/workspace-manager.d.ts +123 -0
  114. package/out/services/workspace-manager.js +489 -0
  115. package/out/services/workspace-manager.js.map +1 -0
  116. package/out/syntaxes/domain-lang.monarch.d.ts +76 -0
  117. package/out/syntaxes/domain-lang.monarch.js +29 -0
  118. package/out/syntaxes/domain-lang.monarch.js.map +1 -0
  119. package/out/utils/import-utils.d.ts +49 -0
  120. package/out/utils/import-utils.js +128 -0
  121. package/out/utils/import-utils.js.map +1 -0
  122. package/out/validation/bounded-context.d.ts +11 -0
  123. package/out/validation/bounded-context.js +79 -0
  124. package/out/validation/bounded-context.js.map +1 -0
  125. package/out/validation/classification.d.ts +3 -0
  126. package/out/validation/classification.js +3 -0
  127. package/out/validation/classification.js.map +1 -0
  128. package/out/validation/constants.d.ts +180 -0
  129. package/out/validation/constants.js +235 -0
  130. package/out/validation/constants.js.map +1 -0
  131. package/out/validation/domain-lang-validator.d.ts +2 -0
  132. package/out/validation/domain-lang-validator.js +27 -0
  133. package/out/validation/domain-lang-validator.js.map +1 -0
  134. package/out/validation/domain.d.ts +11 -0
  135. package/out/validation/domain.js +63 -0
  136. package/out/validation/domain.js.map +1 -0
  137. package/out/validation/import.d.ts +68 -0
  138. package/out/validation/import.js +237 -0
  139. package/out/validation/import.js.map +1 -0
  140. package/out/validation/manifest.d.ts +144 -0
  141. package/out/validation/manifest.js +327 -0
  142. package/out/validation/manifest.js.map +1 -0
  143. package/out/validation/maps.d.ts +21 -0
  144. package/out/validation/maps.js +60 -0
  145. package/out/validation/maps.js.map +1 -0
  146. package/out/validation/metadata.d.ts +7 -0
  147. package/out/validation/metadata.js +16 -0
  148. package/out/validation/metadata.js.map +1 -0
  149. package/out/validation/model.d.ts +12 -0
  150. package/out/validation/model.js +29 -0
  151. package/out/validation/model.js.map +1 -0
  152. package/out/validation/relationships.d.ts +12 -0
  153. package/out/validation/relationships.js +94 -0
  154. package/out/validation/relationships.js.map +1 -0
  155. package/out/validation/shared.d.ts +6 -0
  156. package/out/validation/shared.js +12 -0
  157. package/out/validation/shared.js.map +1 -0
  158. package/package.json +110 -0
  159. package/src/ast-augmentation.ts +5 -0
  160. package/src/domain-lang-module.ts +112 -0
  161. package/src/domain-lang.langium +351 -0
  162. package/src/generated/ast.ts +986 -0
  163. package/src/generated/grammar.ts +2409 -0
  164. package/src/generated/module.ts +25 -0
  165. package/src/index.ts +24 -0
  166. package/src/lsp/domain-lang-code-actions.ts +189 -0
  167. package/src/lsp/domain-lang-completion.ts +514 -0
  168. package/src/lsp/domain-lang-formatter.ts +51 -0
  169. package/src/lsp/domain-lang-naming.ts +56 -0
  170. package/src/lsp/domain-lang-scope.ts +137 -0
  171. package/src/lsp/domain-lang-workspace-manager.ts +104 -0
  172. package/src/lsp/hover/ddd-pattern-explanations.ts +237 -0
  173. package/src/lsp/hover/domain-lang-hover.ts +338 -0
  174. package/src/lsp/hover/domain-lang-keywords.ts +50 -0
  175. package/src/lsp/manifest-diagnostics.ts +290 -0
  176. package/src/main-browser.ts +15 -0
  177. package/src/main.ts +85 -0
  178. package/src/sdk/README.md +297 -0
  179. package/src/sdk/ast-augmentation.ts +157 -0
  180. package/src/sdk/index.ts +126 -0
  181. package/src/sdk/indexes.ts +155 -0
  182. package/src/sdk/loader-node.ts +146 -0
  183. package/src/sdk/loader.ts +99 -0
  184. package/src/sdk/patterns.ts +147 -0
  185. package/src/sdk/query.ts +802 -0
  186. package/src/sdk/resolution.ts +78 -0
  187. package/src/sdk/types.ts +323 -0
  188. package/src/services/dependency-analyzer.ts +321 -0
  189. package/src/services/dependency-resolver.ts +551 -0
  190. package/src/services/git-url-resolver.browser.ts +26 -0
  191. package/src/services/git-url-resolver.ts +517 -0
  192. package/src/services/governance-validator.ts +177 -0
  193. package/src/services/import-resolver.ts +292 -0
  194. package/src/services/performance-optimizer.ts +170 -0
  195. package/src/services/relationship-inference.ts +121 -0
  196. package/src/services/semver.ts +213 -0
  197. package/src/services/types.ts +415 -0
  198. package/src/services/workspace-manager.ts +607 -0
  199. package/src/syntaxes/domain-lang.monarch.ts +29 -0
  200. package/src/utils/import-utils.ts +152 -0
  201. package/src/validation/bounded-context.ts +99 -0
  202. package/src/validation/classification.ts +5 -0
  203. package/src/validation/constants.ts +304 -0
  204. package/src/validation/domain-lang-validator.ts +33 -0
  205. package/src/validation/domain.ts +77 -0
  206. package/src/validation/import.ts +295 -0
  207. package/src/validation/manifest.ts +439 -0
  208. package/src/validation/maps.ts +76 -0
  209. package/src/validation/metadata.ts +18 -0
  210. package/src/validation/model.ts +37 -0
  211. package/src/validation/relationships.ts +154 -0
  212. package/src/validation/shared.ts +14 -0
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Integration Patterns - Type-safe constants for DDD integration patterns.
3
+ *
4
+ * Use these constants instead of magic strings when checking relationship patterns.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { Pattern } from '../sdk/patterns.js';
9
+ *
10
+ * // Instead of: hasPattern('SK') or hasPattern('SharedKernel')
11
+ * // Use:
12
+ * if (relationship.hasPattern(Pattern.SharedKernel)) {
13
+ * // ...
14
+ * }
15
+ * ```
16
+ */
17
+ /**
18
+ * Integration pattern abbreviations as used in the grammar.
19
+ * These are the canonical abbreviations recognized by DomainLang.
20
+ */
21
+ export const Pattern = {
22
+ // Upstream patterns (provider side)
23
+ /** Open Host Service - exposes a clean API for consumers */
24
+ OHS: 'OHS',
25
+ /** Published Language - shared data format/protocol */
26
+ PL: 'PL',
27
+ // Downstream patterns (consumer side)
28
+ /** Conformist - accepts upstream model without translation */
29
+ CF: 'CF',
30
+ /** Anti-Corruption Layer - translates upstream model */
31
+ ACL: 'ACL',
32
+ // Mutual patterns (both sides)
33
+ /** Shared Kernel - shared code/model ownership */
34
+ SK: 'SK',
35
+ /** Partnership - coordinated development */
36
+ P: 'P',
37
+ // Relationship types
38
+ /** Customer/Supplier - negotiated contract */
39
+ CustomerSupplier: 'Customer/Supplier',
40
+ /** Separate Ways - no integration */
41
+ SeparateWays: 'Separate Ways',
42
+ /** Big Ball of Mud - legacy or unstructured */
43
+ BigBallOfMud: 'Big Ball of Mud',
44
+ };
45
+ /**
46
+ * Full names for integration patterns.
47
+ * Used when patterns are spelled out in documentation blocks.
48
+ */
49
+ export const PatternFullName = {
50
+ OHS: 'OpenHostService',
51
+ PL: 'PublishedLanguage',
52
+ CF: 'Conformist',
53
+ ACL: 'AntiCorruptionLayer',
54
+ SK: 'SharedKernel',
55
+ P: 'Partnership',
56
+ };
57
+ /**
58
+ * Mapping from abbreviations to full names and vice versa.
59
+ */
60
+ export const PatternAliases = {
61
+ // Abbreviation -> [abbreviation, fullName]
62
+ OHS: ['OHS', 'OpenHostService'],
63
+ PL: ['PL', 'PublishedLanguage'],
64
+ CF: ['CF', 'Conformist'],
65
+ ACL: ['ACL', 'AntiCorruptionLayer'],
66
+ SK: ['SK', 'SharedKernel'],
67
+ P: ['P', 'Partnership'],
68
+ // Full names map to same
69
+ OpenHostService: ['OHS', 'OpenHostService'],
70
+ PublishedLanguage: ['PL', 'PublishedLanguage'],
71
+ Conformist: ['CF', 'Conformist'],
72
+ AntiCorruptionLayer: ['ACL', 'AntiCorruptionLayer'],
73
+ SharedKernel: ['SK', 'SharedKernel'],
74
+ Partnership: ['P', 'Partnership'],
75
+ };
76
+ /**
77
+ * Checks if a pattern string matches any of the expected aliases.
78
+ * Handles both abbreviations and full names case-insensitively.
79
+ *
80
+ * @param actual - Pattern string from the AST
81
+ * @param expected - Pattern to match (abbreviation or full name)
82
+ * @returns true if patterns match
83
+ */
84
+ export function matchesPattern(actual, expected) {
85
+ const normalizedActual = actual.trim();
86
+ const aliases = PatternAliases[expected];
87
+ if (aliases) {
88
+ return aliases.some(alias => alias.toLowerCase() === normalizedActual.toLowerCase());
89
+ }
90
+ // Fallback: direct comparison
91
+ return normalizedActual.toLowerCase() === expected.toLowerCase();
92
+ }
93
+ /**
94
+ * Patterns that are typically on the upstream (provider) side.
95
+ */
96
+ export const UpstreamPatterns = ['OHS', 'OpenHostService', 'PL', 'PublishedLanguage'];
97
+ /**
98
+ * Patterns that are typically on the downstream (consumer) side.
99
+ */
100
+ export const DownstreamPatterns = ['CF', 'Conformist', 'ACL', 'AntiCorruptionLayer'];
101
+ /**
102
+ * Patterns that require mutual/bidirectional relationships.
103
+ */
104
+ export const MutualPatterns = ['SK', 'SharedKernel', 'P', 'Partnership'];
105
+ /**
106
+ * Checks if a pattern is typically an upstream pattern.
107
+ */
108
+ export function isUpstreamPattern(pattern) {
109
+ return UpstreamPatterns.some(p => matchesPattern(pattern, p));
110
+ }
111
+ /**
112
+ * Checks if a pattern is typically a downstream pattern.
113
+ */
114
+ export function isDownstreamPattern(pattern) {
115
+ return DownstreamPatterns.some(p => matchesPattern(pattern, p));
116
+ }
117
+ /**
118
+ * Checks if a pattern requires bidirectional relationships.
119
+ */
120
+ export function isMutualPattern(pattern) {
121
+ return MutualPatterns.some(p => matchesPattern(pattern, p));
122
+ }
123
+ //# sourceMappingURL=patterns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patterns.js","sourceRoot":"","sources":["../../src/sdk/patterns.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Query and QueryBuilder implementation for the Model Query SDK.
3
+ * Provides fluent, lazy evaluation of model queries.
4
+ */
5
+ import type { LangiumDocument, URI } from 'langium';
6
+ import type { BoundedContext, Domain, Model, Relationship } from '../generated/ast.js';
7
+ import type { DomainLangServices } from '../domain-lang-module.js';
8
+ import type { Query } from './types.js';
9
+ /**
10
+ * Creates a Query instance from a Model node.
11
+ * Zero-copy operation for already-linked AST (used in LSP/validation).
12
+ *
13
+ * Automatically augments the AST with resolved properties on first access.
14
+ *
15
+ * @param model - Root Model node
16
+ * @returns Query interface for model traversal
17
+ */
18
+ export declare function fromModel(model: Model): Query;
19
+ /**
20
+ * Creates a Query instance from a LangiumDocument.
21
+ * Zero-copy operation for already-linked AST (used in LSP providers).
22
+ *
23
+ * Automatically augments the AST with resolved properties on first access.
24
+ *
25
+ * @param document - LangiumDocument containing a Model
26
+ * @returns Query interface for model traversal
27
+ */
28
+ export declare function fromDocument(document: LangiumDocument<Model>): Query;
29
+ /**
30
+ * Creates a Query instance from DomainLangServices and document URI.
31
+ * Zero-copy operation for already-linked AST (used when only services available).
32
+ *
33
+ * Automatically augments the AST with resolved properties on first access.
34
+ *
35
+ * @param services - DomainLangServices instance
36
+ * @param documentUri - URI of the document to query
37
+ * @returns Query interface for model traversal
38
+ * @throws Error if document not found or not a Model
39
+ */
40
+ export declare function fromServices(services: DomainLangServices, documentUri: URI): Query;
41
+ /**
42
+ * Augments BoundedContext instances with SDK-resolved properties.
43
+ * Called during model loading to enrich the AST.
44
+ *
45
+ * Properties use natural names (not sdk* prefix) per PRS:
46
+ * "Properties are discoverable in IDE autocomplete. The SDK enriches the AST
47
+ * during load, so `bc.classification` just works—no imports needed."
48
+ *
49
+ * Note: We use getters to avoid computing values until accessed.
50
+ * Note: We use Object.defineProperty to avoid modifying the original interface.
51
+ *
52
+ * @param bc - BoundedContext to augment
53
+ */
54
+ export declare function augmentBoundedContext(bc: BoundedContext): void;
55
+ /**
56
+ * Augments Domain instances with SDK-resolved properties.
57
+ * Called during model loading to enrich the AST.
58
+ *
59
+ * Only includes properties that add value beyond direct AST access:
60
+ * - fqn: computed qualified name
61
+ * - hasType: helper method
62
+ *
63
+ * Direct access (no augmentation needed):
64
+ * - domain.description
65
+ * - domain.vision
66
+ * - domain.type?.ref
67
+ *
68
+ * @param domain - Domain to augment
69
+ */
70
+ export declare function augmentDomain(domain: Domain): void;
71
+ /**
72
+ * Augments Relationship instances with SDK helper methods.
73
+ * Called during model loading to enrich the AST.
74
+ *
75
+ * @param rel - Relationship to augment
76
+ * @param containingBc - BoundedContext containing this relationship (for 'this' resolution)
77
+ */
78
+ export declare function augmentRelationship(rel: Relationship, containingBc?: BoundedContext): void;
79
+ /**
80
+ * Augments all AST nodes in a model with SDK-resolved properties.
81
+ *
82
+ * This function walks the entire AST and adds lazy getters for resolved
83
+ * properties like `effectiveClassification`, `effectiveTeam`, etc.
84
+ *
85
+ * Idempotent - safe to call multiple times on the same model.
86
+ * Automatically called by `fromModel()`, `fromDocument()`, and `fromServices()`.
87
+ *
88
+ * @param model - Root Model node to augment
89
+ */
90
+ export declare function augmentModel(model: Model): void;