@vite-hub/sandbox 0.1.0 → 0.3.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 +118 -53
- package/dist/abortable-CR01hzfi.js +57 -0
- package/dist/cloudflare-Cog_r2Me.js +910 -0
- package/dist/cloudflare-env-lookup-DzI6Xv1Y.js +16 -0
- package/dist/cloudflare-failure-CFQhalfh.js +50 -0
- package/dist/container-CqfD8yuE.js +868 -0
- package/dist/{crabbox-BFCdf41h.js → crabbox-sbV3Zjuo.js} +10 -6
- package/dist/error-diagnostics-5QT_BjbQ.js +354 -0
- package/dist/error-diagnostics-BJtLRL9w.js +536 -0
- package/dist/{file-listing-DECFTdSl.js → file-listing-CHtRrfo1.js} +1 -1
- package/dist/{file-lock-CxyVl4Cv.js → file-lock-D0-XPogS.js} +3 -2
- package/dist/{index-CXej1Bt0.d.ts → index-DsoQAUb7.d.ts} +94 -19
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -10
- package/dist/internal/cloudflare.d.ts +173 -1
- package/dist/internal/cloudflare.js +4 -12
- package/dist/internal/host-toolchain.d.ts +1 -1
- package/dist/internal/host-toolchain.js +6 -7
- package/dist/internal/vercel.d.ts +1 -1
- package/dist/internal/vercel.js +3 -11
- package/dist/invariant-DolT9EEx.js +22 -0
- package/dist/module-types-B0LQ5H2S.js +7 -0
- package/dist/module-types-DCeJbS9Z.d.ts +110 -0
- package/dist/process-sweep-CMaujWE5.js +33 -0
- package/dist/provider-resolution-C6AQzuFG.js +133 -0
- package/dist/{remote-1Jz2oUMK.js → remote-70ZVZZlq.js} +32 -14
- package/dist/runtime-type-Deo4qzxN.js +9 -0
- package/dist/{session-DD0S1PDC.js → session-e0lyzjJ3.js} +2 -1
- package/dist/size-7AkVwGZb.js +118 -0
- package/dist/ssh.d.ts +8 -0
- package/dist/ssh.js +107 -40
- package/dist/task/index.d.ts +19 -17
- package/dist/task/index.js +92 -201
- package/dist/task/runtime/provider-loader.d.ts +7 -9
- package/dist/task/runtime/provider-loader.js +2 -5
- package/dist/task/runtime/providers/cloudflare.d.ts +5 -19
- package/dist/task/runtime/providers/cloudflare.js +7 -6
- package/dist/task/runtime/providers/vercel.d.ts +3 -3
- package/dist/task/runtime/providers/vercel.js +35 -4
- package/dist/task/runtime/state.d.ts +4 -1
- package/dist/task/runtime/state.js +11 -2
- package/dist/task/vite.d.ts +143 -17
- package/dist/task/vite.js +723 -400
- package/dist/{toolchain-BUVXtQ2m.js → toolchain-BIVGMRty.js} +12 -11
- package/dist/{trusted-host-DNMJ-Oig.js → trusted-host-kxkpaQcs.js} +21 -179
- package/dist/{vercel-Jtxa9TJx.js → vercel-BGGrNpza.js} +107 -34
- package/package.json +15 -12
- package/dist/cloudflare-DO0h3Ncf.js +0 -281
- package/dist/cloudflare-env-BBJaBbuQ.js +0 -39
- package/dist/error-diagnostics-BSysPv-D.js +0 -166
- package/dist/error-diagnostics-dGQqfgLt.js +0 -99
- package/dist/module-types-BfyRBaiP.js +0 -7
- package/dist/module-types-Cis4hrF1.d.ts +0 -95
- 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 };
|