vercel 39.0.2 → 39.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +285 -371
  2. package/package.json +3 -3
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;
@@ -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();
@@ -110093,7 +110101,6 @@ function printInspectUrl(inspectorUrl, deployStamp) {
110093
110101
  }
110094
110102
  async function processDeployment({
110095
110103
  org,
110096
- cwd,
110097
110104
  projectName,
110098
110105
  isSettingUpProject,
110099
110106
  archive,
@@ -110193,16 +110200,6 @@ async function processDeployment({
110193
110200
  }
110194
110201
  if (event.type === "created") {
110195
110202
  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
110203
  now.url = deployment.url;
110207
110204
  stopSpinner();
110208
110205
  printInspectUrl(deployment.inspectorUrl, deployStamp);
@@ -110217,7 +110214,7 @@ async function processDeployment({
110217
110214
  ) + `
110218
110215
  `
110219
110216
  );
110220
- if (quiet) {
110217
+ if (quiet || process.env.FORCE_TTY === "1") {
110221
110218
  process.stdout.write(`https://${event.payload.url}`);
110222
110219
  }
110223
110220
  if (noWait) {
@@ -110290,7 +110287,6 @@ var init_process_deployment = __esm({
110290
110287
  init_emoji();
110291
110288
  init_logs();
110292
110289
  init_progress();
110293
- init_link2();
110294
110290
  init_ua();
110295
110291
  init_output_manager();
110296
110292
  }
@@ -110398,7 +110394,6 @@ var init_util = __esm({
110398
110394
  isSettingUpProject,
110399
110395
  archive,
110400
110396
  skipAutoDetectionConfirmation,
110401
- cwd,
110402
110397
  prebuilt,
110403
110398
  vercelOutputDir,
110404
110399
  rootDirectory,
@@ -110770,6 +110765,13 @@ async function setupAndLink(client2, path11, {
110770
110765
  );
110771
110766
  return { status: "linked", org, project };
110772
110767
  } catch (err) {
110768
+ if (err instanceof SchemaValidationFailed) {
110769
+ const niceError = (0, import_build_utils7.getPrettyError)(err.meta);
110770
+ const fileName = localConfig?.[import_client5.fileNameSymbol] || "vercel.json";
110771
+ niceError.message = `Invalid ${fileName} - ${niceError.message}`;
110772
+ output_manager_default.prettyError(niceError);
110773
+ return { status: "error", exitCode: 1 };
110774
+ }
110773
110775
  if (isAPIError(err) && err.code === "too_many_projects") {
110774
110776
  output_manager_default.prettyError(err);
110775
110777
  return { status: "error", exitCode: 1, reason: "TOO_MANY_PROJECTS" };
@@ -110778,7 +110780,7 @@ async function setupAndLink(client2, path11, {
110778
110780
  return { status: "error", exitCode: 1 };
110779
110781
  }
110780
110782
  }
110781
- var import_path19, import_chalk48, import_fs_extra12;
110783
+ var import_path19, import_chalk48, import_fs_extra12, import_build_utils7, import_client5;
110782
110784
  var init_setup_and_link = __esm({
110783
110785
  "src/util/link/setup-and-link.ts"() {
110784
110786
  "use strict";
@@ -110801,6 +110803,9 @@ var init_setup_and_link = __esm({
110801
110803
  init_util();
110802
110804
  init_errors_ts();
110803
110805
  init_output_manager();
110806
+ import_build_utils7 = require("@vercel/build-utils");
110807
+ init_errors2();
110808
+ import_client5 = __toESM3(require_dist13());
110804
110809
  }
110805
110810
  });
110806
110811
 
@@ -111052,7 +111057,7 @@ async function staticFiles(path11, { src }) {
111052
111057
  let files = [];
111053
111058
  const source = src || ".";
111054
111059
  const search = (0, import_path20.resolve)(path11, source);
111055
- const { ig } = await (0, import_client5.getVercelIgnore)(path11);
111060
+ const { ig } = await (0, import_client6.getVercelIgnore)(path11);
111056
111061
  const filter = ig.createFilter();
111057
111062
  const prefixLength = path11.length + 1;
111058
111063
  const accepts = (file) => {
@@ -111111,13 +111116,13 @@ async function explode(paths, { accepts }) {
111111
111116
  function notNull(value) {
111112
111117
  return value !== null;
111113
111118
  }
111114
- var import_fs_extra13, import_path20, import_client5, asAbsolute;
111119
+ var import_fs_extra13, import_path20, import_client6, asAbsolute;
111115
111120
  var init_get_files = __esm({
111116
111121
  "src/util/get-files.ts"() {
111117
111122
  "use strict";
111118
111123
  import_fs_extra13 = __toESM3(require_lib());
111119
111124
  import_path20 = require("path");
111120
- import_client5 = __toESM3(require_dist13());
111125
+ import_client6 = __toESM3(require_dist13());
111121
111126
  init_unique_strings();
111122
111127
  init_output_manager();
111123
111128
  asAbsolute = function(path11, parent) {
@@ -121119,7 +121124,7 @@ async function extractEntry(zipFile, entry, dir) {
121119
121124
  return;
121120
121125
  const readStream = await zipFile.openReadStream(entry);
121121
121126
  if (symlink3) {
121122
- const link4 = await (0, import_build_utils6.streamToBuffer)(readStream);
121127
+ const link4 = await (0, import_build_utils8.streamToBuffer)(readStream);
121123
121128
  await fs6.symlink(link4.toString("utf8"), dest);
121124
121129
  } else {
121125
121130
  await (0, import_promisepipe.default)(readStream, fs6.createWriteStream(dest, { mode: procMode }));
@@ -121136,14 +121141,14 @@ function getExtractedMode(entryMode, isDir) {
121136
121141
  }
121137
121142
  return mode;
121138
121143
  }
121139
- var import_path22, import_promisepipe, fs6, import_build_utils6, import_yauzl_promise;
121144
+ var import_path22, import_promisepipe, fs6, import_build_utils8, import_yauzl_promise;
121140
121145
  var init_unzip = __esm({
121141
121146
  "src/util/build/unzip.ts"() {
121142
121147
  "use strict";
121143
121148
  import_path22 = __toESM3(require("path"));
121144
121149
  import_promisepipe = __toESM3(require_promisepipe());
121145
121150
  fs6 = __toESM3(require_lib());
121146
- import_build_utils6 = require("@vercel/build-utils");
121151
+ import_build_utils8 = require("@vercel/build-utils");
121147
121152
  import_yauzl_promise = __toESM3(require_lib15());
121148
121153
  }
121149
121154
  });
@@ -121194,7 +121199,7 @@ async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2,
121194
121199
  return;
121195
121200
  }
121196
121201
  if (!buildResult.output) {
121197
- const configFile = vercelConfig?.[import_client6.fileNameSymbol];
121202
+ const configFile = vercelConfig?.[import_client7.fileNameSymbol];
121198
121203
  const updateMessage = build2.use.startsWith("@now/") ? ` Please update from "@now" to "@vercel" in your \`${configFile}\` file.` : "";
121199
121204
  throw new Error(
121200
121205
  `The build result from "${build2.use}" is missing the "output" property.${updateMessage}`
@@ -121247,7 +121252,7 @@ async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2,
121247
121252
  import_fs_extra15.default.createWriteStream(fallbackPath, { mode: fallback.mode })
121248
121253
  );
121249
121254
  }
121250
- fallback = new import_build_utils7.FileFsRef({
121255
+ fallback = new import_build_utils9.FileFsRef({
121251
121256
  ...output2.fallback,
121252
121257
  fsPath: (0, import_path23.basename)(fallbackName)
121253
121258
  });
@@ -121293,7 +121298,7 @@ async function writeBuildResultV3(repoRootPath, outputDir, buildResult, build2,
121293
121298
  if (typeof src !== "string") {
121294
121299
  throw new Error(`Expected "build.src" to be a string`);
121295
121300
  }
121296
- const functionConfiguration = vercelConfig ? await (0, import_build_utils7.getLambdaOptionsFromFunction)({
121301
+ const functionConfiguration = vercelConfig ? await (0, import_build_utils9.getLambdaOptionsFromFunction)({
121297
121302
  sourceFile: src,
121298
121303
  config: vercelConfig
121299
121304
  }) : {};
@@ -121348,7 +121353,7 @@ async function writeStaticFile(outputDir, file, path11, overrides, cleanUrls = f
121348
121353
  } catch (_) {
121349
121354
  }
121350
121355
  }
121351
- await (0, import_build_utils7.downloadFile)(file, dest);
121356
+ await (0, import_build_utils9.downloadFile)(file, dest);
121352
121357
  }
121353
121358
  async function writeFunctionSymlink(outputDir, dest, fn2, existingFunctions) {
121354
121359
  const existingPath = existingFunctions.get(fn2);
@@ -121380,11 +121385,11 @@ async function writeEdgeFunction(repoRootPath, outputDir, edgeFunction, path11,
121380
121385
  edgeFunction.files,
121381
121386
  repoRootPath
121382
121387
  );
121383
- ops.push((0, import_build_utils7.download)(files, dest));
121388
+ ops.push((0, import_build_utils9.download)(files, dest));
121384
121389
  const config2 = {
121385
121390
  runtime: "edge",
121386
121391
  ...edgeFunction,
121387
- entrypoint: (0, import_build_utils7.normalizePath)(edgeFunction.entrypoint),
121392
+ entrypoint: (0, import_build_utils9.normalizePath)(edgeFunction.entrypoint),
121388
121393
  filePathMap,
121389
121394
  files: void 0,
121390
121395
  type: void 0
@@ -121411,7 +121416,7 @@ async function writeLambda(repoRootPath, outputDir, lambda, path11, functionConf
121411
121416
  if (lambda.files) {
121412
121417
  const f = filesWithoutFsRefs(lambda.files, repoRootPath);
121413
121418
  filePathMap = f.filePathMap;
121414
- ops.push((0, import_build_utils7.download)(f.files, dest));
121419
+ ops.push((0, import_build_utils9.download)(f.files, dest));
121415
121420
  } else if (lambda.zipBuffer) {
121416
121421
  ops.push(unzip(lambda.zipBuffer, dest));
121417
121422
  } else {
@@ -121421,7 +121426,7 @@ async function writeLambda(repoRootPath, outputDir, lambda, path11, functionConf
121421
121426
  const maxDuration = functionConfiguration?.maxDuration ?? lambda.maxDuration;
121422
121427
  const config2 = {
121423
121428
  ...lambda,
121424
- handler: (0, import_build_utils7.normalizePath)(lambda.handler),
121429
+ handler: (0, import_build_utils9.normalizePath)(lambda.handler),
121425
121430
  memory,
121426
121431
  maxDuration,
121427
121432
  filePathMap,
@@ -121511,19 +121516,19 @@ function filesWithoutFsRefs(files, repoRootPath) {
121511
121516
  }
121512
121517
  return { files: out, filePathMap };
121513
121518
  }
121514
- var import_fs_extra15, import_mime_types, import_path23, import_build_utils7, import_promisepipe2, import_client6, normalize2, OUTPUT_DIR;
121519
+ var import_fs_extra15, import_mime_types, import_path23, import_build_utils9, import_promisepipe2, import_client7, normalize2, OUTPUT_DIR;
121515
121520
  var init_write_build_result = __esm({
121516
121521
  "src/util/build/write-build-result.ts"() {
121517
121522
  "use strict";
121518
121523
  import_fs_extra15 = __toESM3(require_lib());
121519
121524
  import_mime_types = __toESM3(require_mime_types());
121520
121525
  import_path23 = require("path");
121521
- import_build_utils7 = require("@vercel/build-utils");
121526
+ import_build_utils9 = require("@vercel/build-utils");
121522
121527
  import_promisepipe2 = __toESM3(require_promisepipe());
121523
121528
  init_merge();
121524
121529
  init_unzip();
121525
121530
  init_link2();
121526
- import_client6 = __toESM3(require_dist13());
121531
+ import_client7 = __toESM3(require_dist13());
121527
121532
  ({ normalize: normalize2 } = import_path23.posix);
121528
121533
  OUTPUT_DIR = (0, import_path23.join)(VERCEL_DIR2, "output");
121529
121534
  }
@@ -122396,12 +122401,12 @@ __export3(static_builder_exports, {
122396
122401
  shouldServe: () => shouldServe,
122397
122402
  version: () => version
122398
122403
  });
122399
- var import_minimatch, import_build_utils8, version, build, shouldServe;
122404
+ var import_minimatch, import_build_utils10, version, build, shouldServe;
122400
122405
  var init_static_builder = __esm({
122401
122406
  "src/util/build/static-builder.ts"() {
122402
122407
  "use strict";
122403
122408
  import_minimatch = __toESM3(require_minimatch2());
122404
- import_build_utils8 = require("@vercel/build-utils");
122409
+ import_build_utils10 = require("@vercel/build-utils");
122405
122410
  version = 2;
122406
122411
  build = async ({ entrypoint, files, config: config2 }) => {
122407
122412
  const output2 = {};
@@ -122432,7 +122437,7 @@ var init_static_builder = __esm({
122432
122437
  opts.entrypoint = `${outputDirectory}/${opts.entrypoint}`;
122433
122438
  opts.requestPath = `${outputDirectory}/${opts.requestPath}`;
122434
122439
  }
122435
- return (0, import_build_utils8.shouldServe)(opts);
122440
+ return (0, import_build_utils10.shouldServe)(opts);
122436
122441
  };
122437
122442
  }
122438
122443
  });
@@ -122687,7 +122692,7 @@ async function initCorepack({
122687
122692
  process.env.COREPACK_HOME = corepackHomeDir;
122688
122693
  process.env.PATH = `${corepackShimDir}${import_path25.delimiter}${process.env.PATH}`;
122689
122694
  const pkgManagerName = pkg.packageManager.split("@")[0];
122690
- await (0, import_build_utils9.spawnAsync)(
122695
+ await (0, import_build_utils11.spawnAsync)(
122691
122696
  "corepack",
122692
122697
  ["enable", pkgManagerName, "--install-directory", corepackShimDir],
122693
122698
  {
@@ -122709,12 +122714,12 @@ function cleanupCorepack(corepackShimDir) {
122709
122714
  );
122710
122715
  }
122711
122716
  }
122712
- var import_path25, import_build_utils9, import_fs_extra17;
122717
+ var import_path25, import_build_utils11, import_fs_extra17;
122713
122718
  var init_corepack = __esm({
122714
122719
  "src/util/build/corepack.ts"() {
122715
122720
  "use strict";
122716
122721
  import_path25 = require("path");
122717
- import_build_utils9 = require("@vercel/build-utils");
122722
+ import_build_utils11 = require("@vercel/build-utils");
122718
122723
  import_fs_extra17 = __toESM3(require_lib());
122719
122724
  init_errors_ts();
122720
122725
  init_link2();
@@ -122747,14 +122752,14 @@ function validateConfig(config2) {
122747
122752
  if (!validate(config2)) {
122748
122753
  if (validate.errors && validate.errors[0]) {
122749
122754
  const error3 = validate.errors[0];
122750
- const fileName = config2[import_client7.fileNameSymbol] || "vercel.json";
122751
- const niceError = (0, import_build_utils10.getPrettyError)(error3);
122755
+ const fileName = config2[import_client8.fileNameSymbol] || "vercel.json";
122756
+ const niceError = (0, import_build_utils12.getPrettyError)(error3);
122752
122757
  niceError.message = `Invalid ${fileName} - ${niceError.message}`;
122753
122758
  return niceError;
122754
122759
  }
122755
122760
  }
122756
122761
  if (config2.functions && config2.builds) {
122757
- return new import_build_utils10.NowBuildError({
122762
+ return new import_build_utils12.NowBuildError({
122758
122763
  code: "FUNCTIONS_AND_BUILDS",
122759
122764
  message: "The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",
122760
122765
  link: "https://vercel.link/functions-and-builds"
@@ -122762,14 +122767,14 @@ function validateConfig(config2) {
122762
122767
  }
122763
122768
  return null;
122764
122769
  }
122765
- var import_ajv2, import_routing_utils, import_build_utils10, import_client7, imagesSchema, cronsSchema, vercelConfigSchema, ajv, validate;
122770
+ var import_ajv2, import_routing_utils, import_build_utils12, import_client8, imagesSchema, cronsSchema, vercelConfigSchema, ajv, validate;
122766
122771
  var init_validate_config = __esm({
122767
122772
  "src/util/validate-config.ts"() {
122768
122773
  "use strict";
122769
122774
  import_ajv2 = __toESM3(require_ajv());
122770
122775
  import_routing_utils = __toESM3(require_dist29());
122771
- import_build_utils10 = require("@vercel/build-utils");
122772
- import_client7 = __toESM3(require_dist13());
122776
+ import_build_utils12 = require("@vercel/build-utils");
122777
+ import_client8 = __toESM3(require_dist13());
122773
122778
  imagesSchema = {
122774
122779
  type: "object",
122775
122780
  additionalProperties: false,
@@ -122903,14 +122908,14 @@ var init_validate_config = __esm({
122903
122908
  // doesn't need to know about `regions`, `public`, etc.
122904
122909
  additionalProperties: true,
122905
122910
  properties: {
122906
- builds: import_build_utils10.buildsSchema,
122911
+ builds: import_build_utils12.buildsSchema,
122907
122912
  routes: import_routing_utils.routesSchema,
122908
122913
  cleanUrls: import_routing_utils.cleanUrlsSchema,
122909
122914
  headers: import_routing_utils.headersSchema,
122910
122915
  redirects: import_routing_utils.redirectsSchema,
122911
122916
  rewrites: import_routing_utils.rewritesSchema,
122912
122917
  trailingSlash: import_routing_utils.trailingSlashSchema,
122913
- functions: import_build_utils10.functionsSchema,
122918
+ functions: import_build_utils12.functionsSchema,
122914
122919
  images: imagesSchema,
122915
122920
  crons: cronsSchema
122916
122921
  }
@@ -122927,7 +122932,7 @@ async function setMonorepoDefaultSettings(cwd, workPath, projectSettings) {
122927
122932
  const relativeToRoot = (0, import_path26.relative)(workPath, cwd);
122928
122933
  const setCommand = (command, value) => {
122929
122934
  if (projectSettings[command]) {
122930
- (0, import_build_utils11.debug)(
122935
+ (0, import_build_utils13.debug)(
122931
122936
  `Skipping auto-assignment of ${command} as it is already set via project settings or configuration overrides.`
122932
122937
  );
122933
122938
  } else {
@@ -122968,14 +122973,14 @@ async function setMonorepoDefaultSettings(cwd, workPath, projectSettings) {
122968
122973
  throw error3;
122969
122974
  }
122970
122975
  }
122971
- var import_path26, import_fs_detectors3, import_title3, import_build_utils11;
122976
+ var import_path26, import_fs_detectors3, import_title3, import_build_utils13;
122972
122977
  var init_monorepo = __esm({
122973
122978
  "src/util/build/monorepo.ts"() {
122974
122979
  "use strict";
122975
122980
  import_path26 = require("path");
122976
122981
  import_fs_detectors3 = __toESM3(require_dist27());
122977
122982
  import_title3 = __toESM3(require_lib4());
122978
- import_build_utils11 = require("@vercel/build-utils");
122983
+ import_build_utils13 = require("@vercel/build-utils");
122979
122984
  init_output_manager();
122980
122985
  }
122981
122986
  });
@@ -123087,7 +123092,7 @@ async function main2(client2) {
123087
123092
  }) || "preview";
123088
123093
  const yes = Boolean(parsedArgs.flags["--yes"]);
123089
123094
  try {
123090
- await (0, import_build_utils12.validateNpmrc)(cwd);
123095
+ await (0, import_build_utils14.validateNpmrc)(cwd);
123091
123096
  } catch (err) {
123092
123097
  output_manager_default.prettyError(err);
123093
123098
  return 1;
@@ -123221,9 +123226,9 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
123221
123226
  if (nowConfig instanceof CantParseJSONFile)
123222
123227
  throw nowConfig;
123223
123228
  if (vercelConfig) {
123224
- vercelConfig[import_client8.fileNameSymbol] = "vercel.json";
123229
+ vercelConfig[import_client9.fileNameSymbol] = "vercel.json";
123225
123230
  } else if (nowConfig) {
123226
- nowConfig[import_client8.fileNameSymbol] = "now.json";
123231
+ nowConfig[import_client9.fileNameSymbol] = "now.json";
123227
123232
  }
123228
123233
  const localConfig = vercelConfig || nowConfig || {};
123229
123234
  const validateError = validateConfig(localConfig);
@@ -123238,14 +123243,14 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
123238
123243
  await setMonorepoDefaultSettings(cwd, workPath, projectSettings);
123239
123244
  }
123240
123245
  const files = (await staticFiles(workPath, {})).map(
123241
- (f) => (0, import_build_utils12.normalizePath)((0, import_path27.relative)(workPath, f))
123246
+ (f) => (0, import_build_utils14.normalizePath)((0, import_path27.relative)(workPath, f))
123242
123247
  );
123243
123248
  const routesResult = (0, import_routing_utils2.getTransformedRoutes)(localConfig);
123244
123249
  if (routesResult.error) {
123245
123250
  throw routesResult.error;
123246
123251
  }
123247
123252
  if (localConfig.builds && localConfig.functions) {
123248
- throw new import_build_utils12.NowBuildError({
123253
+ throw new import_build_utils14.NowBuildError({
123249
123254
  code: "bad_request",
123250
123255
  message: "The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",
123251
123256
  link: "https://vercel.link/functions-and-builds"
@@ -123299,7 +123304,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
123299
123304
  for (const path11 of files) {
123300
123305
  const fsPath = (0, import_path27.join)(workPath, path11);
123301
123306
  const { mode } = await import_fs_extra18.default.stat(fsPath);
123302
- filesMap[path11] = new import_build_utils12.FileFsRef({ mode, fsPath });
123307
+ filesMap[path11] = new import_build_utils14.FileFsRef({ mode, fsPath });
123303
123308
  }
123304
123309
  const buildStamp = stamp_default();
123305
123310
  await import_fs_extra18.default.mkdirp(outputDir);
@@ -123400,8 +123405,8 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
123400
123405
  }
123401
123406
  if (buildResult && "output" in buildResult && "runtime" in buildResult.output && "type" in buildResult.output && buildResult.output.type === "Lambda") {
123402
123407
  const lambdaRuntime = buildResult.output.runtime;
123403
- if ((0, import_build_utils12.getDiscontinuedNodeVersions)().some((o) => o.runtime === lambdaRuntime)) {
123404
- throw new import_build_utils12.NowBuildError({
123408
+ if ((0, import_build_utils14.getDiscontinuedNodeVersions)().some((o) => o.runtime === lambdaRuntime)) {
123409
+ throw new import_build_utils14.NowBuildError({
123405
123410
  code: "NODEJS_DISCONTINUED_VERSION",
123406
123411
  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
123412
  link: "https://github.com/vercel/vercel/blob/main/DEVELOPING_A_RUNTIME.md#lambdaruntime"
@@ -123434,7 +123439,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
123434
123439
  throw err;
123435
123440
  } finally {
123436
123441
  ops.push(
123437
- (0, import_build_utils12.download)(diagnostics, (0, import_path27.join)(outputDir, "diagnostics")).then(
123442
+ (0, import_build_utils14.download)(diagnostics, (0, import_path27.join)(outputDir, "diagnostics")).then(
123438
123443
  () => void 0,
123439
123444
  (err) => err
123440
123445
  )
@@ -123451,7 +123456,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
123451
123456
  }
123452
123457
  }
123453
123458
  let needBuildsJsonOverride = false;
123454
- const speedInsightsVersion = await (0, import_build_utils12.getInstalledPackageVersion)(
123459
+ const speedInsightsVersion = await (0, import_build_utils14.getInstalledPackageVersion)(
123455
123460
  "@vercel/speed-insights"
123456
123461
  );
123457
123462
  if (speedInsightsVersion) {
@@ -123461,7 +123466,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
123461
123466
  };
123462
123467
  needBuildsJsonOverride = true;
123463
123468
  }
123464
- const webAnalyticsVersion = await (0, import_build_utils12.getInstalledPackageVersion)("@vercel/analytics");
123469
+ const webAnalyticsVersion = await (0, import_build_utils14.getInstalledPackageVersion)("@vercel/analytics");
123465
123470
  if (webAnalyticsVersion) {
123466
123471
  buildsJson.features = {
123467
123472
  ...buildsJson.features ?? {},
@@ -123567,7 +123572,7 @@ async function getFramework(cwd, buildResults) {
123567
123572
  }
123568
123573
  function expandBuild(files, build2) {
123569
123574
  if (!build2.use) {
123570
- throw new import_build_utils12.NowBuildError({
123575
+ throw new import_build_utils14.NowBuildError({
123571
123576
  code: `invalid_build_specification`,
123572
123577
  message: "Field `use` is missing in build specification",
123573
123578
  link: "https://vercel.com/docs/concepts/projects/project-configuration#builds",
@@ -123576,7 +123581,7 @@ function expandBuild(files, build2) {
123576
123581
  }
123577
123582
  let src = (0, import_path27.normalize)(build2.src || "**").split(import_path27.sep).join("/");
123578
123583
  if (src === "." || src === "./") {
123579
- throw new import_build_utils12.NowBuildError({
123584
+ throw new import_build_utils14.NowBuildError({
123580
123585
  code: `invalid_build_specification`,
123581
123586
  message: "A build `src` path resolves to an empty string",
123582
123587
  link: "https://vercel.com/docs/concepts/projects/project-configuration#builds",
@@ -123663,7 +123668,7 @@ async function getFrameworkRoutes(framework, dirPrefix) {
123663
123668
  }
123664
123669
  return routes2;
123665
123670
  }
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;
123671
+ 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
123672
  var init_build2 = __esm({
123668
123673
  "src/commands/build/index.ts"() {
123669
123674
  "use strict";
@@ -123674,10 +123679,10 @@ var init_build2 = __esm({
123674
123679
  import_minimatch2 = __toESM3(require_minimatch2());
123675
123680
  import_path27 = require("path");
123676
123681
  import_frameworks4 = __toESM3(require_frameworks());
123677
- import_build_utils12 = require("@vercel/build-utils");
123682
+ import_build_utils14 = require("@vercel/build-utils");
123678
123683
  import_fs_detectors4 = __toESM3(require_dist27());
123679
123684
  import_routing_utils2 = __toESM3(require_dist29());
123680
- import_client8 = __toESM3(require_dist13());
123685
+ import_client9 = __toESM3(require_dist13());
123681
123686
  init_pull4();
123682
123687
  init_get_files();
123683
123688
  init_get_args();
@@ -124808,12 +124813,12 @@ var init_print_deployment_status = __esm({
124808
124813
  function isValidArchive(archive) {
124809
124814
  return validArchiveFormats.has(archive);
124810
124815
  }
124811
- var import_client9, validArchiveFormats;
124816
+ var import_client10, validArchiveFormats;
124812
124817
  var init_validate_archive_format = __esm({
124813
124818
  "src/util/deploy/validate-archive-format.ts"() {
124814
124819
  "use strict";
124815
- import_client9 = __toESM3(require_dist13());
124816
- validArchiveFormats = new Set(import_client9.VALID_ARCHIVE_FORMATS);
124820
+ import_client10 = __toESM3(require_dist13());
124821
+ validArchiveFormats = new Set(import_client10.VALID_ARCHIVE_FORMATS);
124817
124822
  }
124818
124823
  });
124819
124824
 
@@ -124861,12 +124866,12 @@ var init_parse_meta = __esm({
124861
124866
  });
124862
124867
 
124863
124868
  // src/util/telemetry/commands/deploy/index.ts
124864
- var import_client10, DeployTelemetryClient;
124869
+ var import_client11, DeployTelemetryClient;
124865
124870
  var init_deploy = __esm({
124866
124871
  "src/util/telemetry/commands/deploy/index.ts"() {
124867
124872
  "use strict";
124868
124873
  init_telemetry();
124869
- import_client10 = __toESM3(require_dist13());
124874
+ import_client11 = __toESM3(require_dist13());
124870
124875
  DeployTelemetryClient = class extends TelemetryClient {
124871
124876
  trackCliArgumentProjectPath(projectPaths) {
124872
124877
  if (projectPaths) {
@@ -124878,7 +124883,7 @@ var init_deploy = __esm({
124878
124883
  }
124879
124884
  trackCliOptionArchive(format4) {
124880
124885
  if (format4) {
124881
- const allowedFormat = import_client10.VALID_ARCHIVE_FORMATS.includes(format4) ? format4 : this.redactedValue;
124886
+ const allowedFormat = import_client11.VALID_ARCHIVE_FORMATS.includes(format4) ? format4 : this.redactedValue;
124882
124887
  this.trackCliOption({
124883
124888
  option: "archive",
124884
124889
  value: allowedFormat
@@ -125020,8 +125025,8 @@ function handleCreateDeployError(error3, localConfig) {
125020
125025
  return 1;
125021
125026
  }
125022
125027
  if (error3 instanceof SchemaValidationFailed) {
125023
- const niceError = (0, import_build_utils13.getPrettyError)(error3.meta);
125024
- const fileName = localConfig[import_client11.fileNameSymbol] || "vercel.json";
125028
+ const niceError = (0, import_build_utils15.getPrettyError)(error3.meta);
125029
+ const fileName = localConfig[import_client12.fileNameSymbol] || "vercel.json";
125025
125030
  niceError.message = `Invalid ${fileName} - ${niceError.message}`;
125026
125031
  output_manager_default.prettyError(niceError);
125027
125032
  return 1;
@@ -125058,12 +125063,12 @@ function handleCreateDeployError(error3, localConfig) {
125058
125063
  }
125059
125064
  return error3;
125060
125065
  }
125061
- var import_build_utils13, import_client11, import_error_utils18, import_bytes5, import_chalk58, import_fs_extra20, import_ms11, import_path31, deploy_default, addProcessEnv;
125066
+ var import_build_utils15, import_client12, import_error_utils18, import_bytes5, import_chalk58, import_fs_extra20, import_ms11, import_path31, deploy_default, addProcessEnv;
125062
125067
  var init_deploy2 = __esm({
125063
125068
  "src/commands/deploy/index.ts"() {
125064
125069
  "use strict";
125065
- import_build_utils13 = require("@vercel/build-utils");
125066
- import_client11 = __toESM3(require_dist13());
125070
+ import_build_utils15 = require("@vercel/build-utils");
125071
+ import_client12 = __toESM3(require_dist13());
125067
125072
  import_error_utils18 = __toESM3(require_dist2());
125068
125073
  import_bytes5 = __toESM3(require_bytes());
125069
125074
  import_chalk58 = __toESM3(require_source());
@@ -125087,12 +125092,6 @@ var init_deploy2 = __esm({
125087
125092
  init_get_deployment();
125088
125093
  init_get_flags_specification();
125089
125094
  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
125095
  init_code();
125097
125096
  init_highlight();
125098
125097
  init_param();
@@ -125100,7 +125099,6 @@ var init_deploy2 = __esm({
125100
125099
  init_parse_env();
125101
125100
  init_parse_meta();
125102
125101
  init_pkg_name();
125103
- init_link2();
125104
125102
  init_project_settings();
125105
125103
  init_validate_paths();
125106
125104
  init_help();
@@ -125108,6 +125106,7 @@ var init_deploy2 = __esm({
125108
125106
  init_parse_target();
125109
125107
  init_deploy();
125110
125108
  init_output_manager();
125109
+ init_ensure_link();
125111
125110
  deploy_default = async (client2) => {
125112
125111
  const telemetryClient = new DeployTelemetryClient({
125113
125112
  opts: {
@@ -125169,8 +125168,9 @@ var init_deploy2 = __esm({
125169
125168
  }
125170
125169
  let localConfig = client2.localConfig || readLocalConfig(paths[0]);
125171
125170
  if (localConfig) {
125171
+ client2.localConfig = localConfig;
125172
125172
  const { version: version2 } = localConfig;
125173
- const file = highlight(localConfig[import_client11.fileNameSymbol]);
125173
+ const file = highlight(localConfig[import_client12.fileNameSymbol]);
125174
125174
  const prop = code("version");
125175
125175
  if (version2) {
125176
125176
  if (typeof version2 === "number") {
@@ -125223,82 +125223,31 @@ var init_deploy2 = __esm({
125223
125223
  });
125224
125224
  const archive = parsedArguments.flags["--archive"];
125225
125225
  if (typeof archive === "string" && !isValidArchive(archive)) {
125226
- output_manager_default.error(`Format must be one of: ${import_client11.VALID_ARCHIVE_FORMATS.join(", ")}`);
125226
+ output_manager_default.error(`Format must be one of: ${import_client12.VALID_ARCHIVE_FORMATS.join(", ")}`);
125227
125227
  return 1;
125228
125228
  }
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({
125229
+ const link4 = await ensureLink("deploy", client2, cwd, {
125230
+ autoConfirm,
125231
+ setupMsg: "Set up and deploy",
125232
+ projectName: getProjectName({
125262
125233
  nameParam: parsedArguments.flags["--name"],
125263
125234
  nowConfig: localConfig,
125264
125235
  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
- }
125236
+ })
125237
+ });
125238
+ if (typeof link4 === "number") {
125239
+ return link4;
125291
125240
  }
125292
- if (link4.status === "linked" && link4.repoRoot) {
125241
+ const { org, project } = link4;
125242
+ const rootDirectory = project.rootDirectory;
125243
+ const sourceFilesOutsideRootDirectory = project.sourceFilesOutsideRootDirectory ?? true;
125244
+ if (link4.repoRoot) {
125293
125245
  cwd = link4.repoRoot;
125294
125246
  }
125295
- if (!org) {
125296
- throw new Error(`"org" is not defined`);
125297
- }
125298
125247
  let vercelOutputDir;
125299
125248
  if (parsedArguments.flags["--prebuilt"]) {
125300
125249
  vercelOutputDir = (0, import_path31.join)(cwd, ".vercel/output");
125301
- if (link4.status === "linked" && link4.repoRoot && link4.project.rootDirectory) {
125250
+ if (link4.repoRoot && link4.project.rootDirectory) {
125302
125251
  vercelOutputDir = (0, import_path31.join)(cwd, link4.project.rootDirectory, ".vercel/output");
125303
125252
  }
125304
125253
  const prebuiltExists = await import_fs_extra20.default.pathExists(vercelOutputDir);
@@ -125358,7 +125307,7 @@ var init_deploy2 = __esm({
125358
125307
  output_manager_default.print(
125359
125308
  `${prependEmoji(
125360
125309
  `The ${highlight(
125361
- localConfig[import_client11.fileNameSymbol]
125310
+ localConfig[import_client12.fileNameSymbol]
125362
125311
  )} file should be inside of the provided root directory.`,
125363
125312
  emoji("warning")
125364
125313
  )}
@@ -125371,7 +125320,7 @@ var init_deploy2 = __esm({
125371
125320
  output_manager_default.print(
125372
125321
  `${prependEmoji(
125373
125322
  `The ${code("name")} property in ${highlight(
125374
- localConfig[import_client11.fileNameSymbol]
125323
+ localConfig[import_client12.fileNameSymbol]
125375
125324
  )} is deprecated (https://vercel.link/name-prop)`,
125376
125325
  emoji("warning")
125377
125326
  )}
@@ -125382,7 +125331,7 @@ var init_deploy2 = __esm({
125382
125331
  if (typeof localConfig.env !== "undefined" && !isObject2(localConfig.env)) {
125383
125332
  error3(
125384
125333
  `The ${code("env")} property in ${highlight(
125385
- localConfig[import_client11.fileNameSymbol]
125334
+ localConfig[import_client12.fileNameSymbol]
125386
125335
  )} needs to be an object`
125387
125336
  );
125388
125337
  return 1;
@@ -125391,7 +125340,7 @@ var init_deploy2 = __esm({
125391
125340
  if (!isObject2(localConfig.build)) {
125392
125341
  error3(
125393
125342
  `The ${code("build")} property in ${highlight(
125394
- localConfig[import_client11.fileNameSymbol]
125343
+ localConfig[import_client12.fileNameSymbol]
125395
125344
  )} needs to be an object`
125396
125345
  );
125397
125346
  return 1;
@@ -125399,7 +125348,7 @@ var init_deploy2 = __esm({
125399
125348
  if (typeof localConfig.build.env !== "undefined" && !isObject2(localConfig.build.env)) {
125400
125349
  error3(
125401
125350
  `The ${code("build.env")} property in ${highlight(
125402
- localConfig[import_client11.fileNameSymbol]
125351
+ localConfig[import_client12.fileNameSymbol]
125403
125352
  )} needs to be an object`
125404
125353
  );
125405
125354
  return 1;
@@ -125430,7 +125379,7 @@ var init_deploy2 = __esm({
125430
125379
  }
125431
125380
  const regionFlag = (parsedArguments.flags["--regions"] || "").split(",").map((s) => s.trim()).filter(Boolean);
125432
125381
  const regions = regionFlag.length > 0 ? regionFlag : localConfig.regions;
125433
- const currentTeam = org?.type === "team" ? org.id : void 0;
125382
+ const currentTeam = org.type === "team" ? org.id : void 0;
125434
125383
  const now = new Now({
125435
125384
  client: client2,
125436
125385
  currentTeam
@@ -125439,7 +125388,7 @@ var init_deploy2 = __esm({
125439
125388
  let deployment = null;
125440
125389
  const noWait = !!parsedArguments.flags["--no-wait"];
125441
125390
  const localConfigurationOverrides = pickOverrides(localConfig);
125442
- const name = project ? project.name : newProjectName;
125391
+ const name = project.name;
125443
125392
  if (!name) {
125444
125393
  throw new Error(
125445
125394
  "`name` not found on project or provided by existing project"
@@ -125479,16 +125428,11 @@ var init_deploy2 = __esm({
125479
125428
  if (!localConfig.builds || localConfig.builds.length === 0) {
125480
125429
  createArgs.projectSettings = {
125481
125430
  sourceFilesOutsideRootDirectory,
125482
- rootDirectory
125431
+ rootDirectory,
125432
+ ...localConfigurationOverrides
125483
125433
  };
125484
- if (status2 === "linked") {
125485
- createArgs.projectSettings = {
125486
- ...createArgs.projectSettings,
125487
- ...localConfigurationOverrides
125488
- };
125489
- }
125490
125434
  }
125491
- const { packageJson } = await (0, import_build_utils13.scanParentDirs)(
125435
+ const { packageJson } = await (0, import_build_utils15.scanParentDirs)(
125492
125436
  (0, import_path31.join)(cwd, project?.rootDirectory ?? ""),
125493
125437
  true,
125494
125438
  cwd
@@ -125496,7 +125440,7 @@ var init_deploy2 = __esm({
125496
125440
  let nodeVersion;
125497
125441
  if (packageJson?.engines?.node) {
125498
125442
  try {
125499
- const { range } = await (0, import_build_utils13.getSupportedNodeVersion)(
125443
+ const { range } = await (0, import_build_utils15.getSupportedNodeVersion)(
125500
125444
  packageJson.engines.node
125501
125445
  );
125502
125446
  nodeVersion = range;
@@ -125520,35 +125464,6 @@ var init_deploy2 = __esm({
125520
125464
  cwd,
125521
125465
  archive
125522
125466
  );
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
125467
  if (deployment instanceof NotDomainOwner) {
125553
125468
  output_manager_default.error(deployment.message);
125554
125469
  return 1;
@@ -141379,14 +141294,14 @@ var require_is_port_reachable = __commonJS2({
141379
141294
 
141380
141295
  // src/util/path-helpers.ts
141381
141296
  function relative6(a, b) {
141382
- return (0, import_build_utils14.normalizePath)((0, import_path32.relative)(a, b));
141297
+ return (0, import_build_utils16.normalizePath)((0, import_path32.relative)(a, b));
141383
141298
  }
141384
- var import_path32, import_build_utils14;
141299
+ var import_path32, import_build_utils16;
141385
141300
  var init_path_helpers = __esm({
141386
141301
  "src/util/path-helpers.ts"() {
141387
141302
  "use strict";
141388
141303
  import_path32 = require("path");
141389
- import_build_utils14 = require("@vercel/build-utils");
141304
+ import_build_utils16 = require("@vercel/build-utils");
141390
141305
  }
141391
141306
  });
141392
141307
 
@@ -142028,7 +141943,7 @@ Please run \`${await getUpdateCommand()}\` to update to the latest CLI.`
142028
141943
  const { output: buildOutput } = result;
142029
141944
  const { cleanUrls } = vercelConfig;
142030
141945
  for (const [originalPath, value] of Object.entries(buildOutput)) {
142031
- let path11 = (0, import_build_utils15.normalizePath)(originalPath);
141946
+ let path11 = (0, import_build_utils17.normalizePath)(originalPath);
142032
141947
  if (cleanUrls && path11.endsWith(".html")) {
142033
141948
  path11 = path11.slice(0, -5);
142034
141949
  if (value.type === "FileBlob" || value.type === "FileFsRef") {
@@ -142048,16 +141963,16 @@ Please run \`${await getUpdateCommand()}\` to update to the latest CLI.`
142048
141963
  let fileBlob;
142049
141964
  switch (obj.type) {
142050
141965
  case "FileFsRef":
142051
- fileRef = Object.assign(Object.create(import_build_utils15.FileFsRef.prototype), obj);
141966
+ fileRef = Object.assign(Object.create(import_build_utils17.FileFsRef.prototype), obj);
142052
141967
  buildOutput[name] = fileRef;
142053
141968
  break;
142054
141969
  case "FileBlob":
142055
- fileBlob = Object.assign(Object.create(import_build_utils15.FileBlob.prototype), obj);
141970
+ fileBlob = Object.assign(Object.create(import_build_utils17.FileBlob.prototype), obj);
142056
141971
  fileBlob.data = Buffer.from(obj.data.data);
142057
141972
  buildOutput[name] = fileBlob;
142058
141973
  break;
142059
141974
  case "Lambda":
142060
- lambda = Object.assign(Object.create(import_build_utils15.Lambda.prototype), obj);
141975
+ lambda = Object.assign(Object.create(import_build_utils17.Lambda.prototype), obj);
142061
141976
  lambda.zipBuffer = Buffer.from(obj.zipBuffer.data);
142062
141977
  buildOutput[name] = lambda;
142063
141978
  break;
@@ -142208,7 +142123,7 @@ async function shutdownBuilder(match) {
142208
142123
  }
142209
142124
  await Promise.all(ops);
142210
142125
  }
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;
142126
+ 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
142127
  var init_builder = __esm({
142213
142128
  "src/util/dev/builder.ts"() {
142214
142129
  "use strict";
@@ -142217,7 +142132,7 @@ var init_builder = __esm({
142217
142132
  import_path34 = require("path");
142218
142133
  import_child_process3 = require("child_process");
142219
142134
  import_fun = require("@vercel/fun");
142220
- import_build_utils15 = require("@vercel/build-utils");
142135
+ import_build_utils17 = require("@vercel/build-utils");
142221
142136
  import_fs_detectors5 = __toESM3(require_dist27());
142222
142137
  import_pluralize6 = __toESM3(require_pluralize());
142223
142138
  import_minimatch3 = __toESM3(require_minimatch2());
@@ -142765,7 +142680,7 @@ function buildMatchEquals(a, b) {
142765
142680
  return false;
142766
142681
  return true;
142767
142682
  }
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;
142683
+ 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
142684
  var init_server = __esm({
142770
142685
  "src/util/dev/server.ts"() {
142771
142686
  "use strict";
@@ -142792,9 +142707,9 @@ var init_server = __esm({
142792
142707
  import_fast_deep_equal = __toESM3(require_fast_deep_equal());
142793
142708
  import_npm_package_arg2 = __toESM3(require_npa());
142794
142709
  import_json_parse_better_errors3 = __toESM3(require_json_parse_better_errors());
142795
- import_client12 = __toESM3(require_dist13());
142710
+ import_client13 = __toESM3(require_dist13());
142796
142711
  import_routing_utils5 = __toESM3(require_dist29());
142797
- import_build_utils16 = require("@vercel/build-utils");
142712
+ import_build_utils18 = require("@vercel/build-utils");
142798
142713
  import_fs_detectors6 = __toESM3(require_dist27());
142799
142714
  import_frameworks5 = __toESM3(require_frameworks());
142800
142715
  init_cmd();
@@ -143614,10 +143529,10 @@ Please ensure that ${cmd(err.path)} is properly installed`;
143614
143529
  const name = relative6(this.cwd, fsPath);
143615
143530
  try {
143616
143531
  await this.getVercelConfig();
143617
- this.files[name] = await import_build_utils16.FileFsRef.fromFsPath({ fsPath });
143532
+ this.files[name] = await import_build_utils18.FileFsRef.fromFsPath({ fsPath });
143618
143533
  const extensionless = this.getExtensionlessFile(name);
143619
143534
  if (extensionless) {
143620
- this.files[extensionless] = await import_build_utils16.FileFsRef.fromFsPath({ fsPath });
143535
+ this.files[extensionless] = await import_build_utils18.FileFsRef.fromFsPath({ fsPath });
143621
143536
  }
143622
143537
  fileChanged(name, changed, removed);
143623
143538
  output_manager_default.debug(`File created: ${name}`);
@@ -143643,7 +143558,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
143643
143558
  async handleFileModified(fsPath, changed, removed) {
143644
143559
  const name = relative6(this.cwd, fsPath);
143645
143560
  try {
143646
- this.files[name] = await import_build_utils16.FileFsRef.fromFsPath({ fsPath });
143561
+ this.files[name] = await import_build_utils18.FileFsRef.fromFsPath({ fsPath });
143647
143562
  fileChanged(name, changed, removed);
143648
143563
  output_manager_default.debug(`File modified: ${name}`);
143649
143564
  } catch (err) {
@@ -143780,7 +143695,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
143780
143695
  pkg = null,
143781
143696
  // The default empty `vercel.json` is used to serve all
143782
143697
  // files as static when no `vercel.json` is present
143783
- vercelConfig = { version: 2, [import_client12.fileNameSymbol]: "vercel.json" }
143698
+ vercelConfig = { version: 2, [import_client13.fileNameSymbol]: "vercel.json" }
143784
143699
  ] = await Promise.all([
143785
143700
  this.readJsonFile("package.json"),
143786
143701
  this.readJsonFile(configPath)
@@ -143864,7 +143779,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
143864
143779
  if (!this.vercelConfigWarning) {
143865
143780
  this.vercelConfigWarning = true;
143866
143781
  output_manager_default.warn(
143867
- `The "has" property in ${vercelConfig[import_client12.fileNameSymbol]} will be ignored during development. Deployments will work as expected.`
143782
+ `The "has" property in ${vercelConfig[import_client13.fileNameSymbol]} will be ignored during development. Deployments will work as expected.`
143868
143783
  );
143869
143784
  }
143870
143785
  return false;
@@ -143913,7 +143828,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
143913
143828
  try {
143914
143829
  const raw = await import_fs_extra21.default.readFile(abs, "utf8");
143915
143830
  const parsed = (0, import_json_parse_better_errors3.default)(raw);
143916
- parsed[import_client12.fileNameSymbol] = rel;
143831
+ parsed[import_client13.fileNameSymbol] = rel;
143917
143832
  return parsed;
143918
143833
  } catch (err) {
143919
143834
  if ((0, import_error_utils19.isError)(err)) {
@@ -144009,7 +143924,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
144009
143924
  if (!import_fs_extra21.default.lstatSync(this.cwd).isDirectory()) {
144010
143925
  throw new Error(`${import_chalk59.default.bold(this.cwd)} is not a directory`);
144011
143926
  }
144012
- const { ig } = await (0, import_client12.getVercelIgnore)(this.cwd);
143927
+ const { ig } = await (0, import_client13.getVercelIgnore)(this.cwd);
144013
143928
  this.filter = ig.createFilter();
144014
143929
  let address = null;
144015
143930
  while (typeof address !== "string") {
@@ -144048,10 +143963,10 @@ Please ensure that ${cmd(err.path)} is properly installed`;
144048
143963
  for (const fsPath of files) {
144049
143964
  let path11 = relative6(this.cwd, fsPath);
144050
143965
  const { mode } = await import_fs_extra21.default.stat(fsPath);
144051
- this.files[path11] = new import_build_utils16.FileFsRef({ mode, fsPath });
143966
+ this.files[path11] = new import_build_utils18.FileFsRef({ mode, fsPath });
144052
143967
  const extensionless = this.getExtensionlessFile(path11);
144053
143968
  if (extensionless) {
144054
- this.files[extensionless] = new import_build_utils16.FileFsRef({ mode, fsPath });
143969
+ this.files[extensionless] = new import_build_utils18.FileFsRef({ mode, fsPath });
144055
143970
  }
144056
143971
  }
144057
143972
  await this.updateBuildMatches(vercelConfig, true);
@@ -144420,7 +144335,7 @@ ${error_code}
144420
144335
  }
144421
144336
  output_manager_default.log(`Running Dev Command ${import_chalk59.default.cyan.bold(`\u201C${devCommand2}\u201D`)}`);
144422
144337
  const port = await (0, import_get_port.default)();
144423
- const env = (0, import_build_utils16.cloneEnv)(
144338
+ const env = (0, import_build_utils18.cloneEnv)(
144424
144339
  {
144425
144340
  // Because of child process 'pipe' below, isTTY will be false.
144426
144341
  // Most frameworks use `chalk`/`supports-color` so we enable it anyway.
@@ -144436,7 +144351,7 @@ ${error_code}
144436
144351
  PORT: `${port}`
144437
144352
  }
144438
144353
  );
144439
- const nodeBinPaths = (0, import_build_utils16.getNodeBinPaths)({ base: this.repoRoot, start: cwd });
144354
+ const nodeBinPaths = (0, import_build_utils18.getNodeBinPaths)({ base: this.repoRoot, start: cwd });
144440
144355
  const nodeBinPath = nodeBinPaths.join(import_path35.default.delimiter);
144441
144356
  env.PATH = `${nodeBinPath}${import_path35.default.delimiter}${env.PATH}`;
144442
144357
  let command = devCommand2.replace(/\$PORT/g, `${port}`).replace(/%PORT%/g, `${port}`);
@@ -144449,7 +144364,7 @@ ${error_code}
144449
144364
  );
144450
144365
  output_manager_default.debug(`Spawning dev command: ${command}`);
144451
144366
  const proxyPort = new RegExp(port.toString(), "g");
144452
- const p = (0, import_build_utils16.spawnCommand)(command, {
144367
+ const p = (0, import_build_utils18.spawnCommand)(command, {
144453
144368
  stdio: ["inherit", "pipe", "pipe"],
144454
144369
  cwd,
144455
144370
  env
@@ -149228,7 +149143,7 @@ async function disconnect(client2, argv) {
149228
149143
  `Your Vercel project will no longer create deployments when you push to this repository.
149229
149144
  `
149230
149145
  );
149231
- const confirmDisconnect = await confirm(
149146
+ const confirmDisconnect = autoConfirm || await confirm(
149232
149147
  client2,
149233
149148
  `Are you sure you want to disconnect ${import_chalk85.default.cyan(
149234
149149
  `${linkOrg}/${repo}`
@@ -149491,12 +149406,12 @@ async function init(client2, opts, args2, telemetry2) {
149491
149406
  const force = opts["--force"];
149492
149407
  const examples = await fetchExampleList(client2);
149493
149408
  if (!examples) {
149494
- throw new Error(`Could not fetch example list.`);
149409
+ throw new Error("Could not fetch example list.");
149495
149410
  }
149496
149411
  const exampleList = examples.filter((x) => x.visible).map((x) => x.name);
149497
149412
  if (!name) {
149498
149413
  if (client2.stdin.isTTY !== true) {
149499
- output_manager_default.print(`No framework provided`);
149414
+ output_manager_default.print("No framework provided");
149500
149415
  return 0;
149501
149416
  }
149502
149417
  const chosen = await chooseFromDropdown(
@@ -149564,7 +149479,7 @@ async function extractExample(client2, name, dir, force, ver = "v2") {
149564
149479
  const successLog = `Initialized "${import_chalk87.default.bold(
149565
149480
  name
149566
149481
  )}" example in ${import_chalk87.default.bold(humanizePath(folder))}.`;
149567
- const folderRel = import_path41.default.relative(client2.cwd, folder);
149482
+ const folderRel = import_node_path2.default.relative(client2.cwd, folder);
149568
149483
  const deployHint = folderRel === "" ? list_item_default(`To deploy, run ${getCommandName()}.`) : list_item_default(
149569
149484
  `To deploy, ${cmd(
149570
149485
  `cd ${folderRel}`
@@ -149579,16 +149494,16 @@ ${deployHint}`);
149579
149494
  });
149580
149495
  }
149581
149496
  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()) {
149497
+ const dest = import_node_path2.default.join(cwd, folder);
149498
+ if (import_node_fs.default.existsSync(dest)) {
149499
+ if (!import_node_fs.default.lstatSync(dest).isDirectory()) {
149585
149500
  throw new Error(
149586
149501
  `Destination path "${import_chalk87.default.bold(
149587
149502
  folder
149588
149503
  )}" already exists and is not a directory.`
149589
149504
  );
149590
149505
  }
149591
- if (!force && import_fs8.default.readdirSync(dest).length !== 0) {
149506
+ if (!force && import_node_fs.default.readdirSync(dest).length !== 0) {
149592
149507
  throw new Error(
149593
149508
  `Destination path "${import_chalk87.default.bold(
149594
149509
  folder
@@ -149599,7 +149514,7 @@ function prepareFolder(cwd, folder, force) {
149599
149514
  }
149600
149515
  } else if (dest !== cwd) {
149601
149516
  try {
149602
- import_fs8.default.mkdirSync(dest);
149517
+ import_node_fs.default.mkdirSync(dest);
149603
149518
  } catch (e2) {
149604
149519
  throw new Error(`Could not create directory "${import_chalk87.default.bold(folder)}".`);
149605
149520
  }
@@ -149609,7 +149524,7 @@ function prepareFolder(cwd, folder, force) {
149609
149524
  async function guess(client2, exampleList, name) {
149610
149525
  const GuessError = new Error(
149611
149526
  `No example found for ${import_chalk87.default.bold(name)}, run ${getCommandName(
149612
- `init`
149527
+ "init"
149613
149528
  )} to see the list of available examples.`
149614
149529
  );
149615
149530
  if (client2.stdin.isTTY !== true) {
@@ -149624,12 +149539,12 @@ async function guess(client2, exampleList, name) {
149624
149539
  throw GuessError;
149625
149540
  }
149626
149541
  }
149627
- var import_fs8, import_path41, import_tar_fs, import_chalk87, EXAMPLE_API;
149542
+ var import_node_fs, import_node_path2, import_tar_fs, import_chalk87, EXAMPLE_API;
149628
149543
  var init_init = __esm({
149629
149544
  "src/commands/init/init.ts"() {
149630
149545
  "use strict";
149631
- import_fs8 = __toESM3(require("fs"));
149632
- import_path41 = __toESM3(require("path"));
149546
+ import_node_fs = __toESM3(require("fs"));
149547
+ import_node_path2 = __toESM3(require("path"));
149633
149548
  import_tar_fs = __toESM3(require_tar_fs());
149634
149549
  import_chalk87 = __toESM3(require_source());
149635
149550
  init_list();
@@ -149682,8 +149597,7 @@ __export3(init_exports, {
149682
149597
  default: () => main8
149683
149598
  });
149684
149599
  async function main8(client2) {
149685
- let args2;
149686
- let parsedArgs = null;
149600
+ let parsedArgs;
149687
149601
  const flagsSpecification = getFlagsSpecification(initCommand.options);
149688
149602
  try {
149689
149603
  parsedArgs = parseArguments(client2.argv.slice(2), flagsSpecification);
@@ -149701,7 +149615,7 @@ async function main8(client2) {
149701
149615
  output_manager_default.print(help2(initCommand, { columns: client2.stderr.columns }));
149702
149616
  return 2;
149703
149617
  }
149704
- args2 = getSubcommand(parsedArgs.args.slice(1), COMMAND_CONFIG8).args;
149618
+ const args2 = getSubcommand(parsedArgs.args.slice(1), COMMAND_CONFIG8).args;
149705
149619
  if (parsedArgs.args.length > 3) {
149706
149620
  output_manager_default.error("Too many arguments.");
149707
149621
  return 1;
@@ -152451,7 +152365,7 @@ async function list3(client2) {
152451
152365
  let pagination;
152452
152366
  let contextName = "";
152453
152367
  let app = parsedArgs.args[1];
152454
- let deployments = [];
152368
+ const deployments = [];
152455
152369
  let singleDeployment = false;
152456
152370
  if (app) {
152457
152371
  if (!isValidName(app)) {
@@ -152543,11 +152457,11 @@ async function list3(client2) {
152543
152457
  }
152544
152458
  }
152545
152459
  if (!deployments.length) {
152546
- log2(`No deployments found.`);
152460
+ log2("No deployments found.");
152547
152461
  return 0;
152548
152462
  }
152549
152463
  log2(
152550
- `${target === "production" ? `Production deployments` : `Deployments`} for ${projectSlugLink} ${elapsed(Date.now() - start)}`
152464
+ `${target === "production" ? "Production deployments" : "Deployments"} for ${projectSlugLink} ${elapsed(Date.now() - start)}`
152551
152465
  );
152552
152466
  }
152553
152467
  const headers = ["Age", "Deployment", "Status", "Environment"];
@@ -152602,7 +152516,7 @@ ${tablePrint}
152602
152516
  const flags = getCommandFlags(parsedArgs.flags, ["--next"]);
152603
152517
  log2(
152604
152518
  `To display the next page, run ${getCommandName(
152605
- `ls${app ? " " + app : ""}${flags} --next ${pagination.next}`
152519
+ `ls${app ? ` ${app}` : ""}${flags} --next ${pagination.next}`
152606
152520
  )}`
152607
152521
  );
152608
152522
  }
@@ -153081,7 +152995,7 @@ async function main11(client2) {
153081
152995
  output_manager_default.spinner("Logging out\u2026", 200);
153082
152996
  let exitCode2 = 0;
153083
152997
  try {
153084
- await client2.fetch(`/v3/user/tokens/current`, {
152998
+ await client2.fetch("/v3/user/tokens/current", {
153085
152999
  method: "DELETE",
153086
153000
  useCurrentTeam: false
153087
153001
  });
@@ -153111,7 +153025,7 @@ async function main11(client2) {
153111
153025
  if (exitCode2 === 0) {
153112
153026
  output_manager_default.log("Logged out!");
153113
153027
  } else {
153114
- output_manager_default.error(`Failed during logout`);
153028
+ output_manager_default.error("Failed during logout");
153115
153029
  }
153116
153030
  return exitCode2;
153117
153031
  }
@@ -153300,7 +153214,7 @@ async function list4(client2, argv) {
153300
153214
  const elapsed2 = (0, import_ms21.default)(Date.now() - start);
153301
153215
  if (deprecated) {
153302
153216
  const upcomingDeprecationVersionsList = [];
153303
- for (const nodeVersion of import_build_utils17.NODE_VERSIONS) {
153217
+ for (const nodeVersion of import_build_utils19.NODE_VERSIONS) {
153304
153218
  if (nodeVersion.discontinueDate && nodeVersion.discontinueDate.valueOf() > Date.now()) {
153305
153219
  upcomingDeprecationVersionsList.push(nodeVersion.range);
153306
153220
  }
@@ -153351,7 +153265,7 @@ function getLatestProdUrl(project) {
153351
153265
  return `https://${alias2}`;
153352
153266
  return "--";
153353
153267
  }
153354
- var import_ms21, import_chalk101, import_build_utils17;
153268
+ var import_ms21, import_chalk101, import_build_utils19;
153355
153269
  var init_list8 = __esm({
153356
153270
  "src/commands/project/list.ts"() {
153357
153271
  "use strict";
@@ -153360,7 +153274,7 @@ var init_list8 = __esm({
153360
153274
  init_table();
153361
153275
  init_get_command_flags();
153362
153276
  init_pkg_name();
153363
- import_build_utils17 = require("@vercel/build-utils");
153277
+ import_build_utils19 = require("@vercel/build-utils");
153364
153278
  init_list7();
153365
153279
  init_output_manager();
153366
153280
  init_command21();
@@ -153947,14 +153861,13 @@ async function requestPromote({
153947
153861
  `Successfully created new deployment of ${import_chalk106.default.bold(project.name)} at ${newDeployment.inspectorUrl}`
153948
153862
  );
153949
153863
  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
153864
  }
153865
+ await client2.fetch(`/v10/projects/${project.id}/promote/${deployment.id}`, {
153866
+ body: {},
153867
+ // required
153868
+ json: false,
153869
+ method: "POST"
153870
+ });
153958
153871
  if (timeout !== void 0 && (0, import_ms24.default)(timeout) === 0) {
153959
153872
  output_manager_default.log(
153960
153873
  `Successfully requested promote of ${import_chalk106.default.bold(project.name)} to ${deployment.url} (${deployment.id})`
@@ -154065,7 +153978,7 @@ var init_promote2 = __esm({
154065
153978
  }
154066
153979
  const yes = parsedArgs.flags["--yes"] ?? false;
154067
153980
  telemetry2.trackCliFlagYes(parsedArgs.flags["--yes"]);
154068
- let timeout = parsedArgs.flags["--timeout"];
153981
+ const timeout = parsedArgs.flags["--timeout"];
154069
153982
  if (timeout && (0, import_ms25.default)(timeout) === void 0) {
154070
153983
  output_manager_default.error(`Invalid timeout "${timeout}"`);
154071
153984
  return 1;
@@ -154357,7 +154270,7 @@ async function redeploy(client2) {
154357
154270
  token: client2.authConfig.token,
154358
154271
  userAgent: ua_default
154359
154272
  };
154360
- for await (const event of (0, import_client13.checkDeploymentStatus)(
154273
+ for await (const event of (0, import_client14.checkDeploymentStatus)(
154361
154274
  deployment,
154362
154275
  clientOptions
154363
154276
  )) {
@@ -154404,12 +154317,12 @@ async function redeploy(client2) {
154404
154317
  return 1;
154405
154318
  }
154406
154319
  }
154407
- var import_chalk108, import_client13, import_error_utils30;
154320
+ var import_chalk108, import_client14, import_error_utils30;
154408
154321
  var init_redeploy2 = __esm({
154409
154322
  "src/commands/redeploy/index.ts"() {
154410
154323
  "use strict";
154411
154324
  import_chalk108 = __toESM3(require_source());
154412
- import_client13 = __toESM3(require_dist13());
154325
+ import_client14 = __toESM3(require_dist13());
154413
154326
  init_emoji();
154414
154327
  init_get_args();
154415
154328
  init_pkg_name();
@@ -154680,8 +154593,11 @@ async function remove5(client2) {
154680
154593
  return true;
154681
154594
  });
154682
154595
  if (deployments.length === 0 && projects.length === 0) {
154596
+ const safeUnaliased = parsedArgs.flags["--safe"] ? "unaliased" : "any";
154597
+ const stylizedIds = ids.map((id) => import_chalk109.default.bold(`"${id}"`)).join(", ");
154598
+ const commandName = getCommandName("projects ls");
154683
154599
  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.`
154600
+ `Could not find ${safeUnaliased} deployments or projects matching ${stylizedIds}. Run ${commandName} to list.`
154685
154601
  );
154686
154602
  return 1;
154687
154603
  }
@@ -154690,7 +154606,7 @@ async function remove5(client2) {
154690
154606
  );
154691
154607
  if (deployments.length > 200) {
154692
154608
  output_manager_default.warn(
154693
- `Only 200 deployments can get deleted at once. Please continue 10 minutes after deletion to remove the rest.`
154609
+ "Only 200 deployments can get deleted at once. Please continue 10 minutes after deletion to remove the rest."
154694
154610
  );
154695
154611
  }
154696
154612
  if (!skipConfirmation) {
@@ -155104,7 +155020,7 @@ var init_rollback2 = __esm({
155104
155020
  output_manager_default.print(help2(rollbackCommand, { columns: client2.stderr.columns }));
155105
155021
  return 2;
155106
155022
  }
155107
- let timeout = parsedArgs.flags["--timeout"];
155023
+ const timeout = parsedArgs.flags["--timeout"];
155108
155024
  if (timeout && (0, import_ms29.default)(timeout) === void 0) {
155109
155025
  output_manager_default.error(`Invalid timeout "${timeout}"`);
155110
155026
  return 1;
@@ -156457,8 +156373,8 @@ var init_whoami2 = __esm({
156457
156373
 
156458
156374
  // src/index.ts
156459
156375
  var import_error_utils34 = __toESM3(require_dist2());
156460
- var import_path42 = require("path");
156461
- var import_fs9 = require("fs");
156376
+ var import_path41 = require("path");
156377
+ var import_fs8 = require("fs");
156462
156378
  var import_fs_extra23 = __toESM3(require_lib());
156463
156379
  var import_chalk119 = __toESM3(require_source());
156464
156380
  var import_epipebomb = __toESM3(require_epipebomb());
@@ -156735,7 +156651,7 @@ init_errors_ts();
156735
156651
  init_errors_ts();
156736
156652
 
156737
156653
  // src/util/constants.ts
156738
- var SENTRY_DSN = "https://26a24e59ba954011919a524b341b6ab5@sentry.io/1323225";
156654
+ var SENTRY_DSN = void 0;
156739
156655
 
156740
156656
  // src/index.ts
156741
156657
  init_get_update_command();
@@ -157844,8 +157760,8 @@ var main14 = async () => {
157844
157760
  let subcommand = void 0;
157845
157761
  let userSuppliedSubCommand = "";
157846
157762
  if (targetOrSubcommand) {
157847
- const targetPath = (0, import_path42.join)(cwd, targetOrSubcommand);
157848
- const targetPathExists = (0, import_fs9.existsSync)(targetPath);
157763
+ const targetPath = (0, import_path41.join)(cwd, targetOrSubcommand);
157764
+ const targetPathExists = (0, import_fs8.existsSync)(targetPath);
157849
157765
  const subcommandExists = GLOBAL_COMMANDS.has(targetOrSubcommand) || commands.has(targetOrSubcommand);
157850
157766
  if (targetPathExists && subcommandExists && !parsedArgs.flags["--cwd"] && !process.env.NOW_BUILDER) {
157851
157767
  output_manager_default.warn(
@@ -158205,9 +158121,7 @@ var main14 = async () => {
158205
158121
  }
158206
158122
  return 1;
158207
158123
  }
158208
- if (subSubCommand !== "flush") {
158209
- await telemetryEventStore.save();
158210
- }
158124
+ await telemetryEventStore.save();
158211
158125
  return exitCode2;
158212
158126
  };
158213
158127
  var handleRejection = async (err) => {