@lionweb/class-core-generator 0.6.13-beta.7 → 0.7.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/api/entity-types.templates.d.ts +3 -3
- package/dist/api/entity-types.templates.d.ts.map +1 -1
- package/dist/api/entity-types.templates.js +10 -9
- package/dist/api/entity-types.templates.js.map +1 -1
- package/dist/api/generation-headers.js.map +1 -1
- package/dist/api/generator.d.ts +0 -2
- package/dist/api/generator.d.ts.map +1 -1
- package/dist/api/generator.js +0 -1
- package/dist/api/generator.js.map +1 -1
- package/dist/api/helpers/classifiers.d.ts.map +1 -1
- package/dist/api/helpers/classifiers.js +1 -1
- package/dist/api/helpers/classifiers.js.map +1 -1
- package/dist/api/helpers/dependencies.d.ts.map +1 -1
- package/dist/api/helpers/dependencies.js +2 -2
- package/dist/api/helpers/dependencies.js.map +1 -1
- package/dist/api/helpers/entities.d.ts.map +1 -1
- package/dist/api/helpers/entities.js.map +1 -1
- package/dist/api/helpers/features.d.ts.map +1 -1
- package/dist/api/helpers/features.js +3 -3
- package/dist/api/helpers/features.js.map +1 -1
- package/dist/api/helpers/imports-tracking.d.ts +3 -0
- package/dist/api/helpers/imports-tracking.d.ts.map +1 -1
- package/dist/api/helpers/imports-tracking.js +8 -0
- package/dist/api/helpers/imports-tracking.js.map +1 -1
- package/dist/api/helpers/index.d.ts +1 -2
- package/dist/api/helpers/index.d.ts.map +1 -1
- package/dist/api/helpers/index.js +1 -2
- package/dist/api/helpers/index.js.map +1 -1
- package/dist/api/helpers/{types.d.ts → primitive-types.d.ts} +1 -1
- package/dist/api/helpers/primitive-types.d.ts.map +1 -0
- package/dist/api/helpers/{types.js → primitive-types.js} +9 -5
- package/dist/api/helpers/primitive-types.js.map +1 -0
- package/dist/api/index-ts.d.ts.map +1 -1
- package/dist/api/index-ts.js +5 -6
- package/dist/api/index-ts.js.map +1 -1
- package/dist/api/index.d.ts +0 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +0 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/language-file.templates.d.ts.map +1 -1
- package/dist/api/language-file.templates.js +8 -13
- package/dist/api/language-file.templates.js.map +1 -1
- package/dist/api/mega-factory.templates.d.ts +1 -2
- package/dist/api/mega-factory.templates.d.ts.map +1 -1
- package/dist/api/mega-factory.templates.js +6 -9
- package/dist/api/mega-factory.templates.js.map +1 -1
- package/dist/api/reflective-layer.templates.d.ts.map +1 -1
- package/dist/api/reflective-layer.templates.js +19 -34
- package/dist/api/reflective-layer.templates.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/textgen.d.ts.map +1 -1
- package/dist/utils/textgen.js.map +1 -1
- package/package.json +14 -9
- package/src/api/entity-types.templates.ts +11 -15
- package/src/api/generation-headers.ts +1 -1
- package/src/api/generator.ts +9 -12
- package/src/api/helpers/classifiers.ts +3 -15
- package/src/api/helpers/dependencies.ts +4 -4
- package/src/api/helpers/entities.ts +2 -8
- package/src/api/helpers/features.ts +5 -5
- package/src/api/helpers/imports-tracking.ts +12 -5
- package/src/api/helpers/index.ts +1 -2
- package/src/api/helpers/{types.ts → primitive-types.ts} +9 -6
- package/src/api/index-ts.ts +26 -16
- package/src/api/index.ts +1 -2
- package/src/api/language-file.templates.ts +12 -19
- package/src/api/mega-factory.templates.ts +21 -27
- package/src/api/reflective-layer.templates.ts +46 -69
- package/src/utils/index.ts +0 -1
- package/src/utils/textgen.ts +1 -1
- package/dist/api/helpers/mps-annotations.d.ts +0 -19
- package/dist/api/helpers/mps-annotations.d.ts.map +0 -1
- package/dist/api/helpers/mps-annotations.js +0 -65
- package/dist/api/helpers/mps-annotations.js.map +0 -1
- package/dist/api/helpers/types.d.ts.map +0 -1
- package/dist/api/helpers/types.js.map +0 -1
- package/dist/utils/string-sorting.d.ts +0 -4
- package/dist/utils/string-sorting.d.ts.map +0 -1
- package/dist/utils/string-sorting.js +0 -23
- package/dist/utils/string-sorting.js.map +0 -1
- package/dist/utils/toposort.d.ts +0 -6
- package/dist/utils/toposort.d.ts.map +0 -1
- package/dist/utils/toposort.js +0 -41
- package/dist/utils/toposort.js.map +0 -1
- package/src/api/helpers/mps-annotations.ts +0 -69
- package/src/utils/string-sorting.ts +0 -29
- package/src/utils/toposort.ts +0 -49
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mega-factory.templates.d.ts","sourceRoot":"","sources":["../../src/api/mega-factory.templates.ts"],"names":[],"mappings":"AAiBA,OAAO,
|
|
1
|
+
{"version":3,"file":"mega-factory.templates.d.ts","sourceRoot":"","sources":["../../src/api/mega-factory.templates.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAc,QAAQ,EAAkB,MAAM,eAAe,CAAA;AAMpE,eAAO,MAAM,cAAc,oBAAqB,MAAM,aAAa,QAAQ,EAAE,WAAW,MAAM,WAgD7F,CAAA"}
|
|
@@ -17,20 +17,19 @@
|
|
|
17
17
|
import { isConcrete } from "@lionweb/core";
|
|
18
18
|
import { asString, commaSeparated } from "littoral-templates";
|
|
19
19
|
import { asJSIdentifier, indent } from "../utils/textgen.js";
|
|
20
|
-
import { Deprecated } from "
|
|
21
|
-
export const megaFactoryFor = (megaFactoryName, languages,
|
|
22
|
-
const isNotDeprecated = (entity) => !
|
|
20
|
+
import { Deprecated, ioLionWebMpsSpecificAnnotationsFrom } from "@lionweb/io-lionweb-mps-specific";
|
|
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 = {`,
|
|
26
26
|
indent(commaSeparated(language.entities
|
|
27
27
|
.filter(requiresFactoryMethod)
|
|
28
|
-
.map(
|
|
28
|
+
.map(classifier => `create${classifier.name}: () => ${asJSIdentifier(language.name)}.${classifier.name}.create(newId(), this.handleDelta)`))),
|
|
29
29
|
`}`,
|
|
30
30
|
``
|
|
31
31
|
];
|
|
32
|
-
const languagesWithFactoryMethods = languages
|
|
33
|
-
.filter((language) => language.entities.some(requiresFactoryMethod));
|
|
32
|
+
const languagesWithFactoryMethods = languages.filter(language => language.entities.some(requiresFactoryMethod));
|
|
34
33
|
return asString([
|
|
35
34
|
header ?? [],
|
|
36
35
|
`import {DeltaHandler} from "@lionweb/class-core";`,
|
|
@@ -46,9 +45,7 @@ export const megaFactoryFor = (megaFactoryName, languages, mpsAnnotations = [],
|
|
|
46
45
|
indent([
|
|
47
46
|
``,
|
|
48
47
|
`constructor(`,
|
|
49
|
-
indent([
|
|
50
|
-
`public readonly handleDelta?: DeltaHandler`
|
|
51
|
-
]),
|
|
48
|
+
indent([`public readonly handleDelta?: DeltaHandler`]),
|
|
52
49
|
`) {`,
|
|
53
50
|
`}`,
|
|
54
51
|
``,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mega-factory.templates.js","sourceRoot":"","sources":["../../src/api/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,
|
|
1
|
+
{"version":3,"file":"mega-factory.templates.js","sourceRoot":"","sources":["../../src/api/mega-factory.templates.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;A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,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAA;IAE/G,OAAO,QAAQ,CAAC;QACZ,MAAM,IAAI,EAAE;QACZ,mDAAmD;QACnD,EAAE;QACF,UAAU;QACV,MAAM,CAAC,cAAc,CAAC,2BAA2B,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3F,wBAAwB;QACxB,EAAE;QACF,oCAAoC;QACpC,EAAE;QACF,EAAE;QACF,gBAAgB,eAAe,IAAI;QACnC,MAAM,CAAC;YACH,EAAE;YACF,cAAc;YACd,MAAM,CAAC,CAAC,4CAA4C,CAAC,CAAC;YACtD,KAAK;YACL,GAAG;YACH,EAAE;YACF,2BAA2B,CAAC,GAAG,CAAC,UAAU,CAAC;SAC9C,CAAC;QACF,GAAG;QACH,EAAE;KACL,CAAC,CAAA;AACN,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflective-layer.templates.d.ts","sourceRoot":"","sources":["../../src/api/reflective-layer.templates.ts"],"names":[],"mappings":"AAiBA,OAAO,
|
|
1
|
+
{"version":3,"file":"reflective-layer.templates.d.ts","sourceRoot":"","sources":["../../src/api/reflective-layer.templates.ts"],"names":[],"mappings":"AAiBA,OAAO,EAYH,QAAQ,EAOX,MAAM,eAAe,CAAA;AAKtB,OAAO,EAA+B,OAAO,EAA8B,MAAM,oBAAoB,CAAA;AAErG,eAAO,MAAM,kBAAkB,YAAa,OAAO,gBAwI7B,QAAQ,0BAqE7B,CAAA"}
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
//
|
|
15
15
|
// SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
|
|
16
16
|
// SPDX-License-Identifier: Apache-2.0
|
|
17
|
-
import { Annotation,
|
|
17
|
+
import { Annotation, Classifier, Concept, Enumeration, featureMetaType, Interface, isConcrete, isEnumeration, isMultiple, Link, nameOf, PrimitiveType, Property } from "@lionweb/core";
|
|
18
|
+
import { asArray } from "@lionweb/ts-utils";
|
|
18
19
|
import { when, withNewlineAppended } from "littoral-templates";
|
|
19
20
|
import { indent, switchOrIf } from "../utils/textgen.js";
|
|
20
21
|
import { entityMetaType, extendsFrom, nameOfBaseClassForLanguage } from "./helpers/index.js";
|
|
@@ -28,10 +29,7 @@ export const reflectiveClassFor = (imports) => {
|
|
|
28
29
|
`private readonly _${qName} = new ${imports.core(metaType)}(this._${classifier.name}, "${name}", "${key}", "${id}")${optional ? ".isOptional()" : ""}${isMultiple(feature) ? ".isMultiple()" : ""};`,
|
|
29
30
|
// | core (2nd x) |
|
|
30
31
|
`get ${qName}(): ${metaType} {`,
|
|
31
|
-
indent([
|
|
32
|
-
`this.ensureWiredUp();`,
|
|
33
|
-
`return this._${qName};`
|
|
34
|
-
]),
|
|
32
|
+
indent([`this.ensureWiredUp();`, `return this._${qName};`]),
|
|
35
33
|
`}`
|
|
36
34
|
];
|
|
37
35
|
};
|
|
@@ -39,13 +37,10 @@ export const reflectiveClassFor = (imports) => {
|
|
|
39
37
|
const { name, key, id, features } = classifier;
|
|
40
38
|
const metaType = entityMetaType(classifier);
|
|
41
39
|
return [
|
|
42
|
-
`public readonly _${name} = new ${imports.core(metaType)}(this._language, "${name}", "${key}", "${id}"${classifier instanceof Concept ?
|
|
40
|
+
`public readonly _${name} = new ${imports.core(metaType)}(this._language, "${name}", "${key}", "${id}"${classifier instanceof Concept ? ", " + classifier.abstract : ""});`,
|
|
43
41
|
// | core (2nd x) |
|
|
44
42
|
`get ${name}(): ${metaType} {`,
|
|
45
|
-
indent([
|
|
46
|
-
`this.ensureWiredUp();`,
|
|
47
|
-
`return this._${name};`
|
|
48
|
-
]),
|
|
43
|
+
indent([`this.ensureWiredUp();`, `return this._${name};`]),
|
|
49
44
|
`}`,
|
|
50
45
|
features.map(reflectiveMembersForFeature)
|
|
51
46
|
];
|
|
@@ -57,10 +52,7 @@ export const reflectiveClassFor = (imports) => {
|
|
|
57
52
|
`private readonly _${qName} = new ${imports.core("EnumerationLiteral")}(this._${enumeration.name}, "${name}", "${key}", "${id}");`,
|
|
58
53
|
// | core (2nd x) |
|
|
59
54
|
`get ${qName}(): EnumerationLiteral {`,
|
|
60
|
-
indent([
|
|
61
|
-
`this.ensureWiredUp();`,
|
|
62
|
-
`return this._${qName};`
|
|
63
|
-
]),
|
|
55
|
+
indent([`this.ensureWiredUp();`, `return this._${qName};`]),
|
|
64
56
|
`}`
|
|
65
57
|
];
|
|
66
58
|
};
|
|
@@ -68,10 +60,7 @@ export const reflectiveClassFor = (imports) => {
|
|
|
68
60
|
`public readonly _${name} = new ${imports.core("Enumeration")}(this._language, "${name}", "${key}", "${id}");`,
|
|
69
61
|
// | core (2nd x) |
|
|
70
62
|
`get ${name}(): Enumeration {`,
|
|
71
|
-
indent([
|
|
72
|
-
`this.ensureWiredUp();`,
|
|
73
|
-
`return this._${name};`
|
|
74
|
-
]),
|
|
63
|
+
indent([`this.ensureWiredUp();`, `return this._${name};`]),
|
|
75
64
|
`}`,
|
|
76
65
|
literals.map(reflectiveMemberForEnumerationLiteral)
|
|
77
66
|
];
|
|
@@ -79,10 +68,7 @@ export const reflectiveClassFor = (imports) => {
|
|
|
79
68
|
`public readonly _${name} = new ${imports.core("PrimitiveType")}(this._language, "${name}", "${key}", "${id}");`,
|
|
80
69
|
// | core (2nd x) |
|
|
81
70
|
`get ${name}(): PrimitiveType {`,
|
|
82
|
-
indent([
|
|
83
|
-
`this.ensureWiredUp();`,
|
|
84
|
-
`return this._${name};`
|
|
85
|
-
]),
|
|
71
|
+
indent([`this.ensureWiredUp();`, `return this._${name};`]),
|
|
86
72
|
`}`
|
|
87
73
|
];
|
|
88
74
|
const reflectiveMembersForEntity = (entity) => {
|
|
@@ -130,11 +116,11 @@ export const reflectiveClassFor = (imports) => {
|
|
|
130
116
|
if (entity instanceof Classifier) {
|
|
131
117
|
const extends_ = extendsFrom(entity);
|
|
132
118
|
return [
|
|
133
|
-
extends_ instanceof Classifier
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
119
|
+
extends_ instanceof Classifier ? `this._${name}.extends = ${refForType(extends_)};` : [],
|
|
120
|
+
when(entity instanceof Interface && entity.extends.length > 0)(() => `this._${name}.extending(${entity.extends.map(interface_ => refForType(interface_)).join(", ")});`),
|
|
121
|
+
when(isConcreteClassifier(entity) && entity.implements.length > 0)(() => `this._${name}.implementing(${asArray(entity.implements)
|
|
122
|
+
.map(interface_ => refForType(interface_))
|
|
123
|
+
.join(", ")});`),
|
|
138
124
|
when(entity.features.length > 0)(`this._${name}.havingFeatures(${entity.features.map(nameOf).map(thisLocalName).join(", ")});`),
|
|
139
125
|
entity.features.map(wireUpStatementsForFeature)
|
|
140
126
|
];
|
|
@@ -161,10 +147,7 @@ export const reflectiveClassFor = (imports) => {
|
|
|
161
147
|
`private readonly _language: ${imports.core("Language")} = new Language("${imports.thisLanguageNameAsJsIdentifier}", "${version}", "${id}", "${key}");`,
|
|
162
148
|
// | core | (3rd x)
|
|
163
149
|
`get language(): Language {`,
|
|
164
|
-
indent([
|
|
165
|
-
`this.ensureWiredUp();`,
|
|
166
|
-
`return this._language;`
|
|
167
|
-
]),
|
|
150
|
+
indent([`this.ensureWiredUp();`, `return this._language;`]),
|
|
168
151
|
`}`,
|
|
169
152
|
``,
|
|
170
153
|
entities.map(withNewlineAppended(reflectiveMembersForEntity)),
|
|
@@ -182,8 +165,10 @@ export const reflectiveClassFor = (imports) => {
|
|
|
182
165
|
``,
|
|
183
166
|
`factory(${parameterPrefix}handleDelta?: ${imports.generic("DeltaHandler")}): ${imports.generic("NodeBaseFactory")} {`,
|
|
184
167
|
indent([
|
|
185
|
-
`return (classifier: ${imports.core("Classifier")}, ${parameterPrefix}id: ${imports.
|
|
186
|
-
indent(switchOrIf("classifier.key", concreteClassifiers
|
|
168
|
+
`return (classifier: ${imports.core("Classifier")}, ${parameterPrefix}id: ${imports.json("LionWebId")}) => {`,
|
|
169
|
+
indent(switchOrIf("classifier.key", concreteClassifiers
|
|
170
|
+
.map(nameOf)
|
|
171
|
+
.map(name => [`this._${name}.key`, `${name}.create(id, ${parameterPrefix}handleDelta)`]), [
|
|
187
172
|
`const {language} = classifier;`,
|
|
188
173
|
`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})\`);`
|
|
189
174
|
])),
|
|
@@ -195,7 +180,7 @@ export const reflectiveClassFor = (imports) => {
|
|
|
195
180
|
// (Why can this work?! EnumType is an unsatisfied generic parameter!)
|
|
196
181
|
indent([
|
|
197
182
|
`const {enumeration} = enumerationLiteral;`,
|
|
198
|
-
switchOrIf("enumeration.key", enumerations.map(nameOf).map(
|
|
183
|
+
switchOrIf("enumeration.key", enumerations.map(nameOf).map(name => [`this._${name}.key`, "enumerationLiteral.key as EnumType"]), [
|
|
199
184
|
`const {language} = enumeration;`,
|
|
200
185
|
`throw new Error(\`enumeration with key \${enumeration.key} is not known in language \${language.name} (key=\${language.key}, version=\${language.version})\`);`
|
|
201
186
|
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflective-layer.templates.js","sourceRoot":"","sources":["../../src/api/reflective-layer.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,EACH,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"reflective-layer.templates.js","sourceRoot":"","sources":["../../src/api/reflective-layer.templates.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iEAAiE;AACjE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,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,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,SAAS,IAAI,MAAM,EAAE,oCAAoC,CAAC,CAAC,EACjG;wBACI,iCAAiC;wBACjC,gKAAgK;qBACnK,CACJ;iBACJ,CAAC;gBACF,GAAG;gBACH,EAAE;gBACF,yCAAyC,0BAA0B,CAAC,QAAQ,CAAC,KAAK;aACrF,CAAC;YACF,GAAG;SACN,CAAA;IACL,CAAC,CAAA;AACL,CAAC,CAAA"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAA"}
|
package/dist/utils/index.js
CHANGED
|
@@ -15,6 +15,5 @@
|
|
|
15
15
|
// SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
|
|
16
16
|
// SPDX-License-Identifier: Apache-2.0
|
|
17
17
|
export { asTypeScript } from "./json-as-ts.js";
|
|
18
|
-
export { sortedStrings, sortedStringsByUppercase } from "./string-sorting.js";
|
|
19
18
|
export { indent } from "./textgen.js";
|
|
20
19
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/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,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/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,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textgen.d.ts","sourceRoot":"","sources":["../../src/utils/textgen.ts"],"names":[],"mappings":"AAuBA,OAAO,
|
|
1
|
+
{"version":3,"file":"textgen.d.ts","sourceRoot":"","sources":["../../src/utils/textgen.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAwB,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAGnE;;GAEG;AACH,eAAO,MAAM,MAAM,2BAAwB,CAAA;AAY3C;;GAEG;AACH,eAAO,MAAM,cAAc,QAXjB,MAAM,WAWsD,CAAA;AAEtE;;GAEG;AACH,eAAO,MAAM,cAAc,QAhBjB,MAAM,WAgBsD,CAAA;AAGtE;;GAEG;AACH,eAAO,MAAM,cAAc,QAAS,MAAM,KAAG,MAGhB,CAAA;AAG7B,eAAO,MAAM,QAAQ,cAAe,OAAO,QAAQ,MAAM,MAAM,SAAS,MAAM,YACnE,MAAM,WAGC,CAAA;AAGlB,MAAM,MAAM,SAAS,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,CAAA;AAErE,eAAO,MAAM,UAAU,eAAgB,MAAM,SAAS,SAAS,EAAE,gBAAgB,QAAQ,eAiBhF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textgen.js","sourceRoot":"","sources":["../../src/utils/textgen.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;;;GAGG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"textgen.js","sourceRoot":"","sources":["../../src/utils/textgen.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;;;GAGG;AAGH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAY,MAAM,oBAAoB,CAAA;AAGnE;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AAG3C,MAAM,cAAc,GAAG,CAAC,QAAgC,EAAE,EAAE,CACxD,CAAC,GAAW,EAAE,EAAE;IACZ,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,GAAG,CAAA;IACd,CAAC;IACD,OAAO,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;UACxB,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GA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,GAAG;KACN;IACD,CAAC,CAAC;QACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC;YACzC,OAAO,UAAU,QAAQ,cAAc,KAAK;YAC5C,MAAM,CAAC,UAAU,WAAW,GAAG,CAAC;YAChC,GAAG;SACN,CAAC;QACF,YAAY;KACf,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lionweb/class-core-generator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0-alpha.2",
|
|
4
4
|
"description": "Generator for implementations of languages based on the class-core package",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,16 +18,21 @@
|
|
|
18
18
|
"clean": "rm -rf dist/ node_modules/ lionweb-class-core-generator-*.tgz",
|
|
19
19
|
"build": "tsc",
|
|
20
20
|
"lint": "eslint src",
|
|
21
|
-
"pre-release
|
|
22
|
-
"prerelease": "npm run pre-release
|
|
23
|
-
"release": "npm publish",
|
|
24
|
-
"prerelease-beta": "npm run pre-release
|
|
25
|
-
"release-beta": "npm publish --tag beta"
|
|
21
|
+
"prep:pre-release": "npm run clean && npm install && npm run build",
|
|
22
|
+
"prerelease-alpha": "npm run prep:pre-release",
|
|
23
|
+
"release-alpha": "npm publish --tag alpha",
|
|
24
|
+
"prerelease-beta": "npm run prep:pre-release",
|
|
25
|
+
"release-beta": "npm publish --tag beta",
|
|
26
|
+
"prerelease": "npm run prep:pre-release",
|
|
27
|
+
"release": "npm publish"
|
|
26
28
|
},
|
|
27
29
|
"devDependencies": {
|
|
28
|
-
"@lionweb/core": "0.
|
|
29
|
-
"@lionweb/
|
|
30
|
-
"@
|
|
30
|
+
"@lionweb/core": "0.7.0-alpha.2",
|
|
31
|
+
"@lionweb/io-lionweb-mps-specific": "0.7.0-alpha.2",
|
|
32
|
+
"@lionweb/json": "0.7.0-alpha.2",
|
|
33
|
+
"@lionweb/ts-utils": "0.7.0-alpha.2",
|
|
34
|
+
"@lionweb/utilities": "0.7.0-alpha.2",
|
|
35
|
+
"@types/node": "22.15.21",
|
|
31
36
|
"littoral-templates": "0.3.0",
|
|
32
37
|
"typescript": "5.3.3"
|
|
33
38
|
}
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
Enumeration,
|
|
22
22
|
Feature,
|
|
23
23
|
featureMetaType,
|
|
24
|
-
Id,
|
|
25
24
|
Interface,
|
|
26
25
|
isContainment,
|
|
27
26
|
isProperty,
|
|
@@ -34,19 +33,17 @@ import {
|
|
|
34
33
|
Reference,
|
|
35
34
|
SingleRef
|
|
36
35
|
} from "@lionweb/core"
|
|
37
|
-
import {
|
|
36
|
+
import { ConceptDescription, Deprecated, ioLionWebMpsSpecificAnnotationsFrom } from "@lionweb/io-lionweb-mps-specific"
|
|
37
|
+
import { commaSeparated, when, withNewlineAppended } from "littoral-templates"
|
|
38
38
|
|
|
39
|
-
import {indent, switchOrIf, withFirstUpper, wrapInIf} from "../utils/textgen.js"
|
|
39
|
+
import { indent, switchOrIf, withFirstUpper, wrapInIf } from "../utils/textgen.js"
|
|
40
40
|
import {
|
|
41
|
-
ConceptDescription,
|
|
42
|
-
Deprecated,
|
|
43
41
|
entityMetaType,
|
|
44
42
|
extendsFrom,
|
|
45
43
|
featuresToConcretelyImplementOf,
|
|
46
44
|
implementsFrom,
|
|
47
45
|
Imports,
|
|
48
46
|
isAbstract,
|
|
49
|
-
MpsAnnotation,
|
|
50
47
|
optionalityPostfix,
|
|
51
48
|
tsFieldTypeForFeature,
|
|
52
49
|
tsTypeForClassifier,
|
|
@@ -55,7 +52,6 @@ import {
|
|
|
55
52
|
tsTypeForValueManager
|
|
56
53
|
} from "./helpers/index.js"
|
|
57
54
|
|
|
58
|
-
|
|
59
55
|
const cardinalityPrefix = (feature: Feature) => {
|
|
60
56
|
if (feature instanceof Property) {
|
|
61
57
|
return feature.optional ? "Optional" : "Required"
|
|
@@ -68,7 +64,7 @@ const cardinalityPrefix = (feature: Feature) => {
|
|
|
68
64
|
const valueManagerFor = (feature: Feature) =>
|
|
69
65
|
`${cardinalityPrefix(feature)}${featureMetaType(feature)}ValueManager`
|
|
70
66
|
|
|
71
|
-
export const typeForLanguageEntity = (imports: Imports
|
|
67
|
+
export const typeForLanguageEntity = (imports: Imports) => {
|
|
72
68
|
|
|
73
69
|
const sortedSuperTypesCond = <T extends Classifier>(ts: T[], prefix: string): string =>
|
|
74
70
|
ts.length === 0 ? `` : `${prefix}${nameSorted(ts).map((t) => imports.entity(t)).join(", ")}`
|
|
@@ -163,7 +159,7 @@ export const typeForLanguageEntity = (imports: Imports, mpsAnnotationsPerId: Rec
|
|
|
163
159
|
when(!isAbstract(classifier))(
|
|
164
160
|
() =>
|
|
165
161
|
[
|
|
166
|
-
`static create(id:
|
|
162
|
+
`static create(id: ${imports.json("LionWebId")}, handleDelta?: ${imports.generic("DeltaHandler")}, parentInfo?: ${imports.generic("Parentage")}): ${classifier.name} {`,
|
|
167
163
|
indent([
|
|
168
164
|
`return new ${classifier.name}(${imports.language(classifier.language)}.INSTANCE.${classifier.name}, id, handleDelta, parentInfo);`
|
|
169
165
|
]),
|
|
@@ -175,7 +171,7 @@ export const typeForLanguageEntity = (imports: Imports, mpsAnnotationsPerId: Rec
|
|
|
175
171
|
[
|
|
176
172
|
``,
|
|
177
173
|
features.map(withNewlineAppended(classMembersForFeature)),
|
|
178
|
-
`public constructor(classifier: ${imports.core("Classifier")}, id: ${imports.
|
|
174
|
+
`public constructor(classifier: ${imports.core("Classifier")}, id: ${imports.json("LionWebId")}, handleDelta?: ${imports.generic("DeltaHandler")}, parentInfo?: ${imports.generic("Parentage")}) {`,
|
|
179
175
|
indent([
|
|
180
176
|
`super(classifier, id, handleDelta, parentInfo);`,
|
|
181
177
|
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);`)
|
|
@@ -217,14 +213,14 @@ export const typeForLanguageEntity = (imports: Imports, mpsAnnotationsPerId: Rec
|
|
|
217
213
|
`export type ${primitiveType.name} = ${tsTypeForPrimitiveType(primitiveType)};`
|
|
218
214
|
|
|
219
215
|
const jsDocFor = (entity: LanguageEntity) => {
|
|
220
|
-
const
|
|
221
|
-
const conceptDescription =
|
|
222
|
-
const hasShortConceptDescription = !!(conceptDescription?.
|
|
223
|
-
const deprecated =
|
|
216
|
+
const annotations = ioLionWebMpsSpecificAnnotationsFrom(entity)
|
|
217
|
+
const conceptDescription = annotations.find((annotation) => annotation instanceof ConceptDescription) as ConceptDescription
|
|
218
|
+
const hasShortConceptDescription = !!(conceptDescription?.conceptShortDescription)
|
|
219
|
+
const deprecated = annotations.find((annotation) => annotation instanceof Deprecated) as Deprecated
|
|
224
220
|
return when(hasShortConceptDescription || deprecated !== undefined)([
|
|
225
221
|
`/**`,
|
|
226
222
|
when(hasShortConceptDescription)(
|
|
227
|
-
() => ` * ${conceptDescription.
|
|
223
|
+
() => ` * ${conceptDescription.conceptShortDescription}`
|
|
228
224
|
),
|
|
229
225
|
when(deprecated !== undefined)(
|
|
230
226
|
() => ` * @deprecated ${deprecated.comment ?? ""}${deprecated.build === null ? "" : ` (build: ${deprecated.build})`}`
|
package/src/api/generator.ts
CHANGED
|
@@ -15,29 +15,26 @@
|
|
|
15
15
|
// SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
|
|
16
16
|
// SPDX-License-Identifier: Apache-2.0
|
|
17
17
|
|
|
18
|
-
import {deserializeLanguages, Language, lioncore
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
import {indexTsFor} from "./index-ts.js"
|
|
25
|
-
import {languageFileFor} from "./language-file.templates.js"
|
|
26
|
-
import {MpsAnnotation} from "./helpers/index.js"
|
|
18
|
+
import { deserializeLanguages, Language, lioncore } from "@lionweb/core"
|
|
19
|
+
import { LionWebJsonChunk } from "@lionweb/json"
|
|
20
|
+
import { readFileAsJson } from "@lionweb/utilities"
|
|
21
|
+
import { writeFileSync } from "fs"
|
|
22
|
+
import { join } from "path"
|
|
23
|
+
import { cwd } from "process"
|
|
27
24
|
|
|
25
|
+
import { indexTsFor } from "./index-ts.js"
|
|
26
|
+
import { languageFileFor } from "./language-file.templates.js"
|
|
28
27
|
|
|
29
28
|
const properGenericImportLocation = "@lionweb/class-core"
|
|
30
29
|
|
|
31
30
|
|
|
32
31
|
export type GeneratorOptions = {
|
|
33
|
-
mpsAnnotations: MpsAnnotation[]
|
|
34
32
|
genericImportLocation: string
|
|
35
33
|
header?: string
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
|
|
39
37
|
const withDefaults = (options?: Partial<GeneratorOptions>): GeneratorOptions => ({
|
|
40
|
-
mpsAnnotations: options?.mpsAnnotations ?? [],
|
|
41
38
|
genericImportLocation: options?.genericImportLocation ?? properGenericImportLocation,
|
|
42
39
|
header: options?.header
|
|
43
40
|
})
|
|
@@ -56,7 +53,7 @@ export const generateApiFromLanguagesJson = (languagesJsonPath: string, generati
|
|
|
56
53
|
console.log(` Path to languages: ${languagesJsonPath}`)
|
|
57
54
|
console.log(` Generation path: ${generationPath}`)
|
|
58
55
|
|
|
59
|
-
const languagesJson = readFileAsJson(languagesJsonPath) as
|
|
56
|
+
const languagesJson = readFileAsJson(languagesJsonPath) as LionWebJsonChunk
|
|
60
57
|
const languages = deserializeLanguages(languagesJson, lioncore)
|
|
61
58
|
generateApiFromLanguages(languages, generationPath, options)
|
|
62
59
|
}
|
|
@@ -15,22 +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 {
|
|
19
|
-
|
|
20
|
-
allSuperTypesOf,
|
|
21
|
-
Annotation,
|
|
22
|
-
Classifier,
|
|
23
|
-
Concept,
|
|
24
|
-
Feature,
|
|
25
|
-
Interface,
|
|
26
|
-
MultiRef,
|
|
27
|
-
SingleRef
|
|
28
|
-
} from "@lionweb/core"
|
|
29
|
-
import {uniquesAmong} from "@lionweb/utilities/dist/utils/array.js"
|
|
18
|
+
import { allFeaturesOf, allSuperTypesOf, Annotation, Classifier, Concept, Feature, Interface, MultiRef, SingleRef } from "@lionweb/core"
|
|
19
|
+
import { uniquesAmong } from "@lionweb/ts-utils"
|
|
30
20
|
|
|
31
|
-
|
|
32
|
-
export const isAbstract = (classifier: Classifier): boolean =>
|
|
33
|
-
classifier instanceof Concept && classifier.abstract
|
|
21
|
+
export const isAbstract = (classifier: Classifier): boolean => classifier instanceof Concept && classifier.abstract
|
|
34
22
|
/*
|
|
35
23
|
* The logical inverse is: classifier instanceof Annotation || (classifier instanceof Concept && !classifier.abstract)
|
|
36
24
|
*/
|
|
@@ -15,10 +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 {Classifier,
|
|
19
|
-
import {uniquesAmong} from "@lionweb/
|
|
20
|
-
import {asString, when} from "littoral-templates"
|
|
21
|
-
import {indent} from "../../utils/index.js"
|
|
18
|
+
import { Classifier, inheritsFrom, Language, nameOf, nameSorted } from "@lionweb/core"
|
|
19
|
+
import { cycleWith, uniquesAmong } from "@lionweb/ts-utils"
|
|
20
|
+
import { asString, when } from "littoral-templates"
|
|
21
|
+
import { indent } from "../../utils/index.js"
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -15,15 +15,9 @@
|
|
|
15
15
|
// SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
|
|
16
16
|
// SPDX-License-Identifier: Apache-2.0
|
|
17
17
|
|
|
18
|
-
import {Annotation, Concept, Interface, LanguageEntity, PrimitiveType} from "@lionweb/core"
|
|
18
|
+
import { Annotation, Concept, Interface, LanguageEntity, PrimitiveType } from "@lionweb/core"
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
type EntityMetaType =
|
|
22
|
-
| "Annotation"
|
|
23
|
-
| "Concept"
|
|
24
|
-
| "Enumeration"
|
|
25
|
-
| "Interface"
|
|
26
|
-
| "PrimitiveType"
|
|
20
|
+
type EntityMetaType = "Annotation" | "Concept" | "Enumeration" | "Interface" | "PrimitiveType"
|
|
27
21
|
|
|
28
22
|
export const entityMetaType = (entity: LanguageEntity): EntityMetaType => {
|
|
29
23
|
if (entity instanceof Annotation) {
|
|
@@ -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) {
|
|
@@ -59,8 +59,8 @@ export const tsTypeForDatatype = (datatype: SingleRef<Datatype>, imports: Import
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
export const tsTypeForClassifier = (classifier: SingleRef<Classifier>, imports: Imports) => {
|
|
62
|
-
if (classifier ===
|
|
63
|
-
return `unknown /* [ERROR] can't compute a TS type for
|
|
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 "../../utils/textgen.js"
|
|
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]
|
package/src/api/helpers/index.ts
CHANGED
|
@@ -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:
|
|
24
|
-
|
|
25
|
-
case builtinPrimitives.
|
|
26
|
-
|
|
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
|
}
|