@likec4/core 1.38.1 → 1.39.1
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/dist/builder/index.d.mts +6 -3
- package/dist/builder/index.mjs +55 -111
- package/dist/compute-view/index.d.mts +6 -3
- package/dist/compute-view/index.mjs +33 -34
- package/dist/compute-view/relationships-view/index.d.mts +6 -3
- package/dist/compute-view/relationships-view/index.mjs +6 -6
- package/dist/index.d.mts +8 -5
- package/dist/index.mjs +15 -24
- package/dist/model/connection/deployment/index.d.mts +8 -5
- package/dist/model/connection/deployment/index.mjs +7 -9
- package/dist/model/connection/index.d.mts +10 -7
- package/dist/model/connection/index.mjs +10 -14
- package/dist/model/connection/model/index.d.mts +8 -5
- package/dist/model/connection/model/index.mjs +7 -10
- package/dist/model/index.d.mts +13 -10
- package/dist/model/index.mjs +17 -20
- package/dist/shared/core.20m8Um0g.d.mts +253 -0
- package/dist/shared/{core.CpwrZi3D.mjs → core.4u1dVmfX.mjs} +3 -5
- package/dist/shared/{core.Bp-IQmJR.mjs → core.BB6zA-UU.mjs} +9 -214
- package/dist/shared/{core.BH0VqY-7.mjs → core.BVNaR17u.mjs} +1 -1
- package/dist/shared/{core.BL_xjl90.mjs → core.Be1n9a0i.mjs} +4 -5
- package/dist/shared/{core.BoyJPEen.mjs → core.Be4Jy9Qx.mjs} +2 -2
- package/dist/shared/{core.H8NbNp2X.mjs → core.BqVo8LrH.mjs} +1 -1
- package/dist/shared/{core.DDoAFHHp.mjs → core.BuoXfSMj.mjs} +1 -1
- package/dist/shared/{core.DhDo8LAz.d.mts → core.C7pZp1nR.d.mts} +3 -3
- package/dist/shared/{core.BH9nN-_I.mjs → core.CCD1ID81.mjs} +3 -4
- package/dist/shared/{core.8KM0D6va.mjs → core.CNGyqkJh.mjs} +1 -9
- package/dist/shared/{core.B0oEIXqd.mjs → core.CUw_2J9j.mjs} +1 -1
- package/dist/shared/{core.C4Cn4Jy_.mjs → core.CWv15GLo.mjs} +11 -15
- package/dist/shared/{core.Bf5zKDK1.d.mts → core.CXCmvCws.d.mts} +2 -2
- package/dist/shared/core.CaT0SUUK.mjs +201 -0
- package/dist/shared/{core.Dtw1SBlz.d.mts → core.ClpXZ4Ib.d.mts} +3 -3
- package/dist/shared/{core.DC6zzxS0.mjs → core.CsbOakly.mjs} +13 -22
- package/dist/shared/{core.Btl47GOn.mjs → core.DLpidoWc.mjs} +2 -2
- package/dist/shared/{core.wwaSalox.d.mts → core.DM3vdkO_.d.mts} +1 -1
- package/dist/shared/core.DXhDWKFZ.d.mts +3 -0
- package/dist/shared/{core.O6FG0HF9.d.mts → core.DdzRtJ9d.d.mts} +1 -1
- package/dist/shared/{core.OUoo2ohq.mjs → core.DgttqsJc.mjs} +5 -9
- package/dist/shared/{core.Dhc0yIwT.mjs → core.DlG1xWt2.mjs} +3 -43
- package/dist/shared/core.DnRszv-l.mjs +11982 -0
- package/dist/shared/core.DoM6aM9N.mjs +7 -0
- package/dist/shared/{core.CzHQRs5x.mjs → core.DozSPE83.mjs} +43 -60
- package/dist/shared/{core.DsMrjY2q.mjs → core.GTgsmXS_.mjs} +2 -2
- package/dist/shared/core.ILwny7BV.mjs +38 -0
- package/dist/shared/core.PHwHXzkG.d.mts +213 -0
- package/dist/shared/core.T-eLZTW_.mjs +59 -0
- package/dist/shared/{core.CE_hG7EJ.d.mts → core.aWJgARyY.d.mts} +10 -486
- package/dist/shared/{core.BvlHvikl.d.mts → core.v1iEaXaR.d.mts} +5 -3
- package/dist/shared/core.yHe79zEl.mjs +98 -0
- package/dist/theme/index.d.mts +3 -126
- package/dist/theme/index.mjs +2 -3
- package/dist/types/_aux.d.mts +1 -1
- package/dist/types/expression-model.d.mts +191 -0
- package/dist/types/expression-model.mjs +112 -0
- package/dist/types/expression.d.mts +7 -0
- package/dist/types/expression.mjs +116 -0
- package/dist/types/fqnRef.d.mts +61 -0
- package/dist/types/fqnRef.mjs +46 -0
- package/dist/types/index.d.mts +6 -3
- package/dist/types/index.mjs +9 -9
- package/dist/types/scalar.mjs +2 -3
- package/dist/utils/index.d.mts +6 -428
- package/dist/utils/index.mjs +56 -15
- package/dist/utils/iterable/index.d.mts +2 -3
- package/dist/utils/iterable/index.mjs +9 -44
- package/package.json +8 -7
- package/src/index.ts +24 -1
- package/src/model/RelationModel.ts +1 -1
- package/src/model/index.ts +1 -1
- package/src/theme/element.ts +2 -2
- package/src/theme/relationships.ts +2 -2
- package/src/types/RichText.ts +1 -1
- package/src/types/expression-model.ts +3 -1
- package/src/types/expression.ts +3 -1
- package/src/types/fqnRef.ts +4 -1
- package/src/utils/guards.ts +0 -1
- package/src/utils/index.ts +0 -1
- package/dist/shared/core.BW8K1y6R.mjs +0 -278
- package/dist/shared/core.BgvIuGGU.mjs +0 -3
- package/dist/shared/core.BpJu1RrF.mjs +0 -5
- package/dist/shared/core.ByrmCl9I.mjs +0 -5
- package/dist/shared/core.CnIyafWn.mjs +0 -3
- package/dist/shared/core.DK6I-Nr7.mjs +0 -149
- package/dist/shared/core.DbRvwARP.mjs +0 -5
- package/dist/shared/core.Dw47t7nG.mjs +0 -5236
- package/dist/shared/core.zLlww-07.mjs +0 -3
- package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +0 -425
- package/src/builder/__snapshots__/Builder-style2.compute-model.json5 +0 -318
- package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +0 -221
- package/src/compute-view/deployment-view/__test__/TestHelper.ts +0 -249
- package/src/compute-view/deployment-view/__test__/fixture.ts +0 -238
- package/src/compute-view/dynamic-view/__test__/fixture.ts +0 -67
- package/src/compute-view/element-view/__test__/TestHelper.ts +0 -282
- package/src/compute-view/element-view/__test__/__snapshots__/legacy.spec.ts.snap +0 -458
- package/src/compute-view/element-view/__test__/fixture.ts +0 -749
- package/src/compute-view/utils/__snapshots__/sortNodes.spec.ts.snap +0 -113
- package/src/model/__test__/fixture.ts +0 -168
- package/src/theme/__test__/theme-index.ts +0 -29
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
-
|
|
3
|
-
exports[`sortNodes > should generate valid testnodes 1`] = `
|
|
4
|
-
{
|
|
5
|
-
"edges": [
|
|
6
|
-
{
|
|
7
|
-
"id": "cloud.frontend.ui:cloud.backend",
|
|
8
|
-
"parent": "cloud",
|
|
9
|
-
"source": "cloud.frontend.ui",
|
|
10
|
-
"target": "cloud.backend",
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"id": "cloud.backend:cloud.db",
|
|
14
|
-
"parent": "cloud",
|
|
15
|
-
"source": "cloud.backend",
|
|
16
|
-
"target": "cloud.db",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"id": "cloud.db:amazon",
|
|
20
|
-
"parent": null,
|
|
21
|
-
"source": "cloud.db",
|
|
22
|
-
"target": "amazon",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"id": "customer:cloud.frontend.ui",
|
|
26
|
-
"parent": null,
|
|
27
|
-
"source": "customer",
|
|
28
|
-
"target": "cloud.frontend.ui",
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
"nodes": [
|
|
32
|
-
{
|
|
33
|
-
"children": [],
|
|
34
|
-
"id": "customer",
|
|
35
|
-
"inEdges": [],
|
|
36
|
-
"outEdges": [
|
|
37
|
-
"customer:cloud.frontend.ui",
|
|
38
|
-
],
|
|
39
|
-
"parent": null,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"children": [],
|
|
43
|
-
"id": "amazon",
|
|
44
|
-
"inEdges": [
|
|
45
|
-
"cloud.db:amazon",
|
|
46
|
-
],
|
|
47
|
-
"outEdges": [],
|
|
48
|
-
"parent": null,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"children": [
|
|
52
|
-
"cloud.frontend.ui",
|
|
53
|
-
],
|
|
54
|
-
"id": "cloud.frontend",
|
|
55
|
-
"inEdges": [
|
|
56
|
-
"customer:cloud.frontend.ui",
|
|
57
|
-
],
|
|
58
|
-
"outEdges": [
|
|
59
|
-
"cloud.frontend.ui:cloud.backend",
|
|
60
|
-
],
|
|
61
|
-
"parent": "cloud",
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"children": [],
|
|
65
|
-
"id": "cloud.frontend.ui",
|
|
66
|
-
"inEdges": [
|
|
67
|
-
"customer:cloud.frontend.ui",
|
|
68
|
-
],
|
|
69
|
-
"outEdges": [
|
|
70
|
-
"cloud.frontend.ui:cloud.backend",
|
|
71
|
-
],
|
|
72
|
-
"parent": "cloud.frontend",
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"children": [
|
|
76
|
-
"cloud.frontend",
|
|
77
|
-
"cloud.db",
|
|
78
|
-
"cloud.backend",
|
|
79
|
-
],
|
|
80
|
-
"id": "cloud",
|
|
81
|
-
"inEdges": [
|
|
82
|
-
"customer:cloud.frontend.ui",
|
|
83
|
-
],
|
|
84
|
-
"outEdges": [
|
|
85
|
-
"cloud.db:amazon",
|
|
86
|
-
],
|
|
87
|
-
"parent": null,
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"children": [],
|
|
91
|
-
"id": "cloud.db",
|
|
92
|
-
"inEdges": [
|
|
93
|
-
"cloud.backend:cloud.db",
|
|
94
|
-
],
|
|
95
|
-
"outEdges": [
|
|
96
|
-
"cloud.db:amazon",
|
|
97
|
-
],
|
|
98
|
-
"parent": "cloud",
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"children": [],
|
|
102
|
-
"id": "cloud.backend",
|
|
103
|
-
"inEdges": [
|
|
104
|
-
"cloud.frontend.ui:cloud.backend",
|
|
105
|
-
],
|
|
106
|
-
"outEdges": [
|
|
107
|
-
"cloud.backend:cloud.db",
|
|
108
|
-
],
|
|
109
|
-
"parent": "cloud",
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
}
|
|
113
|
-
`;
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { Builder } from '../../builder/Builder'
|
|
2
|
-
import { computeParsedModelData } from '../../compute-view/compute-view'
|
|
3
|
-
import { LikeC4Model } from '../LikeC4Model'
|
|
4
|
-
|
|
5
|
-
const {
|
|
6
|
-
builder: b,
|
|
7
|
-
model: {
|
|
8
|
-
person,
|
|
9
|
-
system,
|
|
10
|
-
component,
|
|
11
|
-
webapp,
|
|
12
|
-
mobile,
|
|
13
|
-
...$m
|
|
14
|
-
},
|
|
15
|
-
deployment: {
|
|
16
|
-
deployment,
|
|
17
|
-
env,
|
|
18
|
-
node,
|
|
19
|
-
zone,
|
|
20
|
-
instanceOf,
|
|
21
|
-
...$d
|
|
22
|
-
},
|
|
23
|
-
views: {
|
|
24
|
-
view,
|
|
25
|
-
views,
|
|
26
|
-
viewOf,
|
|
27
|
-
deploymentView,
|
|
28
|
-
$rules,
|
|
29
|
-
$include,
|
|
30
|
-
},
|
|
31
|
-
} = Builder.forSpecification({
|
|
32
|
-
elements: {
|
|
33
|
-
person: {
|
|
34
|
-
style: {
|
|
35
|
-
shape: 'person',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
system: {},
|
|
39
|
-
component: {},
|
|
40
|
-
webapp: {
|
|
41
|
-
tags: ['internal'],
|
|
42
|
-
style: {
|
|
43
|
-
shape: 'browser',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
mobile: {
|
|
47
|
-
style: {
|
|
48
|
-
shape: 'mobile',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
tags: {
|
|
53
|
-
internal: {},
|
|
54
|
-
external: {},
|
|
55
|
-
tag1: {},
|
|
56
|
-
tag2: {},
|
|
57
|
-
},
|
|
58
|
-
deployments: {
|
|
59
|
-
env: {},
|
|
60
|
-
zone: {},
|
|
61
|
-
node: {},
|
|
62
|
-
},
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
const local = b
|
|
66
|
-
.with(
|
|
67
|
-
$m.model(
|
|
68
|
-
person('customer'),
|
|
69
|
-
system('cloud').with(
|
|
70
|
-
component('frontend').with(
|
|
71
|
-
webapp('dashboard', {
|
|
72
|
-
tags: ['tag1'],
|
|
73
|
-
}),
|
|
74
|
-
mobile('mobile'),
|
|
75
|
-
),
|
|
76
|
-
component('auth'),
|
|
77
|
-
component('backend').with(
|
|
78
|
-
component('api'),
|
|
79
|
-
component('graphql'),
|
|
80
|
-
),
|
|
81
|
-
component('media', {
|
|
82
|
-
tags: ['tag2'],
|
|
83
|
-
shape: 'storage',
|
|
84
|
-
}),
|
|
85
|
-
),
|
|
86
|
-
system('aws').with(
|
|
87
|
-
component('rds', {
|
|
88
|
-
tags: ['tag2'],
|
|
89
|
-
shape: 'storage',
|
|
90
|
-
}),
|
|
91
|
-
component('s3', {
|
|
92
|
-
tags: ['tag2'],
|
|
93
|
-
shape: 'storage',
|
|
94
|
-
}),
|
|
95
|
-
),
|
|
96
|
-
system('email', {
|
|
97
|
-
tags: ['external'],
|
|
98
|
-
}),
|
|
99
|
-
),
|
|
100
|
-
$m.model(
|
|
101
|
-
$m.rel('customer', 'cloud', 'uses services'),
|
|
102
|
-
$m.rel('customer', 'cloud.frontend.mobile', 'opens mobile app'),
|
|
103
|
-
$m.rel('customer', 'cloud.frontend.dashboard', 'opens in browser'),
|
|
104
|
-
$m.rel('cloud.frontend.dashboard', 'cloud.auth', 'authenticates'),
|
|
105
|
-
$m.rel('cloud.frontend.dashboard', 'cloud.backend.api', 'fetches data'),
|
|
106
|
-
$m.rel('cloud.frontend.dashboard', 'cloud.media', 'fetches media'),
|
|
107
|
-
$m.rel('cloud.frontend.mobile', 'cloud.auth', 'authenticates'),
|
|
108
|
-
$m.rel('cloud.frontend.mobile', 'cloud.backend.api', 'fetches data'),
|
|
109
|
-
$m.rel('cloud.frontend.mobile', 'cloud.media', 'fetches media'),
|
|
110
|
-
$m.rel('cloud.frontend', 'cloud.backend'),
|
|
111
|
-
),
|
|
112
|
-
$m.model(
|
|
113
|
-
$m.rel('cloud.backend.api', 'cloud.auth', 'authorizes'),
|
|
114
|
-
$m.rel('cloud.backend.api', 'cloud.media', 'uploads media'),
|
|
115
|
-
$m.rel('cloud.backend.api', 'aws.rds', 'reads/writes'),
|
|
116
|
-
$m.rel('cloud.backend.api', 'email', 'sends emails'),
|
|
117
|
-
$m.rel('cloud', 'email', 'uses'),
|
|
118
|
-
$m.rel('cloud.media', 'aws.s3', 'uploads'),
|
|
119
|
-
$m.rel('email', 'customer', 'sends emails'),
|
|
120
|
-
),
|
|
121
|
-
deployment(
|
|
122
|
-
node('customer').with(
|
|
123
|
-
instanceOf('instance', 'customer'),
|
|
124
|
-
),
|
|
125
|
-
env('prod').with(
|
|
126
|
-
zone('eu').with(
|
|
127
|
-
zone('zone1').with(
|
|
128
|
-
instanceOf('ui', 'cloud.frontend.dashboard'),
|
|
129
|
-
instanceOf('api', 'cloud.backend.api'),
|
|
130
|
-
),
|
|
131
|
-
zone('zone2').with(
|
|
132
|
-
instanceOf('ui', 'cloud.frontend.dashboard'),
|
|
133
|
-
instanceOf('api', 'cloud.backend.api'),
|
|
134
|
-
),
|
|
135
|
-
instanceOf('media', 'cloud.media'),
|
|
136
|
-
instanceOf('db', 'aws.rds'),
|
|
137
|
-
),
|
|
138
|
-
zone('us').with(
|
|
139
|
-
instanceOf('db', 'aws.rds'),
|
|
140
|
-
),
|
|
141
|
-
),
|
|
142
|
-
$d.rel('prod.eu.db', 'prod.us.db', 'replicates'),
|
|
143
|
-
),
|
|
144
|
-
views(
|
|
145
|
-
view('index', $include('*')),
|
|
146
|
-
viewOf(
|
|
147
|
-
'cloud',
|
|
148
|
-
'cloud',
|
|
149
|
-
$rules(
|
|
150
|
-
$include('*'),
|
|
151
|
-
$include('cloud.frontend.dashboard'),
|
|
152
|
-
),
|
|
153
|
-
),
|
|
154
|
-
deploymentView('prod').with(
|
|
155
|
-
$include('customer.instance'),
|
|
156
|
-
$include('prod.eu.zone1.ui'),
|
|
157
|
-
),
|
|
158
|
-
),
|
|
159
|
-
)
|
|
160
|
-
|
|
161
|
-
export const builder = local.clone()
|
|
162
|
-
|
|
163
|
-
export const parsed = local.build()
|
|
164
|
-
export type TestFqn = typeof local.Types.Fqn
|
|
165
|
-
|
|
166
|
-
export const computed = computeParsedModelData(parsed)
|
|
167
|
-
|
|
168
|
-
export const model = LikeC4Model.create(computed)
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { HexColor } from "../../types";
|
|
2
|
-
|
|
3
|
-
export const lightValue = {
|
|
4
|
-
elements: {
|
|
5
|
-
fill: "#2ec2fb" as HexColor,
|
|
6
|
-
stroke: "#1fabe1" as HexColor,
|
|
7
|
-
hiContrast: "#00002d" as HexColor,
|
|
8
|
-
loContrast: "#00153d" as HexColor,
|
|
9
|
-
},
|
|
10
|
-
relationships: {
|
|
11
|
-
lineColor: "#4ccdfb" as HexColor,
|
|
12
|
-
labelColor: "#6fd8fc" as HexColor,
|
|
13
|
-
labelBgColor: "#0084b2" as HexColor,
|
|
14
|
-
},
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const darkValue = {
|
|
18
|
-
elements: {
|
|
19
|
-
fill: "#2c40dc" as HexColor,
|
|
20
|
-
stroke: "#1f32c4" as HexColor,
|
|
21
|
-
hiContrast: "#ffffff" as HexColor,
|
|
22
|
-
loContrast: "#fffeff" as HexColor,
|
|
23
|
-
},
|
|
24
|
-
relationships: {
|
|
25
|
-
lineColor: "#5362e1" as HexColor,
|
|
26
|
-
labelColor: "#7a87e9" as HexColor,
|
|
27
|
-
labelBgColor: "#0a259c" as HexColor,
|
|
28
|
-
},
|
|
29
|
-
}
|