likec4 1.59.4 → 1.61.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 +2 -0
- package/__app__/codegen/react.mjs +4 -10
- package/__app__/codegen/webcomponent.mjs +6 -131
- package/__app__/index.html +15 -15
- package/__app__/src/aichat/index.mjs +11 -7
- package/__app__/src/chunks/AIChat.mjs +1355 -739
- package/__app__/src/chunks/ErrorComponent.mjs +444 -0
- package/__app__/src/chunks/Header.mjs +269 -0
- package/__app__/src/chunks/ViewReact.mjs +438 -0
- package/__app__/src/chunks/find.mjs +38 -0
- package/__app__/src/chunks/hooks.mjs +158 -472
- package/__app__/src/chunks/libs/@tabler/icons-react.mjs +340 -0
- package/__app__/src/chunks/libs/@tanstack-ai.mjs +11841 -1417
- package/__app__/src/chunks/libs/@tanstack.mjs +5110 -2404
- package/__app__/src/chunks/libs/fast-equals.mjs +507 -214
- package/__app__/src/chunks/libs/html-to-image.mjs +613 -0
- package/__app__/src/chunks/libs/nanostores.mjs +170 -0
- package/__app__/src/chunks/libs/react-resizable-panels.mjs +2792 -0
- package/__app__/src/chunks/react.mjs +22 -0
- package/__app__/src/chunks/rolldown-runtime.mjs +16 -29
- package/__app__/src/chunks/router.mjs +106 -0
- package/__app__/src/chunks/scope.mjs +106 -0
- package/__app__/src/chunks/searchParams.mjs +29 -0
- package/__app__/src/chunks/single-index.mjs +465 -0
- package/__app__/src/chunks/styled-system.mjs +1826 -2528
- package/__app__/src/chunks/useAsync.mjs +69 -0
- package/__app__/src/chunks/useSyncedRef.mjs +16 -0
- package/__app__/src/components/ColorSchemeToggle.mjs +124 -0
- package/__app__/src/components/CopyToClipboard.mjs +53 -0
- package/__app__/src/components/ErrorComponent.mjs +1 -0
- package/__app__/src/components/NavigationPanel.mjs +63 -0
- package/__app__/src/components/NotFound.mjs +155 -0
- package/__app__/src/components/ViewOutlet.mjs +9 -0
- package/__app__/src/components/model-diff/CompareModelProvider.mjs +44 -0
- package/__app__/src/components/model-diff/ModelDiffPanel.mjs +179 -0
- package/__app__/src/components/model-diff/compare-model.mjs +76 -0
- package/__app__/src/components/model-diff/state.mjs +45 -0
- package/__app__/src/components/search/OverviewSearch.mjs +92 -0
- package/__app__/src/components/search/OverviewSearchAdapter.mjs +94 -0
- package/__app__/src/components/sidebar/DiagramTree.css.mjs +48 -0
- package/__app__/src/components/sidebar/DiagramsTree.mjs +304 -0
- package/__app__/src/components/sidebar/Drawer.mjs +178 -0
- package/__app__/src/components/sidebar/SidebarBurger.mjs +28 -0
- package/__app__/src/components/sidebar/data.mjs +94 -0
- package/__app__/src/components/sidebar/state.mjs +16 -0
- package/__app__/src/components/view-page/Header.mjs +1 -0
- package/__app__/src/components/view-page/SelectProject.mjs +258 -0
- package/__app__/src/components/view-page/ShareModal.mjs +111 -0
- package/__app__/src/components/view-page/share-modal/AlertLocalhost.mjs +31 -0
- package/__app__/src/components/view-page/share-modal/CopyButtonChild.mjs +36 -0
- package/__app__/src/components/view-page/share-modal/EmbedPanel.mjs +100 -0
- package/__app__/src/components/view-page/share-modal/WebcomponentsPanel.mjs +264 -0
- package/__app__/src/components/view-page/state.mjs +17 -0
- package/__app__/src/context/LikeC4CustomizationContext.mjs +26 -0
- package/__app__/src/context/LikeC4IconRendererContext.mjs +29 -0
- package/__app__/src/context/LikeC4ModelContext.mjs +34 -0
- package/__app__/src/context/LikeC4ProjectsContext.mjs +40 -0
- package/__app__/src/context/ModelDiffsContext.mjs +33 -0
- package/__app__/src/context/safeCtx.mjs +14 -0
- package/__app__/src/fonts.css +112 -1
- package/__app__/src/hooks.mjs +1 -0
- package/__app__/src/main.mjs +6 -29151
- package/__app__/src/pages/EmbedPage.mjs +93 -0
- package/__app__/src/pages/ExportPage.mjs +691 -0
- package/__app__/src/pages/ProjectsOverview.mjs +23 -0
- package/__app__/src/pages/ViewAsD2.mjs +105 -0
- package/__app__/src/pages/ViewAsDot.mjs +65 -0
- package/__app__/src/pages/ViewAsMmd.mjs +109 -0
- package/__app__/src/pages/ViewAsPuml.mjs +105 -0
- package/__app__/src/pages/ViewEditor.mjs +220 -0
- package/__app__/src/pages/ViewReact.mjs +1 -0
- package/__app__/src/pages/export-layout.mjs +95 -0
- package/__app__/src/pages/export-page-params.mjs +9 -0
- package/__app__/src/pages/styles.css.mjs +23 -0
- package/__app__/src/routeTree.gen.mjs +105 -0
- package/__app__/src/router.mjs +1 -0
- package/__app__/src/routes/__root.mjs +65 -0
- package/__app__/src/routes/index.css.mjs +29 -0
- package/__app__/src/routes/index.mjs +32 -0
- package/__app__/src/routes/project._projectId/-components.mjs +100 -0
- package/__app__/src/routes/project._projectId/embed._viewId.mjs +5 -0
- package/__app__/src/routes/project._projectId/export._viewId.mjs +24 -0
- package/__app__/src/routes/project._projectId/index.mjs +14 -0
- package/__app__/src/routes/project._projectId/route.mjs +93 -0
- package/__app__/src/routes/project._projectId/view._viewId.d2.mjs +34 -0
- package/__app__/src/routes/project._projectId/view._viewId.dot.mjs +41 -0
- package/__app__/src/routes/project._projectId/view._viewId.index.mjs +7 -0
- package/__app__/src/routes/project._projectId/view._viewId.mjs +23 -0
- package/__app__/src/routes/project._projectId/view._viewId.mmd.mjs +39 -0
- package/__app__/src/routes/project._projectId/view._viewId.puml.mjs +34 -0
- package/__app__/src/routes/projects.mjs +36 -0
- package/__app__/src/routes/single-index.mjs +1 -0
- package/__app__/src/routes/webcomponent._.mjs +94 -0
- package/__app__/src/style.css +18497 -1
- package/config/schema.json +146 -97
- package/dist/app/render-view-client.css +1 -1
- package/dist/app/render-view-client.js +394 -238
- package/dist/chunks/enableServer.mjs +1 -1
- package/dist/chunks/filenames.mjs +25 -17
- package/dist/chunks/generate-likec4.mjs +5 -0
- package/dist/chunks/index.d.mts +255 -194
- package/dist/chunks/index2.d.mts +8246 -3610
- package/dist/chunks/libs/@chenglou/pretext.mjs +9 -0
- package/dist/chunks/libs/@chevrotain/gast.mjs +27 -1
- package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +81 -9
- package/dist/chunks/libs/@logtape/logtape.mjs +5 -4
- package/dist/chunks/libs/@lume/kiwi.mjs +1 -1
- package/dist/chunks/libs/@ts-graphviz/common.d.mts +2 -4
- package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
- package/dist/chunks/libs/birpc.mjs +1 -1
- package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
- package/dist/chunks/libs/chevrotain.mjs +88 -36
- package/dist/chunks/libs/clone.mjs +1 -0
- package/dist/chunks/libs/eventemitter3.mjs +1 -1
- package/dist/chunks/libs/fast-equals.mjs +1 -0
- package/dist/chunks/libs/fontkit.mjs +1 -0
- package/dist/chunks/libs/json5.mjs +4 -4
- package/dist/chunks/libs/langium.d.mts +6707 -6715
- package/dist/chunks/libs/langium.mjs +16 -24
- package/dist/chunks/libs/merge-error-cause.mjs +1 -1
- package/dist/chunks/libs/p-limit.mjs +1 -0
- package/dist/chunks/libs/p-queue.mjs +1 -1
- package/dist/chunks/libs/package-manager-detector.mjs +1 -1
- package/dist/chunks/libs/pako.mjs +1 -1
- package/dist/chunks/libs/pathe.mjs +1 -1
- package/dist/chunks/libs/pretty-ms.mjs +1 -1
- package/dist/chunks/libs/remeda.mjs +1 -1
- package/dist/chunks/libs/ufo.mjs +1 -1
- package/dist/chunks/libs/unstorage.mjs +1 -1
- package/dist/chunks/libs/which.mjs +1 -1
- package/dist/chunks/node.mjs +111 -77
- package/dist/chunks/rolldown-runtime.mjs +1 -1
- package/dist/chunks/sequence-view.mjs +1 -1
- package/dist/chunks/vite-plugin.mjs +185 -166
- package/dist/cli/index.mjs +254 -1306
- package/dist/config/index.d.mts +66 -5
- package/dist/config/index.mjs +1 -1
- package/dist/generators/likec4.d.mts +6530 -0
- package/dist/generators/likec4.mjs +1 -0
- package/dist/index.d.mts +2 -4
- package/dist/model/index.d.mts +0 -7
- package/dist/vite-plugin/index.d.mts +83 -58
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +8 -0
- package/dist/vite-plugin/internal/index.d.mts +92 -17
- package/dist/vite-plugin/internal/index.mjs +225 -126
- package/generators/likec4/package.json +4 -0
- package/package.json +134 -122
- package/react/index.d.mts +7496 -26659
- package/react/index.mjs +533 -63936
- package/react/rolldown-runtime-CfRud99p.js +1 -0
- package/skills/likec4-dsl/SKILL.md +474 -0
- package/skills/likec4-dsl/evals/evals-public.json +207 -0
- package/skills/likec4-dsl/evals/grading-spec.json +603 -0
- package/skills/likec4-dsl/references/bridge-leanix-drawio.md +42 -0
- package/skills/likec4-dsl/references/cli.md +168 -0
- package/skills/likec4-dsl/references/configuration.md +266 -0
- package/skills/likec4-dsl/references/deployment.md +160 -0
- package/skills/likec4-dsl/references/diffs.md +52 -0
- package/skills/likec4-dsl/references/dynamic-views.md +455 -0
- package/skills/likec4-dsl/references/examples.md +370 -0
- package/skills/likec4-dsl/references/identifier-validity.md +90 -0
- package/skills/likec4-dsl/references/include-predicates-wildcards.md +180 -0
- package/skills/likec4-dsl/references/model.md +182 -0
- package/skills/likec4-dsl/references/predicates.md +123 -0
- package/skills/likec4-dsl/references/relationships-bidirectional.md +176 -0
- package/skills/likec4-dsl/references/specification.md +79 -0
- package/skills/likec4-dsl/references/style-tokens-colors.md +150 -0
- package/skills/likec4-dsl/references/troubleshooting.md +101 -0
- package/skills/likec4-dsl/references/views.md +329 -0
- package/vite-plugin-modules.d.ts +126 -51
- package/__app__/src/chunks/LikeC4Styles.mjs +0 -2306
- package/__app__/src/chunks/ProjectsOverview.mjs +0 -537
- package/__app__/src/chunks/es.mjs +0 -439
- package/__app__/src/chunks/libs/@floating-ui.mjs +0 -2532
- package/__app__/src/chunks/libs/@mantine.mjs +0 -13868
- package/__app__/src/chunks/libs/@xstate/react.mjs +0 -2015
- package/__app__/src/chunks/libs/@xyflow/react.mjs +0 -5367
- package/__app__/src/chunks/libs/bezier-js.mjs +0 -1007
- package/__app__/src/chunks/libs/d3.mjs +0 -2817
- package/__app__/src/chunks/libs/framer.mjs +0 -5926
- package/__app__/src/chunks/libs/zod.mjs +0 -3176
- package/dist/chunks/libs/@chevrotain/types.d.mts +0 -108
- package/dist/chunks/libs/picomatch.mjs +0 -1
- package/dist/chunks/libs/zod.d.mts +0 -3840
- package/dist/chunks/libs/zod.mjs +0 -65
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"../chunks/rolldown-runtime.mjs";import{A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,R as _,S as v,T as y,U as b,V as x,W as S,X as C,Y as w,Z as T,_ as E,a as D,d as O,f as k,g as A,h as j,i as M,j as N,k as P,l as F,m as I,n as L,o as R,p as z,q as B,r as V,s as H,t as U,u as W,w as G,x as K,y as q,z as J}from"../chunks/generate-likec4.mjs";var Y=/* @__PURE__ */ e({base:()=>v,body:()=>r,deployment:()=>I,deploymentView:()=>D,deployments:()=>j,dynamicView:()=>R,eachOnFresh:()=>G,elementView:()=>H,eq:()=>y,expr:()=>E,expression:()=>A,foreach:()=>a,foreachNewLine:()=>i,guard:()=>h,indent:()=>P,inlineText:()=>t,join:()=>N,lazy:()=>p,likec4data:()=>M,lines:()=>m,markdown:()=>g,markdownOrString:()=>o,materialize:()=>l,merge:()=>f,model:()=>k,models:()=>z,newline:()=>_,noop:()=>J,print:()=>n,printProperty:()=>x,property:()=>c,props:()=>q,select:()=>b,separateComma:()=>S,separateNewLine:()=>s,separateWith:()=>d,space:()=>B,spaceBetween:()=>u,specification:()=>W,specifications:()=>O,text:()=>w,views:()=>F,when:()=>C,withctx:()=>T});export{U as generate,P as indent,l as materialize,Y as ops,L as print,V as printWithTabIndent,K as schemas,T as withctx};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { i as __name } from "./chunks/rolldown-runtime.mjs";
|
|
2
|
-
import { n as writeDSL, r as LikeC4$1, t as WriteDSLOptions } from "./chunks/index2.mjs";
|
|
2
|
+
import { a as ast_d_exports, n as writeDSL, r as LikeC4$1, t as WriteDSLOptions } from "./chunks/index2.mjs";
|
|
3
3
|
export type * from "@likec4/core/types";
|
|
4
|
-
//#region src/LikeC4.d.ts
|
|
5
4
|
type LikeC4Options = {
|
|
6
5
|
/**
|
|
7
6
|
* By default, if LikeC4 model is invalid, errors are printed to the console.
|
|
@@ -47,5 +46,4 @@ export declare namespace LikeC4 {
|
|
|
47
46
|
*/
|
|
48
47
|
function fromWorkspace(path?: string, _opts?: LikeC4Options): Promise<LikeC4>;
|
|
49
48
|
}
|
|
50
|
-
|
|
51
|
-
export { type LikeC4Options, type WriteDSLOptions, writeDSL };
|
|
49
|
+
export { type LikeC4Options, type WriteDSLOptions, type ast_d_exports as ast, writeDSL };
|
package/dist/model/index.d.mts
CHANGED
|
@@ -4,8 +4,6 @@ import { BBox, LayoutedDynamicView, NodeId, ViewId } from "@likec4/core/types";
|
|
|
4
4
|
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";
|
|
5
5
|
import { ComputedProjectEdge, ComputedProjectNode, ComputedProjectsView, LayoutedProjectEdge, LayoutedProjectNode, LayoutedProjectsView } from "@likec4/core/compute-view";
|
|
6
6
|
export type * from "@likec4/core/types";
|
|
7
|
-
//#region ../layouts/dist/sequence/index.d.mts
|
|
8
|
-
//#region src/sequence/_types.d.ts
|
|
9
7
|
interface SequenceActorStepPort {
|
|
10
8
|
id: string;
|
|
11
9
|
cx: number;
|
|
@@ -46,15 +44,10 @@ interface SequenceViewLayout {
|
|
|
46
44
|
parallelAreas: Array<SequenceParallelArea>;
|
|
47
45
|
bounds: BBox;
|
|
48
46
|
}
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region src/sequence/sequence-view.d.ts
|
|
51
47
|
export declare function calcSequenceLayout(view: LayoutedDynamicView): LayoutedDynamicView.Sequence.Layout;
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region src/model/index.d.ts
|
|
54
48
|
export type UnknownLayouted = types.UnknownLayouted;
|
|
55
49
|
/**
|
|
56
50
|
* Used by vite plugin to generate `virtual:likec4/model`
|
|
57
51
|
*/
|
|
58
52
|
export declare function createLikeC4Model(model: any): LikeC4Model$1<UnknownLayouted>;
|
|
59
|
-
//#endregion
|
|
60
53
|
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, 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 };
|
|
@@ -1,35 +1,50 @@
|
|
|
1
1
|
import { i as __name } from "../chunks/rolldown-runtime.mjs";
|
|
2
|
-
import "../chunks/index.mjs";
|
|
3
2
|
import { i as LikeC4LanguageServices } from "../chunks/index2.mjs";
|
|
4
|
-
import "
|
|
3
|
+
import z from "zod/v4";
|
|
5
4
|
import { PluginOption } from "vite";
|
|
6
5
|
import { AnyTextAdapter } from "@tanstack/ai";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Options of the LikeC4 application, shared by the Vite plugin and the app config of the CLI.
|
|
8
|
+
*
|
|
9
|
+
* @experimental
|
|
10
|
+
*/
|
|
11
|
+
declare const LikeC4AppOptionsSchema: z.ZodObject<{
|
|
12
|
+
title: z.ZodDefault<z.ZodString>;
|
|
13
|
+
theme: z.ZodOptional<z.ZodEnum<{
|
|
14
|
+
light: "light";
|
|
15
|
+
dark: "dark";
|
|
16
|
+
}>>;
|
|
17
|
+
useHashHistory: z.ZodDefault<z.ZodBoolean>;
|
|
18
|
+
webcomponentPrefix: z.ZodDefault<z.ZodString>;
|
|
19
|
+
customization: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
/**
|
|
22
|
+
* Options of the LikeC4 application as written by the user, see {@link LikeC4AppOptionsSchema}
|
|
23
|
+
*
|
|
24
|
+
* @experimental
|
|
25
|
+
*/
|
|
26
|
+
type LikeC4AppOptions = z.input<typeof LikeC4AppOptionsSchema>;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Use {@link LikeC4AppOptions} at the top level of the plugin options
|
|
29
|
+
*/
|
|
30
|
+
interface LikeC4AppConfig {
|
|
10
31
|
/**
|
|
11
|
-
*
|
|
12
|
-
* @default 'likec4'
|
|
32
|
+
* @deprecated Use `webcomponentPrefix` at the top level of the plugin options
|
|
13
33
|
*/
|
|
14
34
|
webcomponentPrefix?: string;
|
|
15
35
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @default 'LikeC4'
|
|
36
|
+
* @deprecated Use `title` at the top level of the plugin options
|
|
18
37
|
*/
|
|
19
38
|
pageTitle?: string;
|
|
20
39
|
/**
|
|
21
|
-
*
|
|
22
|
-
* @default false
|
|
40
|
+
* @deprecated Use `useHashHistory` at the top level of the plugin options
|
|
23
41
|
*/
|
|
24
42
|
useHashHistory?: boolean | undefined;
|
|
25
43
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @default 'auto'
|
|
44
|
+
* @deprecated Use `theme` at the top level of the plugin options
|
|
28
45
|
*/
|
|
29
46
|
theme?: 'light' | 'dark' | undefined;
|
|
30
47
|
}
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/plugin.d.ts
|
|
33
48
|
interface AIOptions<TAdapter extends AnyTextAdapter = AnyTextAdapter> {
|
|
34
49
|
/**
|
|
35
50
|
* The AI adapter to use
|
|
@@ -55,45 +70,12 @@ interface AIOptions<TAdapter extends AnyTextAdapter = AnyTextAdapter> {
|
|
|
55
70
|
modelOptions?: TAdapter['~types']['providerOptions'];
|
|
56
71
|
maxTokens?: number;
|
|
57
72
|
}
|
|
58
|
-
type
|
|
73
|
+
type LikeC4WorkspaceOptions = {
|
|
59
74
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* Or set to `disabled` to disable AI.
|
|
75
|
+
* Initialize LikeC4 from the specified workspace path.
|
|
76
|
+
* If not provided, vite project root will be used.
|
|
63
77
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* @see https://tanstack.com/ai/latest/docs/getting-started/overview#adapters
|
|
67
|
-
* @example
|
|
68
|
-
* ```ts
|
|
69
|
-
* import { openRouterText } from '@tanstack/ai-openrouter'
|
|
70
|
-
*
|
|
71
|
-
* export default defineConfig({
|
|
72
|
-
* plugins: [
|
|
73
|
-
* likec4VitePlugin({
|
|
74
|
-
* ai: {
|
|
75
|
-
* adapter: openRouterText("openai/gpt-5")
|
|
76
|
-
* },
|
|
77
|
-
* }),
|
|
78
|
-
* ],
|
|
79
|
-
* })
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
ai?: 'disabled' | 'auto' | AIOptions | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* Define vite environments where this plugin should be active
|
|
85
|
-
* By default, the plugin is active in all environments
|
|
86
|
-
*/
|
|
87
|
-
environments?: string | string[];
|
|
88
|
-
/**
|
|
89
|
-
* Configuration for the static application
|
|
90
|
-
*/
|
|
91
|
-
appConfig?: AppConfig;
|
|
92
|
-
};
|
|
93
|
-
type LikeC4VitePluginOptions = SharedOptions & ({
|
|
94
|
-
/**
|
|
95
|
-
* Initializes a LikeC4 instance from the specified workspace path.
|
|
96
|
-
* By default it is vite project root.
|
|
78
|
+
* As alternative you can provide {@link LikeC4LanguageServices} instance via `languageServices` option.
|
|
97
79
|
*/
|
|
98
80
|
workspace?: string;
|
|
99
81
|
/**
|
|
@@ -124,11 +106,14 @@ type LikeC4VitePluginOptions = SharedOptions & ({
|
|
|
124
106
|
* @default 'warning'
|
|
125
107
|
*/
|
|
126
108
|
logLevel?: 'trace' | 'debug' | 'info' | 'warning' | 'error' | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Either provide path to {@link LikeC4WorkspaceOptions.workspace} or {@link LikeC4LanguageServices} instance.
|
|
111
|
+
*/
|
|
127
112
|
languageServices?: never;
|
|
128
113
|
} | {
|
|
129
114
|
/**
|
|
130
|
-
* If you have instance of {@link LikeC4LanguageServices}
|
|
131
|
-
*
|
|
115
|
+
* If you have instance of {@link LikeC4LanguageServices}, pass it directly.
|
|
116
|
+
* None of the options below are applied when this option is used.
|
|
132
117
|
*/
|
|
133
118
|
languageServices: LikeC4LanguageServices;
|
|
134
119
|
workspace?: never;
|
|
@@ -137,7 +122,47 @@ type LikeC4VitePluginOptions = SharedOptions & ({
|
|
|
137
122
|
graphviz?: never;
|
|
138
123
|
watch?: never;
|
|
139
124
|
logLevel?: never;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Configuration for the LikeC4 Vite plugin
|
|
128
|
+
*
|
|
129
|
+
* @see {@link LikeC4WorkspaceOptions} for workspace options (language services)
|
|
130
|
+
* @see {@link LikeC4AppOptions} for application-specific options
|
|
131
|
+
*/
|
|
132
|
+
type LikeC4VitePluginOptions = LikeC4WorkspaceOptions & LikeC4AppOptions & {
|
|
133
|
+
/**
|
|
134
|
+
* AI configuration, by default enabled with automatic detection based on environment variables.
|
|
135
|
+
* You can also provide explicit configuration.
|
|
136
|
+
* Or set to `disabled` to disable AI.
|
|
137
|
+
*
|
|
138
|
+
* @default 'auto' (automatic detection based on environment variables)
|
|
139
|
+
*
|
|
140
|
+
* @see https://tanstack.com/ai/latest/docs/getting-started/overview#adapters
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* import { openRouterText } from '@tanstack/ai-openrouter'
|
|
144
|
+
*
|
|
145
|
+
* export default defineConfig({
|
|
146
|
+
* plugins: [
|
|
147
|
+
* likec4VitePlugin({
|
|
148
|
+
* ai: {
|
|
149
|
+
* adapter: openRouterText("openai/gpt-5")
|
|
150
|
+
* },
|
|
151
|
+
* }),
|
|
152
|
+
* ],
|
|
153
|
+
* })
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
ai?: 'disabled' | 'auto' | AIOptions | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* Define vite environments where this plugin should be active
|
|
159
|
+
* By default, the plugin is active in all environments
|
|
160
|
+
*/
|
|
161
|
+
environments?: string | string[];
|
|
162
|
+
/**
|
|
163
|
+
* @deprecated Use the options at the top level: `title`, `theme`, `useHashHistory`, `webcomponentPrefix`
|
|
164
|
+
*/
|
|
165
|
+
appConfig?: LikeC4AppConfig | undefined;
|
|
166
|
+
};
|
|
167
|
+
export declare function LikeC4VitePlugin({ environments, appConfig, title, theme, useHashHistory, webcomponentPrefix, customization, ai: _ai, ...pluginOpts }: LikeC4VitePluginOptions): PluginOption;
|
|
168
|
+
export type { LikeC4AppConfig, LikeC4AppOptions, LikeC4VitePluginOptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{t as LikeC4VitePlugin}from"../chunks/vite-plugin.mjs";
|
|
@@ -1,9 +1,75 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as __name } from "./chunks/rolldown-runtime.mjs";
|
|
2
2
|
import { DependencyList } from "react";
|
|
3
|
+
import { LikeC4Model } from "@likec4/core/model";
|
|
3
4
|
import { LayoutedElementView, LayoutedLikeC4ModelData, LayoutedView, ProjectId, ViewChange, ViewId } from "@likec4/core/types";
|
|
4
5
|
import { AdhocViewPredicate } from "@likec4/core/compute-view";
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
import "@likec4/core/builder";
|
|
7
|
+
import * as c4 from "@likec4/core";
|
|
8
|
+
import "zod/v4";
|
|
9
|
+
import "type-fest";
|
|
10
|
+
import "@likec4/core/utils";
|
|
11
|
+
import "@likec4/core/styles";
|
|
12
|
+
import "chokidar";
|
|
13
|
+
import "@tanstack/ai";
|
|
14
|
+
declare module 'langium' {
|
|
15
|
+
interface LangiumDocument {
|
|
16
|
+
likec4ProjectId?: c4.ProjectId;
|
|
17
|
+
}
|
|
18
|
+
interface AstNodeDescription {
|
|
19
|
+
likec4ProjectId?: c4.ProjectId;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
declare const idattr: unique symbol;
|
|
23
|
+
declare module './generated/ast' {
|
|
24
|
+
interface Element {
|
|
25
|
+
[idattr]?: c4.Fqn | undefined;
|
|
26
|
+
}
|
|
27
|
+
interface ElementView {
|
|
28
|
+
[idattr]?: c4.ViewId | undefined;
|
|
29
|
+
}
|
|
30
|
+
interface DynamicView {
|
|
31
|
+
[idattr]?: c4.ViewId | undefined;
|
|
32
|
+
}
|
|
33
|
+
interface DeploymentView {
|
|
34
|
+
[idattr]?: c4.ViewId | undefined;
|
|
35
|
+
}
|
|
36
|
+
interface DeploymentNode {
|
|
37
|
+
[idattr]?: c4.Fqn | undefined;
|
|
38
|
+
}
|
|
39
|
+
interface DeployedInstance {
|
|
40
|
+
[idattr]?: c4.Fqn | undefined;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @hidden
|
|
45
|
+
*/
|
|
46
|
+
declare type $keywords<T extends string> = { [key in T]: key; };
|
|
47
|
+
declare module 'ts-graphviz' {
|
|
48
|
+
namespace GraphAttributeKey {
|
|
49
|
+
interface $values extends $keywords<'likec4_viewId'> {}
|
|
50
|
+
}
|
|
51
|
+
namespace ClusterSubgraphAttributeKey {
|
|
52
|
+
interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_level' | 'likec4_depth'> {}
|
|
53
|
+
}
|
|
54
|
+
namespace NodeAttributeKey {
|
|
55
|
+
interface $values extends $keywords<'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_project' | 'likec4_level'> {}
|
|
56
|
+
}
|
|
57
|
+
namespace EdgeAttributeKey {
|
|
58
|
+
interface $values extends $keywords<'likec4_id' | 'likec4_project'> {}
|
|
59
|
+
}
|
|
60
|
+
namespace Attribute {
|
|
61
|
+
interface $keys extends $keywords<'likec4_viewId' | 'likec4_type' | 'likec4_path' | 'likec4_id' | 'likec4_project' | 'likec4_level' | 'likec4_depth'> {}
|
|
62
|
+
interface $types {
|
|
63
|
+
likec4_viewId: string;
|
|
64
|
+
likec4_type: 'folder' | 'file' | 'view';
|
|
65
|
+
likec4_path: string;
|
|
66
|
+
likec4_id: string;
|
|
67
|
+
likec4_project: string;
|
|
68
|
+
likec4_level: number;
|
|
69
|
+
likec4_depth: number;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
7
73
|
type AllKeys<T> = T extends any ? keyof T : never;
|
|
8
74
|
type Primitive = boolean | number | string;
|
|
9
75
|
type ReadonlyIfObject<Value> = Value extends undefined ? Value : Value extends ((...args: any) => any) ? Value : Value extends Primitive ? Value : Value extends object ? Readonly<Value> : Value;
|
|
@@ -142,8 +208,6 @@ type Atom<Value = any> = ReadableAtom<Value> | WritableAtom<Value>;
|
|
|
142
208
|
* @returns The store object with methods to subscribe.
|
|
143
209
|
*/
|
|
144
210
|
export declare function atom<Value, StoreExt = object>(...args: undefined extends Value ? [] | [Value] : [Value]): PreinitializedWritableAtom<Value> & StoreExt;
|
|
145
|
-
//#endregion
|
|
146
|
-
//#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/map/index.d.ts
|
|
147
211
|
type KeyofBase = keyof any;
|
|
148
212
|
type Get<T, K extends KeyofBase> = T extends any ? K extends keyof T ? T[K] : never : never;
|
|
149
213
|
type HasIndexSignature<T> = string extends keyof T ? true : false;
|
|
@@ -256,13 +320,9 @@ export declare function map<Value extends object, StoreExt extends object = obje
|
|
|
256
320
|
* @returns The store object with methods to subscribe.
|
|
257
321
|
*/
|
|
258
322
|
export declare function map<Value extends object, StoreExt extends object = object>(value?: Value): PreinitializedMapStore<Partial<Value>> & StoreExt;
|
|
259
|
-
//#endregion
|
|
260
|
-
//#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/task/index.d.ts
|
|
261
323
|
interface Task<Value> extends Promise<Value> {
|
|
262
324
|
t: true;
|
|
263
325
|
}
|
|
264
|
-
//#endregion
|
|
265
|
-
//#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/computed/index.d.ts
|
|
266
326
|
type StoreValues<Stores extends readonly Gettable[]> = { -readonly [Index in keyof Stores]: StoreValue<Stores[Index]>; };
|
|
267
327
|
interface Computed {
|
|
268
328
|
/**
|
|
@@ -311,8 +371,6 @@ interface Batched {
|
|
|
311
371
|
<Value, OriginStores extends readonly Store[]>(stores: readonly [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value> | Value): ReadableAtom<Value>;
|
|
312
372
|
}
|
|
313
373
|
export declare const batched: Batched;
|
|
314
|
-
//#endregion
|
|
315
|
-
//#region src/rpc/protocol.d.ts
|
|
316
374
|
interface LikeC4VitePluginRpc {
|
|
317
375
|
/**
|
|
318
376
|
* Apply semantic layout (if AI is available)
|
|
@@ -342,8 +400,6 @@ interface LikeC4VitePluginRpc {
|
|
|
342
400
|
predicates: AdhocViewPredicate[];
|
|
343
401
|
}): Promise<LayoutedElementView>;
|
|
344
402
|
}
|
|
345
|
-
//#endregion
|
|
346
|
-
//#region ../../node_modules/.pnpm/@nanostores+react@1.1.0_nanostores@1.5.3_react@19.2.8/node_modules/@nanostores/react/index.d.ts
|
|
347
403
|
type StoreKeys<T> = T extends {
|
|
348
404
|
setKey: (k: infer K, v: any) => unknown;
|
|
349
405
|
} ? K : never;
|
|
@@ -390,8 +446,27 @@ interface UseStoreOptions<SomeStore> {
|
|
|
390
446
|
* @returns Store value.
|
|
391
447
|
*/
|
|
392
448
|
export declare function useStore<SomeStore extends Store>(store: SomeStore, options?: UseStoreOptions<SomeStore>): StoreValue<SomeStore>;
|
|
393
|
-
|
|
394
|
-
|
|
449
|
+
/**
|
|
450
|
+
* @deprecated Use {@link LikeC4AppOptions} at the top level of the plugin options
|
|
451
|
+
*/
|
|
452
|
+
interface LikeC4AppConfig {
|
|
453
|
+
/**
|
|
454
|
+
* @deprecated Use `webcomponentPrefix` at the top level of the plugin options
|
|
455
|
+
*/
|
|
456
|
+
webcomponentPrefix?: string;
|
|
457
|
+
/**
|
|
458
|
+
* @deprecated Use `title` at the top level of the plugin options
|
|
459
|
+
*/
|
|
460
|
+
pageTitle?: string;
|
|
461
|
+
/**
|
|
462
|
+
* @deprecated Use `useHashHistory` at the top level of the plugin options
|
|
463
|
+
*/
|
|
464
|
+
useHashHistory?: boolean | undefined;
|
|
465
|
+
/**
|
|
466
|
+
* @deprecated Use `theme` at the top level of the plugin options
|
|
467
|
+
*/
|
|
468
|
+
theme?: 'light' | 'dark' | undefined;
|
|
469
|
+
}
|
|
395
470
|
export interface LikeC4VitePluginRpcOptions {
|
|
396
471
|
/**
|
|
397
472
|
* Function to post raw message
|
|
@@ -413,6 +488,6 @@ export declare function createHooksForModel($atom: WritableAtom<LayoutedLikeC4Mo
|
|
|
413
488
|
useLikeC4Model: () => LikeC4Model.Layouted;
|
|
414
489
|
useLikeC4Views: () => ReadonlyArray<LayoutedView>;
|
|
415
490
|
useLikeC4View: (viewId: string) => LayoutedView | null;
|
|
491
|
+
isLikeC4ViewId: (id: unknown) => id is string;
|
|
416
492
|
};
|
|
417
|
-
|
|
418
|
-
export type { Atom, LikeC4VitePluginRpc, ReadableAtom, WritableAtom };
|
|
493
|
+
export type { Atom, LikeC4AppConfig, LikeC4VitePluginRpc, ReadableAtom, WritableAtom };
|