@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.
Files changed (94) hide show
  1. package/README.md +190 -17
  2. package/dist/{ai-Bk3LLnit.js → ai-Cztw4eLk.js} +149 -29
  3. package/dist/ai-hFdsvDHC.d.ts +162 -0
  4. package/dist/ai.d.ts +2 -85
  5. package/dist/ai.js +1 -1
  6. package/dist/artifacts-store-BAV9jZpd.js +555 -0
  7. package/dist/asset-registry-CaG9b7tf.js +19 -0
  8. package/dist/cli.d.ts +31 -0
  9. package/dist/cli.js +303 -0
  10. package/dist/cloudflare-env-CKxUs2fa.js +20 -0
  11. package/dist/cloudflare.d.ts +16 -0
  12. package/dist/cloudflare.js +3 -0
  13. package/dist/collections/client.d.ts +39 -0
  14. package/dist/collections/client.js +137 -0
  15. package/dist/collections.d.ts +59 -0
  16. package/dist/collections.js +159 -0
  17. package/dist/config--r5unwPc.js +7811 -0
  18. package/dist/config-Ca5DM8fF.d.ts +28 -0
  19. package/dist/config-DCQ6y30R.js +30 -0
  20. package/dist/file-B2q9NE18.js +24 -0
  21. package/dist/{files-DbsIjBya.js → files-xy0le-_U.js} +6 -5
  22. package/dist/github-lIO6-2sH.js +194 -0
  23. package/dist/glob-DeH0dzZX.js +23 -0
  24. package/dist/host-I-_vDs05.js +370 -0
  25. package/dist/hosted-vercel-blob.d.ts +15 -0
  26. package/dist/hosted-vercel-blob.js +26 -0
  27. package/dist/hosted.d.ts +18 -0
  28. package/dist/hosted.js +30 -0
  29. package/dist/index.d.ts +137 -102
  30. package/dist/index.js +479 -594
  31. package/dist/lifecycle-Lhk3dAMt.js +176 -0
  32. package/dist/loader.d.ts +1 -1
  33. package/dist/loader.js +1 -1
  34. package/dist/nitro.d.ts +2 -31
  35. package/dist/nitro.js +2 -2
  36. package/dist/nuxt.d.ts +26 -0
  37. package/dist/nuxt.js +36 -0
  38. package/dist/path-CNI6wKIU.js +115 -0
  39. package/dist/{provider-BZuKAV4e.js → provider-CeQciesl.js} +142 -37
  40. package/dist/providers/cloudflare/artifacts-store.d.ts +1 -1
  41. package/dist/providers/cloudflare/artifacts-store.js +1 -383
  42. package/dist/providers/github/store.d.ts +6 -0
  43. package/dist/providers/github/store.js +362 -0
  44. package/dist/providers/vercel/blob-store.d.ts +1 -1
  45. package/dist/providers/vercel/blob-store.js +77 -18
  46. package/dist/publish.d.ts +3 -2
  47. package/dist/publish.js +48 -142
  48. package/dist/registry-C7DMdBXN.js +74 -0
  49. package/dist/{registry-D4Qzq26I.d.ts → registry-CoC9JxVt.d.ts} +3 -2
  50. package/dist/request-execution-C8qRcReq.js +80 -0
  51. package/dist/runtime/assets.d.ts +2 -1
  52. package/dist/runtime/assets.js +5 -5
  53. package/dist/runtime/empty-assets-registry.d.ts +1 -1
  54. package/dist/runtime/empty-registry.d.ts +1 -1
  55. package/dist/runtime/state.d.ts +4 -21
  56. package/dist/runtime/state.js +7 -4
  57. package/dist/runtime/workspace.d.ts +2 -0
  58. package/dist/runtime/workspace.js +2 -0
  59. package/dist/runtime.d.ts +38 -0
  60. package/dist/runtime.js +643 -0
  61. package/dist/{search-DtaEyjpO.js → search-C4REyHj9.js} +2 -2
  62. package/dist/server.d.ts +65 -0
  63. package/dist/server.js +355 -0
  64. package/dist/shared-BRycRSbo.js +255 -0
  65. package/dist/source-metadata.d.ts +2 -0
  66. package/dist/source-metadata.js +2 -0
  67. package/dist/state-DSAHEsq6.d.ts +25 -0
  68. package/dist/sync-DO42ypji.js +269 -0
  69. package/dist/target-D4Bqb1eH.js +11 -0
  70. package/dist/test.d.ts +1 -1
  71. package/dist/test.js +1 -1
  72. package/dist/types-DHkae7Cb.d.ts +628 -0
  73. package/dist/use-D16tf8Ph.d.ts +86 -0
  74. package/dist/use-d_PlAdOu.js +353 -0
  75. package/dist/{utils-BtAm_K5P.js → utils-BPdaCyI6.js} +7 -3
  76. package/dist/vite-NWC9mFjI.js +1882 -0
  77. package/dist/vite.d.ts +33 -5
  78. package/dist/vite.js +2 -131
  79. package/dist/workspace-f2DBLmPZ.d.ts +6 -0
  80. package/dist/workspace-n4wBmdaM.js +1476 -0
  81. package/package.json +158 -62
  82. package/dist/asset-registry-CMuQbyvl.js +0 -14
  83. package/dist/cloudflare-env-DL94Uvpz.js +0 -12
  84. package/dist/config-CvS-7sre.js +0 -49
  85. package/dist/errors-BUL8SoFS.js +0 -21
  86. package/dist/lifecycle-uD82JeGh.js +0 -92
  87. package/dist/module-8LZUMEXC.js +0 -922
  88. package/dist/path-BVv9OXhg.js +0 -63
  89. package/dist/registry-Cnr0NoKv.js +0 -932
  90. package/dist/runtime/nitro-plugin.d.ts +0 -6
  91. package/dist/runtime/nitro-plugin.js +0 -14
  92. package/dist/sandbox-DtGXCWRq.js +0 -198
  93. package/dist/types-CwNcWTdt.d.ts +0 -378
  94. /package/dist/{chunk-DrSxFLj_.js → chunk-8H4AJuhK.js} +0 -0
@@ -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 };