@vite-hub/workspace 0.0.3 → 0.1.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/LICENSE +201 -0
- package/README.md +236 -58
- package/dist/{ai-nmHdzjCM.d.ts → ai-BW2ZhizI.d.ts} +22 -7
- package/dist/{ai-Ce3PtWFW.js → ai-BZyLwULx.js} +147 -66
- package/dist/ai.d.ts +2 -2
- package/dist/ai.js +1 -1
- package/dist/{asset-registry-CaG9b7tf.js → asset-registry-DfBV5kmw.js} +3 -2
- package/dist/association-Cm0dUTDU-CDDhJnIh-Cv3bWnVb.js +19 -0
- package/dist/blob-database.d.ts +521 -0
- package/dist/blob-database.js +601 -0
- package/dist/cloudflare.d.ts +5 -6
- package/dist/cloudflare.js +1 -1
- package/dist/config-B7dmzDX3.js +1112 -0
- package/dist/{config-3I1BnsdO.d.ts → config-DLKdaFWN.d.ts} +1 -2
- package/dist/error-diagnostics-A_8Kp-48.js +116 -0
- package/dist/error-diagnostics-DY5GP47p.js +96 -0
- package/dist/events-7EBoeIPd-A2RUkJi5-BxrICQ17.js +354 -0
- package/dist/events-CRaLy7U3-3PNNp5WZ-Gv9nd0cH.js +214 -0
- package/dist/events-CeChclTf-CX-gD8oy-4aL2j6V-.js +527 -0
- package/dist/feed-DsC7Vws1-M_de2nSK-tKc0Pwo8.js +248 -0
- package/dist/feed-Dyf730Ys-D0HgBba6-BUnCa5gS.js +179 -0
- package/dist/file-C0_aPWSS.js +26 -0
- package/dist/file-metadata-CxDy-E2H.js +58 -0
- package/dist/{files-QRV55OCx.js → files-C7Px8uaC.js} +21 -10
- package/dist/forgejo-BN8ItCfl-Bbn4vhDd.js +2278 -0
- package/dist/{github-CfA5vpJ5.js → github-CPxHtFB7.js} +36 -34
- package/dist/github-DtncTfmv-Du2S8lGF.js +4159 -0
- package/dist/gitlab-BoDm8-BC-xzZsW9eW.js +2530 -0
- package/dist/glob--XcLlcml.js +22 -0
- package/dist/glob--kNYDbfU.js +30 -0
- package/dist/graphql-DG5aJBT3-DceyFYdM-C4saqX37.js +489 -0
- package/dist/host-CFnrTXTK.js +1086 -0
- package/dist/{hosted-C1-tTTTf.js → hosted-acMA5XyL.js} +216 -43
- package/dist/hosted-vercel-blob-DKntsHaf.js +12603 -0
- package/dist/hosted-vercel-blob.d.ts +5 -6
- package/dist/hosted-vercel-blob.js +1 -1
- package/dist/hosted.d.ts +6 -7
- package/dist/hosted.js +1 -1
- package/dist/index.d.ts +76 -64
- package/dist/index.js +162 -457
- package/dist/inspect-BoObD2cJ.js +167 -0
- package/dist/internal/path.d.ts +2 -0
- package/dist/internal/path.js +2 -0
- package/dist/lifecycle-BwZ7c9hb.js +596 -0
- package/dist/loader.d.ts +5 -6
- package/dist/loader.js +3 -2
- package/dist/mcp-resources-BREFCmtn.js +39 -0
- package/dist/memory-BbwOqDXl.js +248 -0
- package/dist/metadata-target-DZEZQGHA.js +1588 -0
- package/dist/mountx.d.ts +4 -6
- package/dist/mountx.js +10 -8
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +1 -1
- package/dist/nuxt.d.ts +13 -12
- package/dist/nuxt.js +10 -8
- package/dist/operations-BcpWr41m.js +159 -0
- package/dist/operations-CGqY1XeG.js +965 -0
- package/dist/operations-DnOwKsJT.d.ts +136 -0
- package/dist/operations.d.ts +53 -0
- package/dist/operations.js +2 -0
- package/dist/{path-CNI6wKIU.js → path-CNAwN7pw.js} +34 -35
- package/dist/path-DrSIenjj.js +59 -0
- package/dist/path-zHxQUbqa.d.ts +9 -0
- package/dist/plugins-DqQ8b4T5.d.ts +10 -0
- package/dist/provider-kXjfli9u.js +1457 -0
- package/dist/providers/github/store.d.ts +3 -5
- package/dist/providers/github/store.js +1 -1
- package/dist/registry-Bp-8UUfG.js +129 -0
- package/dist/{registry-BIQVCBWI.d.ts → registry-Cg1TJVVZ.d.ts} +3 -4
- package/dist/{request-execution-u9mgUXKX.js → request-execution-Dk9rY-Yh.js} +24 -20
- package/dist/rolldown-runtime-B4iAMlE-.js +35 -0
- package/dist/runtime/assets.d.ts +3 -5
- package/dist/runtime/assets.js +9 -6
- package/dist/runtime/empty-assets-registry.d.ts +1 -2
- package/dist/runtime/empty-registry.d.ts +1 -2
- package/dist/runtime/state.d.ts +4 -4
- package/dist/runtime/state.js +10 -7
- package/dist/runtime/workspace.d.ts +1 -1
- package/dist/runtime/workspace.js +1 -1
- package/dist/runtime.d.ts +84 -15
- package/dist/runtime.js +561 -108
- package/dist/{search-C4REyHj9.js → search-CrTmXj5h.js} +10 -9
- package/dist/server-BNQ-Nbjj.js +290 -0
- package/dist/server.d.ts +22 -34
- package/dist/server.js +2 -355
- package/dist/shared-DalXdP0i.js +2158 -0
- package/dist/source-metadata.d.ts +7 -1
- package/dist/source-metadata.js +34 -2
- package/dist/{state-TTqa3x3Y.d.ts → state-B8zbLi5t.d.ts} +14 -13
- package/dist/store-CXgmu-uw.js +1729 -0
- package/dist/{sync-DiuDmSGk.js → sync-CN6ec-5M.js} +62 -41
- package/dist/templates-Bn8a-pd2-D9DhJEVD-CBfXNRzz.js +125 -0
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -1
- package/dist/token-CO62GglH.js +61 -0
- package/dist/{types-60Yn149G.d.ts → types-DeK9GIxy.d.ts} +348 -49
- package/dist/{use-CsV3oIxH.js → use-BQj7nSz6.js} +200 -45
- package/dist/{use-CUFSnFCS.d.ts → use-DhwhbAVV.d.ts} +34 -12
- package/dist/utils-Blrh4N2n.js +545 -0
- package/dist/vite-BEvgU2GY.js +20909 -0
- package/dist/vite-CcZmMQ7S.d.ts +476 -0
- package/dist/vite.d.ts +2 -50
- package/dist/vite.js +2 -2
- package/dist/webhooks-DgHwxxYz-D1V2LOr1-azofFOiP.js +1565 -0
- package/dist/workspace-6pxkOuxr.js +1286 -0
- package/dist/workspace-BWJQBK1u.d.ts +7 -0
- package/package.json +90 -59
- package/dist/chunk-8H4AJuhK.js +0 -14
- package/dist/collections/client.d.ts +0 -39
- package/dist/collections/client.js +0 -137
- package/dist/collections.d.ts +0 -59
- package/dist/collections.js +0 -159
- package/dist/config-CDoyls2X.js +0 -30
- package/dist/config-CZLO0m9h.js +0 -7811
- package/dist/file-CHfsZpso.js +0 -23
- package/dist/glob-D0vD_wRY.js +0 -17
- package/dist/host-CAnbugpI.js +0 -370
- package/dist/hosted-vercel-blob-CWBILDVo.js +0 -257
- package/dist/lifecycle-BYoa9hVb.js +0 -176
- package/dist/provider-C3_elpEh.js +0 -599
- package/dist/publish.d.ts +0 -35
- package/dist/publish.js +0 -112
- package/dist/registry-CqyDTW9Y.js +0 -74
- package/dist/runtime-options-BsPSv5O7.js +0 -13
- package/dist/shared-jfogBrd5.js +0 -273
- package/dist/store-Bs1SLh55.js +0 -414
- package/dist/vite-tbfDxtlu.js +0 -2191
- package/dist/workspace-66SKyiec.d.ts +0 -6
- package/dist/workspace-C4k92Ow8.js +0 -1460
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
2
|
+
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
3
|
+
function normalizeWindowsPath(input = "") {
|
|
4
|
+
if (!input) return input;
|
|
5
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
6
|
+
}
|
|
7
|
+
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
8
|
+
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
9
|
+
const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
10
|
+
function cwd() {
|
|
11
|
+
if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
|
|
12
|
+
return "/";
|
|
13
|
+
}
|
|
14
|
+
const resolve = function(...arguments_) {
|
|
15
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
16
|
+
let resolvedPath = "";
|
|
17
|
+
let resolvedAbsolute = false;
|
|
18
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
19
|
+
const path = index >= 0 ? arguments_[index] : cwd();
|
|
20
|
+
if (!path || path.length === 0) continue;
|
|
21
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
22
|
+
resolvedAbsolute = isAbsolute(path);
|
|
23
|
+
}
|
|
24
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
25
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
|
|
26
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
27
|
+
};
|
|
28
|
+
function normalizeString(path, allowAboveRoot) {
|
|
29
|
+
let res = "";
|
|
30
|
+
let lastSegmentLength = 0;
|
|
31
|
+
let lastSlash = -1;
|
|
32
|
+
let dots = 0;
|
|
33
|
+
let char = null;
|
|
34
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
35
|
+
if (index < path.length) char = path[index];
|
|
36
|
+
else if (char === "/") break;
|
|
37
|
+
else char = "/";
|
|
38
|
+
if (char === "/") {
|
|
39
|
+
if (lastSlash === index - 1 || dots === 1);
|
|
40
|
+
else if (dots === 2) {
|
|
41
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
42
|
+
if (res.length > 2) {
|
|
43
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
44
|
+
if (lastSlashIndex === -1) {
|
|
45
|
+
res = "";
|
|
46
|
+
lastSegmentLength = 0;
|
|
47
|
+
} else {
|
|
48
|
+
res = res.slice(0, lastSlashIndex);
|
|
49
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
50
|
+
}
|
|
51
|
+
lastSlash = index;
|
|
52
|
+
dots = 0;
|
|
53
|
+
continue;
|
|
54
|
+
} else if (res.length > 0) {
|
|
55
|
+
res = "";
|
|
56
|
+
lastSegmentLength = 0;
|
|
57
|
+
lastSlash = index;
|
|
58
|
+
dots = 0;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (allowAboveRoot) {
|
|
63
|
+
res += res.length > 0 ? "/.." : "..";
|
|
64
|
+
lastSegmentLength = 2;
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
68
|
+
else res = path.slice(lastSlash + 1, index);
|
|
69
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
70
|
+
}
|
|
71
|
+
lastSlash = index;
|
|
72
|
+
dots = 0;
|
|
73
|
+
} else if (char === "." && dots !== -1) ++dots;
|
|
74
|
+
else dots = -1;
|
|
75
|
+
}
|
|
76
|
+
return res;
|
|
77
|
+
}
|
|
78
|
+
const isAbsolute = function(p) {
|
|
79
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
80
|
+
};
|
|
81
|
+
const relative = function(from, to) {
|
|
82
|
+
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
83
|
+
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
84
|
+
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) return _to.join("/");
|
|
85
|
+
const _fromCopy = [..._from];
|
|
86
|
+
for (const segment of _fromCopy) {
|
|
87
|
+
if (_to[0] !== segment) break;
|
|
88
|
+
_from.shift();
|
|
89
|
+
_to.shift();
|
|
90
|
+
}
|
|
91
|
+
return [..._from.map(() => ".."), ..._to].join("/");
|
|
92
|
+
};
|
|
93
|
+
const dirname = function(p) {
|
|
94
|
+
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
95
|
+
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
|
|
96
|
+
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
97
|
+
};
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region ../internal/src/inspect.ts
|
|
100
|
+
function relativeDefinitionFile(projectRoot, file) {
|
|
101
|
+
return relative(projectRoot, file).replaceAll("\\", "/");
|
|
102
|
+
}
|
|
103
|
+
const redactedInspectionValue = "[redacted]";
|
|
104
|
+
const secretKeyPattern = /secret|token|passw(?:or)?d|credential|api[-_\s]?key|private[-_\s]?key|authorization|cookie|signature|dsn|connection[-_\s]?string/i;
|
|
105
|
+
const secretValuePattern = /^(?:[a-z][a-z0-9+.-]*:\/\/[^/\s?#]*@|bearer\s)/i;
|
|
106
|
+
/** Whether an inspection field names a credential, regardless of its value. */
|
|
107
|
+
function isSecretInspectionKey(key) {
|
|
108
|
+
return secretKeyPattern.test(key);
|
|
109
|
+
}
|
|
110
|
+
const embeddedUrlCredentialPattern = /\b([a-z][a-z0-9+.-]*:\/\/)[^/\s?#]*@/gi;
|
|
111
|
+
const embeddedCookiePattern = /\b([\w-]*cookie[\w-]*["']?\s*[:=]\s*)(?:"(?:\\[^\r\n]|[^"\\\r\n])*"(?:\s*;\s*[\w.-]+\s*=[^;\r\n]*)*|'(?:\\[^\r\n]|[^'\\\r\n])*'(?:\s*;\s*[\w.-]+\s*=[^;\r\n]*)*|[^\r\n]+?(?=\s*(?:;\s*[^;=\r\n/]+\s*(?:\r?\n|$)|&|\r?\n|$)))/gi;
|
|
112
|
+
const embeddedBearerPattern = /\bbearer\s+[^\s,;]+/gi;
|
|
113
|
+
const embeddedAuthorizationPattern = new RegExp(String.raw`\b([\w-]*authorization[\w-]*["']?\s*[:=]\s*)(?!\[redacted\](?=$|[\s,;}&]))(?:"(?:\\[^\r\n]|[^"\\\r\n])*"|'(?:\\[^\r\n]|[^'\\\r\n])*'|[^\r\n]+?(?=\s*(?:[,;])?\s*(?:${secretKeyPattern.source})[\w-]*\s*[:=]|\s+rejected\b|$))`, "gi");
|
|
114
|
+
const embeddedSecretAssignmentPattern = new RegExp(String.raw`\b([\w-]*(?:${secretKeyPattern.source})[\w-]*["']?\s*[:=]\s*)(?!\[redacted\](?=$|[\s,;}&]))(?:"(?:\\[^\r\n]|[^"\\\r\n])*"|'(?:\\[^\r\n]|[^'\\\r\n])*'|[^\s,;&#&]+)`, "gi");
|
|
115
|
+
/**
|
|
116
|
+
* Removes credentials inside free text, for example an error message. URL credentials, bearer tokens, and
|
|
117
|
+
* `name=value` pairs with a secret name are replaced with `[redacted]`.
|
|
118
|
+
*/
|
|
119
|
+
function redactInspectionText(value) {
|
|
120
|
+
return value.replace(embeddedUrlCredentialPattern, `$1${redactedInspectionValue}@`).replace(embeddedAuthorizationPattern, `$1${redactedInspectionValue}`).replace(embeddedCookiePattern, `$1${redactedInspectionValue}`).replace(embeddedBearerPattern, `Bearer ${redactedInspectionValue}`).replace(embeddedSecretAssignmentPattern, `$1${redactedInspectionValue}`);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Removes values that can carry credentials before inspection output leaves the process.
|
|
124
|
+
* Keys that name secrets, plaintext Worker `vars`, and URLs with embedded credentials are redacted.
|
|
125
|
+
*/
|
|
126
|
+
function redactInspectionValue(value, key) {
|
|
127
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
128
|
+
let remaining = 1e3;
|
|
129
|
+
function visit(entry, entryKey, depth = 0) {
|
|
130
|
+
if (entryKey && isSecretInspectionKey(entryKey)) return redactedInspectionValue;
|
|
131
|
+
if (--remaining < 0 || depth > 10) return "[truncated]";
|
|
132
|
+
if (typeof entry === "string") {
|
|
133
|
+
const text = entry.slice(0, 1e4);
|
|
134
|
+
return secretValuePattern.test(text) ? redactedInspectionValue : redactInspectionText(text);
|
|
135
|
+
}
|
|
136
|
+
if (typeof entry === "bigint") return entry.toString();
|
|
137
|
+
if (typeof entry === "number") return Number.isFinite(entry) ? entry : String(entry);
|
|
138
|
+
if (entry === null || typeof entry === "boolean") return entry;
|
|
139
|
+
if (typeof entry !== "object") return entry === void 0 ? null : "[unsupported]";
|
|
140
|
+
if (seen.has(entry)) return "[circular]";
|
|
141
|
+
seen.add(entry);
|
|
142
|
+
try {
|
|
143
|
+
let dateTime;
|
|
144
|
+
try {
|
|
145
|
+
dateTime = Date.prototype.getTime.call(entry);
|
|
146
|
+
} catch {}
|
|
147
|
+
if (dateTime !== void 0) return Number.isNaN(dateTime) ? "Invalid Date" : Date.prototype.toISOString.call(entry);
|
|
148
|
+
if (Array.isArray(entry)) return entry.slice(0, 100).map((item) => visit(item, void 0, depth + 1));
|
|
149
|
+
let setValues;
|
|
150
|
+
try {
|
|
151
|
+
setValues = [...Set.prototype.values.call(entry)];
|
|
152
|
+
} catch {}
|
|
153
|
+
if (setValues) return setValues.slice(0, 100).map((item) => visit(item, void 0, depth + 1));
|
|
154
|
+
let mapEntries;
|
|
155
|
+
try {
|
|
156
|
+
mapEntries = [...Map.prototype.entries.call(entry)];
|
|
157
|
+
} catch {}
|
|
158
|
+
const entries = mapEntries ? mapEntries.map(([name, item]) => [String(name), item]) : Object.entries(entry);
|
|
159
|
+
return Object.fromEntries(entries.slice(0, 100).map(([name, item]) => [name, name === "vars" && item && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.keys(item).slice(0, 100).map((variable) => [variable, redactedInspectionValue])) : visit(item, name, depth + 1)]));
|
|
160
|
+
} finally {
|
|
161
|
+
seen.delete(entry);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return visit(value, key);
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
167
|
+
export { isAbsolute as a, dirname as i, redactInspectionValue as n, relative as o, relativeDefinitionFile as r, resolve as s, redactInspectionText as t };
|