vercel 39.0.2 → 39.0.4

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 +293 -390
  2. package/package.json +10 -10
package/dist/index.js CHANGED
@@ -95,7 +95,7 @@ var require_dist2 = __commonJS2({
95
95
  var src_exports2 = {};
96
96
  __export4(src_exports2, {
97
97
  errorToString: () => errorToString13,
98
- isErrnoException: () => isErrnoException20,
98
+ isErrnoException: () => isErrnoException19,
99
99
  isError: () => isError14,
100
100
  isErrorLike: () => isErrorLike,
101
101
  isObject: () => isObject2,
@@ -108,7 +108,7 @@ var require_dist2 = __commonJS2({
108
108
  var isError14 = (error3) => {
109
109
  return import_node_util.default.types.isNativeError(error3);
110
110
  };
111
- var isErrnoException20 = (error3) => {
111
+ var isErrnoException19 = (error3) => {
112
112
  return isError14(error3) && "code" in error3;
113
113
  };
114
114
  var isErrorLike = (error3) => isObject2(error3) && "message" in error3;
@@ -126,7 +126,7 @@ var require_dist2 = __commonJS2({
126
126
  return isErrorLike(error3) ? Object.assign(new Error(errorMessage), error3) : new Error(errorMessage);
127
127
  };
128
128
  function isSpawnError2(v) {
129
- return isErrnoException20(v) && "spawnargs" in v;
129
+ return isErrnoException19(v) && "spawnargs" in v;
130
130
  }
131
131
  }
132
132
  });
@@ -16519,11 +16519,11 @@ var require_dist9 = __commonJS2({
16519
16519
  getPackageJSON: () => getPackageJSON2
16520
16520
  });
16521
16521
  module2.exports = __toCommonJS4(src_exports2);
16522
- var import_fs10 = __toESM4(require("fs"));
16523
- var import_path43 = __toESM4(require("path"));
16522
+ var import_fs9 = __toESM4(require("fs"));
16523
+ var import_path42 = __toESM4(require("path"));
16524
16524
  var cache = /* @__PURE__ */ new Map();
16525
16525
  function getPackageJSONPath(dir) {
16526
- return import_path43.default.join(dir, "package.json");
16526
+ return import_path42.default.join(dir, "package.json");
16527
16527
  }
16528
16528
  function captureCallerCallSite() {
16529
16529
  const _prepareStackTrace = Error.prepareStackTrace;
@@ -16540,15 +16540,15 @@ var require_dist9 = __commonJS2({
16540
16540
  function getPackageJSON2() {
16541
16541
  const callSite = captureCallerCallSite();
16542
16542
  const filePath = callSite.getFileName() || callSite.getEvalOrigin();
16543
- let rootDir = import_path43.default.dirname(filePath);
16543
+ let rootDir = import_path42.default.dirname(filePath);
16544
16544
  let packageJSONPath = getPackageJSONPath(rootDir);
16545
- while (!import_fs10.default.existsSync(packageJSONPath)) {
16546
- rootDir = import_path43.default.join(rootDir, "..");
16545
+ while (!import_fs9.default.existsSync(packageJSONPath)) {
16546
+ rootDir = import_path42.default.join(rootDir, "..");
16547
16547
  packageJSONPath = getPackageJSONPath(rootDir);
16548
16548
  }
16549
16549
  let packageJSON = cache.get(packageJSONPath);
16550
16550
  if (!packageJSON) {
16551
- packageJSON = JSON.parse(import_fs10.default.readFileSync(packageJSONPath, "utf-8"));
16551
+ packageJSON = JSON.parse(import_fs9.default.readFileSync(packageJSONPath, "utf-8"));
16552
16552
  cache.set(packageJSONPath, packageJSON);
16553
16553
  }
16554
16554
  return packageJSON;
@@ -33587,7 +33587,7 @@ var require_package = __commonJS2({
33587
33587
  "../client/package.json"(exports2, module2) {
33588
33588
  module2.exports = {
33589
33589
  name: "@vercel/client",
33590
- version: "13.4.16",
33590
+ version: "13.4.17",
33591
33591
  main: "dist/index.js",
33592
33592
  typings: "dist/index.d.ts",
33593
33593
  homepage: "https://vercel.com",
@@ -33625,7 +33625,7 @@ var require_package = __commonJS2({
33625
33625
  },
33626
33626
  dependencies: {
33627
33627
  "@vercel/build-utils": "8.4.12",
33628
- "@vercel/error-utils": "2.0.2",
33628
+ "@vercel/error-utils": "2.0.3",
33629
33629
  "@vercel/routing-utils": "3.1.0",
33630
33630
  "async-retry": "1.2.3",
33631
33631
  "async-sema": "3.0.0",
@@ -34471,8 +34471,8 @@ var require_readdir_recursive = __commonJS2({
34471
34471
  default: () => readdir2
34472
34472
  });
34473
34473
  module2.exports = __toCommonJS4(readdir_recursive_exports);
34474
- var import_fs10 = __toESM4(require("fs"));
34475
- var import_path43 = __toESM4(require("path"));
34474
+ var import_fs9 = __toESM4(require("fs"));
34475
+ var import_path42 = __toESM4(require("path"));
34476
34476
  var import_minimatch5 = __toESM4(require_minimatch());
34477
34477
  function patternMatcher(pattern) {
34478
34478
  return function(path11, stats) {
@@ -34491,7 +34491,7 @@ var require_readdir_recursive = __commonJS2({
34491
34491
  ignores = ignores.map(toMatcherFunction);
34492
34492
  let list7 = [];
34493
34493
  return new Promise(function(resolve12, reject) {
34494
- import_fs10.default.readdir(path11, function(err, files) {
34494
+ import_fs9.default.readdir(path11, function(err, files) {
34495
34495
  if (err) {
34496
34496
  return reject(err);
34497
34497
  }
@@ -34500,8 +34500,8 @@ var require_readdir_recursive = __commonJS2({
34500
34500
  return resolve12(list7);
34501
34501
  }
34502
34502
  files.forEach(function(file) {
34503
- const filePath = import_path43.default.join(path11, file);
34504
- import_fs10.default.lstat(filePath, function(_err, stats) {
34503
+ const filePath = import_path42.default.join(path11, file);
34504
+ import_fs9.default.lstat(filePath, function(_err, stats) {
34505
34505
  if (_err) {
34506
34506
  return reject(_err);
34507
34507
  }
@@ -34584,11 +34584,11 @@ var require_utils4 = __commonJS2({
34584
34584
  });
34585
34585
  module2.exports = __toCommonJS4(utils_exports);
34586
34586
  var import_node_fetch6 = __toESM4(require_lib7());
34587
- var import_path43 = require("path");
34587
+ var import_path42 = require("path");
34588
34588
  var import_url23 = require("url");
34589
34589
  var import_ignore = __toESM4(require_ignore());
34590
34590
  var import_pkg5 = require_pkg();
34591
- var import_build_utils18 = require("@vercel/build-utils");
34591
+ var import_build_utils20 = require("@vercel/build-utils");
34592
34592
  var import_async_sema = require_lib9();
34593
34593
  var import_fs_extra24 = require_lib8();
34594
34594
  var import_readdir_recursive = __toESM4(require_readdir_recursive());
@@ -34654,7 +34654,7 @@ var require_utils4 = __commonJS2({
34654
34654
  debug2("Building file tree...");
34655
34655
  if (isDirectory2 && !Array.isArray(path11)) {
34656
34656
  const ignores2 = (absPath) => {
34657
- const rel = (0, import_path43.relative)(path11, absPath);
34657
+ const rel = (0, import_path42.relative)(path11, absPath);
34658
34658
  const ignored = ig.ignores(rel);
34659
34659
  if (ignored) {
34660
34660
  ignoreList.push(rel);
@@ -34665,7 +34665,7 @@ var require_utils4 = __commonJS2({
34665
34665
  if (prebuilt) {
34666
34666
  const refs = /* @__PURE__ */ new Set();
34667
34667
  const vcConfigFilePaths = fileList.filter(
34668
- (file) => (0, import_path43.basename)(file) === ".vc-config.json"
34668
+ (file) => (0, import_path42.basename)(file) === ".vc-config.json"
34669
34669
  );
34670
34670
  await Promise.all(
34671
34671
  vcConfigFilePaths.map(async (p) => {
@@ -34674,7 +34674,7 @@ var require_utils4 = __commonJS2({
34674
34674
  if (!config2.filePathMap)
34675
34675
  return;
34676
34676
  for (const v of Object.values(config2.filePathMap)) {
34677
- refs.add((0, import_path43.join)(path11, v));
34677
+ refs.add((0, import_path42.join)(path11, v));
34678
34678
  }
34679
34679
  })
34680
34680
  );
@@ -34704,9 +34704,9 @@ var require_utils4 = __commonJS2({
34704
34704
  if (typeof cwd !== "string") {
34705
34705
  throw new Error(`\`cwd\` must be a "string"`);
34706
34706
  }
34707
- const relOutputDir = (0, import_path43.relative)(cwd, vercelOutputDir);
34707
+ const relOutputDir = (0, import_path42.relative)(cwd, vercelOutputDir);
34708
34708
  ignores = ["*"];
34709
- const parts = relOutputDir.split(import_path43.sep);
34709
+ const parts = relOutputDir.split(import_path42.sep);
34710
34710
  parts.forEach((_, i) => {
34711
34711
  const level = parts.slice(0, i + 1).join("/");
34712
34712
  ignores.push(`!${level}`);
@@ -34744,11 +34744,11 @@ var require_utils4 = __commonJS2({
34744
34744
  const files = await Promise.all(
34745
34745
  cwds.map(async (cwd2) => {
34746
34746
  const [vercelignore, nowignore] = await Promise.all([
34747
- maybeRead((0, import_path43.join)(cwd2, ".vercelignore"), ""),
34748
- maybeRead((0, import_path43.join)(cwd2, ".nowignore"), "")
34747
+ maybeRead((0, import_path42.join)(cwd2, ".vercelignore"), ""),
34748
+ maybeRead((0, import_path42.join)(cwd2, ".nowignore"), "")
34749
34749
  ]);
34750
34750
  if (vercelignore && nowignore) {
34751
- throw new import_build_utils18.NowBuildError({
34751
+ throw new import_build_utils20.NowBuildError({
34752
34752
  code: "CONFLICTING_IGNORE_FILES",
34753
34753
  message: "Cannot use both a `.vercelignore` and `.nowignore` file. Please delete the `.nowignore` file.",
34754
34754
  link: "https://vercel.link/combining-old-and-new-config"
@@ -34804,9 +34804,9 @@ ${clearRelative(ignoreFile)}`);
34804
34804
  for (const name of file.names) {
34805
34805
  let fileName;
34806
34806
  if (clientOptions.isDirectory) {
34807
- fileName = typeof clientOptions.path === "string" ? (0, import_path43.relative)(clientOptions.path, name) : name;
34807
+ fileName = typeof clientOptions.path === "string" ? (0, import_path42.relative)(clientOptions.path, name) : name;
34808
34808
  } else {
34809
- const segments = name.split(import_path43.sep);
34809
+ const segments = name.split(import_path42.sep);
34810
34810
  fileName = segments[segments.length - 1];
34811
34811
  }
34812
34812
  preparedFiles.push({
@@ -35394,7 +35394,7 @@ var require_upload = __commonJS2({
35394
35394
  var import_async_retry6 = __toESM4(require_lib10());
35395
35395
  var import_async_sema = require_lib9();
35396
35396
  var import_utils4 = require_utils4();
35397
- var import_errors6 = require_errors();
35397
+ var import_errors7 = require_errors();
35398
35398
  var import_deploy2 = require_deploy();
35399
35399
  var isClientNetworkError = (err) => {
35400
35400
  if (err.message) {
@@ -35504,11 +35504,11 @@ var require_upload = __commonJS2({
35504
35504
  `An internal error occurred in upload request. Not retrying...`
35505
35505
  );
35506
35506
  const { error: error3 } = await res.json();
35507
- err = new import_errors6.DeploymentError(error3);
35507
+ err = new import_errors7.DeploymentError(error3);
35508
35508
  } else {
35509
35509
  debug2(`A server error occurred in upload request. Retrying...`);
35510
35510
  const { error: error3 } = await res.json();
35511
- throw new import_errors6.DeploymentError(error3);
35511
+ throw new import_errors7.DeploymentError(error3);
35512
35512
  }
35513
35513
  } catch (e2) {
35514
35514
  debug2(`An unexpected error occurred in upload promise:
@@ -39747,13 +39747,13 @@ var require_create_deployment = __commonJS2({
39747
39747
  });
39748
39748
  module2.exports = __toCommonJS4(create_deployment_exports);
39749
39749
  var import_fs_extra24 = require_lib8();
39750
- var import_path43 = require("path");
39750
+ var import_path42 = require("path");
39751
39751
  var import_hashes = require_hashes();
39752
39752
  var import_upload = require_upload();
39753
39753
  var import_utils4 = require_utils4();
39754
- var import_errors6 = require_errors();
39754
+ var import_errors7 = require_errors();
39755
39755
  var import_error_utils35 = require_dist2();
39756
- var import_build_utils18 = require("@vercel/build-utils");
39756
+ var import_build_utils20 = require("@vercel/build-utils");
39757
39757
  var import_tar_fs2 = __toESM4(require_tar_fs());
39758
39758
  var import_zlib = require("zlib");
39759
39759
  function buildCreateDeployment() {
@@ -39765,7 +39765,7 @@ var require_create_deployment = __commonJS2({
39765
39765
  debug2(
39766
39766
  `Error: 'path' is expected to be a string or an array. Received ${typeof path11}`
39767
39767
  );
39768
- throw new import_errors6.DeploymentError({
39768
+ throw new import_errors7.DeploymentError({
39769
39769
  code: "missing_path",
39770
39770
  message: "Path not provided"
39771
39771
  });
@@ -39774,7 +39774,7 @@ var require_create_deployment = __commonJS2({
39774
39774
  debug2(
39775
39775
  `Error: 'token' is expected to be a string. Received ${typeof clientOptions.token}`
39776
39776
  );
39777
- throw new import_errors6.DeploymentError({
39777
+ throw new import_errors7.DeploymentError({
39778
39778
  code: "token_not_provided",
39779
39779
  message: "Options object must include a `token`"
39780
39780
  });
@@ -39782,15 +39782,15 @@ var require_create_deployment = __commonJS2({
39782
39782
  clientOptions.isDirectory = !Array.isArray(path11) && (0, import_fs_extra24.lstatSync)(path11).isDirectory();
39783
39783
  if (Array.isArray(path11)) {
39784
39784
  for (const filePath of path11) {
39785
- if (!(0, import_path43.isAbsolute)(filePath)) {
39786
- throw new import_errors6.DeploymentError({
39785
+ if (!(0, import_path42.isAbsolute)(filePath)) {
39786
+ throw new import_errors7.DeploymentError({
39787
39787
  code: "invalid_path",
39788
39788
  message: `Provided path ${filePath} is not absolute`
39789
39789
  });
39790
39790
  }
39791
39791
  }
39792
- } else if (!(0, import_path43.isAbsolute)(path11)) {
39793
- throw new import_errors6.DeploymentError({
39792
+ } else if (!(0, import_path42.isAbsolute)(path11)) {
39793
+ throw new import_errors7.DeploymentError({
39794
39794
  code: "invalid_path",
39795
39795
  message: `Provided path ${path11} is not absolute`
39796
39796
  });
@@ -39816,15 +39816,15 @@ var require_create_deployment = __commonJS2({
39816
39816
  if (clientOptions.archive === "tgz") {
39817
39817
  debug2("Packing tarball");
39818
39818
  const tarStream = import_tar_fs2.default.pack(workPath, {
39819
- entries: fileList.map((file) => (0, import_path43.relative)(workPath, file))
39819
+ entries: fileList.map((file) => (0, import_path42.relative)(workPath, file))
39820
39820
  }).pipe((0, import_zlib.createGzip)());
39821
- const tarBuffer = await (0, import_build_utils18.streamToBuffer)(tarStream);
39821
+ const tarBuffer = await (0, import_build_utils20.streamToBuffer)(tarStream);
39822
39822
  debug2("Packed tarball");
39823
39823
  files = /* @__PURE__ */ new Map([
39824
39824
  [
39825
39825
  (0, import_hashes.hash)(tarBuffer),
39826
39826
  {
39827
- names: [(0, import_path43.join)(workPath, ".vercel/source.tgz")],
39827
+ names: [(0, import_path42.join)(workPath, ".vercel/source.tgz")],
39828
39828
  data: tarBuffer,
39829
39829
  mode: 438
39830
39830
  }
@@ -39835,9 +39835,9 @@ var require_create_deployment = __commonJS2({
39835
39835
  }
39836
39836
  } catch (err) {
39837
39837
  if (clientOptions.prebuilt && (0, import_error_utils35.isErrnoException)(err) && err.code === "ENOENT" && err.path) {
39838
- const errPath = (0, import_path43.relative)(workPath, err.path);
39839
- err.message = `File does not exist: "${(0, import_path43.relative)(workPath, errPath)}"`;
39840
- if (errPath.split(import_path43.sep).includes("node_modules")) {
39838
+ const errPath = (0, import_path42.relative)(workPath, err.path);
39839
+ err.message = `File does not exist: "${(0, import_path42.relative)(workPath, errPath)}"`;
39840
+ if (errPath.split(import_path42.sep).includes("node_modules")) {
39841
39841
  err.message = `Please ensure project dependencies have been installed:
39842
39842
  ${err.message}`;
39843
39843
  }
@@ -39889,12 +39889,12 @@ var require_types = __commonJS2({
39889
39889
  __export4(types_exports, {
39890
39890
  DeploymentEventType: () => import_utils4.DeploymentEventType,
39891
39891
  VALID_ARCHIVE_FORMATS: () => VALID_ARCHIVE_FORMATS4,
39892
- fileNameSymbol: () => fileNameSymbol8
39892
+ fileNameSymbol: () => fileNameSymbol9
39893
39893
  });
39894
39894
  module2.exports = __toCommonJS4(types_exports);
39895
39895
  var import_utils4 = require_utils4();
39896
39896
  var VALID_ARCHIVE_FORMATS4 = ["tgz"];
39897
- var fileNameSymbol8 = Symbol("fileName");
39897
+ var fileNameSymbol9 = Symbol("fileName");
39898
39898
  }
39899
39899
  });
39900
39900
 
@@ -72554,7 +72554,7 @@ var import_blob_polyfill = __toESM(require_Blob());
72554
72554
  });
72555
72555
 
72556
72556
  // src/util/telemetry/index.ts
72557
- var import_node_crypto, import_node_os, import_node_child_process, import_constants2, LogLabel, TelemetryClient, TelemetryEventStore;
72557
+ var import_node_crypto, import_node_os, import_node_child_process, import_constants2, import_build_utils4, LogLabel, TelemetryClient, TelemetryEventStore;
72558
72558
  var init_telemetry = __esm({
72559
72559
  "src/util/telemetry/index.ts"() {
72560
72560
  "use strict";
@@ -72563,6 +72563,7 @@ var init_telemetry = __esm({
72563
72563
  init_output_manager();
72564
72564
  import_node_child_process = require("child_process");
72565
72565
  import_constants2 = __toESM3(require_dist10());
72566
+ import_build_utils4 = require("@vercel/build-utils");
72566
72567
  LogLabel = `['telemetry']:`;
72567
72568
  TelemetryClient = class {
72568
72569
  constructor({ opts }) {
@@ -72765,9 +72766,13 @@ var init_telemetry = __esm({
72765
72766
  "flush",
72766
72767
  JSON.stringify(payload)
72767
72768
  ];
72769
+ const env = (0, import_build_utils4.cloneEnv)(process.env, {
72770
+ VERCEL_TELEMETRY_DISABLED: "1"
72771
+ });
72768
72772
  if (outputDebugEnabled) {
72769
72773
  return new Promise((resolve12) => {
72770
72774
  const childProcess = (0, import_node_child_process.spawn)(nodeBinaryPath, script, {
72775
+ env,
72771
72776
  stdio: ["ignore", "pipe", "pipe"]
72772
72777
  });
72773
72778
  childProcess.stderr.on("data", (data) => output_manager_default.debug(data.toString()));
@@ -72775,18 +72780,21 @@ var init_telemetry = __esm({
72775
72780
  childProcess.on("error", (d) => {
72776
72781
  output_manager_default.debug(d);
72777
72782
  });
72778
- setTimeout(() => {
72783
+ const timeout = setTimeout(() => {
72784
+ output_manager_default.debug("Telemetry subprocess killed due to timeout");
72779
72785
  childProcess.kill();
72780
72786
  }, 2e3);
72781
- childProcess.on("exit", () => {
72782
- output_manager_default.debug("Telemetry subprocess exited");
72787
+ childProcess.on("exit", (code2) => {
72788
+ output_manager_default.debug(`Telemetry subprocess exited with code ${code2}`);
72783
72789
  childProcess.unref();
72790
+ timeout.unref();
72784
72791
  resolve12();
72785
72792
  });
72786
72793
  });
72787
72794
  } else {
72788
72795
  const childProcess = (0, import_node_child_process.spawn)(nodeBinaryPath, script, {
72789
72796
  stdio: "ignore",
72797
+ env,
72790
72798
  windowsHide: true,
72791
72799
  detached: true
72792
72800
  });
@@ -74792,8 +74800,8 @@ function buildCommandExampleLines(command) {
74792
74800
  return outputArrayToString(outputArray);
74793
74801
  }
74794
74802
  function buildDescriptionLine(command, options) {
74795
- let wrapingText = wordWrap(command.description, options.columns);
74796
- return `${wrapingText}${NEWLINE}`;
74803
+ const wrappingText = wordWrap(command.description, options.columns);
74804
+ return `${wrappingText}${NEWLINE}`;
74797
74805
  }
74798
74806
  function buildHelpOutput(command, options) {
74799
74807
  const outputArray = [
@@ -84229,9 +84237,9 @@ var require_read_config_file = __commonJS2({
84229
84237
  module2.exports = __toCommonJS4(read_config_file_exports);
84230
84238
  var import_js_yaml = __toESM4(require_js_yaml2());
84231
84239
  var import_toml = __toESM4(require_toml());
84232
- var import_fs10 = require("fs");
84240
+ var import_fs9 = require("fs");
84233
84241
  var import_error_utils35 = require_dist2();
84234
- var { readFile: readFile6 } = import_fs10.promises;
84242
+ var { readFile: readFile6 } = import_fs9.promises;
84235
84243
  async function readFileOrNull(file) {
84236
84244
  try {
84237
84245
  const data = await readFile6(file);
@@ -84317,11 +84325,11 @@ var require_frameworks = __commonJS2({
84317
84325
  frameworks: () => frameworks
84318
84326
  });
84319
84327
  module2.exports = __toCommonJS4(frameworks_exports);
84320
- var import_path43 = require("path");
84321
- var import_fs10 = require("fs");
84328
+ var import_path42 = require("path");
84329
+ var import_fs9 = require("fs");
84322
84330
  var import_read_config_file = require_read_config_file();
84323
84331
  __reExport(frameworks_exports, require_types4(), module2.exports);
84324
- var { readdir: readdir2, readFile: readFile6, unlink } = import_fs10.promises;
84332
+ var { readdir: readdir2, readFile: readFile6, unlink } = import_fs9.promises;
84325
84333
  var frameworks = [
84326
84334
  {
84327
84335
  name: "Blitz.js (Legacy)",
@@ -84444,7 +84452,7 @@ var require_frameworks = __commonJS2({
84444
84452
  getOutputDirName: async () => "public",
84445
84453
  defaultRoutes: async (dirPrefix) => {
84446
84454
  try {
84447
- const nowRoutesPath = (0, import_path43.join)(
84455
+ const nowRoutesPath = (0, import_path42.join)(
84448
84456
  dirPrefix,
84449
84457
  "public",
84450
84458
  "__now_routes_g4t5bY.json"
@@ -84682,10 +84690,10 @@ var require_frameworks = __commonJS2({
84682
84690
  getOutputDirName: async (dirPrefix) => {
84683
84691
  const base = "build";
84684
84692
  try {
84685
- const location = (0, import_path43.join)(dirPrefix, base);
84693
+ const location = (0, import_path42.join)(dirPrefix, base);
84686
84694
  const content = await readdir2(location, { withFileTypes: true });
84687
84695
  if (content.length === 1 && content[0].isDirectory()) {
84688
- return (0, import_path43.join)(base, content[0].name);
84696
+ return (0, import_path42.join)(base, content[0].name);
84689
84697
  }
84690
84698
  } catch (error3) {
84691
84699
  console.error(`Error detecting output directory: `, error3);
@@ -84763,10 +84771,10 @@ var require_frameworks = __commonJS2({
84763
84771
  getOutputDirName: async (dirPrefix) => {
84764
84772
  const base = "build";
84765
84773
  try {
84766
- const location = (0, import_path43.join)(dirPrefix, base);
84774
+ const location = (0, import_path42.join)(dirPrefix, base);
84767
84775
  const content = await readdir2(location, { withFileTypes: true });
84768
84776
  if (content.length === 1 && content[0].isDirectory()) {
84769
- return (0, import_path43.join)(base, content[0].name);
84777
+ return (0, import_path42.join)(base, content[0].name);
84770
84778
  }
84771
84779
  } catch (error3) {
84772
84780
  console.error(`Error detecting output directory: `, error3);
@@ -84927,7 +84935,7 @@ var require_frameworks = __commonJS2({
84927
84935
  }
84928
84936
  },
84929
84937
  dependency: "@dojo/cli",
84930
- getOutputDirName: async () => (0, import_path43.join)("output", "dist"),
84938
+ getOutputDirName: async () => (0, import_path42.join)("output", "dist"),
84931
84939
  defaultRoutes: [
84932
84940
  {
84933
84941
  handle: "filesystem"
@@ -85162,12 +85170,12 @@ var require_frameworks = __commonJS2({
85162
85170
  getOutputDirName: async (dirPrefix) => {
85163
85171
  const base = "dist";
85164
85172
  try {
85165
- const location = (0, import_path43.join)(dirPrefix, base);
85173
+ const location = (0, import_path42.join)(dirPrefix, base);
85166
85174
  const content = await readdir2(location, { withFileTypes: true });
85167
85175
  if (content.length === 1 && content[0].isDirectory()) {
85168
- const potentialOutDir = (0, import_path43.join)(base, content[0].name);
85169
- const potentialOutDirWithBrowser = (0, import_path43.join)(potentialOutDir, "browser");
85170
- return (0, import_fs10.existsSync)(potentialOutDirWithBrowser) ? potentialOutDirWithBrowser : potentialOutDir;
85176
+ const potentialOutDir = (0, import_path42.join)(base, content[0].name);
85177
+ const potentialOutDirWithBrowser = (0, import_path42.join)(potentialOutDir, "browser");
85178
+ return (0, import_fs9.existsSync)(potentialOutDirWithBrowser) ? potentialOutDirWithBrowser : potentialOutDir;
85171
85179
  }
85172
85180
  } catch (error3) {
85173
85181
  console.error(`Error detecting output directory: `, error3);
@@ -85219,10 +85227,10 @@ var require_frameworks = __commonJS2({
85219
85227
  getOutputDirName: async (dirPrefix) => {
85220
85228
  const base = "build";
85221
85229
  try {
85222
- const location = (0, import_path43.join)(dirPrefix, base);
85230
+ const location = (0, import_path42.join)(dirPrefix, base);
85223
85231
  const content = await readdir2(location);
85224
85232
  const paths = content.filter((item) => !item.includes("."));
85225
- return (0, import_path43.join)(base, paths[0]);
85233
+ return (0, import_path42.join)(base, paths[0]);
85226
85234
  } catch (error3) {
85227
85235
  console.error(`Error detecting output directory: `, error3);
85228
85236
  }
@@ -85835,7 +85843,7 @@ var require_frameworks = __commonJS2({
85835
85843
  getOutputDirName: async (dirPrefix) => {
85836
85844
  const config2 = await (0, import_read_config_file.readConfigFile)(
85837
85845
  ["config.json", "config.yaml", "config.toml"].map((fileName) => {
85838
- return (0, import_path43.join)(dirPrefix, fileName);
85846
+ return (0, import_path42.join)(dirPrefix, fileName);
85839
85847
  })
85840
85848
  );
85841
85849
  return config2 && config2.publishDir || "public";
@@ -85876,7 +85884,7 @@ var require_frameworks = __commonJS2({
85876
85884
  },
85877
85885
  getOutputDirName: async (dirPrefix) => {
85878
85886
  const config2 = await (0, import_read_config_file.readConfigFile)(
85879
- (0, import_path43.join)(dirPrefix, "_config.yml")
85887
+ (0, import_path42.join)(dirPrefix, "_config.yml")
85880
85888
  );
85881
85889
  return config2 && config2.destination || "_site";
85882
85890
  },
@@ -87628,7 +87636,7 @@ var require_detect_builders = __commonJS2({
87628
87636
  module2.exports = __toCommonJS4(detect_builders_exports);
87629
87637
  var import_minimatch5 = __toESM4(require_minimatch2());
87630
87638
  var import_semver4 = require_semver2();
87631
- var import_path43 = require("path");
87639
+ var import_path42 = require("path");
87632
87640
  var import_frameworks6 = __toESM4(require_frameworks());
87633
87641
  var import_is_official_runtime = require_is_official_runtime();
87634
87642
  var REGEX_MIDDLEWARE_FILES = "middleware.[jt]s";
@@ -87644,7 +87652,7 @@ var require_detect_builders = __commonJS2({
87644
87652
  return new Set(
87645
87653
  builders.filter(
87646
87654
  (b) => Boolean(b.config && b.config.zeroConfig && b.src?.startsWith("api/"))
87647
- ).map((b) => (0, import_path43.extname)(b.src)).filter(Boolean)
87655
+ ).map((b) => (0, import_path42.extname)(b.src)).filter(Boolean)
87648
87656
  );
87649
87657
  }
87650
87658
  function detectApiDirectory3(builders) {
@@ -88143,14 +88151,14 @@ var require_detect_builders = __commonJS2({
88143
88151
  return null;
88144
88152
  }
88145
88153
  function getSegmentName(segment) {
88146
- const { name } = (0, import_path43.parse)(segment);
88154
+ const { name } = (0, import_path42.parse)(segment);
88147
88155
  if (name.startsWith("[") && name.endsWith("]")) {
88148
88156
  return name.slice(1, -1);
88149
88157
  }
88150
88158
  return null;
88151
88159
  }
88152
88160
  function getAbsolutePath(unresolvedPath) {
88153
- const { dir, name } = (0, import_path43.parse)(unresolvedPath);
88161
+ const { dir, name } = (0, import_path42.parse)(unresolvedPath);
88154
88162
  const parts = joinPath(dir, name).split("/");
88155
88163
  return parts.map((part) => part.replace(/\[.*\]/, "1")).join("/");
88156
88164
  }
@@ -88229,7 +88237,7 @@ var require_detect_builders = __commonJS2({
88229
88237
  isDynamic = true;
88230
88238
  return `([^/]+)`;
88231
88239
  } else if (isLast) {
88232
- const { name: fileName2, ext: ext2 } = (0, import_path43.parse)(segment);
88240
+ const { name: fileName2, ext: ext2 } = (0, import_path42.parse)(segment);
88233
88241
  const isIndex22 = fileName2 === "index";
88234
88242
  const prefix = isIndex22 ? "/" : "";
88235
88243
  const names = [
@@ -88241,7 +88249,7 @@ var require_detect_builders = __commonJS2({
88241
88249
  }
88242
88250
  return segment;
88243
88251
  });
88244
- const { name: fileName, ext } = (0, import_path43.parse)(filePath);
88252
+ const { name: fileName, ext } = (0, import_path42.parse)(filePath);
88245
88253
  const isIndex2 = fileName === "index";
88246
88254
  const queryString = `${query.length ? "?" : ""}${query.join("&")}`;
88247
88255
  const src = isIndex2 ? `^/${srcParts.slice(0, -1).join("/")}${srcParts.slice(-1)[0]}$` : `^/${srcParts.join("/")}$`;
@@ -88880,7 +88888,7 @@ var require_filesystem = __commonJS2({
88880
88888
  DetectorFilesystem: () => DetectorFilesystem2
88881
88889
  });
88882
88890
  module2.exports = __toCommonJS4(filesystem_exports);
88883
- var import_path43 = require("path");
88891
+ var import_path42 = require("path");
88884
88892
  var DetectorFilesystem2 = class {
88885
88893
  constructor() {
88886
88894
  this.hasPath = async (path11) => {
@@ -88927,7 +88935,7 @@ var require_filesystem = __commonJS2({
88927
88935
  (path11) => !directoryFiles.has(path11)
88928
88936
  );
88929
88937
  for (const filePath of filesThatDoNotExist) {
88930
- const fullFilePath = dirPath === "/" ? filePath : import_path43.posix.join(dirPath, filePath);
88938
+ const fullFilePath = dirPath === "/" ? filePath : import_path42.posix.join(dirPath, filePath);
88931
88939
  this.fileCache.set(fullFilePath, Promise.resolve(false));
88932
88940
  this.pathCache.set(fullFilePath, Promise.resolve(false));
88933
88941
  }
@@ -88988,7 +88996,7 @@ var require_local_file_system_detector = __commonJS2({
88988
88996
  });
88989
88997
  module2.exports = __toCommonJS4(local_file_system_detector_exports);
88990
88998
  var import_promises = __toESM4(require("fs/promises"));
88991
- var import_path43 = require("path");
88999
+ var import_path42 = require("path");
88992
89000
  var import_filesystem = require_filesystem();
88993
89001
  var import_error_utils35 = require_dist2();
88994
89002
  var LocalFileSystemDetector5 = class _LocalFileSystemDetector extends import_filesystem.DetectorFilesystem {
@@ -89019,8 +89027,8 @@ var require_local_file_system_detector = __commonJS2({
89019
89027
  const files = await import_promises.default.readdir(dirPath);
89020
89028
  return Promise.all(
89021
89029
  files.map(async (name) => {
89022
- const absPath = (0, import_path43.join)(this.rootPath, dir, name);
89023
- const path11 = (0, import_path43.join)(this.getRelativeFilePath(dir), name);
89030
+ const absPath = (0, import_path42.join)(this.rootPath, dir, name);
89031
+ const path11 = (0, import_path42.join)(this.getRelativeFilePath(dir), name);
89024
89032
  const stat2 = await import_promises.default.stat(absPath);
89025
89033
  let type;
89026
89034
  if (stat2.isFile()) {
@@ -89038,10 +89046,10 @@ var require_local_file_system_detector = __commonJS2({
89038
89046
  return new _LocalFileSystemDetector(this.getFilePath(name));
89039
89047
  }
89040
89048
  getRelativeFilePath(name) {
89041
- return name.startsWith(this.rootPath) ? (0, import_path43.relative)(this.rootPath, name) : name;
89049
+ return name.startsWith(this.rootPath) ? (0, import_path42.relative)(this.rootPath, name) : name;
89042
89050
  }
89043
89051
  getFilePath(name) {
89044
- return (0, import_path43.join)(this.rootPath, this.getRelativeFilePath(name));
89052
+ return (0, import_path42.join)(this.rootPath, this.getRelativeFilePath(name));
89045
89053
  }
89046
89054
  };
89047
89055
  }
@@ -89192,11 +89200,11 @@ var require_get_workspaces = __commonJS2({
89192
89200
  getWorkspaces: () => getWorkspaces3
89193
89201
  });
89194
89202
  module2.exports = __toCommonJS4(get_workspaces_exports);
89195
- var import_path43 = __toESM4(require("path"));
89203
+ var import_path42 = __toESM4(require("path"));
89196
89204
  var import_workspace_managers = require_workspace_managers();
89197
89205
  var import_detect_framework = require_detect_framework();
89198
89206
  var MAX_DEPTH_TRAVERSE = 3;
89199
- var posixPath = import_path43.default.posix;
89207
+ var posixPath = import_path42.default.posix;
89200
89208
  async function getWorkspaces3({
89201
89209
  fs: fs15,
89202
89210
  depth = MAX_DEPTH_TRAVERSE,
@@ -95224,7 +95232,7 @@ var require_get_glob_fs = __commonJS2({
95224
95232
  getGlobFs: () => getGlobFs
95225
95233
  });
95226
95234
  module2.exports = __toCommonJS4(get_glob_fs_exports);
95227
- var import_fs10 = __toESM4(require("fs"));
95235
+ var import_fs9 = __toESM4(require("fs"));
95228
95236
  function removeWindowsPrefix(path11) {
95229
95237
  return path11.replace(/^[a-zA-Z]:/, "");
95230
95238
  }
@@ -95268,7 +95276,7 @@ var require_get_glob_fs = __commonJS2({
95268
95276
  });
95269
95277
  }).catch((err) => callback(err, null));
95270
95278
  };
95271
- return new Proxy(import_fs10.default, {
95279
+ return new Proxy(import_fs9.default, {
95272
95280
  get(_target, prop) {
95273
95281
  switch (prop) {
95274
95282
  case "readdir":
@@ -95321,12 +95329,12 @@ var require_get_workspace_package_paths = __commonJS2({
95321
95329
  getWorkspacePackagePaths: () => getWorkspacePackagePaths3
95322
95330
  });
95323
95331
  module2.exports = __toCommonJS4(get_workspace_package_paths_exports);
95324
- var import_path43 = __toESM4(require("path"));
95332
+ var import_path42 = __toESM4(require("path"));
95325
95333
  var import_js_yaml = __toESM4(require_js_yaml3());
95326
95334
  var import_glob = __toESM4(require_glob());
95327
95335
  var import_json5 = __toESM4(require_lib13());
95328
95336
  var import_get_glob_fs = require_get_glob_fs();
95329
- var posixPath = import_path43.default.posix;
95337
+ var posixPath = import_path42.default.posix;
95330
95338
  async function getWorkspacePackagePaths3({
95331
95339
  fs: fs15,
95332
95340
  workspace
@@ -95687,7 +95695,7 @@ var require_get_monorepo_default_settings = __commonJS2({
95687
95695
  getMonorepoDefaultSettings: () => getMonorepoDefaultSettings2
95688
95696
  });
95689
95697
  module2.exports = __toCommonJS4(get_monorepo_default_settings_exports);
95690
- var import_path43 = require("path");
95698
+ var import_path42 = require("path");
95691
95699
  var import_monorepo_managers = require_monorepo_managers();
95692
95700
  var import_package_managers = require_package_managers();
95693
95701
  var import_detect_framework = require_detect_framework();
@@ -95778,8 +95786,8 @@ var require_get_monorepo_default_settings = __commonJS2({
95778
95786
  const nxJSON = import_json5.default.parse(nxJSONBuf.toString("utf-8"));
95779
95787
  if (!nxJSON?.targetDefaults?.build) {
95780
95788
  const [projectJSONBuf, packageJSONBuf] = await Promise.all([
95781
- detectorFilesystem.readFile((0, import_path43.join)(projectPath, "project.json")).catch(() => null),
95782
- detectorFilesystem.readFile((0, import_path43.join)(projectPath, "package.json")).catch(() => null)
95789
+ detectorFilesystem.readFile((0, import_path42.join)(projectPath, "project.json")).catch(() => null),
95790
+ detectorFilesystem.readFile((0, import_path42.join)(projectPath, "package.json")).catch(() => null)
95783
95791
  ]);
95784
95792
  let hasBuildTarget = false;
95785
95793
  if (projectJSONBuf) {
@@ -105957,7 +105965,7 @@ async function findRepoRoot(client2, start) {
105957
105965
  const { debug: debug2 } = output_manager_default;
105958
105966
  const REPO_JSON_PATH = (0, import_path14.join)(VERCEL_DIR2, VERCEL_DIR_REPO);
105959
105967
  const GIT_PATH = isGitWorktreeOrSubmodule({ cwd: client2.cwd }) ? (0, import_path14.normalize)(".git") : (0, import_path14.normalize)(".git/config");
105960
- for (const current of (0, import_build_utils4.traverseUpDirectories)({ start })) {
105968
+ for (const current of (0, import_build_utils5.traverseUpDirectories)({ start })) {
105961
105969
  if (current === home) {
105962
105970
  debug2("Arrived at home directory");
105963
105971
  break;
@@ -105989,7 +105997,7 @@ function sortByDirectory(a, b) {
105989
105997
  return bParts.length - aParts.length;
105990
105998
  }
105991
105999
  function findProjectsFromPath(projects, path11) {
105992
- const normalizedPath = (0, import_build_utils4.normalizePath)(path11);
106000
+ const normalizedPath = (0, import_build_utils5.normalizePath)(path11);
105993
106001
  const matches = projects.slice().sort(sortByDirectory).filter((project) => {
105994
106002
  if (project.directory === ".") {
105995
106003
  return true;
@@ -105999,7 +106007,7 @@ function findProjectsFromPath(projects, path11) {
105999
106007
  const firstMatch = matches[0];
106000
106008
  return matches.filter((match) => match.directory === firstMatch.directory);
106001
106009
  }
106002
- var import_chalk36, import_pluralize3, import_os6, import_slugify, import_path14, import_build_utils4, import_fs_extra6, home;
106010
+ var import_chalk36, import_pluralize3, import_os6, import_slugify, import_path14, import_build_utils5, import_fs_extra6, home;
106003
106011
  var init_repo = __esm({
106004
106012
  "src/util/link/repo.ts"() {
106005
106013
  "use strict";
@@ -106009,7 +106017,7 @@ var init_repo = __esm({
106009
106017
  import_os6 = require("os");
106010
106018
  import_slugify = __toESM3(require_slugify());
106011
106019
  import_path14 = require("path");
106012
- import_build_utils4 = require("@vercel/build-utils");
106020
+ import_build_utils5 = require("@vercel/build-utils");
106013
106021
  import_fs_extra6 = __toESM3(require_lib());
106014
106022
  init_confirm();
106015
106023
  init_humanize_path();
@@ -106035,7 +106043,7 @@ function getVercelDirectory(cwd) {
106035
106043
  const possibleDirs = [(0, import_path15.join)(cwd, VERCEL_DIR2), (0, import_path15.join)(cwd, VERCEL_DIR_FALLBACK)];
106036
106044
  const existingDirs = possibleDirs.filter((d) => isDirectory(d));
106037
106045
  if (existingDirs.length > 1) {
106038
- throw new import_build_utils5.NowBuildError({
106046
+ throw new import_build_utils6.NowBuildError({
106039
106047
  code: "CONFLICTING_CONFIG_DIRECTORIES",
106040
106048
  message: "Both `.vercel` and `.now` directories exist. Please remove the `.now` directory.",
106041
106049
  link: "https://vercel.link/combining-old-and-new-config"
@@ -106114,8 +106122,8 @@ async function getOrgById(client2, orgId) {
106114
106122
  return { type: "user", id: orgId, slug: user.username };
106115
106123
  }
106116
106124
  async function hasProjectLink(client2, projectLink, path11) {
106117
- const VERCEL_ORG_ID = (0, import_build_utils5.getPlatformEnv)("ORG_ID");
106118
- const VERCEL_PROJECT_ID = (0, import_build_utils5.getPlatformEnv)("PROJECT_ID");
106125
+ const VERCEL_ORG_ID = (0, import_build_utils6.getPlatformEnv)("ORG_ID");
106126
+ const VERCEL_PROJECT_ID = (0, import_build_utils6.getPlatformEnv)("PROJECT_ID");
106119
106127
  if (VERCEL_ORG_ID === projectLink.orgId && VERCEL_PROJECT_ID === projectLink.projectId) {
106120
106128
  return true;
106121
106129
  }
@@ -106130,8 +106138,8 @@ async function hasProjectLink(client2, projectLink, path11) {
106130
106138
  return false;
106131
106139
  }
106132
106140
  async function getLinkedProject(client2, path11 = client2.cwd) {
106133
- const VERCEL_ORG_ID = (0, import_build_utils5.getPlatformEnv)("ORG_ID");
106134
- const VERCEL_PROJECT_ID = (0, import_build_utils5.getPlatformEnv)("PROJECT_ID");
106141
+ const VERCEL_ORG_ID = (0, import_build_utils6.getPlatformEnv)("ORG_ID");
106142
+ const VERCEL_PROJECT_ID = (0, import_build_utils6.getPlatformEnv)("PROJECT_ID");
106135
106143
  const shouldUseEnv = Boolean(VERCEL_ORG_ID && VERCEL_PROJECT_ID);
106136
106144
  if ((VERCEL_ORG_ID || VERCEL_PROJECT_ID) && !shouldUseEnv) {
106137
106145
  output_manager_default.error(
@@ -106158,7 +106166,7 @@ async function getLinkedProject(client2, path11 = client2.cwd) {
106158
106166
  if (err.missingToken || err.invalidToken) {
106159
106167
  throw new InvalidToken();
106160
106168
  } else {
106161
- throw new import_build_utils5.NowBuildError({
106169
+ throw new import_build_utils6.NowBuildError({
106162
106170
  message: `Could not retrieve Project Settings. To link your Project, remove the ${code(
106163
106171
  VERCEL_DIR2
106164
106172
  )} directory and deploy again.`,
@@ -106225,7 +106233,7 @@ async function linkFolderToProject(client2, path11, projectLink, projectName, or
106225
106233
  ) + "\n"
106226
106234
  );
106227
106235
  }
106228
- var import_fs4, import_ajv, import_chalk37, import_path15, import_fs_extra7, import_util2, import_build_utils5, import_error_utils12, readFile3, writeFile2, VERCEL_DIR2, VERCEL_DIR_FALLBACK, VERCEL_DIR_README, VERCEL_DIR_PROJECT, VERCEL_DIR_REPO, linkSchema;
106236
+ var import_fs4, import_ajv, import_chalk37, import_path15, import_fs_extra7, import_util2, import_build_utils6, import_error_utils12, readFile3, writeFile2, VERCEL_DIR2, VERCEL_DIR_FALLBACK, VERCEL_DIR_README, VERCEL_DIR_PROJECT, VERCEL_DIR_REPO, linkSchema;
106229
106237
  var init_link2 = __esm({
106230
106238
  "src/util/projects/link.ts"() {
106231
106239
  "use strict";
@@ -106241,7 +106249,7 @@ var init_link2 = __esm({
106241
106249
  init_get_team_by_id();
106242
106250
  init_emoji();
106243
106251
  init_global_path();
106244
- import_build_utils5 = require("@vercel/build-utils");
106252
+ import_build_utils6 = require("@vercel/build-utils");
106245
106253
  init_code();
106246
106254
  import_error_utils12 = __toESM3(require_dist2());
106247
106255
  init_repo();
@@ -107113,16 +107121,9 @@ var init_generate_cert_for_deploy = __esm({
107113
107121
  });
107114
107122
 
107115
107123
  // src/util/deploy/create-deploy.ts
107116
- async function createDeploy(client2, now, contextName, path11, createArgs, org, isSettingUpProject, cwd, archive) {
107124
+ async function createDeploy(client2, now, contextName, path11, createArgs, org, isSettingUpProject, archive) {
107117
107125
  try {
107118
- return await now.create(
107119
- path11,
107120
- createArgs,
107121
- org,
107122
- isSettingUpProject,
107123
- cwd,
107124
- archive
107125
- );
107126
+ return await now.create(path11, createArgs, org, isSettingUpProject, archive);
107126
107127
  } catch (err) {
107127
107128
  if (isAPIError(err)) {
107128
107129
  if (err.code === "rate_limited") {
@@ -107185,8 +107186,7 @@ async function createDeploy(client2, now, contextName, path11, createArgs, org,
107185
107186
  path11,
107186
107187
  createArgs,
107187
107188
  org,
107188
- isSettingUpProject,
107189
- cwd
107189
+ isSettingUpProject
107190
107190
  );
107191
107191
  }
107192
107192
  if (err.code === "not_found") {
@@ -110093,7 +110093,6 @@ function printInspectUrl(inspectorUrl, deployStamp) {
110093
110093
  }
110094
110094
  async function processDeployment({
110095
110095
  org,
110096
- cwd,
110097
110096
  projectName,
110098
110097
  isSettingUpProject,
110099
110098
  archive,
@@ -110193,16 +110192,6 @@ async function processDeployment({
110193
110192
  }
110194
110193
  if (event.type === "created") {
110195
110194
  const deployment = event.payload;
110196
- await linkFolderToProject(
110197
- client2,
110198
- cwd,
110199
- {
110200
- orgId: org.id,
110201
- projectId: deployment.projectId
110202
- },
110203
- projectName,
110204
- org.slug
110205
- );
110206
110195
  now.url = deployment.url;
110207
110196
  stopSpinner();
110208
110197
  printInspectUrl(deployment.inspectorUrl, deployStamp);
@@ -110217,7 +110206,7 @@ async function processDeployment({
110217
110206
  ) + `
110218
110207
  `
110219
110208
  );
110220
- if (quiet) {
110209
+ if (quiet || process.env.FORCE_TTY === "1") {
110221
110210
  process.stdout.write(`https://${event.payload.url}`);
110222
110211
  }
110223
110212
  if (noWait) {
@@ -110290,7 +110279,6 @@ var init_process_deployment = __esm({
110290
110279
  init_emoji();
110291
110280
  init_logs();
110292
110281
  init_progress();
110293
- init_link2();
110294
110282
  init_ua();
110295
110283
  init_output_manager();
110296
110284
  }
@@ -110363,7 +110351,7 @@ var init_util = __esm({
110363
110351
  noWait,
110364
110352
  withLogs,
110365
110353
  autoAssignCustomDomains
110366
- }, org, isSettingUpProject, cwd, archive) {
110354
+ }, org, isSettingUpProject, archive) {
110367
110355
  let hashes = {};
110368
110356
  const uploadStamp = stamp_default();
110369
110357
  let requestBody = {
@@ -110398,7 +110386,6 @@ var init_util = __esm({
110398
110386
  isSettingUpProject,
110399
110387
  archive,
110400
110388
  skipAutoDetectionConfirmation,
110401
- cwd,
110402
110389
  prebuilt,
110403
110390
  vercelOutputDir,
110404
110391
  rootDirectory,
@@ -110729,8 +110716,7 @@ async function setupAndLink(client2, path11, {
110729
110716
  sourcePath,
110730
110717
  createArgs,
110731
110718
  org,
110732
- true,
110733
- path11
110719
+ true
110734
110720
  );
110735
110721
  if (!deployment || !("code" in deployment) || deployment.code !== "missing_project_settings") {
110736
110722
  output_manager_default.error("Failed to detect project settings. Please try again.");
@@ -110770,6 +110756,13 @@ async function setupAndLink(client2, path11, {
110770
110756
  );
110771
110757
  return { status: "linked", org, project };
110772
110758
  } catch (err) {
110759
+ if (err instanceof SchemaValidationFailed) {
110760
+ const niceError = (0, import_build_utils7.getPrettyError)(err.meta);
110761
+ const fileName = localConfig?.[import_client5.fileNameSymbol] || "vercel.json";
110762
+ niceError.message = `Invalid ${fileName} - ${niceError.message}`;
110763
+ output_manager_default.prettyError(niceError);
110764
+ return { status: "error", exitCode: 1 };
110765
+ }
110773
110766
  if (isAPIError(err) && err.code === "too_many_projects") {
110774
110767
  output_manager_default.prettyError(err);
110775
110768
  return { status: "error", exitCode: 1, reason: "TOO_MANY_PROJECTS" };
@@ -110778,7 +110771,7 @@ async function setupAndLink(client2, path11, {
110778
110771
  return { status: "error", exitCode: 1 };
110779
110772
  }
110780
110773
  }
110781
- var import_path19, import_chalk48, import_fs_extra12;
110774
+ var import_path19, import_chalk48, import_fs_extra12, import_build_utils7, import_client5;
110782
110775
  var init_setup_and_link = __esm({
110783
110776
  "src/util/link/setup-and-link.ts"() {
110784
110777
  "use strict";
@@ -110801,6 +110794,9 @@ var init_setup_and_link = __esm({
110801
110794
  init_util();
110802
110795
  init_errors_ts();
110803
110796
  init_output_manager();
110797
+ import_build_utils7 = require("@vercel/build-utils");
110798
+ init_errors2();
110799
+ import_client5 = __toESM3(require_dist13());
110804
110800
  }
110805
110801
  });
110806
110802
 
@@ -111052,7 +111048,7 @@ async function staticFiles(path11, { src }) {
111052
111048
  let files = [];
111053
111049
  const source = src || ".";
111054
111050
  const search = (0, import_path20.resolve)(path11, source);
111055
- const { ig } = await (0, import_client5.getVercelIgnore)(path11);
111051
+ const { ig } = await (0, import_client6.getVercelIgnore)(path11);
111056
111052
  const filter = ig.createFilter();
111057
111053
  const prefixLength = path11.length + 1;
111058
111054
  const accepts = (file) => {
@@ -111111,13 +111107,13 @@ async function explode(paths, { accepts }) {
111111
111107
  function notNull(value) {
111112
111108
  return value !== null;
111113
111109
  }
111114
- var import_fs_extra13, import_path20, import_client5, asAbsolute;
111110
+ var import_fs_extra13, import_path20, import_client6, asAbsolute;
111115
111111
  var init_get_files = __esm({
111116
111112
  "src/util/get-files.ts"() {
111117
111113
  "use strict";
111118
111114
  import_fs_extra13 = __toESM3(require_lib());
111119
111115
  import_path20 = require("path");
111120
- import_client5 = __toESM3(require_dist13());
111116
+ import_client6 = __toESM3(require_dist13());
111121
111117
  init_unique_strings();
111122
111118
  init_output_manager();
111123
111119
  asAbsolute = function(path11, parent) {
@@ -121119,7 +121115,7 @@ async function extractEntry(zipFile, entry, dir) {
121119
121115
  return;
121120
121116
  const readStream = await zipFile.openReadStream(entry);
121121
121117
  if (symlink3) {
121122
- const link4 = await (0, import_build_utils6.streamToBuffer)(readStream);
121118
+ const link4 = await (0, import_build_utils8.streamToBuffer)(readStream);
121123
121119
  await fs6.symlink(link4.toString("utf8"), dest);
121124
121120
  } else {
121125
121121
  await (0, import_promisepipe.default)(readStream, fs6.createWriteStream(dest, { mode: procMode }));
@@ -121136,14 +121132,14 @@ function getExtractedMode(entryMode, isDir) {
121136
121132
  }
121137
121133
  return mode;
121138
121134
  }
121139
- var import_path22, import_promisepipe, fs6, import_build_utils6, import_yauzl_promise;
121135
+ var import_path22, import_promisepipe, fs6, import_build_utils8, import_yauzl_promise;
121140
121136
  var init_unzip = __esm({
121141
121137
  "src/util/build/unzip.ts"() {
121142
121138
  "use strict";
121143
121139
  import_path22 = __toESM3(require("path"));
121144
121140
  import_promisepipe = __toESM3(require_promisepipe());
121145
121141
  fs6 = __toESM3(require_lib());
121146
- import_build_utils6 = require("@vercel/build-utils");
121142
+ import_build_utils8 = require("@vercel/build-utils");
121147
121143
  import_yauzl_promise = __toESM3(require_lib15());
121148
121144
  }
121149
121145
  });
@@ -121194,7 +121190,7 @@ async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2,
121194
121190
  return;
121195
121191
  }
121196
121192
  if (!buildResult.output) {
121197
- const configFile = vercelConfig?.[import_client6.fileNameSymbol];
121193
+ const configFile = vercelConfig?.[import_client7.fileNameSymbol];
121198
121194
  const updateMessage = build2.use.startsWith("@now/") ? ` Please update from "@now" to "@vercel" in your \`${configFile}\` file.` : "";
121199
121195
  throw new Error(
121200
121196
  `The build result from "${build2.use}" is missing the "output" property.${updateMessage}`
@@ -121247,7 +121243,7 @@ async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2,
121247
121243
  import_fs_extra15.default.createWriteStream(fallbackPath, { mode: fallback.mode })
121248
121244
  );
121249
121245
  }
121250
- fallback = new import_build_utils7.FileFsRef({
121246
+ fallback = new import_build_utils9.FileFsRef({
121251
121247
  ...output2.fallback,
121252
121248
  fsPath: (0, import_path23.basename)(fallbackName)
121253
121249
  });
@@ -121293,7 +121289,7 @@ async function writeBuildResultV3(repoRootPath, outputDir, buildResult, build2,
121293
121289
  if (typeof src !== "string") {
121294
121290
  throw new Error(`Expected "build.src" to be a string`);
121295
121291
  }
121296
- const functionConfiguration = vercelConfig ? await (0, import_build_utils7.getLambdaOptionsFromFunction)({
121292
+ const functionConfiguration = vercelConfig ? await (0, import_build_utils9.getLambdaOptionsFromFunction)({
121297
121293
  sourceFile: src,
121298
121294
  config: vercelConfig
121299
121295
  }) : {};
@@ -121348,7 +121344,7 @@ async function writeStaticFile(outputDir, file, path11, overrides, cleanUrls = f
121348
121344
  } catch (_) {
121349
121345
  }
121350
121346
  }
121351
- await (0, import_build_utils7.downloadFile)(file, dest);
121347
+ await (0, import_build_utils9.downloadFile)(file, dest);
121352
121348
  }
121353
121349
  async function writeFunctionSymlink(outputDir, dest, fn2, existingFunctions) {
121354
121350
  const existingPath = existingFunctions.get(fn2);
@@ -121380,11 +121376,11 @@ async function writeEdgeFunction(repoRootPath, outputDir, edgeFunction, path11,
121380
121376
  edgeFunction.files,
121381
121377
  repoRootPath
121382
121378
  );
121383
- ops.push((0, import_build_utils7.download)(files, dest));
121379
+ ops.push((0, import_build_utils9.download)(files, dest));
121384
121380
  const config2 = {
121385
121381
  runtime: "edge",
121386
121382
  ...edgeFunction,
121387
- entrypoint: (0, import_build_utils7.normalizePath)(edgeFunction.entrypoint),
121383
+ entrypoint: (0, import_build_utils9.normalizePath)(edgeFunction.entrypoint),
121388
121384
  filePathMap,
121389
121385
  files: void 0,
121390
121386
  type: void 0
@@ -121411,7 +121407,7 @@ async function writeLambda(repoRootPath, outputDir, lambda, path11, functionConf
121411
121407
  if (lambda.files) {
121412
121408
  const f = filesWithoutFsRefs(lambda.files, repoRootPath);
121413
121409
  filePathMap = f.filePathMap;
121414
- ops.push((0, import_build_utils7.download)(f.files, dest));
121410
+ ops.push((0, import_build_utils9.download)(f.files, dest));
121415
121411
  } else if (lambda.zipBuffer) {
121416
121412
  ops.push(unzip(lambda.zipBuffer, dest));
121417
121413
  } else {
@@ -121421,7 +121417,7 @@ async function writeLambda(repoRootPath, outputDir, lambda, path11, functionConf
121421
121417
  const maxDuration = functionConfiguration?.maxDuration ?? lambda.maxDuration;
121422
121418
  const config2 = {
121423
121419
  ...lambda,
121424
- handler: (0, import_build_utils7.normalizePath)(lambda.handler),
121420
+ handler: (0, import_build_utils9.normalizePath)(lambda.handler),
121425
121421
  memory,
121426
121422
  maxDuration,
121427
121423
  filePathMap,
@@ -121511,19 +121507,19 @@ function filesWithoutFsRefs(files, repoRootPath) {
121511
121507
  }
121512
121508
  return { files: out, filePathMap };
121513
121509
  }
121514
- var import_fs_extra15, import_mime_types, import_path23, import_build_utils7, import_promisepipe2, import_client6, normalize2, OUTPUT_DIR;
121510
+ var import_fs_extra15, import_mime_types, import_path23, import_build_utils9, import_promisepipe2, import_client7, normalize2, OUTPUT_DIR;
121515
121511
  var init_write_build_result = __esm({
121516
121512
  "src/util/build/write-build-result.ts"() {
121517
121513
  "use strict";
121518
121514
  import_fs_extra15 = __toESM3(require_lib());
121519
121515
  import_mime_types = __toESM3(require_mime_types());
121520
121516
  import_path23 = require("path");
121521
- import_build_utils7 = require("@vercel/build-utils");
121517
+ import_build_utils9 = require("@vercel/build-utils");
121522
121518
  import_promisepipe2 = __toESM3(require_promisepipe());
121523
121519
  init_merge();
121524
121520
  init_unzip();
121525
121521
  init_link2();
121526
- import_client6 = __toESM3(require_dist13());
121522
+ import_client7 = __toESM3(require_dist13());
121527
121523
  ({ normalize: normalize2 } = import_path23.posix);
121528
121524
  OUTPUT_DIR = (0, import_path23.join)(VERCEL_DIR2, "output");
121529
121525
  }
@@ -122396,12 +122392,12 @@ __export3(static_builder_exports, {
122396
122392
  shouldServe: () => shouldServe,
122397
122393
  version: () => version
122398
122394
  });
122399
- var import_minimatch, import_build_utils8, version, build, shouldServe;
122395
+ var import_minimatch, import_build_utils10, version, build, shouldServe;
122400
122396
  var init_static_builder = __esm({
122401
122397
  "src/util/build/static-builder.ts"() {
122402
122398
  "use strict";
122403
122399
  import_minimatch = __toESM3(require_minimatch2());
122404
- import_build_utils8 = require("@vercel/build-utils");
122400
+ import_build_utils10 = require("@vercel/build-utils");
122405
122401
  version = 2;
122406
122402
  build = async ({ entrypoint, files, config: config2 }) => {
122407
122403
  const output2 = {};
@@ -122432,7 +122428,7 @@ var init_static_builder = __esm({
122432
122428
  opts.entrypoint = `${outputDirectory}/${opts.entrypoint}`;
122433
122429
  opts.requestPath = `${outputDirectory}/${opts.requestPath}`;
122434
122430
  }
122435
- return (0, import_build_utils8.shouldServe)(opts);
122431
+ return (0, import_build_utils10.shouldServe)(opts);
122436
122432
  };
122437
122433
  }
122438
122434
  });
@@ -122687,7 +122683,7 @@ async function initCorepack({
122687
122683
  process.env.COREPACK_HOME = corepackHomeDir;
122688
122684
  process.env.PATH = `${corepackShimDir}${import_path25.delimiter}${process.env.PATH}`;
122689
122685
  const pkgManagerName = pkg.packageManager.split("@")[0];
122690
- await (0, import_build_utils9.spawnAsync)(
122686
+ await (0, import_build_utils11.spawnAsync)(
122691
122687
  "corepack",
122692
122688
  ["enable", pkgManagerName, "--install-directory", corepackShimDir],
122693
122689
  {
@@ -122709,12 +122705,12 @@ function cleanupCorepack(corepackShimDir) {
122709
122705
  );
122710
122706
  }
122711
122707
  }
122712
- var import_path25, import_build_utils9, import_fs_extra17;
122708
+ var import_path25, import_build_utils11, import_fs_extra17;
122713
122709
  var init_corepack = __esm({
122714
122710
  "src/util/build/corepack.ts"() {
122715
122711
  "use strict";
122716
122712
  import_path25 = require("path");
122717
- import_build_utils9 = require("@vercel/build-utils");
122713
+ import_build_utils11 = require("@vercel/build-utils");
122718
122714
  import_fs_extra17 = __toESM3(require_lib());
122719
122715
  init_errors_ts();
122720
122716
  init_link2();
@@ -122747,14 +122743,14 @@ function validateConfig(config2) {
122747
122743
  if (!validate(config2)) {
122748
122744
  if (validate.errors && validate.errors[0]) {
122749
122745
  const error3 = validate.errors[0];
122750
- const fileName = config2[import_client7.fileNameSymbol] || "vercel.json";
122751
- const niceError = (0, import_build_utils10.getPrettyError)(error3);
122746
+ const fileName = config2[import_client8.fileNameSymbol] || "vercel.json";
122747
+ const niceError = (0, import_build_utils12.getPrettyError)(error3);
122752
122748
  niceError.message = `Invalid ${fileName} - ${niceError.message}`;
122753
122749
  return niceError;
122754
122750
  }
122755
122751
  }
122756
122752
  if (config2.functions && config2.builds) {
122757
- return new import_build_utils10.NowBuildError({
122753
+ return new import_build_utils12.NowBuildError({
122758
122754
  code: "FUNCTIONS_AND_BUILDS",
122759
122755
  message: "The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",
122760
122756
  link: "https://vercel.link/functions-and-builds"
@@ -122762,14 +122758,14 @@ function validateConfig(config2) {
122762
122758
  }
122763
122759
  return null;
122764
122760
  }
122765
- var import_ajv2, import_routing_utils, import_build_utils10, import_client7, imagesSchema, cronsSchema, vercelConfigSchema, ajv, validate;
122761
+ var import_ajv2, import_routing_utils, import_build_utils12, import_client8, imagesSchema, cronsSchema, vercelConfigSchema, ajv, validate;
122766
122762
  var init_validate_config = __esm({
122767
122763
  "src/util/validate-config.ts"() {
122768
122764
  "use strict";
122769
122765
  import_ajv2 = __toESM3(require_ajv());
122770
122766
  import_routing_utils = __toESM3(require_dist29());
122771
- import_build_utils10 = require("@vercel/build-utils");
122772
- import_client7 = __toESM3(require_dist13());
122767
+ import_build_utils12 = require("@vercel/build-utils");
122768
+ import_client8 = __toESM3(require_dist13());
122773
122769
  imagesSchema = {
122774
122770
  type: "object",
122775
122771
  additionalProperties: false,
@@ -122903,14 +122899,14 @@ var init_validate_config = __esm({
122903
122899
  // doesn't need to know about `regions`, `public`, etc.
122904
122900
  additionalProperties: true,
122905
122901
  properties: {
122906
- builds: import_build_utils10.buildsSchema,
122902
+ builds: import_build_utils12.buildsSchema,
122907
122903
  routes: import_routing_utils.routesSchema,
122908
122904
  cleanUrls: import_routing_utils.cleanUrlsSchema,
122909
122905
  headers: import_routing_utils.headersSchema,
122910
122906
  redirects: import_routing_utils.redirectsSchema,
122911
122907
  rewrites: import_routing_utils.rewritesSchema,
122912
122908
  trailingSlash: import_routing_utils.trailingSlashSchema,
122913
- functions: import_build_utils10.functionsSchema,
122909
+ functions: import_build_utils12.functionsSchema,
122914
122910
  images: imagesSchema,
122915
122911
  crons: cronsSchema
122916
122912
  }
@@ -122927,7 +122923,7 @@ async function setMonorepoDefaultSettings(cwd, workPath, projectSettings) {
122927
122923
  const relativeToRoot = (0, import_path26.relative)(workPath, cwd);
122928
122924
  const setCommand = (command, value) => {
122929
122925
  if (projectSettings[command]) {
122930
- (0, import_build_utils11.debug)(
122926
+ (0, import_build_utils13.debug)(
122931
122927
  `Skipping auto-assignment of ${command} as it is already set via project settings or configuration overrides.`
122932
122928
  );
122933
122929
  } else {
@@ -122968,14 +122964,14 @@ async function setMonorepoDefaultSettings(cwd, workPath, projectSettings) {
122968
122964
  throw error3;
122969
122965
  }
122970
122966
  }
122971
- var import_path26, import_fs_detectors3, import_title3, import_build_utils11;
122967
+ var import_path26, import_fs_detectors3, import_title3, import_build_utils13;
122972
122968
  var init_monorepo = __esm({
122973
122969
  "src/util/build/monorepo.ts"() {
122974
122970
  "use strict";
122975
122971
  import_path26 = require("path");
122976
122972
  import_fs_detectors3 = __toESM3(require_dist27());
122977
122973
  import_title3 = __toESM3(require_lib4());
122978
- import_build_utils11 = require("@vercel/build-utils");
122974
+ import_build_utils13 = require("@vercel/build-utils");
122979
122975
  init_output_manager();
122980
122976
  }
122981
122977
  });
@@ -123087,7 +123083,7 @@ async function main2(client2) {
123087
123083
  }) || "preview";
123088
123084
  const yes = Boolean(parsedArgs.flags["--yes"]);
123089
123085
  try {
123090
- await (0, import_build_utils12.validateNpmrc)(cwd);
123086
+ await (0, import_build_utils14.validateNpmrc)(cwd);
123091
123087
  } catch (err) {
123092
123088
  output_manager_default.prettyError(err);
123093
123089
  return 1;
@@ -123221,9 +123217,9 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
123221
123217
  if (nowConfig instanceof CantParseJSONFile)
123222
123218
  throw nowConfig;
123223
123219
  if (vercelConfig) {
123224
- vercelConfig[import_client8.fileNameSymbol] = "vercel.json";
123220
+ vercelConfig[import_client9.fileNameSymbol] = "vercel.json";
123225
123221
  } else if (nowConfig) {
123226
- nowConfig[import_client8.fileNameSymbol] = "now.json";
123222
+ nowConfig[import_client9.fileNameSymbol] = "now.json";
123227
123223
  }
123228
123224
  const localConfig = vercelConfig || nowConfig || {};
123229
123225
  const validateError = validateConfig(localConfig);
@@ -123238,14 +123234,14 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
123238
123234
  await setMonorepoDefaultSettings(cwd, workPath, projectSettings);
123239
123235
  }
123240
123236
  const files = (await staticFiles(workPath, {})).map(
123241
- (f) => (0, import_build_utils12.normalizePath)((0, import_path27.relative)(workPath, f))
123237
+ (f) => (0, import_build_utils14.normalizePath)((0, import_path27.relative)(workPath, f))
123242
123238
  );
123243
123239
  const routesResult = (0, import_routing_utils2.getTransformedRoutes)(localConfig);
123244
123240
  if (routesResult.error) {
123245
123241
  throw routesResult.error;
123246
123242
  }
123247
123243
  if (localConfig.builds && localConfig.functions) {
123248
- throw new import_build_utils12.NowBuildError({
123244
+ throw new import_build_utils14.NowBuildError({
123249
123245
  code: "bad_request",
123250
123246
  message: "The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",
123251
123247
  link: "https://vercel.link/functions-and-builds"
@@ -123299,7 +123295,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
123299
123295
  for (const path11 of files) {
123300
123296
  const fsPath = (0, import_path27.join)(workPath, path11);
123301
123297
  const { mode } = await import_fs_extra18.default.stat(fsPath);
123302
- filesMap[path11] = new import_build_utils12.FileFsRef({ mode, fsPath });
123298
+ filesMap[path11] = new import_build_utils14.FileFsRef({ mode, fsPath });
123303
123299
  }
123304
123300
  const buildStamp = stamp_default();
123305
123301
  await import_fs_extra18.default.mkdirp(outputDir);
@@ -123400,8 +123396,8 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
123400
123396
  }
123401
123397
  if (buildResult && "output" in buildResult && "runtime" in buildResult.output && "type" in buildResult.output && buildResult.output.type === "Lambda") {
123402
123398
  const lambdaRuntime = buildResult.output.runtime;
123403
- if ((0, import_build_utils12.getDiscontinuedNodeVersions)().some((o) => o.runtime === lambdaRuntime)) {
123404
- throw new import_build_utils12.NowBuildError({
123399
+ if ((0, import_build_utils14.getDiscontinuedNodeVersions)().some((o) => o.runtime === lambdaRuntime)) {
123400
+ throw new import_build_utils14.NowBuildError({
123405
123401
  code: "NODEJS_DISCONTINUED_VERSION",
123406
123402
  message: `The Runtime "${build2.use}" is using "${lambdaRuntime}", which is discontinued. Please upgrade your Runtime to a more recent version or consult the author for more details.`,
123407
123403
  link: "https://github.com/vercel/vercel/blob/main/DEVELOPING_A_RUNTIME.md#lambdaruntime"
@@ -123434,7 +123430,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
123434
123430
  throw err;
123435
123431
  } finally {
123436
123432
  ops.push(
123437
- (0, import_build_utils12.download)(diagnostics, (0, import_path27.join)(outputDir, "diagnostics")).then(
123433
+ (0, import_build_utils14.download)(diagnostics, (0, import_path27.join)(outputDir, "diagnostics")).then(
123438
123434
  () => void 0,
123439
123435
  (err) => err
123440
123436
  )
@@ -123451,7 +123447,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
123451
123447
  }
123452
123448
  }
123453
123449
  let needBuildsJsonOverride = false;
123454
- const speedInsightsVersion = await (0, import_build_utils12.getInstalledPackageVersion)(
123450
+ const speedInsightsVersion = await (0, import_build_utils14.getInstalledPackageVersion)(
123455
123451
  "@vercel/speed-insights"
123456
123452
  );
123457
123453
  if (speedInsightsVersion) {
@@ -123461,7 +123457,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
123461
123457
  };
123462
123458
  needBuildsJsonOverride = true;
123463
123459
  }
123464
- const webAnalyticsVersion = await (0, import_build_utils12.getInstalledPackageVersion)("@vercel/analytics");
123460
+ const webAnalyticsVersion = await (0, import_build_utils14.getInstalledPackageVersion)("@vercel/analytics");
123465
123461
  if (webAnalyticsVersion) {
123466
123462
  buildsJson.features = {
123467
123463
  ...buildsJson.features ?? {},
@@ -123567,7 +123563,7 @@ async function getFramework(cwd, buildResults) {
123567
123563
  }
123568
123564
  function expandBuild(files, build2) {
123569
123565
  if (!build2.use) {
123570
- throw new import_build_utils12.NowBuildError({
123566
+ throw new import_build_utils14.NowBuildError({
123571
123567
  code: `invalid_build_specification`,
123572
123568
  message: "Field `use` is missing in build specification",
123573
123569
  link: "https://vercel.com/docs/concepts/projects/project-configuration#builds",
@@ -123576,7 +123572,7 @@ function expandBuild(files, build2) {
123576
123572
  }
123577
123573
  let src = (0, import_path27.normalize)(build2.src || "**").split(import_path27.sep).join("/");
123578
123574
  if (src === "." || src === "./") {
123579
- throw new import_build_utils12.NowBuildError({
123575
+ throw new import_build_utils14.NowBuildError({
123580
123576
  code: `invalid_build_specification`,
123581
123577
  message: "A build `src` path resolves to an empty string",
123582
123578
  link: "https://vercel.com/docs/concepts/projects/project-configuration#builds",
@@ -123663,7 +123659,7 @@ async function getFrameworkRoutes(framework, dirPrefix) {
123663
123659
  }
123664
123660
  return routes2;
123665
123661
  }
123666
- var import_fs_extra18, import_chalk50, import_dotenv, import_semver3, import_minimatch2, import_path27, import_frameworks4, import_build_utils12, import_fs_detectors4, import_routing_utils2, import_client8;
123662
+ var import_fs_extra18, import_chalk50, import_dotenv, import_semver3, import_minimatch2, import_path27, import_frameworks4, import_build_utils14, import_fs_detectors4, import_routing_utils2, import_client9;
123667
123663
  var init_build2 = __esm({
123668
123664
  "src/commands/build/index.ts"() {
123669
123665
  "use strict";
@@ -123674,10 +123670,10 @@ var init_build2 = __esm({
123674
123670
  import_minimatch2 = __toESM3(require_minimatch2());
123675
123671
  import_path27 = require("path");
123676
123672
  import_frameworks4 = __toESM3(require_frameworks());
123677
- import_build_utils12 = require("@vercel/build-utils");
123673
+ import_build_utils14 = require("@vercel/build-utils");
123678
123674
  import_fs_detectors4 = __toESM3(require_dist27());
123679
123675
  import_routing_utils2 = __toESM3(require_dist29());
123680
- import_client8 = __toESM3(require_dist13());
123676
+ import_client9 = __toESM3(require_dist13());
123681
123677
  init_pull4();
123682
123678
  init_get_files();
123683
123679
  init_get_args();
@@ -124808,12 +124804,12 @@ var init_print_deployment_status = __esm({
124808
124804
  function isValidArchive(archive) {
124809
124805
  return validArchiveFormats.has(archive);
124810
124806
  }
124811
- var import_client9, validArchiveFormats;
124807
+ var import_client10, validArchiveFormats;
124812
124808
  var init_validate_archive_format = __esm({
124813
124809
  "src/util/deploy/validate-archive-format.ts"() {
124814
124810
  "use strict";
124815
- import_client9 = __toESM3(require_dist13());
124816
- validArchiveFormats = new Set(import_client9.VALID_ARCHIVE_FORMATS);
124811
+ import_client10 = __toESM3(require_dist13());
124812
+ validArchiveFormats = new Set(import_client10.VALID_ARCHIVE_FORMATS);
124817
124813
  }
124818
124814
  });
124819
124815
 
@@ -124861,12 +124857,12 @@ var init_parse_meta = __esm({
124861
124857
  });
124862
124858
 
124863
124859
  // src/util/telemetry/commands/deploy/index.ts
124864
- var import_client10, DeployTelemetryClient;
124860
+ var import_client11, DeployTelemetryClient;
124865
124861
  var init_deploy = __esm({
124866
124862
  "src/util/telemetry/commands/deploy/index.ts"() {
124867
124863
  "use strict";
124868
124864
  init_telemetry();
124869
- import_client10 = __toESM3(require_dist13());
124865
+ import_client11 = __toESM3(require_dist13());
124870
124866
  DeployTelemetryClient = class extends TelemetryClient {
124871
124867
  trackCliArgumentProjectPath(projectPaths) {
124872
124868
  if (projectPaths) {
@@ -124878,7 +124874,7 @@ var init_deploy = __esm({
124878
124874
  }
124879
124875
  trackCliOptionArchive(format4) {
124880
124876
  if (format4) {
124881
- const allowedFormat = import_client10.VALID_ARCHIVE_FORMATS.includes(format4) ? format4 : this.redactedValue;
124877
+ const allowedFormat = import_client11.VALID_ARCHIVE_FORMATS.includes(format4) ? format4 : this.redactedValue;
124882
124878
  this.trackCliOption({
124883
124879
  option: "archive",
124884
124880
  value: allowedFormat
@@ -125020,8 +125016,8 @@ function handleCreateDeployError(error3, localConfig) {
125020
125016
  return 1;
125021
125017
  }
125022
125018
  if (error3 instanceof SchemaValidationFailed) {
125023
- const niceError = (0, import_build_utils13.getPrettyError)(error3.meta);
125024
- const fileName = localConfig[import_client11.fileNameSymbol] || "vercel.json";
125019
+ const niceError = (0, import_build_utils15.getPrettyError)(error3.meta);
125020
+ const fileName = localConfig[import_client12.fileNameSymbol] || "vercel.json";
125025
125021
  niceError.message = `Invalid ${fileName} - ${niceError.message}`;
125026
125022
  output_manager_default.prettyError(niceError);
125027
125023
  return 1;
@@ -125058,12 +125054,12 @@ function handleCreateDeployError(error3, localConfig) {
125058
125054
  }
125059
125055
  return error3;
125060
125056
  }
125061
- var import_build_utils13, import_client11, import_error_utils18, import_bytes5, import_chalk58, import_fs_extra20, import_ms11, import_path31, deploy_default, addProcessEnv;
125057
+ var import_build_utils15, import_client12, import_error_utils18, import_bytes5, import_chalk58, import_fs_extra20, import_ms11, import_path31, deploy_default, addProcessEnv;
125062
125058
  var init_deploy2 = __esm({
125063
125059
  "src/commands/deploy/index.ts"() {
125064
125060
  "use strict";
125065
- import_build_utils13 = require("@vercel/build-utils");
125066
- import_client11 = __toESM3(require_dist13());
125061
+ import_build_utils15 = require("@vercel/build-utils");
125062
+ import_client12 = __toESM3(require_dist13());
125067
125063
  import_error_utils18 = __toESM3(require_dist2());
125068
125064
  import_bytes5 = __toESM3(require_bytes());
125069
125065
  import_chalk58 = __toESM3(require_source());
@@ -125087,12 +125083,6 @@ var init_deploy2 = __esm({
125087
125083
  init_get_deployment();
125088
125084
  init_get_flags_specification();
125089
125085
  init_get_project_name();
125090
- init_humanize_path();
125091
- init_confirm();
125092
- init_edit_project_settings();
125093
- init_input_project();
125094
- init_input_root_directory();
125095
- init_select_org();
125096
125086
  init_code();
125097
125087
  init_highlight();
125098
125088
  init_param();
@@ -125100,7 +125090,6 @@ var init_deploy2 = __esm({
125100
125090
  init_parse_env();
125101
125091
  init_parse_meta();
125102
125092
  init_pkg_name();
125103
- init_link2();
125104
125093
  init_project_settings();
125105
125094
  init_validate_paths();
125106
125095
  init_help();
@@ -125108,6 +125097,7 @@ var init_deploy2 = __esm({
125108
125097
  init_parse_target();
125109
125098
  init_deploy();
125110
125099
  init_output_manager();
125100
+ init_ensure_link();
125111
125101
  deploy_default = async (client2) => {
125112
125102
  const telemetryClient = new DeployTelemetryClient({
125113
125103
  opts: {
@@ -125169,8 +125159,9 @@ var init_deploy2 = __esm({
125169
125159
  }
125170
125160
  let localConfig = client2.localConfig || readLocalConfig(paths[0]);
125171
125161
  if (localConfig) {
125162
+ client2.localConfig = localConfig;
125172
125163
  const { version: version2 } = localConfig;
125173
- const file = highlight(localConfig[import_client11.fileNameSymbol]);
125164
+ const file = highlight(localConfig[import_client12.fileNameSymbol]);
125174
125165
  const prop = code("version");
125175
125166
  if (version2) {
125176
125167
  if (typeof version2 === "number") {
@@ -125223,82 +125214,31 @@ var init_deploy2 = __esm({
125223
125214
  });
125224
125215
  const archive = parsedArguments.flags["--archive"];
125225
125216
  if (typeof archive === "string" && !isValidArchive(archive)) {
125226
- output_manager_default.error(`Format must be one of: ${import_client11.VALID_ARCHIVE_FORMATS.join(", ")}`);
125217
+ output_manager_default.error(`Format must be one of: ${import_client12.VALID_ARCHIVE_FORMATS.join(", ")}`);
125227
125218
  return 1;
125228
125219
  }
125229
- const link4 = await getLinkedProject(client2, cwd);
125230
- if (link4.status === "error") {
125231
- return link4.exitCode;
125232
- }
125233
- let { org, project, status: status2 } = link4;
125234
- let newProjectName = null;
125235
- let rootDirectory = project ? project.rootDirectory : null;
125236
- let sourceFilesOutsideRootDirectory = true;
125237
- if (status2 === "not_linked") {
125238
- const shouldStartSetup = autoConfirm || await confirm(
125239
- client2,
125240
- `Set up and deploy ${import_chalk58.default.cyan(`\u201C${humanizePath(cwd)}\u201D`)}?`,
125241
- true
125242
- );
125243
- if (!shouldStartSetup) {
125244
- output_manager_default.print(`Canceled. Project not set up.
125245
- `);
125246
- return 0;
125247
- }
125248
- try {
125249
- org = await selectOrg(
125250
- client2,
125251
- "Which scope do you want to deploy to?",
125252
- autoConfirm
125253
- );
125254
- } catch (err) {
125255
- if ((0, import_error_utils18.isErrnoException)(err) && (err.code === "NOT_AUTHORIZED" || err.code === "TEAM_DELETED")) {
125256
- output_manager_default.error(err.message);
125257
- return 1;
125258
- }
125259
- throw err;
125260
- }
125261
- const detectedProjectName = getProjectName({
125220
+ const link4 = await ensureLink("deploy", client2, cwd, {
125221
+ autoConfirm,
125222
+ setupMsg: "Set up and deploy",
125223
+ projectName: getProjectName({
125262
125224
  nameParam: parsedArguments.flags["--name"],
125263
125225
  nowConfig: localConfig,
125264
125226
  paths
125265
- });
125266
- const projectOrNewProjectName = await inputProject(
125267
- client2,
125268
- org,
125269
- detectedProjectName,
125270
- autoConfirm
125271
- );
125272
- if (typeof projectOrNewProjectName === "string") {
125273
- newProjectName = projectOrNewProjectName;
125274
- rootDirectory = await inputRootDirectory(client2, cwd, autoConfirm);
125275
- } else {
125276
- project = projectOrNewProjectName;
125277
- rootDirectory = project.rootDirectory;
125278
- sourceFilesOutsideRootDirectory = project.sourceFilesOutsideRootDirectory;
125279
- await linkFolderToProject(
125280
- client2,
125281
- cwd,
125282
- {
125283
- projectId: project.id,
125284
- orgId: org.id
125285
- },
125286
- project.name,
125287
- org.slug
125288
- );
125289
- status2 = "linked";
125290
- }
125227
+ })
125228
+ });
125229
+ if (typeof link4 === "number") {
125230
+ return link4;
125291
125231
  }
125292
- if (link4.status === "linked" && link4.repoRoot) {
125232
+ const { org, project } = link4;
125233
+ const rootDirectory = project.rootDirectory;
125234
+ const sourceFilesOutsideRootDirectory = project.sourceFilesOutsideRootDirectory ?? true;
125235
+ if (link4.repoRoot) {
125293
125236
  cwd = link4.repoRoot;
125294
125237
  }
125295
- if (!org) {
125296
- throw new Error(`"org" is not defined`);
125297
- }
125298
125238
  let vercelOutputDir;
125299
125239
  if (parsedArguments.flags["--prebuilt"]) {
125300
125240
  vercelOutputDir = (0, import_path31.join)(cwd, ".vercel/output");
125301
- if (link4.status === "linked" && link4.repoRoot && link4.project.rootDirectory) {
125241
+ if (link4.repoRoot && link4.project.rootDirectory) {
125302
125242
  vercelOutputDir = (0, import_path31.join)(cwd, link4.project.rootDirectory, ".vercel/output");
125303
125243
  }
125304
125244
  const prebuiltExists = await import_fs_extra20.default.pathExists(vercelOutputDir);
@@ -125341,10 +125281,9 @@ var init_deploy2 = __esm({
125341
125281
  }
125342
125282
  const contextName = org.slug;
125343
125283
  client2.config.currentTeam = org.type === "team" ? org.id : void 0;
125344
- const sourcePath = rootDirectory && !sourceFilesOutsideRootDirectory ? (0, import_path31.join)(cwd, rootDirectory) : cwd;
125345
125284
  if (rootDirectory && await validateRootDirectory(
125346
125285
  cwd,
125347
- sourcePath,
125286
+ (0, import_path31.join)(cwd, rootDirectory),
125348
125287
  project ? `To change your Project Settings, go to https://vercel.com/${org?.slug}/${project.name}/settings` : ""
125349
125288
  ) === false) {
125350
125289
  return 1;
@@ -125358,7 +125297,7 @@ var init_deploy2 = __esm({
125358
125297
  output_manager_default.print(
125359
125298
  `${prependEmoji(
125360
125299
  `The ${highlight(
125361
- localConfig[import_client11.fileNameSymbol]
125300
+ localConfig[import_client12.fileNameSymbol]
125362
125301
  )} file should be inside of the provided root directory.`,
125363
125302
  emoji("warning")
125364
125303
  )}
@@ -125371,7 +125310,7 @@ var init_deploy2 = __esm({
125371
125310
  output_manager_default.print(
125372
125311
  `${prependEmoji(
125373
125312
  `The ${code("name")} property in ${highlight(
125374
- localConfig[import_client11.fileNameSymbol]
125313
+ localConfig[import_client12.fileNameSymbol]
125375
125314
  )} is deprecated (https://vercel.link/name-prop)`,
125376
125315
  emoji("warning")
125377
125316
  )}
@@ -125382,7 +125321,7 @@ var init_deploy2 = __esm({
125382
125321
  if (typeof localConfig.env !== "undefined" && !isObject2(localConfig.env)) {
125383
125322
  error3(
125384
125323
  `The ${code("env")} property in ${highlight(
125385
- localConfig[import_client11.fileNameSymbol]
125324
+ localConfig[import_client12.fileNameSymbol]
125386
125325
  )} needs to be an object`
125387
125326
  );
125388
125327
  return 1;
@@ -125391,7 +125330,7 @@ var init_deploy2 = __esm({
125391
125330
  if (!isObject2(localConfig.build)) {
125392
125331
  error3(
125393
125332
  `The ${code("build")} property in ${highlight(
125394
- localConfig[import_client11.fileNameSymbol]
125333
+ localConfig[import_client12.fileNameSymbol]
125395
125334
  )} needs to be an object`
125396
125335
  );
125397
125336
  return 1;
@@ -125399,7 +125338,7 @@ var init_deploy2 = __esm({
125399
125338
  if (typeof localConfig.build.env !== "undefined" && !isObject2(localConfig.build.env)) {
125400
125339
  error3(
125401
125340
  `The ${code("build.env")} property in ${highlight(
125402
- localConfig[import_client11.fileNameSymbol]
125341
+ localConfig[import_client12.fileNameSymbol]
125403
125342
  )} needs to be an object`
125404
125343
  );
125405
125344
  return 1;
@@ -125430,7 +125369,7 @@ var init_deploy2 = __esm({
125430
125369
  }
125431
125370
  const regionFlag = (parsedArguments.flags["--regions"] || "").split(",").map((s) => s.trim()).filter(Boolean);
125432
125371
  const regions = regionFlag.length > 0 ? regionFlag : localConfig.regions;
125433
- const currentTeam = org?.type === "team" ? org.id : void 0;
125372
+ const currentTeam = org.type === "team" ? org.id : void 0;
125434
125373
  const now = new Now({
125435
125374
  client: client2,
125436
125375
  currentTeam
@@ -125439,7 +125378,7 @@ var init_deploy2 = __esm({
125439
125378
  let deployment = null;
125440
125379
  const noWait = !!parsedArguments.flags["--no-wait"];
125441
125380
  const localConfigurationOverrides = pickOverrides(localConfig);
125442
- const name = project ? project.name : newProjectName;
125381
+ const name = project.name;
125443
125382
  if (!name) {
125444
125383
  throw new Error(
125445
125384
  "`name` not found on project or provided by existing project"
@@ -125479,16 +125418,11 @@ var init_deploy2 = __esm({
125479
125418
  if (!localConfig.builds || localConfig.builds.length === 0) {
125480
125419
  createArgs.projectSettings = {
125481
125420
  sourceFilesOutsideRootDirectory,
125482
- rootDirectory
125421
+ rootDirectory,
125422
+ ...localConfigurationOverrides
125483
125423
  };
125484
- if (status2 === "linked") {
125485
- createArgs.projectSettings = {
125486
- ...createArgs.projectSettings,
125487
- ...localConfigurationOverrides
125488
- };
125489
- }
125490
125424
  }
125491
- const { packageJson } = await (0, import_build_utils13.scanParentDirs)(
125425
+ const { packageJson } = await (0, import_build_utils15.scanParentDirs)(
125492
125426
  (0, import_path31.join)(cwd, project?.rootDirectory ?? ""),
125493
125427
  true,
125494
125428
  cwd
@@ -125496,7 +125430,7 @@ var init_deploy2 = __esm({
125496
125430
  let nodeVersion;
125497
125431
  if (packageJson?.engines?.node) {
125498
125432
  try {
125499
- const { range } = await (0, import_build_utils13.getSupportedNodeVersion)(
125433
+ const { range } = await (0, import_build_utils15.getSupportedNodeVersion)(
125500
125434
  packageJson.engines.node
125501
125435
  );
125502
125436
  nodeVersion = range;
@@ -125513,42 +125447,12 @@ var init_deploy2 = __esm({
125513
125447
  client2,
125514
125448
  now,
125515
125449
  contextName,
125516
- sourcePath,
125450
+ cwd,
125517
125451
  createArgs,
125518
125452
  org,
125519
125453
  !project,
125520
- cwd,
125521
125454
  archive
125522
125455
  );
125523
- if (deployment.code === "missing_project_settings") {
125524
- let { projectSettings, framework } = deployment;
125525
- if (rootDirectory) {
125526
- projectSettings.rootDirectory = rootDirectory;
125527
- }
125528
- if (typeof sourceFilesOutsideRootDirectory !== "undefined") {
125529
- projectSettings.sourceFilesOutsideRootDirectory = sourceFilesOutsideRootDirectory;
125530
- }
125531
- const settings = await editProjectSettings(
125532
- client2,
125533
- projectSettings,
125534
- framework,
125535
- false,
125536
- localConfigurationOverrides
125537
- );
125538
- createArgs.projectSettings = settings;
125539
- deployStamp = stamp_default();
125540
- createArgs.deployStamp = deployStamp;
125541
- deployment = await createDeploy(
125542
- client2,
125543
- now,
125544
- contextName,
125545
- sourcePath,
125546
- createArgs,
125547
- org,
125548
- false,
125549
- cwd
125550
- );
125551
- }
125552
125456
  if (deployment instanceof NotDomainOwner) {
125553
125457
  output_manager_default.error(deployment.message);
125554
125458
  return 1;
@@ -141379,14 +141283,14 @@ var require_is_port_reachable = __commonJS2({
141379
141283
 
141380
141284
  // src/util/path-helpers.ts
141381
141285
  function relative6(a, b) {
141382
- return (0, import_build_utils14.normalizePath)((0, import_path32.relative)(a, b));
141286
+ return (0, import_build_utils16.normalizePath)((0, import_path32.relative)(a, b));
141383
141287
  }
141384
- var import_path32, import_build_utils14;
141288
+ var import_path32, import_build_utils16;
141385
141289
  var init_path_helpers = __esm({
141386
141290
  "src/util/path-helpers.ts"() {
141387
141291
  "use strict";
141388
141292
  import_path32 = require("path");
141389
- import_build_utils14 = require("@vercel/build-utils");
141293
+ import_build_utils16 = require("@vercel/build-utils");
141390
141294
  }
141391
141295
  });
141392
141296
 
@@ -142028,7 +141932,7 @@ Please run \`${await getUpdateCommand()}\` to update to the latest CLI.`
142028
141932
  const { output: buildOutput } = result;
142029
141933
  const { cleanUrls } = vercelConfig;
142030
141934
  for (const [originalPath, value] of Object.entries(buildOutput)) {
142031
- let path11 = (0, import_build_utils15.normalizePath)(originalPath);
141935
+ let path11 = (0, import_build_utils17.normalizePath)(originalPath);
142032
141936
  if (cleanUrls && path11.endsWith(".html")) {
142033
141937
  path11 = path11.slice(0, -5);
142034
141938
  if (value.type === "FileBlob" || value.type === "FileFsRef") {
@@ -142048,16 +141952,16 @@ Please run \`${await getUpdateCommand()}\` to update to the latest CLI.`
142048
141952
  let fileBlob;
142049
141953
  switch (obj.type) {
142050
141954
  case "FileFsRef":
142051
- fileRef = Object.assign(Object.create(import_build_utils15.FileFsRef.prototype), obj);
141955
+ fileRef = Object.assign(Object.create(import_build_utils17.FileFsRef.prototype), obj);
142052
141956
  buildOutput[name] = fileRef;
142053
141957
  break;
142054
141958
  case "FileBlob":
142055
- fileBlob = Object.assign(Object.create(import_build_utils15.FileBlob.prototype), obj);
141959
+ fileBlob = Object.assign(Object.create(import_build_utils17.FileBlob.prototype), obj);
142056
141960
  fileBlob.data = Buffer.from(obj.data.data);
142057
141961
  buildOutput[name] = fileBlob;
142058
141962
  break;
142059
141963
  case "Lambda":
142060
- lambda = Object.assign(Object.create(import_build_utils15.Lambda.prototype), obj);
141964
+ lambda = Object.assign(Object.create(import_build_utils17.Lambda.prototype), obj);
142061
141965
  lambda.zipBuffer = Buffer.from(obj.zipBuffer.data);
142062
141966
  buildOutput[name] = lambda;
142063
141967
  break;
@@ -142208,7 +142112,7 @@ async function shutdownBuilder(match) {
142208
142112
  }
142209
142113
  await Promise.all(ops);
142210
142114
  }
142211
- var import_ms12, import_bytes6, import_path34, import_child_process3, import_fun, import_build_utils15, import_fs_detectors5, import_pluralize6, import_minimatch3, import_routing_utils4;
142115
+ var import_ms12, import_bytes6, import_path34, import_child_process3, import_fun, import_build_utils17, import_fs_detectors5, import_pluralize6, import_minimatch3, import_routing_utils4;
142212
142116
  var init_builder = __esm({
142213
142117
  "src/util/dev/builder.ts"() {
142214
142118
  "use strict";
@@ -142217,7 +142121,7 @@ var init_builder = __esm({
142217
142121
  import_path34 = require("path");
142218
142122
  import_child_process3 = require("child_process");
142219
142123
  import_fun = require("@vercel/fun");
142220
- import_build_utils15 = require("@vercel/build-utils");
142124
+ import_build_utils17 = require("@vercel/build-utils");
142221
142125
  import_fs_detectors5 = __toESM3(require_dist27());
142222
142126
  import_pluralize6 = __toESM3(require_pluralize());
142223
142127
  import_minimatch3 = __toESM3(require_minimatch2());
@@ -142765,7 +142669,7 @@ function buildMatchEquals(a, b) {
142765
142669
  return false;
142766
142670
  return true;
142767
142671
  }
142768
- var import_url18, import_http3, import_fs_extra21, import_ms13, import_chalk59, import_node_fetch5, import_pluralize7, import_raw_body, import_async_listen3, import_minimatch4, import_http_proxy, import_crypto2, import_serve_handler, import_chokidar, import_dotenv2, import_path35, import_once, import_directory, import_get_port, import_is_port_reachable, import_fast_deep_equal, import_npm_package_arg2, import_json_parse_better_errors3, import_client12, import_routing_utils5, import_build_utils16, import_fs_detectors6, import_frameworks5, import_error_utils19, frontendRuntimeSet, DEV_SERVER_PORT_BIND_TIMEOUT, DevServer;
142672
+ var import_url18, import_http3, import_fs_extra21, import_ms13, import_chalk59, import_node_fetch5, import_pluralize7, import_raw_body, import_async_listen3, import_minimatch4, import_http_proxy, import_crypto2, import_serve_handler, import_chokidar, import_dotenv2, import_path35, import_once, import_directory, import_get_port, import_is_port_reachable, import_fast_deep_equal, import_npm_package_arg2, import_json_parse_better_errors3, import_client13, import_routing_utils5, import_build_utils18, import_fs_detectors6, import_frameworks5, import_error_utils19, frontendRuntimeSet, DEV_SERVER_PORT_BIND_TIMEOUT, DevServer;
142769
142673
  var init_server = __esm({
142770
142674
  "src/util/dev/server.ts"() {
142771
142675
  "use strict";
@@ -142792,9 +142696,9 @@ var init_server = __esm({
142792
142696
  import_fast_deep_equal = __toESM3(require_fast_deep_equal());
142793
142697
  import_npm_package_arg2 = __toESM3(require_npa());
142794
142698
  import_json_parse_better_errors3 = __toESM3(require_json_parse_better_errors());
142795
- import_client12 = __toESM3(require_dist13());
142699
+ import_client13 = __toESM3(require_dist13());
142796
142700
  import_routing_utils5 = __toESM3(require_dist29());
142797
- import_build_utils16 = require("@vercel/build-utils");
142701
+ import_build_utils18 = require("@vercel/build-utils");
142798
142702
  import_fs_detectors6 = __toESM3(require_dist27());
142799
142703
  import_frameworks5 = __toESM3(require_frameworks());
142800
142704
  init_cmd();
@@ -143614,10 +143518,10 @@ Please ensure that ${cmd(err.path)} is properly installed`;
143614
143518
  const name = relative6(this.cwd, fsPath);
143615
143519
  try {
143616
143520
  await this.getVercelConfig();
143617
- this.files[name] = await import_build_utils16.FileFsRef.fromFsPath({ fsPath });
143521
+ this.files[name] = await import_build_utils18.FileFsRef.fromFsPath({ fsPath });
143618
143522
  const extensionless = this.getExtensionlessFile(name);
143619
143523
  if (extensionless) {
143620
- this.files[extensionless] = await import_build_utils16.FileFsRef.fromFsPath({ fsPath });
143524
+ this.files[extensionless] = await import_build_utils18.FileFsRef.fromFsPath({ fsPath });
143621
143525
  }
143622
143526
  fileChanged(name, changed, removed);
143623
143527
  output_manager_default.debug(`File created: ${name}`);
@@ -143643,7 +143547,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
143643
143547
  async handleFileModified(fsPath, changed, removed) {
143644
143548
  const name = relative6(this.cwd, fsPath);
143645
143549
  try {
143646
- this.files[name] = await import_build_utils16.FileFsRef.fromFsPath({ fsPath });
143550
+ this.files[name] = await import_build_utils18.FileFsRef.fromFsPath({ fsPath });
143647
143551
  fileChanged(name, changed, removed);
143648
143552
  output_manager_default.debug(`File modified: ${name}`);
143649
143553
  } catch (err) {
@@ -143780,7 +143684,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
143780
143684
  pkg = null,
143781
143685
  // The default empty `vercel.json` is used to serve all
143782
143686
  // files as static when no `vercel.json` is present
143783
- vercelConfig = { version: 2, [import_client12.fileNameSymbol]: "vercel.json" }
143687
+ vercelConfig = { version: 2, [import_client13.fileNameSymbol]: "vercel.json" }
143784
143688
  ] = await Promise.all([
143785
143689
  this.readJsonFile("package.json"),
143786
143690
  this.readJsonFile(configPath)
@@ -143864,7 +143768,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
143864
143768
  if (!this.vercelConfigWarning) {
143865
143769
  this.vercelConfigWarning = true;
143866
143770
  output_manager_default.warn(
143867
- `The "has" property in ${vercelConfig[import_client12.fileNameSymbol]} will be ignored during development. Deployments will work as expected.`
143771
+ `The "has" property in ${vercelConfig[import_client13.fileNameSymbol]} will be ignored during development. Deployments will work as expected.`
143868
143772
  );
143869
143773
  }
143870
143774
  return false;
@@ -143913,7 +143817,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
143913
143817
  try {
143914
143818
  const raw = await import_fs_extra21.default.readFile(abs, "utf8");
143915
143819
  const parsed = (0, import_json_parse_better_errors3.default)(raw);
143916
- parsed[import_client12.fileNameSymbol] = rel;
143820
+ parsed[import_client13.fileNameSymbol] = rel;
143917
143821
  return parsed;
143918
143822
  } catch (err) {
143919
143823
  if ((0, import_error_utils19.isError)(err)) {
@@ -144009,7 +143913,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
144009
143913
  if (!import_fs_extra21.default.lstatSync(this.cwd).isDirectory()) {
144010
143914
  throw new Error(`${import_chalk59.default.bold(this.cwd)} is not a directory`);
144011
143915
  }
144012
- const { ig } = await (0, import_client12.getVercelIgnore)(this.cwd);
143916
+ const { ig } = await (0, import_client13.getVercelIgnore)(this.cwd);
144013
143917
  this.filter = ig.createFilter();
144014
143918
  let address = null;
144015
143919
  while (typeof address !== "string") {
@@ -144048,10 +143952,10 @@ Please ensure that ${cmd(err.path)} is properly installed`;
144048
143952
  for (const fsPath of files) {
144049
143953
  let path11 = relative6(this.cwd, fsPath);
144050
143954
  const { mode } = await import_fs_extra21.default.stat(fsPath);
144051
- this.files[path11] = new import_build_utils16.FileFsRef({ mode, fsPath });
143955
+ this.files[path11] = new import_build_utils18.FileFsRef({ mode, fsPath });
144052
143956
  const extensionless = this.getExtensionlessFile(path11);
144053
143957
  if (extensionless) {
144054
- this.files[extensionless] = new import_build_utils16.FileFsRef({ mode, fsPath });
143958
+ this.files[extensionless] = new import_build_utils18.FileFsRef({ mode, fsPath });
144055
143959
  }
144056
143960
  }
144057
143961
  await this.updateBuildMatches(vercelConfig, true);
@@ -144420,7 +144324,7 @@ ${error_code}
144420
144324
  }
144421
144325
  output_manager_default.log(`Running Dev Command ${import_chalk59.default.cyan.bold(`\u201C${devCommand2}\u201D`)}`);
144422
144326
  const port = await (0, import_get_port.default)();
144423
- const env = (0, import_build_utils16.cloneEnv)(
144327
+ const env = (0, import_build_utils18.cloneEnv)(
144424
144328
  {
144425
144329
  // Because of child process 'pipe' below, isTTY will be false.
144426
144330
  // Most frameworks use `chalk`/`supports-color` so we enable it anyway.
@@ -144436,7 +144340,7 @@ ${error_code}
144436
144340
  PORT: `${port}`
144437
144341
  }
144438
144342
  );
144439
- const nodeBinPaths = (0, import_build_utils16.getNodeBinPaths)({ base: this.repoRoot, start: cwd });
144343
+ const nodeBinPaths = (0, import_build_utils18.getNodeBinPaths)({ base: this.repoRoot, start: cwd });
144440
144344
  const nodeBinPath = nodeBinPaths.join(import_path35.default.delimiter);
144441
144345
  env.PATH = `${nodeBinPath}${import_path35.default.delimiter}${env.PATH}`;
144442
144346
  let command = devCommand2.replace(/\$PORT/g, `${port}`).replace(/%PORT%/g, `${port}`);
@@ -144449,7 +144353,7 @@ ${error_code}
144449
144353
  );
144450
144354
  output_manager_default.debug(`Spawning dev command: ${command}`);
144451
144355
  const proxyPort = new RegExp(port.toString(), "g");
144452
- const p = (0, import_build_utils16.spawnCommand)(command, {
144356
+ const p = (0, import_build_utils18.spawnCommand)(command, {
144453
144357
  stdio: ["inherit", "pipe", "pipe"],
144454
144358
  cwd,
144455
144359
  env
@@ -149228,7 +149132,7 @@ async function disconnect(client2, argv) {
149228
149132
  `Your Vercel project will no longer create deployments when you push to this repository.
149229
149133
  `
149230
149134
  );
149231
- const confirmDisconnect = await confirm(
149135
+ const confirmDisconnect = autoConfirm || await confirm(
149232
149136
  client2,
149233
149137
  `Are you sure you want to disconnect ${import_chalk85.default.cyan(
149234
149138
  `${linkOrg}/${repo}`
@@ -149491,12 +149395,12 @@ async function init(client2, opts, args2, telemetry2) {
149491
149395
  const force = opts["--force"];
149492
149396
  const examples = await fetchExampleList(client2);
149493
149397
  if (!examples) {
149494
- throw new Error(`Could not fetch example list.`);
149398
+ throw new Error("Could not fetch example list.");
149495
149399
  }
149496
149400
  const exampleList = examples.filter((x) => x.visible).map((x) => x.name);
149497
149401
  if (!name) {
149498
149402
  if (client2.stdin.isTTY !== true) {
149499
- output_manager_default.print(`No framework provided`);
149403
+ output_manager_default.print("No framework provided");
149500
149404
  return 0;
149501
149405
  }
149502
149406
  const chosen = await chooseFromDropdown(
@@ -149564,7 +149468,7 @@ async function extractExample(client2, name, dir, force, ver = "v2") {
149564
149468
  const successLog = `Initialized "${import_chalk87.default.bold(
149565
149469
  name
149566
149470
  )}" example in ${import_chalk87.default.bold(humanizePath(folder))}.`;
149567
- const folderRel = import_path41.default.relative(client2.cwd, folder);
149471
+ const folderRel = import_node_path2.default.relative(client2.cwd, folder);
149568
149472
  const deployHint = folderRel === "" ? list_item_default(`To deploy, run ${getCommandName()}.`) : list_item_default(
149569
149473
  `To deploy, ${cmd(
149570
149474
  `cd ${folderRel}`
@@ -149579,16 +149483,16 @@ ${deployHint}`);
149579
149483
  });
149580
149484
  }
149581
149485
  function prepareFolder(cwd, folder, force) {
149582
- const dest = import_path41.default.join(cwd, folder);
149583
- if (import_fs8.default.existsSync(dest)) {
149584
- if (!import_fs8.default.lstatSync(dest).isDirectory()) {
149486
+ const dest = import_node_path2.default.join(cwd, folder);
149487
+ if (import_node_fs.default.existsSync(dest)) {
149488
+ if (!import_node_fs.default.lstatSync(dest).isDirectory()) {
149585
149489
  throw new Error(
149586
149490
  `Destination path "${import_chalk87.default.bold(
149587
149491
  folder
149588
149492
  )}" already exists and is not a directory.`
149589
149493
  );
149590
149494
  }
149591
- if (!force && import_fs8.default.readdirSync(dest).length !== 0) {
149495
+ if (!force && import_node_fs.default.readdirSync(dest).length !== 0) {
149592
149496
  throw new Error(
149593
149497
  `Destination path "${import_chalk87.default.bold(
149594
149498
  folder
@@ -149599,7 +149503,7 @@ function prepareFolder(cwd, folder, force) {
149599
149503
  }
149600
149504
  } else if (dest !== cwd) {
149601
149505
  try {
149602
- import_fs8.default.mkdirSync(dest);
149506
+ import_node_fs.default.mkdirSync(dest);
149603
149507
  } catch (e2) {
149604
149508
  throw new Error(`Could not create directory "${import_chalk87.default.bold(folder)}".`);
149605
149509
  }
@@ -149609,7 +149513,7 @@ function prepareFolder(cwd, folder, force) {
149609
149513
  async function guess(client2, exampleList, name) {
149610
149514
  const GuessError = new Error(
149611
149515
  `No example found for ${import_chalk87.default.bold(name)}, run ${getCommandName(
149612
- `init`
149516
+ "init"
149613
149517
  )} to see the list of available examples.`
149614
149518
  );
149615
149519
  if (client2.stdin.isTTY !== true) {
@@ -149624,12 +149528,12 @@ async function guess(client2, exampleList, name) {
149624
149528
  throw GuessError;
149625
149529
  }
149626
149530
  }
149627
- var import_fs8, import_path41, import_tar_fs, import_chalk87, EXAMPLE_API;
149531
+ var import_node_fs, import_node_path2, import_tar_fs, import_chalk87, EXAMPLE_API;
149628
149532
  var init_init = __esm({
149629
149533
  "src/commands/init/init.ts"() {
149630
149534
  "use strict";
149631
- import_fs8 = __toESM3(require("fs"));
149632
- import_path41 = __toESM3(require("path"));
149535
+ import_node_fs = __toESM3(require("fs"));
149536
+ import_node_path2 = __toESM3(require("path"));
149633
149537
  import_tar_fs = __toESM3(require_tar_fs());
149634
149538
  import_chalk87 = __toESM3(require_source());
149635
149539
  init_list();
@@ -149682,8 +149586,7 @@ __export3(init_exports, {
149682
149586
  default: () => main8
149683
149587
  });
149684
149588
  async function main8(client2) {
149685
- let args2;
149686
- let parsedArgs = null;
149589
+ let parsedArgs;
149687
149590
  const flagsSpecification = getFlagsSpecification(initCommand.options);
149688
149591
  try {
149689
149592
  parsedArgs = parseArguments(client2.argv.slice(2), flagsSpecification);
@@ -149701,7 +149604,7 @@ async function main8(client2) {
149701
149604
  output_manager_default.print(help2(initCommand, { columns: client2.stderr.columns }));
149702
149605
  return 2;
149703
149606
  }
149704
- args2 = getSubcommand(parsedArgs.args.slice(1), COMMAND_CONFIG8).args;
149607
+ const args2 = getSubcommand(parsedArgs.args.slice(1), COMMAND_CONFIG8).args;
149705
149608
  if (parsedArgs.args.length > 3) {
149706
149609
  output_manager_default.error("Too many arguments.");
149707
149610
  return 1;
@@ -152451,7 +152354,7 @@ async function list3(client2) {
152451
152354
  let pagination;
152452
152355
  let contextName = "";
152453
152356
  let app = parsedArgs.args[1];
152454
- let deployments = [];
152357
+ const deployments = [];
152455
152358
  let singleDeployment = false;
152456
152359
  if (app) {
152457
152360
  if (!isValidName(app)) {
@@ -152543,11 +152446,11 @@ async function list3(client2) {
152543
152446
  }
152544
152447
  }
152545
152448
  if (!deployments.length) {
152546
- log2(`No deployments found.`);
152449
+ log2("No deployments found.");
152547
152450
  return 0;
152548
152451
  }
152549
152452
  log2(
152550
- `${target === "production" ? `Production deployments` : `Deployments`} for ${projectSlugLink} ${elapsed(Date.now() - start)}`
152453
+ `${target === "production" ? "Production deployments" : "Deployments"} for ${projectSlugLink} ${elapsed(Date.now() - start)}`
152551
152454
  );
152552
152455
  }
152553
152456
  const headers = ["Age", "Deployment", "Status", "Environment"];
@@ -152602,7 +152505,7 @@ ${tablePrint}
152602
152505
  const flags = getCommandFlags(parsedArgs.flags, ["--next"]);
152603
152506
  log2(
152604
152507
  `To display the next page, run ${getCommandName(
152605
- `ls${app ? " " + app : ""}${flags} --next ${pagination.next}`
152508
+ `ls${app ? ` ${app}` : ""}${flags} --next ${pagination.next}`
152606
152509
  )}`
152607
152510
  );
152608
152511
  }
@@ -153081,7 +152984,7 @@ async function main11(client2) {
153081
152984
  output_manager_default.spinner("Logging out\u2026", 200);
153082
152985
  let exitCode2 = 0;
153083
152986
  try {
153084
- await client2.fetch(`/v3/user/tokens/current`, {
152987
+ await client2.fetch("/v3/user/tokens/current", {
153085
152988
  method: "DELETE",
153086
152989
  useCurrentTeam: false
153087
152990
  });
@@ -153111,7 +153014,7 @@ async function main11(client2) {
153111
153014
  if (exitCode2 === 0) {
153112
153015
  output_manager_default.log("Logged out!");
153113
153016
  } else {
153114
- output_manager_default.error(`Failed during logout`);
153017
+ output_manager_default.error("Failed during logout");
153115
153018
  }
153116
153019
  return exitCode2;
153117
153020
  }
@@ -153300,7 +153203,7 @@ async function list4(client2, argv) {
153300
153203
  const elapsed2 = (0, import_ms21.default)(Date.now() - start);
153301
153204
  if (deprecated) {
153302
153205
  const upcomingDeprecationVersionsList = [];
153303
- for (const nodeVersion of import_build_utils17.NODE_VERSIONS) {
153206
+ for (const nodeVersion of import_build_utils19.NODE_VERSIONS) {
153304
153207
  if (nodeVersion.discontinueDate && nodeVersion.discontinueDate.valueOf() > Date.now()) {
153305
153208
  upcomingDeprecationVersionsList.push(nodeVersion.range);
153306
153209
  }
@@ -153351,7 +153254,7 @@ function getLatestProdUrl(project) {
153351
153254
  return `https://${alias2}`;
153352
153255
  return "--";
153353
153256
  }
153354
- var import_ms21, import_chalk101, import_build_utils17;
153257
+ var import_ms21, import_chalk101, import_build_utils19;
153355
153258
  var init_list8 = __esm({
153356
153259
  "src/commands/project/list.ts"() {
153357
153260
  "use strict";
@@ -153360,7 +153263,7 @@ var init_list8 = __esm({
153360
153263
  init_table();
153361
153264
  init_get_command_flags();
153362
153265
  init_pkg_name();
153363
- import_build_utils17 = require("@vercel/build-utils");
153266
+ import_build_utils19 = require("@vercel/build-utils");
153364
153267
  init_list7();
153365
153268
  init_output_manager();
153366
153269
  init_command21();
@@ -153947,14 +153850,13 @@ async function requestPromote({
153947
153850
  `Successfully created new deployment of ${import_chalk106.default.bold(project.name)} at ${newDeployment.inspectorUrl}`
153948
153851
  );
153949
153852
  return 0;
153950
- } else {
153951
- await client2.fetch(`/v10/projects/${project.id}/promote/${deployment.id}`, {
153952
- body: {},
153953
- // required
153954
- json: false,
153955
- method: "POST"
153956
- });
153957
153853
  }
153854
+ await client2.fetch(`/v10/projects/${project.id}/promote/${deployment.id}`, {
153855
+ body: {},
153856
+ // required
153857
+ json: false,
153858
+ method: "POST"
153859
+ });
153958
153860
  if (timeout !== void 0 && (0, import_ms24.default)(timeout) === 0) {
153959
153861
  output_manager_default.log(
153960
153862
  `Successfully requested promote of ${import_chalk106.default.bold(project.name)} to ${deployment.url} (${deployment.id})`
@@ -154065,7 +153967,7 @@ var init_promote2 = __esm({
154065
153967
  }
154066
153968
  const yes = parsedArgs.flags["--yes"] ?? false;
154067
153969
  telemetry2.trackCliFlagYes(parsedArgs.flags["--yes"]);
154068
- let timeout = parsedArgs.flags["--timeout"];
153970
+ const timeout = parsedArgs.flags["--timeout"];
154069
153971
  if (timeout && (0, import_ms25.default)(timeout) === void 0) {
154070
153972
  output_manager_default.error(`Invalid timeout "${timeout}"`);
154071
153973
  return 1;
@@ -154357,7 +154259,7 @@ async function redeploy(client2) {
154357
154259
  token: client2.authConfig.token,
154358
154260
  userAgent: ua_default
154359
154261
  };
154360
- for await (const event of (0, import_client13.checkDeploymentStatus)(
154262
+ for await (const event of (0, import_client14.checkDeploymentStatus)(
154361
154263
  deployment,
154362
154264
  clientOptions
154363
154265
  )) {
@@ -154404,12 +154306,12 @@ async function redeploy(client2) {
154404
154306
  return 1;
154405
154307
  }
154406
154308
  }
154407
- var import_chalk108, import_client13, import_error_utils30;
154309
+ var import_chalk108, import_client14, import_error_utils30;
154408
154310
  var init_redeploy2 = __esm({
154409
154311
  "src/commands/redeploy/index.ts"() {
154410
154312
  "use strict";
154411
154313
  import_chalk108 = __toESM3(require_source());
154412
- import_client13 = __toESM3(require_dist13());
154314
+ import_client14 = __toESM3(require_dist13());
154413
154315
  init_emoji();
154414
154316
  init_get_args();
154415
154317
  init_pkg_name();
@@ -154680,8 +154582,11 @@ async function remove5(client2) {
154680
154582
  return true;
154681
154583
  });
154682
154584
  if (deployments.length === 0 && projects.length === 0) {
154585
+ const safeUnaliased = parsedArgs.flags["--safe"] ? "unaliased" : "any";
154586
+ const stylizedIds = ids.map((id) => import_chalk109.default.bold(`"${id}"`)).join(", ");
154587
+ const commandName = getCommandName("projects ls");
154683
154588
  log2(
154684
- `Could not find ${parsedArgs.flags["--safe"] ? "unaliased" : "any"} deployments or projects matching ${ids.map((id) => import_chalk109.default.bold(`"${id}"`)).join(", ")}. Run ${getCommandName("projects ls")} to list.`
154589
+ `Could not find ${safeUnaliased} deployments or projects matching ${stylizedIds}. Run ${commandName} to list.`
154685
154590
  );
154686
154591
  return 1;
154687
154592
  }
@@ -154690,7 +154595,7 @@ async function remove5(client2) {
154690
154595
  );
154691
154596
  if (deployments.length > 200) {
154692
154597
  output_manager_default.warn(
154693
- `Only 200 deployments can get deleted at once. Please continue 10 minutes after deletion to remove the rest.`
154598
+ "Only 200 deployments can get deleted at once. Please continue 10 minutes after deletion to remove the rest."
154694
154599
  );
154695
154600
  }
154696
154601
  if (!skipConfirmation) {
@@ -155104,7 +155009,7 @@ var init_rollback2 = __esm({
155104
155009
  output_manager_default.print(help2(rollbackCommand, { columns: client2.stderr.columns }));
155105
155010
  return 2;
155106
155011
  }
155107
- let timeout = parsedArgs.flags["--timeout"];
155012
+ const timeout = parsedArgs.flags["--timeout"];
155108
155013
  if (timeout && (0, import_ms29.default)(timeout) === void 0) {
155109
155014
  output_manager_default.error(`Invalid timeout "${timeout}"`);
155110
155015
  return 1;
@@ -156457,8 +156362,8 @@ var init_whoami2 = __esm({
156457
156362
 
156458
156363
  // src/index.ts
156459
156364
  var import_error_utils34 = __toESM3(require_dist2());
156460
- var import_path42 = require("path");
156461
- var import_fs9 = require("fs");
156365
+ var import_path41 = require("path");
156366
+ var import_fs8 = require("fs");
156462
156367
  var import_fs_extra23 = __toESM3(require_lib());
156463
156368
  var import_chalk119 = __toESM3(require_source());
156464
156369
  var import_epipebomb = __toESM3(require_epipebomb());
@@ -157844,8 +157749,8 @@ var main14 = async () => {
157844
157749
  let subcommand = void 0;
157845
157750
  let userSuppliedSubCommand = "";
157846
157751
  if (targetOrSubcommand) {
157847
- const targetPath = (0, import_path42.join)(cwd, targetOrSubcommand);
157848
- const targetPathExists = (0, import_fs9.existsSync)(targetPath);
157752
+ const targetPath = (0, import_path41.join)(cwd, targetOrSubcommand);
157753
+ const targetPathExists = (0, import_fs8.existsSync)(targetPath);
157849
157754
  const subcommandExists = GLOBAL_COMMANDS.has(targetOrSubcommand) || commands.has(targetOrSubcommand);
157850
157755
  if (targetPathExists && subcommandExists && !parsedArgs.flags["--cwd"] && !process.env.NOW_BUILDER) {
157851
157756
  output_manager_default.warn(
@@ -158205,9 +158110,7 @@ var main14 = async () => {
158205
158110
  }
158206
158111
  return 1;
158207
158112
  }
158208
- if (subSubCommand !== "flush") {
158209
- await telemetryEventStore.save();
158210
- }
158113
+ await telemetryEventStore.save();
158211
158114
  return exitCode2;
158212
158115
  };
158213
158116
  var handleRejection = async (err) => {