@vercel/client 10.2.3-canary.2 → 10.2.3-canary.23

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.
@@ -51,6 +51,43 @@ async function* checkDeploymentStatus(deployment, clientOptions) {
51
51
  finishedEvents.add('ready');
52
52
  yield { type: 'ready', payload: deploymentUpdate };
53
53
  }
54
+ if (deploymentUpdate.checksState !== undefined) {
55
+ if (deploymentUpdate.checksState === 'completed' &&
56
+ !finishedEvents.has('checks-completed')) {
57
+ finishedEvents.add('checks-completed');
58
+ if (deploymentUpdate.checksConclusion === 'succeeded') {
59
+ yield {
60
+ type: 'checks-conclusion-succeeded',
61
+ payload: deploymentUpdate,
62
+ };
63
+ }
64
+ else if (deploymentUpdate.checksConclusion === 'failed') {
65
+ yield { type: 'checks-conclusion-failed', payload: deploymentUpdate };
66
+ }
67
+ else if (deploymentUpdate.checksConclusion === 'skipped') {
68
+ yield {
69
+ type: 'checks-conclusion-skipped',
70
+ payload: deploymentUpdate,
71
+ };
72
+ }
73
+ else if (deploymentUpdate.checksConclusion === 'canceled') {
74
+ yield {
75
+ type: 'checks-conclusion-canceled',
76
+ payload: deploymentUpdate,
77
+ };
78
+ }
79
+ }
80
+ if (deploymentUpdate.checksState === 'registered' &&
81
+ !finishedEvents.has('checks-registered')) {
82
+ finishedEvents.add('checks-registered');
83
+ yield { type: 'checks-registered', payload: deploymentUpdate };
84
+ }
85
+ if (deploymentUpdate.checksState === 'running' &&
86
+ !finishedEvents.has('checks-running')) {
87
+ finishedEvents.add('checks-running');
88
+ yield { type: 'checks-running', payload: deploymentUpdate };
89
+ }
90
+ }
54
91
  if (ready_state_1.isAliasAssigned(deploymentUpdate)) {
55
92
  debug('Deployment alias assigned');
56
93
  return yield { type: 'alias-assigned', payload: deploymentUpdate };
@@ -72,7 +72,7 @@ function buildCreateDeployment() {
72
72
  else {
73
73
  debug(`Provided 'path' is a single file`);
74
74
  }
75
- let { fileList } = await utils_1.buildFileTree(path, clientOptions.isDirectory, debug);
75
+ let { fileList } = await utils_1.buildFileTree(path, clientOptions.isDirectory, debug, clientOptions.prebuilt);
76
76
  let configPath;
77
77
  if (!nowConfig) {
78
78
  // If the user did not provide a config file, use the one in the root directory.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { getVercelIgnore, buildFileTree } from './utils/index';
2
2
  export declare const createDeployment: (clientOptions: import("./types").VercelClientOptions, deploymentOptions?: import("./types").DeploymentOptions, nowConfig?: import("./types").VercelConfig) => AsyncIterableIterator<{
3
- type: "warning" | "error" | "hashes-calculated" | "file-count" | "file-uploaded" | "all-files-uploaded" | "created" | "building" | "ready" | "alias-assigned" | "notice" | "tip" | "canceled";
3
+ type: "warning" | "error" | "hashes-calculated" | "file-count" | "file-uploaded" | "all-files-uploaded" | "created" | "building" | "ready" | "alias-assigned" | "notice" | "tip" | "canceled" | "checks-registered" | "checks-completed" | "checks-running" | "checks-conclusion-succeeded" | "checks-conclusion-failed" | "checks-conclusion-skipped" | "checks-conclusion-canceled";
4
4
  payload: any;
5
5
  }>;
6
6
  export * from './errors';
package/dist/types.d.ts CHANGED
@@ -11,6 +11,7 @@ export interface VercelClientOptions {
11
11
  teamId?: string;
12
12
  apiUrl?: string;
13
13
  force?: boolean;
14
+ prebuilt?: boolean;
14
15
  withCache?: boolean;
15
16
  userAgent?: string;
16
17
  defaultName?: string;
@@ -4,16 +4,16 @@ import ignore from 'ignore';
4
4
  declare type Ignore = ReturnType<typeof ignore>;
5
5
  import { VercelClientOptions, DeploymentOptions, NowConfig } from '../types';
6
6
  export declare const API_FILES = "/v2/now/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"];
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"];
8
8
  export declare type DeploymentEventType = typeof EVENTS_ARRAY[number];
9
- export declare const EVENTS: Set<"warning" | "error" | "hashes-calculated" | "file-count" | "file-uploaded" | "all-files-uploaded" | "created" | "building" | "ready" | "alias-assigned" | "notice" | "tip" | "canceled">;
9
+ export declare const EVENTS: Set<"warning" | "error" | "hashes-calculated" | "file-count" | "file-uploaded" | "all-files-uploaded" | "created" | "building" | "ready" | "alias-assigned" | "notice" | "tip" | "canceled" | "checks-registered" | "checks-completed" | "checks-running" | "checks-conclusion-succeeded" | "checks-conclusion-failed" | "checks-conclusion-skipped" | "checks-conclusion-canceled">;
10
10
  export declare function getApiDeploymentsUrl(metadata?: Pick<DeploymentOptions, 'builds' | 'functions'>): "/v10/now/deployments" | "/v13/now/deployments";
11
11
  export declare function parseVercelConfig(filePath?: string): Promise<NowConfig>;
12
- export declare function buildFileTree(path: string | string[], isDirectory: boolean, debug: Debug): Promise<{
12
+ export declare function buildFileTree(path: string | string[], isDirectory: boolean, debug: Debug, prebuilt?: boolean): Promise<{
13
13
  fileList: string[];
14
14
  ignoreList: string[];
15
15
  }>;
16
- export declare function getVercelIgnore(cwd: string | string[]): Promise<{
16
+ export declare function getVercelIgnore(cwd: string | string[], prebuilt?: boolean): Promise<{
17
17
  ig: Ignore;
18
18
  ignores: string[];
19
19
  }>;
@@ -31,6 +31,14 @@ const EVENTS_ARRAY = [
31
31
  'notice',
32
32
  'tip',
33
33
  'canceled',
34
+ // Checks events
35
+ 'checks-registered',
36
+ 'checks-completed',
37
+ 'checks-running',
38
+ 'checks-conclusion-succeeded',
39
+ 'checks-conclusion-failed',
40
+ 'checks-conclusion-skipped',
41
+ 'checks-conclusion-canceled',
34
42
  ];
35
43
  exports.EVENTS = new Set(EVENTS_ARRAY);
36
44
  function getApiDeploymentsUrl(metadata) {
@@ -63,10 +71,10 @@ const maybeRead = async function (path, default_) {
63
71
  return default_;
64
72
  }
65
73
  };
66
- async function buildFileTree(path, isDirectory, debug) {
74
+ async function buildFileTree(path, isDirectory, debug, prebuilt) {
67
75
  const ignoreList = [];
68
76
  let fileList;
69
- let { ig, ignores } = await getVercelIgnore(path);
77
+ let { ig, ignores } = await getVercelIgnore(path, prebuilt);
70
78
  debug(`Found ${ignores.length} rules in .vercelignore`);
71
79
  debug('Building file tree...');
72
80
  if (isDirectory && !Array.isArray(path)) {
@@ -95,34 +103,36 @@ async function buildFileTree(path, isDirectory, debug) {
95
103
  return { fileList, ignoreList };
96
104
  }
97
105
  exports.buildFileTree = buildFileTree;
98
- async function getVercelIgnore(cwd) {
99
- const ignores = [
100
- '.hg',
101
- '.git',
102
- '.gitmodules',
103
- '.svn',
104
- '.cache',
105
- '.next',
106
- '.now',
107
- '.vercel',
108
- '.npmignore',
109
- '.dockerignore',
110
- '.gitignore',
111
- '.*.swp',
112
- '.DS_Store',
113
- '.wafpicke-*',
114
- '.lock-wscript',
115
- '.env.local',
116
- '.env.*.local',
117
- '.venv',
118
- 'npm-debug.log',
119
- 'config.gypi',
120
- 'node_modules',
121
- '__pycache__',
122
- 'venv',
123
- 'CVS',
124
- '.vercel_build_output',
125
- ];
106
+ async function getVercelIgnore(cwd, prebuilt) {
107
+ const ignores = prebuilt
108
+ ? ['*', '!.output', '!.output/**']
109
+ : [
110
+ '.hg',
111
+ '.git',
112
+ '.gitmodules',
113
+ '.svn',
114
+ '.cache',
115
+ '.next',
116
+ '.now',
117
+ '.vercel',
118
+ '.npmignore',
119
+ '.dockerignore',
120
+ '.gitignore',
121
+ '.*.swp',
122
+ '.DS_Store',
123
+ '.wafpicke-*',
124
+ '.lock-wscript',
125
+ '.env.local',
126
+ '.env.*.local',
127
+ '.venv',
128
+ 'npm-debug.log',
129
+ 'config.gypi',
130
+ 'node_modules',
131
+ '__pycache__',
132
+ 'venv',
133
+ 'CVS',
134
+ '.output',
135
+ ];
126
136
  const cwds = Array.isArray(cwd) ? cwd : [cwd];
127
137
  const files = await Promise.all(cwds.map(async (cwd) => {
128
138
  const [vercelignore, nowignore] = await Promise.all([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/client",
3
- "version": "10.2.3-canary.2",
3
+ "version": "10.2.3-canary.23",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "homepage": "https://vercel.com",
@@ -40,7 +40,7 @@
40
40
  ]
41
41
  },
42
42
  "dependencies": {
43
- "@vercel/build-utils": "2.12.3-canary.2",
43
+ "@vercel/build-utils": "2.12.3-canary.22",
44
44
  "@zeit/fetch": "5.2.0",
45
45
  "async-retry": "1.2.3",
46
46
  "async-sema": "3.0.0",
@@ -52,5 +52,5 @@
52
52
  "recursive-readdir": "2.2.2",
53
53
  "sleep-promise": "8.0.1"
54
54
  },
55
- "gitHead": "2644e3127b9ea65ec50b89dc774d243f4c2c3941"
55
+ "gitHead": "0cacb1bdace342133fad4bd7a98354e5b2948df0"
56
56
  }