@likec4/config 1.48.0 → 1.50.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/README.md +5 -0
- package/dist/THIRD-PARTY-LICENSES.md +41 -0
- package/dist/_chunks/libs/defu.mjs +39 -0
- package/dist/_chunks/libs/remeda.mjs +32 -19
- package/dist/index.d.mts +233 -148
- package/dist/index.mjs +106 -136
- package/dist/node/index.d.mts +234 -149
- package/dist/node/index.mjs +208 -194
- package/package.json +11 -9
- package/schema.json +169 -141
- package/src/filenames.ts +33 -22
- package/src/index.ts +6 -5
- package/src/node/index.ts +1 -38
- package/src/node/load-config.ts +121 -51
- package/src/schema.image-alias.ts +10 -46
- package/src/schema.include.ts +36 -74
- package/src/schema.theme.ts +87 -83
- package/src/schema.ts +76 -35
package/README.md
CHANGED
|
@@ -172,12 +172,17 @@ for (const name of ConfigFilenames) {
|
|
|
172
172
|
## JSON Schema
|
|
173
173
|
|
|
174
174
|
The JSON Schema is published at `@likec4/config/schema.json` and mirrors the Zod schema.
|
|
175
|
+
For JSON configs you can use `extends` to reuse `styles` from other JSON configs.
|
|
176
|
+
Only `styles` are merged (in order), other fields come from the root config.
|
|
175
177
|
|
|
176
178
|
Fields:
|
|
177
179
|
|
|
178
180
|
- `name` (required): unique project id within the workspace
|
|
179
181
|
- `title` (optional): human-readable project title
|
|
180
182
|
- `contactPerson` (optional): maintainer/author
|
|
183
|
+
- `metadata` (optional): arbitrary project-level key-value pairs
|
|
184
|
+
- `extends` (optional): string or array of strings, paths to JSON configs to merge `styles` from (relative to each config file)
|
|
185
|
+
- `styles` (optional): theme/defaults/customCss customization
|
|
181
186
|
- `exclude` (optional): array of glob patterns (picomatch) to exclude (defaults to `['**/node_modules/**']`)
|
|
182
187
|
|
|
183
188
|
## Getting help
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Licenses of Bundled Dependencies
|
|
2
|
+
|
|
3
|
+
The published artifact additionally contains code with the following licenses:
|
|
4
|
+
MIT
|
|
5
|
+
|
|
6
|
+
# Bundled Dependencies
|
|
7
|
+
|
|
8
|
+
## defu
|
|
9
|
+
|
|
10
|
+
License: MIT
|
|
11
|
+
Repository: https://github.com/unjs/defu
|
|
12
|
+
|
|
13
|
+
> MIT License
|
|
14
|
+
>
|
|
15
|
+
> Copyright (c) Pooya Parsa <pooya@pi0.io>
|
|
16
|
+
>
|
|
17
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
18
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
19
|
+
> in the Software without restriction, including without limitation the rights
|
|
20
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
21
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
22
|
+
> furnished to do so, subject to the following conditions:
|
|
23
|
+
>
|
|
24
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
25
|
+
> copies or substantial portions of the Software.
|
|
26
|
+
>
|
|
27
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
30
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
31
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
32
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
|
+
> SOFTWARE.
|
|
34
|
+
|
|
35
|
+
---------------------------------------
|
|
36
|
+
|
|
37
|
+
## remeda
|
|
38
|
+
|
|
39
|
+
License: MIT
|
|
40
|
+
By: Łukasz Sentkiewicz
|
|
41
|
+
Repository: https://github.com/remeda/remeda
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
function isPlainObject(value) {
|
|
2
|
+
if (value === null || typeof value !== "object") return false;
|
|
3
|
+
const prototype = Object.getPrototypeOf(value);
|
|
4
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
|
|
5
|
+
if (Symbol.iterator in value) return false;
|
|
6
|
+
if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
10
|
+
if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
|
|
11
|
+
const object = Object.assign({}, defaults);
|
|
12
|
+
for (const key in baseObject) {
|
|
13
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
14
|
+
const value = baseObject[key];
|
|
15
|
+
if (value === null || value === void 0) continue;
|
|
16
|
+
if (merger && merger(object, key, value, namespace)) continue;
|
|
17
|
+
if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
|
|
18
|
+
else if (isPlainObject(value) && isPlainObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
|
|
19
|
+
else object[key] = value;
|
|
20
|
+
}
|
|
21
|
+
return object;
|
|
22
|
+
}
|
|
23
|
+
function createDefu(merger) {
|
|
24
|
+
return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
|
|
25
|
+
}
|
|
26
|
+
const defu = createDefu();
|
|
27
|
+
createDefu((object, key, currentValue) => {
|
|
28
|
+
if (object[key] !== void 0 && typeof currentValue === "function") {
|
|
29
|
+
object[key] = currentValue(object[key]);
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
createDefu((object, key, currentValue) => {
|
|
34
|
+
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
35
|
+
object[key] = currentValue(object[key]);
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export { defu as t };
|
|
@@ -1,31 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
function e(e, t, n) {
|
|
1
|
+
function e$2(e, t, n) {
|
|
3
2
|
let r = (n) => e(n, ...t);
|
|
4
3
|
return n === void 0 ? r : Object.assign(r, {
|
|
5
4
|
lazy: n,
|
|
6
5
|
lazyArgs: t
|
|
7
6
|
});
|
|
8
7
|
}
|
|
9
|
-
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purry-DH9cw9sy.js
|
|
12
|
-
function t$1(t, n, r) {
|
|
8
|
+
function t$3(t, n, r) {
|
|
13
9
|
let i = t.length - n.length;
|
|
14
10
|
if (i === 0) return t(...n);
|
|
15
|
-
if (i === 1) return e(t, n, r);
|
|
11
|
+
if (i === 1) return e$2(t, n, r);
|
|
16
12
|
throw Error(`Wrong number of arguments`);
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/fromKeys-fsUaiGAg.js
|
|
21
|
-
function t(...t) {
|
|
22
|
-
return t$1(n, t);
|
|
14
|
+
function t$2(...t) {
|
|
15
|
+
return t$3(n$2, t);
|
|
23
16
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return n;
|
|
17
|
+
const n$2 = (e, t) => e.length >= t;
|
|
18
|
+
function e$1(e) {
|
|
19
|
+
return e != null;
|
|
28
20
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
function t$1(...t) {
|
|
22
|
+
return t$3(n$1, t);
|
|
23
|
+
}
|
|
24
|
+
const n$1 = (e) => e.at(-1);
|
|
25
|
+
function n(...t) {
|
|
26
|
+
return t$3(r, t);
|
|
27
|
+
}
|
|
28
|
+
function r(e, n) {
|
|
29
|
+
if (!t$2(n, 1)) return { ...e };
|
|
30
|
+
if (!t$2(n, 2)) {
|
|
31
|
+
let { [n[0]]: t, ...r } = e;
|
|
32
|
+
return r;
|
|
33
|
+
}
|
|
34
|
+
let r = { ...e };
|
|
35
|
+
for (let e of n) delete r[e];
|
|
36
|
+
return r;
|
|
37
|
+
}
|
|
38
|
+
new Set([
|
|
39
|
+
`-`,
|
|
40
|
+
`_`,
|
|
41
|
+
...` .
|
|
42
|
+
.\v.\f.\r. .
.\xA0. . . . . . . . . . . . .\u2028.\u2029. . . .`.split(`.`)
|
|
43
|
+
]);
|
|
44
|
+
export { t$2 as i, t$1 as n, e$1 as r, n as t };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import z from "zod/v4";
|
|
2
2
|
import { LikeC4ProjectStylesConfig, LikeC4ProjectTheme, ProjectId, ThemeColorValues as ThemeColorValues$1, aux } from "@likec4/core/types";
|
|
3
3
|
import { DeploymentElementModel, DeploymentRelationModel, ElementModel, LikeC4Model, LikeC4ViewModel, RelationshipModel } from "@likec4/core/model";
|
|
4
|
-
import { SimplifyDeep } from "type-fest";
|
|
5
4
|
|
|
5
|
+
//#region src/schema.include.d.ts
|
|
6
|
+
declare const IncludeSchema: z.ZodObject<{
|
|
7
|
+
paths: z.ZodArray<z.ZodString>;
|
|
8
|
+
maxDepth: z.ZodDefault<z.ZodNumber>;
|
|
9
|
+
fileThreshold: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
type IncludeConfig = z.infer<typeof IncludeSchema>;
|
|
12
|
+
//#endregion
|
|
6
13
|
//#region src/schema.d.ts
|
|
7
14
|
interface VscodeURI {
|
|
8
15
|
readonly scheme: string;
|
|
@@ -13,64 +20,92 @@ interface VscodeURI {
|
|
|
13
20
|
readonly fragment: string;
|
|
14
21
|
toString(): string;
|
|
15
22
|
}
|
|
16
|
-
declare const ManualLayoutsConfigSchema: z.ZodObject<{
|
|
17
|
-
outDir: z.ZodDefault<z.ZodString>;
|
|
18
|
-
}, z.core.$strict>;
|
|
19
23
|
declare const LikeC4ProjectJsonConfigSchema: z.ZodObject<{
|
|
20
24
|
name: z.ZodString;
|
|
25
|
+
extends: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
21
26
|
title: z.ZodOptional<z.ZodString>;
|
|
22
27
|
contactPerson: z.ZodOptional<z.ZodString>;
|
|
23
|
-
|
|
24
|
-
include: z.ZodOptional<z.ZodObject<{
|
|
25
|
-
paths: z.ZodArray<z.ZodString>;
|
|
26
|
-
maxDepth: z.ZodDefault<z.ZodNumber>;
|
|
27
|
-
fileThreshold: z.ZodDefault<z.ZodNumber>;
|
|
28
|
-
}, z.core.$strict>>;
|
|
28
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
29
29
|
styles: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
30
30
|
theme: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
31
|
-
colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
32
|
+
[x: string]: any;
|
|
33
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>> & z.core.$partial, z.ZodPipe<z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
34
|
+
elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
35
|
+
fill: z.ZodString;
|
|
36
|
+
stroke: z.ZodString;
|
|
37
|
+
hiContrast: z.ZodString;
|
|
38
|
+
loContrast: z.ZodString;
|
|
37
39
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
38
|
-
fill:
|
|
39
|
-
stroke:
|
|
40
|
-
hiContrast:
|
|
41
|
-
loContrast:
|
|
42
|
-
}
|
|
43
|
-
relationships: z.
|
|
44
|
-
line: z.
|
|
45
|
-
label: z.
|
|
46
|
-
labelBg: z.ZodDefault<z.ZodOptional<z.
|
|
40
|
+
fill: string;
|
|
41
|
+
stroke: string;
|
|
42
|
+
hiContrast: string;
|
|
43
|
+
loContrast: string;
|
|
44
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
45
|
+
relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
46
|
+
line: z.ZodString;
|
|
47
|
+
label: z.ZodString;
|
|
48
|
+
labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
47
49
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
48
|
-
line:
|
|
49
|
-
label:
|
|
50
|
-
labelBg:
|
|
51
|
-
}
|
|
52
|
-
}, z.core.$strict
|
|
53
|
-
|
|
50
|
+
line: string;
|
|
51
|
+
label: string;
|
|
52
|
+
labelBg: string;
|
|
53
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
54
|
+
}, z.core.$strict>, z.ZodTransform<any, {
|
|
55
|
+
elements: any;
|
|
56
|
+
relationships: any;
|
|
57
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>>, z.ZodTransform<Record<ThemeColor, ThemeColorValues>, Partial<Record<any, any>>>>>;
|
|
58
|
+
sizes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
59
|
+
[x: string]: any;
|
|
60
|
+
}> & z.core.$partial, z.ZodObject<{
|
|
61
|
+
width: z.ZodNumber;
|
|
62
|
+
height: z.ZodNumber;
|
|
63
|
+
}, z.core.$strict>>>;
|
|
54
64
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
55
65
|
colors?: Record<ThemeColor, ThemeColorValues> | undefined;
|
|
56
|
-
sizes?: any
|
|
66
|
+
sizes?: Partial<Record<any, {
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
}>> | undefined;
|
|
57
70
|
}>>>;
|
|
58
71
|
defaults: z.ZodOptional<z.ZodObject<{
|
|
59
|
-
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<
|
|
72
|
+
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
73
|
+
[x: string]: any;
|
|
74
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
|
|
60
75
|
opacity: z.ZodOptional<z.ZodInt>;
|
|
61
|
-
border: z.ZodOptional<z.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
76
|
+
border: z.ZodOptional<z.ZodEnum<{
|
|
77
|
+
[x: string]: any;
|
|
78
|
+
}>>;
|
|
79
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
80
|
+
[x: string]: any;
|
|
81
|
+
}>>;
|
|
82
|
+
shape: z.ZodOptional<z.ZodEnum<{
|
|
83
|
+
[x: string]: any;
|
|
84
|
+
}>>;
|
|
85
|
+
iconPosition: z.ZodOptional<z.ZodEnum<{
|
|
86
|
+
[x: string]: any;
|
|
87
|
+
}>>;
|
|
65
88
|
group: z.ZodOptional<z.ZodObject<{
|
|
66
|
-
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<
|
|
89
|
+
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
90
|
+
[x: string]: any;
|
|
91
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
|
|
67
92
|
opacity: z.ZodOptional<z.ZodInt>;
|
|
68
|
-
border: z.ZodOptional<z.
|
|
93
|
+
border: z.ZodOptional<z.ZodEnum<{
|
|
94
|
+
[x: string]: any;
|
|
95
|
+
}>>;
|
|
69
96
|
}, z.core.$strict>>;
|
|
70
97
|
relationship: z.ZodOptional<z.ZodObject<{
|
|
71
|
-
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<
|
|
72
|
-
|
|
73
|
-
|
|
98
|
+
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
99
|
+
[x: string]: any;
|
|
100
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
|
|
101
|
+
line: z.ZodOptional<z.ZodEnum<{
|
|
102
|
+
dashed: "dashed";
|
|
103
|
+
solid: "solid";
|
|
104
|
+
dotted: "dotted";
|
|
105
|
+
}>>;
|
|
106
|
+
arrow: z.ZodOptional<z.ZodEnum<{
|
|
107
|
+
[x: string]: any;
|
|
108
|
+
}>>;
|
|
74
109
|
}, z.core.$strict>>;
|
|
75
110
|
}, z.core.$strict>>;
|
|
76
111
|
customCss: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
@@ -96,12 +131,20 @@ declare const LikeC4ProjectJsonConfigSchema: z.ZodObject<{
|
|
|
96
131
|
} | undefined;
|
|
97
132
|
customCss?: string | string[] | undefined;
|
|
98
133
|
}>>>;
|
|
134
|
+
imageAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
135
|
+
include: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
paths: z.ZodArray<z.ZodString>;
|
|
137
|
+
maxDepth: z.ZodDefault<z.ZodNumber>;
|
|
138
|
+
fileThreshold: z.ZodDefault<z.ZodNumber>;
|
|
139
|
+
}, z.core.$strict>>;
|
|
99
140
|
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
100
141
|
manualLayouts: z.ZodOptional<z.ZodObject<{
|
|
101
142
|
outDir: z.ZodDefault<z.ZodString>;
|
|
102
143
|
}, z.core.$strict>>;
|
|
144
|
+
inferTechnologyFromIcon: z.ZodOptional<z.ZodBoolean>;
|
|
145
|
+
implicitViews: z.ZodOptional<z.ZodBoolean>;
|
|
103
146
|
}, z.core.$strip>;
|
|
104
|
-
type LikeC4ProjectJsonConfig =
|
|
147
|
+
type LikeC4ProjectJsonConfig = z.input<typeof LikeC4ProjectJsonConfigSchema>;
|
|
105
148
|
/**
|
|
106
149
|
* Result of the {@link GeneratorFnContext.locate} function
|
|
107
150
|
*/
|
|
@@ -224,128 +267,173 @@ type LikeC4ProjectConfig = z.infer<typeof LikeC4ProjectJsonConfigSchema> & {
|
|
|
224
267
|
*/
|
|
225
268
|
generators?: Record<string, GeneratorFn> | undefined;
|
|
226
269
|
};
|
|
227
|
-
type LikeC4ProjectConfigInput =
|
|
270
|
+
type LikeC4ProjectConfigInput = LikeC4ProjectJsonConfig & {
|
|
228
271
|
generators?: Record<string, GeneratorFn> | undefined;
|
|
229
|
-
}
|
|
272
|
+
};
|
|
230
273
|
/**
|
|
231
|
-
* Validates
|
|
274
|
+
* Validates Object into a LikeC4ProjectConfig object.
|
|
232
275
|
*/
|
|
233
|
-
declare function validateProjectConfig<C extends
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
maxDepth: z.ZodDefault<z.ZodNumber>;
|
|
245
|
-
fileThreshold: z.ZodDefault<z.ZodNumber>;
|
|
246
|
-
}, z.core.$strict>>;
|
|
247
|
-
type LikeC4IncludeConfig = z.infer<typeof IncludeSchema>;
|
|
248
|
-
declare function normalizeIncludeConfig(include?: LikeC4IncludeConfig): IncludeConfig;
|
|
249
|
-
declare function validateIncludePaths(include?: LikeC4IncludeConfig): void;
|
|
276
|
+
declare function validateProjectConfig<C extends Record<string, unknown>>(config: C): LikeC4ProjectConfig;
|
|
277
|
+
/**
|
|
278
|
+
* Parses JSON string into a LikeC4ProjectConfig object.
|
|
279
|
+
* Does not process "extends" - use `loadConfig` function instead
|
|
280
|
+
*/
|
|
281
|
+
declare function parseProjectConfigJSON(config: string): LikeC4ProjectConfig;
|
|
282
|
+
declare const LikeC4ProjectConfigOps: {
|
|
283
|
+
parse: typeof parseProjectConfigJSON;
|
|
284
|
+
validate: typeof validateProjectConfig;
|
|
285
|
+
normalizeInclude: (include: z.input<typeof IncludeSchema> | undefined) => IncludeConfig;
|
|
286
|
+
};
|
|
250
287
|
//#endregion
|
|
251
288
|
//#region src/schema.theme.d.ts
|
|
252
|
-
declare const ThemeColorValuesSchema: z.ZodPipe<z.ZodUnion<
|
|
253
|
-
elements: z.
|
|
254
|
-
fill: z.
|
|
255
|
-
stroke: z.
|
|
256
|
-
hiContrast: z.
|
|
257
|
-
loContrast: z.
|
|
289
|
+
declare const ThemeColorValuesSchema: z.ZodPipe<z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
290
|
+
elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
291
|
+
fill: z.ZodString;
|
|
292
|
+
stroke: z.ZodString;
|
|
293
|
+
hiContrast: z.ZodString;
|
|
294
|
+
loContrast: z.ZodString;
|
|
258
295
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
259
|
-
fill:
|
|
260
|
-
stroke:
|
|
261
|
-
hiContrast:
|
|
262
|
-
loContrast:
|
|
263
|
-
}
|
|
264
|
-
relationships: z.
|
|
265
|
-
line: z.
|
|
266
|
-
label: z.
|
|
267
|
-
labelBg: z.ZodDefault<z.ZodOptional<z.
|
|
296
|
+
fill: string;
|
|
297
|
+
stroke: string;
|
|
298
|
+
hiContrast: string;
|
|
299
|
+
loContrast: string;
|
|
300
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
301
|
+
relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
302
|
+
line: z.ZodString;
|
|
303
|
+
label: z.ZodString;
|
|
304
|
+
labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
268
305
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
269
|
-
line:
|
|
270
|
-
label:
|
|
271
|
-
labelBg:
|
|
272
|
-
}
|
|
273
|
-
}, z.core.$strict
|
|
306
|
+
line: string;
|
|
307
|
+
label: string;
|
|
308
|
+
labelBg: string;
|
|
309
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
310
|
+
}, z.core.$strict>, z.ZodTransform<any, {
|
|
311
|
+
elements: any;
|
|
312
|
+
relationships: any;
|
|
313
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>;
|
|
274
314
|
type ThemeColorValuesInput = z.input<typeof ThemeColorValuesSchema>;
|
|
275
315
|
declare const LikeC4Config_Styles_Theme: z.ZodPipe<z.ZodObject<{
|
|
276
|
-
colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
316
|
+
colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
317
|
+
[x: string]: any;
|
|
318
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>> & z.core.$partial, z.ZodPipe<z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
319
|
+
elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
320
|
+
fill: z.ZodString;
|
|
321
|
+
stroke: z.ZodString;
|
|
322
|
+
hiContrast: z.ZodString;
|
|
323
|
+
loContrast: z.ZodString;
|
|
282
324
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
283
|
-
fill:
|
|
284
|
-
stroke:
|
|
285
|
-
hiContrast:
|
|
286
|
-
loContrast:
|
|
287
|
-
}
|
|
288
|
-
relationships: z.
|
|
289
|
-
line: z.
|
|
290
|
-
label: z.
|
|
291
|
-
labelBg: z.ZodDefault<z.ZodOptional<z.
|
|
325
|
+
fill: string;
|
|
326
|
+
stroke: string;
|
|
327
|
+
hiContrast: string;
|
|
328
|
+
loContrast: string;
|
|
329
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
330
|
+
relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
331
|
+
line: z.ZodString;
|
|
332
|
+
label: z.ZodString;
|
|
333
|
+
labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
292
334
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
293
|
-
line:
|
|
294
|
-
label:
|
|
295
|
-
labelBg:
|
|
296
|
-
}
|
|
297
|
-
}, z.core.$strict
|
|
298
|
-
|
|
335
|
+
line: string;
|
|
336
|
+
label: string;
|
|
337
|
+
labelBg: string;
|
|
338
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
339
|
+
}, z.core.$strict>, z.ZodTransform<any, {
|
|
340
|
+
elements: any;
|
|
341
|
+
relationships: any;
|
|
342
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>>, z.ZodTransform<Record<ThemeColor, ThemeColorValues>, Partial<Record<any, any>>>>>;
|
|
343
|
+
sizes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
344
|
+
[x: string]: any;
|
|
345
|
+
}> & z.core.$partial, z.ZodObject<{
|
|
346
|
+
width: z.ZodNumber;
|
|
347
|
+
height: z.ZodNumber;
|
|
348
|
+
}, z.core.$strict>>>;
|
|
299
349
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
300
350
|
colors?: Record<ThemeColor, ThemeColorValues> | undefined;
|
|
301
|
-
sizes?: any
|
|
351
|
+
sizes?: Partial<Record<any, {
|
|
352
|
+
width: number;
|
|
353
|
+
height: number;
|
|
354
|
+
}>> | undefined;
|
|
302
355
|
}>>;
|
|
303
356
|
type LikeC4ConfigThemeInput = z.input<typeof LikeC4Config_Styles_Theme>;
|
|
304
357
|
declare const LikeC4StylesConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
305
358
|
theme: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
306
|
-
colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
359
|
+
colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
360
|
+
[x: string]: any;
|
|
361
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>> & z.core.$partial, z.ZodPipe<z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
362
|
+
elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
363
|
+
fill: z.ZodString;
|
|
364
|
+
stroke: z.ZodString;
|
|
365
|
+
hiContrast: z.ZodString;
|
|
366
|
+
loContrast: z.ZodString;
|
|
312
367
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
313
|
-
fill:
|
|
314
|
-
stroke:
|
|
315
|
-
hiContrast:
|
|
316
|
-
loContrast:
|
|
317
|
-
}
|
|
318
|
-
relationships: z.
|
|
319
|
-
line: z.
|
|
320
|
-
label: z.
|
|
321
|
-
labelBg: z.ZodDefault<z.ZodOptional<z.
|
|
368
|
+
fill: string;
|
|
369
|
+
stroke: string;
|
|
370
|
+
hiContrast: string;
|
|
371
|
+
loContrast: string;
|
|
372
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
373
|
+
relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
374
|
+
line: z.ZodString;
|
|
375
|
+
label: z.ZodString;
|
|
376
|
+
labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
322
377
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
323
|
-
line:
|
|
324
|
-
label:
|
|
325
|
-
labelBg:
|
|
326
|
-
}
|
|
327
|
-
}, z.core.$strict
|
|
328
|
-
|
|
378
|
+
line: string;
|
|
379
|
+
label: string;
|
|
380
|
+
labelBg: string;
|
|
381
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
382
|
+
}, z.core.$strict>, z.ZodTransform<any, {
|
|
383
|
+
elements: any;
|
|
384
|
+
relationships: any;
|
|
385
|
+
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>>, z.ZodTransform<Record<ThemeColor, ThemeColorValues>, Partial<Record<any, any>>>>>;
|
|
386
|
+
sizes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
387
|
+
[x: string]: any;
|
|
388
|
+
}> & z.core.$partial, z.ZodObject<{
|
|
389
|
+
width: z.ZodNumber;
|
|
390
|
+
height: z.ZodNumber;
|
|
391
|
+
}, z.core.$strict>>>;
|
|
329
392
|
}, z.core.$strict>, z.ZodTransform<any, {
|
|
330
393
|
colors?: Record<ThemeColor, ThemeColorValues> | undefined;
|
|
331
|
-
sizes?: any
|
|
394
|
+
sizes?: Partial<Record<any, {
|
|
395
|
+
width: number;
|
|
396
|
+
height: number;
|
|
397
|
+
}>> | undefined;
|
|
332
398
|
}>>>;
|
|
333
399
|
defaults: z.ZodOptional<z.ZodObject<{
|
|
334
|
-
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<
|
|
400
|
+
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
401
|
+
[x: string]: any;
|
|
402
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
|
|
335
403
|
opacity: z.ZodOptional<z.ZodInt>;
|
|
336
|
-
border: z.ZodOptional<z.
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
404
|
+
border: z.ZodOptional<z.ZodEnum<{
|
|
405
|
+
[x: string]: any;
|
|
406
|
+
}>>;
|
|
407
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
408
|
+
[x: string]: any;
|
|
409
|
+
}>>;
|
|
410
|
+
shape: z.ZodOptional<z.ZodEnum<{
|
|
411
|
+
[x: string]: any;
|
|
412
|
+
}>>;
|
|
413
|
+
iconPosition: z.ZodOptional<z.ZodEnum<{
|
|
414
|
+
[x: string]: any;
|
|
415
|
+
}>>;
|
|
340
416
|
group: z.ZodOptional<z.ZodObject<{
|
|
341
|
-
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<
|
|
417
|
+
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
418
|
+
[x: string]: any;
|
|
419
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
|
|
342
420
|
opacity: z.ZodOptional<z.ZodInt>;
|
|
343
|
-
border: z.ZodOptional<z.
|
|
421
|
+
border: z.ZodOptional<z.ZodEnum<{
|
|
422
|
+
[x: string]: any;
|
|
423
|
+
}>>;
|
|
344
424
|
}, z.core.$strict>>;
|
|
345
425
|
relationship: z.ZodOptional<z.ZodObject<{
|
|
346
|
-
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<
|
|
347
|
-
|
|
348
|
-
|
|
426
|
+
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
427
|
+
[x: string]: any;
|
|
428
|
+
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
|
|
429
|
+
line: z.ZodOptional<z.ZodEnum<{
|
|
430
|
+
dashed: "dashed";
|
|
431
|
+
solid: "solid";
|
|
432
|
+
dotted: "dotted";
|
|
433
|
+
}>>;
|
|
434
|
+
arrow: z.ZodOptional<z.ZodEnum<{
|
|
435
|
+
[x: string]: any;
|
|
436
|
+
}>>;
|
|
349
437
|
}, z.core.$strict>>;
|
|
350
438
|
}, z.core.$strict>>;
|
|
351
439
|
customCss: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
@@ -375,21 +463,18 @@ interface LikeC4StylesConfig extends z.infer<typeof LikeC4StylesConfigSchema> {}
|
|
|
375
463
|
type LikeC4StylesConfigInput = z.input<typeof LikeC4StylesConfigSchema>;
|
|
376
464
|
//#endregion
|
|
377
465
|
//#region src/filenames.d.ts
|
|
378
|
-
|
|
379
|
-
declare const configNonJsonFilenames: readonly ["likec4.config.js", "likec4.config.cjs", "likec4.config.mjs", "likec4.config.ts", "likec4.config.cts", "likec4.config.mts"];
|
|
466
|
+
/** All known LikeC4 config filenames (JSON and non-JSON). */
|
|
380
467
|
declare const ConfigFilenames: readonly [".likec4rc", ".likec4.config.json", "likec4.config.json", "likec4.config.js", "likec4.config.cjs", "likec4.config.mjs", "likec4.config.ts", "likec4.config.cts", "likec4.config.mts"];
|
|
468
|
+
/** Returns true if the **basename** of the given path matches a known config filename. */
|
|
469
|
+
declare function isLikeC4JsonConfig(filename: string): boolean;
|
|
381
470
|
/**
|
|
382
|
-
*
|
|
383
|
-
*/
|
|
384
|
-
declare function isLikeC4JsonConfig(filename: string): filename is typeof configJsonFilenames[number];
|
|
385
|
-
/**
|
|
386
|
-
* Checks if the given filename is a LikeC4 non-JSON config file (JS, MJS, TS, MTS)
|
|
471
|
+
* Returns true if the **basename** of the given path matches a known non-JSON config filename (JS, MJS, TS, MTS).
|
|
387
472
|
*/
|
|
388
|
-
declare function isLikeC4NonJsonConfig(filename: string):
|
|
473
|
+
declare function isLikeC4NonJsonConfig(filename: string): boolean;
|
|
389
474
|
/**
|
|
390
|
-
*
|
|
475
|
+
* Returns true if the **basename** of the given path matches a known LikeC4 config file (JSON or non-JSON).
|
|
391
476
|
*/
|
|
392
|
-
declare function isLikeC4Config(filename: string):
|
|
477
|
+
declare function isLikeC4Config(filename: string): boolean;
|
|
393
478
|
//#endregion
|
|
394
479
|
//#region src/define-config.d.ts
|
|
395
480
|
/**
|
|
@@ -499,4 +584,4 @@ declare function defineTheme<const S extends LikeC4ConfigThemeInput>(theme: S):
|
|
|
499
584
|
*/
|
|
500
585
|
declare function defineStyle<const S extends LikeC4StylesConfigInput>(styles: S): LikeC4ProjectStylesConfig;
|
|
501
586
|
//#endregion
|
|
502
|
-
export { ConfigFilenames, type GeneratorFn, type GeneratorFnContext, type GeneratorFnParams, type IncludeConfig, type LikeC4ProjectConfig, type LikeC4ProjectConfigInput, type LikeC4ProjectJsonConfig, type LikeC4StylesConfig, type LikeC4StylesConfigInput, type LocateResult, type
|
|
587
|
+
export { ConfigFilenames, type GeneratorFn, type GeneratorFnContext, type GeneratorFnParams, type IncludeConfig, type LikeC4ConfigThemeInput, type LikeC4ProjectConfig, type LikeC4ProjectConfigInput, LikeC4ProjectConfigOps, type LikeC4ProjectJsonConfig, type LikeC4StylesConfig, type LikeC4StylesConfigInput, type LocateResult, type ThemeColorValuesInput, defineConfig, defineGenerators, defineStyle, defineTheme, defineThemeColor, isLikeC4Config, isLikeC4JsonConfig, isLikeC4NonJsonConfig };
|