@likec4/generators 1.46.3 → 1.46.4
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.
|
@@ -2,7 +2,9 @@ import { RichText } from "@likec4/core/types";
|
|
|
2
2
|
import { CompositeGeneratorNode, joinToNode, NL, toString } from "langium/generate";
|
|
3
3
|
import { isNullish as isNil } from "remeda";
|
|
4
4
|
const capitalizeFirstLetter = (value) => value.charAt(0).toLocaleUpperCase() + value.slice(1);
|
|
5
|
-
const fqnName = (nodeId) =>
|
|
5
|
+
const fqnName = (nodeId) => {
|
|
6
|
+
return nodeId.split(/[.-]/).map(capitalizeFirstLetter).join("");
|
|
7
|
+
};
|
|
6
8
|
const nodeName = (node) => {
|
|
7
9
|
return fqnName(node.parent ? node.id.slice(node.parent.length + 1) : node.id);
|
|
8
10
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/generators",
|
|
3
|
-
"version": "1.46.
|
|
3
|
+
"version": "1.46.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
6
6
|
"homepage": "https://likec4.dev",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"json5": "^2.2.3",
|
|
40
40
|
"langium": "3.5.0",
|
|
41
41
|
"remeda": "^2.32.0",
|
|
42
|
-
"@likec4/core": "1.46.
|
|
42
|
+
"@likec4/core": "1.46.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "~22.19.3",
|
|
@@ -17,7 +17,10 @@ import { isNullish as isNil } from 'remeda'
|
|
|
17
17
|
|
|
18
18
|
const capitalizeFirstLetter = (value: string) => value.charAt(0).toLocaleUpperCase() + value.slice(1)
|
|
19
19
|
|
|
20
|
-
const fqnName = (nodeId: string): string =>
|
|
20
|
+
const fqnName = (nodeId: string): string => {
|
|
21
|
+
// Split on both '.' and '-' to handle dashed identifiers (e.g., payment-gateway -> PaymentGateway)
|
|
22
|
+
return nodeId.split(/[.-]/).map(capitalizeFirstLetter).join('')
|
|
23
|
+
}
|
|
21
24
|
|
|
22
25
|
const nodeName = (node: ComputedNode): string => {
|
|
23
26
|
return fqnName(node.parent ? node.id.slice(node.parent.length + 1) : node.id)
|