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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/entity-types.templates.d.ts +4 -0
  3. package/dist/entity-types.templates.d.ts.map +1 -0
  4. package/dist/{api/entity-types.templates.js → entity-types.templates.js} +36 -15
  5. package/dist/entity-types.templates.js.map +1 -0
  6. package/dist/{api/generation-headers.d.ts → generation-headers.d.ts} +1 -1
  7. package/dist/generation-headers.d.ts.map +1 -0
  8. package/dist/{api/generation-headers.js → generation-headers.js} +19 -13
  9. package/dist/generation-headers.js.map +1 -0
  10. package/dist/{api/generator.d.ts → generator.d.ts} +0 -2
  11. package/dist/generator.d.ts.map +1 -0
  12. package/dist/{api/generator.js → generator.js} +0 -1
  13. package/dist/generator.js.map +1 -0
  14. package/dist/helpers/classifiers.d.ts.map +1 -0
  15. package/dist/helpers/classifiers.js.map +1 -0
  16. package/dist/helpers/entities.d.ts.map +1 -0
  17. package/dist/helpers/entities.js.map +1 -0
  18. package/dist/{api/helpers → helpers}/features.d.ts +3 -3
  19. package/dist/helpers/features.d.ts.map +1 -0
  20. package/dist/{api/helpers → helpers}/features.js +11 -11
  21. package/dist/helpers/features.js.map +1 -0
  22. package/dist/helpers/imports-tracking.d.ts.map +1 -0
  23. package/dist/{api/helpers → helpers}/imports-tracking.js +1 -1
  24. package/dist/helpers/imports-tracking.js.map +1 -0
  25. package/dist/{api/helpers → helpers}/index.d.ts +0 -2
  26. package/dist/helpers/index.d.ts.map +1 -0
  27. package/dist/{api/helpers → helpers}/index.js +0 -2
  28. package/dist/helpers/index.js.map +1 -0
  29. package/dist/helpers/primitive-types.d.ts.map +1 -0
  30. package/dist/{api/helpers → helpers}/primitive-types.js +4 -4
  31. package/dist/helpers/primitive-types.js.map +1 -0
  32. package/dist/index-ts.d.ts.map +1 -0
  33. package/dist/{api/index-ts.js → index-ts.js} +3 -2
  34. package/dist/index-ts.js.map +1 -0
  35. package/dist/index.d.ts +3 -2
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +3 -2
  38. package/dist/index.js.map +1 -1
  39. package/dist/language-file.templates.d.ts.map +1 -0
  40. package/dist/{api/language-file.templates.js → language-file.templates.js} +3 -5
  41. package/dist/language-file.templates.js.map +1 -0
  42. package/dist/mega-factory.templates.d.ts +3 -0
  43. package/dist/mega-factory.templates.d.ts.map +1 -0
  44. package/dist/{api/mega-factory.templates.js → mega-factory.templates.js} +4 -4
  45. package/dist/mega-factory.templates.js.map +1 -0
  46. package/dist/reflective-layer.templates.d.ts.map +1 -0
  47. package/dist/{api/reflective-layer.templates.js → reflective-layer.templates.js} +9 -5
  48. package/dist/reflective-layer.templates.js.map +1 -0
  49. package/package.json +17 -13
  50. package/src/{api/entity-types.templates.ts → entity-types.templates.ts} +56 -20
  51. package/src/{api/generation-headers.ts → generation-headers.ts} +19 -15
  52. package/src/{api/generator.ts → generator.ts} +0 -3
  53. package/src/{api/helpers → helpers}/features.ts +13 -12
  54. package/src/{api/helpers → helpers}/imports-tracking.ts +1 -1
  55. package/src/{api/helpers → helpers}/index.ts +0 -2
  56. package/src/{api/helpers → helpers}/primitive-types.ts +4 -4
  57. package/src/{api/index-ts.ts → index-ts.ts} +4 -3
  58. package/src/index.ts +3 -2
  59. package/src/{api/language-file.templates.ts → language-file.templates.ts} +3 -6
  60. package/src/{api/mega-factory.templates.ts → mega-factory.templates.ts} +4 -5
  61. package/src/{api/reflective-layer.templates.ts → reflective-layer.templates.ts} +9 -4
  62. package/dist/api/entity-types.templates.d.ts +0 -5
  63. package/dist/api/entity-types.templates.d.ts.map +0 -1
  64. package/dist/api/entity-types.templates.js.map +0 -1
  65. package/dist/api/generation-headers.d.ts.map +0 -1
  66. package/dist/api/generation-headers.js.map +0 -1
  67. package/dist/api/generator.d.ts.map +0 -1
  68. package/dist/api/generator.js.map +0 -1
  69. package/dist/api/helpers/classifiers.d.ts.map +0 -1
  70. package/dist/api/helpers/classifiers.js.map +0 -1
  71. package/dist/api/helpers/dependencies.d.ts +0 -11
  72. package/dist/api/helpers/dependencies.d.ts.map +0 -1
  73. package/dist/api/helpers/dependencies.js +0 -52
  74. package/dist/api/helpers/dependencies.js.map +0 -1
  75. package/dist/api/helpers/entities.d.ts.map +0 -1
  76. package/dist/api/helpers/entities.js.map +0 -1
  77. package/dist/api/helpers/features.d.ts.map +0 -1
  78. package/dist/api/helpers/features.js.map +0 -1
  79. package/dist/api/helpers/imports-tracking.d.ts.map +0 -1
  80. package/dist/api/helpers/imports-tracking.js.map +0 -1
  81. package/dist/api/helpers/index.d.ts.map +0 -1
  82. package/dist/api/helpers/index.js.map +0 -1
  83. package/dist/api/helpers/mps-annotations.d.ts +0 -19
  84. package/dist/api/helpers/mps-annotations.d.ts.map +0 -1
  85. package/dist/api/helpers/mps-annotations.js +0 -65
  86. package/dist/api/helpers/mps-annotations.js.map +0 -1
  87. package/dist/api/helpers/primitive-types.d.ts.map +0 -1
  88. package/dist/api/helpers/primitive-types.js.map +0 -1
  89. package/dist/api/index-ts.d.ts.map +0 -1
  90. package/dist/api/index-ts.js.map +0 -1
  91. package/dist/api/index.d.ts +0 -5
  92. package/dist/api/index.d.ts.map +0 -1
  93. package/dist/api/index.js +0 -21
  94. package/dist/api/index.js.map +0 -1
  95. package/dist/api/language-file.templates.d.ts.map +0 -1
  96. package/dist/api/language-file.templates.js.map +0 -1
  97. package/dist/api/mega-factory.templates.d.ts +0 -4
  98. package/dist/api/mega-factory.templates.d.ts.map +0 -1
  99. package/dist/api/mega-factory.templates.js.map +0 -1
  100. package/dist/api/reflective-layer.templates.d.ts.map +0 -1
  101. package/dist/api/reflective-layer.templates.js.map +0 -1
  102. package/dist/utils/index.d.ts +0 -3
  103. package/dist/utils/index.d.ts.map +0 -1
  104. package/dist/utils/index.js +0 -19
  105. package/dist/utils/index.js.map +0 -1
  106. package/dist/utils/json-as-ts.d.ts +0 -2
  107. package/dist/utils/json-as-ts.d.ts.map +0 -1
  108. package/dist/utils/json-as-ts.js +0 -18
  109. package/dist/utils/json-as-ts.js.map +0 -1
  110. package/dist/utils/textgen.d.ts +0 -21
  111. package/dist/utils/textgen.d.ts.map +0 -1
  112. package/dist/utils/textgen.js +0 -67
  113. package/dist/utils/textgen.js.map +0 -1
  114. package/src/api/helpers/dependencies.ts +0 -62
  115. package/src/api/helpers/mps-annotations.ts +0 -67
  116. package/src/api/index.ts +0 -21
  117. package/src/utils/index.ts +0 -20
  118. package/src/utils/json-as-ts.ts +0 -20
  119. package/src/utils/textgen.ts +0 -89
  120. /package/dist/{api/helpers → helpers}/classifiers.d.ts +0 -0
  121. /package/dist/{api/helpers → helpers}/classifiers.js +0 -0
  122. /package/dist/{api/helpers → helpers}/entities.d.ts +0 -0
  123. /package/dist/{api/helpers → helpers}/entities.js +0 -0
  124. /package/dist/{api/helpers → helpers}/imports-tracking.d.ts +0 -0
  125. /package/dist/{api/helpers → helpers}/primitive-types.d.ts +0 -0
  126. /package/dist/{api/index-ts.d.ts → index-ts.d.ts} +0 -0
  127. /package/dist/{api/language-file.templates.d.ts → language-file.templates.d.ts} +0 -0
  128. /package/dist/{api/reflective-layer.templates.d.ts → reflective-layer.templates.d.ts} +0 -0
  129. /package/src/{api/helpers → helpers}/classifiers.ts +0 -0
  130. /package/src/{api/helpers → helpers}/entities.ts +0 -0
package/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"
@@ -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
-
@@ -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
-
@@ -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
File without changes
File without changes
File without changes
File without changes
File without changes