@likec4/generators 0.57.1 → 0.60.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likec4/generators",
3
- "version": "0.57.1",
3
+ "version": "0.60.0",
4
4
  "license": "MIT",
5
5
  "bugs": "https://github.com/likec4/likec4/issues",
6
6
  "homepage": "https://likec4.dev",
@@ -34,18 +34,18 @@
34
34
  "test": "run -T vitest run"
35
35
  },
36
36
  "dependencies": {
37
- "@likec4/core": "0.57.1",
37
+ "@likec4/core": "0.60.0",
38
38
  "json5": "^2.2.3",
39
- "langium": "^2.1.3",
40
- "rambdax": "^9.1.1"
39
+ "langium": "^3.0.0",
40
+ "remeda": "^1.40.1"
41
41
  },
42
42
  "devDependencies": {
43
- "@types/node": "^20.11.17",
43
+ "@types/node": "^20.11.19",
44
44
  "typescript": "^5.3.3",
45
45
  "unbuild": "^2.0.0",
46
- "vitest": "^1.2.2"
46
+ "vitest": "^1.3.1"
47
47
  },
48
- "packageManager": "yarn@4.1.0",
48
+ "packageManager": "yarn@4.1.1",
49
49
  "volta": {
50
50
  "extends": "../../package.json"
51
51
  }
@@ -1,9 +1,8 @@
1
1
  import type { ComputedEdge, ComputedNode, ComputedView, NodeId } from '@likec4/core'
2
- import { CompositeGeneratorNode, NL, joinToNode, toString } from 'langium'
3
- import { isNil } from 'rambdax'
2
+ import { CompositeGeneratorNode, joinToNode, NL, toString } from 'langium/generate'
3
+ import { isNil } from 'remeda'
4
4
 
5
- const capitalizeFirstLetter = (value: string) =>
6
- value.charAt(0).toLocaleUpperCase() + value.slice(1)
5
+ const capitalizeFirstLetter = (value: string) => value.charAt(0).toLocaleUpperCase() + value.slice(1)
7
6
 
8
7
  const fqnName = (nodeId: string): string => nodeId.split('.').map(capitalizeFirstLetter).join('')
9
8
 
@@ -1,9 +1,8 @@
1
1
  import type { ComputedEdge, ComputedNode, ComputedView, NodeId } from '@likec4/core'
2
- import { CompositeGeneratorNode, NL, NLEmpty, expandToNode, joinToNode, toString } from 'langium'
3
- import { isNil } from 'rambdax'
2
+ import { CompositeGeneratorNode, expandToNode, joinToNode, NL, NLEmpty, toString } from 'langium/generate'
3
+ import { isNil } from 'remeda'
4
4
 
5
- const capitalizeFirstLetter = (value: string) =>
6
- value.charAt(0).toLocaleUpperCase() + value.slice(1)
5
+ const capitalizeFirstLetter = (value: string) => value.charAt(0).toLocaleUpperCase() + value.slice(1)
7
6
 
8
7
  const fqnName = (nodeId: string): string => nodeId.split('.').map(capitalizeFirstLetter).join('')
9
8
 
@@ -1,6 +1,6 @@
1
1
  import type { DiagramView } from '@likec4/core'
2
2
  import JSON5 from 'json5'
3
- import { CompositeGeneratorNode, NL, expandToNode, joinToNode, toString } from 'langium'
3
+ import { CompositeGeneratorNode, expandToNode, joinToNode, NL, toString } from 'langium/generate'
4
4
 
5
5
  const componentName = (value: string): string => {
6
6
  if (!value.charAt(0).match(/[a-zA-Z]/)) {
@@ -51,9 +51,11 @@ export function generateReact(views: DiagramView[]) {
51
51
  joinToNode(
52
52
  views,
53
53
  view =>
54
- expandToNode`${JSON5.stringify(view.id)}: (${JSON5.stringify(
55
- view
56
- )} as unknown) as DiagramView`,
54
+ expandToNode`${JSON5.stringify(view.id)}: (${
55
+ JSON5.stringify(
56
+ view
57
+ )
58
+ } as unknown) as DiagramView`,
57
59
  {
58
60
  separator: ',',
59
61
  appendNewLineIfNotEmpty: true
@@ -1,6 +1,6 @@
1
1
  import type { DiagramView } from '@likec4/core'
2
2
  import JSON5 from 'json5'
3
- import { CompositeGeneratorNode, NL, expandToNode, joinToNode, toString } from 'langium'
3
+ import { CompositeGeneratorNode, expandToNode, joinToNode, NL, toString } from 'langium/generate'
4
4
  import { generateViewId } from '../react/generate-react'
5
5
 
6
6
  export function generateViewsDataJs(views: DiagramView[]) {
@@ -78,9 +78,11 @@ export function generateViewsDataTs(views: DiagramView[]) {
78
78
  joinToNode(
79
79
  views,
80
80
  view =>
81
- expandToNode`${JSON5.stringify(view.id)}: (${JSON5.stringify(
82
- view
83
- )} as unknown) as DiagramView`,
81
+ expandToNode`${JSON5.stringify(view.id)}: (${
82
+ JSON5.stringify(
83
+ view
84
+ )
85
+ } as unknown) as DiagramView`,
84
86
  {
85
87
  separator: ',',
86
88
  appendNewLineIfNotEmpty: true