likec4 1.25.0 → 1.26.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/__app__/react/likec4.tsx +12 -28
- package/__app__/src/main.js +48928 -3
- package/__app__/src/style.css +1 -1
- package/__app__/webcomponent/webcomponent.js +2 -16
- package/dist/cli/index.mjs +727 -1112
- package/dist/index.d.mts +11 -16022
- package/dist/index.d.ts +11 -16022
- package/dist/index.mjs +1 -1
- package/dist/model/index.d.mts +2 -2
- package/dist/model/index.d.ts +2 -2
- package/dist/shared/likec4.C0X7XZt3.mjs +3682 -0
- package/dist/shared/likec4.Cz9mPeTQ.mjs +356 -0
- package/dist/shared/likec4.Y_4a6gTW.d.mts +2063 -0
- package/dist/shared/likec4.Y_4a6gTW.d.ts +2063 -0
- package/dist/vite-plugin/index.d.mts +48 -0
- package/dist/vite-plugin/index.d.ts +48 -0
- package/dist/vite-plugin/index.mjs +2 -0
- package/package.json +37 -24
- package/react/index.d.ts +17 -9
- package/react/index.js +6924 -5918
- package/react/{style.css → likec4.css} +1 -1
- package/vite-plugin-modules.d.ts +88 -0
- package/__app__/src/chunks/-index-overview-BQqR8e0d.js +0 -310
- package/__app__/src/chunks/-view-lazy-data-CI4xD57c.js +0 -9
- package/__app__/src/chunks/likec4-DRDnYFvy.js +0 -6150
- package/__app__/src/chunks/main-iM8EmCL0.js +0 -25402
- package/__app__/src/chunks/mantine-B7q9iXnB.js +0 -13363
- package/__app__/src/chunks/tanstack-router-MjA2OK6n.js +0 -2925
- package/__app__/src/icons.js +0 -9
- package/dist/shared/likec4.DX7xzn9M.mjs +0 -3608
- /package/__app__/src/{chunks/index-C6pszJh8.js → index-C6pszJh8.js} +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { L as LikeC4LanguageServices } from '../shared/likec4.Y_4a6gTW.mjs';
|
|
2
|
+
import '@likec4/core';
|
|
3
|
+
import 'type-fest';
|
|
4
|
+
|
|
5
|
+
type LikeC4VitePluginOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* Initializes a LikeC4 instance from the specified workspace path.
|
|
8
|
+
* By default it is vite project root.
|
|
9
|
+
*/
|
|
10
|
+
workspace?: string;
|
|
11
|
+
/**
|
|
12
|
+
* By default, if LikeC4 model is invalid, errors are printed to the console.
|
|
13
|
+
* Disable this behavior by setting this option to false.
|
|
14
|
+
*
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
printErrors?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* If true, initialization will return rejected promise with the LikeC4 instance.
|
|
20
|
+
* Use `likec4.getErrors()` to get the errors.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
throwIfInvalid?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether to use the `dot` binary for layouting or the WebAssembly version.
|
|
26
|
+
* @default 'wasm'
|
|
27
|
+
*/
|
|
28
|
+
graphviz?: 'wasm' | 'binary';
|
|
29
|
+
/**
|
|
30
|
+
* If you have instance of {@link LikeC4}
|
|
31
|
+
* you can pass `languageServices` from it.
|
|
32
|
+
*/
|
|
33
|
+
languageServices?: LikeC4LanguageServices;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated
|
|
36
|
+
*/
|
|
37
|
+
useOverviewGraph?: boolean;
|
|
38
|
+
} | {
|
|
39
|
+
languageServices: LikeC4LanguageServices;
|
|
40
|
+
workspace?: never;
|
|
41
|
+
printErrors?: never;
|
|
42
|
+
throwIfInvalid?: never;
|
|
43
|
+
graphviz?: never;
|
|
44
|
+
useOverviewGraph?: boolean;
|
|
45
|
+
};
|
|
46
|
+
declare function LikeC4VitePlugin({ useOverviewGraph, ...opts }: LikeC4VitePluginOptions): any;
|
|
47
|
+
|
|
48
|
+
export { LikeC4VitePlugin, type LikeC4VitePluginOptions };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { L as LikeC4LanguageServices } from '../shared/likec4.Y_4a6gTW.js';
|
|
2
|
+
import '@likec4/core';
|
|
3
|
+
import 'type-fest';
|
|
4
|
+
|
|
5
|
+
type LikeC4VitePluginOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* Initializes a LikeC4 instance from the specified workspace path.
|
|
8
|
+
* By default it is vite project root.
|
|
9
|
+
*/
|
|
10
|
+
workspace?: string;
|
|
11
|
+
/**
|
|
12
|
+
* By default, if LikeC4 model is invalid, errors are printed to the console.
|
|
13
|
+
* Disable this behavior by setting this option to false.
|
|
14
|
+
*
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
printErrors?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* If true, initialization will return rejected promise with the LikeC4 instance.
|
|
20
|
+
* Use `likec4.getErrors()` to get the errors.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
throwIfInvalid?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether to use the `dot` binary for layouting or the WebAssembly version.
|
|
26
|
+
* @default 'wasm'
|
|
27
|
+
*/
|
|
28
|
+
graphviz?: 'wasm' | 'binary';
|
|
29
|
+
/**
|
|
30
|
+
* If you have instance of {@link LikeC4}
|
|
31
|
+
* you can pass `languageServices` from it.
|
|
32
|
+
*/
|
|
33
|
+
languageServices?: LikeC4LanguageServices;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated
|
|
36
|
+
*/
|
|
37
|
+
useOverviewGraph?: boolean;
|
|
38
|
+
} | {
|
|
39
|
+
languageServices: LikeC4LanguageServices;
|
|
40
|
+
workspace?: never;
|
|
41
|
+
printErrors?: never;
|
|
42
|
+
throwIfInvalid?: never;
|
|
43
|
+
graphviz?: never;
|
|
44
|
+
useOverviewGraph?: boolean;
|
|
45
|
+
};
|
|
46
|
+
declare function LikeC4VitePlugin({ useOverviewGraph, ...opts }: LikeC4VitePluginOptions): any;
|
|
47
|
+
|
|
48
|
+
export { LikeC4VitePlugin, type LikeC4VitePluginOptions };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{L as LikeC4VitePlugin}from"../shared/likec4.Cz9mPeTQ.mjs";import"node:path";import"../shared/likec4.C0X7XZt3.mjs";import"node:fs";import"node:url";import"tty";import"node:util";import"util";import"path";import"os";import"crypto";import"net";import"url";import"fs";import"child_process";import"@likec4/core";import"@likec4/core/types";import"events";import"buffer";import"@hpcc-js/wasm-graphviz";import"@likec4/core/compute-view";import"@likec4/core/utils";import"node:process";import"boxen";import"node:child_process";
|
|
2
|
+
import"node:events";import"node:fs/promises";import"node:stream/promises";import"node:os";import"fs/promises";import"@likec4/core/model";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "likec4",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://likec4.dev",
|
|
6
6
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -44,6 +44,17 @@
|
|
|
44
44
|
"default": "./react/index.js"
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
+
"./vite-plugin-modules": {
|
|
48
|
+
"types": "./vite-plugin-modules.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./vite-plugin": {
|
|
51
|
+
"sources": "./src/vite-plugin/index.ts",
|
|
52
|
+
"default": {
|
|
53
|
+
"types": "./dist/vite-plugin/index.d.mts",
|
|
54
|
+
"import": "./dist/vite-plugin/index.mjs",
|
|
55
|
+
"default": "./dist/vite-plugin/index.mjs"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
47
58
|
"./react/style.css": "./react/style.css",
|
|
48
59
|
"./icons/all": {
|
|
49
60
|
"types": "./icons/all.d.ts",
|
|
@@ -69,25 +80,26 @@
|
|
|
69
80
|
"react-dom": "~19.0.0",
|
|
70
81
|
"rollup": "4.34.6",
|
|
71
82
|
"type-fest": "4.34.1",
|
|
72
|
-
"vite": "
|
|
73
|
-
"@likec4/core": "~1.
|
|
83
|
+
"vite": "^6.2.0",
|
|
84
|
+
"@likec4/core": "~1.26.0"
|
|
74
85
|
},
|
|
75
86
|
"devDependencies": {
|
|
76
87
|
"@dagrejs/dagre": "1.1.4",
|
|
77
|
-
"@fontsource/ibm-plex-sans": "^5.
|
|
88
|
+
"@fontsource/ibm-plex-sans": "^5.2.5",
|
|
78
89
|
"@mantine/core": "7.17.1",
|
|
79
90
|
"@mantine/hooks": "7.17.1",
|
|
80
91
|
"@mantine/vanilla-extract": "7.17.1",
|
|
81
92
|
"@nanostores/react": "0.8.4",
|
|
82
93
|
"@react-hookz/web": "^25.0.1",
|
|
83
94
|
"@tabler/icons-react": "3.29.0",
|
|
84
|
-
"@tanstack/react-router": "1.
|
|
85
|
-
"@tanstack/router-cli": "1.
|
|
86
|
-
"@tanstack/router-
|
|
87
|
-
"@
|
|
95
|
+
"@tanstack/react-router": "1.114.4",
|
|
96
|
+
"@tanstack/router-cli": "1.114.4",
|
|
97
|
+
"@tanstack/router-devtools": "1.114.4",
|
|
98
|
+
"@tanstack/router-vite-plugin": "1.114.4",
|
|
99
|
+
"@types/node": "^20.17.23",
|
|
88
100
|
"@types/prop-types": "^15.7.14",
|
|
89
|
-
"@types/react": "~19.0.
|
|
90
|
-
"@types/react-dom": "~19.0.
|
|
101
|
+
"@types/react": "~19.0.10",
|
|
102
|
+
"@types/react-dom": "~19.0.4",
|
|
91
103
|
"@types/semver": "^7.5.8",
|
|
92
104
|
"@types/yargs": "^17.0.33",
|
|
93
105
|
"@vanilla-extract/css": "^1.17.1",
|
|
@@ -107,7 +119,7 @@
|
|
|
107
119
|
"esm-env": "^1.2.2",
|
|
108
120
|
"fast-equals": "^5.2.2",
|
|
109
121
|
"fdir": "^6.4.3",
|
|
110
|
-
"framer-motion": "^12.4.
|
|
122
|
+
"framer-motion": "^12.4.10",
|
|
111
123
|
"get-port": "^7.1.0",
|
|
112
124
|
"glob": "^11.0.1",
|
|
113
125
|
"html-to-image": "^1.11.13",
|
|
@@ -117,7 +129,7 @@
|
|
|
117
129
|
"merge-error-cause": "^5.0.0",
|
|
118
130
|
"mkdirp": "^3.0.1",
|
|
119
131
|
"nano-spawn": "^0.2.0",
|
|
120
|
-
"nanostores": "0.11.
|
|
132
|
+
"nanostores": "0.11.4",
|
|
121
133
|
"npm-run-all2": "^7.0.1",
|
|
122
134
|
"p-limit": "^6.2.0",
|
|
123
135
|
"package-up": "^5.0.0",
|
|
@@ -128,35 +140,36 @@
|
|
|
128
140
|
"react-error-boundary": "^5.0.0",
|
|
129
141
|
"react-resizable-panels": "^2.1.7",
|
|
130
142
|
"react-shadow": "^20.6.0",
|
|
131
|
-
"remeda": "^2.
|
|
143
|
+
"remeda": "^2.21.0",
|
|
132
144
|
"semver": "^7.7.1",
|
|
133
|
-
"std-env": "^3.8.
|
|
145
|
+
"std-env": "^3.8.1",
|
|
134
146
|
"strip-indent": "^4.0.0",
|
|
135
147
|
"terser": "^5.39.0",
|
|
136
148
|
"tinyrainbow": "^2.0.0",
|
|
137
149
|
"tsx": "~4.19.3",
|
|
138
|
-
"turbo": "^2.4.
|
|
139
|
-
"typescript": "5.
|
|
150
|
+
"turbo": "^2.4.4",
|
|
151
|
+
"typescript": "5.8.2",
|
|
140
152
|
"ufo": "^1.5.4",
|
|
141
153
|
"unbuild": "^3.3.1",
|
|
142
154
|
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
143
155
|
"vite-plugin-dts": "^4.5.0",
|
|
156
|
+
"vite-plugin-inspect": "^11.0.0",
|
|
144
157
|
"vite-plugin-shadow-style": "^1.2.0",
|
|
145
158
|
"vite-plugin-singlefile": "^2.1.0",
|
|
146
|
-
"vitest": "^3.0.
|
|
159
|
+
"vitest": "^3.0.8",
|
|
147
160
|
"vscode-jsonrpc": "8.2.0",
|
|
148
161
|
"vscode-languageserver": "9.0.1",
|
|
149
162
|
"vscode-languageserver-types": "3.17.5",
|
|
150
163
|
"vscode-uri": "3.1.0",
|
|
151
164
|
"which": "^5.0.0",
|
|
152
165
|
"yargs": "17.7.2",
|
|
153
|
-
"@likec4/
|
|
154
|
-
"@likec4/icons": "1.
|
|
155
|
-
"@likec4/language-server": "1.
|
|
156
|
-
"@likec4/
|
|
157
|
-
"@likec4/
|
|
158
|
-
"@likec4/
|
|
159
|
-
"@likec4/tsconfig": "1.
|
|
166
|
+
"@likec4/diagram": "1.26.0",
|
|
167
|
+
"@likec4/icons": "1.26.0",
|
|
168
|
+
"@likec4/language-server": "1.26.0",
|
|
169
|
+
"@likec4/layouts": "1.26.0",
|
|
170
|
+
"@likec4/generators": "1.26.0",
|
|
171
|
+
"@likec4/log": "1.26.0",
|
|
172
|
+
"@likec4/tsconfig": "1.26.0"
|
|
160
173
|
},
|
|
161
174
|
"scripts": {
|
|
162
175
|
"turbo-build": "turbo run build --log-prefix=none --log-order=grouped",
|
package/react/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
+
import { deepEqual } from 'fast-equals';
|
|
2
3
|
import type { DependencyList } from 'react';
|
|
3
4
|
import { DiagramEdge } from '@likec4/core';
|
|
4
5
|
import { DiagramNode } from '@likec4/core';
|
|
@@ -21,6 +22,8 @@ declare type AnyStore<Value = any> = {
|
|
|
21
22
|
readonly value: undefined | Value
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
declare type Atom<Value = any> = ReadableAtom<Value> | WritableAtom<Value>
|
|
26
|
+
|
|
24
27
|
/**
|
|
25
28
|
* Create store with atomic value. It could be a string or an object, which you
|
|
26
29
|
* will replace completely.
|
|
@@ -50,7 +53,7 @@ declare type AnyStore<Value = any> = {
|
|
|
50
53
|
* @param initialValue Initial value of the store.
|
|
51
54
|
* @returns The store object with methods to subscribe.
|
|
52
55
|
*/
|
|
53
|
-
declare function atom<Value, StoreExt =
|
|
56
|
+
declare function atom<Value, StoreExt = object>(
|
|
54
57
|
...args: undefined extends Value ? [] | [Value] : [Value]
|
|
55
58
|
): PreinitializedWritableAtom<Value> & StoreExt
|
|
56
59
|
|
|
@@ -63,15 +66,15 @@ declare type ChangeEvent = {
|
|
|
63
66
|
declare type ColorScheme = 'light' | 'dark';
|
|
64
67
|
|
|
65
68
|
declare interface Computed {
|
|
66
|
-
<Value
|
|
69
|
+
<Value, OriginStore extends Store>(
|
|
67
70
|
stores: OriginStore,
|
|
68
71
|
cb: (value: StoreValue<OriginStore>) => Task<Value>
|
|
69
72
|
): ReadableAtom<undefined | Value>
|
|
70
|
-
<Value
|
|
73
|
+
<Value, OriginStores extends AnyStore[]>(
|
|
71
74
|
stores: [...OriginStores],
|
|
72
75
|
cb: (...values: StoreValues<OriginStores>) => Task<Value>
|
|
73
76
|
): ReadableAtom<undefined | Value>
|
|
74
|
-
<Value
|
|
77
|
+
<Value, OriginStore extends Store>(
|
|
75
78
|
stores: OriginStore,
|
|
76
79
|
cb: (value: StoreValue<OriginStore>) => Value
|
|
77
80
|
): ReadableAtom<Value>
|
|
@@ -101,7 +104,7 @@ declare interface Computed {
|
|
|
101
104
|
* }))
|
|
102
105
|
* ```
|
|
103
106
|
*/
|
|
104
|
-
<Value
|
|
107
|
+
<Value, OriginStores extends AnyStore[]>(
|
|
105
108
|
stores: [...OriginStores],
|
|
106
109
|
cb: (...values: StoreValues<OriginStores>) => Task<Value> | Value
|
|
107
110
|
): ReadableAtom<Value>
|
|
@@ -119,6 +122,10 @@ declare type ControlsCustomLayoutProps = {
|
|
|
119
122
|
syncInProgressBadge: ReactNode;
|
|
120
123
|
};
|
|
121
124
|
|
|
125
|
+
export declare const createHooksForModel: (arg: unknown) => unknown;
|
|
126
|
+
|
|
127
|
+
export { deepEqual }
|
|
128
|
+
|
|
122
129
|
declare type DiagramNodeWithNavigate<ID = ViewId> = Omit<DiagramNode, 'navigateTo'> & {
|
|
123
130
|
navigateTo: ID;
|
|
124
131
|
};
|
|
@@ -489,7 +496,7 @@ export declare interface LikeC4ViewProps<ViewId = string, Tag = string, Kind = s
|
|
|
489
496
|
* @param init Initialize store and return store destructor.
|
|
490
497
|
* @returns The store object with methods to subscribe.
|
|
491
498
|
*/
|
|
492
|
-
declare function map<Value extends object, StoreExt extends object =
|
|
499
|
+
declare function map<Value extends object, StoreExt extends object = object>(
|
|
493
500
|
value?: Value
|
|
494
501
|
): PreinitializedMapStore<Value> & StoreExt
|
|
495
502
|
|
|
@@ -587,7 +594,9 @@ export declare namespace nano {
|
|
|
587
594
|
atom,
|
|
588
595
|
computed,
|
|
589
596
|
map,
|
|
590
|
-
useStore
|
|
597
|
+
useStore,
|
|
598
|
+
Atom,
|
|
599
|
+
WritableAtom
|
|
591
600
|
}
|
|
592
601
|
}
|
|
593
602
|
|
|
@@ -621,8 +630,7 @@ extends MapStore<Value> {
|
|
|
621
630
|
readonly value: Value
|
|
622
631
|
}
|
|
623
632
|
|
|
624
|
-
declare interface PreinitializedWritableAtom<Value extends
|
|
625
|
-
extends WritableAtom<Value> {
|
|
633
|
+
declare interface PreinitializedWritableAtom<Value> extends WritableAtom<Value> {
|
|
626
634
|
readonly value: Value
|
|
627
635
|
}
|
|
628
636
|
|