@lionweb/class-core-generator 0.6.13-beta.7 → 0.7.0-alpha.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 (141) hide show
  1. package/CHANGELOG.md +10 -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} +37 -16
  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/{api/helpers → helpers}/classifiers.js +1 -1
  16. package/dist/helpers/classifiers.js.map +1 -0
  17. package/dist/helpers/entities.d.ts.map +1 -0
  18. package/dist/helpers/entities.js.map +1 -0
  19. package/dist/{api/helpers → helpers}/features.d.ts +3 -3
  20. package/dist/helpers/features.d.ts.map +1 -0
  21. package/dist/{api/helpers → helpers}/features.js +11 -11
  22. package/dist/helpers/features.js.map +1 -0
  23. package/dist/{api/helpers → helpers}/imports-tracking.d.ts +3 -0
  24. package/dist/helpers/imports-tracking.d.ts.map +1 -0
  25. package/dist/{api/helpers → helpers}/imports-tracking.js +9 -1
  26. package/dist/helpers/imports-tracking.js.map +1 -0
  27. package/dist/helpers/index.d.ts +6 -0
  28. package/dist/helpers/index.d.ts.map +1 -0
  29. package/dist/{api/helpers → helpers}/index.js +1 -3
  30. package/dist/helpers/index.js.map +1 -0
  31. package/dist/{api/helpers/types.d.ts → helpers/primitive-types.d.ts} +1 -1
  32. package/dist/helpers/primitive-types.d.ts.map +1 -0
  33. package/dist/{api/helpers/types.js → helpers/primitive-types.js} +9 -5
  34. package/dist/helpers/primitive-types.js.map +1 -0
  35. package/dist/index-ts.d.ts.map +1 -0
  36. package/dist/{api/index-ts.js → index-ts.js} +8 -8
  37. package/dist/index-ts.js.map +1 -0
  38. package/dist/index.d.ts +3 -2
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +3 -2
  41. package/dist/index.js.map +1 -1
  42. package/dist/language-file.templates.d.ts.map +1 -0
  43. package/dist/{api/language-file.templates.js → language-file.templates.js} +7 -13
  44. package/dist/language-file.templates.js.map +1 -0
  45. package/dist/mega-factory.templates.d.ts +3 -0
  46. package/dist/mega-factory.templates.d.ts.map +1 -0
  47. package/dist/{api/mega-factory.templates.js → mega-factory.templates.js} +7 -10
  48. package/dist/mega-factory.templates.js.map +1 -0
  49. package/dist/reflective-layer.templates.d.ts.map +1 -0
  50. package/dist/{api/reflective-layer.templates.js → reflective-layer.templates.js} +24 -35
  51. package/dist/reflective-layer.templates.js.map +1 -0
  52. package/package.json +17 -11
  53. package/src/{api/entity-types.templates.ts → entity-types.templates.ts} +57 -22
  54. package/src/{api/generation-headers.ts → generation-headers.ts} +20 -16
  55. package/src/{api/generator.ts → generator.ts} +9 -12
  56. package/src/{api/helpers → helpers}/classifiers.ts +3 -15
  57. package/src/{api/helpers → helpers}/entities.ts +2 -8
  58. package/src/{api/helpers → helpers}/features.ts +14 -14
  59. package/src/{api/helpers → helpers}/imports-tracking.ts +12 -5
  60. package/src/{api/helpers → helpers}/index.ts +1 -3
  61. package/src/{api/helpers/types.ts → helpers/primitive-types.ts} +9 -6
  62. package/src/{api/index-ts.ts → index-ts.ts} +27 -16
  63. package/src/index.ts +3 -2
  64. package/src/{api/language-file.templates.ts → language-file.templates.ts} +11 -19
  65. package/src/{api/mega-factory.templates.ts → mega-factory.templates.ts} +21 -28
  66. package/src/{api/reflective-layer.templates.ts → reflective-layer.templates.ts} +51 -69
  67. package/dist/api/entity-types.templates.d.ts +0 -4
  68. package/dist/api/entity-types.templates.d.ts.map +0 -1
  69. package/dist/api/entity-types.templates.js.map +0 -1
  70. package/dist/api/generation-headers.d.ts.map +0 -1
  71. package/dist/api/generation-headers.js.map +0 -1
  72. package/dist/api/generator.d.ts.map +0 -1
  73. package/dist/api/generator.js.map +0 -1
  74. package/dist/api/helpers/classifiers.d.ts.map +0 -1
  75. package/dist/api/helpers/classifiers.js.map +0 -1
  76. package/dist/api/helpers/dependencies.d.ts +0 -11
  77. package/dist/api/helpers/dependencies.d.ts.map +0 -1
  78. package/dist/api/helpers/dependencies.js +0 -52
  79. package/dist/api/helpers/dependencies.js.map +0 -1
  80. package/dist/api/helpers/entities.d.ts.map +0 -1
  81. package/dist/api/helpers/entities.js.map +0 -1
  82. package/dist/api/helpers/features.d.ts.map +0 -1
  83. package/dist/api/helpers/features.js.map +0 -1
  84. package/dist/api/helpers/imports-tracking.d.ts.map +0 -1
  85. package/dist/api/helpers/imports-tracking.js.map +0 -1
  86. package/dist/api/helpers/index.d.ts +0 -8
  87. package/dist/api/helpers/index.d.ts.map +0 -1
  88. package/dist/api/helpers/index.js.map +0 -1
  89. package/dist/api/helpers/mps-annotations.d.ts +0 -19
  90. package/dist/api/helpers/mps-annotations.d.ts.map +0 -1
  91. package/dist/api/helpers/mps-annotations.js +0 -65
  92. package/dist/api/helpers/mps-annotations.js.map +0 -1
  93. package/dist/api/helpers/types.d.ts.map +0 -1
  94. package/dist/api/helpers/types.js.map +0 -1
  95. package/dist/api/index-ts.d.ts.map +0 -1
  96. package/dist/api/index-ts.js.map +0 -1
  97. package/dist/api/index.d.ts +0 -5
  98. package/dist/api/index.d.ts.map +0 -1
  99. package/dist/api/index.js +0 -21
  100. package/dist/api/index.js.map +0 -1
  101. package/dist/api/language-file.templates.d.ts.map +0 -1
  102. package/dist/api/language-file.templates.js.map +0 -1
  103. package/dist/api/mega-factory.templates.d.ts +0 -4
  104. package/dist/api/mega-factory.templates.d.ts.map +0 -1
  105. package/dist/api/mega-factory.templates.js.map +0 -1
  106. package/dist/api/reflective-layer.templates.d.ts.map +0 -1
  107. package/dist/api/reflective-layer.templates.js.map +0 -1
  108. package/dist/utils/index.d.ts +0 -4
  109. package/dist/utils/index.d.ts.map +0 -1
  110. package/dist/utils/index.js +0 -20
  111. package/dist/utils/index.js.map +0 -1
  112. package/dist/utils/json-as-ts.d.ts +0 -2
  113. package/dist/utils/json-as-ts.d.ts.map +0 -1
  114. package/dist/utils/json-as-ts.js +0 -18
  115. package/dist/utils/json-as-ts.js.map +0 -1
  116. package/dist/utils/string-sorting.d.ts +0 -4
  117. package/dist/utils/string-sorting.d.ts.map +0 -1
  118. package/dist/utils/string-sorting.js +0 -23
  119. package/dist/utils/string-sorting.js.map +0 -1
  120. package/dist/utils/textgen.d.ts +0 -21
  121. package/dist/utils/textgen.d.ts.map +0 -1
  122. package/dist/utils/textgen.js +0 -67
  123. package/dist/utils/textgen.js.map +0 -1
  124. package/dist/utils/toposort.d.ts +0 -6
  125. package/dist/utils/toposort.d.ts.map +0 -1
  126. package/dist/utils/toposort.js +0 -41
  127. package/dist/utils/toposort.js.map +0 -1
  128. package/src/api/helpers/dependencies.ts +0 -62
  129. package/src/api/helpers/mps-annotations.ts +0 -69
  130. package/src/api/index.ts +0 -21
  131. package/src/utils/index.ts +0 -21
  132. package/src/utils/json-as-ts.ts +0 -20
  133. package/src/utils/string-sorting.ts +0 -29
  134. package/src/utils/textgen.ts +0 -89
  135. package/src/utils/toposort.ts +0 -49
  136. /package/dist/{api/helpers → helpers}/classifiers.d.ts +0 -0
  137. /package/dist/{api/helpers → helpers}/entities.d.ts +0 -0
  138. /package/dist/{api/helpers → helpers}/entities.js +0 -0
  139. /package/dist/{api/index-ts.d.ts → index-ts.d.ts} +0 -0
  140. /package/dist/{api/language-file.templates.d.ts → language-file.templates.d.ts} +0 -0
  141. /package/dist/{api/reflective-layer.templates.d.ts → reflective-layer.templates.d.ts} +0 -0
@@ -18,7 +18,7 @@
18
18
  import {
19
19
  builtinClassifiers,
20
20
  Classifier,
21
- Datatype,
21
+ DataType,
22
22
  Enumeration,
23
23
  Feature,
24
24
  isContainment,
@@ -28,10 +28,10 @@ import {
28
28
  Link,
29
29
  PrimitiveType,
30
30
  Property,
31
- SingleRef
31
+ SingleRef,
32
+ unresolved
32
33
  } from "@lionweb/core"
33
- import {Imports, tsTypeForPrimitiveType} from "./index.js"
34
-
34
+ import { Imports, tsTypeForPrimitiveType } from "./index.js"
35
35
 
36
36
  export const typeOf = (feature: Feature): SingleRef<LanguageEntity> => {
37
37
  if (feature instanceof Property) {
@@ -44,23 +44,23 @@ export const typeOf = (feature: Feature): SingleRef<LanguageEntity> => {
44
44
  }
45
45
 
46
46
 
47
- export const tsTypeForDatatype = (datatype: SingleRef<Datatype>, imports: Imports) => {
48
- if (datatype === null) {
49
- return `unknown /* [ERROR] can't compute a TS type for a null datatype */`
47
+ export const tsTypeForDataType = (dataType: SingleRef<DataType>, imports: Imports) => {
48
+ if (dataType === null) {
49
+ return `unknown /* [ERROR] can't compute a TS type for a null data type */`
50
50
  }
51
- if (datatype instanceof PrimitiveType) {
52
- return tsTypeForPrimitiveType(datatype)
51
+ if (dataType instanceof PrimitiveType) {
52
+ return tsTypeForPrimitiveType(dataType)
53
53
  }
54
- if (datatype instanceof Enumeration) {
55
- return imports.entity(datatype)
54
+ if (dataType instanceof Enumeration) {
55
+ return imports.entity(dataType)
56
56
  }
57
- return `unknown /* [ERROR] can't compute a TS type for datatype ${datatype.name} that has an unhandled/-known meta-type ${datatype.constructor.name} */`
57
+ return `unknown /* [ERROR] can't compute a TS type for data type ${dataType.name} that has an unhandled/-known meta-type ${dataType.constructor.name} */`
58
58
  }
59
59
 
60
60
 
61
61
  export const tsTypeForClassifier = (classifier: SingleRef<Classifier>, imports: Imports) => {
62
- if (classifier === null) {
63
- return `unknown /* [ERROR] can't compute a TS type for a null classifier */`
62
+ if (classifier === unresolved) {
63
+ return `unknown /* [ERROR] can't compute a TS type for an unresolved classifier */`
64
64
  }
65
65
  return classifier === builtinClassifiers.node ? imports.generic("INodeBase") : imports.entity(classifier)
66
66
  }
@@ -15,12 +15,10 @@
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
17
 
18
- import {Language, LanguageEntity, lioncoreBuiltins} from "@lionweb/core"
19
- import {asJSIdentifier} from "../../utils/textgen.js"
18
+ import { Language, LanguageEntity, lioncoreBuiltins } from "@lionweb/core"
19
+ import { asJSIdentifier } from "@lionweb/textgen-utils"
20
20
 
21
-
22
- export const importRenamingForLanguage = (language: Language) =>
23
- asJSIdentifier(language.name)
21
+ export const importRenamingForLanguage = (language: Language) => asJSIdentifier(language.name)
24
22
 
25
23
  export const nameOfBaseClassForLanguage = (language: Language) =>
26
24
  asJSIdentifier(language.name) + "Base"
@@ -42,6 +40,15 @@ export class Imports {
42
40
  return this.thisLanguageNameAsJsIdentifier + "Base"
43
41
  }
44
42
 
43
+ private readonly _jsonImports = new Set<string>()
44
+ get jsonImports() {
45
+ return [...this._jsonImports]
46
+ }
47
+ json(identifier: string) {
48
+ this._jsonImports.add(identifier)
49
+ return identifier
50
+ }
51
+
45
52
  private readonly _coreImports = new Set<string>()
46
53
  get coreImports() {
47
54
  return [...this._coreImports]
@@ -16,9 +16,7 @@
16
16
  // SPDX-License-Identifier: Apache-2.0
17
17
 
18
18
  export * from "./classifiers.js"
19
- export * from "./dependencies.js"
20
19
  export * from "./entities.js"
21
20
  export * from "./features.js"
22
21
  export * from "./imports-tracking.js"
23
- export * from "./mps-annotations.js"
24
- export * from "./types.js"
22
+ export * from "./primitive-types.js"
@@ -15,15 +15,18 @@
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
17
 
18
- import {builtinPrimitives, PrimitiveType} from "@lionweb/core"
19
-
18
+ import { builtinPrimitives, PrimitiveType } from "@lionweb/core"
20
19
 
21
20
  export const tsTypeForPrimitiveType = (primitiveType: PrimitiveType): string => {
22
21
  switch (primitiveType) {
23
- case builtinPrimitives.booleanDatatype: return `boolean`
24
- case builtinPrimitives.stringDatatype: return `string`
25
- case builtinPrimitives.integerDatatype: return `number`
26
- case builtinPrimitives.jsonDatatype: return `unknown`
22
+ case builtinPrimitives.booleanDataType:
23
+ return `boolean`
24
+ case builtinPrimitives.stringDataType:
25
+ return `string`
26
+ case builtinPrimitives.integerDataType:
27
+ return `number`
28
+ case builtinPrimitives.jsonDataType:
29
+ return `unknown`
27
30
  default:
28
31
  return `string`
29
32
  }
@@ -15,39 +15,50 @@
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
17
 
18
- import {Language} from "@lionweb/core"
19
- import {asString, commaSeparated} from "littoral-templates"
20
-
21
- import {indent} from "../utils/textgen.js"
22
- import {dependencyOrderOf} from "../utils/toposort.js"
23
- import {dependenciesThroughDirectInheritanceOf, importRenamingForLanguage, nameOfBaseClassForLanguage} from "./helpers/index.js"
24
- import {GeneratorOptions} from "./generator.js"
18
+ import { Language } from "@lionweb/core"
19
+ import { indent } from "@lionweb/textgen-utils"
20
+ import { dependencyOrderOf } from "@lionweb/ts-utils"
21
+ import { dependenciesThroughDirectInheritanceOf } from "@lionweb/utilities"
22
+ import { asString, commaSeparated } from "littoral-templates"
25
23
 
24
+ import { GeneratorOptions } from "./generator.js"
25
+ import { importRenamingForLanguage, nameOfBaseClassForLanguage } from "./helpers/index.js"
26
26
 
27
27
  export const indexTsFor = (languages: Language[], options: GeneratorOptions) => {
28
28
  const dependenciesInOrderOfDirectInheritance = dependencyOrderOf(languages, dependenciesThroughDirectInheritanceOf)
29
29
  if (dependenciesInOrderOfDirectInheritance === false) {
30
- console.error(`⚠ CYCLE detected! Proceeding with order of languages as-is, instead of in type-wise (through direct inheritance) dependency order ⇒ generated code might not initialize!`)
30
+ console.error(
31
+ `⚠ CYCLE detected! Proceeding with order of languages as-is, instead of in type-wise (through direct inheritance) dependency order ⇒ generated code might not initialize!`
32
+ )
31
33
  }
32
- const languagesForImports = dependenciesInOrderOfDirectInheritance === false
33
- ? languages
34
- : dependenciesInOrderOfDirectInheritance
35
- .filter((language) => languages.indexOf(language) > -1)
34
+ const languagesForImports =
35
+ dependenciesInOrderOfDirectInheritance === false
36
+ ? languages
37
+ : dependenciesInOrderOfDirectInheritance.filter(language => languages.indexOf(language) > -1)
36
38
 
37
39
  return asString([
38
40
  options.header === undefined ? [] : [options.header, ``],
39
41
  `import {ILanguageBase, LionCore_builtinsBase} from "${options.genericImportLocation}";`,
40
42
  ``,
41
- languagesForImports.map((language) => `import * as ${importRenamingForLanguage(language)} from "./${language.name}.g.js";`),
43
+ languagesForImports.map(language => `import * as ${importRenamingForLanguage(language)} from "./${language.name}.g.js";`),
42
44
  ``,
43
45
  `// ensure that all languages get wired up by triggering that through their first entity:`,
44
46
  `LionCore_builtinsBase.INSTANCE.String;`,
45
47
  languages
46
- .filter(({entities}) => entities.length > 0)
47
- .map((language) => `${importRenamingForLanguage(language)}.${nameOfBaseClassForLanguage(language)}.INSTANCE.${language.entities[0].name};`),
48
+ .filter(({ entities }) => entities.length > 0)
49
+ .map(
50
+ language =>
51
+ `${importRenamingForLanguage(language)}.${nameOfBaseClassForLanguage(language)}.INSTANCE.${language.entities[0].name};`
52
+ ),
48
53
  ``,
49
54
  `export const allLanguageBases: ILanguageBase[] = [`,
50
- indent(commaSeparated(languagesForImports.map((language) => `${importRenamingForLanguage(language)}.${nameOfBaseClassForLanguage(language)}.INSTANCE`))),
55
+ indent(
56
+ commaSeparated(
57
+ languagesForImports.map(
58
+ language => `${importRenamingForLanguage(language)}.${nameOfBaseClassForLanguage(language)}.INSTANCE`
59
+ )
60
+ )
61
+ ),
51
62
  `];`,
52
63
  ``,
53
64
  `export {`,
package/src/index.ts CHANGED
@@ -15,5 +15,6 @@
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
17
 
18
- export * from "./api/index.js"
19
- export * from "./utils/index.js"
18
+ export { generateLanguage, generateApiFromLanguages, generateApiFromLanguagesJson } from "./generator.js"
19
+ export * from "./generation-headers.js"
20
+ export * from "./mega-factory.templates.js"
@@ -15,25 +15,18 @@
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
17
 
18
- import {Concept, groupBy, Language} from "@lionweb/core"
19
- import {asString, commaSeparated, when, withNewlineAppended} from "littoral-templates"
20
-
21
- import {typeForLanguageEntity} from "./entity-types.templates.js"
22
- import {reflectiveClassFor} from "./reflective-layer.templates.js"
23
- import {indent} from "../utils/textgen.js"
24
- import {sortedStringsByUppercase} from "../utils/string-sorting.js"
25
- import {dependencyOrderOf} from "../utils/toposort.js"
26
- import {Imports} from "./helpers/index.js"
27
- import {GeneratorOptions} from "./generator.js"
18
+ import { Concept, Language } from "@lionweb/core"
19
+ import { indent } from "@lionweb/textgen-utils"
20
+ import { dependencyOrderOf, sortedStringsByUppercase } from "@lionweb/ts-utils"
21
+ import { asString, commaSeparated, when, withNewlineAppended } from "littoral-templates"
28
22
 
23
+ import { typeForLanguageEntity } from "./entity-types.templates.js"
24
+ import { GeneratorOptions } from "./generator.js"
25
+ import { Imports } from "./helpers/index.js"
26
+ import { reflectiveClassFor } from "./reflective-layer.templates.js"
29
27
 
30
28
  const importStatement = (dep: string, items: string[]) =>
31
- when(items.length > 0)([
32
- `import {`,
33
- indent(commaSeparated(sortedStringsByUppercase(items))),
34
- `} from "${dep}";`,
35
- ``
36
- ])
29
+ when(items.length > 0)([`import {`, indent(commaSeparated(sortedStringsByUppercase(items))), `} from "${dep}";`, ``])
37
30
 
38
31
 
39
32
  export const languageFileFor = (language: Language, options: GeneratorOptions) => {
@@ -47,8 +40,6 @@ export const languageFileFor = (language: Language, options: GeneratorOptions) =
47
40
  throw new Error(`language ${name} has a cycle among the graph of entities with edges formed by the inheritance dependency`)
48
41
  }
49
42
 
50
- const mpsAnnotationsPerId = groupBy(options.mpsAnnotations, ({annotatedNodeId}) => annotatedNodeId)
51
-
52
43
  const postImportsPart = [
53
44
  ``,
54
45
  reflectiveClassFor(imports)(language),
@@ -56,7 +47,7 @@ export const languageFileFor = (language: Language, options: GeneratorOptions) =
56
47
  ``,
57
48
  orderedEntities
58
49
  .filter((entity) => entity.language === language)
59
- .map(withNewlineAppended(typeForLanguageEntity(imports, mpsAnnotationsPerId)))
50
+ .map(withNewlineAppended(typeForLanguageEntity(imports)))
60
51
  ]
61
52
 
62
53
  return asString([
@@ -71,6 +62,7 @@ export const languageFileFor = (language: Language, options: GeneratorOptions) =
71
62
  ``,
72
63
  ``,
73
64
  importStatement(`@lionweb/core`, imports.coreImports),
65
+ importStatement(`@lionweb/json`, imports.jsonImports),
74
66
  importStatement(options.genericImportLocation, imports.genericImports),
75
67
  importStatement(`./index.g.js`, imports.languageImports),
76
68
  postImportsPart
@@ -15,46 +15,41 @@
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
17
 
18
- import {isConcrete, Language, LanguageEntity} from "@lionweb/core"
19
- import {asString, commaSeparated} from "littoral-templates"
18
+ import { isConcrete, Language, LanguageEntity } from "@lionweb/core"
19
+ import { Deprecated, ioLionWebMpsSpecificAnnotationsFrom } from "@lionweb/io-lionweb-mps-specific"
20
+ import { asJSIdentifier, indent } from "@lionweb/textgen-utils"
21
+ import { asString, commaSeparated } from "littoral-templates"
20
22
 
21
- import {asJSIdentifier, indent} from "../utils/textgen.js"
22
- import {Deprecated, MpsAnnotation} from "./helpers/index.js";
23
+ export const megaFactoryFor = (megaFactoryName: string, languages: Language[], header?: string) => {
24
+ const isNotDeprecated = (entity: LanguageEntity) =>
25
+ !ioLionWebMpsSpecificAnnotationsFrom(entity).some((annotation) => annotation instanceof Deprecated)
23
26
 
24
-
25
- export const megaFactoryFor = (megaFactoryName: string, languages: Language[], mpsAnnotations: MpsAnnotation[] = [], header?: string) => {
26
- const isNotDeprecated = (entity: LanguageEntity)=>
27
- !mpsAnnotations.some(
28
- (mpsAnnotation) => mpsAnnotation.annotatedNodeId === entity.id && mpsAnnotation instanceof Deprecated
29
- )
30
-
31
- const requiresFactoryMethod = (entity: LanguageEntity) =>
32
- isConcrete(entity) && isNotDeprecated(entity)
27
+ const requiresFactoryMethod = (entity: LanguageEntity) => isConcrete(entity) && isNotDeprecated(entity)
33
28
 
34
29
  const factoryFor = (language: Language) => [
35
30
  `${asJSIdentifier(language.name)}Factory = {`,
36
- indent(commaSeparated(
37
- language.entities
38
- .filter(requiresFactoryMethod)
39
- .map((classifier) => `create${classifier.name}: () => ${asJSIdentifier(language.name)}.${classifier.name}.create(newId(), this.handleDelta)`)
40
- )),
31
+ indent(
32
+ commaSeparated(
33
+ language.entities
34
+ .filter(requiresFactoryMethod)
35
+ .map(
36
+ classifier =>
37
+ `create${classifier.name}: () => ${asJSIdentifier(language.name)}.${classifier.name}.create(newId(), this.handleDelta)`
38
+ )
39
+ )
40
+ ),
41
41
  `}`,
42
42
  ``
43
43
  ]
44
44
 
45
- const languagesWithFactoryMethods = languages
46
- .filter(
47
- (language) => language.entities.some(requiresFactoryMethod)
48
- )
45
+ const languagesWithFactoryMethods = languages.filter(language => language.entities.some(requiresFactoryMethod))
49
46
 
50
47
  return asString([
51
48
  header ?? [],
52
49
  `import {DeltaHandler} from "@lionweb/class-core";`,
53
50
  ``,
54
51
  `import {`,
55
- indent(commaSeparated(
56
- languagesWithFactoryMethods.map(({name}) => asJSIdentifier(name))
57
- )),
52
+ indent(commaSeparated(languagesWithFactoryMethods.map(({ name }) => asJSIdentifier(name)))),
58
53
  `} from "./index.g.js";`,
59
54
  ``,
60
55
  `import {newId} from "../index.js";`,
@@ -64,9 +59,7 @@ export const megaFactoryFor = (megaFactoryName: string, languages: Language[], m
64
59
  indent([
65
60
  ``,
66
61
  `constructor(`,
67
- indent([
68
- `public readonly handleDelta?: DeltaHandler`
69
- ]),
62
+ indent([`public readonly handleDelta?: DeltaHandler`]),
70
63
  `) {`,
71
64
  `}`,
72
65
  ``,
@@ -17,7 +17,6 @@
17
17
 
18
18
  import {
19
19
  Annotation,
20
- asArray,
21
20
  Classifier,
22
21
  Concept,
23
22
  Enumeration,
@@ -28,6 +27,7 @@ import {
28
27
  isConcrete,
29
28
  isEnumeration,
30
29
  isMultiple,
30
+ isPartition,
31
31
  Language,
32
32
  LanguageEntity,
33
33
  Link,
@@ -36,90 +36,70 @@ import {
36
36
  Property,
37
37
  SingleRef
38
38
  } from "@lionweb/core"
39
- import {when, withNewlineAppended} from "littoral-templates"
40
-
41
- import {indent, switchOrIf} from "../utils/textgen.js"
42
- import {entityMetaType, extendsFrom, Imports, nameOfBaseClassForLanguage} from "./helpers/index.js"
39
+ import { indent, switchOrIf } from "@lionweb/textgen-utils"
40
+ import { asArray } from "@lionweb/ts-utils"
41
+ import { when, withNewlineAppended } from "littoral-templates"
43
42
 
43
+ import { entityMetaType, extendsFrom, Imports, nameOfBaseClassForLanguage } from "./helpers/index.js"
44
44
 
45
45
  export const reflectiveClassFor = (imports: Imports) => {
46
-
47
46
  // classifier:
48
47
 
49
48
  const reflectiveMembersForFeature = (feature: Feature) => {
50
- const {classifier, name, key, id, optional} = feature
49
+ const { classifier, name, key, id, optional } = feature
51
50
  const metaType = featureMetaType(feature)
52
51
  const qName = `${classifier.name}_${name}`
53
52
  return [
54
53
  `private readonly _${qName} = new ${imports.core(metaType)}(this._${classifier.name}, "${name}", "${key}", "${id}")${optional ? ".isOptional()" : ""}${isMultiple(feature) ? ".isMultiple()" : ""};`,
55
54
  // | core (2nd x) |
56
55
  `get ${qName}(): ${metaType} {`,
57
- indent([
58
- `this.ensureWiredUp();`,
59
- `return this._${qName};`
60
- ]),
56
+ indent([`this.ensureWiredUp();`, `return this._${qName};`]),
61
57
  `}`
62
58
  ]
63
59
  }
64
60
 
65
61
  const reflectiveMembersForClassifier = (classifier: Classifier) => {
66
- const {name, key, id, features} = classifier
62
+ const { name, key, id, features } = classifier
67
63
  const metaType = entityMetaType(classifier)
68
64
  return [
69
- `public readonly _${name} = new ${imports.core(metaType)}(this._language, "${name}", "${key}", "${id}"${classifier instanceof Concept ? (", " + classifier.abstract) : ""});`,
65
+ `public readonly _${name} = new ${imports.core(metaType)}(this._language, "${name}", "${key}", "${id}"${classifier instanceof Concept ? ", " + classifier.abstract : ""})${isPartition(classifier) ? ".isPartition()" : ""};`,
70
66
  // | core (2nd x) |
71
67
  `get ${name}(): ${metaType} {`,
72
- indent([
73
- `this.ensureWiredUp();`,
74
- `return this._${name};`
75
- ]),
68
+ indent([`this.ensureWiredUp();`, `return this._${name};`]),
76
69
  `}`,
77
70
  features.map(reflectiveMembersForFeature)
78
71
  ]
79
72
  }
80
73
 
74
+ // enumeration:
81
75
 
82
- // enumeration:
83
-
84
- const reflectiveMemberForEnumerationLiteral = ({enumeration, name, key, id}: EnumerationLiteral) => {
76
+ const reflectiveMemberForEnumerationLiteral = ({ enumeration, name, key, id }: EnumerationLiteral) => {
85
77
  const qName = `${enumeration.name}_${name}`
86
78
  return [
87
79
  `private readonly _${qName} = new ${imports.core("EnumerationLiteral")}(this._${enumeration.name}, "${name}", "${key}", "${id}");`,
88
80
  // | core (2nd x) |
89
81
  `get ${qName}(): EnumerationLiteral {`,
90
- indent([
91
- `this.ensureWiredUp();`,
92
- `return this._${qName};`
93
- ]),
82
+ indent([`this.ensureWiredUp();`, `return this._${qName};`]),
94
83
  `}`
95
84
  ]
96
85
  }
97
86
 
98
- const reflectiveMembersForEnumeration = ({name, key, id, literals}: Enumeration) =>
99
- [
100
- `public readonly _${name} = new ${imports.core("Enumeration")}(this._language, "${name}", "${key}", "${id}");`,
101
- // | core (2nd x) |
102
- `get ${name}(): Enumeration {`,
103
- indent([
104
- `this.ensureWiredUp();`,
105
- `return this._${name};`
106
- ]),
107
- `}`,
108
- literals.map(reflectiveMemberForEnumerationLiteral)
109
- ]
110
-
111
- const reflectiveMembersForPrimitiveType = ({name, key, id}: PrimitiveType) =>
112
- [
113
- `public readonly _${name} = new ${imports.core("PrimitiveType")}(this._language, "${name}", "${key}", "${id}");`,
114
- // | core (2nd x) |
115
- `get ${name}(): PrimitiveType {`,
116
- indent([
117
- `this.ensureWiredUp();`,
118
- `return this._${name};`
119
- ]),
120
- `}`
121
- ]
122
-
87
+ const reflectiveMembersForEnumeration = ({ name, key, id, literals }: Enumeration) => [
88
+ `public readonly _${name} = new ${imports.core("Enumeration")}(this._language, "${name}", "${key}", "${id}");`,
89
+ // | core (2nd x) |
90
+ `get ${name}(): Enumeration {`,
91
+ indent([`this.ensureWiredUp();`, `return this._${name};`]),
92
+ `}`,
93
+ literals.map(reflectiveMemberForEnumerationLiteral)
94
+ ]
95
+
96
+ const reflectiveMembersForPrimitiveType = ({ name, key, id }: PrimitiveType) => [
97
+ `public readonly _${name} = new ${imports.core("PrimitiveType")}(this._language, "${name}", "${key}", "${id}");`,
98
+ // | core (2nd x) |
99
+ `get ${name}(): PrimitiveType {`,
100
+ indent([`this.ensureWiredUp();`, `return this._${name};`]),
101
+ `}`
102
+ ]
123
103
 
124
104
  const reflectiveMembersForEntity = (entity: LanguageEntity) => {
125
105
  if (entity instanceof Classifier) {
@@ -134,7 +114,6 @@ export const reflectiveClassFor = (imports: Imports) => {
134
114
  return `// unhandled language entity <${entityMetaType(entity)}>"${entity.name}"`
135
115
  }
136
116
 
137
-
138
117
  const refForType = (type: SingleRef<LanguageEntity>) => {
139
118
  if (type === null) {
140
119
  return `???`
@@ -146,12 +125,12 @@ export const reflectiveClassFor = (imports: Imports) => {
146
125
  }
147
126
 
148
127
  const wireUpStatementsForProperty = (property: Property) => {
149
- const {classifier, name, type, optional} = property
128
+ const { classifier, name, type, optional } = property
150
129
  return `this._${classifier.name}_${name}.ofType(${refForType(type)})${optional ? ".isOptional()" : ""};`
151
130
  }
152
131
 
153
132
  const wireUpStatementsForLink = (link: Link) => {
154
- const {classifier, name, type} = link
133
+ const { classifier, name, type } = link
155
134
  return `this._${classifier.name}_${name}.ofType(${refForType(type)});`
156
135
  }
157
136
 
@@ -165,23 +144,24 @@ export const reflectiveClassFor = (imports: Imports) => {
165
144
  return `// unhandled feature <${featureMetaType(feature)}>"${feature.name}"`
166
145
  }
167
146
 
168
- const isConcreteClassifier = (classifier: Classifier): classifier is (Annotation | Concept) =>
147
+ const isConcreteClassifier = (classifier: Classifier): classifier is Annotation | Concept =>
169
148
  classifier instanceof Annotation || classifier instanceof Concept
170
149
 
171
150
  const wireUpStatementsForEntity = (entity: LanguageEntity) => {
172
- const {name} = entity
151
+ const { name } = entity
173
152
  const thisLocalName = (localName: string) => `this._${name}_${localName}`
174
153
  if (entity instanceof Classifier) {
175
154
  const extends_ = extendsFrom(entity)
176
155
  return [
177
- extends_ instanceof Classifier
178
- ? `this._${name}.extends = ${refForType(extends_)};`
179
- : [],
156
+ extends_ instanceof Classifier ? `this._${name}.extends = ${refForType(extends_)};` : [],
180
157
  when(entity instanceof Interface && entity.extends.length > 0)(
181
- () => `this._${name}.extending(${(entity as Interface).extends.map((interface_) => refForType(interface_)).join(", ")});`
158
+ () => `this._${name}.extending(${(entity as Interface).extends.map(interface_ => refForType(interface_)).join(", ")});`
182
159
  ),
183
160
  when(isConcreteClassifier(entity) && entity.implements.length > 0)(
184
- () => `this._${name}.implementing(${asArray((entity as (Annotation | Concept)).implements).map((interface_) => refForType(interface_)).join(", ")});`
161
+ () =>
162
+ `this._${name}.implementing(${asArray((entity as Annotation | Concept).implements)
163
+ .map(interface_ => refForType(interface_))
164
+ .join(", ")});`
185
165
  ),
186
166
  when(entity.features.length > 0)(
187
167
  `this._${name}.havingFeatures(${entity.features.map(nameOf).map(thisLocalName).join(", ")});`
@@ -193,13 +173,13 @@ export const reflectiveClassFor = (imports: Imports) => {
193
173
  return `this._${name}.havingLiterals(${entity.literals.map(nameOf).map(thisLocalName).join(", ")});`
194
174
  }
195
175
  if (entity instanceof PrimitiveType) {
196
- return [] // (nothing to do)
176
+ return [] // (nothing to do)
197
177
  }
198
178
  return `// unhandled language entity <${entityMetaType(entity)}>"${name}"`
199
179
  }
200
180
 
201
181
  return (language: Language) => {
202
- const {version, id, key, entities} = language
182
+ const { version, id, key, entities } = language
203
183
  const enumerations = entities.filter(isEnumeration)
204
184
  const concreteClassifiers = entities.filter(isConcrete)
205
185
  const parameterPrefix = concreteClassifiers.length === 0 ? "_" : ""
@@ -212,10 +192,7 @@ export const reflectiveClassFor = (imports: Imports) => {
212
192
  `private readonly _language: ${imports.core("Language")} = new Language("${imports.thisLanguageNameAsJsIdentifier}", "${version}", "${id}", "${key}");`,
213
193
  // | core | (3rd x)
214
194
  `get language(): Language {`,
215
- indent([
216
- `this.ensureWiredUp();`,
217
- `return this._language;`
218
- ]),
195
+ indent([`this.ensureWiredUp();`, `return this._language;`]),
219
196
  `}`,
220
197
  ``,
221
198
  entities.map(withNewlineAppended(reflectiveMembersForEntity)),
@@ -233,11 +210,17 @@ export const reflectiveClassFor = (imports: Imports) => {
233
210
  ``,
234
211
  `factory(${parameterPrefix}handleDelta?: ${imports.generic("DeltaHandler")}): ${imports.generic("NodeBaseFactory")} {`,
235
212
  indent([
236
- `return (classifier: ${imports.core("Classifier")}, ${parameterPrefix}id: ${imports.core("Id")}) => {`,
213
+ `return (classifier: ${imports.core("Classifier")}, ${parameterPrefix}id: ${imports.json("LionWebId")}) => {`,
237
214
  indent(
238
215
  switchOrIf(
239
216
  "classifier.key",
240
- concreteClassifiers.map(nameOf).map((name) => [`this._${name}.key`, `${name}.create(id, ${parameterPrefix}handleDelta)`]),
217
+ concreteClassifiers
218
+ .map((classifier) => [
219
+ // case's key:
220
+ `this._${classifier.name}.key`,
221
+ // return value:
222
+ `${classifier.name}.create(id, ${parameterPrefix}handleDelta)`
223
+ ]),
241
224
  [
242
225
  `const {language} = classifier;`,
243
226
  `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})\`);`
@@ -254,7 +237,7 @@ export const reflectiveClassFor = (imports: Imports) => {
254
237
  `const {enumeration} = enumerationLiteral;`,
255
238
  switchOrIf(
256
239
  "enumeration.key",
257
- enumerations.map(nameOf).map((name) => [`this._${name}.key`, "enumerationLiteral.key as EnumType"]),
240
+ enumerations.map(nameOf).map(name => [`this._${name}.key`, "enumerationLiteral.key as EnumType"]),
258
241
  [
259
242
  `const {language} = enumeration;`,
260
243
  `throw new Error(\`enumeration with key \${enumeration.key} is not known in language \${language.name} (key=\${language.key}, version=\${language.version})\`);`
@@ -268,6 +251,5 @@ export const reflectiveClassFor = (imports: Imports) => {
268
251
  `}`
269
252
  ]
270
253
  }
271
-
272
254
  }
273
255
 
@@ -1,4 +0,0 @@
1
- import { Id, LanguageEntity } from "@lionweb/core";
2
- import { Imports, MpsAnnotation } from "./helpers/index.js";
3
- export declare const typeForLanguageEntity: (imports: Imports, mpsAnnotationsPerId: Record<Id, MpsAnnotation[]>) => (entity: LanguageEntity) => import("littoral-templates").Template[];
4
- //# sourceMappingURL=entity-types.templates.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entity-types.templates.d.ts","sourceRoot":"","sources":["../../src/api/entity-types.templates.ts"],"names":[],"mappings":"AAiBA,OAAO,EAMH,EAAE,EAKF,cAAc,EAOjB,MAAM,eAAe,CAAA;AAItB,OAAO,EAOH,OAAO,EAEP,aAAa,EAOhB,MAAM,oBAAoB,CAAA;AAe3B,eAAO,MAAM,qBAAqB,YAAa,OAAO,uBAAuB,OAAO,EAAE,EAAE,aAAa,EAAE,CAAC,cAqKpF,cAAc,4CAoBjC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"entity-types.templates.js","sourceRoot":"","sources":["../../src/api/entity-types.templates.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sE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AAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"generation-headers.js","sourceRoot":"","sources":["../../src/api/generation-headers.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,6CAA6C;AAE7C,OAAO,EAAC,QAAQ,EAAC,MAAM,oBAAoB,CAAA;AAE3C;;;GAGG;AACH,MAAM,aAAa,GAAG,CAAC,GAAW,EAAE,EAAE,CAClC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAEpC;;GAEG;AACH,MAAM,+CAA+C,GAAG;;;;;;;;;;;;;;KAcnD,aAAa,CAAC,wBAAwB,CAAC;KACvC,aAAa,CAAC,yBAAyB,CAAC;CAC5C,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;;CAE3C,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,+CAA+C,GACxD,QAAQ,CAAC,CAAC,+CAA+C,EAAE,EAAE,EAAE,4BAA4B,EAAE,EAAE,CAAC,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/api/generator.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAuB,QAAQ,EAA+B,MAAM,eAAe,CAAA;AAQ1F,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAA;AAMhD,MAAM,MAAM,gBAAgB,GAAG;IAC3B,cAAc,EAAE,aAAa,EAAE,CAAA;IAC/B,qBAAqB,EAAE,MAAM,CAAA;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAUD,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;AAG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