@vercel/client 13.0.1 → 13.0.3

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,21 +1,44 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateQueryString = void 0;
4
- const url_1 = require("url");
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var query_string_exports = {};
20
+ __export(query_string_exports, {
21
+ generateQueryString: () => generateQueryString
22
+ });
23
+ module.exports = __toCommonJS(query_string_exports);
24
+ var import_url = require("url");
5
25
  function generateQueryString(clientOptions) {
6
- const options = new url_1.URLSearchParams();
7
- if (clientOptions.teamId) {
8
- options.set('teamId', clientOptions.teamId);
9
- }
10
- if (clientOptions.force) {
11
- options.set('forceNew', '1');
12
- }
13
- if (clientOptions.withCache) {
14
- options.set('withCache', '1');
15
- }
16
- if (clientOptions.skipAutoDetectionConfirmation) {
17
- options.set('skipAutoDetectionConfirmation', '1');
18
- }
19
- return Array.from(options.entries()).length ? `?${options.toString()}` : '';
26
+ const options = new import_url.URLSearchParams();
27
+ if (clientOptions.teamId) {
28
+ options.set("teamId", clientOptions.teamId);
29
+ }
30
+ if (clientOptions.force) {
31
+ options.set("forceNew", "1");
32
+ }
33
+ if (clientOptions.withCache) {
34
+ options.set("withCache", "1");
35
+ }
36
+ if (clientOptions.skipAutoDetectionConfirmation) {
37
+ options.set("skipAutoDetectionConfirmation", "1");
38
+ }
39
+ return Array.from(options.entries()).length ? `?${options.toString()}` : "";
20
40
  }
21
- exports.generateQueryString = generateQueryString;
41
+ // Annotate the CommonJS export names for ESM import in node:
42
+ 0 && (module.exports = {
43
+ generateQueryString
44
+ });
@@ -1,104 +1,98 @@
1
1
  "use strict";
2
- /*
3
- The MIT License (MIT)
4
-
5
- Copyright (c) 2014 Jamison Dance
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining a copy
8
- of this software and associated documentation files (the "Software"), to deal
9
- in the Software without restriction, including without limitation the rights
10
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- copies of the Software, and to permit persons to whom the Software is
12
- furnished to do so, subject to the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be included in
15
- all copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
- THE SOFTWARE.
24
- */
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
27
11
  };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- /*
30
- based on https://github.com/jergason/recursive-readdir
31
- primary changes:
32
- - use `lstat` instead of `stat` so that symlinks are not followed
33
- */
34
- const fs_1 = __importDefault(require("fs"));
35
- const path_1 = __importDefault(require("path"));
36
- const minimatch_1 = __importDefault(require("minimatch"));
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var readdir_recursive_exports = {};
30
+ __export(readdir_recursive_exports, {
31
+ default: () => readdir
32
+ });
33
+ module.exports = __toCommonJS(readdir_recursive_exports);
34
+ var import_fs = __toESM(require("fs"));
35
+ var import_path = __toESM(require("path"));
36
+ var import_minimatch = __toESM(require("minimatch"));
37
37
  function patternMatcher(pattern) {
38
- return function (path, stats) {
39
- const minimatcher = new minimatch_1.default.Minimatch(pattern, { matchBase: true });
40
- return (!minimatcher.negate || stats.isFile()) && minimatcher.match(path);
41
- };
38
+ return function(path, stats) {
39
+ const minimatcher = new import_minimatch.default.Minimatch(pattern, { matchBase: true });
40
+ return (!minimatcher.negate || stats.isFile()) && minimatcher.match(path);
41
+ };
42
42
  }
43
43
  function toMatcherFunction(ignoreEntry) {
44
- if (typeof ignoreEntry === 'function') {
45
- return ignoreEntry;
46
- }
47
- else {
48
- return patternMatcher(ignoreEntry);
49
- }
44
+ if (typeof ignoreEntry === "function") {
45
+ return ignoreEntry;
46
+ } else {
47
+ return patternMatcher(ignoreEntry);
48
+ }
50
49
  }
51
50
  function readdir(path, ignores) {
52
- ignores = ignores.map(toMatcherFunction);
53
- let list = [];
54
- return new Promise(function (resolve, reject) {
55
- fs_1.default.readdir(path, function (err, files) {
56
- if (err) {
57
- return reject(err);
58
- }
59
- let pending = files.length;
51
+ ignores = ignores.map(toMatcherFunction);
52
+ let list = [];
53
+ return new Promise(function(resolve, reject) {
54
+ import_fs.default.readdir(path, function(err, files) {
55
+ if (err) {
56
+ return reject(err);
57
+ }
58
+ let pending = files.length;
59
+ if (!pending) {
60
+ return resolve(list);
61
+ }
62
+ files.forEach(function(file) {
63
+ const filePath = import_path.default.join(path, file);
64
+ import_fs.default.lstat(filePath, function(_err, stats) {
65
+ if (_err) {
66
+ return reject(_err);
67
+ }
68
+ const matches = ignores.some((matcher) => matcher(filePath, stats));
69
+ if (matches) {
70
+ pending -= 1;
60
71
  if (!pending) {
72
+ return resolve(list);
73
+ }
74
+ return null;
75
+ }
76
+ if (stats.isDirectory()) {
77
+ readdir(filePath, ignores).then(function(res) {
78
+ if (res.length === 0) {
79
+ list.push(filePath);
80
+ }
81
+ list = list.concat(res);
82
+ pending -= 1;
83
+ if (!pending) {
61
84
  return resolve(list);
85
+ }
86
+ }).catch(reject);
87
+ } else {
88
+ list.push(filePath);
89
+ pending -= 1;
90
+ if (!pending) {
91
+ return resolve(list);
62
92
  }
63
- files.forEach(function (file) {
64
- const filePath = path_1.default.join(path, file);
65
- fs_1.default.lstat(filePath, function (_err, stats) {
66
- if (_err) {
67
- return reject(_err);
68
- }
69
- const matches = ignores.some(matcher => matcher(filePath, stats));
70
- if (matches) {
71
- pending -= 1;
72
- if (!pending) {
73
- return resolve(list);
74
- }
75
- return null;
76
- }
77
- if (stats.isDirectory()) {
78
- readdir(filePath, ignores)
79
- .then(function (res) {
80
- if (res.length === 0) {
81
- // Empty directories get returned
82
- list.push(filePath);
83
- }
84
- list = list.concat(res);
85
- pending -= 1;
86
- if (!pending) {
87
- return resolve(list);
88
- }
89
- })
90
- .catch(reject);
91
- }
92
- else {
93
- list.push(filePath);
94
- pending -= 1;
95
- if (!pending) {
96
- return resolve(list);
97
- }
98
- }
99
- });
100
- });
93
+ }
101
94
  });
95
+ });
102
96
  });
97
+ });
103
98
  }
104
- exports.default = readdir;
@@ -1,22 +1,54 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isAliasError = exports.isAliasAssigned = exports.isDone = exports.isFailed = exports.isReady = void 0;
4
- const isReady = ({ readyState, state, }) => readyState === 'READY' || state === 'READY';
5
- exports.isReady = isReady;
6
- const isFailed = ({ readyState, state, }) => {
7
- if (readyState) {
8
- return readyState.endsWith('_ERROR') || readyState === 'ERROR';
9
- }
10
- if (!state) {
11
- return false;
12
- }
13
- // TS is convinced `state` is `never`, but it's definitely a `string | undefined` entering this function
14
- return state.endsWith('_ERROR') || state === 'ERROR';
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
15
9
  };
16
- exports.isFailed = isFailed;
17
- const isDone = (buildOrDeployment) => (0, exports.isReady)(buildOrDeployment) || (0, exports.isFailed)(buildOrDeployment);
18
- exports.isDone = isDone;
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var ready_state_exports = {};
20
+ __export(ready_state_exports, {
21
+ isAliasAssigned: () => isAliasAssigned,
22
+ isAliasError: () => isAliasError,
23
+ isDone: () => isDone,
24
+ isFailed: () => isFailed,
25
+ isReady: () => isReady
26
+ });
27
+ module.exports = __toCommonJS(ready_state_exports);
28
+ const isReady = ({
29
+ readyState,
30
+ state
31
+ }) => readyState === "READY" || state === "READY";
32
+ const isFailed = ({
33
+ readyState,
34
+ state
35
+ }) => {
36
+ if (readyState) {
37
+ return readyState.endsWith("_ERROR") || readyState === "ERROR";
38
+ }
39
+ if (!state) {
40
+ return false;
41
+ }
42
+ return state.endsWith("_ERROR") || state === "ERROR";
43
+ };
44
+ const isDone = (buildOrDeployment) => isReady(buildOrDeployment) || isFailed(buildOrDeployment);
19
45
  const isAliasAssigned = (deployment) => Boolean(deployment.aliasAssigned);
20
- exports.isAliasAssigned = isAliasAssigned;
21
46
  const isAliasError = (deployment) => Boolean(deployment.aliasError);
22
- exports.isAliasError = isAliasError;
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ isAliasAssigned,
50
+ isAliasError,
51
+ isDone,
52
+ isFailed,
53
+ isReady
54
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/client",
3
- "version": "13.0.1",
3
+ "version": "13.0.3",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "homepage": "https://vercel.com",
@@ -30,7 +30,7 @@
30
30
  "typescript": "4.9.5"
31
31
  },
32
32
  "dependencies": {
33
- "@vercel/build-utils": "7.1.0",
33
+ "@vercel/build-utils": "7.2.0",
34
34
  "@vercel/routing-utils": "3.0.0",
35
35
  "@zeit/fetch": "5.2.0",
36
36
  "async-retry": "1.2.3",
@@ -45,7 +45,7 @@
45
45
  "tar-fs": "1.16.3"
46
46
  },
47
47
  "scripts": {
48
- "build": "tsc",
48
+ "build": "node ../../utils/build.mjs",
49
49
  "test-e2e": "pnpm test tests/create-deployment.test.ts tests/create-legacy-deployment.test.ts tests/paths.test.ts",
50
50
  "test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
51
51
  "test-unit": "pnpm test tests/unit.*test.*"