@vite-hub/sandbox 0.0.2 → 0.0.4
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 +97 -24
- package/dist/{cloudflare-env-2NctU8i7.js → cloudflare-env-QQV4uzCT.js} +4 -2
- package/dist/index.d.ts +8 -4
- package/dist/index.js +34 -23
- package/dist/{module-types-Cjqo67ay.d.ts → module-types-DKYItiOu.d.ts} +3 -1
- package/dist/{provider-loader-3ml65ZFy.d.ts → provider-loader-D0UihePq.d.ts} +1 -1
- package/dist/runtime/provider-loader.d.ts +1 -1
- package/dist/runtime/provider-loader.js +4 -4
- package/dist/runtime/providers/cloudflare.d.ts +4 -5
- package/dist/runtime/providers/cloudflare.js +4 -4
- package/dist/runtime/providers/vercel.d.ts +111 -4
- package/dist/runtime/providers/vercel.js +3 -3
- package/dist/runtime/state.d.ts +11 -2
- package/dist/runtime/state.js +52 -1
- package/dist/vite.d.ts +26 -2
- package/dist/vite.js +1097 -136
- package/package.json +17 -12
- package/dist/index-DiH4OGAU.d.ts +0 -101
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vite-hub/sandbox",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Sandbox execution primitives and Vite integration for ViteHub.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -48,14 +48,6 @@
|
|
|
48
48
|
"types": "./dist/runtime/provider-loader.d.ts",
|
|
49
49
|
"import": "./dist/runtime/provider-loader.js"
|
|
50
50
|
},
|
|
51
|
-
"./runtime/providers/cloudflare": {
|
|
52
|
-
"types": "./dist/runtime/providers/cloudflare.d.ts",
|
|
53
|
-
"import": "./dist/runtime/providers/cloudflare.js"
|
|
54
|
-
},
|
|
55
|
-
"./runtime/providers/vercel": {
|
|
56
|
-
"types": "./dist/runtime/providers/vercel.d.ts",
|
|
57
|
-
"import": "./dist/runtime/providers/vercel.js"
|
|
58
|
-
},
|
|
59
51
|
"./runtime/state": {
|
|
60
52
|
"types": "./dist/runtime/state.d.ts",
|
|
61
53
|
"import": "./dist/runtime/state.js"
|
|
@@ -64,9 +56,23 @@
|
|
|
64
56
|
"types": "./dist/vite.d.ts",
|
|
65
57
|
"import": "./dist/vite.js"
|
|
66
58
|
},
|
|
67
|
-
"./package.json": "./package.json"
|
|
59
|
+
"./package.json": "./package.json",
|
|
60
|
+
"./_internal/runtime": {
|
|
61
|
+
"types": "./dist/index.d.ts",
|
|
62
|
+
"import": "./dist/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./_internal/runtime/providers/cloudflare": {
|
|
65
|
+
"types": "./dist/runtime/providers/cloudflare.d.ts",
|
|
66
|
+
"import": "./dist/runtime/providers/cloudflare.js"
|
|
67
|
+
},
|
|
68
|
+
"./_internal/runtime/providers/vercel": {
|
|
69
|
+
"types": "./dist/runtime/providers/vercel.d.ts",
|
|
70
|
+
"import": "./dist/runtime/providers/vercel.js"
|
|
71
|
+
}
|
|
68
72
|
},
|
|
69
73
|
"dependencies": {
|
|
74
|
+
"@vite-hub/box": "0.0.4",
|
|
75
|
+
"@vite-hub/runtime": "0.0.4",
|
|
70
76
|
"esbuild": "^0.28.1",
|
|
71
77
|
"h3": "2.0.1-rc.25",
|
|
72
78
|
"local-pkg": "^1.2.1",
|
|
@@ -77,8 +83,7 @@
|
|
|
77
83
|
"typescript": "^6.0.3",
|
|
78
84
|
"ufo": "^1.6.4",
|
|
79
85
|
"unimport": "^6.3.0",
|
|
80
|
-
"
|
|
81
|
-
"@vite-hub/box": "0.0.2"
|
|
86
|
+
"yaml": "^2.9.0"
|
|
82
87
|
},
|
|
83
88
|
"devDependencies": {
|
|
84
89
|
"ofetch": "^1.5.1",
|
package/dist/index-DiH4OGAU.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { ExecutionAuthority } from "@vite-hub/runtime";
|
|
2
|
-
|
|
3
|
-
//#region ../box/dist/index-Vc0GwE3_.d.ts
|
|
4
|
-
interface BoxOpenOptions {
|
|
5
|
-
id?: string;
|
|
6
|
-
initialize?: (session: BoxSession, context: {
|
|
7
|
-
signal?: AbortSignal;
|
|
8
|
-
}) => Promise<void>;
|
|
9
|
-
signal?: AbortSignal;
|
|
10
|
-
}
|
|
11
|
-
interface BoxExecOptions {
|
|
12
|
-
cwd?: string;
|
|
13
|
-
env?: Readonly<Record<string, string>>;
|
|
14
|
-
signal?: AbortSignal;
|
|
15
|
-
timeout?: number;
|
|
16
|
-
}
|
|
17
|
-
interface BoxExecResult {
|
|
18
|
-
readonly code: number;
|
|
19
|
-
readonly ok: boolean;
|
|
20
|
-
readonly stderr: string;
|
|
21
|
-
readonly stdout: string;
|
|
22
|
-
}
|
|
23
|
-
interface BoxProcessExit {
|
|
24
|
-
readonly code: number;
|
|
25
|
-
}
|
|
26
|
-
interface BoxProcess {
|
|
27
|
-
readonly pid?: number;
|
|
28
|
-
readonly stderr: ReadableStream<Uint8Array>;
|
|
29
|
-
readonly stdout: ReadableStream<Uint8Array>;
|
|
30
|
-
kill(signal?: string): Promise<void>;
|
|
31
|
-
wait(): Promise<BoxProcessExit>;
|
|
32
|
-
}
|
|
33
|
-
interface BoxFileEntry {
|
|
34
|
-
readonly path: string;
|
|
35
|
-
readonly size?: number;
|
|
36
|
-
readonly type: "directory" | "file" | "symlink";
|
|
37
|
-
}
|
|
38
|
-
interface BoxFileOptions {
|
|
39
|
-
signal?: AbortSignal;
|
|
40
|
-
}
|
|
41
|
-
interface BoxListFilesOptions extends BoxFileOptions {
|
|
42
|
-
recursive?: boolean;
|
|
43
|
-
}
|
|
44
|
-
interface BoxRemoveFileOptions extends BoxFileOptions {
|
|
45
|
-
recursive?: boolean;
|
|
46
|
-
}
|
|
47
|
-
interface BoxFiles {
|
|
48
|
-
exists(path: string, options?: BoxFileOptions): Promise<boolean>;
|
|
49
|
-
list(path: string, options?: BoxListFilesOptions): Promise<readonly BoxFileEntry[]>;
|
|
50
|
-
mkdir(path: string, options?: BoxFileOptions & {
|
|
51
|
-
recursive?: boolean;
|
|
52
|
-
}): Promise<void>;
|
|
53
|
-
move?(source: string, destination: string, options?: BoxFileOptions): Promise<void>;
|
|
54
|
-
read(path: string, options?: BoxFileOptions): Promise<Uint8Array | null>;
|
|
55
|
-
remove(path: string, options?: BoxRemoveFileOptions): Promise<void>;
|
|
56
|
-
write(path: string, contents: Uint8Array, options?: BoxFileOptions): Promise<void>;
|
|
57
|
-
}
|
|
58
|
-
interface BoxPorts {
|
|
59
|
-
readonly values: readonly number[];
|
|
60
|
-
expose(port: number, options?: {
|
|
61
|
-
protocol?: "http" | "https" | "ws";
|
|
62
|
-
}): Promise<URL>;
|
|
63
|
-
}
|
|
64
|
-
interface BoxSession {
|
|
65
|
-
readonly cwd: string;
|
|
66
|
-
readonly executionAuthority: ExecutionAuthority;
|
|
67
|
-
readonly files: BoxFiles;
|
|
68
|
-
readonly id: string;
|
|
69
|
-
readonly ports?: BoxPorts;
|
|
70
|
-
readonly spawn?: (command: string, args?: readonly string[], options?: BoxExecOptions) => Promise<BoxProcess>;
|
|
71
|
-
close(): Promise<void>;
|
|
72
|
-
exec(command: string, args?: readonly string[], options?: BoxExecOptions): Promise<BoxExecResult>;
|
|
73
|
-
}
|
|
74
|
-
interface BoxEnvironment {
|
|
75
|
-
readonly env: Readonly<Record<string, string | undefined>>;
|
|
76
|
-
}
|
|
77
|
-
interface BoxResolvedRequirement {
|
|
78
|
-
readonly command: string;
|
|
79
|
-
readonly name: string;
|
|
80
|
-
}
|
|
81
|
-
interface BoxPlan {
|
|
82
|
-
readonly cache: {
|
|
83
|
-
readonly state: "disposable";
|
|
84
|
-
};
|
|
85
|
-
readonly environment: BoxEnvironment;
|
|
86
|
-
readonly executionAuthority: ExecutionAuthority;
|
|
87
|
-
readonly identity: string;
|
|
88
|
-
readonly requirements: readonly BoxResolvedRequirement[];
|
|
89
|
-
readonly runtime: string;
|
|
90
|
-
readonly workspace: {
|
|
91
|
-
readonly path?: string;
|
|
92
|
-
readonly state: "authoritative" | "disposable";
|
|
93
|
-
readonly workDir?: "." | "workspace";
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
interface Box {
|
|
97
|
-
readonly plan: BoxPlan;
|
|
98
|
-
open(options?: BoxOpenOptions): Promise<BoxSession>;
|
|
99
|
-
}
|
|
100
|
-
//#endregion
|
|
101
|
-
export { Box as t };
|