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
|
@@ -1,240 +1 @@
|
|
|
1
|
-
|
|
2
|
-
const r = String.fromCharCode;
|
|
3
|
-
const HASH_RE = /#/g;
|
|
4
|
-
const AMPERSAND_RE = /&/g;
|
|
5
|
-
const SLASH_RE = /\//g;
|
|
6
|
-
const EQUAL_RE = /=/g;
|
|
7
|
-
const PLUS_RE = /\+/g;
|
|
8
|
-
const ENC_CARET_RE = /%5e/gi;
|
|
9
|
-
const ENC_BACKTICK_RE = /%60/gi;
|
|
10
|
-
const ENC_PIPE_RE = /%7c/gi;
|
|
11
|
-
const ENC_SPACE_RE = /%20/gi;
|
|
12
|
-
function encode(text) {
|
|
13
|
-
return encodeURI("" + text).replace(ENC_PIPE_RE, "|");
|
|
14
|
-
}
|
|
15
|
-
function encodeQueryValue(input) {
|
|
16
|
-
return encode(typeof input === "string" ? input : JSON.stringify(input)).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CARET_RE, "^").replace(SLASH_RE, "%2F");
|
|
17
|
-
}
|
|
18
|
-
function encodeQueryKey(text) {
|
|
19
|
-
return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
|
|
20
|
-
}
|
|
21
|
-
function decode(text = "") {
|
|
22
|
-
try {
|
|
23
|
-
return decodeURIComponent("" + text);
|
|
24
|
-
} catch {
|
|
25
|
-
return "" + text;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function decodeQueryKey(text) {
|
|
29
|
-
return decode(text.replace(PLUS_RE, " "));
|
|
30
|
-
}
|
|
31
|
-
function decodeQueryValue(text) {
|
|
32
|
-
return decode(text.replace(PLUS_RE, " "));
|
|
33
|
-
}
|
|
34
|
-
function parseQuery(parametersString = "") {
|
|
35
|
-
const object = /* @__PURE__ */ Object.create(null);
|
|
36
|
-
if (parametersString[0] === "?") parametersString = parametersString.slice(1);
|
|
37
|
-
for (const parameter of parametersString.split("&")) {
|
|
38
|
-
const s = parameter.match(/([^=]+)=?(.*)/) || [];
|
|
39
|
-
if (s.length < 2) continue;
|
|
40
|
-
const key = decodeQueryKey(s[1]);
|
|
41
|
-
if (key === "__proto__" || key === "constructor") continue;
|
|
42
|
-
const value = decodeQueryValue(s[2] || "");
|
|
43
|
-
if (object[key] === void 0) object[key] = value;
|
|
44
|
-
else if (Array.isArray(object[key])) object[key].push(value);
|
|
45
|
-
else object[key] = [object[key], value];
|
|
46
|
-
}
|
|
47
|
-
return object;
|
|
48
|
-
}
|
|
49
|
-
function encodeQueryItem(key, value) {
|
|
50
|
-
if (typeof value === "number" || typeof value === "boolean") value = String(value);
|
|
51
|
-
if (!value) return encodeQueryKey(key);
|
|
52
|
-
if (Array.isArray(value)) return value.map((_value) => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}`).join("&");
|
|
53
|
-
return `${encodeQueryKey(key)}=${encodeQueryValue(value)}`;
|
|
54
|
-
}
|
|
55
|
-
function stringifyQuery(query) {
|
|
56
|
-
return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem(k, query[k])).filter(Boolean).join("&");
|
|
57
|
-
}
|
|
58
|
-
const PROTOCOL_STRICT_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/;
|
|
59
|
-
const PROTOCOL_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{2})?/;
|
|
60
|
-
const PROTOCOL_RELATIVE_REGEX = /^([/\\]\s*){2,}[^/\\]/;
|
|
61
|
-
const TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
|
|
62
|
-
const JOIN_LEADING_SLASH_RE = /^\.?\//;
|
|
63
|
-
function isRelative(inputString) {
|
|
64
|
-
return ["./", "../"].some((string_) => inputString.startsWith(string_));
|
|
65
|
-
}
|
|
66
|
-
function hasProtocol(inputString, opts = {}) {
|
|
67
|
-
if (typeof opts === "boolean") opts = { acceptRelative: opts };
|
|
68
|
-
if (opts.strict) return PROTOCOL_STRICT_REGEX.test(inputString);
|
|
69
|
-
return PROTOCOL_REGEX.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(inputString) : false);
|
|
70
|
-
}
|
|
71
|
-
function hasTrailingSlash(input = "", respectQueryAndFragment) {
|
|
72
|
-
if (!respectQueryAndFragment) return input.endsWith("/");
|
|
73
|
-
return TRAILING_SLASH_RE.test(input);
|
|
74
|
-
}
|
|
75
|
-
function withoutTrailingSlash(input = "", respectQueryAndFragment) {
|
|
76
|
-
if (!respectQueryAndFragment) return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || "/";
|
|
77
|
-
if (!hasTrailingSlash(input, true)) return input || "/";
|
|
78
|
-
let path = input;
|
|
79
|
-
let fragment = "";
|
|
80
|
-
const fragmentIndex = input.indexOf("#");
|
|
81
|
-
if (fragmentIndex !== -1) {
|
|
82
|
-
path = input.slice(0, fragmentIndex);
|
|
83
|
-
fragment = input.slice(fragmentIndex);
|
|
84
|
-
}
|
|
85
|
-
const [s0, ...s] = path.split("?");
|
|
86
|
-
return ((s0.endsWith("/") ? s0.slice(0, -1) : s0) || "/") + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
|
|
87
|
-
}
|
|
88
|
-
function withTrailingSlash(input = "", respectQueryAndFragment) {
|
|
89
|
-
if (!respectQueryAndFragment) return input.endsWith("/") ? input : input + "/";
|
|
90
|
-
if (hasTrailingSlash(input, true)) return input || "/";
|
|
91
|
-
let path = input;
|
|
92
|
-
let fragment = "";
|
|
93
|
-
const fragmentIndex = input.indexOf("#");
|
|
94
|
-
if (fragmentIndex !== -1) {
|
|
95
|
-
path = input.slice(0, fragmentIndex);
|
|
96
|
-
fragment = input.slice(fragmentIndex);
|
|
97
|
-
if (!path) return fragment;
|
|
98
|
-
}
|
|
99
|
-
const [s0, ...s] = path.split("?");
|
|
100
|
-
return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
|
|
101
|
-
}
|
|
102
|
-
function hasLeadingSlash(input = "") {
|
|
103
|
-
return input.startsWith("/");
|
|
104
|
-
}
|
|
105
|
-
function withoutLeadingSlash(input = "") {
|
|
106
|
-
return (hasLeadingSlash(input) ? input.slice(1) : input) || "/";
|
|
107
|
-
}
|
|
108
|
-
function withLeadingSlash(input = "") {
|
|
109
|
-
return hasLeadingSlash(input) ? input : "/" + input;
|
|
110
|
-
}
|
|
111
|
-
function cleanDoubleSlashes(input = "") {
|
|
112
|
-
return input.split("://").map((string_) => string_.replace(/\/{2,}/g, "/")).join("://");
|
|
113
|
-
}
|
|
114
|
-
function withoutBase(input, base) {
|
|
115
|
-
if (isEmptyURL(base)) return input;
|
|
116
|
-
const _base = withoutTrailingSlash(base);
|
|
117
|
-
if (!input.startsWith(_base)) return input;
|
|
118
|
-
const nextChar = input[_base.length];
|
|
119
|
-
if (nextChar && nextChar !== "/" && nextChar !== "?") return input;
|
|
120
|
-
const trimmed = input.slice(_base.length);
|
|
121
|
-
return trimmed[0] === "/" ? trimmed : "/" + trimmed;
|
|
122
|
-
}
|
|
123
|
-
function withQuery(input, query) {
|
|
124
|
-
const parsed = parseURL(input);
|
|
125
|
-
parsed.search = stringifyQuery({
|
|
126
|
-
...parseQuery(parsed.search),
|
|
127
|
-
...query
|
|
128
|
-
});
|
|
129
|
-
return stringifyParsedURL(parsed);
|
|
130
|
-
}
|
|
131
|
-
function isEmptyURL(url) {
|
|
132
|
-
return !url || url === "/";
|
|
133
|
-
}
|
|
134
|
-
function isNonEmptyURL(url) {
|
|
135
|
-
return url && url !== "/";
|
|
136
|
-
}
|
|
137
|
-
function joinURL(base, ...input) {
|
|
138
|
-
let url = base || "";
|
|
139
|
-
for (const segment of input.filter((url2) => isNonEmptyURL(url2))) if (url) {
|
|
140
|
-
const _segment = segment.replace(JOIN_LEADING_SLASH_RE, "");
|
|
141
|
-
url = withTrailingSlash(url) + _segment;
|
|
142
|
-
} else url = segment;
|
|
143
|
-
return url;
|
|
144
|
-
}
|
|
145
|
-
function joinRelativeURL(..._input) {
|
|
146
|
-
const JOIN_SEGMENT_SPLIT_RE = /\/(?!\/)/;
|
|
147
|
-
const input = _input.filter(Boolean);
|
|
148
|
-
const segments = [];
|
|
149
|
-
let segmentsDepth = 0;
|
|
150
|
-
for (const i of input) {
|
|
151
|
-
if (!i || i === "/") continue;
|
|
152
|
-
for (const [sindex, s] of i.split(JOIN_SEGMENT_SPLIT_RE).entries()) {
|
|
153
|
-
if (!s || s === ".") continue;
|
|
154
|
-
if (s === "..") {
|
|
155
|
-
if (segments.length === 1 && hasProtocol(segments[0])) continue;
|
|
156
|
-
segments.pop();
|
|
157
|
-
segmentsDepth--;
|
|
158
|
-
continue;
|
|
159
|
-
}
|
|
160
|
-
if (sindex === 1 && segments[segments.length - 1]?.endsWith(":/")) {
|
|
161
|
-
segments[segments.length - 1] += "/" + s;
|
|
162
|
-
continue;
|
|
163
|
-
}
|
|
164
|
-
segments.push(s);
|
|
165
|
-
segmentsDepth++;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
let url = segments.join("/");
|
|
169
|
-
if (segmentsDepth >= 0) {
|
|
170
|
-
if (input[0]?.startsWith("/") && !url.startsWith("/")) url = "/" + url;
|
|
171
|
-
else if (input[0]?.startsWith("./") && !url.startsWith("./")) url = "./" + url;
|
|
172
|
-
} else url = "../".repeat(-1 * segmentsDepth) + url;
|
|
173
|
-
if (input[input.length - 1]?.endsWith("/") && !url.endsWith("/")) url += "/";
|
|
174
|
-
return url;
|
|
175
|
-
}
|
|
176
|
-
function withoutProtocol(input) {
|
|
177
|
-
return withProtocol(input, "");
|
|
178
|
-
}
|
|
179
|
-
function withProtocol(input, protocol) {
|
|
180
|
-
let match = input.match(PROTOCOL_REGEX);
|
|
181
|
-
if (!match) match = input.match(/^\/{2,}/);
|
|
182
|
-
if (!match) return protocol + input;
|
|
183
|
-
return protocol + input.slice(match[0].length);
|
|
184
|
-
}
|
|
185
|
-
const protocolRelative = Symbol.for("ufo:protocolRelative");
|
|
186
|
-
function parseURL(input = "", defaultProto) {
|
|
187
|
-
const _specialProtoMatch = input.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);
|
|
188
|
-
if (_specialProtoMatch) {
|
|
189
|
-
const [, _proto, _pathname = ""] = _specialProtoMatch;
|
|
190
|
-
return {
|
|
191
|
-
protocol: _proto.toLowerCase(),
|
|
192
|
-
pathname: _pathname,
|
|
193
|
-
href: _proto + _pathname,
|
|
194
|
-
auth: "",
|
|
195
|
-
host: "",
|
|
196
|
-
search: "",
|
|
197
|
-
hash: ""
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
if (!hasProtocol(input, { acceptRelative: true })) return defaultProto ? parseURL(defaultProto + input) : parsePath(input);
|
|
201
|
-
const [, protocol = "", auth, hostAndPath = ""] = input.replace(/\\/g, "/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/) || [];
|
|
202
|
-
let [, host = "", path = ""] = hostAndPath.match(/([^#/?]*)(.*)?/) || [];
|
|
203
|
-
if (protocol === "file:") path = path.replace(/\/(?=[A-Za-z]:)/, "");
|
|
204
|
-
const { pathname, search, hash } = parsePath(path);
|
|
205
|
-
return {
|
|
206
|
-
protocol: protocol.toLowerCase(),
|
|
207
|
-
auth: auth ? auth.slice(0, Math.max(0, auth.length - 1)) : "",
|
|
208
|
-
host,
|
|
209
|
-
pathname,
|
|
210
|
-
search,
|
|
211
|
-
hash,
|
|
212
|
-
[protocolRelative]: !protocol
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
function parsePath(input = "") {
|
|
216
|
-
const [pathname = "", search = "", hash = ""] = (input.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1);
|
|
217
|
-
return {
|
|
218
|
-
pathname,
|
|
219
|
-
search,
|
|
220
|
-
hash
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
function stringifyParsedURL(parsed) {
|
|
224
|
-
const pathname = parsed.pathname || "";
|
|
225
|
-
const search = parsed.search ? (parsed.search.startsWith("?") ? "" : "?") + parsed.search : "";
|
|
226
|
-
const hash = parsed.hash || "";
|
|
227
|
-
const auth = parsed.auth ? parsed.auth + "@" : "";
|
|
228
|
-
const host = parsed.host || "";
|
|
229
|
-
return (parsed.protocol || parsed[protocolRelative] ? (parsed.protocol || "") + "//" : "") + auth + host + pathname + search + hash;
|
|
230
|
-
}
|
|
231
|
-
const FILENAME_STRICT_REGEX = /\/([^/]+\.[^/]+)$/;
|
|
232
|
-
const FILENAME_REGEX = /\/([^/]+)$/;
|
|
233
|
-
function parseFilename(input = "", opts) {
|
|
234
|
-
const { pathname } = parseURL(input);
|
|
235
|
-
const matches = opts?.strict ? pathname.match(FILENAME_STRICT_REGEX) : pathname.match(FILENAME_REGEX);
|
|
236
|
-
return matches ? matches[1] : void 0;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
//#endregion
|
|
240
|
-
export { joinRelativeURL as a, withLeadingSlash as c, withoutBase as d, withoutLeadingSlash as f, isRelative as i, withQuery as l, withoutTrailingSlash as m, hasLeadingSlash as n, joinURL as o, withoutProtocol as p, hasProtocol as r, parseFilename as s, cleanDoubleSlashes as t, withTrailingSlash as u };
|
|
1
|
+
String.fromCharCode;const HASH_RE=/#/g,AMPERSAND_RE=/&/g,SLASH_RE=/\//g,EQUAL_RE=/=/g,PLUS_RE=/\+/g,ENC_CARET_RE=/%5e/gi,ENC_BACKTICK_RE=/%60/gi,ENC_PIPE_RE=/%7c/gi,ENC_SPACE_RE=/%20/gi;function encode(e){return encodeURI(``+e).replace(ENC_PIPE_RE,`|`)}function encodeQueryValue(r){return encode(typeof r==`string`?r:JSON.stringify(r)).replace(PLUS_RE,`%2B`).replace(ENC_SPACE_RE,`+`).replace(HASH_RE,`%23`).replace(AMPERSAND_RE,`%26`).replace(ENC_BACKTICK_RE,"`").replace(ENC_CARET_RE,`^`).replace(SLASH_RE,`%2F`)}function encodeQueryKey(e){return encodeQueryValue(e).replace(EQUAL_RE,`%3D`)}function decode(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function decodeQueryKey(e){return decode(e.replace(PLUS_RE,` `))}function decodeQueryValue(e){return decode(e.replace(PLUS_RE,` `))}function parseQuery(e=``){let t=Object.create(null);e[0]===`?`&&(e=e.slice(1));for(let n of e.split(`&`)){let e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let r=decodeQueryKey(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=decodeQueryValue(e[2]||``);t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}return t}function encodeQueryItem(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${encodeQueryKey(e)}=${encodeQueryValue(t)}`).join(`&`):`${encodeQueryKey(e)}=${encodeQueryValue(t)}`:encodeQueryKey(e)}function stringifyQuery(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>encodeQueryItem(t,e[t])).filter(Boolean).join(`&`)}const PROTOCOL_STRICT_REGEX=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,PROTOCOL_REGEX=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,PROTOCOL_RELATIVE_REGEX=/^([/\\]\s*){2,}[^/\\]/,TRAILING_SLASH_RE=/\/$|\/\?|\/#/,JOIN_LEADING_SLASH_RE=/^\.?\//;function isRelative(e){return[`./`,`../`].some(t=>e.startsWith(t))}function hasProtocol(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?PROTOCOL_STRICT_REGEX.test(e):PROTOCOL_REGEX.test(e)||(t.acceptRelative?PROTOCOL_RELATIVE_REGEX.test(e):!1)}function hasTrailingSlash(e=``,t){return t?TRAILING_SLASH_RE.test(e):e.endsWith(`/`)}function withoutTrailingSlash(e=``,t){if(!t)return(hasTrailingSlash(e)?e.slice(0,-1):e)||`/`;if(!hasTrailingSlash(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function withTrailingSlash(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(hasTrailingSlash(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function hasLeadingSlash(e=``){return e.startsWith(`/`)}function withoutLeadingSlash(e=``){return(hasLeadingSlash(e)?e.slice(1):e)||`/`}function withLeadingSlash(e=``){return hasLeadingSlash(e)?e:`/`+e}function cleanDoubleSlashes(e=``){return e.split(`://`).map(e=>e.replace(/\/{2,}/g,`/`)).join(`://`)}function withoutBase(e,t){if(isEmptyURL(t))return e;let n=withoutTrailingSlash(t);if(!e.startsWith(n))return e;let r=e[n.length];if(r&&r!==`/`&&r!==`?`)return e;let i=e.slice(n.length);return i[0]===`/`?i:`/`+i}function withQuery(e,t){let n=parseURL(e);return n.search=stringifyQuery({...parseQuery(n.search),...t}),stringifyParsedURL(n)}function isEmptyURL(e){return!e||e===`/`}function isNonEmptyURL(e){return e&&e!==`/`}function joinURL(e,...t){let n=e||``;for(let e of t.filter(e=>isNonEmptyURL(e)))if(n){let t=e.replace(JOIN_LEADING_SLASH_RE,``);n=withTrailingSlash(n)+t}else n=e;return n}function joinRelativeURL(...e){let t=/\/(?!\/)/,n=e.filter(Boolean),r=[],i=0;for(let e of n)if(!(!e||e===`/`)){for(let[n,a]of e.split(t).entries())if(!(!a||a===`.`)){if(a===`..`){if(r.length===1&&hasProtocol(r[0]))continue;r.pop(),i--;continue}if(n===1&&r[r.length-1]?.endsWith(`:/`)){r[r.length-1]+=`/`+a;continue}r.push(a),i++}}let a=r.join(`/`);return i>=0?n[0]?.startsWith(`/`)&&!a.startsWith(`/`)?a=`/`+a:n[0]?.startsWith(`./`)&&!a.startsWith(`./`)&&(a=`./`+a):a=`../`.repeat(-1*i)+a,n[n.length-1]?.endsWith(`/`)&&!a.endsWith(`/`)&&(a+=`/`),a}function withoutProtocol(e){return withProtocol(e,``)}function withProtocol(e,t){let n=e.match(PROTOCOL_REGEX);return n||=e.match(/^\/{2,}/),n?t+e.slice(n[0].length):t+e}const protocolRelative=Symbol.for(`ufo:protocolRelative`);function parseURL(e=``,t){let n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=``]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:``,host:``,search:``,hash:``}}if(!hasProtocol(e,{acceptRelative:!0}))return t?parseURL(t+e):parsePath(e);let[,r=``,i,a=``]=e.replace(/\\/g,`/`).match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o=``,s=``]=a.match(/([^#/?]*)(.*)?/)||[];r===`file:`&&(s=s.replace(/\/(?=[A-Za-z]:)/,``));let{pathname:c,search:l,hash:u}=parsePath(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[protocolRelative]:!r}}function parsePath(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function stringifyParsedURL(e){let t=e.pathname||``,n=e.search?(e.search.startsWith(`?`)?``:`?`)+e.search:``,r=e.hash||``,i=e.auth?e.auth+`@`:``,a=e.host||``;return(e.protocol||e[protocolRelative]?(e.protocol||``)+`//`:``)+i+a+t+n+r}export{joinRelativeURL as a,withQuery as c,withoutLeadingSlash as d,withoutProtocol as f,isRelative as i,withTrailingSlash as l,hasLeadingSlash as n,joinURL as o,withoutTrailingSlash as p,hasProtocol as r,withLeadingSlash as s,cleanDoubleSlashes as t,withoutBase as u};
|
|
@@ -1,84 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { n as mjs_exports, t as init_mjs } from "./isexe.mjs";
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.pnpm/which@5.0.0/node_modules/which/lib/index.js
|
|
5
|
-
var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6
|
-
const { isexe, sync: isexeSync } = (init_mjs(), __toCommonJS(mjs_exports));
|
|
7
|
-
const { join, delimiter, sep, posix } = __require("path");
|
|
8
|
-
const isWindows = process.platform === "win32";
|
|
9
|
-
/* istanbul ignore next */
|
|
10
|
-
const rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? "" : sep}]`.replace(/(\\)/g, "\\$1"));
|
|
11
|
-
const rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
12
|
-
const getNotFoundError = (cmd) => Object.assign(/* @__PURE__ */ new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
13
|
-
const getPathInfo = (cmd, { path: optPath = process.env.PATH, pathExt: optPathExt = process.env.PATHEXT, delimiter: optDelimiter = delimiter }) => {
|
|
14
|
-
const pathEnv = cmd.match(rSlash) ? [""] : [...isWindows ? [process.cwd()] : [], ...(optPath || "").split(optDelimiter)];
|
|
15
|
-
if (isWindows) {
|
|
16
|
-
const pathExtExe = optPathExt || [
|
|
17
|
-
".EXE",
|
|
18
|
-
".CMD",
|
|
19
|
-
".BAT",
|
|
20
|
-
".COM"
|
|
21
|
-
].join(optDelimiter);
|
|
22
|
-
const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]);
|
|
23
|
-
if (cmd.includes(".") && pathExt[0] !== "") pathExt.unshift("");
|
|
24
|
-
return {
|
|
25
|
-
pathEnv,
|
|
26
|
-
pathExt,
|
|
27
|
-
pathExtExe
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
pathEnv,
|
|
32
|
-
pathExt: [""]
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
const getPathPart = (raw, cmd) => {
|
|
36
|
-
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
|
37
|
-
return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join(pathPart, cmd);
|
|
38
|
-
};
|
|
39
|
-
const which = async (cmd, opt = {}) => {
|
|
40
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
41
|
-
const found = [];
|
|
42
|
-
for (const envPart of pathEnv) {
|
|
43
|
-
const p = getPathPart(envPart, cmd);
|
|
44
|
-
for (const ext of pathExt) {
|
|
45
|
-
const withExt = p + ext;
|
|
46
|
-
if (await isexe(withExt, {
|
|
47
|
-
pathExt: pathExtExe,
|
|
48
|
-
ignoreErrors: true
|
|
49
|
-
})) {
|
|
50
|
-
if (!opt.all) return withExt;
|
|
51
|
-
found.push(withExt);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (opt.all && found.length) return found;
|
|
56
|
-
if (opt.nothrow) return null;
|
|
57
|
-
throw getNotFoundError(cmd);
|
|
58
|
-
};
|
|
59
|
-
const whichSync = (cmd, opt = {}) => {
|
|
60
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
61
|
-
const found = [];
|
|
62
|
-
for (const pathEnvPart of pathEnv) {
|
|
63
|
-
const p = getPathPart(pathEnvPart, cmd);
|
|
64
|
-
for (const ext of pathExt) {
|
|
65
|
-
const withExt = p + ext;
|
|
66
|
-
if (isexeSync(withExt, {
|
|
67
|
-
pathExt: pathExtExe,
|
|
68
|
-
ignoreErrors: true
|
|
69
|
-
})) {
|
|
70
|
-
if (!opt.all) return withExt;
|
|
71
|
-
found.push(withExt);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (opt.all && found.length) return found;
|
|
76
|
-
if (opt.nothrow) return null;
|
|
77
|
-
throw getNotFoundError(cmd);
|
|
78
|
-
};
|
|
79
|
-
module.exports = which;
|
|
80
|
-
which.sync = whichSync;
|
|
81
|
-
}));
|
|
82
|
-
|
|
83
|
-
//#endregion
|
|
84
|
-
export { require_lib as t };
|
|
1
|
+
import{a as __require,o as __toCommonJS,t as __commonJSMin}from"../rolldown-runtime.mjs";import{n as mjs_exports,t as init_mjs}from"./isexe.mjs";var require_lib=__commonJSMin(((n,a)=>{let{isexe:o,sync:s}=(init_mjs(),__toCommonJS(mjs_exports)),{join:c,delimiter:l,sep:u,posix:d}=__require(`path`),f=process.platform===`win32`,p=new RegExp(`[${d.sep}${u===d.sep?``:u}]`.replace(/(\\)/g,`\\$1`)),m=RegExp(`^\\.${p.source}`),h=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),g=(e,{path:t=process.env.PATH,pathExt:n=process.env.PATHEXT,delimiter:r=l})=>{let i=e.match(p)?[``]:[...f?[process.cwd()]:[],...(t||``).split(r)];if(f){let t=n||[`.EXE`,`.CMD`,`.BAT`,`.COM`].join(r),a=t.split(r).flatMap(e=>[e,e.toLowerCase()]);return e.includes(`.`)&&a[0]!==``&&a.unshift(``),{pathEnv:i,pathExt:a,pathExtExe:t}}return{pathEnv:i,pathExt:[``]}},_=(e,t)=>{let n=/^".*"$/.test(e)?e.slice(1,-1):e;return(!n&&m.test(t)?t.slice(0,2):``)+c(n,t)},v=async(e,t={})=>{let{pathEnv:n,pathExt:r,pathExtExe:i}=g(e,t),a=[];for(let s of n){let n=_(s,e);for(let e of r){let r=n+e;if(await o(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;a.push(r)}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw h(e)},y=(e,t={})=>{let{pathEnv:n,pathExt:r,pathExtExe:i}=g(e,t),a=[];for(let o of n){let n=_(o,e);for(let e of r){let r=n+e;if(s(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;a.push(r)}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw h(e)};a.exports=v,v.sync=y}));export{require_lib as t};
|
|
@@ -1,43 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
let lastChar = str[lastCharPos];
|
|
14
|
-
while (lastChar === " " || lastChar === " ") lastChar = str[--lastCharPos];
|
|
15
|
-
return str.substring(0, lastCharPos + 1);
|
|
16
|
-
}
|
|
17
|
-
function trimTabAndSpaces(str) {
|
|
18
|
-
return str.split("\n").map((line) => trimEnd(line)).join("\n");
|
|
19
|
-
}
|
|
20
|
-
module.exports = function(str, options) {
|
|
21
|
-
options = options || {};
|
|
22
|
-
if (str == null) return str;
|
|
23
|
-
var width = options.width || 50;
|
|
24
|
-
var indent = typeof options.indent === "string" ? options.indent : " ";
|
|
25
|
-
var newline = options.newline || "\n" + indent;
|
|
26
|
-
var escape = typeof options.escape === "function" ? options.escape : identity;
|
|
27
|
-
var regexString = ".{1," + width + "}";
|
|
28
|
-
if (options.cut !== true) regexString += "([\\s]+|$)|[^\\s]+?([\\s]+|$)";
|
|
29
|
-
var re = new RegExp(regexString, "g");
|
|
30
|
-
var result = indent + (str.match(re) || []).map(function(line) {
|
|
31
|
-
if (line.slice(-1) === "\n") line = line.slice(0, line.length - 1);
|
|
32
|
-
return escape(line);
|
|
33
|
-
}).join(newline);
|
|
34
|
-
if (options.trim === true) result = trimTabAndSpaces(result);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
function identity(str) {
|
|
38
|
-
return str;
|
|
39
|
-
}
|
|
40
|
-
}));
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
export { require_word_wrap as t };
|
|
1
|
+
import{t as __commonJSMin}from"../rolldown-runtime.mjs";var require_word_wrap=__commonJSMin(((e,t)=>{
|
|
2
|
+
/*!
|
|
3
|
+
* word-wrap <https://github.com/jonschlinkert/word-wrap>
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2014-2023, Jon Schlinkert.
|
|
6
|
+
* Released under the MIT License.
|
|
7
|
+
*/
|
|
8
|
+
function n(e){let t=e.length-1,n=e[t];for(;n===` `||n===` `;)n=e[--t];return e.substring(0,t+1)}function r(e){return e.split(`
|
|
9
|
+
`).map(e=>n(e)).join(`
|
|
10
|
+
`)}t.exports=function(e,t){if(t||={},e==null)return e;var n=t.width||50,a=typeof t.indent==`string`?t.indent:` `,o=t.newline||`
|
|
11
|
+
`+a,s=typeof t.escape==`function`?t.escape:i,c=`.{1,`+n+`}`;t.cut!==!0&&(c+=`([\\s]+|$)|[^\\s]+?([\\s]+|$)`);var l=new RegExp(c,`g`),u=a+(e.match(l)||[]).map(function(e){return e.slice(-1)===`
|
|
12
|
+
`&&(e=e.slice(0,e.length-1)),s(e)}).join(o);return t.trim===!0&&(u=r(u)),u};function i(e){return e}}));export{require_word_wrap as t};
|