@likec4/config 1.58.0 → 1.59.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/dist/chunks/index.d.mts +596 -0
- package/dist/chunks/rolldown-runtime.mjs +1 -0
- package/dist/chunks/src.mjs +17 -0
- package/dist/index.d.mts +1 -595
- package/dist/index.mjs +1 -421
- package/dist/node/index.d.mts +2 -595
- package/dist/node/index.mjs +2 -537
- package/package.json +14 -14
- package/src/node/load-config.ts +1 -1
- package/dist/THIRD-PARTY-LICENSES.md +0 -41
- package/dist/_chunks/libs/defu.mjs +0 -29
- package/dist/_chunks/libs/remeda.mjs +0 -56
package/dist/index.d.mts
CHANGED
|
@@ -1,596 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { LikeC4ProjectStylesConfig, LikeC4ProjectTheme, ProjectId, ThemeColorValues as ThemeColorValues$1, aux } from "@likec4/core/types";
|
|
3
|
-
import { DeploymentElementModel, DeploymentRelationModel, ElementModel, LikeC4Model, LikeC4ViewModel, RelationshipModel } from "@likec4/core/model";
|
|
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
|
|
13
|
-
//#region src/schema.d.ts
|
|
14
|
-
interface VscodeURI {
|
|
15
|
-
readonly scheme: string;
|
|
16
|
-
readonly authority: string;
|
|
17
|
-
readonly path: string;
|
|
18
|
-
readonly fsPath: string;
|
|
19
|
-
readonly query: string;
|
|
20
|
-
readonly fragment: string;
|
|
21
|
-
toString(): string;
|
|
22
|
-
}
|
|
23
|
-
declare const LikeC4ProjectJsonConfigSchema: z.ZodObject<{
|
|
24
|
-
name: z.ZodString;
|
|
25
|
-
extends: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
26
|
-
title: z.ZodOptional<z.ZodString>;
|
|
27
|
-
contactPerson: z.ZodOptional<z.ZodString>;
|
|
28
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
29
|
-
styles: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
30
|
-
theme: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
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;
|
|
39
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
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>>;
|
|
49
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
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>>>;
|
|
64
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
65
|
-
colors?: Record<ThemeColor, ThemeColorValues> | undefined;
|
|
66
|
-
sizes?: Partial<Record<any, {
|
|
67
|
-
width: number;
|
|
68
|
-
height: number;
|
|
69
|
-
}>> | undefined;
|
|
70
|
-
}>>>;
|
|
71
|
-
defaults: z.ZodOptional<z.ZodObject<{
|
|
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>>>;
|
|
75
|
-
opacity: z.ZodOptional<z.ZodInt>;
|
|
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
|
-
}>>;
|
|
88
|
-
group: z.ZodOptional<z.ZodObject<{
|
|
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>>>;
|
|
92
|
-
opacity: z.ZodOptional<z.ZodInt>;
|
|
93
|
-
border: z.ZodOptional<z.ZodEnum<{
|
|
94
|
-
[x: string]: any;
|
|
95
|
-
}>>;
|
|
96
|
-
}, z.core.$strict>>;
|
|
97
|
-
relationship: z.ZodOptional<z.ZodObject<{
|
|
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
|
-
}>>;
|
|
109
|
-
}, z.core.$strict>>;
|
|
110
|
-
}, z.core.$strict>>;
|
|
111
|
-
customCss: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
112
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
113
|
-
theme?: any;
|
|
114
|
-
defaults?: {
|
|
115
|
-
color?: any;
|
|
116
|
-
opacity?: number | undefined;
|
|
117
|
-
border?: any;
|
|
118
|
-
size?: any;
|
|
119
|
-
shape?: any;
|
|
120
|
-
iconPosition?: any;
|
|
121
|
-
group?: {
|
|
122
|
-
color?: any;
|
|
123
|
-
opacity?: number | undefined;
|
|
124
|
-
border?: any;
|
|
125
|
-
} | undefined;
|
|
126
|
-
relationship?: {
|
|
127
|
-
color?: any;
|
|
128
|
-
line?: "dashed" | "solid" | "dotted" | undefined;
|
|
129
|
-
arrow?: any;
|
|
130
|
-
} | undefined;
|
|
131
|
-
} | undefined;
|
|
132
|
-
customCss?: string | string[] | undefined;
|
|
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>>;
|
|
140
|
-
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
141
|
-
manualLayouts: z.ZodOptional<z.ZodObject<{
|
|
142
|
-
outDir: z.ZodDefault<z.ZodString>;
|
|
143
|
-
}, z.core.$strict>>;
|
|
144
|
-
inferTechnologyFromIcon: z.ZodOptional<z.ZodBoolean>;
|
|
145
|
-
implicitViews: z.ZodOptional<z.ZodBoolean>;
|
|
146
|
-
landingPage: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
147
|
-
redirect: z.ZodLiteral<true>;
|
|
148
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
149
|
-
include: z.ZodArray<z.ZodString>;
|
|
150
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
151
|
-
exclude: z.ZodArray<z.ZodString>;
|
|
152
|
-
}, z.core.$strict>]>>;
|
|
153
|
-
}, z.core.$strip>;
|
|
154
|
-
type LikeC4ProjectJsonConfig = z.input<typeof LikeC4ProjectJsonConfigSchema>;
|
|
155
|
-
/**
|
|
156
|
-
* Result of the {@link GeneratorFnContext.locate} function
|
|
157
|
-
*/
|
|
158
|
-
type LocateResult = {
|
|
159
|
-
/**
|
|
160
|
-
* Range inside the source file
|
|
161
|
-
*/
|
|
162
|
-
range: {
|
|
163
|
-
start: {
|
|
164
|
-
line: number;
|
|
165
|
-
character: number;
|
|
166
|
-
};
|
|
167
|
-
end: {
|
|
168
|
-
line: number;
|
|
169
|
-
character: number;
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
/**
|
|
173
|
-
* Full path to the source file
|
|
174
|
-
*/
|
|
175
|
-
document: VscodeURI;
|
|
176
|
-
/**
|
|
177
|
-
* Document path relative to the project folder
|
|
178
|
-
*/
|
|
179
|
-
relativePath: string;
|
|
180
|
-
/**
|
|
181
|
-
* Folder, containing the source file ("dirname" of document)
|
|
182
|
-
*/
|
|
183
|
-
folder: string;
|
|
184
|
-
/**
|
|
185
|
-
* Source file name ("basename" of document)
|
|
186
|
-
*/
|
|
187
|
-
filename: string;
|
|
188
|
-
};
|
|
189
|
-
interface GeneratorFnContext {
|
|
190
|
-
/**
|
|
191
|
-
* Workspace root directory
|
|
192
|
-
*/
|
|
193
|
-
readonly workspace: VscodeURI;
|
|
194
|
-
/**
|
|
195
|
-
* Current project
|
|
196
|
-
*/
|
|
197
|
-
readonly project: {
|
|
198
|
-
/**
|
|
199
|
-
* Project name
|
|
200
|
-
*/
|
|
201
|
-
readonly id: ProjectId;
|
|
202
|
-
readonly title?: string;
|
|
203
|
-
/**
|
|
204
|
-
* Project folder
|
|
205
|
-
*/
|
|
206
|
-
readonly folder: VscodeURI;
|
|
207
|
-
};
|
|
208
|
-
/**
|
|
209
|
-
* Returns the location of the specified element, relation, view or deployment element
|
|
210
|
-
*/
|
|
211
|
-
locate(target: ElementModel | RelationshipModel | DeploymentRelationModel | LikeC4ViewModel | DeploymentElementModel): LocateResult;
|
|
212
|
-
/**
|
|
213
|
-
* Write a file
|
|
214
|
-
* @param path - Path to the file, either absolute or relative to the project folder
|
|
215
|
-
* All folders will be created automatically
|
|
216
|
-
* @param content - Content of the file
|
|
217
|
-
*/
|
|
218
|
-
write(file: {
|
|
219
|
-
path: string | string[] | VscodeURI;
|
|
220
|
-
content: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | NodeJS.ReadableStream;
|
|
221
|
-
}): Promise<void>;
|
|
222
|
-
/**
|
|
223
|
-
* Abort the process
|
|
224
|
-
*/
|
|
225
|
-
abort(reason?: string): never;
|
|
226
|
-
}
|
|
227
|
-
type GeneratorFnParams = {
|
|
228
|
-
/**
|
|
229
|
-
* LikeC4 model
|
|
230
|
-
*/
|
|
231
|
-
likec4model: LikeC4Model<aux.UnknownLayouted>;
|
|
232
|
-
/**
|
|
233
|
-
* Generator context
|
|
234
|
-
*/
|
|
235
|
-
ctx: GeneratorFnContext;
|
|
236
|
-
};
|
|
237
|
-
interface GeneratorFn {
|
|
238
|
-
(params: GeneratorFnParams): Promise<void> | void;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* LikeC4 project configuration
|
|
242
|
-
*
|
|
243
|
-
* @example
|
|
244
|
-
* ```ts
|
|
245
|
-
* export default defineConfig({
|
|
246
|
-
* name: 'my-project',
|
|
247
|
-
* generators: {
|
|
248
|
-
* 'my-generator': async ({ likec4model, ctx }) => {
|
|
249
|
-
* await ctx.write('my-generator.txt', likec4model.project.id)
|
|
250
|
-
* }
|
|
251
|
-
* }
|
|
252
|
-
* })
|
|
253
|
-
* ```
|
|
254
|
-
*/
|
|
255
|
-
type LikeC4ProjectConfig = z.infer<typeof LikeC4ProjectJsonConfigSchema> & {
|
|
256
|
-
/**
|
|
257
|
-
* Add custom generators to the project
|
|
258
|
-
* @example
|
|
259
|
-
* ```ts
|
|
260
|
-
* export default defineConfig({
|
|
261
|
-
* name: 'my-project',
|
|
262
|
-
* generators: {
|
|
263
|
-
* 'my-generator': async ({ likec4model, ctx }) => {
|
|
264
|
-
* await ctx.write('my-generator.txt', likec4model.project.id)
|
|
265
|
-
* }
|
|
266
|
-
* }
|
|
267
|
-
* })
|
|
268
|
-
* ```
|
|
269
|
-
*
|
|
270
|
-
* Execute generator:
|
|
271
|
-
* ```bash
|
|
272
|
-
* likec4 gen my-generator
|
|
273
|
-
* ```
|
|
274
|
-
*/
|
|
275
|
-
generators?: Record<string, GeneratorFn> | undefined;
|
|
276
|
-
};
|
|
277
|
-
type LikeC4ProjectConfigInput = LikeC4ProjectJsonConfig & {
|
|
278
|
-
generators?: Record<string, GeneratorFn> | undefined;
|
|
279
|
-
};
|
|
280
|
-
/**
|
|
281
|
-
* Validates Object into a LikeC4ProjectConfig object.
|
|
282
|
-
* Zod v4 can strip optional union keys (e.g. landingPage) from parse output;
|
|
283
|
-
* we validate landingPage once with LandingPageSchema and merge onto the result.
|
|
284
|
-
*/
|
|
285
|
-
declare function validateProjectConfig<C extends Record<string, unknown>>(config: C): LikeC4ProjectConfig;
|
|
286
|
-
/**
|
|
287
|
-
* Parses JSON string into a LikeC4ProjectConfig object.
|
|
288
|
-
* Does not process "extends" - use `loadConfig` function instead
|
|
289
|
-
*/
|
|
290
|
-
declare function parseProjectConfigJSON(config: string): LikeC4ProjectConfig;
|
|
291
|
-
declare const LikeC4ProjectConfigOps: {
|
|
292
|
-
parse: typeof parseProjectConfigJSON;
|
|
293
|
-
validate: typeof validateProjectConfig;
|
|
294
|
-
normalizeInclude: (include: z.input<typeof IncludeSchema> | undefined) => IncludeConfig;
|
|
295
|
-
};
|
|
296
|
-
//#endregion
|
|
297
|
-
//#region src/schema.theme.d.ts
|
|
298
|
-
declare const ThemeColorValuesSchema: z.ZodPipe<z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
299
|
-
elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
300
|
-
fill: z.ZodString;
|
|
301
|
-
stroke: z.ZodString;
|
|
302
|
-
hiContrast: z.ZodString;
|
|
303
|
-
loContrast: z.ZodString;
|
|
304
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
305
|
-
fill: string;
|
|
306
|
-
stroke: string;
|
|
307
|
-
hiContrast: string;
|
|
308
|
-
loContrast: string;
|
|
309
|
-
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
310
|
-
relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
311
|
-
line: z.ZodString;
|
|
312
|
-
label: z.ZodString;
|
|
313
|
-
labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
314
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
315
|
-
line: string;
|
|
316
|
-
label: string;
|
|
317
|
-
labelBg: string;
|
|
318
|
-
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
319
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
320
|
-
elements: any;
|
|
321
|
-
relationships: any;
|
|
322
|
-
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>;
|
|
323
|
-
type ThemeColorValuesInput = z.input<typeof ThemeColorValuesSchema>;
|
|
324
|
-
declare const LikeC4Config_Styles_Theme: z.ZodPipe<z.ZodObject<{
|
|
325
|
-
colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
326
|
-
[x: string]: any;
|
|
327
|
-
}>, 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<{
|
|
328
|
-
elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
329
|
-
fill: z.ZodString;
|
|
330
|
-
stroke: z.ZodString;
|
|
331
|
-
hiContrast: z.ZodString;
|
|
332
|
-
loContrast: z.ZodString;
|
|
333
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
334
|
-
fill: string;
|
|
335
|
-
stroke: string;
|
|
336
|
-
hiContrast: string;
|
|
337
|
-
loContrast: string;
|
|
338
|
-
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
339
|
-
relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
340
|
-
line: z.ZodString;
|
|
341
|
-
label: z.ZodString;
|
|
342
|
-
labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
343
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
344
|
-
line: string;
|
|
345
|
-
label: string;
|
|
346
|
-
labelBg: string;
|
|
347
|
-
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
348
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
349
|
-
elements: any;
|
|
350
|
-
relationships: any;
|
|
351
|
-
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>>, z.ZodTransform<Record<ThemeColor, ThemeColorValues>, Partial<Record<any, any>>>>>;
|
|
352
|
-
sizes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
353
|
-
[x: string]: any;
|
|
354
|
-
}> & z.core.$partial, z.ZodObject<{
|
|
355
|
-
width: z.ZodNumber;
|
|
356
|
-
height: z.ZodNumber;
|
|
357
|
-
}, z.core.$strict>>>;
|
|
358
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
359
|
-
colors?: Record<ThemeColor, ThemeColorValues> | undefined;
|
|
360
|
-
sizes?: Partial<Record<any, {
|
|
361
|
-
width: number;
|
|
362
|
-
height: number;
|
|
363
|
-
}>> | undefined;
|
|
364
|
-
}>>;
|
|
365
|
-
type LikeC4ConfigThemeInput = z.input<typeof LikeC4Config_Styles_Theme>;
|
|
366
|
-
declare const LikeC4StylesConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
367
|
-
theme: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
368
|
-
colors: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
369
|
-
[x: string]: any;
|
|
370
|
-
}>, 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<{
|
|
371
|
-
elements: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
372
|
-
fill: z.ZodString;
|
|
373
|
-
stroke: z.ZodString;
|
|
374
|
-
hiContrast: z.ZodString;
|
|
375
|
-
loContrast: z.ZodString;
|
|
376
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
377
|
-
fill: string;
|
|
378
|
-
stroke: string;
|
|
379
|
-
hiContrast: string;
|
|
380
|
-
loContrast: string;
|
|
381
|
-
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
382
|
-
relationships: z.ZodUnion<[z.ZodPipe<z.ZodObject<{
|
|
383
|
-
line: z.ZodString;
|
|
384
|
-
label: z.ZodString;
|
|
385
|
-
labelBg: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
386
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
387
|
-
line: string;
|
|
388
|
-
label: string;
|
|
389
|
-
labelBg: string;
|
|
390
|
-
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>;
|
|
391
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
392
|
-
elements: any;
|
|
393
|
-
relationships: any;
|
|
394
|
-
}>>, z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>]>, z.ZodTransform<any, any>>>, z.ZodTransform<Record<ThemeColor, ThemeColorValues>, Partial<Record<any, any>>>>>;
|
|
395
|
-
sizes: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
396
|
-
[x: string]: any;
|
|
397
|
-
}> & z.core.$partial, z.ZodObject<{
|
|
398
|
-
width: z.ZodNumber;
|
|
399
|
-
height: z.ZodNumber;
|
|
400
|
-
}, z.core.$strict>>>;
|
|
401
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
402
|
-
colors?: Record<ThemeColor, ThemeColorValues> | undefined;
|
|
403
|
-
sizes?: Partial<Record<any, {
|
|
404
|
-
width: number;
|
|
405
|
-
height: number;
|
|
406
|
-
}>> | undefined;
|
|
407
|
-
}>>>;
|
|
408
|
-
defaults: z.ZodOptional<z.ZodObject<{
|
|
409
|
-
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
410
|
-
[x: string]: any;
|
|
411
|
-
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
|
|
412
|
-
opacity: z.ZodOptional<z.ZodInt>;
|
|
413
|
-
border: z.ZodOptional<z.ZodEnum<{
|
|
414
|
-
[x: string]: any;
|
|
415
|
-
}>>;
|
|
416
|
-
size: z.ZodOptional<z.ZodEnum<{
|
|
417
|
-
[x: string]: any;
|
|
418
|
-
}>>;
|
|
419
|
-
shape: z.ZodOptional<z.ZodEnum<{
|
|
420
|
-
[x: string]: any;
|
|
421
|
-
}>>;
|
|
422
|
-
iconPosition: z.ZodOptional<z.ZodEnum<{
|
|
423
|
-
[x: string]: any;
|
|
424
|
-
}>>;
|
|
425
|
-
group: z.ZodOptional<z.ZodObject<{
|
|
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
|
-
opacity: z.ZodOptional<z.ZodInt>;
|
|
430
|
-
border: z.ZodOptional<z.ZodEnum<{
|
|
431
|
-
[x: string]: any;
|
|
432
|
-
}>>;
|
|
433
|
-
}, z.core.$strict>>;
|
|
434
|
-
relationship: z.ZodOptional<z.ZodObject<{
|
|
435
|
-
color: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodEnum<{
|
|
436
|
-
[x: string]: any;
|
|
437
|
-
}>, z.ZodPipe<z.ZodCustom<string & Record<never, never>, string & Record<never, never>>, z.ZodTransform<any, string & Record<never, never>>>]>, z.ZodTransform<any, any>>>;
|
|
438
|
-
line: z.ZodOptional<z.ZodEnum<{
|
|
439
|
-
dashed: "dashed";
|
|
440
|
-
solid: "solid";
|
|
441
|
-
dotted: "dotted";
|
|
442
|
-
}>>;
|
|
443
|
-
arrow: z.ZodOptional<z.ZodEnum<{
|
|
444
|
-
[x: string]: any;
|
|
445
|
-
}>>;
|
|
446
|
-
}, z.core.$strict>>;
|
|
447
|
-
}, z.core.$strict>>;
|
|
448
|
-
customCss: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
449
|
-
}, z.core.$strict>, z.ZodTransform<any, {
|
|
450
|
-
theme?: any;
|
|
451
|
-
defaults?: {
|
|
452
|
-
color?: any;
|
|
453
|
-
opacity?: number | undefined;
|
|
454
|
-
border?: any;
|
|
455
|
-
size?: any;
|
|
456
|
-
shape?: any;
|
|
457
|
-
iconPosition?: any;
|
|
458
|
-
group?: {
|
|
459
|
-
color?: any;
|
|
460
|
-
opacity?: number | undefined;
|
|
461
|
-
border?: any;
|
|
462
|
-
} | undefined;
|
|
463
|
-
relationship?: {
|
|
464
|
-
color?: any;
|
|
465
|
-
line?: "dashed" | "solid" | "dotted" | undefined;
|
|
466
|
-
arrow?: any;
|
|
467
|
-
} | undefined;
|
|
468
|
-
} | undefined;
|
|
469
|
-
customCss?: string | string[] | undefined;
|
|
470
|
-
}>>;
|
|
471
|
-
interface LikeC4StylesConfig extends z.infer<typeof LikeC4StylesConfigSchema> {}
|
|
472
|
-
type LikeC4StylesConfigInput = z.input<typeof LikeC4StylesConfigSchema>;
|
|
473
|
-
//#endregion
|
|
474
|
-
//#region src/filenames.d.ts
|
|
475
|
-
/** All known LikeC4 config filenames (JSON and non-JSON). */
|
|
476
|
-
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"];
|
|
477
|
-
/** Returns true if the **basename** of the given path matches a known config filename. */
|
|
478
|
-
declare function isLikeC4JsonConfig(filename: string): boolean;
|
|
479
|
-
/**
|
|
480
|
-
* Returns true if the **basename** of the given path matches a known non-JSON config filename (JS, MJS, TS, MTS).
|
|
481
|
-
*/
|
|
482
|
-
declare function isLikeC4NonJsonConfig(filename: string): boolean;
|
|
483
|
-
/**
|
|
484
|
-
* Returns true if the **basename** of the given path matches a known LikeC4 config file (JSON or non-JSON).
|
|
485
|
-
*/
|
|
486
|
-
declare function isLikeC4Config(filename: string): boolean;
|
|
487
|
-
//#endregion
|
|
488
|
-
//#region src/define-config.d.ts
|
|
489
|
-
/**
|
|
490
|
-
* Defines LikeC4 Project, allows custom generators that can be executed using CLI:
|
|
491
|
-
*
|
|
492
|
-
* `$ likec4 gen <generator-name>`
|
|
493
|
-
*
|
|
494
|
-
* or VSCode command `LikeC4: Run code generator`
|
|
495
|
-
*
|
|
496
|
-
* @example
|
|
497
|
-
* ```ts
|
|
498
|
-
* export default defineConfig({
|
|
499
|
-
* name: 'my-project',
|
|
500
|
-
* title: 'My Project',
|
|
501
|
-
*
|
|
502
|
-
* exclude: ['picomatch pattern'],
|
|
503
|
-
* generators: {
|
|
504
|
-
* '<generator-name>': async ({ likec4model, ctx }) => {
|
|
505
|
-
* await ctx.write('my-generator.txt', likec4model.project.id)
|
|
506
|
-
* }
|
|
507
|
-
* }
|
|
508
|
-
* })
|
|
509
|
-
* ```
|
|
510
|
-
*/
|
|
511
|
-
declare function defineConfig<C extends LikeC4ProjectConfigInput>(config: C): LikeC4ProjectConfig;
|
|
512
|
-
/**
|
|
513
|
-
* Define reusable custom generators
|
|
514
|
-
*
|
|
515
|
-
* @example
|
|
516
|
-
* ```ts
|
|
517
|
-
* // generators.ts
|
|
518
|
-
* export default defineGenerators({
|
|
519
|
-
* 'my-generator': async ({ likec4model, ctx }) => {
|
|
520
|
-
* await ctx.write('my-generator.txt', likec4model.project.id)
|
|
521
|
-
* }
|
|
522
|
-
* })
|
|
523
|
-
*
|
|
524
|
-
* // likec4.config.ts
|
|
525
|
-
* import generators from './generators'
|
|
526
|
-
*
|
|
527
|
-
* export default defineConfig({
|
|
528
|
-
* name: 'my-project',
|
|
529
|
-
* generators,
|
|
530
|
-
* })
|
|
531
|
-
* ```
|
|
532
|
-
*/
|
|
533
|
-
declare function defineGenerators<const G extends Record<string, GeneratorFn>>(generators: G): G;
|
|
534
|
-
/**
|
|
535
|
-
* Define reusable custom theme color
|
|
536
|
-
* @example
|
|
537
|
-
* ```ts
|
|
538
|
-
* export default defineThemeColor({
|
|
539
|
-
* element: {
|
|
540
|
-
* fill: 'red'
|
|
541
|
-
* }
|
|
542
|
-
* })
|
|
543
|
-
* ```
|
|
544
|
-
*/
|
|
545
|
-
declare function defineThemeColor<const S extends ThemeColorValuesInput>(colors: S): ThemeColorValues$1;
|
|
546
|
-
/**
|
|
547
|
-
* Define reusable custom theme
|
|
548
|
-
* @example
|
|
549
|
-
* ```ts
|
|
550
|
-
* import { defineThemeColor, defineTheme } from 'likec4/config'
|
|
551
|
-
*
|
|
552
|
-
* export default defineTheme({
|
|
553
|
-
* colors: {
|
|
554
|
-
* primary: '#FF0000',
|
|
555
|
-
* // Or use defineThemeColor
|
|
556
|
-
* red: defineThemeColor({
|
|
557
|
-
* elements: {
|
|
558
|
-
* fill: 'red'
|
|
559
|
-
* }
|
|
560
|
-
* })
|
|
561
|
-
* }
|
|
562
|
-
* })
|
|
563
|
-
* ```
|
|
564
|
-
*/
|
|
565
|
-
declare function defineTheme<const S extends LikeC4ConfigThemeInput>(theme: S): LikeC4ProjectTheme;
|
|
566
|
-
/**
|
|
567
|
-
* Define reusable custom style
|
|
568
|
-
* @example
|
|
569
|
-
* ```ts
|
|
570
|
-
* import { defineStyle, defineThemeColor } from 'likec4/config'
|
|
571
|
-
*
|
|
572
|
-
* export default defineStyle({
|
|
573
|
-
* theme: {
|
|
574
|
-
* colors: {
|
|
575
|
-
* red: defineThemeColor({
|
|
576
|
-
* elements: {
|
|
577
|
-
* fill: 'red'
|
|
578
|
-
* }
|
|
579
|
-
* })
|
|
580
|
-
* }
|
|
581
|
-
* },
|
|
582
|
-
* defaults: {
|
|
583
|
-
* color: 'red',
|
|
584
|
-
* opacity: 50,
|
|
585
|
-
* border: 'solid',
|
|
586
|
-
* size: 'sm',
|
|
587
|
-
* relationship: {
|
|
588
|
-
* color: 'grey',
|
|
589
|
-
* line: 'solid',
|
|
590
|
-
* }
|
|
591
|
-
* }
|
|
592
|
-
* })
|
|
593
|
-
*/
|
|
594
|
-
declare function defineStyle<const S extends LikeC4StylesConfigInput>(styles: S): LikeC4ProjectStylesConfig;
|
|
595
|
-
//#endregion
|
|
1
|
+
import { S as LocateResult, _ as GeneratorFnParams, a as defineThemeColor, b as LikeC4ProjectConfigOps, c as isLikeC4JsonConfig, d as LikeC4StylesConfig, f as LikeC4StylesConfigInput, g as GeneratorFnContext, h as GeneratorFn, i as defineTheme, l as isLikeC4NonJsonConfig, m as ThemeColorValuesInput, n as defineGenerators, o as ConfigFilenames, p as LikeC4StylesConfigSchema, r as defineStyle, s as isLikeC4Config, t as defineConfig, u as LikeC4ConfigThemeInput, v as LikeC4ProjectConfig, w as IncludeConfig, x as LikeC4ProjectJsonConfig, y as LikeC4ProjectConfigInput } from "./chunks/index.mjs";
|
|
596
2
|
export { ConfigFilenames, type GeneratorFn, type GeneratorFnContext, type GeneratorFnParams, type IncludeConfig, type LikeC4ConfigThemeInput, type LikeC4ProjectConfig, type LikeC4ProjectConfigInput, LikeC4ProjectConfigOps, type LikeC4ProjectJsonConfig, type LikeC4StylesConfig, type LikeC4StylesConfigInput, LikeC4StylesConfigSchema, type LocateResult, type ThemeColorValuesInput, defineConfig, defineGenerators, defineStyle, defineTheme, defineThemeColor, isLikeC4Config, isLikeC4JsonConfig, isLikeC4NonJsonConfig };
|