Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"common-corners-leave",
"cyan-bats-clap",
"dirty-cows-talk",
"easy-geckos-grab",
"fair-pears-dream",
"fresh-rings-rescue",
"legal-rings-work",
Expand Down
7 changes: 7 additions & 0 deletions packages/sandbox/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# sandbox

## 3.0.0-beta.8

### Patch Changes

- Updated dependencies []:
- @vercel/sandbox@2.0.0-beta.8

## 3.0.0-beta.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/sandbox/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## `sandbox --help`

```
sandbox 3.0.0-beta.7
sandbox 3.0.0-beta.8

▲ sandbox [options] <command>

Expand Down
2 changes: 1 addition & 1 deletion packages/sandbox/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sandbox",
"description": "Command line interface for Vercel Sandbox",
"version": "3.0.0-beta.7",
"version": "3.0.0-beta.8",
"scripts": {
"clean": "rm -rf node_modules dist",
"sandbox": "ts-node ./src/sandbox.ts",
Expand Down
6 changes: 6 additions & 0 deletions packages/vercel-sandbox/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @vercel/sandbox

## 2.0.0-beta.8

### Patch Changes

- Fix an error with resuming while reading a file

## 2.0.0-beta.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/vercel-sandbox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vercel/sandbox",
"version": "2.0.0-beta.7",
"version": "2.0.0-beta.8",
"description": "Software Development Kit for Vercel Sandbox",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions packages/vercel-sandbox/src/api-client/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,10 @@ export class APIClient extends BaseClient {
return null;
}

if (!response.ok) {
await parseOrThrow(z.any(), response);
}

if (response.body === null) {
return null;
}
Expand Down
10 changes: 10 additions & 0 deletions packages/vercel-sandbox/src/sandbox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,16 @@ for (const port of ports) {
expect(await result.stdout()).toContain("resumed!");
});

it("auto-resumes a stopped session when reading a file", async () => {
await sandbox.writeFiles([
{ path: "persist.txt", content: Buffer.from("persisted content") },
]);
await sandbox.stop({ blocking: true });

const content = await sandbox.readFileToBuffer({ path: "persist.txt" });
expect(content?.toString()).toBe("persisted content");
});

it("raises an error when the timeout cannot be updated", async () => {
try {
await sandbox.extendTimeout(ms("5d"));
Expand Down
2 changes: 1 addition & 1 deletion packages/vercel-sandbox/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Autogenerated by inject-version.ts
export const VERSION = "2.0.0-beta.7";
export const VERSION = "2.0.0-beta.8";
Loading