vercel 32.6.0 → 32.6.1

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/index.js +193 -228
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -140,12 +140,12 @@ var require_polyfills = __commonJS2({
140
140
  "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports2, module2) {
141
141
  var constants = require("constants");
142
142
  var origCwd = process.cwd;
143
- var cwd2 = null;
143
+ var cwd = null;
144
144
  var platform2 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
145
145
  process.cwd = function() {
146
- if (!cwd2)
147
- cwd2 = origCwd.call(process);
148
- return cwd2;
146
+ if (!cwd)
147
+ cwd = origCwd.call(process);
148
+ return cwd;
149
149
  };
150
150
  try {
151
151
  process.cwd();
@@ -154,7 +154,7 @@ var require_polyfills = __commonJS2({
154
154
  if (typeof process.chdir === "function") {
155
155
  chdir = process.chdir;
156
156
  process.chdir = function(d) {
157
- cwd2 = null;
157
+ cwd = null;
158
158
  chdir.call(process, d);
159
159
  };
160
160
  if (Object.setPrototypeOf)
@@ -12008,7 +12008,7 @@ var require_ansi_escapes = __commonJS2({
12008
12008
  return ret + ":" + buffer.toString("base64") + BEL;
12009
12009
  };
12010
12010
  ansiEscapes4.iTerm = {
12011
- setCwd: (cwd2 = process.cwd()) => `${OSC}50;CurrentDir=${cwd2}${BEL}`,
12011
+ setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
12012
12012
  annotation: (message2, options = {}) => {
12013
12013
  let ret = `${OSC}1337;`;
12014
12014
  const hasX = typeof options.x !== "undefined";
@@ -52631,12 +52631,12 @@ var require_polyfills2 = __commonJS2({
52631
52631
  "../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/polyfills.js"(exports2, module2) {
52632
52632
  var constants = require("constants");
52633
52633
  var origCwd = process.cwd;
52634
- var cwd2 = null;
52634
+ var cwd = null;
52635
52635
  var platform2 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
52636
52636
  process.cwd = function() {
52637
- if (!cwd2)
52638
- cwd2 = origCwd.call(process);
52639
- return cwd2;
52637
+ if (!cwd)
52638
+ cwd = origCwd.call(process);
52639
+ return cwd;
52640
52640
  };
52641
52641
  try {
52642
52642
  process.cwd();
@@ -52645,7 +52645,7 @@ var require_polyfills2 = __commonJS2({
52645
52645
  if (typeof process.chdir === "function") {
52646
52646
  chdir = process.chdir;
52647
52647
  process.chdir = function(d) {
52648
- cwd2 = null;
52648
+ cwd = null;
52649
52649
  chdir.call(process, d);
52650
52650
  };
52651
52651
  if (Object.setPrototypeOf)
@@ -63600,7 +63600,7 @@ var require_utils8 = __commonJS2({
63600
63600
  }
63601
63601
  return { fileList, ignoreList };
63602
63602
  }
63603
- async function getVercelIgnore4(cwd2, prebuilt) {
63603
+ async function getVercelIgnore4(cwd, prebuilt) {
63604
63604
  const ig = (0, import_ignore.default)();
63605
63605
  let ignores;
63606
63606
  if (prebuilt) {
@@ -63640,12 +63640,12 @@ var require_utils8 = __commonJS2({
63640
63640
  "venv",
63641
63641
  "CVS"
63642
63642
  ];
63643
- const cwds = Array.isArray(cwd2) ? cwd2 : [cwd2];
63643
+ const cwds = Array.isArray(cwd) ? cwd : [cwd];
63644
63644
  const files = await Promise.all(
63645
- cwds.map(async (cwd22) => {
63645
+ cwds.map(async (cwd2) => {
63646
63646
  const [vercelignore, nowignore] = await Promise.all([
63647
- maybeRead((0, import_path44.join)(cwd22, ".vercelignore"), ""),
63648
- maybeRead((0, import_path44.join)(cwd22, ".nowignore"), "")
63647
+ maybeRead((0, import_path44.join)(cwd2, ".vercelignore"), ""),
63648
+ maybeRead((0, import_path44.join)(cwd2, ".nowignore"), "")
63649
63649
  ]);
63650
63650
  if (vercelignore && nowignore) {
63651
63651
  throw new import_build_utils18.NowBuildError({
@@ -68228,13 +68228,13 @@ var require_tar_fs = __commonJS2({
68228
68228
  var normalize4 = !win32 ? echo : function(name) {
68229
68229
  return name.replace(/\\/g, "/").replace(/[:?<>|]/g, "_");
68230
68230
  };
68231
- var statAll = function(fs16, stat2, cwd2, ignore, entries, sort) {
68231
+ var statAll = function(fs16, stat2, cwd, ignore, entries, sort) {
68232
68232
  var queue = entries || ["."];
68233
68233
  return function loop(callback) {
68234
68234
  if (!queue.length)
68235
68235
  return callback();
68236
68236
  var next = queue.shift();
68237
- var nextAbs = path11.join(cwd2, next);
68237
+ var nextAbs = path11.join(cwd, next);
68238
68238
  stat2(nextAbs, function(err, stat3) {
68239
68239
  if (err)
68240
68240
  return callback(err);
@@ -68246,7 +68246,7 @@ var require_tar_fs = __commonJS2({
68246
68246
  if (sort)
68247
68247
  files.sort();
68248
68248
  for (var i = 0; i < files.length; i++) {
68249
- if (!ignore(path11.join(cwd2, next, files[i])))
68249
+ if (!ignore(path11.join(cwd, next, files[i])))
68250
68250
  queue.push(path11.join(next, files[i]));
68251
68251
  }
68252
68252
  callback(null, next, stat3);
@@ -68264,16 +68264,16 @@ var require_tar_fs = __commonJS2({
68264
68264
  return map(header);
68265
68265
  };
68266
68266
  };
68267
- exports2.pack = function(cwd2, opts) {
68268
- if (!cwd2)
68269
- cwd2 = ".";
68267
+ exports2.pack = function(cwd, opts) {
68268
+ if (!cwd)
68269
+ cwd = ".";
68270
68270
  if (!opts)
68271
68271
  opts = {};
68272
68272
  var xfs = opts.fs || fs15;
68273
68273
  var ignore = opts.ignore || opts.filter || noop;
68274
68274
  var map = opts.map || noop;
68275
68275
  var mapStream = opts.mapStream || echo;
68276
- var statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd2, ignore, opts.entries, opts.sort);
68276
+ var statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd, ignore, opts.entries, opts.sort);
68277
68277
  var strict = opts.strict !== false;
68278
68278
  var umask = typeof opts.umask === "number" ? ~opts.umask : ~processUmask();
68279
68279
  var dmode = typeof opts.dmode === "number" ? opts.dmode : 0;
@@ -68291,7 +68291,7 @@ var require_tar_fs = __commonJS2({
68291
68291
  fmode |= parseInt(222, 8);
68292
68292
  }
68293
68293
  var onsymlink = function(filename, header) {
68294
- xfs.readlink(path11.join(cwd2, filename), function(err, linkname) {
68294
+ xfs.readlink(path11.join(cwd, filename), function(err, linkname) {
68295
68295
  if (err)
68296
68296
  return pack.destroy(err);
68297
68297
  header.linkname = normalize4(linkname);
@@ -68338,7 +68338,7 @@ var require_tar_fs = __commonJS2({
68338
68338
  var entry = pack.entry(header, onnextentry);
68339
68339
  if (!entry)
68340
68340
  return;
68341
- var rs = mapStream(xfs.createReadStream(path11.join(cwd2, filename)), header);
68341
+ var rs = mapStream(xfs.createReadStream(path11.join(cwd, filename)), header);
68342
68342
  rs.on("error", function(err2) {
68343
68343
  entry.destroy(err2);
68344
68344
  });
@@ -68361,9 +68361,9 @@ var require_tar_fs = __commonJS2({
68361
68361
  var processUmask = function() {
68362
68362
  return process.umask ? process.umask() : 0;
68363
68363
  };
68364
- exports2.extract = function(cwd2, opts) {
68365
- if (!cwd2)
68366
- cwd2 = ".";
68364
+ exports2.extract = function(cwd, opts) {
68365
+ if (!cwd)
68366
+ cwd = ".";
68367
68367
  if (!opts)
68368
68368
  opts = {};
68369
68369
  var xfs = opts.fs || fs15;
@@ -68429,7 +68429,7 @@ var require_tar_fs = __commonJS2({
68429
68429
  extract.on("entry", function(header, stream, next) {
68430
68430
  header = map(header) || header;
68431
68431
  header.name = normalize4(header.name);
68432
- var name = path11.join(cwd2, path11.join("/", header.name));
68432
+ var name = path11.join(cwd, path11.join("/", header.name));
68433
68433
  if (ignore(name, header)) {
68434
68434
  stream.resume();
68435
68435
  return next();
@@ -68456,7 +68456,7 @@ var require_tar_fs = __commonJS2({
68456
68456
  if (win32)
68457
68457
  return next();
68458
68458
  xfs.unlink(name, function() {
68459
- var srcpath = path11.join(cwd2, path11.join("/", header.linkname));
68459
+ var srcpath = path11.join(cwd, path11.join("/", header.linkname));
68460
68460
  xfs.link(srcpath, name, function(err) {
68461
68461
  if (err && err.code === "EPERM" && opts.hardlinkAsFilesFallback) {
68462
68462
  stream = xfs.createReadStream(srcpath);
@@ -68488,7 +68488,7 @@ var require_tar_fs = __commonJS2({
68488
68488
  }, stat2);
68489
68489
  }
68490
68490
  var dir = path11.dirname(name);
68491
- validate2(xfs, dir, path11.join(cwd2, "."), function(err, valid) {
68491
+ validate2(xfs, dir, path11.join(cwd, "."), function(err, valid) {
68492
68492
  if (err)
68493
68493
  return next(err);
68494
68494
  if (!valid)
@@ -129966,7 +129966,7 @@ var require_resolveCommand = __commonJS2({
129966
129966
  var getPathKey = require_path_key();
129967
129967
  function resolveCommandAttempt(parsed, withoutPathExt) {
129968
129968
  const env = parsed.options.env || process.env;
129969
- const cwd2 = process.cwd();
129969
+ const cwd = process.cwd();
129970
129970
  const hasCustomCwd = parsed.options.cwd != null;
129971
129971
  const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
129972
129972
  if (shouldSwitchCwd) {
@@ -129984,7 +129984,7 @@ var require_resolveCommand = __commonJS2({
129984
129984
  } catch (e2) {
129985
129985
  } finally {
129986
129986
  if (shouldSwitchCwd) {
129987
- process.chdir(cwd2);
129987
+ process.chdir(cwd);
129988
129988
  }
129989
129989
  }
129990
129990
  if (resolved) {
@@ -148133,10 +148133,10 @@ var require_detect_framework = __commonJS2({
148133
148133
  firstMatchPackage.matchPackage
148134
148134
  );
148135
148135
  }
148136
- function lookupInstalledVersion(cwd2, packageName2) {
148136
+ function lookupInstalledVersion(cwd, packageName2) {
148137
148137
  try {
148138
148138
  const script = `require('${packageName2}/package.json').version`;
148139
- return (0, import_child_process4.spawnSync)(cwd2, ["-p", script], {
148139
+ return (0, import_child_process4.spawnSync)(cwd, ["-p", script], {
148140
148140
  encoding: "utf-8"
148141
148141
  }).stdout.trim();
148142
148142
  } catch (error4) {
@@ -148575,7 +148575,7 @@ var require_get_workspaces = __commonJS2({
148575
148575
  async function getWorkspaces3({
148576
148576
  fs: fs15,
148577
148577
  depth = MAX_DEPTH_TRAVERSE,
148578
- cwd: cwd2 = "/"
148578
+ cwd = "/"
148579
148579
  }) {
148580
148580
  if (depth === 0)
148581
148581
  return [];
@@ -148593,7 +148593,7 @@ var require_get_workspaces = __commonJS2({
148593
148593
  (childDirectory) => getWorkspaces3({
148594
148594
  fs: fs15.chdir(childDirectory.path),
148595
148595
  depth: depth - 1,
148596
- cwd: posixPath.join(cwd2, childDirectory.path)
148596
+ cwd: posixPath.join(cwd, childDirectory.path)
148597
148597
  })
148598
148598
  )
148599
148599
  )).flat();
@@ -148601,7 +148601,7 @@ var require_get_workspaces = __commonJS2({
148601
148601
  return [
148602
148602
  {
148603
148603
  type: workspaceType,
148604
- rootPath: cwd2
148604
+ rootPath: cwd
148605
148605
  }
148606
148606
  ];
148607
148607
  }
@@ -152377,12 +152377,12 @@ var require_common4 = __commonJS2({
152377
152377
  self2.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null);
152378
152378
  setupIgnores(self2, options);
152379
152379
  self2.changedCwd = false;
152380
- var cwd2 = process.cwd();
152380
+ var cwd = process.cwd();
152381
152381
  if (!ownProp(options, "cwd"))
152382
- self2.cwd = path11.resolve(cwd2);
152382
+ self2.cwd = path11.resolve(cwd);
152383
152383
  else {
152384
152384
  self2.cwd = path11.resolve(options.cwd);
152385
- self2.changedCwd = self2.cwd !== cwd2;
152385
+ self2.changedCwd = self2.cwd !== cwd;
152386
152386
  }
152387
152387
  self2.root = options.root || path11.resolve(self2.cwd, "/");
152388
152388
  self2.root = path11.resolve(self2.root);
@@ -163675,8 +163675,8 @@ var init_create_project = __esm({
163675
163675
  });
163676
163676
 
163677
163677
  // src/util/projects/detect-projects.ts
163678
- async function detectProjects(cwd2) {
163679
- const fs15 = new import_fs_detectors.LocalFileSystemDetector(cwd2);
163678
+ async function detectProjects(cwd) {
163679
+ const fs15 = new import_fs_detectors.LocalFileSystemDetector(cwd);
163680
163680
  const workspaces = await (0, import_fs_detectors.getWorkspaces)({ fs: fs15 });
163681
163681
  const detectedProjects = /* @__PURE__ */ new Map();
163682
163682
  const packagePaths = (await Promise.all(
@@ -163829,8 +163829,8 @@ var init_connect_git_provider = __esm({
163829
163829
  });
163830
163830
 
163831
163831
  // src/util/link/repo.ts
163832
- async function getRepoLink(client2, cwd2) {
163833
- const rootPath = await findRepoRoot(client2, cwd2);
163832
+ async function getRepoLink(client2, cwd) {
163833
+ const rootPath = await findRepoRoot(client2, cwd);
163834
163834
  if (!rootPath)
163835
163835
  return void 0;
163836
163836
  const repoConfigPath = (0, import_path14.join)(rootPath, VERCEL_DIR2, VERCEL_DIR_REPO);
@@ -163842,9 +163842,9 @@ async function getRepoLink(client2, cwd2) {
163842
163842
  );
163843
163843
  return { rootPath, repoConfig, repoConfigPath };
163844
163844
  }
163845
- async function ensureRepoLink(client2, cwd2, { yes, overwrite }) {
163845
+ async function ensureRepoLink(client2, cwd, { yes, overwrite }) {
163846
163846
  const { output: output2 } = client2;
163847
- const repoLink = await getRepoLink(client2, cwd2);
163847
+ const repoLink = await getRepoLink(client2, cwd);
163848
163848
  if (repoLink) {
163849
163849
  output2.debug(`Found Git repository root directory: ${repoLink.rootPath}`);
163850
163850
  } else {
@@ -164149,8 +164149,8 @@ var init_repo = __esm({
164149
164149
  });
164150
164150
 
164151
164151
  // src/util/projects/link.ts
164152
- function getVercelDirectory(cwd2) {
164153
- const possibleDirs = [(0, import_path15.join)(cwd2, VERCEL_DIR2), (0, import_path15.join)(cwd2, VERCEL_DIR_FALLBACK)];
164152
+ function getVercelDirectory(cwd) {
164153
+ const possibleDirs = [(0, import_path15.join)(cwd, VERCEL_DIR2), (0, import_path15.join)(cwd, VERCEL_DIR_FALLBACK)];
164154
164154
  const existingDirs = possibleDirs.filter((d) => isDirectory(d));
164155
164155
  if (existingDirs.length > 1) {
164156
164156
  throw new import_build_utils6.NowBuildError({
@@ -164393,7 +164393,7 @@ var init_link2 = __esm({
164393
164393
  });
164394
164394
 
164395
164395
  // src/util/projects/project-settings.ts
164396
- async function writeProjectSettings(cwd2, project, org, isRepoLinked) {
164396
+ async function writeProjectSettings(cwd, project, org, isRepoLinked) {
164397
164397
  let analyticsId;
164398
164398
  if (project.analytics?.id && (!project.analytics.disabledAt || project.analytics.enabledAt && project.analytics.enabledAt > project.analytics.disabledAt)) {
164399
164399
  analyticsId = project.analytics.id;
@@ -164414,7 +164414,7 @@ async function writeProjectSettings(cwd2, project, org, isRepoLinked) {
164414
164414
  analyticsId
164415
164415
  }
164416
164416
  };
164417
- const path11 = (0, import_path16.join)(cwd2, VERCEL_DIR2, VERCEL_DIR_PROJECT);
164417
+ const path11 = (0, import_path16.join)(cwd, VERCEL_DIR2, VERCEL_DIR_PROJECT);
164418
164418
  return await (0, import_fs_extra8.outputJSON)(path11, projectLinkAndSettings, {
164419
164419
  spaces: 2
164420
164420
  });
@@ -164624,7 +164624,7 @@ function tryReadHeadSync(path11, length) {
164624
164624
  }
164625
164625
  }
164626
164626
  }
164627
- async function pull(client2, link4, project, environment, opts, args2, output2, cwd2, source) {
164627
+ async function pull(client2, link4, project, environment, opts, args2, output2, cwd, source) {
164628
164628
  if (args2.length > 1) {
164629
164629
  output2.error(
164630
164630
  `Invalid number of arguments. Usage: ${getCommandName(`env pull <file>`)}`
@@ -164632,7 +164632,7 @@ async function pull(client2, link4, project, environment, opts, args2, output2,
164632
164632
  return 1;
164633
164633
  }
164634
164634
  const [filename = ".env.local"] = args2;
164635
- const fullPath = (0, import_path17.resolve)(cwd2, filename);
164635
+ const fullPath = (0, import_path17.resolve)(cwd, filename);
164636
164636
  const skipConfirmation = opts["--yes"];
164637
164637
  const gitBranch = opts["--git-branch"];
164638
164638
  const head = tryReadHeadSync(fullPath, Buffer.byteLength(CONTENTS_PREFIX));
@@ -164676,7 +164676,7 @@ async function pull(client2, link4, project, environment, opts, args2, output2,
164676
164676
  }
164677
164677
  let isGitIgnoreUpdated = false;
164678
164678
  if (filename === ".env.local") {
164679
- const rootPath = link4.repoRoot ?? cwd2;
164679
+ const rootPath = link4.repoRoot ?? cwd;
164680
164680
  isGitIgnoreUpdated = await addToGitIgnore(rootPath, ".env*.local");
164681
164681
  }
164682
164682
  output2.print(
@@ -164848,7 +164848,7 @@ var init_input_project = __esm({
164848
164848
  });
164849
164849
 
164850
164850
  // src/util/validate-paths.ts
164851
- async function validateRootDirectory(output2, cwd2, path11, errorSuffix) {
164851
+ async function validateRootDirectory(output2, cwd, path11, errorSuffix) {
164852
164852
  const pathStat = await (0, import_fs_extra11.lstat)(path11).catch(() => null);
164853
164853
  const suffix = errorSuffix ? ` ${errorSuffix}` : "";
164854
164854
  if (!pathStat) {
@@ -164867,7 +164867,7 @@ async function validateRootDirectory(output2, cwd2, path11, errorSuffix) {
164867
164867
  );
164868
164868
  return false;
164869
164869
  }
164870
- if (!path11.startsWith(cwd2)) {
164870
+ if (!path11.startsWith(cwd)) {
164871
164871
  output2.error(
164872
164872
  `The provided path ${import_chalk38.default.cyan(
164873
164873
  `\u201C${humanizePath(path11)}\u201D`
@@ -164923,7 +164923,7 @@ var init_validate_paths = __esm({
164923
164923
  });
164924
164924
 
164925
164925
  // src/util/input/input-root-directory.ts
164926
- async function inputRootDirectory(client2, cwd2, autoConfirm = false) {
164926
+ async function inputRootDirectory(client2, cwd, autoConfirm = false) {
164927
164927
  if (autoConfirm) {
164928
164928
  return null;
164929
164929
  }
@@ -164943,10 +164943,10 @@ async function inputRootDirectory(client2, cwd2, autoConfirm = false) {
164943
164943
  if (normal === "." || normal === "./") {
164944
164944
  return null;
164945
164945
  }
164946
- const fullPath = import_path18.default.join(cwd2, normal);
164946
+ const fullPath = import_path18.default.join(cwd, normal);
164947
164947
  if (await validateRootDirectory(
164948
164948
  client2.output,
164949
- cwd2,
164949
+ cwd,
164950
164950
  fullPath,
164951
164951
  "Please choose a different one."
164952
164952
  ) === false) {
@@ -165137,14 +165137,14 @@ var init_generate_cert_for_deploy = __esm({
165137
165137
  });
165138
165138
 
165139
165139
  // src/util/deploy/create-deploy.ts
165140
- async function createDeploy(client2, now, contextName, path11, createArgs, org, isSettingUpProject, cwd2, archive) {
165140
+ async function createDeploy(client2, now, contextName, path11, createArgs, org, isSettingUpProject, cwd, archive) {
165141
165141
  try {
165142
165142
  return await now.create(
165143
165143
  path11,
165144
165144
  createArgs,
165145
165145
  org,
165146
165146
  isSettingUpProject,
165147
- cwd2,
165147
+ cwd,
165148
165148
  archive
165149
165149
  );
165150
165150
  } catch (err) {
@@ -165210,7 +165210,7 @@ async function createDeploy(client2, now, contextName, path11, createArgs, org,
165210
165210
  createArgs,
165211
165211
  org,
165212
165212
  isSettingUpProject,
165213
- cwd2
165213
+ cwd
165214
165214
  );
165215
165215
  }
165216
165216
  if (err.code === "not_found") {
@@ -165266,7 +165266,7 @@ function printInspectUrl(output2, inspectorUrl, deployStamp) {
165266
165266
  }
165267
165267
  async function processDeployment({
165268
165268
  org,
165269
- cwd: cwd2,
165269
+ cwd,
165270
165270
  projectName,
165271
165271
  isSettingUpProject,
165272
165272
  archive,
@@ -165361,7 +165361,7 @@ async function processDeployment({
165361
165361
  const deployment = event.payload;
165362
165362
  await linkFolderToProject(
165363
165363
  client2,
165364
- cwd2,
165364
+ cwd,
165365
165365
  {
165366
165366
  orgId: org.id,
165367
165367
  projectId: deployment.projectId
@@ -165522,7 +165522,7 @@ var init_util = __esm({
165522
165522
  skipAutoDetectionConfirmation,
165523
165523
  noWait,
165524
165524
  autoAssignCustomDomains
165525
- }, org, isSettingUpProject, cwd2, archive) {
165525
+ }, org, isSettingUpProject, cwd, archive) {
165526
165526
  let hashes = {};
165527
165527
  const uploadStamp = stamp_default();
165528
165528
  let requestBody = {
@@ -165557,7 +165557,7 @@ var init_util = __esm({
165557
165557
  isSettingUpProject,
165558
165558
  archive,
165559
165559
  skipAutoDetectionConfirmation,
165560
- cwd: cwd2,
165560
+ cwd,
165561
165561
  prebuilt,
165562
165562
  rootDirectory,
165563
165563
  noWait
@@ -166089,14 +166089,14 @@ var init_setup_and_link = __esm({
166089
166089
  });
166090
166090
 
166091
166091
  // src/util/link/ensure-link.ts
166092
- async function ensureLink(commandName, client2, cwd2, opts = {}) {
166092
+ async function ensureLink(commandName, client2, cwd, opts = {}) {
166093
166093
  let { link: link4 } = opts;
166094
166094
  if (!link4) {
166095
- link4 = await getLinkedProject(client2, cwd2);
166095
+ link4 = await getLinkedProject(client2, cwd);
166096
166096
  opts.link = link4;
166097
166097
  }
166098
166098
  if (link4.status === "linked" && opts.forceDelete || link4.status === "not_linked") {
166099
- link4 = await setupAndLink(client2, cwd2, opts);
166099
+ link4 = await setupAndLink(client2, cwd, opts);
166100
166100
  if (link4.status === "not_linked") {
166101
166101
  return 0;
166102
166102
  }
@@ -166217,7 +166217,7 @@ function parseArgs(client2) {
166217
166217
  }
166218
166218
  return argv2;
166219
166219
  }
166220
- async function pullAllEnvFiles(environment, client2, link4, project, argv2, cwd2) {
166220
+ async function pullAllEnvFiles(environment, client2, link4, project, argv2, cwd) {
166221
166221
  const environmentFile = `.env.${environment}.local`;
166222
166222
  return pull(
166223
166223
  client2,
@@ -166227,7 +166227,7 @@ async function pullAllEnvFiles(environment, client2, link4, project, argv2, cwd2
166227
166227
  argv2,
166228
166228
  [(0, import_path20.join)(".vercel", environmentFile)],
166229
166229
  client2.output,
166230
- cwd2,
166230
+ cwd,
166231
166231
  "vercel-cli:pull"
166232
166232
  );
166233
166233
  }
@@ -166244,16 +166244,16 @@ async function main(client2) {
166244
166244
  if (typeof argv2 === "number") {
166245
166245
  return argv2;
166246
166246
  }
166247
- let cwd2 = argv2._[1] || client2.cwd;
166247
+ let cwd = argv2._[1] || client2.cwd;
166248
166248
  const autoConfirm = Boolean(argv2["--yes"]);
166249
166249
  const environment = parseEnvironment(argv2["--environment"] || void 0);
166250
- const link4 = await ensureLink("pull", client2, cwd2, { autoConfirm });
166250
+ const link4 = await ensureLink("pull", client2, cwd, { autoConfirm });
166251
166251
  if (typeof link4 === "number") {
166252
166252
  return link4;
166253
166253
  }
166254
166254
  const { project, org, repoRoot } = link4;
166255
166255
  if (repoRoot) {
166256
- cwd2 = (0, import_path20.join)(repoRoot, project.rootDirectory || "");
166256
+ cwd = (0, import_path20.join)(repoRoot, project.rootDirectory || "");
166257
166257
  }
166258
166258
  client2.config.currentTeam = org.type === "team" ? org.id : void 0;
166259
166259
  const pullResultCode = await pullAllEnvFiles(
@@ -166262,7 +166262,7 @@ async function main(client2) {
166262
166262
  link4,
166263
166263
  project,
166264
166264
  argv2,
166265
- cwd2
166265
+ cwd
166266
166266
  );
166267
166267
  if (pullResultCode !== 0) {
166268
166268
  return pullResultCode;
@@ -166270,12 +166270,12 @@ async function main(client2) {
166270
166270
  client2.output.print("\n");
166271
166271
  client2.output.log("Downloading project settings");
166272
166272
  const isRepoLinked = typeof repoRoot === "string";
166273
- await writeProjectSettings(cwd2, project, org, isRepoLinked);
166273
+ await writeProjectSettings(cwd, project, org, isRepoLinked);
166274
166274
  const settingsStamp = stamp_default();
166275
166275
  client2.output.print(
166276
166276
  `${prependEmoji(
166277
166277
  `Downloaded project settings to ${import_chalk44.default.bold(
166278
- humanizePath((0, import_path20.join)(cwd2, VERCEL_DIR2, VERCEL_DIR_PROJECT))
166278
+ humanizePath((0, import_path20.join)(cwd, VERCEL_DIR2, VERCEL_DIR_PROJECT))
166279
166279
  )} ${import_chalk44.default.gray(settingsStamp())}`,
166280
166280
  emoji("success")
166281
166281
  )}
@@ -169705,8 +169705,8 @@ var init_static_builder = __esm({
169705
169705
  });
169706
169706
 
169707
169707
  // src/util/build/import-builders.ts
169708
- async function importBuilders(builderSpecs, cwd2, output2) {
169709
- const buildersDir = (0, import_path25.join)(cwd2, VERCEL_DIR2, "builders");
169708
+ async function importBuilders(builderSpecs, cwd, output2) {
169709
+ const buildersDir = (0, import_path25.join)(cwd, VERCEL_DIR2, "builders");
169710
169710
  let importResult = await resolveBuilders(buildersDir, builderSpecs, output2);
169711
169711
  if ("buildersToAdd" in importResult) {
169712
169712
  const installResult = await installBuilders(
@@ -170161,10 +170161,10 @@ var init_validate_config = __esm({
170161
170161
  });
170162
170162
 
170163
170163
  // src/util/build/monorepo.ts
170164
- async function setMonorepoDefaultSettings(cwd2, workPath, projectSettings, output2) {
170165
- const localFileSystem = new import_fs_detectors3.LocalFileSystemDetector(cwd2);
170164
+ async function setMonorepoDefaultSettings(cwd, workPath, projectSettings, output2) {
170165
+ const localFileSystem = new import_fs_detectors3.LocalFileSystemDetector(cwd);
170166
170166
  const projectName = (0, import_path27.basename)(workPath);
170167
- const relativeToRoot = (0, import_path27.relative)(workPath, cwd2);
170167
+ const relativeToRoot = (0, import_path27.relative)(workPath, cwd);
170168
170168
  const setCommand = (command, value) => {
170169
170169
  if (projectSettings[command]) {
170170
170170
  (0, import_build_utils12.debug)(
@@ -170177,7 +170177,7 @@ async function setMonorepoDefaultSettings(cwd2, workPath, projectSettings, outpu
170177
170177
  try {
170178
170178
  const result = await (0, import_fs_detectors3.getMonorepoDefaultSettings)(
170179
170179
  projectName,
170180
- (0, import_path27.relative)(cwd2, workPath),
170180
+ (0, import_path27.relative)(cwd, workPath),
170181
170181
  relativeToRoot,
170182
170182
  localFileSystem
170183
170183
  );
@@ -170296,7 +170296,7 @@ __export3(build_exports, {
170296
170296
  default: () => main2
170297
170297
  });
170298
170298
  async function main2(client2) {
170299
- let { cwd: cwd2 } = client2;
170299
+ let { cwd } = client2;
170300
170300
  const { output: output2 } = client2;
170301
170301
  if (process.env.__VERCEL_BUILD_RUNNING) {
170302
170302
  output2.error(
@@ -170326,17 +170326,17 @@ async function main2(client2) {
170326
170326
  const target = argv2["--prod"] ? "production" : "preview";
170327
170327
  const yes = Boolean(argv2["--yes"]);
170328
170328
  try {
170329
- await (0, import_build_utils13.validateNpmrc)(cwd2);
170329
+ await (0, import_build_utils13.validateNpmrc)(cwd);
170330
170330
  } catch (err) {
170331
170331
  output2.prettyError(err);
170332
170332
  return 1;
170333
170333
  }
170334
- const link4 = await getProjectLink(client2, cwd2);
170334
+ const link4 = await getProjectLink(client2, cwd);
170335
170335
  const projectRootDirectory = link4?.projectRootDirectory ?? "";
170336
170336
  if (link4?.repoRoot) {
170337
- cwd2 = client2.cwd = link4.repoRoot;
170337
+ cwd = client2.cwd = link4.repoRoot;
170338
170338
  }
170339
- const vercelDir = (0, import_path28.join)(cwd2, projectRootDirectory, VERCEL_DIR2);
170339
+ const vercelDir = (0, import_path28.join)(cwd, projectRootDirectory, VERCEL_DIR2);
170340
170340
  let project = await readProjectSettings(vercelDir);
170341
170341
  const isTTY3 = process.stdin.isTTY;
170342
170342
  while (!project?.settings) {
@@ -170364,7 +170364,7 @@ async function main2(client2) {
170364
170364
  return 0;
170365
170365
  }
170366
170366
  const { argv: originalArgv } = client2;
170367
- client2.cwd = (0, import_path28.join)(cwd2, projectRootDirectory);
170367
+ client2.cwd = (0, import_path28.join)(cwd, projectRootDirectory);
170368
170368
  client2.argv = [
170369
170369
  ...originalArgv.slice(0, 2),
170370
170370
  "pull",
@@ -170375,11 +170375,11 @@ async function main2(client2) {
170375
170375
  if (result !== 0) {
170376
170376
  return result;
170377
170377
  }
170378
- client2.cwd = cwd2;
170378
+ client2.cwd = cwd;
170379
170379
  client2.argv = originalArgv;
170380
170380
  project = await readProjectSettings(vercelDir);
170381
170381
  }
170382
- const defaultOutputDir = (0, import_path28.join)(cwd2, projectRootDirectory, OUTPUT_DIR);
170382
+ const defaultOutputDir = (0, import_path28.join)(cwd, projectRootDirectory, OUTPUT_DIR);
170383
170383
  const outputDir = argv2["--output"] ? (0, import_path28.resolve)(argv2["--output"]) : defaultOutputDir;
170384
170384
  await Promise.all([
170385
170385
  import_fs_extra18.default.remove(outputDir),
@@ -170394,7 +170394,7 @@ async function main2(client2) {
170394
170394
  const envToUnset = /* @__PURE__ */ new Set(["VERCEL", "NOW_BUILDER"]);
170395
170395
  try {
170396
170396
  const envPath = (0, import_path28.join)(
170397
- cwd2,
170397
+ cwd,
170398
170398
  projectRootDirectory,
170399
170399
  VERCEL_DIR2,
170400
170400
  `.env.${target}.local`
@@ -170419,7 +170419,7 @@ async function main2(client2) {
170419
170419
  }
170420
170420
  process.env.VERCEL = "1";
170421
170421
  process.env.NOW_BUILDER = "1";
170422
- await doBuild(client2, project, buildsJson, cwd2, outputDir);
170422
+ await doBuild(client2, project, buildsJson, cwd, outputDir);
170423
170423
  return 0;
170424
170424
  } catch (err) {
170425
170425
  output2.prettyError(err);
@@ -170437,9 +170437,9 @@ async function main2(client2) {
170437
170437
  }
170438
170438
  }
170439
170439
  }
170440
- async function doBuild(client2, project, buildsJson, cwd2, outputDir) {
170440
+ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
170441
170441
  const { localConfigPath, output: output2 } = client2;
170442
- const workPath = (0, import_path28.join)(cwd2, project.settings.rootDirectory || ".");
170442
+ const workPath = (0, import_path28.join)(cwd, project.settings.rootDirectory || ".");
170443
170443
  const [pkg, vercelConfig, nowConfig] = await Promise.all([
170444
170444
  readJSONFile((0, import_path28.join)(workPath, "package.json")),
170445
170445
  readJSONFile(
@@ -170468,7 +170468,7 @@ async function doBuild(client2, project, buildsJson, cwd2, outputDir) {
170468
170468
  ...pickOverrides(localConfig)
170469
170469
  };
170470
170470
  if (process.env.VERCEL_BUILD_MONOREPO_SUPPORT === "1" && pkg?.scripts?.["vercel-build"] === void 0 && projectSettings.rootDirectory !== null && projectSettings.rootDirectory !== ".") {
170471
- await setMonorepoDefaultSettings(cwd2, workPath, projectSettings, output2);
170471
+ await setMonorepoDefaultSettings(cwd, workPath, projectSettings, output2);
170472
170472
  }
170473
170473
  const files = (await staticFiles(workPath, client2)).map(
170474
170474
  (f) => (0, import_build_utils13.normalizePath)((0, import_path28.relative)(workPath, f))
@@ -170529,7 +170529,7 @@ async function doBuild(client2, project, buildsJson, cwd2, outputDir) {
170529
170529
  zeroConfigRoutes.push(...detectedBuilders.defaultRoutes || []);
170530
170530
  }
170531
170531
  const builderSpecs = new Set(builds.map((b) => b.use));
170532
- const buildersWithPkgs = await importBuilders(builderSpecs, cwd2, output2);
170532
+ const buildersWithPkgs = await importBuilders(builderSpecs, cwd, output2);
170533
170533
  const filesMap = {};
170534
170534
  for (const path11 of files) {
170535
170535
  const fsPath = (0, import_path28.join)(workPath, path11);
@@ -170539,6 +170539,27 @@ async function doBuild(client2, project, buildsJson, cwd2, outputDir) {
170539
170539
  const buildStamp = stamp_default();
170540
170540
  await import_fs_extra18.default.mkdirp(outputDir);
170541
170541
  const ops = [];
170542
+ const dependencyMap = makeDepencyMap(pkg);
170543
+ const speedInsighsVersion = dependencyMap.get("@vercel/speed-insights");
170544
+ if (speedInsighsVersion) {
170545
+ if (process.env.VERCEL_ANALYTICS_ID) {
170546
+ output2.warn(
170547
+ `The \`VERCEL_ANALYTICS_ID\` environment variable is deprecated and will be removed in a future release. Please remove it from your environment variables`
170548
+ );
170549
+ delete process.env.VERCEL_ANALYTICS_ID;
170550
+ }
170551
+ buildsJson.features = {
170552
+ ...buildsJson.features ?? {},
170553
+ speedInsightsVersion: speedInsighsVersion
170554
+ };
170555
+ }
170556
+ const webAnalyticsVersion = dependencyMap.get("@vercel/analytics");
170557
+ if (webAnalyticsVersion) {
170558
+ buildsJson.features = {
170559
+ ...buildsJson.features ?? {},
170560
+ webAnalyticsVersion
170561
+ };
170562
+ }
170542
170563
  const buildsJsonBuilds = new Map(
170543
170564
  builds.map((build2) => {
170544
170565
  const builderWithPkg = buildersWithPkgs.get(build2.use);
@@ -170558,7 +170579,9 @@ async function doBuild(client2, project, buildsJson, cwd2, outputDir) {
170558
170579
  })
170559
170580
  );
170560
170581
  buildsJson.builds = Array.from(buildsJsonBuilds.values());
170561
- await writeBuildJson(buildsJson, outputDir);
170582
+ await import_fs_extra18.default.writeJSON((0, import_path28.join)(outputDir, "builds.json"), buildsJson, {
170583
+ spaces: 2
170584
+ });
170562
170585
  const meta = {
170563
170586
  skipDownload: true,
170564
170587
  cliVersion: pkg_default.version
@@ -170566,7 +170589,7 @@ async function doBuild(client2, project, buildsJson, cwd2, outputDir) {
170566
170589
  const sortedBuilders = sortBuilders(builds);
170567
170590
  const buildResults = /* @__PURE__ */ new Map();
170568
170591
  const overrides = [];
170569
- const repoRootPath = cwd2;
170592
+ const repoRootPath = cwd;
170570
170593
  const corepackShimDir = await initCorepack({ repoRootPath });
170571
170594
  for (const build2 of sortedBuilders) {
170572
170595
  if (typeof build2.src !== "string")
@@ -170656,31 +170679,6 @@ async function doBuild(client2, project, buildsJson, cwd2, outputDir) {
170656
170679
  throw error4;
170657
170680
  }
170658
170681
  }
170659
- let needBuildsJsonOverride = false;
170660
- const { speedInsightsVersion, webAnalyticsVersion } = await readPackageVersions(pkg);
170661
- if (speedInsightsVersion) {
170662
- if (process.env.VERCEL_ANALYTICS_ID) {
170663
- output2.warn(
170664
- `The \`VERCEL_ANALYTICS_ID\` environment variable is deprecated and will be removed in a future release. Please remove it from your environment variables`
170665
- );
170666
- delete process.env.VERCEL_ANALYTICS_ID;
170667
- }
170668
- buildsJson.features = {
170669
- ...buildsJson.features ?? {},
170670
- speedInsightsVersion
170671
- };
170672
- needBuildsJsonOverride = true;
170673
- }
170674
- if (webAnalyticsVersion) {
170675
- buildsJson.features = {
170676
- ...buildsJson.features ?? {},
170677
- webAnalyticsVersion
170678
- };
170679
- needBuildsJsonOverride = true;
170680
- }
170681
- if (needBuildsJsonOverride) {
170682
- await writeBuildJson(buildsJson, outputDir);
170683
- }
170684
170682
  const configPath = (0, import_path28.join)(outputDir, "config.json");
170685
170683
  const existingConfig = await readJSONFile(configPath);
170686
170684
  if (existingConfig instanceof CantParseJSONFile) {
@@ -170723,7 +170721,7 @@ async function doBuild(client2, project, buildsJson, cwd2, outputDir) {
170723
170721
  const mergedWildcard = mergeWildcard(buildResults.values());
170724
170722
  const mergedOverrides = overrides.length > 0 ? Object.assign({}, ...overrides) : void 0;
170725
170723
  const mergedFlags = mergeFlags(buildResults.values());
170726
- const framework = await getFramework(cwd2, buildResults);
170724
+ const framework = await getFramework(cwd, buildResults);
170727
170725
  const config3 = {
170728
170726
  version: 3,
170729
170727
  routes: mergedRoutes,
@@ -170735,7 +170733,7 @@ async function doBuild(client2, project, buildsJson, cwd2, outputDir) {
170735
170733
  flags: mergedFlags
170736
170734
  };
170737
170735
  await import_fs_extra18.default.writeJSON((0, import_path28.join)(outputDir, "config.json"), config3, { spaces: 2 });
170738
- const relOutputDir = (0, import_path28.relative)(cwd2, outputDir);
170736
+ const relOutputDir = (0, import_path28.relative)(cwd, outputDir);
170739
170737
  output2.print(
170740
170738
  `${prependEmoji(
170741
170739
  `Build Completed in ${import_chalk45.default.bold(
@@ -170746,9 +170744,9 @@ async function doBuild(client2, project, buildsJson, cwd2, outputDir) {
170746
170744
  `
170747
170745
  );
170748
170746
  }
170749
- async function getFramework(cwd2, buildResults) {
170747
+ async function getFramework(cwd, buildResults) {
170750
170748
  const detectedFramework = await (0, import_fs_detectors4.detectFrameworkRecord)({
170751
- fs: new import_fs_detectors4.LocalFileSystemDetector(cwd2),
170749
+ fs: new import_fs_detectors4.LocalFileSystemDetector(cwd),
170752
170750
  frameworkList: import_frameworks4.default
170753
170751
  });
170754
170752
  if (!detectedFramework) {
@@ -170847,39 +170845,7 @@ function makeDepencyMap(pkg) {
170847
170845
  ...Object.entries(pkg?.dependencies ?? {})
170848
170846
  ]);
170849
170847
  }
170850
- async function writeBuildJson(buildsJson, outputDir) {
170851
- await import_fs_extra18.default.writeJSON((0, import_path28.join)(outputDir, "builds.json"), buildsJson, { spaces: 2 });
170852
- }
170853
- async function readPackageVersions(descriptor2) {
170854
- const referencedDependencies = makeDepencyMap(descriptor2);
170855
- const [speedInsightsVersion, webAnalyticsVersion] = await Promise.all([
170856
- readPackageVersion("@vercel/speed-insights", referencedDependencies),
170857
- readPackageVersion("@vercel/analytics", referencedDependencies)
170858
- ]);
170859
- return { webAnalyticsVersion, speedInsightsVersion };
170860
- }
170861
- async function readPackageVersion(pkgName, dependencies) {
170862
- let version2 = void 0;
170863
- try {
170864
- const descriptorPath = require.resolve(`${pkgName}/package.json`, {
170865
- paths: [(0, import_process.cwd)()]
170866
- });
170867
- const descriptor2 = await readJSONFile(descriptorPath);
170868
- if (descriptor2 instanceof CantParseJSONFile)
170869
- throw descriptor2;
170870
- version2 = descriptor2?.version;
170871
- } catch {
170872
- }
170873
- if (version2 && !dependencies.has(pkgName)) {
170874
- throw new import_build_utils13.NowBuildError({
170875
- code: "INVALID_CONFIGURATION",
170876
- message: `Package \`${pkgName}\` is globally installed, which is not supported. Please move the dependency to your deployed application's package.json`,
170877
- link: "https://vercel.link/global-observability-package"
170878
- });
170879
- }
170880
- return version2;
170881
- }
170882
- var import_fs_extra18, import_chalk45, import_dotenv, import_semver3, import_minimatch2, import_path28, import_process, import_frameworks4, import_build_utils13, import_fs_detectors4, import_routing_utils2, import_client8;
170848
+ var import_fs_extra18, import_chalk45, import_dotenv, import_semver3, import_minimatch2, import_path28, import_frameworks4, import_build_utils13, import_fs_detectors4, import_routing_utils2, import_client8;
170883
170849
  var init_build = __esm({
170884
170850
  "src/commands/build/index.ts"() {
170885
170851
  "use strict";
@@ -170889,7 +170855,6 @@ var init_build = __esm({
170889
170855
  import_semver3 = __toESM3(require_semver());
170890
170856
  import_minimatch2 = __toESM3(require_minimatch2());
170891
170857
  import_path28 = require("path");
170892
- import_process = require("process");
170893
170858
  import_frameworks4 = __toESM3(require_frameworks());
170894
170859
  import_build_utils13 = require("@vercel/build-utils");
170895
170860
  import_fs_detectors4 = __toESM3(require_dist27());
@@ -172323,7 +172288,7 @@ var init_deploy = __esm({
172323
172288
  }
172324
172289
  const { log: log2, debug: debug3, error: error4, prettyError } = output2;
172325
172290
  const quiet = !client2.stdout.isTTY;
172326
- let { path: cwd2 } = pathValidation;
172291
+ let { path: cwd } = pathValidation;
172327
172292
  const autoConfirm = argv2["--yes"];
172328
172293
  if (argv2["--name"]) {
172329
172294
  output2.print(
@@ -172356,7 +172321,7 @@ var init_deploy = __esm({
172356
172321
  output2.error(`Format must be one of: ${import_client10.VALID_ARCHIVE_FORMATS.join(", ")}`);
172357
172322
  return 1;
172358
172323
  }
172359
- const link4 = await getLinkedProject(client2, cwd2);
172324
+ const link4 = await getLinkedProject(client2, cwd);
172360
172325
  if (link4.status === "error") {
172361
172326
  return link4.exitCode;
172362
172327
  }
@@ -172367,7 +172332,7 @@ var init_deploy = __esm({
172367
172332
  if (status === "not_linked") {
172368
172333
  const shouldStartSetup = autoConfirm || await confirm(
172369
172334
  client2,
172370
- `Set up and deploy ${import_chalk53.default.cyan(`\u201C${humanizePath(cwd2)}\u201D`)}?`,
172335
+ `Set up and deploy ${import_chalk53.default.cyan(`\u201C${humanizePath(cwd)}\u201D`)}?`,
172371
172336
  true
172372
172337
  );
172373
172338
  if (!shouldStartSetup) {
@@ -172401,14 +172366,14 @@ var init_deploy = __esm({
172401
172366
  );
172402
172367
  if (typeof projectOrNewProjectName === "string") {
172403
172368
  newProjectName = projectOrNewProjectName;
172404
- rootDirectory = await inputRootDirectory(client2, cwd2, autoConfirm);
172369
+ rootDirectory = await inputRootDirectory(client2, cwd, autoConfirm);
172405
172370
  } else {
172406
172371
  project = projectOrNewProjectName;
172407
172372
  rootDirectory = project.rootDirectory;
172408
172373
  sourceFilesOutsideRootDirectory = project.sourceFilesOutsideRootDirectory;
172409
172374
  await linkFolderToProject(
172410
172375
  client2,
172411
- cwd2,
172376
+ cwd,
172412
172377
  {
172413
172378
  projectId: project.id,
172414
172379
  orgId: org.id
@@ -172420,16 +172385,16 @@ var init_deploy = __esm({
172420
172385
  }
172421
172386
  }
172422
172387
  if (link4.status === "linked" && link4.repoRoot) {
172423
- cwd2 = link4.repoRoot;
172388
+ cwd = link4.repoRoot;
172424
172389
  }
172425
172390
  if (!org) {
172426
172391
  throw new Error(`"org" is not defined`);
172427
172392
  }
172428
172393
  if (argv2["--prebuilt"]) {
172429
172394
  if (link4.status === "linked" && link4.repoRoot && link4.project.rootDirectory) {
172430
- cwd2 = (0, import_path32.join)(cwd2, link4.project.rootDirectory);
172395
+ cwd = (0, import_path32.join)(cwd, link4.project.rootDirectory);
172431
172396
  }
172432
- const prebuiltExists = await import_fs_extra20.default.pathExists((0, import_path32.join)(cwd2, ".vercel/output"));
172397
+ const prebuiltExists = await import_fs_extra20.default.pathExists((0, import_path32.join)(cwd, ".vercel/output"));
172433
172398
  if (!prebuiltExists) {
172434
172399
  error4(
172435
172400
  `The ${param(
@@ -172440,7 +172405,7 @@ var init_deploy = __esm({
172440
172405
  );
172441
172406
  return 1;
172442
172407
  }
172443
- const prebuiltBuild = await getPrebuiltJson(cwd2);
172408
+ const prebuiltBuild = await getPrebuiltJson(cwd);
172444
172409
  const prebuiltError = prebuiltBuild?.error || prebuiltBuild?.builds?.find((build2) => "error" in build2)?.error;
172445
172410
  if (prebuiltError) {
172446
172411
  output2.log(
@@ -172469,17 +172434,17 @@ var init_deploy = __esm({
172469
172434
  }
172470
172435
  const contextName = org.slug;
172471
172436
  client2.config.currentTeam = org.type === "team" ? org.id : void 0;
172472
- const sourcePath = rootDirectory && !sourceFilesOutsideRootDirectory ? (0, import_path32.join)(cwd2, rootDirectory) : cwd2;
172437
+ const sourcePath = rootDirectory && !sourceFilesOutsideRootDirectory ? (0, import_path32.join)(cwd, rootDirectory) : cwd;
172473
172438
  if (rootDirectory && await validateRootDirectory(
172474
172439
  output2,
172475
- cwd2,
172440
+ cwd,
172476
172441
  sourcePath,
172477
172442
  project ? `To change your Project Settings, go to https://vercel.com/${org?.slug}/${project.name}/settings` : ""
172478
172443
  ) === false) {
172479
172444
  return 1;
172480
172445
  }
172481
172446
  if (rootDirectory) {
172482
- const rootDirectoryConfig = readLocalConfig((0, import_path32.join)(cwd2, rootDirectory));
172447
+ const rootDirectoryConfig = readLocalConfig((0, import_path32.join)(cwd, rootDirectory));
172483
172448
  if (rootDirectoryConfig) {
172484
172449
  debug3(`Read local config from root directory (${rootDirectory})`);
172485
172450
  localConfig = rootDirectoryConfig;
@@ -172539,7 +172504,7 @@ var init_deploy = __esm({
172539
172504
  parseMeta(localConfig.meta),
172540
172505
  parseMeta(argv2["--meta"])
172541
172506
  );
172542
- const gitMetadata = await createGitMeta(cwd2, output2, project);
172507
+ const gitMetadata = await createGitMeta(cwd, output2, project);
172543
172508
  const deploymentEnv = Object.assign(
172544
172509
  {},
172545
172510
  parseEnv(localConfig.env),
@@ -172614,7 +172579,7 @@ var init_deploy = __esm({
172614
172579
  createArgs,
172615
172580
  org,
172616
172581
  !project,
172617
- cwd2,
172582
+ cwd,
172618
172583
  archive
172619
172584
  );
172620
172585
  if (deployment.code === "missing_project_settings") {
@@ -172643,7 +172608,7 @@ var init_deploy = __esm({
172643
172608
  createArgs,
172644
172609
  org,
172645
172610
  false,
172646
- cwd2
172611
+ cwd
172647
172612
  );
172648
172613
  }
172649
172614
  if (deployment instanceof NotDomainOwner) {
@@ -184720,8 +184685,8 @@ var require_src3 = __commonJS2({
184720
184685
  sendError
184721
184686
  }, methods);
184722
184687
  module2.exports = async (request, response, config3 = {}, methods = {}) => {
184723
- const cwd2 = process.cwd();
184724
- const current = config3.public ? path11.resolve(cwd2, config3.public) : cwd2;
184688
+ const cwd = process.cwd();
184689
+ const current = config3.public ? path11.resolve(cwd, config3.public) : cwd;
184725
184690
  const handlers = getHandlers(methods);
184726
184691
  let relativePath = null;
184727
184692
  let acceptsJSON = null;
@@ -185772,7 +185737,7 @@ Please run \`${await getUpdateCommand()}\` to update to the latest CLI.`
185772
185737
  );
185773
185738
  }
185774
185739
  }
185775
- async function getBuildMatches(vercelConfig, cwd2, output2, devServer, fileList) {
185740
+ async function getBuildMatches(vercelConfig, cwd, output2, devServer, fileList) {
185776
185741
  const matches = [];
185777
185742
  if (fileList.length === 0) {
185778
185743
  return matches;
@@ -185780,7 +185745,7 @@ async function getBuildMatches(vercelConfig, cwd2, output2, devServer, fileList)
185780
185745
  const noMatches = [];
185781
185746
  const builds = vercelConfig.builds || [{ src: "**", use: "@vercel/static" }];
185782
185747
  const builderSpecs = new Set(builds.map((b) => b.use).filter(Boolean));
185783
- const buildersWithPkgs = await importBuilders(builderSpecs, cwd2, output2);
185748
+ const buildersWithPkgs = await importBuilders(builderSpecs, cwd, output2);
185784
185749
  for (const buildConfig of builds) {
185785
185750
  let { src = "**", use, config: config3 = {} } = buildConfig;
185786
185751
  if (!use) {
@@ -185795,12 +185760,12 @@ async function getBuildMatches(vercelConfig, cwd2, output2, devServer, fileList)
185795
185760
  mapToEntrypoint.set(extensionless, src);
185796
185761
  src = extensionless;
185797
185762
  }
185798
- const files = fileList.filter((name) => name === src || (0, import_minimatch3.default)(name, src, { dot: true })).map((name) => (0, import_path35.join)(cwd2, name));
185763
+ const files = fileList.filter((name) => name === src || (0, import_minimatch3.default)(name, src, { dot: true })).map((name) => (0, import_path35.join)(cwd, name));
185799
185764
  if (files.length === 0) {
185800
185765
  noMatches.push(buildConfig);
185801
185766
  }
185802
185767
  for (const file of files) {
185803
- src = relative6(cwd2, file);
185768
+ src = relative6(cwd, file);
185804
185769
  const entrypoint = mapToEntrypoint.get(src) || src;
185805
185770
  if (config3.zeroConfig && config3.outputDirectory) {
185806
185771
  const outputMatch = config3.outputDirectory + "/";
@@ -186222,9 +186187,9 @@ function proxyPass(req, res, dest, devServer, requestId, ignorePath = true) {
186222
186187
  }
186223
186188
  );
186224
186189
  }
186225
- function serveStaticFile(req, res, cwd2, opts) {
186190
+ function serveStaticFile(req, res, cwd, opts) {
186226
186191
  return (0, import_serve_handler.default)(req, res, {
186227
- public: cwd2,
186192
+ public: cwd,
186228
186193
  cleanUrls: false,
186229
186194
  etag: true,
186230
186195
  ...opts
@@ -186481,7 +186446,7 @@ var init_server = __esm({
186481
186446
  import_frameworks5.default.map((f) => f.useRuntime?.use || "@vercel/static-build")
186482
186447
  );
186483
186448
  DevServer = class {
186484
- constructor(cwd2, options) {
186449
+ constructor(cwd, options) {
186485
186450
  this.clearVercelConfigPromise = () => {
186486
186451
  this.getVercelConfigPromise = null;
186487
186452
  };
@@ -187126,8 +187091,8 @@ Please ensure that ${cmd(err.path)} is properly installed`;
187126
187091
  await this.sendError(req, res, requestId, "UNKNOWN_ASSET_TYPE");
187127
187092
  }
187128
187093
  };
187129
- this.cwd = cwd2;
187130
- this.repoRoot = options.repoRoot ?? cwd2;
187094
+ this.cwd = cwd;
187095
+ this.repoRoot = options.repoRoot ?? cwd;
187131
187096
  this.output = options.output;
187132
187097
  this.envConfigs = { buildEnv: {}, runEnv: {}, allEnv: {} };
187133
187098
  this.envValues = options.envValues || {};
@@ -187150,7 +187115,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
187150
187115
  this.stopping = false;
187151
187116
  this.buildMatches = /* @__PURE__ */ new Map();
187152
187117
  this.inProgressBuilds = /* @__PURE__ */ new Map();
187153
- this.devCacheDir = (0, import_path36.join)(getVercelDirectory(cwd2), "cache");
187118
+ this.devCacheDir = (0, import_path36.join)(getVercelDirectory(cwd), "cache");
187154
187119
  this.vercelConfigWarning = false;
187155
187120
  this.getVercelConfigPromise = null;
187156
187121
  this.blockingBuildsPromise = null;
@@ -188061,7 +188026,7 @@ ${error_code}
188061
188026
  return this.caseSensitive;
188062
188027
  }
188063
188028
  async runDevCommand() {
188064
- const { devCommand: devCommand2, cwd: cwd2 } = this;
188029
+ const { devCommand: devCommand2, cwd } = this;
188065
188030
  if (devCommand2 === this.currentDevCommand) {
188066
188031
  return;
188067
188032
  }
@@ -188092,13 +188057,13 @@ ${error_code}
188092
188057
  PORT: `${port}`
188093
188058
  }
188094
188059
  );
188095
- const nodeBinPaths = (0, import_build_utils17.getNodeBinPaths)({ base: this.repoRoot, start: cwd2 });
188060
+ const nodeBinPaths = (0, import_build_utils17.getNodeBinPaths)({ base: this.repoRoot, start: cwd });
188096
188061
  const nodeBinPath = nodeBinPaths.join(import_path36.default.delimiter);
188097
188062
  env.PATH = `${nodeBinPath}${import_path36.default.delimiter}${env.PATH}`;
188098
188063
  let command = devCommand2.replace(/\$PORT/g, `${port}`).replace(/%PORT%/g, `${port}`);
188099
188064
  this.output.debug(
188100
188065
  `Starting dev command with parameters: ${JSON.stringify({
188101
- cwd: cwd2,
188066
+ cwd,
188102
188067
  command,
188103
188068
  port
188104
188069
  })}`
@@ -188107,7 +188072,7 @@ ${error_code}
188107
188072
  const proxyPort = new RegExp(port.toString(), "g");
188108
188073
  const p = (0, import_build_utils17.spawnCommand)(command, {
188109
188074
  stdio: ["inherit", "pipe", "pipe"],
188110
- cwd: cwd2,
188075
+ cwd,
188111
188076
  env
188112
188077
  });
188113
188078
  this.devProcess = p;
@@ -188137,11 +188102,11 @@ ${error_code}
188137
188102
  async function dev(client2, opts, args2) {
188138
188103
  const { output: output2 } = client2;
188139
188104
  const [dir = "."] = args2;
188140
- let cwd2 = (0, import_path37.resolve)(dir);
188105
+ let cwd = (0, import_path37.resolve)(dir);
188141
188106
  const listen4 = parseListen(opts["--listen"] || "3000");
188142
- let link4 = await getLinkedProject(client2, cwd2);
188107
+ let link4 = await getLinkedProject(client2, cwd);
188143
188108
  if (link4.status === "not_linked" && !process.env.__VERCEL_SKIP_DEV_CMD) {
188144
- link4 = await setupAndLink(client2, cwd2, {
188109
+ link4 = await setupAndLink(client2, cwd, {
188145
188110
  autoConfirm: opts["--yes"],
188146
188111
  link: link4,
188147
188112
  successEmoji: "link",
@@ -188167,16 +188132,16 @@ async function dev(client2, opts, args2) {
188167
188132
  if (link4.status === "linked") {
188168
188133
  const { project, org } = link4;
188169
188134
  if (link4.repoRoot) {
188170
- repoRoot = cwd2 = link4.repoRoot;
188135
+ repoRoot = cwd = link4.repoRoot;
188171
188136
  }
188172
188137
  client2.config.currentTeam = org.type === "team" ? org.id : void 0;
188173
188138
  projectSettings = project;
188174
188139
  if (project.rootDirectory) {
188175
- cwd2 = (0, import_path37.join)(cwd2, project.rootDirectory);
188140
+ cwd = (0, import_path37.join)(cwd, project.rootDirectory);
188176
188141
  }
188177
188142
  envValues = (await pullEnvRecords(output2, client2, project.id, "vercel-cli:dev")).env;
188178
188143
  }
188179
- const devServer = new DevServer(cwd2, {
188144
+ const devServer = new DevServer(cwd, {
188180
188145
  output: output2,
188181
188146
  projectSettings,
188182
188147
  envValues,
@@ -188184,7 +188149,7 @@ async function dev(client2, opts, args2) {
188184
188149
  });
188185
188150
  process.on("SIGTERM", () => devServer.stop());
188186
188151
  if (!devServer.devCommand) {
188187
- const outputDir = (0, import_path37.join)(cwd2, OUTPUT_DIR);
188152
+ const outputDir = (0, import_path37.join)(cwd, OUTPUT_DIR);
188188
188153
  if (await import_fs_extra22.default.pathExists(outputDir)) {
188189
188154
  output2.log(`Removing ${OUTPUT_DIR}`);
188190
188155
  await import_fs_extra22.default.remove(outputDir);
@@ -191973,7 +191938,7 @@ async function main6(client2) {
191973
191938
  }
191974
191939
  const subArgs = argv2._.slice(1);
191975
191940
  const { subcommand: subcommand2, args: args2 } = getSubcommand(subArgs, COMMAND_CONFIG6);
191976
- const { cwd: cwd2, output: output2, config: config3 } = client2;
191941
+ const { cwd, output: output2, config: config3 } = client2;
191977
191942
  const target = argv2["--environment"]?.toLowerCase() || "development";
191978
191943
  if (!isValidEnvTarget(target)) {
191979
191944
  output2.error(
@@ -191983,7 +191948,7 @@ async function main6(client2) {
191983
191948
  );
191984
191949
  return 1;
191985
191950
  }
191986
- const link4 = await getLinkedProject(client2, cwd2);
191951
+ const link4 = await getLinkedProject(client2, cwd);
191987
191952
  if (link4.status === "error") {
191988
191953
  return link4.exitCode;
191989
191954
  } else if (link4.status === "not_linked") {
@@ -192012,7 +191977,7 @@ async function main6(client2) {
192012
191977
  argv2,
192013
191978
  args2,
192014
191979
  output2,
192015
- cwd2,
191980
+ cwd,
192016
191981
  "vercel-cli:env:pull"
192017
191982
  );
192018
191983
  default:
@@ -192053,7 +192018,7 @@ var init_env = __esm({
192053
192018
 
192054
192019
  // src/commands/git/connect.ts
192055
192020
  async function connect(client2, argv2, args2, project, org) {
192056
- const { cwd: cwd2, output: output2 } = client2;
192021
+ const { cwd, output: output2 } = client2;
192057
192022
  const confirm2 = Boolean(argv2["--yes"]);
192058
192023
  const repoArg = argv2._[1];
192059
192024
  if (args2.length > 1) {
@@ -192074,7 +192039,7 @@ async function connect(client2, argv2, args2, project, org) {
192074
192039
  }
192075
192040
  const gitProviderLink = project.link;
192076
192041
  client2.config.currentTeam = org.type === "team" ? org.id : void 0;
192077
- const gitConfigPath = (0, import_path41.join)(cwd2, ".git/config");
192042
+ const gitConfigPath = (0, import_path41.join)(cwd, ".git/config");
192078
192043
  const gitConfig = await parseGitConfig(gitConfigPath, output2);
192079
192044
  if (repoArg) {
192080
192045
  const parsedUrlArg = parseRepoUrl(repoArg);
@@ -192529,8 +192494,8 @@ async function main7(client2) {
192529
192494
  subcommand2 = argv2._[0];
192530
192495
  const args2 = argv2._.slice(1);
192531
192496
  const autoConfirm = Boolean(argv2["--yes"]);
192532
- const { cwd: cwd2, output: output2 } = client2;
192533
- const linkedProject = await ensureLink("git", client2, cwd2, { autoConfirm });
192497
+ const { cwd, output: output2 } = client2;
192498
+ const linkedProject = await ensureLink("git", client2, cwd, { autoConfirm });
192534
192499
  if (typeof linkedProject === "number") {
192535
192500
  return linkedProject;
192536
192501
  }
@@ -192784,8 +192749,8 @@ ${deployHint}`);
192784
192749
  throw e2;
192785
192750
  });
192786
192751
  }
192787
- function prepareFolder(cwd2, folder, force) {
192788
- const dest = import_path42.default.join(cwd2, folder);
192752
+ function prepareFolder(cwd, folder, force) {
192753
+ const dest = import_path42.default.join(cwd, folder);
192789
192754
  if (import_fs8.default.existsSync(dest)) {
192790
192755
  if (!import_fs8.default.lstatSync(dest).isDirectory()) {
192791
192756
  throw new Error(
@@ -192803,7 +192768,7 @@ function prepareFolder(cwd2, folder, force) {
192803
192768
  )} or ${cmd("-f")} to override it.`
192804
192769
  );
192805
192770
  }
192806
- } else if (dest !== cwd2) {
192771
+ } else if (dest !== cwd) {
192807
192772
  try {
192808
192773
  import_fs8.default.mkdirSync(dest);
192809
192774
  } catch (e2) {
@@ -193591,23 +193556,23 @@ async function link3(client2) {
193591
193556
  argv2["--yes"] = argv2["--confirm"];
193592
193557
  }
193593
193558
  const yes = !!argv2["--yes"];
193594
- let cwd2 = argv2._[1];
193595
- if (cwd2) {
193559
+ let cwd = argv2._[1];
193560
+ if (cwd) {
193596
193561
  client2.output.warn(
193597
193562
  `The ${cmd("vc link <directory>")} syntax is deprecated, please use ${cmd(
193598
- `vc link --cwd ${cwd2}`
193563
+ `vc link --cwd ${cwd}`
193599
193564
  )} instead`
193600
193565
  );
193601
193566
  } else {
193602
- cwd2 = client2.cwd;
193567
+ cwd = client2.cwd;
193603
193568
  }
193604
193569
  if (argv2["--repo"]) {
193605
193570
  client2.output.warn(
193606
193571
  `The ${cmd("--repo")} flag is in alpha, please report issues`
193607
193572
  );
193608
- await ensureRepoLink(client2, cwd2, { yes, overwrite: true });
193573
+ await ensureRepoLink(client2, cwd, { yes, overwrite: true });
193609
193574
  } else {
193610
- const link4 = await ensureLink("link", client2, cwd2, {
193575
+ const link4 = await ensureLink("link", client2, cwd, {
193611
193576
  autoConfirm: yes,
193612
193577
  forceDelete: true,
193613
193578
  projectName: argv2["--project"],
@@ -193725,7 +193690,7 @@ async function list2(client2) {
193725
193690
  handleError(err);
193726
193691
  return 1;
193727
193692
  }
193728
- const { cwd: cwd2, output: output2, config: config3 } = client2;
193693
+ const { cwd, output: output2, config: config3 } = client2;
193729
193694
  if ("--confirm" in argv2) {
193730
193695
  output2.warn("`--confirm` is deprecated, please use `--yes` instead");
193731
193696
  argv2["--yes"] = argv2["--confirm"];
@@ -193742,7 +193707,7 @@ async function list2(client2) {
193742
193707
  const autoConfirm = !!argv2["--yes"];
193743
193708
  const meta = parseMeta(argv2["--meta"]);
193744
193709
  const target = argv2["--prod"] ? "production" : typeof argv2["--environment"] === "string" ? argv2["--environment"].toLowerCase() : void 0;
193745
- let link4 = await getLinkedProject(client2, cwd2);
193710
+ let link4 = await getLinkedProject(client2, cwd);
193746
193711
  if (link4.status === "error") {
193747
193712
  return link4.exitCode;
193748
193713
  }
@@ -193755,7 +193720,7 @@ async function list2(client2) {
193755
193720
  return 1;
193756
193721
  }
193757
193722
  if (status === "not_linked" && !app) {
193758
- const linkedProject = await ensureLink("list", client2, cwd2, {
193723
+ const linkedProject = await ensureLink("list", client2, cwd, {
193759
193724
  autoConfirm,
193760
193725
  link: link4
193761
193726
  });
@@ -195152,7 +195117,7 @@ async function getProjectByCwdOrLink({
195152
195117
  autoConfirm,
195153
195118
  client: client2,
195154
195119
  commandName,
195155
- cwd: cwd2,
195120
+ cwd,
195156
195121
  projectNameOrId
195157
195122
  }) {
195158
195123
  if (projectNameOrId) {
@@ -195162,7 +195127,7 @@ async function getProjectByCwdOrLink({
195162
195127
  }
195163
195128
  return project;
195164
195129
  }
195165
- const linkedProject = await ensureLink(commandName, client2, cwd2, {
195130
+ const linkedProject = await ensureLink(commandName, client2, cwd, {
195166
195131
  autoConfirm
195167
195132
  });
195168
195133
  if (typeof linkedProject === "number") {
@@ -198501,16 +198466,16 @@ function createProxy(client2) {
198501
198466
  }
198502
198467
 
198503
198468
  // src/util/extension/exec.ts
198504
- async function execExtension(client2, name, args2, cwd2) {
198469
+ async function execExtension(client2, name, args2, cwd) {
198505
198470
  const { debug: debug3 } = client2.output;
198506
198471
  const extensionCommand = `vercel-${name}`;
198507
- const { packageJsonPath, lockfilePath } = await (0, import_build_utils4.scanParentDirs)(cwd2);
198472
+ const { packageJsonPath, lockfilePath } = await (0, import_build_utils4.scanParentDirs)(cwd);
198508
198473
  const baseFile = lockfilePath || packageJsonPath;
198509
198474
  let extensionPath = null;
198510
198475
  if (baseFile) {
198511
198476
  extensionPath = await (0, import_build_utils4.walkParentDirs)({
198512
198477
  base: (0, import_path8.dirname)(baseFile),
198513
- start: cwd2,
198478
+ start: cwd,
198514
198479
  filename: `node_modules/.bin/${extensionCommand}`
198515
198480
  });
198516
198481
  }
@@ -198530,7 +198495,7 @@ async function execExtension(client2, name, args2, cwd2) {
198530
198495
  const VERCEL_API = proxyUrl.href.replace(/\/$/, "");
198531
198496
  debug3(`extension proxy server listening at ${VERCEL_API}`);
198532
198497
  const result = await (0, import_execa.default)(extensionPath, args2, {
198533
- cwd: cwd2,
198498
+ cwd,
198534
198499
  reject: false,
198535
198500
  stdio: "inherit",
198536
198501
  env: {
@@ -198830,10 +198795,10 @@ var main13 = async () => {
198830
198795
  if (argv2["--cwd"]) {
198831
198796
  client.cwd = argv2["--cwd"];
198832
198797
  }
198833
- const { cwd: cwd2 } = client;
198798
+ const { cwd } = client;
198834
198799
  let subcommand2 = void 0;
198835
198800
  if (targetOrSubcommand) {
198836
- const targetPath = (0, import_path43.join)(cwd2, targetOrSubcommand);
198801
+ const targetPath = (0, import_path43.join)(cwd, targetOrSubcommand);
198837
198802
  const targetPathExists = (0, import_fs9.existsSync)(targetPath);
198838
198803
  const subcommandExists = GLOBAL_COMMANDS.has(targetOrSubcommand) || commands_default.has(targetOrSubcommand);
198839
198804
  if (targetPathExists && subcommandExists && !argv2["--cwd"] && !process.env.NOW_BUILDER) {
@@ -198981,7 +198946,7 @@ var main13 = async () => {
198981
198946
  client,
198982
198947
  targetCommand,
198983
198948
  argv2._.slice(3),
198984
- cwd2
198949
+ cwd
198985
198950
  );
198986
198951
  } catch (err) {
198987
198952
  if ((0, import_error_utils33.isErrnoException)(err) && err.code === "ENOENT") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "32.6.0",
3
+ "version": "32.6.1",
4
4
  "preferGlobal": true,
5
5
  "license": "Apache-2.0",
6
6
  "description": "The command-line interface for Vercel",