@lionweb/class-core-generator 0.7.0-beta.0 → 0.7.0-beta.10

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 (130) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/entity-types.templates.d.ts +4 -0
  3. package/dist/entity-types.templates.d.ts.map +1 -0
  4. package/dist/{api/entity-types.templates.js → entity-types.templates.js} +36 -15
  5. package/dist/entity-types.templates.js.map +1 -0
  6. package/dist/{api/generation-headers.d.ts → generation-headers.d.ts} +1 -1
  7. package/dist/generation-headers.d.ts.map +1 -0
  8. package/dist/{api/generation-headers.js → generation-headers.js} +19 -13
  9. package/dist/generation-headers.js.map +1 -0
  10. package/dist/{api/generator.d.ts → generator.d.ts} +0 -2
  11. package/dist/generator.d.ts.map +1 -0
  12. package/dist/{api/generator.js → generator.js} +0 -1
  13. package/dist/generator.js.map +1 -0
  14. package/dist/helpers/classifiers.d.ts.map +1 -0
  15. package/dist/helpers/classifiers.js.map +1 -0
  16. package/dist/helpers/entities.d.ts.map +1 -0
  17. package/dist/helpers/entities.js.map +1 -0
  18. package/dist/{api/helpers → helpers}/features.d.ts +3 -3
  19. package/dist/helpers/features.d.ts.map +1 -0
  20. package/dist/{api/helpers → helpers}/features.js +11 -11
  21. package/dist/helpers/features.js.map +1 -0
  22. package/dist/helpers/imports-tracking.d.ts.map +1 -0
  23. package/dist/{api/helpers → helpers}/imports-tracking.js +1 -1
  24. package/dist/helpers/imports-tracking.js.map +1 -0
  25. package/dist/{api/helpers → helpers}/index.d.ts +0 -2
  26. package/dist/helpers/index.d.ts.map +1 -0
  27. package/dist/{api/helpers → helpers}/index.js +0 -2
  28. package/dist/helpers/index.js.map +1 -0
  29. package/dist/helpers/primitive-types.d.ts.map +1 -0
  30. package/dist/{api/helpers → helpers}/primitive-types.js +4 -4
  31. package/dist/helpers/primitive-types.js.map +1 -0
  32. package/dist/index-ts.d.ts.map +1 -0
  33. package/dist/{api/index-ts.js → index-ts.js} +3 -2
  34. package/dist/index-ts.js.map +1 -0
  35. package/dist/index.d.ts +3 -2
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +3 -2
  38. package/dist/index.js.map +1 -1
  39. package/dist/language-file.templates.d.ts.map +1 -0
  40. package/dist/{api/language-file.templates.js → language-file.templates.js} +3 -5
  41. package/dist/language-file.templates.js.map +1 -0
  42. package/dist/mega-factory.templates.d.ts +3 -0
  43. package/dist/mega-factory.templates.d.ts.map +1 -0
  44. package/dist/{api/mega-factory.templates.js → mega-factory.templates.js} +4 -4
  45. package/dist/mega-factory.templates.js.map +1 -0
  46. package/dist/reflective-layer.templates.d.ts.map +1 -0
  47. package/dist/{api/reflective-layer.templates.js → reflective-layer.templates.js} +9 -5
  48. package/dist/reflective-layer.templates.js.map +1 -0
  49. package/package.json +17 -13
  50. package/src/{api/entity-types.templates.ts → entity-types.templates.ts} +56 -20
  51. package/src/{api/generation-headers.ts → generation-headers.ts} +19 -15
  52. package/src/{api/generator.ts → generator.ts} +0 -3
  53. package/src/{api/helpers → helpers}/features.ts +13 -12
  54. package/src/{api/helpers → helpers}/imports-tracking.ts +1 -1
  55. package/src/{api/helpers → helpers}/index.ts +0 -2
  56. package/src/{api/helpers → helpers}/primitive-types.ts +4 -4
  57. package/src/{api/index-ts.ts → index-ts.ts} +4 -3
  58. package/src/index.ts +3 -2
  59. package/src/{api/language-file.templates.ts → language-file.templates.ts} +3 -6
  60. package/src/{api/mega-factory.templates.ts → mega-factory.templates.ts} +4 -5
  61. package/src/{api/reflective-layer.templates.ts → reflective-layer.templates.ts} +9 -4
  62. package/dist/api/entity-types.templates.d.ts +0 -5
  63. package/dist/api/entity-types.templates.d.ts.map +0 -1
  64. package/dist/api/entity-types.templates.js.map +0 -1
  65. package/dist/api/generation-headers.d.ts.map +0 -1
  66. package/dist/api/generation-headers.js.map +0 -1
  67. package/dist/api/generator.d.ts.map +0 -1
  68. package/dist/api/generator.js.map +0 -1
  69. package/dist/api/helpers/classifiers.d.ts.map +0 -1
  70. package/dist/api/helpers/classifiers.js.map +0 -1
  71. package/dist/api/helpers/dependencies.d.ts +0 -11
  72. package/dist/api/helpers/dependencies.d.ts.map +0 -1
  73. package/dist/api/helpers/dependencies.js +0 -52
  74. package/dist/api/helpers/dependencies.js.map +0 -1
  75. package/dist/api/helpers/entities.d.ts.map +0 -1
  76. package/dist/api/helpers/entities.js.map +0 -1
  77. package/dist/api/helpers/features.d.ts.map +0 -1
  78. package/dist/api/helpers/features.js.map +0 -1
  79. package/dist/api/helpers/imports-tracking.d.ts.map +0 -1
  80. package/dist/api/helpers/imports-tracking.js.map +0 -1
  81. package/dist/api/helpers/index.d.ts.map +0 -1
  82. package/dist/api/helpers/index.js.map +0 -1
  83. package/dist/api/helpers/mps-annotations.d.ts +0 -19
  84. package/dist/api/helpers/mps-annotations.d.ts.map +0 -1
  85. package/dist/api/helpers/mps-annotations.js +0 -65
  86. package/dist/api/helpers/mps-annotations.js.map +0 -1
  87. package/dist/api/helpers/primitive-types.d.ts.map +0 -1
  88. package/dist/api/helpers/primitive-types.js.map +0 -1
  89. package/dist/api/index-ts.d.ts.map +0 -1
  90. package/dist/api/index-ts.js.map +0 -1
  91. package/dist/api/index.d.ts +0 -5
  92. package/dist/api/index.d.ts.map +0 -1
  93. package/dist/api/index.js +0 -21
  94. package/dist/api/index.js.map +0 -1
  95. package/dist/api/language-file.templates.d.ts.map +0 -1
  96. package/dist/api/language-file.templates.js.map +0 -1
  97. package/dist/api/mega-factory.templates.d.ts +0 -4
  98. package/dist/api/mega-factory.templates.d.ts.map +0 -1
  99. package/dist/api/mega-factory.templates.js.map +0 -1
  100. package/dist/api/reflective-layer.templates.d.ts.map +0 -1
  101. package/dist/api/reflective-layer.templates.js.map +0 -1
  102. package/dist/utils/index.d.ts +0 -3
  103. package/dist/utils/index.d.ts.map +0 -1
  104. package/dist/utils/index.js +0 -19
  105. package/dist/utils/index.js.map +0 -1
  106. package/dist/utils/json-as-ts.d.ts +0 -2
  107. package/dist/utils/json-as-ts.d.ts.map +0 -1
  108. package/dist/utils/json-as-ts.js +0 -18
  109. package/dist/utils/json-as-ts.js.map +0 -1
  110. package/dist/utils/textgen.d.ts +0 -21
  111. package/dist/utils/textgen.d.ts.map +0 -1
  112. package/dist/utils/textgen.js +0 -67
  113. package/dist/utils/textgen.js.map +0 -1
  114. package/src/api/helpers/dependencies.ts +0 -62
  115. package/src/api/helpers/mps-annotations.ts +0 -67
  116. package/src/api/index.ts +0 -21
  117. package/src/utils/index.ts +0 -20
  118. package/src/utils/json-as-ts.ts +0 -20
  119. package/src/utils/textgen.ts +0 -89
  120. /package/dist/{api/helpers → helpers}/classifiers.d.ts +0 -0
  121. /package/dist/{api/helpers → helpers}/classifiers.js +0 -0
  122. /package/dist/{api/helpers → helpers}/entities.d.ts +0 -0
  123. /package/dist/{api/helpers → helpers}/entities.js +0 -0
  124. /package/dist/{api/helpers → helpers}/imports-tracking.d.ts +0 -0
  125. /package/dist/{api/helpers → helpers}/primitive-types.d.ts +0 -0
  126. /package/dist/{api/index-ts.d.ts → index-ts.d.ts} +0 -0
  127. /package/dist/{api/language-file.templates.d.ts → language-file.templates.d.ts} +0 -0
  128. /package/dist/{api/reflective-layer.templates.d.ts → reflective-layer.templates.d.ts} +0 -0
  129. /package/src/{api/helpers → helpers}/classifiers.ts +0 -0
  130. /package/src/{api/helpers → helpers}/entities.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -2,3 +2,9 @@
2
2
 
3
3
  ## 0.7.0
4
4
 
5
+ * Move `dependenciesThroughDirectInheritanceOf` and `verboseDependencies` functions from `class-core-generator` to `utilities` package.
6
+ * Remove everything specific to annotations coming from the `io.lionweb.mps.specific` language, in favor of using the types and functionality provided by the `@lionweb/io-lionweb-mps-specific` package.
7
+ **Note**: this slightly breaks the API of the generator, but in such a trivial way (because of the use of defaults) that it doesn't warrant an increment in major version, IOHO.
8
+ * Partition concepts are now marked as such in their `ILanguageBase` implementation.
9
+ * Constructors of abstract concepts are now declared `protected` instead of `public`.
10
+
@@ -0,0 +1,4 @@
1
+ import { LanguageEntity } from "@lionweb/core";
2
+ import { Imports } from "./helpers/index.js";
3
+ export declare const typeForLanguageEntity: (imports: Imports) => (entity: LanguageEntity) => import("littoral-templates").Template[];
4
+ //# sourceMappingURL=entity-types.templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-types.templates.d.ts","sourceRoot":"","sources":["../src/entity-types.templates.ts"],"names":[],"mappings":"AAiBA,OAAO,EAUH,cAAc,EASjB,MAAM,eAAe,CAAA;AAYtB,OAAO,EAKH,OAAO,EAQV,MAAM,oBAAoB,CAAA;AAc3B,eAAO,MAAM,qBAAqB,YAAa,OAAO,cAmMlC,cAAc,4CAoBjC,CAAA"}
@@ -14,10 +14,11 @@
14
14
  //
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
- import { builtinClassifiers, Classifier, Enumeration, featureMetaType, Interface, isContainment, isProperty, isReference, Link, nameSorted, PrimitiveType, Property, Reference } from "@lionweb/core";
17
+ import { builtinClassifiers, Classifier, Enumeration, featureMetaType, Interface, isContainment, isProperty, isReference, LanguageEntity, Link, nameSorted, PrimitiveType, Property, Reference } from "@lionweb/core";
18
+ import { ConceptDescription, Deprecated, ioLionWebMpsSpecificAnnotationsFrom, KeyedDescription, ShortDescription, VirtualPackage } from "@lionweb/io-lionweb-mps-specific";
19
+ import { indent, switchOrIf, withFirstUpper, wrapInIf } from "@lionweb/textgen-utils";
18
20
  import { commaSeparated, when, withNewlineAppended } from "littoral-templates";
19
- import { indent, switchOrIf, withFirstUpper, wrapInIf } from "../utils/textgen.js";
20
- import { ConceptDescription, Deprecated, entityMetaType, extendsFrom, featuresToConcretelyImplementOf, implementsFrom, isAbstract, optionalityPostfix, tsFieldTypeForFeature, tsTypeForClassifier, tsTypeForDatatype, tsTypeForPrimitiveType, tsTypeForValueManager } from "./helpers/index.js";
21
+ import { entityMetaType, extendsFrom, featuresToConcretelyImplementOf, implementsFrom, isAbstract, optionalityPostfix, tsFieldTypeForFeature, tsTypeForClassifier, tsTypeForDataType, tsTypeForPrimitiveType, tsTypeForValueManager } from "./helpers/index.js";
21
22
  const cardinalityPrefix = (feature) => {
22
23
  if (feature instanceof Property) {
23
24
  return feature.optional ? "Optional" : "Required";
@@ -27,17 +28,18 @@ const cardinalityPrefix = (feature) => {
27
28
  }
28
29
  };
29
30
  const valueManagerFor = (feature) => `${cardinalityPrefix(feature)}${featureMetaType(feature)}ValueManager`;
30
- export const typeForLanguageEntity = (imports, mpsAnnotationsPerId) => {
31
+ export const typeForLanguageEntity = (imports) => {
31
32
  const sortedSuperTypesCond = (ts, prefix) => ts.length === 0 ? `` : `${prefix}${nameSorted(ts).map((t) => imports.entity(t)).join(", ")}`;
32
33
  const extendsCond = (ref) => ` extends ${ref === builtinClassifiers.node ? imports.generic("NodeBase") : imports.entity(ref)}`;
33
34
  const classMembersForProperty = (property) => {
34
35
  const { name, type } = property;
35
36
  return [
36
- `private readonly _${name}: ${imports.generic(valueManagerFor(property))}<${tsTypeForDatatype(type, imports)}>;`,
37
- `get ${name}(): ${tsTypeForDatatype(type, imports)}${optionalityPostfix(property)} {`,
37
+ `private readonly _${name}: ${imports.generic(valueManagerFor(property))}<${tsTypeForDataType(type, imports)}>;`,
38
+ jsDocFor(property),
39
+ `get ${name}(): ${tsTypeForDataType(type, imports)}${optionalityPostfix(property)} {`,
38
40
  indent(`return this._${name}.get();`),
39
41
  `}`,
40
- `set ${name}(newValue: ${tsTypeForDatatype(type, imports)}${optionalityPostfix(property)}) {`,
42
+ `set ${name}(newValue: ${tsTypeForDataType(type, imports)}${optionalityPostfix(property)}) {`,
41
43
  indent(`this._${name}.set(newValue);`),
42
44
  `}`
43
45
  ];
@@ -48,6 +50,7 @@ export const typeForLanguageEntity = (imports, mpsAnnotationsPerId) => {
48
50
  const { name, type, multiple } = link;
49
51
  return [
50
52
  `private readonly _${name}: ${imports.generic(valueManagerFor(link))}<${tsTypeForClassifier(type, imports)}>;`,
53
+ jsDocFor(link),
51
54
  `get ${name}(): ${tsTypeForLink(link)} {`,
52
55
  indent(`return this._${name}.get();`),
53
56
  `}`,
@@ -110,7 +113,7 @@ export const typeForLanguageEntity = (imports, mpsAnnotationsPerId) => {
110
113
  when(features.length > 0)(() => [
111
114
  ``,
112
115
  features.map(withNewlineAppended(classMembersForFeature)),
113
- `public constructor(classifier: ${imports.core("Classifier")}, id: ${imports.json("LionWebId")}, handleDelta?: ${imports.generic("DeltaHandler")}, parentInfo?: ${imports.generic("Parentage")}) {`,
116
+ `${isAbstract(classifier) ? "protected" : "public"} constructor(classifier: ${imports.core("Classifier")}, id: ${imports.json("LionWebId")}, handleDelta?: ${imports.generic("DeltaHandler")}, parentInfo?: ${imports.generic("Parentage")}) {`,
114
117
  indent([
115
118
  `super(classifier, id, handleDelta, parentInfo);`,
116
119
  features.map((feature) => `this._${feature.name} = new ${imports.generic(valueManagerFor(feature))}<${tsTypeForValueManager(feature, imports)}>(${imports.language(feature.classifier.language)}.INSTANCE.${feature.classifier.name}_${feature.name}, this);`)
@@ -138,14 +141,32 @@ export const typeForLanguageEntity = (imports, mpsAnnotationsPerId) => {
138
141
  ];
139
142
  const typeForPrimitiveType = (primitiveType) => `export type ${primitiveType.name} = ${tsTypeForPrimitiveType(primitiveType)};`;
140
143
  const jsDocFor = (entity) => {
141
- const mpsAnnotationsForEntity = mpsAnnotationsPerId[entity.id] ?? [];
142
- const conceptDescription = mpsAnnotationsForEntity.find((mpsAnnotation) => mpsAnnotation instanceof ConceptDescription);
143
- const hasShortConceptDescription = !!(conceptDescription?.shortDescription);
144
- const deprecated = mpsAnnotationsForEntity.find((mpsAnnotation) => mpsAnnotation instanceof Deprecated);
145
- return when(hasShortConceptDescription || deprecated !== undefined)([
144
+ const annotations = ioLionWebMpsSpecificAnnotationsFrom(entity);
145
+ const conceptDescription = annotations.find((annotation) => annotation instanceof ConceptDescription);
146
+ const deprecated = annotations.find((annotation) => annotation instanceof Deprecated);
147
+ const keyedDescription = annotations.find((annotation) => annotation instanceof KeyedDescription);
148
+ const shortDescription = annotations.find((annotation) => annotation instanceof ShortDescription);
149
+ const virtualPackage = annotations.find((annotation) => annotation instanceof VirtualPackage);
150
+ const requiresJsDoc = !!(conceptDescription?.conceptShortDescription)
151
+ || !!(conceptDescription?.helpUrl)
152
+ || !!(shortDescription?.description)
153
+ || keyedDescription !== undefined
154
+ || deprecated !== undefined
155
+ || !!(virtualPackage?.name);
156
+ const linkName = (node) => node instanceof LanguageEntity
157
+ ? node.name
158
+ : "??? (not a language's entity)";
159
+ return when(requiresJsDoc)([
146
160
  `/**`,
147
- when(hasShortConceptDescription)(() => ` * ${conceptDescription.shortDescription}`),
148
- when(deprecated !== undefined)(() => ` * @deprecated ${deprecated.comment ?? ""}${deprecated.build === null ? "" : ` (build: ${deprecated.build})`}`),
161
+ when(!!(conceptDescription?.conceptShortDescription))(() => ` * ${conceptDescription.conceptShortDescription}`),
162
+ when(!!(conceptDescription?.helpUrl))(() => ` * {@see} ${conceptDescription.helpUrl}`),
163
+ when(!!(shortDescription?.description))(() => ` * ${shortDescription.description}`),
164
+ when(keyedDescription !== undefined)(() => [
165
+ when(keyedDescription.documentation !== undefined)(` * ${keyedDescription.documentation}`),
166
+ keyedDescription.seeAlso.map((seeAlso) => ` * {@see} {@link ${linkName(seeAlso)}}`)
167
+ ]),
168
+ when(deprecated !== undefined)(() => ` * @deprecated ${deprecated.comment ?? ""}${deprecated.build === undefined ? "" : ` (build: ${deprecated.build})`}`),
169
+ when(!!(virtualPackage?.name))(() => `(virtual package: ${virtualPackage.name})`),
149
170
  ` */`
150
171
  ]);
151
172
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-types.templates.js","sourceRoot":"","sources":["../src/entity-types.templates.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,E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AA;YACrC,CAAC;YACD,IAAI,MAAM,YAAY,aAAa,EAAE,CAAC;gBAClC,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAA;YACvC,CAAC;YACD,OAAO,iCAAiC,cAAc,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,IAAI,GAAG,CAAA;QACrF,CAAC,CAAC,EAAE;KACP,CAAA;AAET,CAAC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Generic (//-styled) comments warning about code being generated.
3
3
  */
4
- export declare const generatedCodeWarningComments = "// Warning: this file is generated!\n// Modifying it by hand is useless at best, and sabotage at worst.\n";
4
+ export declare const generatedCodeWarningComments = "// Warning: this file is generated!\n// Modifying it by hand is useless at best, and sabotage at worst.";
5
5
  /**
6
6
  * The empty line-separation concatenation of the Trumpf-flavored Apache-2.0 license header and the generation warning.
7
7
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generation-headers.d.ts","sourceRoot":"","sources":["../src/generation-headers.ts"],"names":[],"mappings":"AAuCA;;GAEG;AACH,eAAO,MAAM,4BAA4B,4GAC0B,CAAA;AAEnE;;GAEG;AACH,eAAO,MAAM,+CAA+C,QACqC,CAAA"}
@@ -1,12 +1,20 @@
1
- // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE
1
+ // Copyright 2025 TRUMPF Laser SE and other contributors
2
2
  //
3
- // SPDX-License-Identifier: LicenseRef-TRUMPF
3
+ // Licensed under the Apache License, Version 2.0 (the "License")
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ //
15
+ // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
+ // SPDX-License-Identifier: Apache-2.0
4
17
  import { asString } from "littoral-templates";
5
- /**
6
- * @return the given string, reversed — "abc" -> "cba"
7
- * Note: only used to hack around the REUSE compliance checker!
8
- */
9
- const reverseString = (str) => str.split("").reverse().join("");
10
18
  /**
11
19
  * The license header (as //-styled comments) for code originating from Trumpf Laser SE, licensed under Apache-2.0.
12
20
  */
@@ -24,17 +32,15 @@ const trumpfOriginatingApache2_0LicenseHeaderComments = `// Copyright 2025 TRUMP
24
32
  // See the License for the specific language governing permissions and
25
33
  // limitations under the License.
26
34
  //
27
- // ${reverseString("txeTthgirypoCeliF-XDPS")}: 2025 TRUMPF Laser SE and other contributors
28
- // ${reverseString("reifitnedI-esneciL-XDPS")}: Apache-2.0
29
- `;
35
+ // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
36
+ // SPDX-License-Identifier: Apache-2.0`;
30
37
  /**
31
38
  * Generic (//-styled) comments warning about code being generated.
32
39
  */
33
40
  export const generatedCodeWarningComments = `// Warning: this file is generated!
34
- // Modifying it by hand is useless at best, and sabotage at worst.
35
- `;
41
+ // Modifying it by hand is useless at best, and sabotage at worst.`;
36
42
  /**
37
43
  * The empty line-separation concatenation of the Trumpf-flavored Apache-2.0 license header and the generation warning.
38
44
  */
39
- export const defaultTrumpfOriginatingApache2_0LicensedHeader = asString([trumpfOriginatingApache2_0LicenseHeaderComments, ``, generatedCodeWarningComments, ``]);
45
+ export const defaultTrumpfOriginatingApache2_0LicensedHeader = asString([trumpfOriginatingApache2_0LicenseHeaderComments, ``, generatedCodeWarningComments]);
40
46
  //# sourceMappingURL=generation-headers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generation-headers.js","sourceRoot":"","sources":["../src/generation-headers.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7C;;GAEG;AACH,MAAM,+CAA+C,GAAG;;;;;;;;;;;;;;;uCAejB,CAAA;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;mEACuB,CAAA;AAEnE;;GAEG;AACH,MAAM,CAAC,MAAM,+CAA+C,GACxD,QAAQ,CAAC,CAAC,+CAA+C,EAAE,EAAE,EAAE,4BAA4B,CAAC,CAAC,CAAA"}
@@ -1,7 +1,5 @@
1
1
  import { Language } from "@lionweb/core";
2
- import { MpsAnnotation } from "./helpers/index.js";
3
2
  export type GeneratorOptions = {
4
- mpsAnnotations: MpsAnnotation[];
5
3
  genericImportLocation: string;
6
4
  header?: string;
7
5
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAwB,QAAQ,EAAY,MAAM,eAAe,CAAA;AAaxE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,qBAAqB,EAAE,MAAM,CAAA;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AASD,eAAO,MAAM,gBAAgB,aAAc,QAAQ,kBAAkB,MAAM,YAAY,QAAQ,gBAAgB,CAAC,KAAG,MAKlH,CAAA;AAGD,eAAO,MAAM,4BAA4B,sBAAuB,MAAM,kBAAkB,MAAM,YAAY,QAAQ,gBAAgB,CAAC,SAQlI,CAAA;AAGD,eAAO,MAAM,wBAAwB,cAAe,QAAQ,EAAE,kBAAkB,MAAM,iBAAiB,QAAQ,gBAAgB,CAAC,SAkB/H,CAAA"}
@@ -23,7 +23,6 @@ import { indexTsFor } from "./index-ts.js";
23
23
  import { languageFileFor } from "./language-file.templates.js";
24
24
  const properGenericImportLocation = "@lionweb/class-core";
25
25
  const withDefaults = (options) => ({
26
- mpsAnnotations: options?.mpsAnnotations ?? [],
27
26
  genericImportLocation: options?.genericImportLocation ?? properGenericImportLocation,
28
27
  header: options?.header
29
28
  });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,OAAO,EAAE,oBAAoB,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAE9D,MAAM,2BAA2B,GAAG,qBAAqB,CAAA;AASzD,MAAM,YAAY,GAAG,CAAC,OAAmC,EAAoB,EAAE,CAAC,CAAC;IAC7E,qBAAqB,EAAE,OAAO,EAAE,qBAAqB,IAAI,2BAA2B;IACpF,MAAM,EAAE,OAAO,EAAE,MAAM;CAC1B,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAkB,EAAE,cAAsB,EAAE,OAAmC,EAAU,EAAE;IACxH,MAAM,EAAC,IAAI,EAAC,GAAG,QAAQ,CAAA;IACvB,MAAM,QAAQ,GAAG,GAAG,IAAI,OAAO,CAAA;IAC/B,aAAa,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,E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Ac,EAAE,OAAO,CAAC,CAAA;QACpE,OAAO,CAAC,GAAG,CAAC,UAAU,QAAQ,iBAAiB,IAAI,aAAa,OAAO,SAAS,GAAG,QAAQ,EAAE,GAAG,CAAC,CAAA;IACrG,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IACrB,OAAO,CAAC,GAAG,EAAE,CAAA;AACjB,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classifiers.d.ts","sourceRoot":"","sources":["../../src/helpers/classifiers.ts"],"names":[],"mappings":"AAiBA,OAAO,EAA8C,UAAU,EAAW,OAAO,EAAa,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAGxI,eAAO,MAAM,UAAU,eAAgB,UAAU,KAAG,OAA+D,CAAA;AAMnH,eAAO,MAAM,WAAW,eAAgB,UAAU,KAAG,UAAU,UAAU,CAAC,GAAG,SAQ5E,CAAA;AAED,eAAO,MAAM,cAAc,eAAgB,UAAU,KAAG,SAAS,UAAU,CAQ1E,CAAA;AAED,eAAO,MAAM,+BAA+B,eAAgB,UAAU,KAAG,OAAO,EAO/E,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classifiers.js","sourceRoot":"","sources":["../../src/helpers/classifiers.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAc,OAAO,EAAW,SAAS,EAAuB,MAAM,eAAe,CAAA;AACxI,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,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AAc,GAAG,YAAY,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,eAAe,CAAA;AAE9F,eAAO,MAAM,cAAc,WAAY,cAAc,KAAG,cAcvD,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.js","sourceRoot":"","sources":["../../src/helpers/entities.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAkB,aAAa,EAAE,MAAM,eAAe,CAAA;AAI7F,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAsB,EAAkB,EAAE;IACrE,IAAI,MAAM,YAAY,UAAU,EAAE,CAAC;QAC/B,OAAO,YAAY,CAAA;IACvB,CAAC;IACD,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAA;IACpB,CAAC;IACD,IAAI,MAAM,YAAY,SAAS,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAA;IACtB,CAAC;IACD,IAAI,MAAM,YAAY,aAAa,EAAE,CAAC;QAClC,OAAO,eAAe,CAAA;IAC1B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,qCAAqC,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAA;AACnF,CAAC,CAAA"}
@@ -1,9 +1,9 @@
1
- import { Classifier, Datatype, Feature, LanguageEntity, SingleRef } from "@lionweb/core";
1
+ import { Classifier, DataType, Feature, LanguageEntity, SingleRef } from "@lionweb/core";
2
2
  import { Imports } from "./index.js";
3
3
  export declare const typeOf: (feature: Feature) => SingleRef<LanguageEntity>;
4
- export declare const tsTypeForDatatype: (datatype: SingleRef<Datatype>, imports: Imports) => string;
4
+ export declare const tsTypeForDataType: (dataType: SingleRef<DataType>, imports: Imports) => string;
5
5
  export declare const tsTypeForClassifier: (classifier: SingleRef<Classifier>, imports: Imports) => string;
6
- export declare const optionalityPostfix: (feature: Feature) => "" | " | undefined";
6
+ export declare const optionalityPostfix: (feature: Feature) => " | undefined" | "";
7
7
  export declare const tsFieldTypeForFeature: (feature: Feature, imports: Imports) => string;
8
8
  export declare const tsTypeForValueManager: (feature: Feature, imports: Imports) => string;
9
9
  //# sourceMappingURL=features.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/helpers/features.ts"],"names":[],"mappings":"AAiBA,OAAO,EAEH,UAAU,EACV,QAAQ,EAER,OAAO,EAIP,cAAc,EAId,SAAS,EAEZ,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,OAAO,EAA0B,MAAM,YAAY,CAAA;AAE5D,eAAO,MAAM,MAAM,YAAa,OAAO,KAAG,UAAU,cAAc,CAQjE,CAAA;AAGD,eAAO,MAAM,iBAAiB,aAAc,UAAU,QAAQ,CAAC,WAAW,OAAO,WAWhF,CAAA;AAGD,eAAO,MAAM,mBAAmB,eAAgB,UAAU,UAAU,CAAC,WAAW,OAAO,WAKtF,CAAA;AAGD,eAAO,MAAM,kBAAkB,YAAa,OAAO,wBAA2C,CAAA;AAE9F,eAAO,MAAM,qBAAqB,YAAa,OAAO,WAAW,OAAO,KAAG,MA0B1E,CAAA;AAED,eAAO,MAAM,qBAAqB,YAAa,OAAO,WAAW,OAAO,KAAG,MAqB1E,CAAA"}
@@ -14,7 +14,7 @@
14
14
  //
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
- import { builtinClassifiers, Enumeration, isContainment, isProperty, isReference, Link, PrimitiveType, Property } from "@lionweb/core";
17
+ import { builtinClassifiers, Enumeration, isContainment, isProperty, isReference, Link, PrimitiveType, Property, unresolved } from "@lionweb/core";
18
18
  import { tsTypeForPrimitiveType } from "./index.js";
19
19
  export const typeOf = (feature) => {
20
20
  if (feature instanceof Property) {
@@ -25,21 +25,21 @@ export const typeOf = (feature) => {
25
25
  }
26
26
  return null;
27
27
  };
28
- export const tsTypeForDatatype = (datatype, imports) => {
29
- if (datatype === null) {
30
- return `unknown /* [ERROR] can't compute a TS type for a null datatype */`;
28
+ export const tsTypeForDataType = (dataType, imports) => {
29
+ if (dataType === null) {
30
+ return `unknown /* [ERROR] can't compute a TS type for a null data type */`;
31
31
  }
32
- if (datatype instanceof PrimitiveType) {
33
- return tsTypeForPrimitiveType(datatype);
32
+ if (dataType instanceof PrimitiveType) {
33
+ return tsTypeForPrimitiveType(dataType);
34
34
  }
35
- if (datatype instanceof Enumeration) {
36
- return imports.entity(datatype);
35
+ if (dataType instanceof Enumeration) {
36
+ return imports.entity(dataType);
37
37
  }
38
- return `unknown /* [ERROR] can't compute a TS type for datatype ${datatype.name} that has an unhandled/-known meta-type ${datatype.constructor.name} */`;
38
+ return `unknown /* [ERROR] can't compute a TS type for data type ${dataType.name} that has an unhandled/-known meta-type ${dataType.constructor.name} */`;
39
39
  };
40
40
  export const tsTypeForClassifier = (classifier, imports) => {
41
- if (classifier === null) {
42
- return `unknown /* [ERROR] can't compute a TS type for a null classifier */`;
41
+ if (classifier === unresolved) {
42
+ return `unknown /* [ERROR] can't compute a TS type for an unresolved classifier */`;
43
43
  }
44
44
  return classifier === builtinClassifiers.node ? imports.generic("INodeBase") : imports.entity(classifier);
45
45
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features.js","sourceRoot":"","sources":["../../src/helpers/features.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;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C,UAAU,EAAE,MAAM;IAKvB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAoB;IACpD,IAAI,cAAc,aAEjB;IACD,OAAO,CAAC,UAAU,EAAE,MAAM;IAK1B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoB;IAClD,IAAI,YAAY,aAEf;IACD,MAAM,CAAC,MAAM,EAAE,cAAc;IAY7B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAoB;IACrD,IAAI,eAAe,aAElB;IACD,QAAQ,CAAC,QAAQ,EAAE,QAAQ;CAY9B"}
@@ -15,7 +15,7 @@
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
17
  import { lioncoreBuiltins } from "@lionweb/core";
18
- import { asJSIdentifier } from "../../utils/textgen.js";
18
+ import { asJSIdentifier } from "@lionweb/textgen-utils";
19
19
  export const importRenamingForLanguage = (language) => asJSIdentifier(language.name);
20
20
  export const nameOfBaseClassForLanguage = (language) => asJSIdentifier(language.name) + "Base";
21
21
  const lionCoreBuiltinsIdentifier = nameOfBaseClassForLanguage(lioncoreBuiltins);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imports-tracking.js","sourceRoot":"","sources":["../../src/helpers/imports-tracking.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,OAAO,EAA4B,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,QAAkB,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,I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AE,CAAA;IACpE,CAAC;CACJ"}
@@ -1,8 +1,6 @@
1
1
  export * from "./classifiers.js";
2
- export * from "./dependencies.js";
3
2
  export * from "./entities.js";
4
3
  export * from "./features.js";
5
4
  export * from "./imports-tracking.js";
6
- export * from "./mps-annotations.js";
7
5
  export * from "./primitive-types.js";
8
6
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAiBA,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA"}
@@ -15,10 +15,8 @@
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
17
  export * from "./classifiers.js";
18
- export * from "./dependencies.js";
19
18
  export * from "./entities.js";
20
19
  export * from "./features.js";
21
20
  export * from "./imports-tracking.js";
22
- export * from "./mps-annotations.js";
23
21
  export * from "./primitive-types.js";
24
22
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitive-types.d.ts","sourceRoot":"","sources":["../../src/helpers/primitive-types.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAqB,aAAa,EAAE,MAAM,eAAe,CAAA;AAEhE,eAAO,MAAM,sBAAsB,kBAAmB,aAAa,KAAG,MAarE,CAAA"}
@@ -17,13 +17,13 @@
17
17
  import { builtinPrimitives } from "@lionweb/core";
18
18
  export const tsTypeForPrimitiveType = (primitiveType) => {
19
19
  switch (primitiveType) {
20
- case builtinPrimitives.booleanDatatype:
20
+ case builtinPrimitives.booleanDataType:
21
21
  return `boolean`;
22
- case builtinPrimitives.stringDatatype:
22
+ case builtinPrimitives.stringDataType:
23
23
  return `string`;
24
- case builtinPrimitives.integerDatatype:
24
+ case builtinPrimitives.integerDataType:
25
25
  return `number`;
26
- case builtinPrimitives.jsonDatatype:
26
+ case builtinPrimitives.jsonDataType:
27
27
  return `unknown`;
28
28
  default:
29
29
  return `string`;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitive-types.js","sourceRoot":"","sources":["../../src/helpers/primitive-types.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,OAAO,EAAE,iBAAiB,EAAiB,MAAM,eAAe,CAAA;AAEhE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,aAA4B,EAAU,EAAE;IAC3E,QAAQ,aAAa,EAAE,CAAC;QACpB,KAAK,iBAAiB,CAAC,eAAe;YAClC,OAAO,SAAS,CAAA;QACpB,KAAK,iBAAiB,CAAC,cAAc;YACjC,OAAO,QAAQ,CAAA;QACnB,KAAK,iBAAiB,CAAC,eAAe;YAClC,OAAO,QAAQ,CAAA;QACnB,KAAK,iBAAiB,CAAC,YAAY;YAC/B,OAAO,SAAS,CAAA;QACpB;YACI,OAAO,QAAQ,CAAA;IACvB,CAAC;AACL,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-ts.d.ts","sourceRoot":"","sources":["../src/index-ts.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAMxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGjD,eAAO,MAAM,UAAU,cAAe,QAAQ,EAAE,WAAW,gBAAgB,WA0C1E,CAAA"}
@@ -14,10 +14,11 @@
14
14
  //
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
+ import { indent } from "@lionweb/textgen-utils";
17
18
  import { dependencyOrderOf } from "@lionweb/ts-utils";
19
+ import { dependenciesThroughDirectInheritanceOf } from "@lionweb/utilities";
18
20
  import { asString, commaSeparated } from "littoral-templates";
19
- import { indent } from "../utils/textgen.js";
20
- import { dependenciesThroughDirectInheritanceOf, importRenamingForLanguage, nameOfBaseClassForLanguage } from "./helpers/index.js";
21
+ import { importRenamingForLanguage, nameOfBaseClassForLanguage } from "./helpers/index.js";
21
22
  export const indexTsFor = (languages, options) => {
22
23
  const dependenciesInOrderOfDirectInheritance = dependencyOrderOf(languages, dependenciesThroughDirectInheritanceOf);
23
24
  if (dependenciesInOrderOfDirectInheritance === false) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-ts.js","sourceRoot":"","sources":["../src/index-ts.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAGtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAA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,QAAQ,CAAC,IAAI,0BAA0B,CAAC,QAAQ,CAAC,aAAa,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAC9H;QACL,EAAE;QACF,oDAAoD;QACpD,MAAM,CACF,cAAc,CACV,mBAAmB,CAAC,GAAG,CACnB,QAAQ,CAAC,EAAE,CAAC,GAAG,yBAAyB,CAAC,QAAQ,CAAC,IAAI,0BAA0B,CAAC,QAAQ,CAAC,WAAW,CACxG,CACJ,CACJ;QACD,IAAI;QACJ,EAAE;QACF,UAAU;QACV,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,CAAC;QAChE,IAAI;QACJ,EAAE;KACL,CAAC,CAAA;AACN,CAAC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- export * from "./api/index.js";
2
- export * from "./utils/index.js";
1
+ export { generateLanguage, generateApiFromLanguages, generateApiFromLanguagesJson } from "./generator.js";
2
+ export * from "./generation-headers.js";
3
+ export * from "./mega-factory.templates.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AACzG,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA"}
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@
14
14
  //
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
- export * from "./api/index.js";
18
- export * from "./utils/index.js";
17
+ export { generateLanguage, generateApiFromLanguages, generateApiFromLanguagesJson } from "./generator.js";
18
+ export * from "./generation-headers.js";
19
+ export * from "./mega-factory.templates.js";
19
20
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AACzG,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language-file.templates.d.ts","sourceRoot":"","sources":["../src/language-file.templates.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAW,QAAQ,EAAE,MAAM,eAAe,CAAA;AAMjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAQjD,eAAO,MAAM,eAAe,aAAc,QAAQ,WAAW,gBAAgB,WAsC5E,CAAA"}
@@ -14,11 +14,10 @@
14
14
  //
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
- import { sortedStringsByUppercase } from "@lionweb/ts-utils";
18
17
  import { Concept } from "@lionweb/core";
19
- import { dependencyOrderOf, groupBy } from "@lionweb/ts-utils";
18
+ import { indent } from "@lionweb/textgen-utils";
19
+ import { dependencyOrderOf, sortedStringsByUppercase } from "@lionweb/ts-utils";
20
20
  import { asString, commaSeparated, when, withNewlineAppended } from "littoral-templates";
21
- import { indent } from "../utils/textgen.js";
22
21
  import { typeForLanguageEntity } from "./entity-types.templates.js";
23
22
  import { Imports } from "./helpers/index.js";
24
23
  import { reflectiveClassFor } from "./reflective-layer.templates.js";
@@ -30,7 +29,6 @@ export const languageFileFor = (language, options) => {
30
29
  if (typeof orderedEntities === "boolean") {
31
30
  throw new Error(`language ${name} has a cycle among the graph of entities with edges formed by the inheritance dependency`);
32
31
  }
33
- const mpsAnnotationsPerId = groupBy(options.mpsAnnotations, ({ annotatedNodeId }) => annotatedNodeId);
34
32
  const postImportsPart = [
35
33
  ``,
36
34
  reflectiveClassFor(imports)(language),
@@ -38,7 +36,7 @@ export const languageFileFor = (language, options) => {
38
36
  ``,
39
37
  orderedEntities
40
38
  .filter((entity) => entity.language === language)
41
- .map(withNewlineAppended(typeForLanguageEntity(imports, mpsAnnotationsPerId)))
39
+ .map(withNewlineAppended(typeForLanguageEntity(imports)))
42
40
  ];
43
41
  return asString([
44
42
  options?.header ?? [],
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language-file.templates.js","sourceRoot":"","sources":["../src/language-file.templates.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,OAAO,EAAE,OAAO,EAAY,MAAM,eAAe,CAAA;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AAe,GAAG;QACpB,EAAE;QACF,kBAAkB,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;QACrC,EAAE;QACF,EAAE;QACF,eAAe;aACV,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC;aAChD,GAAG,CAAC,mBAAmB,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;KAChE,CAAA;IAED,OAAO,QAAQ,CAAC;QACZ,OAAO,EAAE,MAAM,IAAI,EAAE;QACrB;;kBAEU,IAAI;kBACJ,OAAO;kBACP,GAAG;kBACH,EAAE;IAChB;QACI,EAAE;QACF,EAAE;QACF,eAAe,CAAC,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC;QACrD,eAAe,CAAC,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC;QACrD,eAAe,CAAC,OAAO,CAAC,qBAAqB,EAAE,OAAO,CAAC,cAAc,CAAC;QACtE,eAAe,CAAC,cAAc,EAAE,OAAO,CAAC,eAAe,CAAC;QACxD,eAAe;KAClB,CAAC,CAAA;AACN,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { Language } from "@lionweb/core";
2
+ export declare const megaFactoryFor: (megaFactoryName: string, languages: Language[], header?: string) => string;
3
+ //# sourceMappingURL=mega-factory.templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mega-factory.templates.d.ts","sourceRoot":"","sources":["../src/mega-factory.templates.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAc,QAAQ,EAAkB,MAAM,eAAe,CAAA;AAKpE,eAAO,MAAM,cAAc,oBAAqB,MAAM,aAAa,QAAQ,EAAE,WAAW,MAAM,WAgD7F,CAAA"}
@@ -15,11 +15,11 @@
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
17
  import { isConcrete } from "@lionweb/core";
18
+ import { Deprecated, ioLionWebMpsSpecificAnnotationsFrom } from "@lionweb/io-lionweb-mps-specific";
19
+ import { asJSIdentifier, indent } from "@lionweb/textgen-utils";
18
20
  import { asString, commaSeparated } from "littoral-templates";
19
- import { asJSIdentifier, indent } from "../utils/textgen.js";
20
- import { Deprecated } from "./helpers/index.js";
21
- export const megaFactoryFor = (megaFactoryName, languages, mpsAnnotations = [], header) => {
22
- const isNotDeprecated = (entity) => !mpsAnnotations.some(mpsAnnotation => mpsAnnotation.annotatedNodeId === entity.id && mpsAnnotation instanceof Deprecated);
21
+ export const megaFactoryFor = (megaFactoryName, languages, header) => {
22
+ const isNotDeprecated = (entity) => !ioLionWebMpsSpecificAnnotationsFrom(entity).some((annotation) => annotation instanceof Deprecated);
23
23
  const requiresFactoryMethod = (entity) => isConcrete(entity) && isNotDeprecated(entity);
24
24
  const factoryFor = (language) => [
25
25
  `${asJSIdentifier(language.name)}Factory = {`,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mega-factory.templates.js","sourceRoot":"","sources":["../src/mega-factory.templates.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,sEAAsE;AACtE,sCAAsC;AAEtC,OAAO,EAAE,UAAU,EAA4B,MAAM,eAAe,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,mCAAmC,EAAE,MAAM,kCAAkC,CAAA;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAE7D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,eAAuB,EAAE,SAAqB,EAAE,MAAe,EAAE,EAAE;IAC9F,MAAM,eAAe,GAAG,CAAC,MAA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AG,CAAC,UAAU,CAAC;SAC9C,CAAC;QACF,GAAG;QACH,EAAE;KACL,CAAC,CAAA;AACN,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflective-layer.templates.d.ts","sourceRoot":"","sources":["../src/reflective-layer.templates.ts"],"names":[],"mappings":"AAiBA,OAAO,EAaH,QAAQ,EAOX,MAAM,eAAe,CAAA;AAKtB,OAAO,EAA+B,OAAO,EAA8B,MAAM,oBAAoB,CAAA;AAErG,eAAO,MAAM,kBAAkB,YAAa,OAAO,gBAwI7B,QAAQ,0BAyE7B,CAAA"}
@@ -14,10 +14,10 @@
14
14
  //
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
- import { Annotation, Classifier, Concept, Enumeration, featureMetaType, Interface, isConcrete, isEnumeration, isMultiple, Link, nameOf, PrimitiveType, Property } from "@lionweb/core";
17
+ import { Annotation, Classifier, Concept, Enumeration, featureMetaType, Interface, isConcrete, isEnumeration, isMultiple, isPartition, Link, nameOf, PrimitiveType, Property } from "@lionweb/core";
18
+ import { indent, switchOrIf } from "@lionweb/textgen-utils";
18
19
  import { asArray } from "@lionweb/ts-utils";
19
20
  import { when, withNewlineAppended } from "littoral-templates";
20
- import { indent, switchOrIf } from "../utils/textgen.js";
21
21
  import { entityMetaType, extendsFrom, nameOfBaseClassForLanguage } from "./helpers/index.js";
22
22
  export const reflectiveClassFor = (imports) => {
23
23
  // classifier:
@@ -37,7 +37,7 @@ export const reflectiveClassFor = (imports) => {
37
37
  const { name, key, id, features } = classifier;
38
38
  const metaType = entityMetaType(classifier);
39
39
  return [
40
- `public readonly _${name} = new ${imports.core(metaType)}(this._language, "${name}", "${key}", "${id}"${classifier instanceof Concept ? ", " + classifier.abstract : ""});`,
40
+ `public readonly _${name} = new ${imports.core(metaType)}(this._language, "${name}", "${key}", "${id}"${classifier instanceof Concept ? ", " + classifier.abstract : ""})${isPartition(classifier) ? ".isPartition()" : ""};`,
41
41
  // | core (2nd x) |
42
42
  `get ${name}(): ${metaType} {`,
43
43
  indent([`this.ensureWiredUp();`, `return this._${name};`]),
@@ -167,8 +167,12 @@ export const reflectiveClassFor = (imports) => {
167
167
  indent([
168
168
  `return (classifier: ${imports.core("Classifier")}, ${parameterPrefix}id: ${imports.json("LionWebId")}) => {`,
169
169
  indent(switchOrIf("classifier.key", concreteClassifiers
170
- .map(nameOf)
171
- .map(name => [`this._${name}.key`, `${name}.create(id, ${parameterPrefix}handleDelta)`]), [
170
+ .map((classifier) => [
171
+ // case's key:
172
+ `this._${classifier.name}.key`,
173
+ // return value:
174
+ `${classifier.name}.create(id, ${parameterPrefix}handleDelta)`
175
+ ]), [
172
176
  `const {language} = classifier;`,
173
177
  `throw new Error(\`can't instantiate \${classifier.name} (key=\${classifier.key}): classifier is not known in language \${language.name} (key=\${language.key}, version=\${language.version})\`);`
174
178
  ])),