vercel 28.4.17 → 28.5.0

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 +359 -171
  2. package/package.json +5 -6
package/dist/index.js CHANGED
@@ -205215,138 +205215,6 @@ exports.fromPromise = function (fn) {
205215
205215
  }
205216
205216
 
205217
205217
 
205218
- /***/ }),
205219
-
205220
- /***/ 36732:
205221
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
205222
-
205223
- const isWindows = process.platform === 'win32' ||
205224
- process.env.OSTYPE === 'cygwin' ||
205225
- process.env.OSTYPE === 'msys'
205226
-
205227
- const path = __webpack_require__(85622)
205228
- const COLON = isWindows ? ';' : ':'
205229
- const isexe = __webpack_require__(80228)
205230
-
205231
- const getNotFoundError = (cmd) =>
205232
- Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })
205233
-
205234
- const getPathInfo = (cmd, opt) => {
205235
- const colon = opt.colon || COLON
205236
-
205237
- // If it has a slash, then we don't bother searching the pathenv.
205238
- // just check the file itself, and that's it.
205239
- const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? ['']
205240
- : (
205241
- [
205242
- // windows always checks the cwd first
205243
- ...(isWindows ? [process.cwd()] : []),
205244
- ...(opt.path || process.env.PATH ||
205245
- /* istanbul ignore next: very unusual */ '').split(colon),
205246
- ]
205247
- )
205248
- const pathExtExe = isWindows
205249
- ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'
205250
- : ''
205251
- const pathExt = isWindows ? pathExtExe.split(colon) : ['']
205252
-
205253
- if (isWindows) {
205254
- if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
205255
- pathExt.unshift('')
205256
- }
205257
-
205258
- return {
205259
- pathEnv,
205260
- pathExt,
205261
- pathExtExe,
205262
- }
205263
- }
205264
-
205265
- const which = (cmd, opt, cb) => {
205266
- if (typeof opt === 'function') {
205267
- cb = opt
205268
- opt = {}
205269
- }
205270
- if (!opt)
205271
- opt = {}
205272
-
205273
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)
205274
- const found = []
205275
-
205276
- const step = i => new Promise((resolve, reject) => {
205277
- if (i === pathEnv.length)
205278
- return opt.all && found.length ? resolve(found)
205279
- : reject(getNotFoundError(cmd))
205280
-
205281
- const ppRaw = pathEnv[i]
205282
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw
205283
-
205284
- const pCmd = path.join(pathPart, cmd)
205285
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd
205286
- : pCmd
205287
-
205288
- resolve(subStep(p, i, 0))
205289
- })
205290
-
205291
- const subStep = (p, i, ii) => new Promise((resolve, reject) => {
205292
- if (ii === pathExt.length)
205293
- return resolve(step(i + 1))
205294
- const ext = pathExt[ii]
205295
- isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
205296
- if (!er && is) {
205297
- if (opt.all)
205298
- found.push(p + ext)
205299
- else
205300
- return resolve(p + ext)
205301
- }
205302
- return resolve(subStep(p, i, ii + 1))
205303
- })
205304
- })
205305
-
205306
- return cb ? step(0).then(res => cb(null, res), cb) : step(0)
205307
- }
205308
-
205309
- const whichSync = (cmd, opt) => {
205310
- opt = opt || {}
205311
-
205312
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)
205313
- const found = []
205314
-
205315
- for (let i = 0; i < pathEnv.length; i ++) {
205316
- const ppRaw = pathEnv[i]
205317
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw
205318
-
205319
- const pCmd = path.join(pathPart, cmd)
205320
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd
205321
- : pCmd
205322
-
205323
- for (let j = 0; j < pathExt.length; j ++) {
205324
- const cur = p + pathExt[j]
205325
- try {
205326
- const is = isexe.sync(cur, { pathExt: pathExtExe })
205327
- if (is) {
205328
- if (opt.all)
205329
- found.push(cur)
205330
- else
205331
- return cur
205332
- }
205333
- } catch (ex) {}
205334
- }
205335
- }
205336
-
205337
- if (opt.all && found.length)
205338
- return found
205339
-
205340
- if (opt.nothrow)
205341
- return null
205342
-
205343
- throw getNotFoundError(cmd)
205344
- }
205345
-
205346
- module.exports = which
205347
- which.sync = whichSync
205348
-
205349
-
205350
205218
  /***/ }),
205351
205219
 
205352
205220
  /***/ 87556:
@@ -220138,6 +220006,78 @@ exports.DetectorFilesystem = DetectorFilesystem;
220138
220006
 
220139
220007
  /***/ }),
220140
220008
 
220009
+ /***/ 24885:
220010
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
220011
+
220012
+ "use strict";
220013
+
220014
+ var __importDefault = (this && this.__importDefault) || function (mod) {
220015
+ return (mod && mod.__esModule) ? mod : { "default": mod };
220016
+ };
220017
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
220018
+ exports.LocalFileSystemDetector = void 0;
220019
+ const promises_1 = __importDefault(__webpack_require__(69225));
220020
+ const path_1 = __importDefault(__webpack_require__(85622));
220021
+ const filesystem_1 = __webpack_require__(56114);
220022
+ const error_utils_1 = __webpack_require__(68005);
220023
+ class LocalFileSystemDetector extends filesystem_1.DetectorFilesystem {
220024
+ constructor(rootPath) {
220025
+ super();
220026
+ this.rootPath = rootPath;
220027
+ }
220028
+ async _hasPath(name) {
220029
+ try {
220030
+ await promises_1.default.stat(this.getFilePath(name));
220031
+ return true;
220032
+ }
220033
+ catch (err) {
220034
+ if (error_utils_1.isErrnoException(err) && err.code === 'ENOENT') {
220035
+ return false;
220036
+ }
220037
+ throw err;
220038
+ }
220039
+ }
220040
+ _readFile(name) {
220041
+ return promises_1.default.readFile(this.getFilePath(name));
220042
+ }
220043
+ async _isFile(name) {
220044
+ const stat = await promises_1.default.stat(this.getFilePath(name));
220045
+ return stat.isFile();
220046
+ }
220047
+ async _readdir(name) {
220048
+ const dirPath = this.getFilePath(name);
220049
+ const dir = await promises_1.default.readdir(dirPath, {
220050
+ withFileTypes: true,
220051
+ });
220052
+ const getType = (dirent) => {
220053
+ if (dirent.isFile()) {
220054
+ return 'file';
220055
+ }
220056
+ else if (dirent.isDirectory()) {
220057
+ return 'dir';
220058
+ }
220059
+ else {
220060
+ throw new Error(`Dirent was neither file nor directory`);
220061
+ }
220062
+ };
220063
+ return dir.map(dirent => ({
220064
+ name: dirent.name,
220065
+ path: path_1.default.join(dirPath, dirent.name),
220066
+ type: getType(dirent),
220067
+ }));
220068
+ }
220069
+ _chdir(name) {
220070
+ return new LocalFileSystemDetector(this.getFilePath(name));
220071
+ }
220072
+ getFilePath(name) {
220073
+ return path_1.default.join(this.rootPath, name);
220074
+ }
220075
+ }
220076
+ exports.LocalFileSystemDetector = LocalFileSystemDetector;
220077
+ //# sourceMappingURL=local-file-system-detector.js.map
220078
+
220079
+ /***/ }),
220080
+
220141
220081
  /***/ 47968:
220142
220082
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
220143
220083
 
@@ -220191,7 +220131,7 @@ exports.getProjectPaths = getProjectPaths;
220191
220131
  "use strict";
220192
220132
 
220193
220133
  Object.defineProperty(exports, "__esModule", ({ value: true }));
220194
- exports.isStaticRuntime = exports.isOfficialRuntime = exports.monorepoManagers = exports.getWorkspacePackagePaths = exports.getWorkspaces = exports.workspaceManagers = exports.DetectorFilesystem = exports.getProjectPaths = exports.detectFramework = exports.detectFileSystemAPI = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = void 0;
220134
+ exports.packageManagers = exports.isStaticRuntime = exports.isOfficialRuntime = exports.monorepoManagers = exports.getWorkspacePackagePaths = exports.getWorkspaces = exports.workspaceManagers = exports.LocalFileSystemDetector = exports.DetectorFilesystem = exports.getProjectPaths = exports.detectFramework = exports.detectFileSystemAPI = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = void 0;
220195
220135
  var detect_builders_1 = __webpack_require__(48163);
220196
220136
  Object.defineProperty(exports, "detectBuilders", ({ enumerable: true, get: function () { return detect_builders_1.detectBuilders; } }));
220197
220137
  Object.defineProperty(exports, "detectOutputDirectory", ({ enumerable: true, get: function () { return detect_builders_1.detectOutputDirectory; } }));
@@ -220205,6 +220145,8 @@ var get_project_paths_1 = __webpack_require__(47968);
220205
220145
  Object.defineProperty(exports, "getProjectPaths", ({ enumerable: true, get: function () { return get_project_paths_1.getProjectPaths; } }));
220206
220146
  var filesystem_1 = __webpack_require__(56114);
220207
220147
  Object.defineProperty(exports, "DetectorFilesystem", ({ enumerable: true, get: function () { return filesystem_1.DetectorFilesystem; } }));
220148
+ var local_file_system_detector_1 = __webpack_require__(24885);
220149
+ Object.defineProperty(exports, "LocalFileSystemDetector", ({ enumerable: true, get: function () { return local_file_system_detector_1.LocalFileSystemDetector; } }));
220208
220150
  var workspace_managers_1 = __webpack_require__(20503);
220209
220151
  Object.defineProperty(exports, "workspaceManagers", ({ enumerable: true, get: function () { return workspace_managers_1.workspaceManagers; } }));
220210
220152
  var get_workspaces_1 = __webpack_require__(54899);
@@ -220216,6 +220158,8 @@ Object.defineProperty(exports, "monorepoManagers", ({ enumerable: true, get: fun
220216
220158
  var is_official_runtime_1 = __webpack_require__(78800);
220217
220159
  Object.defineProperty(exports, "isOfficialRuntime", ({ enumerable: true, get: function () { return is_official_runtime_1.isOfficialRuntime; } }));
220218
220160
  Object.defineProperty(exports, "isStaticRuntime", ({ enumerable: true, get: function () { return is_official_runtime_1.isStaticRuntime; } }));
220161
+ var package_managers_1 = __webpack_require__(3334);
220162
+ Object.defineProperty(exports, "packageManagers", ({ enumerable: true, get: function () { return package_managers_1.packageManagers; } }));
220219
220163
  //# sourceMappingURL=index.js.map
220220
220164
 
220221
220165
  /***/ }),
@@ -220331,36 +220275,104 @@ exports.monorepoManagers = [
220331
220275
  },
220332
220276
  },
220333
220277
  },
220278
+ // TODO (@Ethan-Arrowood) - Revisit rush support when we can test it better
220279
+ /* {
220280
+ name: 'Rush',
220281
+ slug: 'rush',
220282
+ logo: 'https://api-frameworks.vercel.sh/monorepo-logos/rush.svg',
220283
+ detectors: {
220284
+ every: [
220285
+ {
220286
+ path: 'rush.json',
220287
+ },
220288
+ ],
220289
+ },
220290
+ settings: {
220291
+ buildCommand: {
220292
+ placeholder: 'Rush default',
220293
+ value: null,
220294
+ },
220295
+ outputDirectory: {
220296
+ value: null,
220297
+ },
220298
+ installCommand: {
220299
+ placeholder: 'Rush default',
220300
+ },
220301
+ devCommand: {
220302
+ value: null,
220303
+ },
220304
+ },
220305
+ }, */
220306
+ ];
220307
+ exports.default = exports.monorepoManagers;
220308
+ //# sourceMappingURL=monorepo-managers.js.map
220309
+
220310
+ /***/ }),
220311
+
220312
+ /***/ 3334:
220313
+ /***/ ((__unused_webpack_module, exports) => {
220314
+
220315
+ "use strict";
220316
+
220317
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
220318
+ exports.packageManagers = void 0;
220319
+ exports.packageManagers = [
220320
+ {
220321
+ name: 'npm',
220322
+ slug: 'npm',
220323
+ logo: '',
220324
+ darkModeLogo: '',
220325
+ detectors: {
220326
+ some: [
220327
+ {
220328
+ path: 'package-lock.json',
220329
+ },
220330
+ {
220331
+ path: 'package.json',
220332
+ matchContent: '"packageManager":\\s*"npm@.*"',
220333
+ },
220334
+ ],
220335
+ },
220336
+ },
220334
220337
  {
220335
- name: 'Rush',
220336
- slug: 'rush',
220337
- logo: 'https://api-frameworks.vercel.sh/monorepo-logos/rush.svg',
220338
+ name: 'pnpm',
220339
+ slug: 'pnpm',
220340
+ logo: '',
220341
+ darkModeLogo: '',
220338
220342
  detectors: {
220339
- every: [
220343
+ some: [
220340
220344
  {
220341
- path: 'rush.json',
220345
+ path: 'pnpm-lock.yaml',
220346
+ },
220347
+ {
220348
+ path: 'package.json',
220349
+ matchContent: '"packageManager":\\s*"pnpm@.*"',
220342
220350
  },
220343
220351
  ],
220344
220352
  },
220345
- settings: {
220346
- buildCommand: {
220347
- placeholder: 'Rush default',
220348
- value: null,
220349
- },
220350
- outputDirectory: {
220351
- value: null,
220352
- },
220353
- installCommand: {
220354
- placeholder: 'Rush default',
220355
- },
220356
- devCommand: {
220357
- value: null,
220358
- },
220353
+ },
220354
+ {
220355
+ name: 'yarn',
220356
+ slug: 'yarn',
220357
+ logo: '',
220358
+ darkModeLogo: '',
220359
+ detectors: {
220360
+ some: [
220361
+ {
220362
+ path: 'yarn.lock',
220363
+ },
220364
+ {
220365
+ path: 'package.json',
220366
+ matchContent: '"packageManager":\\s*"yarn@.*"',
220367
+ },
220368
+ {
220369
+ path: 'package.json',
220370
+ },
220371
+ ],
220359
220372
  },
220360
220373
  },
220361
220374
  ];
220362
- exports.default = exports.monorepoManagers;
220363
- //# sourceMappingURL=monorepo-managers.js.map
220375
+ //# sourceMappingURL=package-managers.js.map
220364
220376
 
220365
220377
  /***/ }),
220366
220378
 
@@ -220686,6 +220698,84 @@ exports.default = exports.workspaceManagers;
220686
220698
 
220687
220699
  /***/ }),
220688
220700
 
220701
+ /***/ 68005:
220702
+ /***/ ((__unused_webpack_module, exports) => {
220703
+
220704
+ "use strict";
220705
+
220706
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
220707
+ exports.isSpawnError = exports.normalizeError = exports.errorToString = exports.isErrorLike = exports.isErrnoException = exports.isError = exports.isObject = void 0;
220708
+ /**
220709
+ * A simple type guard for objects.
220710
+ *
220711
+ * @param obj - A possible object
220712
+ */
220713
+ const isObject = (obj) => typeof obj === 'object' && obj !== null;
220714
+ exports.isObject = isObject;
220715
+ /**
220716
+ * A type guard for `try...catch` errors.
220717
+ *
220718
+ * This function is based on:
220719
+ * https://github.com/stdlib-js/assert-is-error
220720
+ */
220721
+ const isError = (error) => {
220722
+ if (!(0, exports.isObject)(error))
220723
+ return false;
220724
+ // Check for `Error` objects instantiated within the current global context.
220725
+ if (error instanceof Error)
220726
+ return true;
220727
+ // Walk the prototype tree until we find a matching object.
220728
+ while (error) {
220729
+ if (Object.prototype.toString.call(error) === '[object Error]')
220730
+ return true;
220731
+ error = Object.getPrototypeOf(error);
220732
+ }
220733
+ return false;
220734
+ };
220735
+ exports.isError = isError;
220736
+ const isErrnoException = (error) => {
220737
+ return (0, exports.isError)(error) && 'code' in error;
220738
+ };
220739
+ exports.isErrnoException = isErrnoException;
220740
+ /**
220741
+ * A type guard for error-like objects.
220742
+ */
220743
+ const isErrorLike = (error) => (0, exports.isObject)(error) && 'message' in error;
220744
+ exports.isErrorLike = isErrorLike;
220745
+ /**
220746
+ * Parses errors to string, useful for getting the error message in a
220747
+ * `try...catch` statement.
220748
+ */
220749
+ const errorToString = (error, fallback) => {
220750
+ if ((0, exports.isError)(error) || (0, exports.isErrorLike)(error))
220751
+ return error.message;
220752
+ if (typeof error === 'string')
220753
+ return error;
220754
+ return fallback ?? 'An unknown error has ocurred.';
220755
+ };
220756
+ exports.errorToString = errorToString;
220757
+ /**
220758
+ * Normalizes unknown errors to the Error type, useful for working with errors
220759
+ * in a `try...catch` statement.
220760
+ */
220761
+ const normalizeError = (error) => {
220762
+ if ((0, exports.isError)(error))
220763
+ return error;
220764
+ const errorMessage = (0, exports.errorToString)(error);
220765
+ // Copy over additional properties if the object is error-like.
220766
+ return (0, exports.isErrorLike)(error)
220767
+ ? Object.assign(new Error(errorMessage), error)
220768
+ : new Error(errorMessage);
220769
+ };
220770
+ exports.normalizeError = normalizeError;
220771
+ function isSpawnError(v) {
220772
+ return (0, exports.isErrnoException)(v) && 'spawnargs' in v;
220773
+ }
220774
+ exports.isSpawnError = isSpawnError;
220775
+ //# sourceMappingURL=index.js.map
220776
+
220777
+ /***/ }),
220778
+
220689
220779
  /***/ 83532:
220690
220780
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
220691
220781
 
@@ -232232,6 +232322,7 @@ const corepack_1 = __webpack_require__(51806);
232232
232322
  const sort_builders_1 = __webpack_require__(40233);
232233
232323
  const error_1 = __webpack_require__(54094);
232234
232324
  const validate_config_1 = __webpack_require__(14864);
232325
+ const monorepo_1 = __webpack_require__(46570);
232235
232326
  const help = () => {
232236
232327
  return console.log(`
232237
232328
  ${chalk_1.default.bold(`${cli.logo} ${cli.name} build`)}
@@ -232249,7 +232340,7 @@ const help = () => {
232249
232340
 
232250
232341
  ${chalk_1.default.dim('Examples:')}
232251
232342
 
232252
- ${chalk_1.default.gray('')} Build the project
232343
+ ${chalk_1.default.gray('-')} Build the project
232253
232344
 
232254
232345
  ${chalk_1.default.cyan(`$ ${cli.name} build`)}
232255
232346
  ${chalk_1.default.cyan(`$ ${cli.name} build --cwd ./path-to-project`)}
@@ -232408,6 +232499,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir) {
232408
232499
  ...project.settings,
232409
232500
  ...(0, project_settings_1.pickOverrides)(localConfig),
232410
232501
  };
232502
+ await (0, monorepo_1.setMonorepoDefaultSettings)(cwd, workPath, projectSettings, output);
232411
232503
  // Get a list of source files
232412
232504
  const files = (await (0, get_files_1.staticFiles)(workPath, client)).map(f => (0, build_utils_1.normalizePath)((0, path_1.relative)(workPath, f)));
232413
232505
  const routesResult = (0, routing_utils_1.getTransformedRoutes)(localConfig);
@@ -240472,6 +240564,106 @@ async function installBuilders(buildersDir, buildersToAdd, output) {
240472
240564
  }
240473
240565
 
240474
240566
 
240567
+ /***/ }),
240568
+
240569
+ /***/ 46570:
240570
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
240571
+
240572
+ "use strict";
240573
+
240574
+ var __importDefault = (this && this.__importDefault) || function (mod) {
240575
+ return (mod && mod.__esModule) ? mod : { "default": mod };
240576
+ };
240577
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
240578
+ exports.setMonorepoDefaultSettings = void 0;
240579
+ const fs_extra_1 = __importDefault(__webpack_require__(45392));
240580
+ const path_1 = __webpack_require__(85622);
240581
+ const fs_detectors_1 = __webpack_require__(20302);
240582
+ const title_1 = __importDefault(__webpack_require__(45676));
240583
+ async function setMonorepoDefaultSettings(cwd, workPath, projectSettings, output) {
240584
+ const localFileSystem = new fs_detectors_1.LocalFileSystemDetector(cwd);
240585
+ const [monorepoManager, packageManager] = await Promise.all([
240586
+ (0, fs_detectors_1.detectFramework)({
240587
+ fs: localFileSystem,
240588
+ frameworkList: fs_detectors_1.monorepoManagers,
240589
+ }),
240590
+ (0, fs_detectors_1.detectFramework)({
240591
+ fs: localFileSystem,
240592
+ frameworkList: fs_detectors_1.packageManagers,
240593
+ }),
240594
+ ]);
240595
+ const projectName = (0, path_1.basename)(workPath);
240596
+ const relativeToRoot = (0, path_1.relative)(workPath, cwd);
240597
+ const setCommand = (command, value) => {
240598
+ if (projectSettings[command]) {
240599
+ output.warn(`Cannot automatically assign ${command} as it is already set via project settings or configuarion overrides.`);
240600
+ }
240601
+ else {
240602
+ projectSettings[command] = value;
240603
+ }
240604
+ };
240605
+ if (monorepoManager) {
240606
+ output.log(`Automatically detected ${(0, title_1.default)(monorepoManager)} monorepo manager. Attempting to assign default \`buildCommand\` and \`installCommand\` settings.`);
240607
+ }
240608
+ if (monorepoManager === 'turbo') {
240609
+ // No ENOENT handling required here since conditional wouldn't be `true` unless `turbo.json` was found.
240610
+ const turboJSON = JSON.parse(fs_extra_1.default.readFileSync((0, path_1.join)(cwd, 'turbo.json'), 'utf-8'));
240611
+ if (!turboJSON?.pipeline?.build) {
240612
+ output.warn('Missing required `build` pipeline in turbo.json. Skipping automatic setting assignment.');
240613
+ return;
240614
+ }
240615
+ setCommand('buildCommand', `cd ${relativeToRoot} && npx turbo run build --filter=${projectName}...`);
240616
+ setCommand('installCommand', `cd ${relativeToRoot} && ${packageManager} install`);
240617
+ }
240618
+ else if (monorepoManager === 'nx') {
240619
+ // No ENOENT handling required here since conditional wouldn't be `true` unless `nx.json` was found.
240620
+ const nxJSON = JSON.parse(fs_extra_1.default.readFileSync((0, path_1.join)(cwd, 'nx.json'), 'utf-8'));
240621
+ if (!nxJSON?.targetDefaults?.build) {
240622
+ output.log('Missing default `build` target in nx.json. Checking for project level Nx configuration...');
240623
+ const [projectJSONBuf, packageJsonBuf] = await Promise.all([
240624
+ fs_extra_1.default.readFile((0, path_1.join)(workPath, 'project.json')).catch(() => null),
240625
+ fs_extra_1.default.readFile((0, path_1.join)(workPath, 'package.json')).catch(() => null),
240626
+ ]);
240627
+ let hasBuildTarget = false;
240628
+ if (projectJSONBuf) {
240629
+ output.log('Found project.json Nx configuration.');
240630
+ const projectJSON = JSON.parse(projectJSONBuf.toString('utf-8'));
240631
+ if (projectJSON?.targets?.build) {
240632
+ hasBuildTarget = true;
240633
+ }
240634
+ }
240635
+ if (packageJsonBuf) {
240636
+ const packageJSON = JSON.parse(packageJsonBuf.toString('utf-8'));
240637
+ if (packageJSON?.nx) {
240638
+ output.log('Found package.json Nx configuration.');
240639
+ if (packageJSON.nx.targets?.build) {
240640
+ hasBuildTarget = true;
240641
+ }
240642
+ }
240643
+ }
240644
+ if (!hasBuildTarget) {
240645
+ output.warn('Missing required `build` target in either project.json or package.json Nx configuration. Skipping automatic setting assignment.');
240646
+ return;
240647
+ }
240648
+ }
240649
+ setCommand('buildCommand', `cd ${relativeToRoot} && npx nx build ${projectName}`);
240650
+ setCommand('installCommand', `cd ${relativeToRoot} && ${packageManager} install`);
240651
+ }
240652
+ // TODO (@Ethan-Arrowood) - Revisit rush support when we can test it better
240653
+ /* else if (monorepoManager === 'rush') {
240654
+ setCommand(
240655
+ 'buildCommand',
240656
+ `node ${relativeToRoot}/common/scripts/install-run-rush.js build --to ${projectName}`
240657
+ );
240658
+ setCommand(
240659
+ 'installCommand',
240660
+ `node ${relativeToRoot}/common/scripts/install-run-rush.js install`
240661
+ );
240662
+ } */
240663
+ }
240664
+ exports.setMonorepoDefaultSettings = setMonorepoDefaultSettings;
240665
+
240666
+
240475
240667
  /***/ }),
240476
240668
 
240477
240669
  /***/ 40233:
@@ -243784,7 +243976,6 @@ const directory_1 = __importDefault(__webpack_require__(52662));
243784
243976
  const get_port_1 = __importDefault(__webpack_require__(99142));
243785
243977
  const is_port_reachable_1 = __importDefault(__webpack_require__(74133));
243786
243978
  const fast_deep_equal_1 = __importDefault(__webpack_require__(27689));
243787
- const which_1 = __importDefault(__webpack_require__(36732));
243788
243979
  const npm_package_arg_1 = __importDefault(__webpack_require__(79726));
243789
243980
  const client_1 = __webpack_require__(20192);
243790
243981
  const routing_utils_1 = __webpack_require__(72948);
@@ -245362,6 +245553,9 @@ class DevServer {
245362
245553
  }, process.env, this.envConfigs.allEnv, {
245363
245554
  PORT: `${port}`,
245364
245555
  });
245556
+ // add the node_modules/.bin directory to the PATH
245557
+ const nodeBinPath = await (0, build_utils_1.getNodeBinPath)({ cwd });
245558
+ env.PATH = `${nodeBinPath}${path_1.default.delimiter}${env.PATH}`;
245365
245559
  // This is necesary so that the dev command in the Project
245366
245560
  // will work cross-platform (especially Windows).
245367
245561
  let command = devCommand
@@ -245372,20 +245566,6 @@ class DevServer {
245372
245566
  command,
245373
245567
  port,
245374
245568
  })}`);
245375
- const isNpxAvailable = await (0, which_1.default)('npx')
245376
- .then(() => true)
245377
- .catch(() => false);
245378
- if (isNpxAvailable) {
245379
- command = `npx --no-install ${command}`;
245380
- }
245381
- else {
245382
- const isYarnAvailable = await (0, which_1.default)('yarn')
245383
- .then(() => true)
245384
- .catch(() => false);
245385
- if (isYarnAvailable) {
245386
- command = `yarn run --silent ${command}`;
245387
- }
245388
- }
245389
245569
  this.output.debug(`Spawning dev command: ${command}`);
245390
245570
  const proxyPort = new RegExp(port.toString(), 'g');
245391
245571
  const p = (0, build_utils_1.spawnCommand)(command, {
@@ -254352,7 +254532,7 @@ module.exports = JSON.parse("{\"application/1d-interleaved-parityfec\":{\"source
254352
254532
  /***/ ((module) => {
254353
254533
 
254354
254534
  "use strict";
254355
- module.exports = JSON.parse("{\"name\":\"vercel\",\"version\":\"28.4.17\",\"preferGlobal\":true,\"license\":\"Apache-2.0\",\"description\":\"The command-line interface for Vercel\",\"homepage\":\"https://vercel.com\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/vercel/vercel.git\",\"directory\":\"packages/cli\"},\"scripts\":{\"preinstall\":\"node ./scripts/preinstall.js\",\"test\":\"jest --env node --verbose --runInBand --bail --forceExit\",\"test-unit\":\"yarn test test/unit/\",\"test-integration-cli\":\"rimraf test/fixtures/integration && ava test/integration.js --serial --fail-fast --verbose\",\"test-integration-dev\":\"yarn test test/dev/\",\"coverage\":\"codecov\",\"build\":\"ts-node ./scripts/build.ts\",\"dev\":\"ts-node ./src/index.ts\"},\"bin\":{\"vc\":\"./dist/index.js\",\"vercel\":\"./dist/index.js\"},\"files\":[\"dist\",\"scripts/preinstall.js\"],\"ava\":{\"extensions\":[\"ts\"],\"require\":[\"ts-node/register/transpile-only\",\"esm\"]},\"engines\":{\"node\":\">= 14\"},\"dependencies\":{\"@vercel/build-utils\":\"5.5.7\",\"@vercel/go\":\"2.2.15\",\"@vercel/hydrogen\":\"0.0.29\",\"@vercel/next\":\"3.2.11\",\"@vercel/node\":\"2.6.2\",\"@vercel/python\":\"3.1.24\",\"@vercel/redwood\":\"1.0.35\",\"@vercel/remix\":\"1.0.35\",\"@vercel/ruby\":\"1.3.41\",\"@vercel/static-build\":\"1.0.36\",\"update-notifier\":\"5.1.0\"},\"devDependencies\":{\"@alex_neo/jest-expect-message\":\"1.0.5\",\"@next/env\":\"11.1.2\",\"@sentry/node\":\"5.5.0\",\"@sindresorhus/slugify\":\"0.11.0\",\"@swc/core\":\"1.2.218\",\"@tootallnate/once\":\"1.1.2\",\"@types/ansi-escapes\":\"3.0.0\",\"@types/ansi-regex\":\"4.0.0\",\"@types/async-retry\":\"1.2.1\",\"@types/bytes\":\"3.0.0\",\"@types/chance\":\"1.1.3\",\"@types/debug\":\"0.0.31\",\"@types/dotenv\":\"6.1.1\",\"@types/escape-html\":\"0.0.20\",\"@types/express\":\"4.17.13\",\"@types/fs-extra\":\"9.0.13\",\"@types/glob\":\"7.1.1\",\"@types/http-proxy\":\"1.16.2\",\"@types/ini\":\"1.3.31\",\"@types/inquirer\":\"7.3.1\",\"@types/jest\":\"27.4.1\",\"@types/jest-expect-message\":\"1.0.3\",\"@types/load-json-file\":\"2.0.7\",\"@types/mime-types\":\"2.1.0\",\"@types/minimatch\":\"3.0.3\",\"@types/mri\":\"1.1.0\",\"@types/ms\":\"0.7.30\",\"@types/node\":\"14.18.33\",\"@types/node-fetch\":\"2.5.10\",\"@types/npm-package-arg\":\"6.1.0\",\"@types/pluralize\":\"0.0.29\",\"@types/psl\":\"1.1.0\",\"@types/semver\":\"6.0.1\",\"@types/tar-fs\":\"1.16.1\",\"@types/text-table\":\"0.2.0\",\"@types/title\":\"3.4.1\",\"@types/universal-analytics\":\"0.4.2\",\"@types/update-notifier\":\"5.1.0\",\"@types/which\":\"1.3.2\",\"@types/write-json-file\":\"2.2.1\",\"@types/yauzl-promise\":\"2.1.0\",\"@vercel/client\":\"12.2.17\",\"@vercel/error-utils\":\"1.0.3\",\"@vercel/frameworks\":\"1.1.12\",\"@vercel/fs-detectors\":\"3.4.9\",\"@vercel/fun\":\"1.0.4\",\"@vercel/ncc\":\"0.24.0\",\"@zeit/source-map-support\":\"0.6.2\",\"ajv\":\"6.12.2\",\"alpha-sort\":\"2.0.1\",\"ansi-escapes\":\"3.0.0\",\"ansi-regex\":\"3.0.0\",\"arg\":\"5.0.0\",\"async-listen\":\"1.2.0\",\"async-retry\":\"1.1.3\",\"async-sema\":\"2.1.4\",\"ava\":\"2.2.0\",\"boxen\":\"4.2.0\",\"bytes\":\"3.0.0\",\"chalk\":\"4.1.0\",\"chance\":\"1.1.7\",\"chokidar\":\"3.3.1\",\"codecov\":\"3.8.2\",\"cpy\":\"7.2.0\",\"date-fns\":\"1.29.0\",\"debug\":\"3.1.0\",\"dot\":\"1.1.3\",\"dotenv\":\"4.0.0\",\"email-prompt\":\"0.3.2\",\"email-validator\":\"1.1.1\",\"epipebomb\":\"1.0.0\",\"escape-html\":\"1.0.3\",\"esm\":\"3.1.4\",\"execa\":\"3.2.0\",\"express\":\"4.17.1\",\"fast-deep-equal\":\"3.1.3\",\"fs-extra\":\"10.0.0\",\"get-port\":\"5.1.1\",\"git-last-commit\":\"1.0.1\",\"glob\":\"7.1.2\",\"http-proxy\":\"1.18.1\",\"ini\":\"3.0.0\",\"inquirer\":\"7.0.4\",\"is-docker\":\"2.2.1\",\"is-port-reachable\":\"3.1.0\",\"is-url\":\"1.2.2\",\"jaro-winkler\":\"0.2.8\",\"jsonlines\":\"0.1.1\",\"load-json-file\":\"3.0.0\",\"mime-types\":\"2.1.24\",\"minimatch\":\"3.0.4\",\"mri\":\"1.1.5\",\"ms\":\"2.1.2\",\"node-fetch\":\"2.6.7\",\"npm-package-arg\":\"6.1.0\",\"open\":\"8.4.0\",\"ora\":\"3.4.0\",\"pcre-to-regexp\":\"1.0.0\",\"pluralize\":\"7.0.0\",\"promisepipe\":\"3.0.0\",\"psl\":\"1.1.31\",\"qr-image\":\"3.2.0\",\"raw-body\":\"2.4.1\",\"rimraf\":\"3.0.2\",\"semver\":\"5.5.0\",\"serve-handler\":\"6.1.1\",\"strip-ansi\":\"5.2.0\",\"stripe\":\"5.1.0\",\"tar-fs\":\"1.16.3\",\"test-listen\":\"1.1.0\",\"text-table\":\"0.2.0\",\"title\":\"3.4.1\",\"tmp-promise\":\"1.0.3\",\"tree-kill\":\"1.2.2\",\"ts-node\":\"10.9.1\",\"typescript\":\"4.7.4\",\"universal-analytics\":\"0.4.20\",\"utility-types\":\"2.1.0\",\"which\":\"2.0.2\",\"write-json-file\":\"2.2.0\",\"xdg-app-paths\":\"5.1.0\",\"yauzl-promise\":\"2.1.3\"},\"jest\":{\"preset\":\"ts-jest\",\"globals\":{\"ts-jest\":{\"diagnostics\":false,\"isolatedModules\":true}},\"setupFilesAfterEnv\":[\"@alex_neo/jest-expect-message\"],\"verbose\":false,\"testEnvironment\":\"node\",\"testMatch\":[\"<rootDir>/test/**/*.test.ts\"]}}");
254535
+ module.exports = JSON.parse("{\"name\":\"vercel\",\"version\":\"28.5.0\",\"preferGlobal\":true,\"license\":\"Apache-2.0\",\"description\":\"The command-line interface for Vercel\",\"homepage\":\"https://vercel.com\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/vercel/vercel.git\",\"directory\":\"packages/cli\"},\"scripts\":{\"preinstall\":\"node ./scripts/preinstall.js\",\"test\":\"jest --env node --verbose --bail --forceExit\",\"test-unit\":\"yarn test test/unit/\",\"test-integration-cli\":\"rimraf test/fixtures/integration && ava test/integration.js --serial --fail-fast --verbose\",\"test-integration-dev\":\"yarn test test/dev/\",\"coverage\":\"codecov\",\"build\":\"ts-node ./scripts/build.ts\",\"dev\":\"ts-node ./src/index.ts\"},\"bin\":{\"vc\":\"./dist/index.js\",\"vercel\":\"./dist/index.js\"},\"files\":[\"dist\",\"scripts/preinstall.js\"],\"ava\":{\"extensions\":[\"ts\"],\"require\":[\"ts-node/register/transpile-only\",\"esm\"]},\"engines\":{\"node\":\">= 14\"},\"dependencies\":{\"@vercel/build-utils\":\"5.5.7\",\"@vercel/go\":\"2.2.15\",\"@vercel/hydrogen\":\"0.0.29\",\"@vercel/next\":\"3.2.11\",\"@vercel/node\":\"2.6.2\",\"@vercel/python\":\"3.1.25\",\"@vercel/redwood\":\"1.0.35\",\"@vercel/remix\":\"1.0.35\",\"@vercel/ruby\":\"1.3.41\",\"@vercel/static-build\":\"1.0.36\",\"update-notifier\":\"5.1.0\"},\"devDependencies\":{\"@alex_neo/jest-expect-message\":\"1.0.5\",\"@next/env\":\"11.1.2\",\"@sentry/node\":\"5.5.0\",\"@sindresorhus/slugify\":\"0.11.0\",\"@swc/core\":\"1.2.218\",\"@tootallnate/once\":\"1.1.2\",\"@types/ansi-escapes\":\"3.0.0\",\"@types/ansi-regex\":\"4.0.0\",\"@types/async-retry\":\"1.2.1\",\"@types/bytes\":\"3.0.0\",\"@types/chance\":\"1.1.3\",\"@types/debug\":\"0.0.31\",\"@types/dotenv\":\"6.1.1\",\"@types/escape-html\":\"0.0.20\",\"@types/express\":\"4.17.13\",\"@types/fs-extra\":\"9.0.13\",\"@types/glob\":\"7.1.1\",\"@types/http-proxy\":\"1.16.2\",\"@types/ini\":\"1.3.31\",\"@types/inquirer\":\"7.3.1\",\"@types/jest\":\"27.4.1\",\"@types/jest-expect-message\":\"1.0.3\",\"@types/load-json-file\":\"2.0.7\",\"@types/mime-types\":\"2.1.0\",\"@types/minimatch\":\"3.0.3\",\"@types/mri\":\"1.1.0\",\"@types/ms\":\"0.7.30\",\"@types/node\":\"14.18.33\",\"@types/node-fetch\":\"2.5.10\",\"@types/npm-package-arg\":\"6.1.0\",\"@types/pluralize\":\"0.0.29\",\"@types/psl\":\"1.1.0\",\"@types/semver\":\"6.0.1\",\"@types/tar-fs\":\"1.16.1\",\"@types/text-table\":\"0.2.0\",\"@types/title\":\"3.4.1\",\"@types/universal-analytics\":\"0.4.2\",\"@types/update-notifier\":\"5.1.0\",\"@types/which\":\"1.3.2\",\"@types/write-json-file\":\"2.2.1\",\"@types/yauzl-promise\":\"2.1.0\",\"@vercel/client\":\"12.2.17\",\"@vercel/error-utils\":\"1.0.3\",\"@vercel/frameworks\":\"1.1.12\",\"@vercel/fs-detectors\":\"3.5.0\",\"@vercel/fun\":\"1.0.4\",\"@vercel/ncc\":\"0.24.0\",\"@zeit/source-map-support\":\"0.6.2\",\"ajv\":\"6.12.2\",\"alpha-sort\":\"2.0.1\",\"ansi-escapes\":\"3.0.0\",\"ansi-regex\":\"3.0.0\",\"arg\":\"5.0.0\",\"async-listen\":\"1.2.0\",\"async-retry\":\"1.1.3\",\"async-sema\":\"2.1.4\",\"ava\":\"2.2.0\",\"boxen\":\"4.2.0\",\"bytes\":\"3.0.0\",\"chalk\":\"4.1.0\",\"chance\":\"1.1.7\",\"chokidar\":\"3.3.1\",\"codecov\":\"3.8.2\",\"cpy\":\"7.2.0\",\"date-fns\":\"1.29.0\",\"debug\":\"3.1.0\",\"dot\":\"1.1.3\",\"dotenv\":\"4.0.0\",\"email-prompt\":\"0.3.2\",\"email-validator\":\"1.1.1\",\"epipebomb\":\"1.0.0\",\"escape-html\":\"1.0.3\",\"esm\":\"3.1.4\",\"execa\":\"3.2.0\",\"express\":\"4.17.1\",\"fast-deep-equal\":\"3.1.3\",\"fs-extra\":\"10.0.0\",\"get-port\":\"5.1.1\",\"git-last-commit\":\"1.0.1\",\"glob\":\"7.1.2\",\"http-proxy\":\"1.18.1\",\"ini\":\"3.0.0\",\"inquirer\":\"7.0.4\",\"is-docker\":\"2.2.1\",\"is-port-reachable\":\"3.1.0\",\"is-url\":\"1.2.2\",\"jaro-winkler\":\"0.2.8\",\"jsonlines\":\"0.1.1\",\"load-json-file\":\"3.0.0\",\"mime-types\":\"2.1.24\",\"minimatch\":\"3.0.4\",\"mri\":\"1.1.5\",\"ms\":\"2.1.2\",\"node-fetch\":\"2.6.7\",\"npm-package-arg\":\"6.1.0\",\"open\":\"8.4.0\",\"ora\":\"3.4.0\",\"pcre-to-regexp\":\"1.0.0\",\"pluralize\":\"7.0.0\",\"promisepipe\":\"3.0.0\",\"psl\":\"1.1.31\",\"qr-image\":\"3.2.0\",\"raw-body\":\"2.4.1\",\"rimraf\":\"3.0.2\",\"semver\":\"5.5.0\",\"serve-handler\":\"6.1.1\",\"strip-ansi\":\"5.2.0\",\"stripe\":\"5.1.0\",\"tar-fs\":\"1.16.3\",\"test-listen\":\"1.1.0\",\"text-table\":\"0.2.0\",\"title\":\"3.4.1\",\"tmp-promise\":\"1.0.3\",\"tree-kill\":\"1.2.2\",\"ts-node\":\"10.9.1\",\"typescript\":\"4.7.4\",\"universal-analytics\":\"0.4.20\",\"utility-types\":\"2.1.0\",\"write-json-file\":\"2.2.0\",\"xdg-app-paths\":\"5.1.0\",\"yauzl-promise\":\"2.1.3\"},\"jest\":{\"preset\":\"ts-jest\",\"globals\":{\"ts-jest\":{\"diagnostics\":false,\"isolatedModules\":true}},\"setupFilesAfterEnv\":[\"@alex_neo/jest-expect-message\"],\"verbose\":false,\"testEnvironment\":\"node\",\"testMatch\":[\"<rootDir>/test/**/*.test.ts\"]}}");
254356
254536
 
254357
254537
  /***/ }),
254358
254538
 
@@ -254444,6 +254624,14 @@ module.exports = require("fs");
254444
254624
 
254445
254625
  /***/ }),
254446
254626
 
254627
+ /***/ 69225:
254628
+ /***/ ((module) => {
254629
+
254630
+ "use strict";
254631
+ module.exports = require("fs/promises");
254632
+
254633
+ /***/ }),
254634
+
254447
254635
  /***/ 98605:
254448
254636
  /***/ ((module) => {
254449
254637
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "28.4.17",
3
+ "version": "28.5.0",
4
4
  "preferGlobal": true,
5
5
  "license": "Apache-2.0",
6
6
  "description": "The command-line interface for Vercel",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "scripts": {
14
14
  "preinstall": "node ./scripts/preinstall.js",
15
- "test": "jest --env node --verbose --runInBand --bail --forceExit",
15
+ "test": "jest --env node --verbose --bail --forceExit",
16
16
  "test-unit": "yarn test test/unit/",
17
17
  "test-integration-cli": "rimraf test/fixtures/integration && ava test/integration.js --serial --fail-fast --verbose",
18
18
  "test-integration-dev": "yarn test test/dev/",
@@ -46,7 +46,7 @@
46
46
  "@vercel/hydrogen": "0.0.29",
47
47
  "@vercel/next": "3.2.11",
48
48
  "@vercel/node": "2.6.2",
49
- "@vercel/python": "3.1.24",
49
+ "@vercel/python": "3.1.25",
50
50
  "@vercel/redwood": "1.0.35",
51
51
  "@vercel/remix": "1.0.35",
52
52
  "@vercel/ruby": "1.3.41",
@@ -98,7 +98,7 @@
98
98
  "@vercel/client": "12.2.17",
99
99
  "@vercel/error-utils": "1.0.3",
100
100
  "@vercel/frameworks": "1.1.12",
101
- "@vercel/fs-detectors": "3.4.9",
101
+ "@vercel/fs-detectors": "3.5.0",
102
102
  "@vercel/fun": "1.0.4",
103
103
  "@vercel/ncc": "0.24.0",
104
104
  "@zeit/source-map-support": "0.6.2",
@@ -172,7 +172,6 @@
172
172
  "typescript": "4.7.4",
173
173
  "universal-analytics": "0.4.20",
174
174
  "utility-types": "2.1.0",
175
- "which": "2.0.2",
176
175
  "write-json-file": "2.2.0",
177
176
  "xdg-app-paths": "5.1.0",
178
177
  "yauzl-promise": "2.1.3"
@@ -194,5 +193,5 @@
194
193
  "<rootDir>/test/**/*.test.ts"
195
194
  ]
196
195
  },
197
- "gitHead": "1b211f28dfdcb112f1aecb53a2b9f257ecc58420"
196
+ "gitHead": "8d2c0fec89b34c98e0a6123516d54407fc1cb738"
198
197
  }