@zerodeploy/cli 0.1.8 → 0.1.9

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 (2) hide show
  1. package/dist/cli.js +26 -7
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -5816,7 +5816,7 @@ var deployCommand = new Command2("deploy").description("Deploy a site").argument
5816
5816
  spinner.fail("Pre-flight check failed");
5817
5817
  const body = await sitesRes.json();
5818
5818
  displayError(parseApiError(body));
5819
- return;
5819
+ process.exit(sitesRes.status >= 500 ? 5 : 3);
5820
5820
  }
5821
5821
  const { data: sites } = await sitesRes.json();
5822
5822
  const siteExists = sites.some((s) => s.slug === siteSlug);
@@ -5987,7 +5987,7 @@ Error: Build failed`);
5987
5987
  if (!promoteRes.ok) {
5988
5988
  const body = await promoteRes.json();
5989
5989
  displayError(parseApiError(body));
5990
- return;
5990
+ process.exit(promoteRes.status >= 500 ? 5 : 3);
5991
5991
  }
5992
5992
  const { data: promoteData } = await promoteRes.json();
5993
5993
  console.log("Deployment promoted!");
@@ -6024,7 +6024,7 @@ Error: Build failed`);
6024
6024
  if (!createRes.ok) {
6025
6025
  const body = await createRes.json();
6026
6026
  displayError(parseApiError(body));
6027
- return;
6027
+ process.exit(createRes.status >= 500 ? 5 : 3);
6028
6028
  }
6029
6029
  const { data: deployment } = await createRes.json();
6030
6030
  console.log(`Created deployment: ${deployment.id}`);
@@ -6061,8 +6061,27 @@ Error: Build failed`);
6061
6061
  }
6062
6062
  });
6063
6063
  if (!finalizeRes.ok) {
6064
- finalizeSpinner.stop("Error: Failed to finalize deployment");
6065
- return;
6064
+ finalizeSpinner.stop();
6065
+ const body = await finalizeRes.json().catch(() => ({}));
6066
+ displayError(parseApiError(body));
6067
+ process.exit(5);
6068
+ }
6069
+ const verifyRecordRes = await client.deployments[":id"].$get({
6070
+ param: { id: deployment.id }
6071
+ });
6072
+ if (!verifyRecordRes.ok) {
6073
+ finalizeSpinner.stop();
6074
+ console.log("");
6075
+ console.log("Error: Deployment finalized but record not found in database");
6076
+ console.log("This may be a temporary database issue. Please retry.");
6077
+ process.exit(5);
6078
+ }
6079
+ const { data: verifiedDeployment } = await verifyRecordRes.json();
6080
+ if (verifiedDeployment.status !== "ready") {
6081
+ finalizeSpinner.stop();
6082
+ console.log("");
6083
+ console.log(`Error: Deployment status is "${verifiedDeployment.status}", expected "ready"`);
6084
+ process.exit(5);
6066
6085
  }
6067
6086
  finalizeSpinner.stop();
6068
6087
  const verifyUrl = isPreview ? deployment.previewUrl : deployment.url;
@@ -6893,7 +6912,7 @@ var accountCommand = new Command2("account").description("Manage your ZeroDeploy
6893
6912
  }));
6894
6913
 
6895
6914
  // src/lib/version.ts
6896
- var VERSION = "0.1.8";
6915
+ var VERSION = "0.1.9";
6897
6916
 
6898
6917
  // src/commands/inspect.ts
6899
6918
  function getCommandByPath(rootCommand, path3) {
@@ -7022,7 +7041,7 @@ function createInspectCommand(rootProgram) {
7022
7041
  }
7023
7042
 
7024
7043
  // src/lib/version.ts
7025
- var VERSION2 = "0.1.8";
7044
+ var VERSION2 = "0.1.9";
7026
7045
 
7027
7046
  // src/lib/update-check.ts
7028
7047
  import { existsSync as existsSync3, mkdirSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerodeploy/cli",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "zerodeploy": "dist/cli.js"