@lionweb/io-lionweb-mps-specific 0.7.0-beta.20 → 0.7.0-beta.22

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.
@@ -1,7 +1,12 @@
1
1
  import { M3Concept } from "@lionweb/core";
2
+ import { LionWebJsonChunk } from "@lionweb/json";
2
3
  import { IoLionWebMpsSpecificAnnotation } from "./implementation.js";
3
4
  /**
4
5
  * @return the `io.lionweb.mps.specific` annotations present on the given node.
5
6
  */
6
7
  export declare const ioLionWebMpsSpecificAnnotationsFrom: (node: M3Concept) => IoLionWebMpsSpecificAnnotation[];
8
+ /**
9
+ * Replaces stated version "0" of language "io-lionweb-mps-specific" with its actual version.
10
+ */
11
+ export declare const repairIoLionWebMpsSpecificAnnotations: (serializationChunk: LionWebJsonChunk) => void;
7
12
  //# sourceMappingURL=annotations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../src/annotations.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAA;AAEpE;;GAEG;AACH,eAAO,MAAM,mCAAmC,GAAI,MAAM,SAAS,KAAG,8BAA8B,EAGqB,CAAA"}
1
+ {"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../src/annotations.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAA0B,MAAM,eAAe,CAAA;AAExE,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAA;AAIpE;;GAEG;AACH,eAAO,MAAM,mCAAmC,GAAI,MAAM,SAAS,KAAG,8BAA8B,EAGqB,CAAA;AAGzH;;GAEG;AACH,eAAO,MAAM,qCAAqC,GAAI,oBAAoB,gBAAgB,SAuBzF,CAAA"}
@@ -15,10 +15,38 @@
15
15
  // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
16
  // SPDX-License-Identifier: Apache-2.0
17
17
  import { IoLionWebMpsSpecificAnnotation } from "./implementation.js";
18
+ import { ioLionWebMpsSpecificLanguage } from "./definition.js";
18
19
  /**
19
20
  * @return the `io.lionweb.mps.specific` annotations present on the given node.
20
21
  */
21
22
  export const ioLionWebMpsSpecificAnnotationsFrom = (node) => node
22
23
  .annotations
23
24
  .filter((annotation) => annotation instanceof IoLionWebMpsSpecificAnnotation);
25
+ /**
26
+ * Replaces stated version "0" of language "io-lionweb-mps-specific" with its actual version.
27
+ */
28
+ export const repairIoLionWebMpsSpecificAnnotations = (serializationChunk) => {
29
+ serializationChunk.languages.forEach((usedLanguage) => {
30
+ if (usedLanguage.key === ioLionWebMpsSpecificLanguage.key) {
31
+ usedLanguage.version = ioLionWebMpsSpecificLanguage.version;
32
+ }
33
+ });
34
+ const repairMetaPointer = (metaPointer) => {
35
+ if (metaPointer.language === ioLionWebMpsSpecificLanguage.key) {
36
+ metaPointer.version = ioLionWebMpsSpecificLanguage.version;
37
+ }
38
+ };
39
+ serializationChunk.nodes.forEach((node) => {
40
+ repairMetaPointer(node.classifier);
41
+ node.properties.forEach((propertySetting) => {
42
+ repairMetaPointer(propertySetting.property);
43
+ });
44
+ node.containments.forEach((containmentSetting) => {
45
+ repairMetaPointer(containmentSetting.containment);
46
+ });
47
+ node.references.forEach((referenceSetting) => {
48
+ repairMetaPointer(referenceSetting.reference);
49
+ });
50
+ });
51
+ };
24
52
  //# sourceMappingURL=annotations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotations.js","sourceRoot":"","sources":["../src/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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AC,QAAQ,KAAK,4BAA4B,CAAC,GAAG,EAAE,CAAC;YAC5D,WAAW,CAAC,OAAO,GAAG,4BAA4B,CAAC,OAAO,CAAA;QAC9D,CAAC;IACL,CAAC,CAAA;IACD,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACtC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAClC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,EAAE;YACxC,iBAAiB,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAA;QAC/C,CAAC,CAAC,CAAA;QACF,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,kBAAkB,EAAE,EAAE;YAC7C,iBAAiB,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAA;QACrD,CAAC,CAAC,CAAA;QACF,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,gBAAgB,EAAE,EAAE;YACzC,iBAAiB,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACN,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lionweb/io-lionweb-mps-specific",
3
- "version": "0.7.0-beta.20",
3
+ "version": "0.7.0-beta.22",
4
4
  "description": "TypeScript implementation of the io.lionweb.mps.specific language",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,10 +15,10 @@
15
15
  "url": "https://github.com/LionWeb-io/lionweb-typescript/issues"
16
16
  },
17
17
  "dependencies": {
18
- "@lionweb/core": "0.7.0-beta.20",
19
- "@lionweb/json": "0.7.0-beta.20",
20
- "@lionweb/textgen-utils": "0.7.0-beta.20",
21
- "@lionweb/ts-utils": "0.7.0-beta.20",
18
+ "@lionweb/core": "0.7.0-beta.22",
19
+ "@lionweb/json": "0.7.0-beta.22",
20
+ "@lionweb/textgen-utils": "0.7.0-beta.22",
21
+ "@lionweb/ts-utils": "0.7.0-beta.22",
22
22
  "littoral-templates": "0.5.1",
23
23
  "nanoid": "5.1.5"
24
24
  },
@@ -16,7 +16,11 @@
16
16
  // SPDX-License-Identifier: Apache-2.0
17
17
 
18
18
  import { M3Concept } from "@lionweb/core"
19
+ import { LionWebJsonChunk, LionWebJsonMetaPointer } from "@lionweb/json"
20
+
19
21
  import { IoLionWebMpsSpecificAnnotation } from "./implementation.js"
22
+ import { ioLionWebMpsSpecificLanguage } from "./definition.js"
23
+
20
24
 
21
25
  /**
22
26
  * @return the `io.lionweb.mps.specific` annotations present on the given node.
@@ -26,3 +30,32 @@ export const ioLionWebMpsSpecificAnnotationsFrom = (node: M3Concept): IoLionWebM
26
30
  .annotations
27
31
  .filter((annotation) => annotation instanceof IoLionWebMpsSpecificAnnotation) as IoLionWebMpsSpecificAnnotation[]
28
32
 
33
+
34
+ /**
35
+ * Replaces stated version "0" of language "io-lionweb-mps-specific" with its actual version.
36
+ */
37
+ export const repairIoLionWebMpsSpecificAnnotations = (serializationChunk: LionWebJsonChunk) => {
38
+ serializationChunk.languages.forEach((usedLanguage) => {
39
+ if (usedLanguage.key === ioLionWebMpsSpecificLanguage.key) {
40
+ usedLanguage.version = ioLionWebMpsSpecificLanguage.version
41
+ }
42
+ })
43
+ const repairMetaPointer = (metaPointer: LionWebJsonMetaPointer): void => {
44
+ if (metaPointer.language === ioLionWebMpsSpecificLanguage.key) {
45
+ metaPointer.version = ioLionWebMpsSpecificLanguage.version
46
+ }
47
+ }
48
+ serializationChunk.nodes.forEach((node) => {
49
+ repairMetaPointer(node.classifier)
50
+ node.properties.forEach((propertySetting) => {
51
+ repairMetaPointer(propertySetting.property)
52
+ })
53
+ node.containments.forEach((containmentSetting) => {
54
+ repairMetaPointer(containmentSetting.containment)
55
+ })
56
+ node.references.forEach((referenceSetting) => {
57
+ repairMetaPointer(referenceSetting.reference)
58
+ })
59
+ })
60
+ }
61
+