@vite-hub/workspace 0.0.1 → 0.0.2
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 +190 -17
- package/dist/{ai-Bk3LLnit.js → ai-Cztw4eLk.js} +149 -29
- package/dist/ai-hFdsvDHC.d.ts +162 -0
- package/dist/ai.d.ts +2 -85
- package/dist/ai.js +1 -1
- package/dist/artifacts-store-BAV9jZpd.js +555 -0
- package/dist/asset-registry-CaG9b7tf.js +19 -0
- package/dist/cli.d.ts +31 -0
- package/dist/cli.js +303 -0
- package/dist/cloudflare-env-CKxUs2fa.js +20 -0
- package/dist/cloudflare.d.ts +16 -0
- package/dist/cloudflare.js +3 -0
- package/dist/collections/client.d.ts +39 -0
- package/dist/collections/client.js +137 -0
- package/dist/collections.d.ts +59 -0
- package/dist/collections.js +159 -0
- package/dist/config--r5unwPc.js +7811 -0
- package/dist/config-Ca5DM8fF.d.ts +28 -0
- package/dist/config-DCQ6y30R.js +30 -0
- package/dist/file-B2q9NE18.js +24 -0
- package/dist/{files-DbsIjBya.js → files-xy0le-_U.js} +6 -5
- package/dist/github-lIO6-2sH.js +194 -0
- package/dist/glob-DeH0dzZX.js +23 -0
- package/dist/host-I-_vDs05.js +370 -0
- package/dist/hosted-vercel-blob.d.ts +15 -0
- package/dist/hosted-vercel-blob.js +26 -0
- package/dist/hosted.d.ts +18 -0
- package/dist/hosted.js +30 -0
- package/dist/index.d.ts +137 -102
- package/dist/index.js +479 -594
- package/dist/lifecycle-Lhk3dAMt.js +176 -0
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js +1 -1
- package/dist/nitro.d.ts +2 -31
- package/dist/nitro.js +2 -2
- package/dist/nuxt.d.ts +26 -0
- package/dist/nuxt.js +36 -0
- package/dist/path-CNI6wKIU.js +115 -0
- package/dist/{provider-BZuKAV4e.js → provider-CeQciesl.js} +142 -37
- package/dist/providers/cloudflare/artifacts-store.d.ts +1 -1
- package/dist/providers/cloudflare/artifacts-store.js +1 -383
- package/dist/providers/github/store.d.ts +6 -0
- package/dist/providers/github/store.js +362 -0
- package/dist/providers/vercel/blob-store.d.ts +1 -1
- package/dist/providers/vercel/blob-store.js +77 -18
- package/dist/publish.d.ts +3 -2
- package/dist/publish.js +48 -142
- package/dist/registry-C7DMdBXN.js +74 -0
- package/dist/{registry-D4Qzq26I.d.ts → registry-CoC9JxVt.d.ts} +3 -2
- package/dist/request-execution-C8qRcReq.js +80 -0
- package/dist/runtime/assets.d.ts +2 -1
- package/dist/runtime/assets.js +5 -5
- package/dist/runtime/empty-assets-registry.d.ts +1 -1
- package/dist/runtime/empty-registry.d.ts +1 -1
- package/dist/runtime/state.d.ts +4 -21
- package/dist/runtime/state.js +7 -4
- package/dist/runtime/workspace.d.ts +2 -0
- package/dist/runtime/workspace.js +2 -0
- package/dist/runtime.d.ts +38 -0
- package/dist/runtime.js +643 -0
- package/dist/{search-DtaEyjpO.js → search-C4REyHj9.js} +2 -2
- package/dist/server.d.ts +65 -0
- package/dist/server.js +355 -0
- package/dist/shared-BRycRSbo.js +255 -0
- package/dist/source-metadata.d.ts +2 -0
- package/dist/source-metadata.js +2 -0
- package/dist/state-DSAHEsq6.d.ts +25 -0
- package/dist/sync-DO42ypji.js +269 -0
- package/dist/target-D4Bqb1eH.js +11 -0
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -1
- package/dist/types-DHkae7Cb.d.ts +628 -0
- package/dist/use-D16tf8Ph.d.ts +86 -0
- package/dist/use-d_PlAdOu.js +353 -0
- package/dist/{utils-BtAm_K5P.js → utils-BPdaCyI6.js} +7 -3
- package/dist/vite-NWC9mFjI.js +1882 -0
- package/dist/vite.d.ts +33 -5
- package/dist/vite.js +2 -131
- package/dist/workspace-f2DBLmPZ.d.ts +6 -0
- package/dist/workspace-n4wBmdaM.js +1476 -0
- package/package.json +158 -62
- package/dist/asset-registry-CMuQbyvl.js +0 -14
- package/dist/cloudflare-env-DL94Uvpz.js +0 -12
- package/dist/config-CvS-7sre.js +0 -49
- package/dist/errors-BUL8SoFS.js +0 -21
- package/dist/lifecycle-uD82JeGh.js +0 -92
- package/dist/module-8LZUMEXC.js +0 -922
- package/dist/path-BVv9OXhg.js +0 -63
- package/dist/registry-Cnr0NoKv.js +0 -932
- package/dist/runtime/nitro-plugin.d.ts +0 -6
- package/dist/runtime/nitro-plugin.js +0 -14
- package/dist/sandbox-DtGXCWRq.js +0 -198
- package/dist/types-CwNcWTdt.d.ts +0 -378
- /package/dist/{chunk-DrSxFLj_.js → chunk-8H4AJuhK.js} +0 -0
package/dist/path-BVv9OXhg.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./chunk-DrSxFLj_.js";
|
|
2
|
-
import { r as WorkspacePathError } from "./errors-BUL8SoFS.js";
|
|
3
|
-
import { relative, resolve, sep } from "node:path";
|
|
4
|
-
import { createHash } from "node:crypto";
|
|
5
|
-
import { minimatch } from "minimatch";
|
|
6
|
-
//#region src/core/path.ts
|
|
7
|
-
var path_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
-
contentToBytes: () => contentToBytes,
|
|
9
|
-
decodeFile: () => decodeFile,
|
|
10
|
-
matchesAny: () => matchesAny,
|
|
11
|
-
normalizeSafeWorkspacePath: () => normalizeSafeWorkspacePath,
|
|
12
|
-
normalizeSafeWorkspacePattern: () => normalizeSafeWorkspacePattern,
|
|
13
|
-
normalizeWorkspacePath: () => normalizeWorkspacePath,
|
|
14
|
-
resolveInside: () => resolveInside,
|
|
15
|
-
sha256: () => sha256
|
|
16
|
-
});
|
|
17
|
-
function normalizeWorkspacePath(path = "") {
|
|
18
|
-
return path.replace(/\\/g, "/").replace(/^\/+/, "").replace(/\/+$/, "");
|
|
19
|
-
}
|
|
20
|
-
function normalizeSafeWorkspacePath(path = "", options = {}) {
|
|
21
|
-
const raw = path.replace(/\\/g, "/");
|
|
22
|
-
const normalized = normalizeWorkspacePath(path);
|
|
23
|
-
const parts = normalized.split("/").filter(Boolean);
|
|
24
|
-
if (!options.allowEmpty && !normalized) throw new WorkspacePathError(path);
|
|
25
|
-
if (raw.startsWith("/") || parts.some((part) => part === "." || part === "..")) throw new WorkspacePathError(path);
|
|
26
|
-
if (!options.allowReserved && (parts[0] === ".git" || parts[0] === ".vitehub")) throw new WorkspacePathError(path);
|
|
27
|
-
return normalized;
|
|
28
|
-
}
|
|
29
|
-
function normalizeSafeWorkspacePattern(pattern) {
|
|
30
|
-
return normalizeSafeWorkspacePath(pattern, {
|
|
31
|
-
allowEmpty: true,
|
|
32
|
-
pattern: true
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function resolveInside(root, path = "") {
|
|
36
|
-
const resolvedRoot = resolve(root);
|
|
37
|
-
const resolved = resolve(resolvedRoot, normalizeWorkspacePath(path));
|
|
38
|
-
const rel = relative(resolvedRoot, resolved);
|
|
39
|
-
if (rel.startsWith("..") || rel === ".." || rel.includes(`..${sep}`) || rel === "") {
|
|
40
|
-
if (rel === "") return resolved;
|
|
41
|
-
throw new WorkspacePathError(path);
|
|
42
|
-
}
|
|
43
|
-
return resolved;
|
|
44
|
-
}
|
|
45
|
-
function matchesAny(path, patterns) {
|
|
46
|
-
if (!patterns) return true;
|
|
47
|
-
const list = Array.isArray(patterns) ? patterns : [patterns];
|
|
48
|
-
const normalizedPath = normalizeWorkspacePath(path);
|
|
49
|
-
return list.some((pattern) => minimatch(normalizedPath, normalizeWorkspacePath(pattern), { dot: true }));
|
|
50
|
-
}
|
|
51
|
-
function contentToBytes(content) {
|
|
52
|
-
return typeof content === "string" ? new TextEncoder().encode(content) : content;
|
|
53
|
-
}
|
|
54
|
-
function decodeFile(content, options) {
|
|
55
|
-
if (options?.encoding === "binary") return content;
|
|
56
|
-
return typeof content === "string" ? content : new TextDecoder().decode(content);
|
|
57
|
-
}
|
|
58
|
-
async function sha256(input) {
|
|
59
|
-
const bytes = contentToBytes(typeof input === "string" || input instanceof Uint8Array ? input : JSON.stringify(input));
|
|
60
|
-
return createHash("sha256").update(bytes).digest("hex");
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
export { normalizeSafeWorkspacePattern as a, resolveInside as c, normalizeSafeWorkspacePath as i, sha256 as l, decodeFile as n, normalizeWorkspacePath as o, matchesAny as r, path_exports as s, contentToBytes as t };
|