@vercel/client 17.2.69 → 17.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.
@@ -156,6 +156,14 @@ async function* checkDeploymentStatus(deployment, clientOptions) {
156
156
  yield { type: "checks-running", payload: deploymentUpdate };
157
157
  }
158
158
  }
159
+ if (deploymentUpdate.checks?.["deployment-alias"]?.state === "failed" && !finishedEvents.has("checks-v2-failed")) {
160
+ debug("v2 deployment-alias check failed");
161
+ finishedEvents.add("checks-v2-failed");
162
+ return yield {
163
+ type: "checks-v2-failed",
164
+ payload: deploymentUpdate
165
+ };
166
+ }
159
167
  if ((0, import_ready_state.isAliasAssigned)(deploymentUpdate)) {
160
168
  debug("Deployment alias assigned");
161
169
  return yield { type: "alias-assigned", payload: deploymentUpdate };
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export { continueDeployment } from './continue';
2
2
  export { checkDeploymentStatus } from './check-deployment-status';
3
3
  export { getVercelIgnore, buildFileTree } from './utils/index';
4
4
  export declare const createDeployment: (clientOptions: import("./types").VercelClientOptions, deploymentOptions?: import("./types").DeploymentOptions) => AsyncIterableIterator<{
5
- type: "hashes-calculated" | "file-count" | "file-uploaded" | "all-files-uploaded" | "created" | "building" | "ready" | "alias-assigned" | "warning" | "error" | "notice" | "tip" | "canceled" | "checks-registered" | "checks-completed" | "checks-running" | "checks-conclusion-succeeded" | "checks-conclusion-failed" | "checks-conclusion-skipped" | "checks-conclusion-canceled";
5
+ type: "hashes-calculated" | "file-count" | "file-uploaded" | "all-files-uploaded" | "created" | "building" | "ready" | "alias-assigned" | "warning" | "error" | "notice" | "tip" | "canceled" | "checks-registered" | "checks-completed" | "checks-running" | "checks-conclusion-succeeded" | "checks-conclusion-failed" | "checks-conclusion-skipped" | "checks-conclusion-canceled" | "checks-v2-failed";
6
6
  payload: any;
7
7
  }>;
8
8
  export * from './errors';
package/dist/types.d.ts CHANGED
@@ -76,6 +76,11 @@ export interface Deployment {
76
76
  alias: string[];
77
77
  aliasAssigned: boolean;
78
78
  aliasError: string | null;
79
+ checks?: Record<string, {
80
+ state: 'pending' | 'succeeded' | 'failed';
81
+ startedAt?: string;
82
+ completedAt?: string;
83
+ }>;
79
84
  expiration?: number;
80
85
  proposedExpiration?: number;
81
86
  undeletedAt?: number;
package/dist/upload.js CHANGED
@@ -65,8 +65,10 @@ async function* upload(files, clientOptions, deploymentOptions) {
65
65
  return yield event;
66
66
  }
67
67
  } else {
68
- if (event.type === "alias-assigned") {
69
- debug("Deployment succeeded on file check");
68
+ if (event.type === "alias-assigned" || event.type === "checks-v2-failed") {
69
+ debug(
70
+ event.type === "alias-assigned" ? "Deployment succeeded on file check" : "v2 deployment-alias check failed on file check"
71
+ );
70
72
  return yield event;
71
73
  }
72
74
  yield event;
@@ -102,7 +104,7 @@ async function* upload(files, clientOptions, deploymentOptions) {
102
104
  try {
103
105
  debug("Starting deployment creation");
104
106
  for await (const event of (0, import_deploy.deploy)(files, clientOptions, deploymentOptions)) {
105
- if (event.type === "alias-assigned") {
107
+ if (event.type === "alias-assigned" || event.type === "checks-v2-failed") {
106
108
  debug("Deployment is ready");
107
109
  return yield event;
108
110
  }
@@ -4,9 +4,9 @@ import ignore from 'ignore';
4
4
  import { VercelClientOptions, VercelConfig } from '../types';
5
5
  type Ignore = ReturnType<typeof ignore>;
6
6
  export declare const API_FILES = "/v2/files";
7
- declare const EVENTS_ARRAY: readonly ["hashes-calculated", "file-count", "file-uploaded", "all-files-uploaded", "created", "building", "ready", "alias-assigned", "warning", "error", "notice", "tip", "canceled", "checks-registered", "checks-completed", "checks-running", "checks-conclusion-succeeded", "checks-conclusion-failed", "checks-conclusion-skipped", "checks-conclusion-canceled"];
7
+ declare const EVENTS_ARRAY: readonly ["hashes-calculated", "file-count", "file-uploaded", "all-files-uploaded", "created", "building", "ready", "alias-assigned", "warning", "error", "notice", "tip", "canceled", "checks-registered", "checks-completed", "checks-running", "checks-conclusion-succeeded", "checks-conclusion-failed", "checks-conclusion-skipped", "checks-conclusion-canceled", "checks-v2-failed"];
8
8
  export type DeploymentEventType = (typeof EVENTS_ARRAY)[number];
9
- export declare const EVENTS: Set<"hashes-calculated" | "file-count" | "file-uploaded" | "all-files-uploaded" | "created" | "building" | "ready" | "alias-assigned" | "warning" | "error" | "notice" | "tip" | "canceled" | "checks-registered" | "checks-completed" | "checks-running" | "checks-conclusion-succeeded" | "checks-conclusion-failed" | "checks-conclusion-skipped" | "checks-conclusion-canceled">;
9
+ export declare const EVENTS: Set<"hashes-calculated" | "file-count" | "file-uploaded" | "all-files-uploaded" | "created" | "building" | "ready" | "alias-assigned" | "warning" | "error" | "notice" | "tip" | "canceled" | "checks-registered" | "checks-completed" | "checks-running" | "checks-conclusion-succeeded" | "checks-conclusion-failed" | "checks-conclusion-skipped" | "checks-conclusion-canceled" | "checks-v2-failed">;
10
10
  export declare function getApiDeploymentsUrl(): string;
11
11
  export declare function parseVercelConfig(filePath?: string): Promise<VercelConfig>;
12
12
  export declare function buildFileTree(path: string | string[], { isDirectory, prebuilt, vercelOutputDir, rootDirectory, projectName, bulkRedirectsPath, }: Pick<VercelClientOptions, 'isDirectory' | 'prebuilt' | 'vercelOutputDir' | 'rootDirectory' | 'projectName' | 'bulkRedirectsPath'>, debug: Debug): Promise<{
@@ -67,14 +67,16 @@ const EVENTS_ARRAY = [
67
67
  "notice",
68
68
  "tip",
69
69
  "canceled",
70
- // Checks events
70
+ // v1 Checks events
71
71
  "checks-registered",
72
72
  "checks-completed",
73
73
  "checks-running",
74
74
  "checks-conclusion-succeeded",
75
75
  "checks-conclusion-failed",
76
76
  "checks-conclusion-skipped",
77
- "checks-conclusion-canceled"
77
+ "checks-conclusion-canceled",
78
+ // v2 Checks events
79
+ "checks-v2-failed"
78
80
  ];
79
81
  const EVENTS = new Set(EVENTS_ARRAY);
80
82
  function getApiDeploymentsUrl() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/client",
3
- "version": "17.2.69",
3
+ "version": "17.3.0",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "homepage": "https://vercel.com",
@@ -42,7 +42,7 @@
42
42
  "querystring": "^0.2.0",
43
43
  "sleep-promise": "8.0.1",
44
44
  "tar-fs": "1.16.3",
45
- "@vercel/build-utils": "13.14.0",
45
+ "@vercel/build-utils": "13.14.1",
46
46
  "@vercel/error-utils": "2.0.3",
47
47
  "@vercel/routing-utils": "6.1.1"
48
48
  },