@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,74 +1,88 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- 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 });
4
11
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.hashes = exports.mapToObject = exports.hash = void 0;
7
- const crypto_1 = require("crypto");
8
- const fs_extra_1 = __importDefault(require("fs-extra"));
9
- const async_sema_1 = require("async-sema");
10
- /**
11
- * Computes a hash for the given buf.
12
- *
13
- * @param {Buffer} file data
14
- * @return {String} hex digest
15
- */
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 hashes_exports = {};
30
+ __export(hashes_exports, {
31
+ hash: () => hash,
32
+ hashes: () => hashes,
33
+ mapToObject: () => mapToObject
34
+ });
35
+ module.exports = __toCommonJS(hashes_exports);
36
+ var import_crypto = require("crypto");
37
+ var import_fs_extra = __toESM(require("fs-extra"));
38
+ var import_async_sema = require("async-sema");
16
39
  function hash(buf) {
17
- return (0, crypto_1.createHash)('sha1').update(buf).digest('hex');
40
+ return (0, import_crypto.createHash)("sha1").update(buf).digest("hex");
18
41
  }
19
- exports.hash = hash;
20
- /**
21
- * Transforms map to object
22
- * @param map with hashed files
23
- * @return {object}
24
- */
25
42
  const mapToObject = (map) => {
26
- const obj = {};
27
- for (const [key, value] of map) {
28
- if (typeof key === 'undefined')
29
- continue;
30
- obj[key] = value;
31
- }
32
- return obj;
43
+ const obj = {};
44
+ for (const [key, value] of map) {
45
+ if (typeof key === "undefined")
46
+ continue;
47
+ obj[key] = value;
48
+ }
49
+ return obj;
33
50
  };
34
- exports.mapToObject = mapToObject;
35
- /**
36
- * Computes hashes for the contents of each file given.
37
- *
38
- * @param files - absolute file paths
39
- * @param map - optional map of files to append
40
- * @return Map of hash digest to file object
41
- */
42
- async function hashes(files, map = new Map()) {
43
- const semaphore = new async_sema_1.Sema(100);
44
- await Promise.all(files.map(async (name) => {
45
- await semaphore.acquire();
46
- const stat = await fs_extra_1.default.lstat(name);
47
- const mode = stat.mode;
48
- let data;
49
- const isDirectory = stat.isDirectory();
50
- let h;
51
- if (!isDirectory) {
52
- if (stat.isSymbolicLink()) {
53
- const link = await fs_extra_1.default.readlink(name);
54
- data = Buffer.from(link, 'utf8');
55
- }
56
- else {
57
- data = await fs_extra_1.default.readFile(name);
58
- }
59
- h = hash(data);
60
- }
61
- const entry = map.get(h);
62
- if (entry) {
63
- const names = new Set(entry.names);
64
- names.add(name);
65
- entry.names = [...names];
66
- }
67
- else {
68
- map.set(h, { names: [name], data, mode });
51
+ async function hashes(files, map = /* @__PURE__ */ new Map()) {
52
+ const semaphore = new import_async_sema.Sema(100);
53
+ await Promise.all(
54
+ files.map(async (name) => {
55
+ await semaphore.acquire();
56
+ const stat = await import_fs_extra.default.lstat(name);
57
+ const mode = stat.mode;
58
+ let data;
59
+ const isDirectory = stat.isDirectory();
60
+ let h;
61
+ if (!isDirectory) {
62
+ if (stat.isSymbolicLink()) {
63
+ const link = await import_fs_extra.default.readlink(name);
64
+ data = Buffer.from(link, "utf8");
65
+ } else {
66
+ data = await import_fs_extra.default.readFile(name);
69
67
  }
70
- semaphore.release();
71
- }));
72
- return map;
68
+ h = hash(data);
69
+ }
70
+ const entry = map.get(h);
71
+ if (entry) {
72
+ const names = new Set(entry.names);
73
+ names.add(name);
74
+ entry.names = [...names];
75
+ } else {
76
+ map.set(h, { names: [name], data, mode });
77
+ }
78
+ semaphore.release();
79
+ })
80
+ );
81
+ return map;
73
82
  }
74
- exports.hashes = hashes;
83
+ // Annotate the CommonJS export names for ESM import in node:
84
+ 0 && (module.exports = {
85
+ hash,
86
+ hashes,
87
+ mapToObject
88
+ });
@@ -1,242 +1,270 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- 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 });
4
11
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createDebug = exports.prepareFiles = exports.fetch = exports.getVercelIgnore = exports.buildFileTree = exports.parseVercelConfig = exports.getApiDeploymentsUrl = exports.EVENTS = exports.API_FILES = void 0;
7
- const fetch_1 = require("./fetch");
8
- const path_1 = require("path");
9
- const url_1 = require("url");
10
- const ignore_1 = __importDefault(require("ignore"));
11
- const pkg_1 = require("../pkg");
12
- const build_utils_1 = require("@vercel/build-utils");
13
- const async_sema_1 = require("async-sema");
14
- const fs_extra_1 = require("fs-extra");
15
- const readdir_recursive_1 = __importDefault(require("./readdir-recursive"));
16
- const semaphore = new async_sema_1.Sema(10);
17
- exports.API_FILES = '/v2/files';
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 utils_exports = {};
30
+ __export(utils_exports, {
31
+ API_FILES: () => API_FILES,
32
+ EVENTS: () => EVENTS,
33
+ buildFileTree: () => buildFileTree,
34
+ createDebug: () => createDebug,
35
+ fetch: () => fetch,
36
+ getApiDeploymentsUrl: () => getApiDeploymentsUrl,
37
+ getVercelIgnore: () => getVercelIgnore,
38
+ parseVercelConfig: () => parseVercelConfig,
39
+ prepareFiles: () => prepareFiles
40
+ });
41
+ module.exports = __toCommonJS(utils_exports);
42
+ var import_fetch2 = require("./fetch");
43
+ var import_path = require("path");
44
+ var import_url = require("url");
45
+ var import_ignore = __toESM(require("ignore"));
46
+ var import_pkg = require("../pkg");
47
+ var import_build_utils = require("@vercel/build-utils");
48
+ var import_async_sema = require("async-sema");
49
+ var import_fs_extra = require("fs-extra");
50
+ var import_readdir_recursive = __toESM(require("./readdir-recursive"));
51
+ const semaphore = new import_async_sema.Sema(10);
52
+ const API_FILES = "/v2/files";
18
53
  const EVENTS_ARRAY = [
19
- // File events
20
- 'hashes-calculated',
21
- 'file-count',
22
- 'file-uploaded',
23
- 'all-files-uploaded',
24
- // Deployment events
25
- 'created',
26
- 'building',
27
- 'ready',
28
- 'alias-assigned',
29
- 'warning',
30
- 'error',
31
- 'notice',
32
- 'tip',
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',
54
+ // File events
55
+ "hashes-calculated",
56
+ "file-count",
57
+ "file-uploaded",
58
+ "all-files-uploaded",
59
+ // Deployment events
60
+ "created",
61
+ "building",
62
+ "ready",
63
+ "alias-assigned",
64
+ "warning",
65
+ "error",
66
+ "notice",
67
+ "tip",
68
+ "canceled",
69
+ // Checks events
70
+ "checks-registered",
71
+ "checks-completed",
72
+ "checks-running",
73
+ "checks-conclusion-succeeded",
74
+ "checks-conclusion-failed",
75
+ "checks-conclusion-skipped",
76
+ "checks-conclusion-canceled"
42
77
  ];
43
- exports.EVENTS = new Set(EVENTS_ARRAY);
78
+ const EVENTS = new Set(EVENTS_ARRAY);
44
79
  function getApiDeploymentsUrl(metadata) {
45
- if (metadata && metadata.builds && !metadata.functions) {
46
- return '/v10/deployments';
47
- }
48
- return '/v13/deployments';
80
+ if (metadata && metadata.builds && !metadata.functions) {
81
+ return "/v10/deployments";
82
+ }
83
+ return "/v13/deployments";
49
84
  }
50
- exports.getApiDeploymentsUrl = getApiDeploymentsUrl;
51
85
  async function parseVercelConfig(filePath) {
52
- if (!filePath) {
53
- return {};
54
- }
55
- try {
56
- const jsonString = await (0, fs_extra_1.readFile)(filePath, 'utf8');
57
- return JSON.parse(jsonString);
58
- }
59
- catch (e) {
60
- // eslint-disable-next-line no-console
61
- console.error(e);
62
- return {};
63
- }
86
+ if (!filePath) {
87
+ return {};
88
+ }
89
+ try {
90
+ const jsonString = await (0, import_fs_extra.readFile)(filePath, "utf8");
91
+ return JSON.parse(jsonString);
92
+ } catch (e) {
93
+ console.error(e);
94
+ return {};
95
+ }
64
96
  }
65
- exports.parseVercelConfig = parseVercelConfig;
66
- const maybeRead = async function (path, default_) {
67
- try {
68
- return await (0, fs_extra_1.readFile)(path, 'utf8');
69
- }
70
- catch (err) {
71
- return default_;
72
- }
97
+ const maybeRead = async function(path, default_) {
98
+ try {
99
+ return await (0, import_fs_extra.readFile)(path, "utf8");
100
+ } catch (err) {
101
+ return default_;
102
+ }
73
103
  };
74
- async function buildFileTree(path, { isDirectory, prebuilt, }, debug) {
75
- const ignoreList = [];
76
- let fileList;
77
- let { ig, ignores } = await getVercelIgnore(path, prebuilt);
78
- debug(`Found ${ignores.length} rules in .vercelignore`);
79
- debug('Building file tree...');
80
- if (isDirectory && !Array.isArray(path)) {
81
- // Directory path
82
- const ignores = (absPath) => {
83
- const rel = (0, path_1.relative)(path, absPath);
84
- const ignored = ig.ignores(rel);
85
- if (ignored) {
86
- ignoreList.push(rel);
87
- }
88
- return ignored;
89
- };
90
- fileList = await (0, readdir_recursive_1.default)(path, [ignores]);
91
- debug(`Found ${fileList.length} files in the specified directory`);
92
- }
93
- else if (Array.isArray(path)) {
94
- // Array of file paths
95
- fileList = path;
96
- debug(`Assigned ${fileList.length} files provided explicitly`);
97
- }
98
- else {
99
- // Single file
100
- fileList = [path];
101
- debug(`Deploying the provided path as single file`);
102
- }
103
- return { fileList, ignoreList };
104
+ async function buildFileTree(path, {
105
+ isDirectory,
106
+ prebuilt
107
+ }, debug) {
108
+ const ignoreList = [];
109
+ let fileList;
110
+ let { ig, ignores } = await getVercelIgnore(path, prebuilt);
111
+ debug(`Found ${ignores.length} rules in .vercelignore`);
112
+ debug("Building file tree...");
113
+ if (isDirectory && !Array.isArray(path)) {
114
+ const ignores2 = (absPath) => {
115
+ const rel = (0, import_path.relative)(path, absPath);
116
+ const ignored = ig.ignores(rel);
117
+ if (ignored) {
118
+ ignoreList.push(rel);
119
+ }
120
+ return ignored;
121
+ };
122
+ fileList = await (0, import_readdir_recursive.default)(path, [ignores2]);
123
+ debug(`Found ${fileList.length} files in the specified directory`);
124
+ } else if (Array.isArray(path)) {
125
+ fileList = path;
126
+ debug(`Assigned ${fileList.length} files provided explicitly`);
127
+ } else {
128
+ fileList = [path];
129
+ debug(`Deploying the provided path as single file`);
130
+ }
131
+ return { fileList, ignoreList };
104
132
  }
105
- exports.buildFileTree = buildFileTree;
106
133
  async function getVercelIgnore(cwd, prebuilt) {
107
- const ig = (0, ignore_1.default)();
108
- let ignores;
109
- if (prebuilt) {
110
- const outputDir = '.vercel/output';
111
- ignores = ['*'];
112
- const parts = outputDir.split('/');
113
- parts.forEach((_, i) => {
114
- const level = parts.slice(0, i + 1).join('/');
115
- ignores.push(`!${level}`);
116
- });
117
- ignores.push(`!${outputDir}/**`);
118
- ig.add(ignores.join('\n'));
119
- }
120
- else {
121
- ignores = [
122
- '.hg',
123
- '.git',
124
- '.gitmodules',
125
- '.svn',
126
- '.cache',
127
- '.next',
128
- '.now',
129
- '.vercel',
130
- '.npmignore',
131
- '.dockerignore',
132
- '.gitignore',
133
- '.*.swp',
134
- '.DS_Store',
135
- '.wafpicke-*',
136
- '.lock-wscript',
137
- '.env.local',
138
- '.env.*.local',
139
- '.venv',
140
- 'npm-debug.log',
141
- 'config.gypi',
142
- 'node_modules',
143
- '__pycache__',
144
- 'venv',
145
- 'CVS',
146
- ];
147
- const cwds = Array.isArray(cwd) ? cwd : [cwd];
148
- const files = await Promise.all(cwds.map(async (cwd) => {
149
- const [vercelignore, nowignore] = await Promise.all([
150
- maybeRead((0, path_1.join)(cwd, '.vercelignore'), ''),
151
- maybeRead((0, path_1.join)(cwd, '.nowignore'), ''),
152
- ]);
153
- if (vercelignore && nowignore) {
154
- throw new build_utils_1.NowBuildError({
155
- code: 'CONFLICTING_IGNORE_FILES',
156
- message: 'Cannot use both a `.vercelignore` and `.nowignore` file. Please delete the `.nowignore` file.',
157
- link: 'https://vercel.link/combining-old-and-new-config',
158
- });
159
- }
160
- return vercelignore || nowignore;
161
- }));
162
- const ignoreFile = files.join('\n');
163
- ig.add(`${ignores.join('\n')}\n${clearRelative(ignoreFile)}`);
164
- }
165
- return { ig, ignores };
134
+ const ig = (0, import_ignore.default)();
135
+ let ignores;
136
+ if (prebuilt) {
137
+ const outputDir = ".vercel/output";
138
+ ignores = ["*"];
139
+ const parts = outputDir.split("/");
140
+ parts.forEach((_, i) => {
141
+ const level = parts.slice(0, i + 1).join("/");
142
+ ignores.push(`!${level}`);
143
+ });
144
+ ignores.push(`!${outputDir}/**`);
145
+ ig.add(ignores.join("\n"));
146
+ } else {
147
+ ignores = [
148
+ ".hg",
149
+ ".git",
150
+ ".gitmodules",
151
+ ".svn",
152
+ ".cache",
153
+ ".next",
154
+ ".now",
155
+ ".vercel",
156
+ ".npmignore",
157
+ ".dockerignore",
158
+ ".gitignore",
159
+ ".*.swp",
160
+ ".DS_Store",
161
+ ".wafpicke-*",
162
+ ".lock-wscript",
163
+ ".env.local",
164
+ ".env.*.local",
165
+ ".venv",
166
+ "npm-debug.log",
167
+ "config.gypi",
168
+ "node_modules",
169
+ "__pycache__",
170
+ "venv",
171
+ "CVS"
172
+ ];
173
+ const cwds = Array.isArray(cwd) ? cwd : [cwd];
174
+ const files = await Promise.all(
175
+ cwds.map(async (cwd2) => {
176
+ const [vercelignore, nowignore] = await Promise.all([
177
+ maybeRead((0, import_path.join)(cwd2, ".vercelignore"), ""),
178
+ maybeRead((0, import_path.join)(cwd2, ".nowignore"), "")
179
+ ]);
180
+ if (vercelignore && nowignore) {
181
+ throw new import_build_utils.NowBuildError({
182
+ code: "CONFLICTING_IGNORE_FILES",
183
+ message: "Cannot use both a `.vercelignore` and `.nowignore` file. Please delete the `.nowignore` file.",
184
+ link: "https://vercel.link/combining-old-and-new-config"
185
+ });
186
+ }
187
+ return vercelignore || nowignore;
188
+ })
189
+ );
190
+ const ignoreFile = files.join("\n");
191
+ ig.add(`${ignores.join("\n")}
192
+ ${clearRelative(ignoreFile)}`);
193
+ }
194
+ return { ig, ignores };
166
195
  }
167
- exports.getVercelIgnore = getVercelIgnore;
168
- /**
169
- * Remove leading `./` from the beginning of ignores
170
- * because ignore doesn't like them :|
171
- */
172
196
  function clearRelative(str) {
173
- return str.replace(/(\n|^)\.\//g, '$1');
197
+ return str.replace(/(\n|^)\.\//g, "$1");
174
198
  }
175
199
  const fetch = async (url, token, opts = {}, debugEnabled, useNodeFetch) => {
176
- semaphore.acquire();
177
- const debug = createDebug(debugEnabled);
178
- let time;
179
- url = `${opts.apiUrl || 'https://api.vercel.com'}${url}`;
180
- delete opts.apiUrl;
181
- if (opts.teamId) {
182
- const parsedUrl = new url_1.URL(url);
183
- parsedUrl.searchParams.set('teamId', opts.teamId);
184
- url = parsedUrl.toString();
185
- delete opts.teamId;
186
- }
187
- const userAgent = opts.userAgent || `client-v${pkg_1.pkgVersion}`;
188
- delete opts.userAgent;
189
- opts.headers = {
190
- ...opts.headers,
191
- authorization: `Bearer ${token}`,
192
- accept: 'application/json',
193
- 'user-agent': userAgent,
194
- };
195
- debug(`${opts.method || 'GET'} ${url}`);
196
- time = Date.now();
197
- const res = useNodeFetch
198
- ? await (0, fetch_1.nodeFetch)(url, opts)
199
- : await (0, fetch_1.zeitFetch)(url, opts);
200
- debug(`DONE in ${Date.now() - time}ms: ${opts.method || 'GET'} ${url}`);
201
- semaphore.release();
202
- return res;
200
+ semaphore.acquire();
201
+ const debug = createDebug(debugEnabled);
202
+ let time;
203
+ url = `${opts.apiUrl || "https://api.vercel.com"}${url}`;
204
+ delete opts.apiUrl;
205
+ if (opts.teamId) {
206
+ const parsedUrl = new import_url.URL(url);
207
+ parsedUrl.searchParams.set("teamId", opts.teamId);
208
+ url = parsedUrl.toString();
209
+ delete opts.teamId;
210
+ }
211
+ const userAgent = opts.userAgent || `client-v${import_pkg.pkgVersion}`;
212
+ delete opts.userAgent;
213
+ opts.headers = {
214
+ ...opts.headers,
215
+ authorization: `Bearer ${token}`,
216
+ accept: "application/json",
217
+ "user-agent": userAgent
218
+ };
219
+ debug(`${opts.method || "GET"} ${url}`);
220
+ time = Date.now();
221
+ const res = useNodeFetch ? await (0, import_fetch2.nodeFetch)(url, opts) : await (0, import_fetch2.zeitFetch)(url, opts);
222
+ debug(`DONE in ${Date.now() - time}ms: ${opts.method || "GET"} ${url}`);
223
+ semaphore.release();
224
+ return res;
203
225
  };
204
- exports.fetch = fetch;
205
- const isWin = process.platform.includes('win');
226
+ const isWin = process.platform.includes("win");
206
227
  const prepareFiles = (files, clientOptions) => {
207
- const preparedFiles = [];
208
- for (const [sha, file] of files) {
209
- for (const name of file.names) {
210
- let fileName;
211
- if (clientOptions.isDirectory) {
212
- // Directory
213
- fileName =
214
- typeof clientOptions.path === 'string'
215
- ? (0, path_1.relative)(clientOptions.path, name)
216
- : name;
217
- }
218
- else {
219
- // Array of files or single file
220
- const segments = name.split(path_1.sep);
221
- fileName = segments[segments.length - 1];
222
- }
223
- preparedFiles.push({
224
- file: isWin ? fileName.replace(/\\/g, '/') : fileName,
225
- size: file.data?.byteLength || file.data?.length,
226
- mode: file.mode,
227
- sha: sha || undefined,
228
- });
229
- }
228
+ const preparedFiles = [];
229
+ for (const [sha, file] of files) {
230
+ for (const name of file.names) {
231
+ let fileName;
232
+ if (clientOptions.isDirectory) {
233
+ fileName = typeof clientOptions.path === "string" ? (0, import_path.relative)(clientOptions.path, name) : name;
234
+ } else {
235
+ const segments = name.split(import_path.sep);
236
+ fileName = segments[segments.length - 1];
237
+ }
238
+ preparedFiles.push({
239
+ file: isWin ? fileName.replace(/\\/g, "/") : fileName,
240
+ size: file.data?.byteLength || file.data?.length,
241
+ mode: file.mode,
242
+ sha: sha || void 0
243
+ });
230
244
  }
231
- return preparedFiles;
245
+ }
246
+ return preparedFiles;
232
247
  };
233
- exports.prepareFiles = prepareFiles;
234
248
  function createDebug(debug) {
235
- if (debug) {
236
- return (...logs) => {
237
- process.stderr.write([`[client-debug] ${new Date().toISOString()}`, ...logs].join(' ') + '\n');
238
- };
239
- }
240
- return () => { };
249
+ if (debug) {
250
+ return (...logs) => {
251
+ process.stderr.write(
252
+ [`[client-debug] ${(/* @__PURE__ */ new Date()).toISOString()}`, ...logs].join(" ") + "\n"
253
+ );
254
+ };
255
+ }
256
+ return () => {
257
+ };
241
258
  }
242
- exports.createDebug = createDebug;
259
+ // Annotate the CommonJS export names for ESM import in node:
260
+ 0 && (module.exports = {
261
+ API_FILES,
262
+ EVENTS,
263
+ buildFileTree,
264
+ createDebug,
265
+ fetch,
266
+ getApiDeploymentsUrl,
267
+ getVercelIgnore,
268
+ parseVercelConfig,
269
+ prepareFiles
270
+ });