@vercel/sandbox 0.0.6 → 0.0.7

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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @vercel/sandbox@0.0.6 build /home/runner/work/sandbox-sdk/sandbox-sdk/packages/sandbox
2
+ > @vercel/sandbox@0.0.7 build /home/runner/work/sandbox-sdk/sandbox-sdk/packages/sandbox
3
3
  > tsc
4
4
 
@@ -1,4 +1,4 @@
1
1
 
2
- > @vercel/sandbox@0.0.6 typecheck /home/runner/work/sandbox-sdk/sandbox-sdk/packages/sandbox
2
+ > @vercel/sandbox@0.0.7 typecheck /home/runner/work/sandbox-sdk/sandbox-sdk/packages/sandbox
3
3
  > tsc --noEmit
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @vercel/sandbox
2
2
 
3
+ ## 0.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Rename `cores` to `vcpus` ([#41](https://github.com/vercel/sandbox-sdk/pull/41))
8
+
3
9
  ## 0.0.6
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -49,7 +49,7 @@ All while streaming logs to your local terminal.
49
49
 
50
50
  - Sandbox only supports cloning public repositories at the moment.
51
51
  - `sudo` is not available. User code is executed as the `vercel-sandbox` user.
52
- - Max resources: 2 cores, 4096 MiB of memory.
52
+ - Max resources: 8 vCPUs. You will get 2048 MB of memory per vCPU.
53
53
  - All APIs of the SDK are subject to change. **We make no stability promises.**
54
54
 
55
55
  ## System
@@ -22,8 +22,7 @@ export declare class APIClient extends BaseClient {
22
22
  };
23
23
  timeout?: number;
24
24
  resources?: {
25
- cores: number;
26
- memory: number;
25
+ vcpus: number;
27
26
  };
28
27
  }): Promise<Parsed<{
29
28
  sandboxId: string;
package/dist/sandbox.d.ts CHANGED
@@ -27,11 +27,11 @@ export interface CreateSandboxParams {
27
27
  /**
28
28
  * Resources to allocate to the sandbox.
29
29
  *
30
- * Your sandbox will get the amount of cores you specify here. For memory,
31
- * you will get double the amount of cores.
30
+ * Your sandbox will get the amount of vCPUs you specify here and
31
+ * 2048 MB of memory per vCPU.
32
32
  */
33
33
  resources?: {
34
- cores: number;
34
+ vcpus: number;
35
35
  };
36
36
  }
37
37
  /** @inline */
package/dist/sandbox.js CHANGED
@@ -28,10 +28,7 @@ class Sandbox {
28
28
  projectId: credentials.projectId,
29
29
  ports: params?.ports ?? [],
30
30
  timeout: params?.timeout,
31
- ...(params?.resources && {
32
- cores: params.resources.cores,
33
- memory: 2048 * params.resources.cores,
34
- }),
31
+ resources: params?.resources,
35
32
  });
36
33
  return new Sandbox({
37
34
  client,
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.0.6";
1
+ export declare const VERSION = "0.0.7";
package/dist/version.js CHANGED
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // Autogenerated by inject-version.ts
5
- exports.VERSION = "0.0.6";
5
+ exports.VERSION = "0.0.7";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/sandbox",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -62,7 +62,7 @@ export class APIClient extends BaseClient {
62
62
  projectId: string;
63
63
  source?: { type: "git"; url: string } | { type: "tarball"; url: string };
64
64
  timeout?: number;
65
- resources?: { cores: number; memory: number };
65
+ resources?: { vcpus: number };
66
66
  }) {
67
67
  return parseOrThrow(
68
68
  CreatedSandbox,
package/src/sandbox.ts CHANGED
@@ -22,10 +22,10 @@ export interface CreateSandboxParams {
22
22
  /**
23
23
  * Resources to allocate to the sandbox.
24
24
  *
25
- * Your sandbox will get the amount of cores you specify here. For memory,
26
- * you will get double the amount of cores.
25
+ * Your sandbox will get the amount of vCPUs you specify here and
26
+ * 2048 MB of memory per vCPU.
27
27
  */
28
- resources?: { cores: number };
28
+ resources?: { vcpus: number };
29
29
  }
30
30
 
31
31
  /** @inline */
@@ -112,10 +112,7 @@ export class Sandbox {
112
112
  projectId: credentials.projectId,
113
113
  ports: params?.ports ?? [],
114
114
  timeout: params?.timeout,
115
- ...(params?.resources && {
116
- cores: params.resources.cores,
117
- memory: 2048 * params.resources.cores,
118
- }),
115
+ resources: params?.resources,
119
116
  });
120
117
 
121
118
  return new Sandbox({
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Autogenerated by inject-version.ts
2
- export const VERSION = "0.0.6";
2
+ export const VERSION = "0.0.7";