@vite-hub/sandbox 0.1.0 → 0.3.1

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 (54) hide show
  1. package/README.md +118 -53
  2. package/dist/abortable-CR01hzfi.js +57 -0
  3. package/dist/cloudflare-Cog_r2Me.js +910 -0
  4. package/dist/cloudflare-env-lookup-DzI6Xv1Y.js +16 -0
  5. package/dist/cloudflare-failure-CFQhalfh.js +50 -0
  6. package/dist/container-CqfD8yuE.js +868 -0
  7. package/dist/{crabbox-BFCdf41h.js → crabbox-sbV3Zjuo.js} +10 -6
  8. package/dist/error-diagnostics-5QT_BjbQ.js +354 -0
  9. package/dist/error-diagnostics-BJtLRL9w.js +536 -0
  10. package/dist/{file-listing-DECFTdSl.js → file-listing-CHtRrfo1.js} +1 -1
  11. package/dist/{file-lock-CxyVl4Cv.js → file-lock-D0-XPogS.js} +3 -2
  12. package/dist/{index-CXej1Bt0.d.ts → index-DsoQAUb7.d.ts} +94 -19
  13. package/dist/index.d.ts +2 -2
  14. package/dist/index.js +15 -10
  15. package/dist/internal/cloudflare.d.ts +173 -1
  16. package/dist/internal/cloudflare.js +4 -12
  17. package/dist/internal/host-toolchain.d.ts +1 -1
  18. package/dist/internal/host-toolchain.js +6 -7
  19. package/dist/internal/vercel.d.ts +1 -1
  20. package/dist/internal/vercel.js +3 -11
  21. package/dist/invariant-DolT9EEx.js +22 -0
  22. package/dist/module-types-B0LQ5H2S.js +7 -0
  23. package/dist/module-types-DCeJbS9Z.d.ts +110 -0
  24. package/dist/process-sweep-CMaujWE5.js +33 -0
  25. package/dist/provider-resolution-C6AQzuFG.js +133 -0
  26. package/dist/{remote-1Jz2oUMK.js → remote-70ZVZZlq.js} +32 -14
  27. package/dist/runtime-type-Deo4qzxN.js +9 -0
  28. package/dist/{session-DD0S1PDC.js → session-e0lyzjJ3.js} +2 -1
  29. package/dist/size-7AkVwGZb.js +118 -0
  30. package/dist/ssh.d.ts +8 -0
  31. package/dist/ssh.js +107 -40
  32. package/dist/task/index.d.ts +19 -17
  33. package/dist/task/index.js +92 -201
  34. package/dist/task/runtime/provider-loader.d.ts +7 -9
  35. package/dist/task/runtime/provider-loader.js +2 -5
  36. package/dist/task/runtime/providers/cloudflare.d.ts +5 -19
  37. package/dist/task/runtime/providers/cloudflare.js +7 -6
  38. package/dist/task/runtime/providers/vercel.d.ts +3 -3
  39. package/dist/task/runtime/providers/vercel.js +35 -4
  40. package/dist/task/runtime/state.d.ts +4 -1
  41. package/dist/task/runtime/state.js +11 -2
  42. package/dist/task/vite.d.ts +143 -17
  43. package/dist/task/vite.js +723 -400
  44. package/dist/{toolchain-BUVXtQ2m.js → toolchain-BIVGMRty.js} +12 -11
  45. package/dist/{trusted-host-DNMJ-Oig.js → trusted-host-kxkpaQcs.js} +21 -179
  46. package/dist/{vercel-Jtxa9TJx.js → vercel-BGGrNpza.js} +107 -34
  47. package/package.json +15 -12
  48. package/dist/cloudflare-DO0h3Ncf.js +0 -281
  49. package/dist/cloudflare-env-BBJaBbuQ.js +0 -39
  50. package/dist/error-diagnostics-BSysPv-D.js +0 -166
  51. package/dist/error-diagnostics-dGQqfgLt.js +0 -99
  52. package/dist/module-types-BfyRBaiP.js +0 -7
  53. package/dist/module-types-Cis4hrF1.d.ts +0 -95
  54. package/dist/runtime-type-DrmrW5m5.js +0 -42
@@ -1,42 +0,0 @@
1
- //#region src/internal/abortable.ts
2
- /**
3
- * Wait for a promise until the caller's signal aborts.
4
- *
5
- * The underlying operation is intentionally not cancelled. This helper only
6
- * stops waiting for it and rejects with the signal reason.
7
- */
8
- function abortable(promise, signal) {
9
- if (!signal) return promise;
10
- signal.throwIfAborted();
11
- return new Promise((resolve, reject) => {
12
- const onAbort = () => {
13
- signal.removeEventListener("abort", onAbort);
14
- reject(signal.reason);
15
- };
16
- signal.addEventListener("abort", onAbort, { once: true });
17
- promise.then((value) => {
18
- signal.removeEventListener("abort", onAbort);
19
- resolve(value);
20
- }, (error) => {
21
- signal.removeEventListener("abort", onAbort);
22
- reject(error);
23
- });
24
- });
25
- }
26
- //#endregion
27
- //#region src/internal/runtime-type.ts
28
- /** Parses JavaScript runtime representations at Sandbox boundaries. */
29
- function isRuntimeString(value) {
30
- return Object(value) !== value && Object.prototype.toString.call(value) === "[object String]";
31
- }
32
- function isRuntimeNumber(value) {
33
- return Object(value) !== value && Object.prototype.toString.call(value) === "[object Number]";
34
- }
35
- /** Returns a plain JSON-style object, or undefined for primitives, arrays, and functions. */
36
- function runtimeRecord(value) {
37
- if (value === null || Object(value) !== value || Array.isArray(value)) return;
38
- if (Object.prototype.toString.call(value) !== "[object Object]") return;
39
- return value;
40
- }
41
- //#endregion
42
- export { abortable as i, isRuntimeString as n, runtimeRecord as r, isRuntimeNumber as t };