likec4 1.48.0 → 1.49.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 +11 -1
- package/__app__/src/likec4.js +5595 -4127
- package/__app__/src/routes/index.js +3 -153
- package/__app__/src/routes/projects.js +21 -1087
- package/__app__/src/routes/single.js +1221 -16
- package/__app__/src/style.css +1 -1
- package/__app__/src/vendors.js +3507 -894
- package/__app__/src/webcomponent.js +1 -1
- package/config/schema.json +155 -143
- package/dist/THIRD-PARTY-LICENSES.md +1739 -0
- package/dist/_chunks/GraphvizBinaryAdapter.mjs +72 -0
- package/dist/_chunks/filenames.mjs +14 -0
- package/dist/_chunks/index.d.mts +224 -129
- package/dist/_chunks/index2.d.mts +2033 -1908
- package/dist/_chunks/libs/@chevrotain/gast.mjs +1 -3969
- package/dist/_chunks/libs/@chevrotain/regexp-to-ast.mjs +9 -785
- package/dist/_chunks/libs/@chevrotain/utils.mjs +1 -37
- package/dist/_chunks/libs/@hono/mcp.mjs +34 -0
- package/dist/_chunks/libs/@hono/node-server.mjs +1 -436
- package/dist/_chunks/libs/@logtape/logtape.d.mts +741 -0
- package/dist/_chunks/libs/@logtape/logtape.mjs +6 -1354
- package/dist/_chunks/libs/@lume/kiwi.mjs +1 -1355
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.d.mts +14 -14
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +12 -25105
- package/dist/_chunks/libs/@msgpack/msgpack.mjs +1 -1503
- package/dist/_chunks/libs/@nanostores/react.mjs +1 -30
- package/dist/_chunks/libs/@smithy/util-base64.mjs +1 -100
- package/dist/_chunks/libs/ajv.mjs +1 -777
- package/dist/_chunks/libs/atomically.mjs +1 -362
- package/dist/_chunks/libs/birpc.mjs +1 -201
- package/dist/_chunks/libs/chevrotain-allstar.mjs +2 -850
- package/dist/_chunks/libs/chevrotain.mjs +55 -6229
- package/dist/_chunks/libs/conf.mjs +1 -2258
- package/dist/_chunks/libs/defu.mjs +1 -42
- package/dist/_chunks/libs/esm-env.mjs +1 -5
- package/dist/_chunks/libs/eventemitter3.mjs +1 -243
- package/dist/_chunks/libs/fast-equals.mjs +1 -446
- package/dist/_chunks/libs/find-up-simple.mjs +1 -24
- package/dist/_chunks/libs/get-port.mjs +1 -107
- package/dist/_chunks/libs/is-docker.mjs +1 -26
- package/dist/_chunks/libs/is-error-instance.mjs +1 -26
- package/dist/_chunks/libs/is-inside-container.mjs +1 -20
- package/dist/_chunks/libs/is-plain-obj.mjs +1 -9
- package/dist/_chunks/libs/isexe.mjs +1 -127
- package/dist/_chunks/libs/json5.mjs +14 -959
- package/dist/_chunks/libs/khroma.mjs +1 -605
- package/dist/_chunks/libs/ky.mjs +2 -807
- package/dist/_chunks/libs/langium.d.mts +2880 -2844
- package/dist/_chunks/libs/langium.mjs +32 -20351
- package/dist/_chunks/libs/merge-error-cause.mjs +2 -746
- package/dist/_chunks/libs/nanostores.mjs +1 -198
- package/dist/_chunks/libs/p-limit.mjs +1 -120
- package/dist/_chunks/libs/p-queue.mjs +1 -449
- package/dist/_chunks/libs/package-manager-detector.mjs +1 -559
- package/dist/_chunks/libs/package-up.mjs +1 -10
- package/dist/_chunks/libs/parse-ms.mjs +1 -36
- package/dist/_chunks/libs/pathe.mjs +1 -0
- package/dist/_chunks/libs/picomatch.mjs +1 -1673
- package/dist/_chunks/libs/pretty-ms.mjs +1 -80
- package/dist/_chunks/libs/remeda.mjs +1 -690
- package/dist/_chunks/libs/safe-stringify.mjs +1 -21
- package/dist/_chunks/libs/strip-indent.mjs +1 -15
- package/dist/_chunks/libs/tinyrainbow.mjs +1 -88
- package/dist/_chunks/libs/ts-graphviz.mjs +4 -725
- package/dist/_chunks/libs/ufo.mjs +1 -240
- package/dist/_chunks/libs/which.mjs +1 -84
- package/dist/_chunks/libs/word-wrap.mjs +12 -43
- package/dist/_chunks/node.mjs +481 -0
- package/dist/_chunks/plugin.mjs +98 -772
- package/dist/_chunks/rolldown-runtime.mjs +1 -48
- package/dist/_chunks/sequence-view.mjs +1 -575
- package/dist/cli/index.mjs +127 -1846
- package/dist/config/index.d.mts +2 -2
- package/dist/config/index.mjs +1 -6
- package/dist/index.d.mts +148 -7
- package/dist/index.mjs +1 -21
- package/dist/model/builder.mjs +1 -3
- package/dist/model/index.d.mts +57 -3
- package/dist/model/index.mjs +1 -5
- package/dist/vite-plugin/index.d.mts +4 -3
- package/dist/vite-plugin/index.mjs +1 -22
- package/dist/vite-plugin/internal.d.mts +5 -5
- package/dist/vite-plugin/internal.mjs +1 -68
- package/package.json +60 -41
- package/react/{index.d.ts → index.d.mts} +112 -70
- package/react/{index.js → index.mjs} +21361 -22064
- package/react/package.json +2 -5
- package/vite-plugin-modules.d.ts +5 -5
- package/dist/_chunks/LikeC4.d.mts +0 -121
- package/dist/_chunks/LikeC4.mjs +0 -202
- package/dist/_chunks/config-app.prod.d.mts +0 -18
- package/dist/_chunks/config-app.prod.mjs +0 -188
- package/dist/_chunks/config-webcomponent.prod.mjs +0 -71
- package/dist/_chunks/define-config.mjs +0 -409
- package/dist/_chunks/index3.d.mts +0 -60
- package/dist/_chunks/index4.d.mts +0 -1
- package/dist/_chunks/libs/@smithy/is-array-buffer.mjs +0 -10
- package/dist/_chunks/libs/hono.mjs +0 -1829
- package/dist/_chunks/libs/nanoid.mjs +0 -29
- package/dist/_chunks/model.mjs +0 -12
- package/dist/_chunks/module.d.mts +0 -71
- package/dist/_chunks/module.mjs +0 -18657
- package/dist/_chunks/vite-build.mjs +0 -69
- package/dist/_chunks/vite-dev.mjs +0 -79
- package/dist/_chunks/vite-preview.mjs +0 -27
- package/dist/language/module.d.mts +0 -5
- package/dist/language/module.mjs +0 -20
- package/dist/vite/vite-build.d.mts +0 -26
- package/dist/vite/vite-build.mjs +0 -27
- package/dist/vite/vite-dev.d.mts +0 -34
- package/dist/vite/vite-dev.mjs +0 -29
- package/dist/vite/vite-preview.d.mts +0 -20
- package/dist/vite/vite-preview.mjs +0 -26
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{t as basename}from"./libs/pathe.mjs";import{t as lib}from"./libs/json5.mjs";import{J as v4_default}from"./libs/@hono/mcp.mjs";import{BorderStyles,ElementShapes,IconPositions,RelationshipArrowTypes,Sizes,ThemeColors,computeColorValues}from"@likec4/core/styles";import{exact}from"@likec4/core/types";const IMAGE_ALIAS_KEY_REGEX=/^@[A-Za-z0-9_-]*$/,IMAGE_ALIAS_VALUE_REGEX=/^(?!\/|[A-Za-z]:[\\\/])(?!.*:\/\/).*$/,ImageAliasKey=v4_default.string().min(1,`Image alias key cannot be empty`).regex(IMAGE_ALIAS_KEY_REGEX,`Image alias key must match /^@\\w+$/`),ImageAliasValue=v4_default.string().min(1,`Image alias value cannot be empty`).regex(IMAGE_ALIAS_VALUE_REGEX,`Image alias value must be a relative path (no leading slash or protocol)`),ImageAliasesSchema=v4_default.record(ImageAliasKey,ImageAliasValue).meta({id:`ImageAliases`,description:`Map of image alias prefixes to relative paths (keys must match /^@\\w+$/; values must be relative paths without protocol or leading slash).`}),IncludePathValue=v4_default.string().min(1,`Include path cannot be empty`).regex(/^(?!\/|[A-Za-z]:[\\\/])(?!.*:\/\/).*$/,`Include path must be a relative path (no leading slash, drive letter, or protocol)`),IncludeSchema=v4_default.strictObject({paths:v4_default.array(IncludePathValue).meta({description:[`Additional relative directory paths to include LikeC4 source files from, searched recursively.`,`Paths are relative to the project folder (the folder containing this config file).`,`Example: ["../shared", "../common/specs"]`].join(`
|
|
2
|
+
`)}),maxDepth:v4_default.number().int().min(1).max(20).default(3).meta({description:[`Maximum directory depth to scan when searching for .c4 files in include paths.`,`Prevents excessive scanning of deeply nested directories.`,`Default: 3`].join(`
|
|
3
|
+
`)}),fileThreshold:v4_default.number().int().min(1).max(1e4).default(30).meta({description:[`Maximum number of files to load from include paths before warning.`,`Helps identify performance issues from accidentally including large directories.`,`Default: 30`].join(`
|
|
4
|
+
`)})}).meta({id:`include-config`,description:[`Configuration for including additional LikeC4 source files from other directories.`,`Example: { "paths": ["../shared", "../common/specs"], "maxDepth": 5, "fileThreshold": 50 }`].join(`
|
|
5
|
+
`)}),opacity=v4_default.int().min(0,`Opacity must be between 0 and 100`).max(100,`Opacity must be between 0 and 100`).meta({id:`Opacity`,description:`Opacity 0-100%`}),shape=v4_default.enum(ElementShapes).meta({id:`ElementShape`}),border=v4_default.enum(BorderStyles).meta({id:`BorderStyle`}),size=v4_default.enum(Sizes).meta({id:`ElementSize`}),iconPosition=v4_default.enum(IconPositions).meta({id:`IconPosition`}),arrow=v4_default.enum(RelationshipArrowTypes).meta({id:`ArrowType`}),line=v4_default.enum([`dashed`,`solid`,`dotted`]).meta({id:`LineType`}),themeColor=v4_default.enum(ThemeColors).meta({id:`ThemeColorName`}),customColor=v4_default.custom().refine(e=>typeof e==`string`,`Custom color name must be a string`).transform(e=>e).meta({id:`CustomColorName`}),color=themeColor.or(customColor).transform(e=>e).meta({id:`ColorName`}),colorSchema=v4_default.string().min(1,`Color value cannot be empty`).meta({id:`ColorLiteral`}),ElementColorValuesSchema=v4_default.strictObject({fill:colorSchema.meta({description:`Background color`}),stroke:colorSchema.meta({description:`Stroke color (border, paths above background)`}),hiContrast:colorSchema.meta({description:`High contrast text color (title)`}),loContrast:colorSchema.meta({description:`Low contrast text color (description)`})}).meta({id:`ElementColorValues`}).transform(e=>e),RelationshipColorValuesSchema=v4_default.strictObject({line:colorSchema.meta({description:`Line color`}),label:colorSchema.meta({description:`Label text color`}),labelBg:colorSchema.optional().default(`rgba(0, 0, 0, 0.5)`).meta({description:`Label background color`})}).meta({id:`RelationshipColorValues`}).transform(e=>e),ThemeColorValuesSchema=v4_default.strictObject({elements:ElementColorValuesSchema.or(colorSchema.transform(e=>computeColorValues(e).elements)).meta({description:`Exact color value (hex, rgb, rgba, hsl, hsla ...) or break down of specific color values`}),relationships:RelationshipColorValuesSchema.or(colorSchema.transform(e=>computeColorValues(e).relationships)).meta({description:`Exact color value (hex, rgb, rgba, hsl, hsla ...) or break down of specific color values`})}).transform(e=>e).meta({id:`StrictThemeColorValues`,description:`Exact color value (hex, rgb, rgba, hsl, hsla ...) or break down of specific color value`}).or(colorSchema.transform(e=>computeColorValues(e))).transform(e=>e).meta({id:`ThemeColorValues`,description:`Exact value (hex, rgb, rgba, hsl, hsla ...) or break down of specific color values`}),ThemeColorsSchema=v4_default.partialRecord(color,ThemeColorValuesSchema).transform(e=>e),DimensionsSchema=v4_default.strictObject({width:v4_default.number().min(50),height:v4_default.number().min(50)}).meta({id:`Dimensions`,description:`Defines dimensions for theme size`}),LikeC4Config_Styles_Theme_Sizes=v4_default.partialRecord(size,DimensionsSchema),LikeC4Config_Styles_Theme=v4_default.strictObject({colors:ThemeColorsSchema.optional().meta({description:`Override theme colors`}),sizes:LikeC4Config_Styles_Theme_Sizes.optional().meta({description:`Override theme sizes`})}).meta({id:`ThemeCustomization`,description:`Customize theme colors and sizes`}).transform(({colors:e,sizes:t})=>exact({colors:e?exact(e):void 0,sizes:t?exact(t):void 0})),LikeC4Config_Styles_Defaults_Group=v4_default.strictObject({color:color.optional().meta({description:`Default color for groups
|
|
6
|
+
(must be a valid color name from the theme)`}),opacity:opacity.optional().meta({description:`Default opacity for groups`}),border:border.optional().meta({description:`Default border for groups`})}).meta({id:`GroupDefaultStyleValues`}),LikeC4Config_Styles_Defaults_Relationship=v4_default.strictObject({color:color.optional().meta({description:`Default color for relationships
|
|
7
|
+
(must be a valid color name from the theme)`}),line:line.optional().meta({description:`Default line style for relationships`}),arrow:arrow.optional().meta({description:`Default arrow style for relationships`})}).meta({id:`RelationshipDefaultStyleValues`,description:`Override default values for relationship style properties
|
|
8
|
+
These values will be used if such property is not defined`}),LikeC4Config_Styles_Defaults=v4_default.strictObject({color:color.optional().meta({description:`Default color for elements
|
|
9
|
+
(must be a valid color name from the theme)`}),opacity:opacity.optional().meta({description:`Default opacity (0-100%) for elements when displayed as a group (like a container)`}),border:border.optional().meta({description:`Default border style for elements when displayed as a group (like a container)`}),size:size.optional().meta({description:`Default size for elements`}),shape:shape.optional().meta({description:`Default shape for elements`}),iconPosition:iconPosition.optional().meta({description:`Default icon position for elements`}),group:LikeC4Config_Styles_Defaults_Group.optional().meta({description:`Override default values for group style properties
|
|
10
|
+
These values will be used if such property is not defined`}),relationship:LikeC4Config_Styles_Defaults_Relationship.optional().meta({description:`Override default values for relationship style properties
|
|
11
|
+
These values will be used if such property is not defined`})}).meta({id:`DefaultStyleValues`}),LikeC4Config_Styles_CustomStylesheets=v4_default.union([v4_default.string().min(1,`Custom CSS file path cannot be empty`),v4_default.array(v4_default.string().min(1,`Custom CSS file path cannot be empty`))]).meta({id:`CustomStylesheets`}),LikeC4StylesConfigSchema=v4_default.strictObject({theme:LikeC4Config_Styles_Theme.optional().meta({description:`Project theme customization`}),defaults:LikeC4Config_Styles_Defaults.optional().meta({description:`Override default values for style properties
|
|
12
|
+
These values will be used if such property is not defined`}),customCss:LikeC4Config_Styles_CustomStylesheets.optional().meta({description:`Custom CSS (or list of CSS files) to be included in the generated diagrams`})}).transform(({theme:e,defaults:t,customCss:n})=>exact({defaults:normalizeDefaults(t),customCss:normalizeStylesheets(n),theme:e}));function normalizeDefaults(e){if(!e)return;let{relationship:t,group:n,...r}=e;return exact({...r,relationship:t&&exact(t),group:n&&exact(n)})}function normalizeStylesheets(e){if(!e)return;let t=(Array.isArray(e)?e:[e]).filter(Boolean);if(t.length!==0)return{paths:t,content:``}}const ManualLayoutsConfigSchema=v4_default.strictObject({outDir:v4_default.string().default(`.likec4`).meta({description:[`Path to the directory where manual layouts will be stored,`,`relative to the folder containing the project config. `,``,`Defaults to '.likec4'.`].join(`
|
|
13
|
+
`)})}).meta({id:`ManualLayoutsConfig`,description:`Configuration for manual layouts`}),LikeC4ProjectJsonConfigSchema=v4_default.object({name:v4_default.string().nonempty(`Project name cannot be empty`).refine(e=>e!==`default`,{abort:!0,error:`Project name cannot be "default"`}).refine(e=>!e.includes(`.`)&&!e.includes(`@`)&&!e.includes(`#`),{abort:!0,error:`Project name cannot contain ".", "@" or "#", try to use A-z, 0-9, _ and -`}).meta({description:`Project name, must be unique in the workspace`}),extends:v4_default.union([v4_default.string().min(1,`Extend path cannot be empty`),v4_default.array(v4_default.string().min(1,`Extend path cannot be empty`)).min(1,`Extend list cannot be empty`)]).optional().meta({description:`Extend styles from other config files`}),title:v4_default.string().nonempty(`Project title cannot be empty if specified`).optional().meta({description:`A human readable title for the project`}),contactPerson:v4_default.string().nonempty(`Contact person cannot be empty if specified`).optional().meta({description:`A person who has been involved in creating or maintaining this project`}),styles:LikeC4StylesConfigSchema.optional().meta({description:`Project styles customization`}),imageAliases:ImageAliasesSchema.optional(),include:IncludeSchema.optional(),exclude:v4_default.array(v4_default.string()).optional().meta({description:`List of file patterns to exclude from the project, default is ["**/node_modules/**"]`}),manualLayouts:ManualLayoutsConfigSchema.optional()}).meta({id:`LikeC4ProjectConfig`,description:`LikeC4 Project Configuration`}),FunctionType=v4_default.instanceof(Function),GeneratorsSchema=v4_default.record(v4_default.string(),FunctionType),LikeC4ProjectConfigSchema=LikeC4ProjectJsonConfigSchema.extend({generators:GeneratorsSchema.optional()});function validateProjectConfig(e){let t=LikeC4ProjectConfigSchema.safeParse(e);if(t.success)return t.data;throw Error(`Config validation failed:
|
|
14
|
+
`+v4_default.prettifyError(t.error))}function parseProjectConfigJSON(e){return validateProjectConfig(lib.parse(e.trim()||`{}`))}const LikeC4ProjectConfigOps={parse:parseProjectConfigJSON,validate:validateProjectConfig,normalizeInclude:e=>{let t=IncludeSchema.safeParse(e);return t.success?t.data:{paths:[],maxDepth:3,fileThreshold:30}}},configJsonFilenames=[`.likec4rc`,`.likec4.config.json`,`likec4.config.json`],configNonJsonFilenames=[`likec4.config.js`,`likec4.config.cjs`,`likec4.config.mjs`,`likec4.config.ts`,`likec4.config.cts`,`likec4.config.mts`];[...configJsonFilenames,...configNonJsonFilenames];function isLikeC4JsonConfig(t){return configJsonFilenames.includes(basename(t))}function isLikeC4NonJsonConfig(t){return configNonJsonFilenames.includes(basename(t))}function isLikeC4Config(e){return isLikeC4JsonConfig(e)||isLikeC4NonJsonConfig(e)}export{LikeC4ProjectConfigOps as a,validateProjectConfig as c,ThemeColorValuesSchema as d,GeneratorsSchema as i,LikeC4Config_Styles_Theme as l,isLikeC4JsonConfig as n,LikeC4ProjectConfigSchema as o,isLikeC4NonJsonConfig as r,LikeC4ProjectJsonConfigSchema as s,isLikeC4Config as t,LikeC4StylesConfigSchema as u};
|
package/dist/_chunks/index.d.mts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import { LikeC4ProjectStylesConfig, LikeC4ProjectTheme, ProjectId, ThemeColorValues as ThemeColorValues$1, aux } from "@likec4/core/types";
|
|
1
|
+
import { _ as output, a as ZodDefault, b as $strip, c as ZodNumber, d as ZodPipe, f as ZodRecord, g as input, h as ZodUnion, i as ZodCustom, l as ZodObject, m as ZodTransform, o as ZodEnum, p as ZodString, r as ZodArray, s as ZodInt, u as ZodOptional, v as $partial, y as $strict } from "./libs/@modelcontextprotocol/sdk.mjs";
|
|
3
2
|
import { DeploymentElementModel, DeploymentRelationModel, ElementModel, LikeC4Model, LikeC4ViewModel, RelationshipModel } from "@likec4/core/model";
|
|
4
|
-
import {
|
|
3
|
+
import { LikeC4ProjectStylesConfig, LikeC4ProjectTheme, ProjectId, ThemeColorValues as ThemeColorValues$1, aux } from "@likec4/core/types";
|
|
5
4
|
|
|
6
5
|
//#region ../config/dist/index.d.mts
|
|
6
|
+
//#region src/schema.include.d.ts
|
|
7
|
+
declare const IncludeSchema: ZodObject<{
|
|
8
|
+
paths: ZodArray<ZodString>;
|
|
9
|
+
maxDepth: ZodDefault<ZodNumber>;
|
|
10
|
+
fileThreshold: ZodDefault<ZodNumber>;
|
|
11
|
+
}, $strict>;
|
|
12
|
+
type IncludeConfig = output<typeof IncludeSchema>; //#endregion
|
|
7
13
|
//#region src/schema.d.ts
|
|
8
14
|
interface VscodeURI {
|
|
9
15
|
readonly scheme: string;
|
|
@@ -16,59 +22,89 @@ interface VscodeURI {
|
|
|
16
22
|
}
|
|
17
23
|
declare const LikeC4ProjectJsonConfigSchema: ZodObject<{
|
|
18
24
|
name: ZodString;
|
|
25
|
+
extends: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
|
|
19
26
|
title: ZodOptional<ZodString>;
|
|
20
27
|
contactPerson: ZodOptional<ZodString>;
|
|
21
|
-
imageAliases: ZodOptional<ZodRecord<ZodString, ZodString>>;
|
|
22
|
-
include: ZodOptional<ZodObject<{
|
|
23
|
-
paths: ZodArray<ZodString>;
|
|
24
|
-
maxDepth: ZodDefault<ZodNumber>;
|
|
25
|
-
fileThreshold: ZodDefault<ZodNumber>;
|
|
26
|
-
}, $strict>>;
|
|
27
28
|
styles: ZodOptional<ZodPipe<ZodObject<{
|
|
28
29
|
theme: ZodOptional<ZodPipe<ZodObject<{
|
|
29
|
-
colors: ZodOptional<ZodPipe<ZodRecord<ZodPipe<ZodUnion<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
colors: ZodOptional<ZodPipe<ZodRecord<ZodPipe<ZodUnion<[ZodEnum<{
|
|
31
|
+
[x: string]: any;
|
|
32
|
+
}>, ZodPipe<ZodCustom<string & Record<never, never>, string & Record<never, never>>, ZodTransform<any, string & Record<never, never>>>]>, ZodTransform<any, any>> & $partial, ZodPipe<ZodUnion<[ZodPipe<ZodObject<{
|
|
33
|
+
elements: ZodUnion<[ZodPipe<ZodObject<{
|
|
34
|
+
fill: ZodString;
|
|
35
|
+
stroke: ZodString;
|
|
36
|
+
hiContrast: ZodString;
|
|
37
|
+
loContrast: ZodString;
|
|
35
38
|
}, $strict>, ZodTransform<any, {
|
|
36
|
-
fill:
|
|
37
|
-
stroke:
|
|
38
|
-
hiContrast:
|
|
39
|
-
loContrast:
|
|
40
|
-
}
|
|
41
|
-
relationships:
|
|
42
|
-
line:
|
|
43
|
-
label:
|
|
44
|
-
labelBg: ZodDefault<ZodOptional<
|
|
39
|
+
fill: string;
|
|
40
|
+
stroke: string;
|
|
41
|
+
hiContrast: string;
|
|
42
|
+
loContrast: string;
|
|
43
|
+
}>>, ZodPipe<ZodString, ZodTransform<any, string>>]>;
|
|
44
|
+
relationships: ZodUnion<[ZodPipe<ZodObject<{
|
|
45
|
+
line: ZodString;
|
|
46
|
+
label: ZodString;
|
|
47
|
+
labelBg: ZodDefault<ZodOptional<ZodString>>;
|
|
45
48
|
}, $strict>, ZodTransform<any, {
|
|
46
|
-
line:
|
|
47
|
-
label:
|
|
48
|
-
labelBg:
|
|
49
|
-
}
|
|
50
|
-
}, $strict
|
|
51
|
-
|
|
49
|
+
line: string;
|
|
50
|
+
label: string;
|
|
51
|
+
labelBg: string;
|
|
52
|
+
}>>, ZodPipe<ZodString, ZodTransform<any, string>>]>;
|
|
53
|
+
}, $strict>, ZodTransform<any, {
|
|
54
|
+
elements: any;
|
|
55
|
+
relationships: any;
|
|
56
|
+
}>>, ZodPipe<ZodString, ZodTransform<any, string>>]>, ZodTransform<any, any>>>, ZodTransform<Record<ThemeColor, ThemeColorValues>, Partial<Record<any, any>>>>>;
|
|
57
|
+
sizes: ZodOptional<ZodRecord<ZodEnum<{
|
|
58
|
+
[x: string]: any;
|
|
59
|
+
}> & $partial, ZodObject<{
|
|
60
|
+
width: ZodNumber;
|
|
61
|
+
height: ZodNumber;
|
|
62
|
+
}, $strict>>>;
|
|
52
63
|
}, $strict>, ZodTransform<any, {
|
|
53
64
|
colors?: Record<ThemeColor, ThemeColorValues> | undefined;
|
|
54
|
-
sizes?: any
|
|
65
|
+
sizes?: Partial<Record<any, {
|
|
66
|
+
width: number;
|
|
67
|
+
height: number;
|
|
68
|
+
}>> | undefined;
|
|
55
69
|
}>>>;
|
|
56
70
|
defaults: ZodOptional<ZodObject<{
|
|
57
|
-
color: ZodOptional<ZodPipe<ZodUnion<
|
|
71
|
+
color: ZodOptional<ZodPipe<ZodUnion<[ZodEnum<{
|
|
72
|
+
[x: string]: any;
|
|
73
|
+
}>, ZodPipe<ZodCustom<string & Record<never, never>, string & Record<never, never>>, ZodTransform<any, string & Record<never, never>>>]>, ZodTransform<any, any>>>;
|
|
58
74
|
opacity: ZodOptional<ZodInt>;
|
|
59
|
-
border: ZodOptional<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
75
|
+
border: ZodOptional<ZodEnum<{
|
|
76
|
+
[x: string]: any;
|
|
77
|
+
}>>;
|
|
78
|
+
size: ZodOptional<ZodEnum<{
|
|
79
|
+
[x: string]: any;
|
|
80
|
+
}>>;
|
|
81
|
+
shape: ZodOptional<ZodEnum<{
|
|
82
|
+
[x: string]: any;
|
|
83
|
+
}>>;
|
|
84
|
+
iconPosition: ZodOptional<ZodEnum<{
|
|
85
|
+
[x: string]: any;
|
|
86
|
+
}>>;
|
|
63
87
|
group: ZodOptional<ZodObject<{
|
|
64
|
-
color: ZodOptional<ZodPipe<ZodUnion<
|
|
88
|
+
color: ZodOptional<ZodPipe<ZodUnion<[ZodEnum<{
|
|
89
|
+
[x: string]: any;
|
|
90
|
+
}>, ZodPipe<ZodCustom<string & Record<never, never>, string & Record<never, never>>, ZodTransform<any, string & Record<never, never>>>]>, ZodTransform<any, any>>>;
|
|
65
91
|
opacity: ZodOptional<ZodInt>;
|
|
66
|
-
border: ZodOptional<
|
|
92
|
+
border: ZodOptional<ZodEnum<{
|
|
93
|
+
[x: string]: any;
|
|
94
|
+
}>>;
|
|
67
95
|
}, $strict>>;
|
|
68
96
|
relationship: ZodOptional<ZodObject<{
|
|
69
|
-
color: ZodOptional<ZodPipe<ZodUnion<
|
|
70
|
-
|
|
71
|
-
|
|
97
|
+
color: ZodOptional<ZodPipe<ZodUnion<[ZodEnum<{
|
|
98
|
+
[x: string]: any;
|
|
99
|
+
}>, ZodPipe<ZodCustom<string & Record<never, never>, string & Record<never, never>>, ZodTransform<any, string & Record<never, never>>>]>, ZodTransform<any, any>>>;
|
|
100
|
+
line: ZodOptional<ZodEnum<{
|
|
101
|
+
dashed: "dashed";
|
|
102
|
+
solid: "solid";
|
|
103
|
+
dotted: "dotted";
|
|
104
|
+
}>>;
|
|
105
|
+
arrow: ZodOptional<ZodEnum<{
|
|
106
|
+
[x: string]: any;
|
|
107
|
+
}>>;
|
|
72
108
|
}, $strict>>;
|
|
73
109
|
}, $strict>>;
|
|
74
110
|
customCss: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
|
|
@@ -94,12 +130,18 @@ declare const LikeC4ProjectJsonConfigSchema: ZodObject<{
|
|
|
94
130
|
} | undefined;
|
|
95
131
|
customCss?: string | string[] | undefined;
|
|
96
132
|
}>>>;
|
|
133
|
+
imageAliases: ZodOptional<ZodRecord<ZodString, ZodString>>;
|
|
134
|
+
include: ZodOptional<ZodObject<{
|
|
135
|
+
paths: ZodArray<ZodString>;
|
|
136
|
+
maxDepth: ZodDefault<ZodNumber>;
|
|
137
|
+
fileThreshold: ZodDefault<ZodNumber>;
|
|
138
|
+
}, $strict>>;
|
|
97
139
|
exclude: ZodOptional<ZodArray<ZodString>>;
|
|
98
140
|
manualLayouts: ZodOptional<ZodObject<{
|
|
99
141
|
outDir: ZodDefault<ZodString>;
|
|
100
142
|
}, $strict>>;
|
|
101
143
|
}, $strip>;
|
|
102
|
-
type LikeC4ProjectJsonConfig =
|
|
144
|
+
type LikeC4ProjectJsonConfig = input<typeof LikeC4ProjectJsonConfigSchema>;
|
|
103
145
|
/**
|
|
104
146
|
* Result of the {@link GeneratorFnContext.locate} function
|
|
105
147
|
*/
|
|
@@ -222,119 +264,172 @@ type LikeC4ProjectConfig = output<typeof LikeC4ProjectJsonConfigSchema> & {
|
|
|
222
264
|
*/
|
|
223
265
|
generators?: Record<string, GeneratorFn> | undefined;
|
|
224
266
|
};
|
|
225
|
-
type LikeC4ProjectConfigInput =
|
|
267
|
+
type LikeC4ProjectConfigInput = LikeC4ProjectJsonConfig & {
|
|
226
268
|
generators?: Record<string, GeneratorFn> | undefined;
|
|
227
|
-
}
|
|
269
|
+
};
|
|
228
270
|
/**
|
|
229
|
-
* Validates
|
|
271
|
+
* Validates Object into a LikeC4ProjectConfig object.
|
|
230
272
|
*/
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
273
|
+
declare function validateProjectConfig<C extends Record<string, unknown>>(config: C): LikeC4ProjectConfig;
|
|
274
|
+
/**
|
|
275
|
+
* Parses JSON string into a LikeC4ProjectConfig object.
|
|
276
|
+
* Does not process "extends" - use `loadConfig` function instead
|
|
277
|
+
*/
|
|
278
|
+
declare function parseProjectConfigJSON(config: string): LikeC4ProjectConfig;
|
|
279
|
+
declare const LikeC4ProjectConfigOps: {
|
|
280
|
+
parse: typeof parseProjectConfigJSON;
|
|
281
|
+
validate: typeof validateProjectConfig;
|
|
282
|
+
normalizeInclude: (include: input<typeof IncludeSchema> | undefined) => IncludeConfig;
|
|
283
|
+
}; //#endregion
|
|
240
284
|
//#region src/schema.theme.d.ts
|
|
241
|
-
declare const ThemeColorValuesSchema: ZodPipe<ZodUnion<
|
|
242
|
-
elements:
|
|
243
|
-
fill:
|
|
244
|
-
stroke:
|
|
245
|
-
hiContrast:
|
|
246
|
-
loContrast:
|
|
285
|
+
declare const ThemeColorValuesSchema: ZodPipe<ZodUnion<[ZodPipe<ZodObject<{
|
|
286
|
+
elements: ZodUnion<[ZodPipe<ZodObject<{
|
|
287
|
+
fill: ZodString;
|
|
288
|
+
stroke: ZodString;
|
|
289
|
+
hiContrast: ZodString;
|
|
290
|
+
loContrast: ZodString;
|
|
247
291
|
}, $strict>, ZodTransform<any, {
|
|
248
|
-
fill:
|
|
249
|
-
stroke:
|
|
250
|
-
hiContrast:
|
|
251
|
-
loContrast:
|
|
252
|
-
}
|
|
253
|
-
relationships:
|
|
254
|
-
line:
|
|
255
|
-
label:
|
|
256
|
-
labelBg: ZodDefault<ZodOptional<
|
|
292
|
+
fill: string;
|
|
293
|
+
stroke: string;
|
|
294
|
+
hiContrast: string;
|
|
295
|
+
loContrast: string;
|
|
296
|
+
}>>, ZodPipe<ZodString, ZodTransform<any, string>>]>;
|
|
297
|
+
relationships: ZodUnion<[ZodPipe<ZodObject<{
|
|
298
|
+
line: ZodString;
|
|
299
|
+
label: ZodString;
|
|
300
|
+
labelBg: ZodDefault<ZodOptional<ZodString>>;
|
|
257
301
|
}, $strict>, ZodTransform<any, {
|
|
258
|
-
line:
|
|
259
|
-
label:
|
|
260
|
-
labelBg:
|
|
261
|
-
}
|
|
262
|
-
}, $strict
|
|
302
|
+
line: string;
|
|
303
|
+
label: string;
|
|
304
|
+
labelBg: string;
|
|
305
|
+
}>>, ZodPipe<ZodString, ZodTransform<any, string>>]>;
|
|
306
|
+
}, $strict>, ZodTransform<any, {
|
|
307
|
+
elements: any;
|
|
308
|
+
relationships: any;
|
|
309
|
+
}>>, ZodPipe<ZodString, ZodTransform<any, string>>]>, ZodTransform<any, any>>;
|
|
263
310
|
type ThemeColorValuesInput = input<typeof ThemeColorValuesSchema>;
|
|
264
311
|
declare const LikeC4Config_Styles_Theme: ZodPipe<ZodObject<{
|
|
265
|
-
colors: ZodOptional<ZodPipe<ZodRecord<ZodPipe<ZodUnion<
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
312
|
+
colors: ZodOptional<ZodPipe<ZodRecord<ZodPipe<ZodUnion<[ZodEnum<{
|
|
313
|
+
[x: string]: any;
|
|
314
|
+
}>, ZodPipe<ZodCustom<string & Record<never, never>, string & Record<never, never>>, ZodTransform<any, string & Record<never, never>>>]>, ZodTransform<any, any>> & $partial, ZodPipe<ZodUnion<[ZodPipe<ZodObject<{
|
|
315
|
+
elements: ZodUnion<[ZodPipe<ZodObject<{
|
|
316
|
+
fill: ZodString;
|
|
317
|
+
stroke: ZodString;
|
|
318
|
+
hiContrast: ZodString;
|
|
319
|
+
loContrast: ZodString;
|
|
271
320
|
}, $strict>, ZodTransform<any, {
|
|
272
|
-
fill:
|
|
273
|
-
stroke:
|
|
274
|
-
hiContrast:
|
|
275
|
-
loContrast:
|
|
276
|
-
}
|
|
277
|
-
relationships:
|
|
278
|
-
line:
|
|
279
|
-
label:
|
|
280
|
-
labelBg: ZodDefault<ZodOptional<
|
|
321
|
+
fill: string;
|
|
322
|
+
stroke: string;
|
|
323
|
+
hiContrast: string;
|
|
324
|
+
loContrast: string;
|
|
325
|
+
}>>, ZodPipe<ZodString, ZodTransform<any, string>>]>;
|
|
326
|
+
relationships: ZodUnion<[ZodPipe<ZodObject<{
|
|
327
|
+
line: ZodString;
|
|
328
|
+
label: ZodString;
|
|
329
|
+
labelBg: ZodDefault<ZodOptional<ZodString>>;
|
|
281
330
|
}, $strict>, ZodTransform<any, {
|
|
282
|
-
line:
|
|
283
|
-
label:
|
|
284
|
-
labelBg:
|
|
285
|
-
}
|
|
286
|
-
}, $strict
|
|
287
|
-
|
|
331
|
+
line: string;
|
|
332
|
+
label: string;
|
|
333
|
+
labelBg: string;
|
|
334
|
+
}>>, ZodPipe<ZodString, ZodTransform<any, string>>]>;
|
|
335
|
+
}, $strict>, ZodTransform<any, {
|
|
336
|
+
elements: any;
|
|
337
|
+
relationships: any;
|
|
338
|
+
}>>, ZodPipe<ZodString, ZodTransform<any, string>>]>, ZodTransform<any, any>>>, ZodTransform<Record<ThemeColor, ThemeColorValues>, Partial<Record<any, any>>>>>;
|
|
339
|
+
sizes: ZodOptional<ZodRecord<ZodEnum<{
|
|
340
|
+
[x: string]: any;
|
|
341
|
+
}> & $partial, ZodObject<{
|
|
342
|
+
width: ZodNumber;
|
|
343
|
+
height: ZodNumber;
|
|
344
|
+
}, $strict>>>;
|
|
288
345
|
}, $strict>, ZodTransform<any, {
|
|
289
346
|
colors?: Record<ThemeColor, ThemeColorValues> | undefined;
|
|
290
|
-
sizes?: any
|
|
347
|
+
sizes?: Partial<Record<any, {
|
|
348
|
+
width: number;
|
|
349
|
+
height: number;
|
|
350
|
+
}>> | undefined;
|
|
291
351
|
}>>;
|
|
292
352
|
type LikeC4ConfigThemeInput = input<typeof LikeC4Config_Styles_Theme>;
|
|
293
353
|
declare const LikeC4StylesConfigSchema: ZodPipe<ZodObject<{
|
|
294
354
|
theme: ZodOptional<ZodPipe<ZodObject<{
|
|
295
|
-
colors: ZodOptional<ZodPipe<ZodRecord<ZodPipe<ZodUnion<
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
355
|
+
colors: ZodOptional<ZodPipe<ZodRecord<ZodPipe<ZodUnion<[ZodEnum<{
|
|
356
|
+
[x: string]: any;
|
|
357
|
+
}>, ZodPipe<ZodCustom<string & Record<never, never>, string & Record<never, never>>, ZodTransform<any, string & Record<never, never>>>]>, ZodTransform<any, any>> & $partial, ZodPipe<ZodUnion<[ZodPipe<ZodObject<{
|
|
358
|
+
elements: ZodUnion<[ZodPipe<ZodObject<{
|
|
359
|
+
fill: ZodString;
|
|
360
|
+
stroke: ZodString;
|
|
361
|
+
hiContrast: ZodString;
|
|
362
|
+
loContrast: ZodString;
|
|
301
363
|
}, $strict>, ZodTransform<any, {
|
|
302
|
-
fill:
|
|
303
|
-
stroke:
|
|
304
|
-
hiContrast:
|
|
305
|
-
loContrast:
|
|
306
|
-
}
|
|
307
|
-
relationships:
|
|
308
|
-
line:
|
|
309
|
-
label:
|
|
310
|
-
labelBg: ZodDefault<ZodOptional<
|
|
364
|
+
fill: string;
|
|
365
|
+
stroke: string;
|
|
366
|
+
hiContrast: string;
|
|
367
|
+
loContrast: string;
|
|
368
|
+
}>>, ZodPipe<ZodString, ZodTransform<any, string>>]>;
|
|
369
|
+
relationships: ZodUnion<[ZodPipe<ZodObject<{
|
|
370
|
+
line: ZodString;
|
|
371
|
+
label: ZodString;
|
|
372
|
+
labelBg: ZodDefault<ZodOptional<ZodString>>;
|
|
311
373
|
}, $strict>, ZodTransform<any, {
|
|
312
|
-
line:
|
|
313
|
-
label:
|
|
314
|
-
labelBg:
|
|
315
|
-
}
|
|
316
|
-
}, $strict
|
|
317
|
-
|
|
374
|
+
line: string;
|
|
375
|
+
label: string;
|
|
376
|
+
labelBg: string;
|
|
377
|
+
}>>, ZodPipe<ZodString, ZodTransform<any, string>>]>;
|
|
378
|
+
}, $strict>, ZodTransform<any, {
|
|
379
|
+
elements: any;
|
|
380
|
+
relationships: any;
|
|
381
|
+
}>>, ZodPipe<ZodString, ZodTransform<any, string>>]>, ZodTransform<any, any>>>, ZodTransform<Record<ThemeColor, ThemeColorValues>, Partial<Record<any, any>>>>>;
|
|
382
|
+
sizes: ZodOptional<ZodRecord<ZodEnum<{
|
|
383
|
+
[x: string]: any;
|
|
384
|
+
}> & $partial, ZodObject<{
|
|
385
|
+
width: ZodNumber;
|
|
386
|
+
height: ZodNumber;
|
|
387
|
+
}, $strict>>>;
|
|
318
388
|
}, $strict>, ZodTransform<any, {
|
|
319
389
|
colors?: Record<ThemeColor, ThemeColorValues> | undefined;
|
|
320
|
-
sizes?: any
|
|
390
|
+
sizes?: Partial<Record<any, {
|
|
391
|
+
width: number;
|
|
392
|
+
height: number;
|
|
393
|
+
}>> | undefined;
|
|
321
394
|
}>>>;
|
|
322
395
|
defaults: ZodOptional<ZodObject<{
|
|
323
|
-
color: ZodOptional<ZodPipe<ZodUnion<
|
|
396
|
+
color: ZodOptional<ZodPipe<ZodUnion<[ZodEnum<{
|
|
397
|
+
[x: string]: any;
|
|
398
|
+
}>, ZodPipe<ZodCustom<string & Record<never, never>, string & Record<never, never>>, ZodTransform<any, string & Record<never, never>>>]>, ZodTransform<any, any>>>;
|
|
324
399
|
opacity: ZodOptional<ZodInt>;
|
|
325
|
-
border: ZodOptional<
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
400
|
+
border: ZodOptional<ZodEnum<{
|
|
401
|
+
[x: string]: any;
|
|
402
|
+
}>>;
|
|
403
|
+
size: ZodOptional<ZodEnum<{
|
|
404
|
+
[x: string]: any;
|
|
405
|
+
}>>;
|
|
406
|
+
shape: ZodOptional<ZodEnum<{
|
|
407
|
+
[x: string]: any;
|
|
408
|
+
}>>;
|
|
409
|
+
iconPosition: ZodOptional<ZodEnum<{
|
|
410
|
+
[x: string]: any;
|
|
411
|
+
}>>;
|
|
329
412
|
group: ZodOptional<ZodObject<{
|
|
330
|
-
color: ZodOptional<ZodPipe<ZodUnion<
|
|
413
|
+
color: ZodOptional<ZodPipe<ZodUnion<[ZodEnum<{
|
|
414
|
+
[x: string]: any;
|
|
415
|
+
}>, ZodPipe<ZodCustom<string & Record<never, never>, string & Record<never, never>>, ZodTransform<any, string & Record<never, never>>>]>, ZodTransform<any, any>>>;
|
|
331
416
|
opacity: ZodOptional<ZodInt>;
|
|
332
|
-
border: ZodOptional<
|
|
417
|
+
border: ZodOptional<ZodEnum<{
|
|
418
|
+
[x: string]: any;
|
|
419
|
+
}>>;
|
|
333
420
|
}, $strict>>;
|
|
334
421
|
relationship: ZodOptional<ZodObject<{
|
|
335
|
-
color: ZodOptional<ZodPipe<ZodUnion<
|
|
336
|
-
|
|
337
|
-
|
|
422
|
+
color: ZodOptional<ZodPipe<ZodUnion<[ZodEnum<{
|
|
423
|
+
[x: string]: any;
|
|
424
|
+
}>, ZodPipe<ZodCustom<string & Record<never, never>, string & Record<never, never>>, ZodTransform<any, string & Record<never, never>>>]>, ZodTransform<any, any>>>;
|
|
425
|
+
line: ZodOptional<ZodEnum<{
|
|
426
|
+
dashed: "dashed";
|
|
427
|
+
solid: "solid";
|
|
428
|
+
dotted: "dotted";
|
|
429
|
+
}>>;
|
|
430
|
+
arrow: ZodOptional<ZodEnum<{
|
|
431
|
+
[x: string]: any;
|
|
432
|
+
}>>;
|
|
338
433
|
}, $strict>>;
|
|
339
434
|
}, $strict>>;
|
|
340
435
|
customCss: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
|
|
@@ -486,4 +581,4 @@ declare function defineTheme<const S extends LikeC4ConfigThemeInput>(theme: S):
|
|
|
486
581
|
*/
|
|
487
582
|
declare function defineStyle<const S extends LikeC4StylesConfigInput>(styles: S): LikeC4ProjectStylesConfig; //#endregion
|
|
488
583
|
//#endregion
|
|
489
|
-
export {
|
|
584
|
+
export { isLikeC4JsonConfig as _, LikeC4ProjectConfig as a, LikeC4ProjectJsonConfig as c, defineConfig as d, defineGenerators as f, isLikeC4Config as g, defineThemeColor as h, IncludeConfig as i, LikeC4StylesConfig as l, defineTheme as m, GeneratorFnContext as n, LikeC4ProjectConfigInput as o, defineStyle as p, GeneratorFnParams as r, LikeC4ProjectConfigOps as s, GeneratorFn as t, LikeC4StylesConfigInput as u, isLikeC4NonJsonConfig as v };
|