likec4 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 +11 -1
- package/__app__/src/likec4.js +5941 -4496
- package/__app__/src/routes/index.js +3 -153
- package/__app__/src/routes/projects.js +21 -1087
- package/__app__/src/routes/single.js +1228 -16
- package/__app__/src/style.css +1 -1
- package/__app__/src/vendors.js +4649 -1897
- package/__app__/src/webcomponent.js +1 -1
- package/config/schema.json +169 -141
- package/dist/THIRD-PARTY-LICENSES.md +1769 -0
- package/dist/_chunks/LikeC4.mjs +1154 -202
- package/dist/_chunks/binary.mjs +72 -0
- package/dist/_chunks/index.d.mts +234 -140
- package/dist/_chunks/index2.d.mts +2043 -1828
- package/dist/_chunks/libs/@chevrotain/cst-dts-gen.mjs +30 -0
- 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 +114 -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.d.mts +61 -1
- package/dist/_chunks/libs/@nanostores/react.mjs +1 -30
- package/dist/_chunks/libs/@smithy/is-array-buffer.mjs +1 -10
- 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 +2913 -2876
- package/dist/_chunks/libs/langium.mjs +33 -20351
- package/dist/_chunks/libs/merge-error-cause.mjs +2 -746
- 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/pako.mjs +1 -0
- 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 +2 -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/rolldown-runtime.mjs +1 -48
- package/dist/_chunks/sequence.mjs +1 -0
- package/dist/_chunks/src.mjs +15 -0
- package/dist/_chunks/src2.mjs +499 -0
- package/dist/cli/index.mjs +77 -1952
- package/dist/config/index.d.mts +2 -2
- package/dist/config/index.mjs +1 -6
- package/dist/index.d.mts +150 -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 +7 -3
- package/dist/vite-plugin/index.mjs +1 -22
- package/dist/vite-plugin/internal.d.mts +6 -7
- package/dist/vite-plugin/internal.mjs +1 -68
- package/package.json +64 -45
- package/react/{index.d.ts → index.d.mts} +114 -72
- package/react/{index.js → index.mjs} +21320 -22041
- package/react/package.json +2 -5
- package/vite-plugin-modules.d.ts +10 -5
- package/dist/_chunks/LikeC4.d.mts +0 -121
- 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/libs/@chevrotain/gast.mjs +0 -3969
- package/dist/_chunks/libs/hono.mjs +0 -1829
- package/dist/_chunks/libs/nanoid.mjs +0 -29
- package/dist/_chunks/libs/nanostores.d.mts +0 -63
- package/dist/_chunks/libs/nanostores.mjs +0 -198
- 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/plugin.mjs +0 -996
- package/dist/_chunks/sequence-view.mjs +0 -575
- 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
- /package/dist/_chunks/{index4.d.mts → libs/@chevrotain/types.d.mts} +0 -0
package/dist/config/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../_chunks/libs/@modelcontextprotocol/sdk.mjs";
|
|
2
|
-
import { _ as
|
|
3
|
-
export { type GeneratorFn, type GeneratorFnContext, type GeneratorFnParams, type LikeC4ProjectConfig, type LikeC4ProjectConfigInput, type LikeC4ProjectJsonConfig, type LikeC4StylesConfig, type LikeC4StylesConfigInput, defineConfig, defineGenerators, defineStyle, defineTheme, defineThemeColor, isLikeC4Config, isLikeC4JsonConfig, isLikeC4NonJsonConfig };
|
|
2
|
+
import { _ as isLikeC4JsonConfig, a as LikeC4ProjectConfig, c as LikeC4ProjectJsonConfig, d as defineConfig, f as defineGenerators, g as isLikeC4Config, h as defineThemeColor, l as LikeC4StylesConfig, m as defineTheme, n as GeneratorFnContext, o as LikeC4ProjectConfigInput, p as defineStyle, r as GeneratorFnParams, s as LikeC4ProjectConfigOps, t as GeneratorFn, u as LikeC4StylesConfigInput, v as isLikeC4NonJsonConfig } from "../_chunks/index.mjs";
|
|
3
|
+
export { type GeneratorFn, type GeneratorFnContext, type GeneratorFnParams, type LikeC4ProjectConfig, type LikeC4ProjectConfigInput, LikeC4ProjectConfigOps, type LikeC4ProjectJsonConfig, type LikeC4StylesConfig, type LikeC4StylesConfigInput, defineConfig, defineGenerators, defineStyle, defineTheme, defineThemeColor, isLikeC4Config, isLikeC4JsonConfig, isLikeC4NonJsonConfig };
|
package/dist/config/index.mjs
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import "../_chunks/
|
|
2
|
-
import "../_chunks/libs/json5.mjs";
|
|
3
|
-
import "../_chunks/libs/@modelcontextprotocol/sdk.mjs";
|
|
4
|
-
import { a as defineThemeColor, c as isLikeC4NonJsonConfig, i as defineTheme, n as defineGenerators, o as isLikeC4Config, r as defineStyle, s as isLikeC4JsonConfig, t as defineConfig } from "../_chunks/define-config.mjs";
|
|
5
|
-
|
|
6
|
-
export { defineConfig, defineGenerators, defineStyle, defineTheme, defineThemeColor, isLikeC4Config, isLikeC4JsonConfig, isLikeC4NonJsonConfig };
|
|
1
|
+
import"../_chunks/libs/json5.mjs";import"../_chunks/libs/@hono/mcp.mjs";import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"../_chunks/src.mjs";export{r as LikeC4ProjectConfigOps,c as defineConfig,i as defineGenerators,o as defineStyle,n as defineTheme,e as defineThemeColor,a as isLikeC4Config,s as isLikeC4JsonConfig,t as isLikeC4NonJsonConfig};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,153 @@
|
|
|
1
|
-
import "./_chunks/rolldown-runtime.mjs";
|
|
2
1
|
import "./_chunks/libs/@modelcontextprotocol/sdk.mjs";
|
|
3
2
|
import "./_chunks/index.mjs";
|
|
4
|
-
import "./_chunks/
|
|
5
|
-
import "./_chunks/
|
|
6
|
-
import "./_chunks/
|
|
7
|
-
import
|
|
8
|
-
import "./_chunks/
|
|
3
|
+
import { t as Logger$1 } from "./_chunks/libs/@logtape/logtape.mjs";
|
|
4
|
+
import "./_chunks/libs/langium.mjs";
|
|
5
|
+
import { a as LikeC4Views, i as LikeC4SharedServices, n as LikeC4ModelBuilder, o as ProjectsManager, r as LikeC4Services, t as LikeC4LanguageServices } from "./_chunks/index2.mjs";
|
|
6
|
+
import "./_chunks/libs/@chevrotain/types.mjs";
|
|
7
|
+
import "./_chunks/libs/ts-graphviz.mjs";
|
|
8
|
+
import { LikeC4Model } from "@likec4/core/model";
|
|
9
|
+
import { LayoutedView, NonEmptyArray, ProjectId } from "@likec4/core/types";
|
|
9
10
|
export * from "@likec4/core/types";
|
|
10
|
-
|
|
11
|
+
|
|
12
|
+
//#region ../language-services/dist/_chunks/options.d.mts
|
|
13
|
+
//#region src/common/LikeC4.d.ts
|
|
14
|
+
interface LikeC4Langium {
|
|
15
|
+
shared: LikeC4SharedServices;
|
|
16
|
+
likec4: LikeC4Services;
|
|
17
|
+
}
|
|
18
|
+
declare class LikeC4$1 {
|
|
19
|
+
protected readonly langium: LikeC4Langium;
|
|
20
|
+
protected readonly logger: Logger$1;
|
|
21
|
+
constructor(langium: LikeC4Langium, logger?: Logger$1);
|
|
22
|
+
/**
|
|
23
|
+
* File system path to the workspace root
|
|
24
|
+
*/
|
|
25
|
+
get workspace(): any;
|
|
26
|
+
/**
|
|
27
|
+
* URI of the workspace root
|
|
28
|
+
*/
|
|
29
|
+
get workspaceURI(): any;
|
|
30
|
+
/**
|
|
31
|
+
* URL of the workspace root
|
|
32
|
+
*/
|
|
33
|
+
get workspaceURL(): any;
|
|
34
|
+
get languageServices(): LikeC4LanguageServices;
|
|
35
|
+
get projectsManager(): ProjectsManager;
|
|
36
|
+
get viewsService(): LikeC4Views;
|
|
37
|
+
get modelBuilder(): LikeC4ModelBuilder;
|
|
38
|
+
private get LangiumDocuments();
|
|
39
|
+
ensureSingleProject(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Diagram is a computed view, layouted using Graphviz
|
|
42
|
+
* If diagram has manual layout, it will be used.
|
|
43
|
+
* Used in React components
|
|
44
|
+
*/
|
|
45
|
+
diagrams(project?: string | undefined): Promise<LayoutedView[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Builds LikeC4Model from all documents
|
|
48
|
+
* Only computes view predicates {@link ComputedView} - i.e. no layout
|
|
49
|
+
* Not ready for rendering, but enough to traverse
|
|
50
|
+
*
|
|
51
|
+
* Sync version does not read manual layouts
|
|
52
|
+
* Use {@link computedModel} for a version that includes manual layouts
|
|
53
|
+
*/
|
|
54
|
+
syncComputedModel(project?: string | undefined): LikeC4Model.Computed;
|
|
55
|
+
/**
|
|
56
|
+
* Builds LikeC4Model from all documents
|
|
57
|
+
* Only computes view predicates {@link ComputedView} - i.e. no layout
|
|
58
|
+
* Not ready for rendering, but enough to traverse
|
|
59
|
+
*/
|
|
60
|
+
computedModel(project?: string | undefined): Promise<LikeC4Model.Computed>;
|
|
61
|
+
projects(): NonEmptyArray<ProjectId>;
|
|
62
|
+
/**
|
|
63
|
+
* Same as {@link computedModel()}, but also applies layout
|
|
64
|
+
* Ready for rendering
|
|
65
|
+
*/
|
|
66
|
+
layoutedModel(project?: string | undefined): Promise<LikeC4Model.Layouted>;
|
|
67
|
+
getErrors(): Array<{
|
|
68
|
+
message: string;
|
|
69
|
+
line: number;
|
|
70
|
+
range: {
|
|
71
|
+
start: {
|
|
72
|
+
line: number;
|
|
73
|
+
character: number;
|
|
74
|
+
};
|
|
75
|
+
end: {
|
|
76
|
+
line: number;
|
|
77
|
+
character: number;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
sourceFsPath: string;
|
|
81
|
+
}>;
|
|
82
|
+
hasErrors(): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* @returns true if there are errors
|
|
85
|
+
*/
|
|
86
|
+
printErrors(): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* @returns a function to dispose the listener
|
|
89
|
+
*/
|
|
90
|
+
onModelUpdate(listener: () => void): () => void;
|
|
91
|
+
dispose(): Promise<void>;
|
|
92
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
93
|
+
} //#endregion
|
|
94
|
+
//#region src/common/options.d.ts
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/logger.d.ts
|
|
97
|
+
/** Minimal logger interface (info, warn, error only). */
|
|
98
|
+
type Logger = {
|
|
99
|
+
info(msg: string): void;
|
|
100
|
+
warn(msg: unknown): void;
|
|
101
|
+
error(err: unknown): void;
|
|
102
|
+
};
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/LikeC4.d.ts
|
|
105
|
+
type LikeC4Options = {
|
|
106
|
+
/**
|
|
107
|
+
* By default, if LikeC4 model is invalid, errors are printed to the console.
|
|
108
|
+
* Disable this behavior by setting this option to false.
|
|
109
|
+
*
|
|
110
|
+
* @default true
|
|
111
|
+
*/
|
|
112
|
+
printErrors?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* If true, initialization will return rejected promise with the LikeC4 instance.
|
|
115
|
+
* Use `likec4.getErrors()` to get the errors.
|
|
116
|
+
* @default false
|
|
117
|
+
*/
|
|
118
|
+
throwIfInvalid?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Logger to use for the language service.
|
|
121
|
+
* false - no output
|
|
122
|
+
* @default 'default'
|
|
123
|
+
*/
|
|
124
|
+
logger?: Logger | 'vite' | 'default' | false;
|
|
125
|
+
/**
|
|
126
|
+
* Whether to use the `dot` binary for layouting or the WebAssembly version.
|
|
127
|
+
* @default 'wasm'
|
|
128
|
+
*/
|
|
129
|
+
graphviz?: 'wasm' | 'binary';
|
|
130
|
+
/**
|
|
131
|
+
* Whether to start MCP server
|
|
132
|
+
* @default false
|
|
133
|
+
*/
|
|
134
|
+
mcp?: false | 'stdio' | {
|
|
135
|
+
port: number;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Whether to watch for changes in the workspace.
|
|
139
|
+
* @default false
|
|
140
|
+
*/
|
|
141
|
+
watch?: boolean;
|
|
142
|
+
};
|
|
143
|
+
interface LikeC4 extends LikeC4$1 {}
|
|
144
|
+
declare namespace LikeC4 {
|
|
145
|
+
function fromSource(likec4SourceCode: string, opts?: LikeC4Options): Promise<LikeC4>;
|
|
146
|
+
/**
|
|
147
|
+
* Initializes a LikeC4 instance from the specified workspace path.
|
|
148
|
+
* By default in current folder
|
|
149
|
+
*/
|
|
150
|
+
function fromWorkspace(path?: string, opts?: LikeC4Options): Promise<LikeC4>;
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
export { LikeC4, type LikeC4Options };
|
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1 @@
|
|
|
1
|
-
import "./_chunks/
|
|
2
|
-
import "./_chunks/libs/defu.mjs";
|
|
3
|
-
import "./_chunks/libs/langium.mjs";
|
|
4
|
-
import "./_chunks/libs/@chevrotain/regexp-to-ast.mjs";
|
|
5
|
-
import "./_chunks/libs/chevrotain.mjs";
|
|
6
|
-
import "./_chunks/libs/chevrotain-allstar.mjs";
|
|
7
|
-
import "./_chunks/libs/tinyrainbow.mjs";
|
|
8
|
-
import "./_chunks/module.mjs";
|
|
9
|
-
import "./_chunks/libs/json5.mjs";
|
|
10
|
-
import "./_chunks/libs/@modelcontextprotocol/sdk.mjs";
|
|
11
|
-
import "./_chunks/libs/eventemitter3.mjs";
|
|
12
|
-
import "./_chunks/libs/@hono/node-server.mjs";
|
|
13
|
-
import "./_chunks/libs/hono.mjs";
|
|
14
|
-
import "./_chunks/libs/@lume/kiwi.mjs";
|
|
15
|
-
import "./_chunks/libs/ts-graphviz.mjs";
|
|
16
|
-
import "./_chunks/libs/word-wrap.mjs";
|
|
17
|
-
import "./_chunks/libs/isexe.mjs";
|
|
18
|
-
import "./_chunks/libs/which.mjs";
|
|
19
|
-
import { t as LikeC4 } from "./_chunks/LikeC4.mjs";
|
|
20
|
-
|
|
21
|
-
export { LikeC4 };
|
|
1
|
+
import"./_chunks/libs/remeda.mjs";import"./_chunks/libs/@logtape/logtape.mjs";import"./_chunks/libs/merge-error-cause.mjs";import"./_chunks/libs/is-error-instance.mjs";import"./_chunks/libs/is-plain-obj.mjs";import"./_chunks/libs/safe-stringify.mjs";import"./_chunks/binary.mjs";import"./_chunks/libs/defu.mjs";import"./_chunks/libs/pathe.mjs";import"./_chunks/libs/tinyrainbow.mjs";import"./_chunks/libs/json5.mjs";import"./_chunks/libs/@hono/mcp.mjs";import"./_chunks/src.mjs";import"./_chunks/libs/langium.mjs";import"./_chunks/libs/@chevrotain/regexp-to-ast.mjs";import"./_chunks/libs/chevrotain.mjs";import"./_chunks/libs/@chevrotain/cst-dts-gen.mjs";import"./_chunks/libs/@chevrotain/utils.mjs";import"./_chunks/libs/chevrotain-allstar.mjs";import"./_chunks/libs/eventemitter3.mjs";import"./_chunks/libs/p-queue.mjs";import"./_chunks/libs/fast-equals.mjs";import"./_chunks/sequence.mjs";import"./_chunks/libs/@lume/kiwi.mjs";import"./_chunks/libs/ts-graphviz.mjs";import"./_chunks/libs/word-wrap.mjs";import"./_chunks/libs/khroma.mjs";import"./_chunks/libs/p-limit.mjs";import"./_chunks/libs/picomatch.mjs";import"./_chunks/libs/ufo.mjs";import"./_chunks/libs/parse-ms.mjs";import"./_chunks/libs/pretty-ms.mjs";import"./_chunks/libs/@msgpack/msgpack.mjs";import"./_chunks/libs/@smithy/is-array-buffer.mjs";import"./_chunks/libs/@smithy/util-base64.mjs";import"./_chunks/libs/strip-indent.mjs";import"./_chunks/libs/isexe.mjs";import"./_chunks/libs/which.mjs";import{t as e}from"./_chunks/LikeC4.mjs";import"./_chunks/libs/@modelcontextprotocol/sdk.mjs";import"./_chunks/libs/@hono/node-server.mjs";export{e as LikeC4};
|
package/dist/model/builder.mjs
CHANGED
package/dist/model/index.d.mts
CHANGED
|
@@ -1,4 +1,58 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import
|
|
1
|
+
import { Connection, ConnectionModel, DeployedInstanceModel, DeploymentConnectionModel, DeploymentElementModel, DeploymentNodeModel, DeploymentRelationEndpoint, DeploymentRelationModel, EdgeModel, ElementModel, LikeC4DeploymentModel, LikeC4Model, LikeC4Model as LikeC4Model$1, LikeC4ViewModel, NodeModel, RelationshipModel, deploymentConnection, differenceConnections, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isDeployedInstanceModel, isDeploymentElementModel, isDeploymentNodeModel, isDeploymentRelationModel, isEdgeModel, isElementModel, isIncoming, isLikeC4ViewModel, isNestedConnection, isNestedElementOfDeployedInstanceModel, isNodeModel, isOutgoing, isRelationModel, mergeConnections, modelConnection, sortConnectionsByBoundaryHierarchy, sortDeepestFirst } from "@likec4/core/model";
|
|
2
|
+
import * as types from "@likec4/core/types";
|
|
3
|
+
import { BBox, LayoutedDynamicView, NodeId, ViewId } from "@likec4/core/types";
|
|
4
|
+
import { ComputedProjectEdge, ComputedProjectNode, ComputedProjectsView, LayoutedProjectEdge, LayoutedProjectNode, LayoutedProjectsView } from "@likec4/core/compute-view";
|
|
3
5
|
export * from "@likec4/core/types";
|
|
4
|
-
|
|
6
|
+
|
|
7
|
+
//#region ../layouts/dist/sequence/index.d.mts
|
|
8
|
+
//#region src/sequence/_types.d.ts
|
|
9
|
+
interface SequenceActorStepPort {
|
|
10
|
+
id: string;
|
|
11
|
+
cx: number;
|
|
12
|
+
cy: number;
|
|
13
|
+
height: number;
|
|
14
|
+
type: 'target' | 'source';
|
|
15
|
+
position: 'left' | 'right' | 'top' | 'bottom';
|
|
16
|
+
}
|
|
17
|
+
interface SequenceActor {
|
|
18
|
+
id: NodeId;
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
ports: Array<SequenceActorStepPort>;
|
|
24
|
+
}
|
|
25
|
+
interface SequenceCompound {
|
|
26
|
+
id: NodeId;
|
|
27
|
+
origin: NodeId;
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
depth: number;
|
|
33
|
+
}
|
|
34
|
+
interface SequenceParallelArea {
|
|
35
|
+
parallelPrefix: string;
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
}
|
|
41
|
+
interface SequenceViewLayout {
|
|
42
|
+
id: ViewId;
|
|
43
|
+
actors: Array<SequenceActor>;
|
|
44
|
+
compounds: Array<SequenceCompound>;
|
|
45
|
+
parallelAreas: Array<SequenceParallelArea>;
|
|
46
|
+
bounds: BBox;
|
|
47
|
+
} //#endregion
|
|
48
|
+
//#region src/sequence/sequence-view.d.ts
|
|
49
|
+
declare function calcSequenceLayout(view: LayoutedDynamicView): LayoutedDynamicView.Sequence.Layout; //#endregion
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/model/index.d.ts
|
|
52
|
+
type UnknownLayouted = types.UnknownLayouted;
|
|
53
|
+
/**
|
|
54
|
+
* Used by vite plugin to generate `virtual:likec4/model`
|
|
55
|
+
*/
|
|
56
|
+
declare function createLikeC4Model(model: any): LikeC4Model$1<UnknownLayouted>;
|
|
57
|
+
//#endregion
|
|
58
|
+
export { type ComputedProjectEdge, type ComputedProjectNode, type ComputedProjectsView, Connection, ConnectionModel, DeployedInstanceModel, DeploymentConnectionModel, type DeploymentElementModel, DeploymentNodeModel, type DeploymentRelationEndpoint, DeploymentRelationModel, EdgeModel, ElementModel, type LayoutedProjectEdge, type LayoutedProjectNode, type LayoutedProjectsView, LikeC4DeploymentModel, LikeC4Model, LikeC4ViewModel, NodeModel, RelationshipModel, type SequenceViewLayout, UnknownLayouted, calcSequenceLayout, createLikeC4Model, deploymentConnection, differenceConnections, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isDeployedInstanceModel, isDeploymentElementModel, isDeploymentNodeModel, isDeploymentRelationModel, isEdgeModel, isElementModel, isIncoming, isLikeC4ViewModel, isNestedConnection, isNestedElementOfDeployedInstanceModel, isNodeModel, isOutgoing, isRelationModel, mergeConnections, modelConnection, sortConnectionsByBoundaryHierarchy, sortDeepestFirst, type types };
|
package/dist/model/index.mjs
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "../_chunks/libs/@lume/kiwi.mjs";
|
|
3
|
-
import { A as isIncoming, B as sortDeepestFirst, C as isAnyInOut, D as isDeploymentRelationModel, E as isDeploymentNodeModel, F as isOutgoing, I as isRelationModel, L as mergeConnections, M as isNestedConnection, N as isNestedElementOfDeployedInstanceModel, O as isEdgeModel, P as isNodeModel, R as modelConnection, S as hasSameTarget, T as isDeploymentElementModel, _ as findAscendingConnections, a as DeploymentNodeModel, b as hasSameSource, c as ElementModel, d as LikeC4ViewModel, f as NodeModel, g as differenceConnections, h as deploymentConnection, i as DeploymentConnectionModel, j as isLikeC4ViewModel, k as isElementModel, l as LikeC4DeploymentModel, m as createLikeC4Model, n as ConnectionModel, o as DeploymentRelationModel, p as RelationshipModel, r as DeployedInstanceModel, s as EdgeModel, t as Connection, u as LikeC4Model, v as findDeepestNestedConnection, w as isDeployedInstanceModel, x as hasSameSourceTarget, y as findDescendantConnections, z as sortConnectionsByBoundaryHierarchy } from "../_chunks/model.mjs";
|
|
4
|
-
|
|
5
|
-
export { Connection, ConnectionModel, DeployedInstanceModel, DeploymentConnectionModel, DeploymentNodeModel, DeploymentRelationModel, EdgeModel, ElementModel, LikeC4DeploymentModel, LikeC4Model, LikeC4ViewModel, NodeModel, RelationshipModel, calcSequenceLayout, createLikeC4Model, deploymentConnection, differenceConnections, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isDeployedInstanceModel, isDeploymentElementModel, isDeploymentNodeModel, isDeploymentRelationModel, isEdgeModel, isElementModel, isIncoming, isLikeC4ViewModel, isNestedConnection, isNestedElementOfDeployedInstanceModel, isNodeModel, isOutgoing, isRelationModel, mergeConnections, modelConnection, sortConnectionsByBoundaryHierarchy, sortDeepestFirst };
|
|
1
|
+
import"../_chunks/libs/remeda.mjs";import{t as e}from"../_chunks/sequence.mjs";import"../_chunks/libs/@lume/kiwi.mjs";import{Connection as t,ConnectionModel as n,DeployedInstanceModel as r,DeploymentConnectionModel as i,DeploymentNodeModel as a,DeploymentRelationModel as o,EdgeModel as s,ElementModel as c,LikeC4DeploymentModel as l,LikeC4Model as u,LikeC4Model as d,LikeC4ViewModel as f,NodeModel as p,RelationshipModel as m,deploymentConnection as h,differenceConnections as g,findAscendingConnections as _,findDeepestNestedConnection as v,findDescendantConnections as y,hasSameSource as b,hasSameSourceTarget as x,hasSameTarget as S,isAnyInOut as C,isDeployedInstanceModel as w,isDeploymentElementModel as T,isDeploymentNodeModel as E,isDeploymentRelationModel as D,isEdgeModel as O,isElementModel as k,isIncoming as A,isLikeC4ViewModel as j,isNestedConnection as M,isNestedElementOfDeployedInstanceModel as N,isNodeModel as P,isOutgoing as F,isRelationModel as I,mergeConnections as L,modelConnection as R,sortConnectionsByBoundaryHierarchy as z,sortDeepestFirst as B}from"@likec4/core/model";function V(e){return d.create(e)}export{t as Connection,n as ConnectionModel,r as DeployedInstanceModel,i as DeploymentConnectionModel,a as DeploymentNodeModel,o as DeploymentRelationModel,s as EdgeModel,c as ElementModel,l as LikeC4DeploymentModel,u as LikeC4Model,f as LikeC4ViewModel,p as NodeModel,m as RelationshipModel,e as calcSequenceLayout,V as createLikeC4Model,h as deploymentConnection,g as differenceConnections,_ as findAscendingConnections,v as findDeepestNestedConnection,y as findDescendantConnections,b as hasSameSource,x as hasSameSourceTarget,S as hasSameTarget,C as isAnyInOut,w as isDeployedInstanceModel,T as isDeploymentElementModel,E as isDeploymentNodeModel,D as isDeploymentRelationModel,O as isEdgeModel,k as isElementModel,A as isIncoming,j as isLikeC4ViewModel,M as isNestedConnection,N as isNestedElementOfDeployedInstanceModel,P as isNodeModel,F as isOutgoing,I as isRelationModel,L as mergeConnections,R as modelConnection,z as sortConnectionsByBoundaryHierarchy,B as sortDeepestFirst};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import "../_chunks/libs/@modelcontextprotocol/sdk.mjs";
|
|
2
2
|
import "../_chunks/index.mjs";
|
|
3
|
+
import "../_chunks/libs/langium.mjs";
|
|
3
4
|
import { t as LikeC4LanguageServices } from "../_chunks/index2.mjs";
|
|
5
|
+
import "../_chunks/libs/@chevrotain/types.mjs";
|
|
6
|
+
import "../_chunks/libs/ts-graphviz.mjs";
|
|
4
7
|
import { Plugin } from "vite";
|
|
5
8
|
|
|
6
|
-
//#region
|
|
9
|
+
//#region ../vite-plugin/dist/index.d.mts
|
|
10
|
+
//#region src/plugin.d.ts
|
|
7
11
|
type SharedOptions = {
|
|
8
12
|
/**
|
|
9
13
|
* Define vite environments where this plugin should be active
|
|
@@ -43,7 +47,7 @@ type LikeC4VitePluginOptions = SharedOptions & ({
|
|
|
43
47
|
languageServices?: never;
|
|
44
48
|
} | {
|
|
45
49
|
/**
|
|
46
|
-
* If you have instance of {@link
|
|
50
|
+
* If you have instance of {@link LikeC4LanguageServices}
|
|
47
51
|
* you can pass `languageServices` from it.
|
|
48
52
|
*/
|
|
49
53
|
languageServices: LikeC4LanguageServices;
|
|
@@ -56,6 +60,6 @@ type LikeC4VitePluginOptions = SharedOptions & ({
|
|
|
56
60
|
declare function LikeC4VitePlugin({
|
|
57
61
|
environments,
|
|
58
62
|
...opts
|
|
59
|
-
}: LikeC4VitePluginOptions): Plugin;
|
|
63
|
+
}: LikeC4VitePluginOptions): Plugin; //#endregion
|
|
60
64
|
//#endregion
|
|
61
65
|
export { LikeC4VitePlugin, type LikeC4VitePluginOptions };
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "../_chunks/libs/defu.mjs";
|
|
3
|
-
import "../_chunks/libs/langium.mjs";
|
|
4
|
-
import "../_chunks/libs/@chevrotain/regexp-to-ast.mjs";
|
|
5
|
-
import "../_chunks/libs/chevrotain.mjs";
|
|
6
|
-
import "../_chunks/libs/chevrotain-allstar.mjs";
|
|
7
|
-
import "../_chunks/libs/tinyrainbow.mjs";
|
|
8
|
-
import "../_chunks/module.mjs";
|
|
9
|
-
import "../_chunks/libs/json5.mjs";
|
|
10
|
-
import "../_chunks/libs/@modelcontextprotocol/sdk.mjs";
|
|
11
|
-
import "../_chunks/libs/eventemitter3.mjs";
|
|
12
|
-
import "../_chunks/libs/@hono/node-server.mjs";
|
|
13
|
-
import "../_chunks/libs/hono.mjs";
|
|
14
|
-
import "../_chunks/libs/@lume/kiwi.mjs";
|
|
15
|
-
import "../_chunks/libs/ts-graphviz.mjs";
|
|
16
|
-
import "../_chunks/libs/word-wrap.mjs";
|
|
17
|
-
import "../_chunks/libs/isexe.mjs";
|
|
18
|
-
import "../_chunks/libs/which.mjs";
|
|
19
|
-
import "../_chunks/LikeC4.mjs";
|
|
20
|
-
import { t as LikeC4VitePlugin } from "../_chunks/plugin.mjs";
|
|
21
|
-
|
|
22
|
-
export { LikeC4VitePlugin };
|
|
1
|
+
import"../_chunks/libs/birpc.mjs";import"../_chunks/libs/remeda.mjs";import"../_chunks/libs/@logtape/logtape.mjs";import"../_chunks/libs/merge-error-cause.mjs";import"../_chunks/libs/is-error-instance.mjs";import"../_chunks/libs/is-plain-obj.mjs";import"../_chunks/libs/safe-stringify.mjs";import"../_chunks/binary.mjs";import"../_chunks/libs/defu.mjs";import"../_chunks/libs/pathe.mjs";import"../_chunks/libs/tinyrainbow.mjs";import"../_chunks/libs/json5.mjs";import"../_chunks/libs/@hono/mcp.mjs";import"../_chunks/src.mjs";import"../_chunks/libs/langium.mjs";import"../_chunks/libs/@chevrotain/regexp-to-ast.mjs";import"../_chunks/libs/chevrotain.mjs";import"../_chunks/libs/@chevrotain/cst-dts-gen.mjs";import"../_chunks/libs/@chevrotain/utils.mjs";import"../_chunks/libs/chevrotain-allstar.mjs";import"../_chunks/libs/eventemitter3.mjs";import"../_chunks/libs/p-queue.mjs";import"../_chunks/libs/fast-equals.mjs";import"../_chunks/sequence.mjs";import"../_chunks/libs/@lume/kiwi.mjs";import"../_chunks/libs/ts-graphviz.mjs";import"../_chunks/libs/word-wrap.mjs";import"../_chunks/libs/khroma.mjs";import"../_chunks/libs/p-limit.mjs";import"../_chunks/libs/picomatch.mjs";import"../_chunks/libs/ufo.mjs";import"../_chunks/libs/parse-ms.mjs";import"../_chunks/libs/pretty-ms.mjs";import"../_chunks/libs/@msgpack/msgpack.mjs";import"../_chunks/libs/@smithy/is-array-buffer.mjs";import"../_chunks/libs/@smithy/util-base64.mjs";import"../_chunks/libs/strip-indent.mjs";import"../_chunks/libs/isexe.mjs";import"../_chunks/libs/which.mjs";import{t as e}from"../_chunks/src2.mjs";import"../_chunks/libs/pako.mjs";export{e as LikeC4VitePlugin};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { n as computed, t as batched } from "../_chunks/libs/nanostores.mjs";
|
|
1
|
+
import { a as Atom, c as atom, i as map, n as batched, o as ReadableAtom, r as computed, s as WritableAtom, t as useStore } from "../_chunks/libs/@nanostores/react.mjs";
|
|
3
2
|
import { LayoutedElementView, ProjectId, ViewChange, ViewId } from "@likec4/core/types";
|
|
4
3
|
import { AdhocViewPredicate } from "@likec4/core/compute-view";
|
|
5
4
|
|
|
6
|
-
//#region
|
|
5
|
+
//#region ../vite-plugin/dist/internal.d.mts
|
|
6
|
+
//#region src/rpc/protocol.d.ts
|
|
7
7
|
interface LikeC4VitePluginRpc {
|
|
8
8
|
/**
|
|
9
9
|
* Send a view change to the server
|
|
@@ -22,9 +22,8 @@ interface LikeC4VitePluginRpc {
|
|
|
22
22
|
projectId: ProjectId;
|
|
23
23
|
predicates: AdhocViewPredicate[];
|
|
24
24
|
}): Promise<LayoutedElementView>;
|
|
25
|
-
}
|
|
26
|
-
//#
|
|
27
|
-
//#region src/vite-plugin/internal.d.ts
|
|
25
|
+
} //#endregion
|
|
26
|
+
//#region src/internal.d.ts
|
|
28
27
|
interface LikeC4VitePluginRpcOptions {
|
|
29
28
|
/**
|
|
30
29
|
* Function to post raw message
|
|
@@ -40,6 +39,6 @@ interface LikeC4VitePluginRpcOptions {
|
|
|
40
39
|
* used by the Vite plugin in virtual modules
|
|
41
40
|
*/
|
|
42
41
|
declare function createRpc(options: LikeC4VitePluginRpcOptions): LikeC4VitePluginRpc;
|
|
43
|
-
declare const createHooksForModel: ($atom: WritableAtom) => any;
|
|
42
|
+
declare const createHooksForModel: ($atom: WritableAtom) => any; //#endregion
|
|
44
43
|
//#endregion
|
|
45
44
|
export { type Atom, type LikeC4VitePluginRpc, LikeC4VitePluginRpcOptions, type ReadableAtom, type WritableAtom, atom, batched, computed, createHooksForModel, createRpc, map, useStore };
|
|
@@ -1,68 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { t as createBirpc } from "../_chunks/libs/birpc.mjs";
|
|
3
|
-
import { i as atom, n as batched, r as computed, t as map } from "../_chunks/libs/nanostores.mjs";
|
|
4
|
-
import { t as useStore } from "../_chunks/libs/@nanostores/react.mjs";
|
|
5
|
-
import { LikeC4Model } from "@likec4/core/model";
|
|
6
|
-
import { useEffect, useState } from "react";
|
|
7
|
-
|
|
8
|
-
//#region src/vite-plugin/internal.ts
|
|
9
|
-
/**
|
|
10
|
-
* This module is used by the Vite plugin to generate the virtual modules
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Create a PluginRPC instance for the LikeC4 Vite plugin
|
|
14
|
-
* used by the Vite plugin in virtual modules
|
|
15
|
-
*/
|
|
16
|
-
function createRpc(options) {
|
|
17
|
-
return createBirpc({}, {
|
|
18
|
-
post: (data) => options.send("likec4:rpc", data),
|
|
19
|
-
on: (fn) => options.on("likec4:rpc", fn),
|
|
20
|
-
onGeneralError(error, functionName) {
|
|
21
|
-
console.error(`RPC error in ${functionName}`, { error });
|
|
22
|
-
},
|
|
23
|
-
onFunctionError: (error, functionName) => {
|
|
24
|
-
console.error(`RPC error in ${functionName}`, { error });
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
const createHooksForModel = ($atom) => {
|
|
29
|
-
const $likec4model = /* @__PURE__ */ computed($atom, (data) => LikeC4Model.create(data));
|
|
30
|
-
function updateModel(data) {
|
|
31
|
-
const current = $atom.get();
|
|
32
|
-
if (t(current, data)) return;
|
|
33
|
-
const next = {
|
|
34
|
-
...data,
|
|
35
|
-
views: t$1(data.views, (next) => {
|
|
36
|
-
const currentView = current.views[next.id];
|
|
37
|
-
return t(currentView, next) ? currentView : next;
|
|
38
|
-
})
|
|
39
|
-
};
|
|
40
|
-
$atom.set(next);
|
|
41
|
-
}
|
|
42
|
-
const $likec4views = /* @__PURE__ */ computed($atom, (model) => Object.values(model.views));
|
|
43
|
-
function useLikeC4Model() {
|
|
44
|
-
return useStore($likec4model);
|
|
45
|
-
}
|
|
46
|
-
function useLikeC4Views() {
|
|
47
|
-
return useStore($likec4views);
|
|
48
|
-
}
|
|
49
|
-
function useLikeC4View(viewId) {
|
|
50
|
-
const [view, setView] = useState($atom.value?.views[viewId] ?? null);
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
return $atom.subscribe((next) => {
|
|
53
|
-
setView(next.views[viewId] ?? null);
|
|
54
|
-
});
|
|
55
|
-
}, [viewId]);
|
|
56
|
-
return view;
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
updateModel,
|
|
60
|
-
$likec4model,
|
|
61
|
-
useLikeC4Model,
|
|
62
|
-
useLikeC4Views,
|
|
63
|
-
useLikeC4View
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
//#endregion
|
|
68
|
-
export { atom, batched, computed, createHooksForModel, createRpc, map, useStore };
|
|
1
|
+
import{a as e,i as t,n,r,t as i}from"../_chunks/libs/@nanostores/react.mjs";import{t as a}from"../_chunks/libs/birpc.mjs";import{F as o,_ as s}from"../_chunks/libs/remeda.mjs";import{LikeC4Model as c}from"@likec4/core/model";import{useEffect as l,useState as u}from"react";function d(e){return a({},{post:t=>e.send(`likec4:rpc`,t),on:t=>e.on(`likec4:rpc`,t),onGeneralError(e,t){console.error(`RPC error in ${t}`,{error:e})},onFunctionError:(e,t)=>{console.error(`RPC error in ${t}`,{error:e})}})}const f=e=>{let n=t(e,e=>c.create(e));function r(t){let n=e.get();if(o(n,t))return;let r={...t,views:s(t.views,e=>{let t=n.views[e.id];return o(t,e)?t:e})};e.set(r)}let a=t(e,e=>Object.values(e.views));function d(){return i(n)}function f(){return i(a)}function p(t){let[n,r]=u(e.value?.views[t]??null);return l(()=>e.subscribe(e=>{r(e.views[t]??null)}),[t]),n}return{updateModel:r,$likec4model:n,useLikeC4Model:d,useLikeC4Views:f,useLikeC4View:p}};export{e as atom,r as batched,t as computed,f as createHooksForModel,d as createRpc,n as map,i as useStore};
|