@lionweb/class-core-generator 0.7.0-beta.0 → 0.7.0-beta.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 +4 -0
- package/dist/entity-types.templates.d.ts +4 -0
- package/dist/entity-types.templates.d.ts.map +1 -0
- package/dist/{api/entity-types.templates.js → entity-types.templates.js} +35 -14
- package/dist/entity-types.templates.js.map +1 -0
- package/dist/{api/generation-headers.d.ts → generation-headers.d.ts} +1 -1
- package/dist/generation-headers.d.ts.map +1 -0
- package/dist/{api/generation-headers.js → generation-headers.js} +3 -5
- package/dist/generation-headers.js.map +1 -0
- package/dist/{api/generator.d.ts → generator.d.ts} +0 -2
- package/dist/generator.d.ts.map +1 -0
- package/dist/{api/generator.js → generator.js} +0 -1
- package/dist/generator.js.map +1 -0
- package/dist/helpers/classifiers.d.ts.map +1 -0
- package/dist/helpers/classifiers.js.map +1 -0
- package/dist/helpers/entities.d.ts.map +1 -0
- package/dist/helpers/entities.js.map +1 -0
- package/dist/{api/helpers → helpers}/features.d.ts +3 -3
- package/dist/helpers/features.d.ts.map +1 -0
- package/dist/{api/helpers → helpers}/features.js +11 -11
- package/dist/helpers/features.js.map +1 -0
- package/dist/helpers/imports-tracking.d.ts.map +1 -0
- package/dist/{api/helpers → helpers}/imports-tracking.js +1 -1
- package/dist/helpers/imports-tracking.js.map +1 -0
- package/dist/{api/helpers → helpers}/index.d.ts +0 -2
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/{api/helpers → helpers}/index.js +0 -2
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/primitive-types.d.ts.map +1 -0
- package/dist/{api/helpers → helpers}/primitive-types.js +4 -4
- package/dist/helpers/primitive-types.js.map +1 -0
- package/dist/index-ts.d.ts.map +1 -0
- package/dist/{api/index-ts.js → index-ts.js} +3 -2
- package/dist/index-ts.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/language-file.templates.d.ts.map +1 -0
- package/dist/{api/language-file.templates.js → language-file.templates.js} +3 -5
- package/dist/language-file.templates.js.map +1 -0
- package/dist/mega-factory.templates.d.ts +3 -0
- package/dist/mega-factory.templates.d.ts.map +1 -0
- package/dist/{api/mega-factory.templates.js → mega-factory.templates.js} +4 -4
- package/dist/mega-factory.templates.js.map +1 -0
- package/dist/reflective-layer.templates.d.ts.map +1 -0
- package/dist/{api/reflective-layer.templates.js → reflective-layer.templates.js} +1 -1
- package/dist/reflective-layer.templates.js.map +1 -0
- package/package.json +16 -12
- package/src/{api/entity-types.templates.ts → entity-types.templates.ts} +55 -19
- package/src/{api/generation-headers.ts → generation-headers.ts} +3 -5
- package/src/{api/generator.ts → generator.ts} +0 -3
- package/src/{api/helpers → helpers}/features.ts +13 -12
- package/src/{api/helpers → helpers}/imports-tracking.ts +1 -1
- package/src/{api/helpers → helpers}/index.ts +0 -2
- package/src/{api/helpers → helpers}/primitive-types.ts +4 -4
- package/src/{api/index-ts.ts → index-ts.ts} +4 -3
- package/src/index.ts +3 -2
- package/src/{api/language-file.templates.ts → language-file.templates.ts} +3 -6
- package/src/{api/mega-factory.templates.ts → mega-factory.templates.ts} +4 -5
- package/src/{api/reflective-layer.templates.ts → reflective-layer.templates.ts} +1 -1
- package/dist/api/entity-types.templates.d.ts +0 -5
- package/dist/api/entity-types.templates.d.ts.map +0 -1
- package/dist/api/entity-types.templates.js.map +0 -1
- package/dist/api/generation-headers.d.ts.map +0 -1
- package/dist/api/generation-headers.js.map +0 -1
- package/dist/api/generator.d.ts.map +0 -1
- package/dist/api/generator.js.map +0 -1
- package/dist/api/helpers/classifiers.d.ts.map +0 -1
- package/dist/api/helpers/classifiers.js.map +0 -1
- package/dist/api/helpers/dependencies.d.ts +0 -11
- package/dist/api/helpers/dependencies.d.ts.map +0 -1
- package/dist/api/helpers/dependencies.js +0 -52
- package/dist/api/helpers/dependencies.js.map +0 -1
- package/dist/api/helpers/entities.d.ts.map +0 -1
- package/dist/api/helpers/entities.js.map +0 -1
- package/dist/api/helpers/features.d.ts.map +0 -1
- package/dist/api/helpers/features.js.map +0 -1
- package/dist/api/helpers/imports-tracking.d.ts.map +0 -1
- package/dist/api/helpers/imports-tracking.js.map +0 -1
- package/dist/api/helpers/index.d.ts.map +0 -1
- package/dist/api/helpers/index.js.map +0 -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/primitive-types.d.ts.map +0 -1
- package/dist/api/helpers/primitive-types.js.map +0 -1
- package/dist/api/index-ts.d.ts.map +0 -1
- package/dist/api/index-ts.js.map +0 -1
- package/dist/api/index.d.ts +0 -5
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/index.js +0 -21
- package/dist/api/index.js.map +0 -1
- package/dist/api/language-file.templates.d.ts.map +0 -1
- package/dist/api/language-file.templates.js.map +0 -1
- package/dist/api/mega-factory.templates.d.ts +0 -4
- package/dist/api/mega-factory.templates.d.ts.map +0 -1
- package/dist/api/mega-factory.templates.js.map +0 -1
- package/dist/api/reflective-layer.templates.d.ts.map +0 -1
- package/dist/api/reflective-layer.templates.js.map +0 -1
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -19
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/json-as-ts.d.ts +0 -2
- package/dist/utils/json-as-ts.d.ts.map +0 -1
- package/dist/utils/json-as-ts.js +0 -18
- package/dist/utils/json-as-ts.js.map +0 -1
- package/dist/utils/textgen.d.ts +0 -21
- package/dist/utils/textgen.d.ts.map +0 -1
- package/dist/utils/textgen.js +0 -67
- package/dist/utils/textgen.js.map +0 -1
- package/src/api/helpers/dependencies.ts +0 -62
- package/src/api/helpers/mps-annotations.ts +0 -67
- package/src/api/index.ts +0 -21
- package/src/utils/index.ts +0 -20
- package/src/utils/json-as-ts.ts +0 -20
- package/src/utils/textgen.ts +0 -89
- /package/dist/{api/helpers → helpers}/classifiers.d.ts +0 -0
- /package/dist/{api/helpers → helpers}/classifiers.js +0 -0
- /package/dist/{api/helpers → helpers}/entities.d.ts +0 -0
- /package/dist/{api/helpers → helpers}/entities.js +0 -0
- /package/dist/{api/helpers → helpers}/imports-tracking.d.ts +0 -0
- /package/dist/{api/helpers → helpers}/primitive-types.d.ts +0 -0
- /package/dist/{api/index-ts.d.ts → index-ts.d.ts} +0 -0
- /package/dist/{api/language-file.templates.d.ts → language-file.templates.d.ts} +0 -0
- /package/dist/{api/reflective-layer.templates.d.ts → reflective-layer.templates.d.ts} +0 -0
- /package/src/{api/helpers → helpers}/classifiers.ts +0 -0
- /package/src/{api/helpers → helpers}/entities.ts +0 -0
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
-
//
|
|
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
|
|
17
|
-
export class MpsAnnotation {
|
|
18
|
-
constructor(annotatedNodeId) {
|
|
19
|
-
this.annotatedNodeId = annotatedNodeId;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export class ConceptDescription extends MpsAnnotation {
|
|
23
|
-
constructor(annotatedNodeId, shortDescription, alias) {
|
|
24
|
-
super(annotatedNodeId);
|
|
25
|
-
this.shortDescription = shortDescription;
|
|
26
|
-
this.alias = alias;
|
|
27
|
-
}
|
|
28
|
-
toString() {
|
|
29
|
-
return `<ConceptDescription> annotatedNodeId=${this.annotatedNodeId}, shortDescription="${this.shortDescription}"`;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export class Deprecated extends MpsAnnotation {
|
|
33
|
-
constructor(annotatedNodeId, comment, build) {
|
|
34
|
-
super(annotatedNodeId);
|
|
35
|
-
this.comment = comment;
|
|
36
|
-
this.build = build;
|
|
37
|
-
}
|
|
38
|
-
toString() {
|
|
39
|
-
return `<Deprecated> annotatedNodeId=${this.annotatedNodeId}, comment="${this.comment}", build="${this.build}"`;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export const extractedMpsAnnotations = ({ nodes }) => nodes.flatMap(({ classifier, properties, parent }) => {
|
|
43
|
-
const propertyValue = (key) => {
|
|
44
|
-
const property = properties.find(({ property }) => property.key === key);
|
|
45
|
-
return property === undefined
|
|
46
|
-
? null
|
|
47
|
-
: property.value;
|
|
48
|
-
};
|
|
49
|
-
if (classifier.language !== "io-lionweb-mps-specific" || classifier.version !== "0") {
|
|
50
|
-
return [];
|
|
51
|
-
}
|
|
52
|
-
switch (classifier.key) {
|
|
53
|
-
case "ConceptDescription": {
|
|
54
|
-
return [new ConceptDescription(parent, propertyValue("ConceptDescription-conceptShortDescription"), propertyValue("ConceptDescription-conceptAlias"))];
|
|
55
|
-
}
|
|
56
|
-
case "Deprecated": {
|
|
57
|
-
return [new Deprecated(parent, propertyValue("Deprecated-comment"), propertyValue("Deprecated-build"))];
|
|
58
|
-
}
|
|
59
|
-
default: {
|
|
60
|
-
console.log(`couldn't handle MPS annotation with key ${classifier.key}`);
|
|
61
|
-
return [];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
//# sourceMappingURL=mps-annotations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mps-annotations.js","sourceRoot":"","sources":["../../../src/api/helpers/mps-annotations.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;AAItC,MAAM,OAAgB,aAAa;IAC/B,YAA4B,eAA0B;QAA1B,oBAAe,GAAf,eAAe,CAAW;IAAG,CAAC;CAC7D;AAED,MAAM,OAAO,kBAAmB,SAAQ,aAAa;IACjD,YAAY,eAA0B,EAAkB,gBAA+B,EAAkB,KAAoB;QACzH,KAAK,CAAC,eAAe,CAAC,CAAA;QAD8B,qBAAgB,GAAhB,gBAAgB,CAAe;QAAkB,UAAK,GAAL,KAAK,CAAe;IAE7H,CAAC;IACD,QAAQ;QACJ,OAAO,wCAAwC,IAAI,CAAC,eAAe,uBAAuB,IAAI,CAAC,gBAAgB,GAAG,CAAA;IACtH,CAAC;CACJ;AAED,MAAM,OAAO,UAAW,SAAQ,aAAa;IACzC,YAAY,eAA0B,EAAkB,OAAsB,EAAkB,KAAoB;QAChH,KAAK,CAAC,eAAe,CAAC,CAAA;QAD8B,YAAO,GAAP,OAAO,CAAe;QAAkB,UAAK,GAAL,KAAK,CAAe;IAEpH,CAAC;IACD,QAAQ;QACJ,OAAO,gCAAgC,IAAI,CAAC,eAAe,cAAc,IAAI,CAAC,OAAO,aAAa,IAAI,CAAC,KAAK,GAAG,CAAA;IACnH,CAAC;CACJ;AAGD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EAAC,KAAK,EAAmB,EAAmB,EAAE,CAClF,KAAK,CAAC,OAAO,CAAgB,CAAC,EA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M,sBAAsB,kBAAmB,aAAa,KAAG,MAarE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"primitive-types.js","sourceRoot":"","sources":["../../../src/api/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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-ts.d.ts","sourceRoot":"","sources":["../../src/api/index-ts.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAIxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGjD,eAAO,MAAM,UAAU,cAAe,QAAQ,EAAE,WAAW,gBAAgB,WA0C1E,CAAA"}
|
package/dist/api/index-ts.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-ts.js","sourceRoot":"","sources":["../../src/api/index-ts.ts"],"names":[],"mappings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AAQ,CAAC,IAAI,SAAS,CAAC;QACzH,EAAE;QACF,0FAA0F;QAC1F,wCAAwC;QACxC,SAAS;aACJ,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;aAC7C,GAAG,CACA,QAAQ,CAAC,EAAE,CACP,GAAG,yBAAyB,CAAC,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/api/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { generateLanguage, generateApiFromLanguages, generateApiFromLanguagesJson } from "./generator.js";
|
|
2
|
-
export * from "./generation-headers.js";
|
|
3
|
-
export * from "./helpers/mps-annotations.js";
|
|
4
|
-
export * from "./mega-factory.templates.js";
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/api/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,gBAAgB,EAAE,wBAAwB,EAAE,4BAA4B,EAAC,MAAM,gBAAgB,CAAA;AACvG,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,6BAA6B,CAAA"}
|
package/dist/api/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
-
//
|
|
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
|
|
17
|
-
export { generateLanguage, generateApiFromLanguages, generateApiFromLanguagesJson } from "./generator.js";
|
|
18
|
-
export * from "./generation-headers.js";
|
|
19
|
-
export * from "./helpers/mps-annotations.js";
|
|
20
|
-
export * from "./mega-factory.templates.js";
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/dist/api/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/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,gBAAgB,EAAE,wBAAwB,EAAE,4BAA4B,EAAC,MAAM,gBAAgB,CAAA;AACvG,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,6BAA6B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"language-file.templates.d.ts","sourceRoot":"","sources":["../../src/api/language-file.templates.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAW,QAAQ,EAAE,MAAM,eAAe,CAAA;AAMjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAQjD,eAAO,MAAM,eAAe,aAAc,QAAQ,WAAW,gBAAgB,WAwC5E,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"language-file.templates.js","sourceRoot":"","sources":["../../src/api/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,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAY,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC9D,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAE5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAEpE,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,KAAe,EAAE,EAAE,CACrD,IAAI,C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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"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Language } from "@lionweb/core";
|
|
2
|
-
import { MpsAnnotation } from "./helpers/index.js";
|
|
3
|
-
export declare const megaFactoryFor: (megaFactoryName: string, languages: Language[], mpsAnnotations?: MpsAnnotation[], header?: string) => string;
|
|
4
|
-
//# sourceMappingURL=mega-factory.templates.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAIpE,OAAO,EAAc,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAE9D,eAAO,MAAM,cAAc,oBAAqB,MAAM,aAAa,QAAQ,EAAE,mBAAkB,aAAa,EAAE,WAAgB,MAAM,WAgDnI,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
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;AACt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AO,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 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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,UAAU,EACV,OAAO,EACP,WAAW,EAGX,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ACH,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
DELETED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
-
//
|
|
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
|
|
17
|
-
export { asTypeScript } from "./json-as-ts.js";
|
|
18
|
-
export { indent } from "./textgen.js";
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-as-ts.d.ts","sourceRoot":"","sources":["../../src/utils/json-as-ts.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,YAAY,SAAU,OAAO,WACwB,CAAA"}
|
package/dist/utils/json-as-ts.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
-
//
|
|
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
|
|
17
|
-
export const asTypeScript = (json) => JSON.stringify(json, null, 4).replaceAll(/"(.+?)": /g, `$1: `);
|
|
18
|
-
//# sourceMappingURL=json-as-ts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-as-ts.js","sourceRoot":"","sources":["../../src/utils/json-as-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;AAEtC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAa,EAAE,EAAE,CAC1C,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA"}
|
package/dist/utils/textgen.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Template } from "littoral-templates";
|
|
2
|
-
/**
|
|
3
|
-
* @return an indenter function that indents by 4 spaces.
|
|
4
|
-
*/
|
|
5
|
-
export declare const indent: (_: Template) => string[];
|
|
6
|
-
/**
|
|
7
|
-
* @return the given string but with its first character lower-cased (when possible).
|
|
8
|
-
*/
|
|
9
|
-
export declare const withFirstLower: (str: string) => string;
|
|
10
|
-
/**
|
|
11
|
-
* @return the given string but with its first character upper-cased (when possible).
|
|
12
|
-
*/
|
|
13
|
-
export declare const withFirstUpper: (str: string) => string;
|
|
14
|
-
/**
|
|
15
|
-
* @return a sanitized version of the given string that should be suitable as a valid JavaScript identifier.
|
|
16
|
-
*/
|
|
17
|
-
export declare const asJSIdentifier: (str: string) => string;
|
|
18
|
-
export declare const wrapInIf: (condition: boolean, left: () => string, right: string) => (text: string) => string;
|
|
19
|
-
export type MatchCase = [caseExpression: string, returnValue: string];
|
|
20
|
-
export declare const switchOrIf: (expression: string, cases: MatchCase[], defaultBlock: Template) => Template[];
|
|
21
|
-
//# sourceMappingURL=textgen.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/utils/textgen.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
-
//
|
|
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
|
|
17
|
-
/*
|
|
18
|
-
* NOTE: this code is copied verbatim from the @lionweb/utilities package, and subsequently modified/added to.
|
|
19
|
-
* This code should “flow back” to the @lionweb packages.
|
|
20
|
-
*/
|
|
21
|
-
import { asString, indentWith } from "littoral-templates";
|
|
22
|
-
/**
|
|
23
|
-
* @return an indenter function that indents by 4 spaces.
|
|
24
|
-
*/
|
|
25
|
-
export const indent = indentWith(" ")(1);
|
|
26
|
-
const withFirstCased = (charFunc) => (str) => {
|
|
27
|
-
if (str.length === 0) {
|
|
28
|
-
return str;
|
|
29
|
-
}
|
|
30
|
-
return charFunc(str.charAt(0))
|
|
31
|
-
+ (str.length > 1 ? str.substring(1) : "");
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* @return the given string but with its first character lower-cased (when possible).
|
|
35
|
-
*/
|
|
36
|
-
export const withFirstLower = withFirstCased((ch) => ch.toLowerCase());
|
|
37
|
-
/**
|
|
38
|
-
* @return the given string but with its first character upper-cased (when possible).
|
|
39
|
-
*/
|
|
40
|
-
export const withFirstUpper = withFirstCased((ch) => ch.toUpperCase());
|
|
41
|
-
/**
|
|
42
|
-
* @return a sanitized version of the given string that should be suitable as a valid JavaScript identifier.
|
|
43
|
-
*/
|
|
44
|
-
export const asJSIdentifier = (str) => str
|
|
45
|
-
.replaceAll(".", "_")
|
|
46
|
-
.replaceAll("-", "_");
|
|
47
|
-
export const wrapInIf = (condition, left, right) => (text) => condition
|
|
48
|
-
? `${left()}${text}${right}`
|
|
49
|
-
: text;
|
|
50
|
-
export const switchOrIf = (expression, cases, defaultBlock) => cases.length > 1
|
|
51
|
-
? [
|
|
52
|
-
`switch (${expression}) {`,
|
|
53
|
-
indent([
|
|
54
|
-
cases.map(([caseExpression, returnValue]) => `case ${caseExpression}: return ${returnValue};`),
|
|
55
|
-
`default: ${typeof defaultBlock === "string" ? defaultBlock : asString(["{", indent(defaultBlock), "}"])}`
|
|
56
|
-
]),
|
|
57
|
-
`}`
|
|
58
|
-
]
|
|
59
|
-
: [
|
|
60
|
-
cases.map(([caseExpression, returnValue]) => [
|
|
61
|
-
`if (${expression} === ${caseExpression}) {`,
|
|
62
|
-
indent(`return ${returnValue};`),
|
|
63
|
-
`}`
|
|
64
|
-
]),
|
|
65
|
-
defaultBlock
|
|
66
|
-
];
|
|
67
|
-
//# sourceMappingURL=textgen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AAClD,CAAC,CAAA;AAEL;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;AAEtE;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE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
|
2
|
-
//
|
|
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
|
|
17
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @return all languages that any {@link Classifier classifier} of the given {@link Language language} depends on through direct inheritance.
|
|
26
|
-
*/
|
|
27
|
-
export const dependenciesThroughDirectInheritanceOf = (language: Language) =>
|
|
28
|
-
uniquesAmong(
|
|
29
|
-
language.entities
|
|
30
|
-
.filter((entity) => entity instanceof Classifier)
|
|
31
|
-
.flatMap((entity) => inheritsFrom(entity as Classifier))
|
|
32
|
-
.map((classifier) => classifier.language)
|
|
33
|
-
.filter((depLanguage) => depLanguage !== language)
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @return the – currently only those arising from direct inheritance on classifier-level – dependencies of the given {@link Language languages},
|
|
39
|
-
* as a human-readable text
|
|
40
|
-
*/
|
|
41
|
-
export const verboseDependencies = (languages: Language[]): string => {
|
|
42
|
-
const nameSortedLanguages = nameSorted(languages)
|
|
43
|
-
return asString([
|
|
44
|
-
nameSortedLanguages.map((language) => {
|
|
45
|
-
const deps = dependenciesThroughDirectInheritanceOf(language)
|
|
46
|
-
const what = `direct type-wise dependencies (through inheritance)`
|
|
47
|
-
const cycle = cycleWith(language, dependenciesThroughDirectInheritanceOf)
|
|
48
|
-
return deps.length === 0
|
|
49
|
-
? `language ${language.name} has no ${what}`
|
|
50
|
-
: [
|
|
51
|
-
`language ${language.name} has the following ${what}:`,
|
|
52
|
-
indent([
|
|
53
|
-
nameSorted(dependenciesThroughDirectInheritanceOf(language)).map(nameOf),
|
|
54
|
-
when(cycle.length > 0)(
|
|
55
|
-
`⚠ language "${language.name}" is part of the following cycle through type-wise (through direct inheritance): ${cycle.map(nameOf).join(" -> ")}`
|
|
56
|
-
)
|
|
57
|
-
])
|
|
58
|
-
]
|
|
59
|
-
})
|
|
60
|
-
])
|
|
61
|
-
}
|
|
62
|
-
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
-
//
|
|
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
|
|
17
|
-
|
|
18
|
-
import { LionWebId, LionWebJsonChunk, LionWebKey } from "@lionweb/json"
|
|
19
|
-
|
|
20
|
-
export abstract class MpsAnnotation {
|
|
21
|
-
constructor(public readonly annotatedNodeId: LionWebId) {}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export class ConceptDescription extends MpsAnnotation {
|
|
25
|
-
constructor(annotatedNodeId: LionWebId, public readonly shortDescription: string | null, public readonly alias: string | null) {
|
|
26
|
-
super(annotatedNodeId)
|
|
27
|
-
}
|
|
28
|
-
toString() {
|
|
29
|
-
return `<ConceptDescription> annotatedNodeId=${this.annotatedNodeId}, shortDescription="${this.shortDescription}"`
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export class Deprecated extends MpsAnnotation {
|
|
34
|
-
constructor(annotatedNodeId: LionWebId, public readonly comment: string | null, public readonly build: string | null) {
|
|
35
|
-
super(annotatedNodeId)
|
|
36
|
-
}
|
|
37
|
-
toString() {
|
|
38
|
-
return `<Deprecated> annotatedNodeId=${this.annotatedNodeId}, comment="${this.comment}", build="${this.build}"`
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
export const extractedMpsAnnotations = ({nodes}: LionWebJsonChunk): MpsAnnotation[] =>
|
|
44
|
-
nodes.flatMap<MpsAnnotation>(({classifier, properties, parent}) => {
|
|
45
|
-
const propertyValue = (key: LionWebKey): string | null => {
|
|
46
|
-
const property = properties.find(({property}) => property.key === key)
|
|
47
|
-
return property === undefined
|
|
48
|
-
? null
|
|
49
|
-
: property.value
|
|
50
|
-
}
|
|
51
|
-
if (classifier.language !== "io-lionweb-mps-specific" || classifier.version !== "0") {
|
|
52
|
-
return []
|
|
53
|
-
}
|
|
54
|
-
switch (classifier.key) {
|
|
55
|
-
case "ConceptDescription": {
|
|
56
|
-
return [new ConceptDescription(parent!, propertyValue("ConceptDescription-conceptShortDescription"), propertyValue("ConceptDescription-conceptAlias"))]
|
|
57
|
-
}
|
|
58
|
-
case "Deprecated": {
|
|
59
|
-
return [new Deprecated(parent!, propertyValue("Deprecated-comment"), propertyValue("Deprecated-build"))]
|
|
60
|
-
}
|
|
61
|
-
default: {
|
|
62
|
-
console.log(`couldn't handle MPS annotation with key ${classifier.key}`)
|
|
63
|
-
return []
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
|
package/src/api/index.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
-
//
|
|
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
|
|
17
|
-
|
|
18
|
-
export {generateLanguage, generateApiFromLanguages, generateApiFromLanguagesJson} from "./generator.js"
|
|
19
|
-
export * from "./generation-headers.js"
|
|
20
|
-
export * from "./helpers/mps-annotations.js"
|
|
21
|
-
export * from "./mega-factory.templates.js"
|
package/src/utils/index.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
-
//
|
|
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
|
|
17
|
-
|
|
18
|
-
export {asTypeScript} from "./json-as-ts.js"
|
|
19
|
-
export {indent} from "./textgen.js"
|
|
20
|
-
|
package/src/utils/json-as-ts.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
-
//
|
|
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
|
|
17
|
-
|
|
18
|
-
export const asTypeScript = (json: unknown) =>
|
|
19
|
-
JSON.stringify(json, null, 4).replaceAll(/"(.+?)": /g, `$1: `)
|
|
20
|
-
|
package/src/utils/textgen.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 TRUMPF Laser SE and other contributors
|
|
2
|
-
//
|
|
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
|
|
17
|
-
|
|
18
|
-
/*
|
|
19
|
-
* NOTE: this code is copied verbatim from the @lionweb/utilities package, and subsequently modified/added to.
|
|
20
|
-
* This code should “flow back” to the @lionweb packages.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
import { asString, indentWith, Template } from "littoral-templates"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @return an indenter function that indents by 4 spaces.
|
|
29
|
-
*/
|
|
30
|
-
export const indent = indentWith(" ")(1)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const withFirstCased = (charFunc: (ch: string) => string) =>
|
|
34
|
-
(str: string) => {
|
|
35
|
-
if (str.length === 0) {
|
|
36
|
-
return str
|
|
37
|
-
}
|
|
38
|
-
return charFunc(str.charAt(0))
|
|
39
|
-
+ (str.length > 1 ? str.substring(1) : "")
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @return the given string but with its first character lower-cased (when possible).
|
|
44
|
-
*/
|
|
45
|
-
export const withFirstLower = withFirstCased((ch) => ch.toLowerCase())
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @return the given string but with its first character upper-cased (when possible).
|
|
49
|
-
*/
|
|
50
|
-
export const withFirstUpper = withFirstCased((ch) => ch.toUpperCase())
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @return a sanitized version of the given string that should be suitable as a valid JavaScript identifier.
|
|
55
|
-
*/
|
|
56
|
-
export const asJSIdentifier = (str: string): string =>
|
|
57
|
-
str
|
|
58
|
-
.replaceAll(".", "_")
|
|
59
|
-
.replaceAll("-", "_")
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
export const wrapInIf = (condition: boolean, left: () => string, right: string) =>
|
|
63
|
-
(text: string) =>
|
|
64
|
-
condition
|
|
65
|
-
? `${left()}${text}${right}`
|
|
66
|
-
: text
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
export type MatchCase = [caseExpression: string, returnValue: string]
|
|
70
|
-
|
|
71
|
-
export const switchOrIf = (expression: string, cases: MatchCase[], defaultBlock: Template) =>
|
|
72
|
-
cases.length > 1
|
|
73
|
-
? [
|
|
74
|
-
`switch (${expression}) {`,
|
|
75
|
-
indent([
|
|
76
|
-
cases.map(([caseExpression, returnValue]) => `case ${caseExpression}: return ${returnValue};`),
|
|
77
|
-
`default: ${typeof defaultBlock === "string" ? defaultBlock : asString(["{", indent(defaultBlock), "}"])}`
|
|
78
|
-
]),
|
|
79
|
-
`}`
|
|
80
|
-
]
|
|
81
|
-
: [
|
|
82
|
-
cases.map(([caseExpression, returnValue]) => [
|
|
83
|
-
`if (${expression} === ${caseExpression}) {`,
|
|
84
|
-
indent(`return ${returnValue};`),
|
|
85
|
-
`}`
|
|
86
|
-
]),
|
|
87
|
-
defaultBlock
|
|
88
|
-
]
|
|
89
|
-
|
|
File without changes
|
|
File without changes
|