@vercel/static-build 1.3.24 → 1.3.26

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.
package/dist/index.js CHANGED
@@ -237283,7 +237283,11 @@ exports.isSpawnError = isSpawnError;
237283
237283
 
237284
237284
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
237285
237285
  if (k2 === undefined) k2 = k;
237286
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
237286
+ var desc = Object.getOwnPropertyDescriptor(m, k);
237287
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
237288
+ desc = { enumerable: true, get: function() { return m[k]; } };
237289
+ }
237290
+ Object.defineProperty(o, k2, desc);
237287
237291
  }) : (function(o, m, k, k2) {
237288
237292
  if (k2 === undefined) k2 = k;
237289
237293
  o[k2] = m[k];
@@ -237428,7 +237432,7 @@ exports.frameworks = [
237428
237432
  defaultRoutes: async (dirPrefix) => {
237429
237433
  // This file could be generated by gatsby-plugin-now or gatsby-plugin-zeit-now
237430
237434
  try {
237431
- const nowRoutesPath = path_1.join(dirPrefix, 'public', '__now_routes_g4t5bY.json');
237435
+ const nowRoutesPath = (0, path_1.join)(dirPrefix, 'public', '__now_routes_g4t5bY.json');
237432
237436
  const content = await readFile(nowRoutesPath, 'utf8');
237433
237437
  const nowRoutes = JSON.parse(content);
237434
237438
  try {
@@ -237663,11 +237667,11 @@ exports.frameworks = [
237663
237667
  getOutputDirName: async (dirPrefix) => {
237664
237668
  const base = 'build';
237665
237669
  try {
237666
- const location = path_1.join(dirPrefix, base);
237670
+ const location = (0, path_1.join)(dirPrefix, base);
237667
237671
  const content = await readdir(location, { withFileTypes: true });
237668
237672
  // If there is only one file in it that is a dir we'll use it as dist dir
237669
237673
  if (content.length === 1 && content[0].isDirectory()) {
237670
- return path_1.join(base, content[0].name);
237674
+ return (0, path_1.join)(base, content[0].name);
237671
237675
  }
237672
237676
  }
237673
237677
  catch (error) {
@@ -237746,11 +237750,11 @@ exports.frameworks = [
237746
237750
  getOutputDirName: async (dirPrefix) => {
237747
237751
  const base = 'build';
237748
237752
  try {
237749
- const location = path_1.join(dirPrefix, base);
237753
+ const location = (0, path_1.join)(dirPrefix, base);
237750
237754
  const content = await readdir(location, { withFileTypes: true });
237751
237755
  // If there is only one file in it that is a dir we'll use it as dist dir
237752
237756
  if (content.length === 1 && content[0].isDirectory()) {
237753
- return path_1.join(base, content[0].name);
237757
+ return (0, path_1.join)(base, content[0].name);
237754
237758
  }
237755
237759
  }
237756
237760
  catch (error) {
@@ -237875,7 +237879,7 @@ exports.frameworks = [
237875
237879
  },
237876
237880
  },
237877
237881
  dependency: '@dojo/cli',
237878
- getOutputDirName: async () => path_1.join('output', 'dist'),
237882
+ getOutputDirName: async () => (0, path_1.join)('output', 'dist'),
237879
237883
  defaultRoutes: [
237880
237884
  {
237881
237885
  handle: 'filesystem',
@@ -238110,11 +238114,11 @@ exports.frameworks = [
238110
238114
  getOutputDirName: async (dirPrefix) => {
238111
238115
  const base = 'dist';
238112
238116
  try {
238113
- const location = path_1.join(dirPrefix, base);
238117
+ const location = (0, path_1.join)(dirPrefix, base);
238114
238118
  const content = await readdir(location, { withFileTypes: true });
238115
238119
  // If there is only one file in it that is a dir we'll use it as dist dir
238116
238120
  if (content.length === 1 && content[0].isDirectory()) {
238117
- return path_1.join(base, content[0].name);
238121
+ return (0, path_1.join)(base, content[0].name);
238118
238122
  }
238119
238123
  }
238120
238124
  catch (error) {
@@ -238167,10 +238171,10 @@ exports.frameworks = [
238167
238171
  getOutputDirName: async (dirPrefix) => {
238168
238172
  const base = 'build';
238169
238173
  try {
238170
- const location = path_1.join(dirPrefix, base);
238174
+ const location = (0, path_1.join)(dirPrefix, base);
238171
238175
  const content = await readdir(location);
238172
238176
  const paths = content.filter(item => !item.includes('.'));
238173
- return path_1.join(base, paths[0]);
238177
+ return (0, path_1.join)(base, paths[0]);
238174
238178
  }
238175
238179
  catch (error) {
238176
238180
  console.error(`Error detecting output directory: `, error);
@@ -238782,8 +238786,8 @@ exports.frameworks = [
238782
238786
  },
238783
238787
  },
238784
238788
  getOutputDirName: async (dirPrefix) => {
238785
- const config = await read_config_file_1.readConfigFile(['config.json', 'config.yaml', 'config.toml'].map(fileName => {
238786
- return path_1.join(dirPrefix, fileName);
238789
+ const config = await (0, read_config_file_1.readConfigFile)(['config.json', 'config.yaml', 'config.toml'].map(fileName => {
238790
+ return (0, path_1.join)(dirPrefix, fileName);
238787
238791
  }));
238788
238792
  return (config && config.publishDir) || 'public';
238789
238793
  },
@@ -238821,7 +238825,7 @@ exports.frameworks = [
238821
238825
  },
238822
238826
  },
238823
238827
  getOutputDirName: async (dirPrefix) => {
238824
- const config = await read_config_file_1.readConfigFile(path_1.join(dirPrefix, '_config.yml'));
238828
+ const config = await (0, read_config_file_1.readConfigFile)((0, path_1.join)(dirPrefix, '_config.yml'));
238825
238829
  return (config && config.destination) || '_site';
238826
238830
  },
238827
238831
  cachePattern: '{vendor/bin,vendor/cache,vendor/bundle}/**',
@@ -239213,15 +239217,19 @@ exports.readConfigFile = void 0;
239213
239217
  const js_yaml_1 = __importDefault(__webpack_require__(1452));
239214
239218
  const toml_1 = __importDefault(__webpack_require__(207));
239215
239219
  const fs_1 = __webpack_require__(5747);
239220
+ const error_utils_1 = __webpack_require__(9799);
239216
239221
  const { readFile } = fs_1.promises;
239217
239222
  async function readFileOrNull(file) {
239218
239223
  try {
239219
239224
  const data = await readFile(file);
239220
239225
  return data;
239221
239226
  }
239222
- catch (err) {
239223
- if (err.code !== 'ENOENT') {
239224
- throw err;
239227
+ catch (error) {
239228
+ if (!(0, error_utils_1.isErrnoException)(error)) {
239229
+ throw error;
239230
+ }
239231
+ if (error.code !== 'ENOENT') {
239232
+ throw error;
239225
239233
  }
239226
239234
  }
239227
239235
  return null;
@@ -239285,7 +239293,7 @@ exports.sortFiles = sortFiles;
239285
239293
  function detectApiExtensions(builders) {
239286
239294
  return new Set(builders
239287
239295
  .filter((b) => Boolean(b.config && b.config.zeroConfig && b.src?.startsWith('api/')))
239288
- .map(b => path_1.extname(b.src))
239296
+ .map(b => (0, path_1.extname)(b.src))
239289
239297
  .filter(Boolean));
239290
239298
  }
239291
239299
  exports.detectApiExtensions = detectApiExtensions;
@@ -239300,7 +239308,7 @@ exports.detectApiDirectory = detectApiDirectory;
239300
239308
  function getPublicBuilder(builders) {
239301
239309
  for (const builder of builders) {
239302
239310
  if (typeof builder.src === 'string' &&
239303
- is_official_runtime_1.isOfficialRuntime('static', builder.use) &&
239311
+ (0, is_official_runtime_1.isOfficialRuntime)('static', builder.use) &&
239304
239312
  /^.*\/\*\*\/\*$/.test(builder.src) &&
239305
239313
  builder.config?.zeroConfig === true) {
239306
239314
  return builder;
@@ -239490,7 +239498,7 @@ async function detectBuilders(files, pkg, options = {}) {
239490
239498
  if (frontendBuilder) {
239491
239499
  builders.push(frontendBuilder);
239492
239500
  if (hasNextApiFiles &&
239493
- apiBuilders.some(b => is_official_runtime_1.isOfficialRuntime('node', b.use))) {
239501
+ apiBuilders.some(b => (0, is_official_runtime_1.isOfficialRuntime)('node', b.use))) {
239494
239502
  warnings.push({
239495
239503
  code: 'conflicting_files',
239496
239504
  message: 'When using Next.js, it is recommended to place Node.js Serverless Functions inside of the `pages/api` (provided by Next.js) directory instead of `api` (provided by Vercel).',
@@ -239534,7 +239542,7 @@ function maybeGetApiBuilder(fileName, apiMatches, options) {
239534
239542
  return null;
239535
239543
  }
239536
239544
  const match = apiMatches.find(({ src = '**' }) => {
239537
- return src === fileName || minimatch_1.default(fileName, src);
239545
+ return src === fileName || (0, minimatch_1.default)(fileName, src);
239538
239546
  });
239539
239547
  const { fnPattern, func } = getFunction(fileName, options);
239540
239548
  const use = func?.runtime || match?.use;
@@ -239566,7 +239574,7 @@ function getFunction(fileName, { functions = {} }) {
239566
239574
  if (!keys.length) {
239567
239575
  return { fnPattern: null, func: null };
239568
239576
  }
239569
- const func = keys.find(key => key === fileName || minimatch_1.default(fileName, key));
239577
+ const func = keys.find(key => key === fileName || (0, minimatch_1.default)(fileName, key));
239570
239578
  return func
239571
239579
  ? { fnPattern: func, func: functions[func] }
239572
239580
  : { fnPattern: null, func: null };
@@ -239706,7 +239714,7 @@ function validateFunctions({ functions = {} }) {
239706
239714
  }
239707
239715
  if (func.runtime !== undefined) {
239708
239716
  const tag = `${func.runtime}`.split('@').pop();
239709
- if (!tag || !semver_1.valid(tag)) {
239717
+ if (!tag || !(0, semver_1.valid)(tag)) {
239710
239718
  return {
239711
239719
  code: 'invalid_function_runtime',
239712
239720
  message: 'Function Runtimes must have a valid version, for example `now-php@1.0.0`.',
@@ -239738,7 +239746,7 @@ function checkUnusedFunctions(frontendBuilder, usedFunctions, options) {
239738
239746
  return null;
239739
239747
  }
239740
239748
  // Next.js can use functions only for `src/pages` or `pages`
239741
- if (frontendBuilder && is_official_runtime_1.isOfficialRuntime('next', frontendBuilder.use)) {
239749
+ if (frontendBuilder && (0, is_official_runtime_1.isOfficialRuntime)('next', frontendBuilder.use)) {
239742
239750
  for (const fnKey of unusedFunctions.values()) {
239743
239751
  if (fnKey.startsWith('pages/') || fnKey.startsWith('src/pages')) {
239744
239752
  unusedFunctions.delete(fnKey);
@@ -239819,14 +239827,14 @@ function getConflictingSegment(filePath) {
239819
239827
  // It will return `null` if there are no brackets
239820
239828
  // and therefore no segment.
239821
239829
  function getSegmentName(segment) {
239822
- const { name } = path_1.parse(segment);
239830
+ const { name } = (0, path_1.parse)(segment);
239823
239831
  if (name.startsWith('[') && name.endsWith(']')) {
239824
239832
  return name.slice(1, -1);
239825
239833
  }
239826
239834
  return null;
239827
239835
  }
239828
239836
  function getAbsolutePath(unresolvedPath) {
239829
- const { dir, name } = path_1.parse(unresolvedPath);
239837
+ const { dir, name } = (0, path_1.parse)(unresolvedPath);
239830
239838
  const parts = joinPath(dir, name).split('/');
239831
239839
  return parts.map(part => part.replace(/\[.*\]/, '1')).join('/');
239832
239840
  }
@@ -239916,7 +239924,7 @@ function createRouteFromPath(filePath, featHandleMiss, cleanUrls) {
239916
239924
  return `([^/]+)`;
239917
239925
  }
239918
239926
  else if (isLast) {
239919
- const { name: fileName, ext } = path_1.parse(segment);
239927
+ const { name: fileName, ext } = (0, path_1.parse)(segment);
239920
239928
  const isIndex = fileName === 'index';
239921
239929
  const prefix = isIndex ? '/' : '';
239922
239930
  const names = [
@@ -239933,7 +239941,7 @@ function createRouteFromPath(filePath, featHandleMiss, cleanUrls) {
239933
239941
  }
239934
239942
  return segment;
239935
239943
  });
239936
- const { name: fileName, ext } = path_1.parse(filePath);
239944
+ const { name: fileName, ext } = (0, path_1.parse)(filePath);
239937
239945
  const isIndex = fileName === 'index';
239938
239946
  const queryString = `${query.length ? '?' : ''}${query.join('&')}`;
239939
239947
  const src = isIndex
@@ -239962,7 +239970,7 @@ function getRouteResult(apiRoutes, dynamicRoutes, outputDirectory, apiBuilders,
239962
239970
  const rewriteRoutes = [];
239963
239971
  const errorRoutes = [];
239964
239972
  const framework = frontendBuilder?.config?.framework || '';
239965
- const isNextjs = framework === 'nextjs' || is_official_runtime_1.isOfficialRuntime('next', frontendBuilder?.use);
239973
+ const isNextjs = framework === 'nextjs' || (0, is_official_runtime_1.isOfficialRuntime)('next', frontendBuilder?.use);
239966
239974
  const ignoreRuntimes = slugToFramework.get(framework)?.ignoreRuntimes;
239967
239975
  if (apiRoutes && apiRoutes.length > 0) {
239968
239976
  if (options.featHandleMiss) {
@@ -240026,7 +240034,7 @@ function getRouteResult(apiRoutes, dynamicRoutes, outputDirectory, apiBuilders,
240026
240034
  if (outputDirectory &&
240027
240035
  frontendBuilder &&
240028
240036
  !options.featHandleMiss &&
240029
- is_official_runtime_1.isOfficialRuntime('static', frontendBuilder.use)) {
240037
+ (0, is_official_runtime_1.isOfficialRuntime)('static', frontendBuilder.use)) {
240030
240038
  defaultRoutes.push({
240031
240039
  src: '/(.*)',
240032
240040
  dest: `/${outputDirectory}/$1`,
@@ -240142,13 +240150,13 @@ async function detectFileSystemAPI({ files, projectSettings, builders, vercelCon
240142
240150
  };
240143
240151
  }
240144
240152
  const invalidBuilder = builders.find(({ use }) => {
240145
- const valid = _1.isOfficialRuntime('go', use) ||
240146
- _1.isOfficialRuntime('python', use) ||
240147
- _1.isOfficialRuntime('ruby', use) ||
240148
- _1.isOfficialRuntime('node', use) ||
240149
- _1.isOfficialRuntime('next', use) ||
240150
- _1.isOfficialRuntime('static', use) ||
240151
- _1.isOfficialRuntime('static-build', use);
240153
+ const valid = (0, _1.isOfficialRuntime)('go', use) ||
240154
+ (0, _1.isOfficialRuntime)('python', use) ||
240155
+ (0, _1.isOfficialRuntime)('ruby', use) ||
240156
+ (0, _1.isOfficialRuntime)('node', use) ||
240157
+ (0, _1.isOfficialRuntime)('next', use) ||
240158
+ (0, _1.isOfficialRuntime)('static', use) ||
240159
+ (0, _1.isOfficialRuntime)('static-build', use);
240152
240160
  return !valid;
240153
240161
  });
240154
240162
  if (invalidBuilder) {
@@ -240161,7 +240169,7 @@ async function detectFileSystemAPI({ files, projectSettings, builders, vercelCon
240161
240169
  for (const lang of ['go', 'python', 'ruby']) {
240162
240170
  for (const { use } of builders) {
240163
240171
  const plugin = 'vercel-plugin-' + lang;
240164
- if (_1.isOfficialRuntime(lang, use) && !deps[plugin]) {
240172
+ if ((0, _1.isOfficialRuntime)(lang, use) && !deps[plugin]) {
240165
240173
  return {
240166
240174
  metadata,
240167
240175
  fsApiBuilder: null,
@@ -240227,9 +240235,9 @@ async function detectFileSystemAPI({ files, projectSettings, builders, vercelCon
240227
240235
  }
240228
240236
  }
240229
240237
  }
240230
- const frontendBuilder = builders.find(({ use }) => _1.isOfficialRuntime('next', use) ||
240231
- _1.isOfficialRuntime('static', use) ||
240232
- _1.isOfficialRuntime('static-build', use));
240238
+ const frontendBuilder = builders.find(({ use }) => (0, _1.isOfficialRuntime)('next', use) ||
240239
+ (0, _1.isOfficialRuntime)('static', use) ||
240240
+ (0, _1.isOfficialRuntime)('static-build', use));
240233
240241
  const config = frontendBuilder?.config || {};
240234
240242
  const withTag = tag ? `@${tag}` : '';
240235
240243
  const fsApiBuilder = {
@@ -240378,7 +240386,7 @@ exports.detectFrameworkVersion = detectFrameworkVersion;
240378
240386
  function lookupInstalledVersion(cwd, packageName) {
240379
240387
  try {
240380
240388
  const script = `require('${packageName}/package.json').version`;
240381
- return child_process_1.spawnSync(cwd, ['-p', script], {
240389
+ return (0, child_process_1.spawnSync)(cwd, ['-p', script], {
240382
240390
  encoding: 'utf-8',
240383
240391
  }).stdout.trim();
240384
240392
  }
@@ -240535,7 +240543,7 @@ class LocalFileSystemDetector extends filesystem_1.DetectorFilesystem {
240535
240543
  return true;
240536
240544
  }
240537
240545
  catch (err) {
240538
- if (error_utils_1.isErrnoException(err) && err.code === 'ENOENT') {
240546
+ if ((0, error_utils_1.isErrnoException)(err) && err.code === 'ENOENT') {
240539
240547
  return false;
240540
240548
  }
240541
240549
  throw err;
@@ -240603,7 +240611,7 @@ const getProjectPaths = async ({ fs, path, skipPaths, depth = MAX_DEPTH_TRAVERSE
240603
240611
  if (path && skipPaths?.includes(path)) {
240604
240612
  return allPaths;
240605
240613
  }
240606
- const framework = await detect_framework_1.detectFramework({
240614
+ const framework = await (0, detect_framework_1.detectFramework)({
240607
240615
  fs: fs.chdir(topPath),
240608
240616
  frameworkList: frameworks_1.default,
240609
240617
  });
@@ -240613,7 +240621,7 @@ const getProjectPaths = async ({ fs, path, skipPaths, depth = MAX_DEPTH_TRAVERSE
240613
240621
  const directoryContents = await fs.readdir(topPath);
240614
240622
  const childDirectories = directoryContents.filter(stat => stat.type === 'dir' && !skipPaths?.includes(stat.path));
240615
240623
  const paths = (await Promise.all(childDirectories.map(({ path }) => {
240616
- return exports.getProjectPaths({
240624
+ return (0, exports.getProjectPaths)({
240617
240625
  fs,
240618
240626
  path,
240619
240627
  depth: depth - 1,
@@ -240636,7 +240644,11 @@ exports.getProjectPaths = getProjectPaths;
240636
240644
 
240637
240645
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
240638
240646
  if (k2 === undefined) k2 = k;
240639
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
240647
+ var desc = Object.getOwnPropertyDescriptor(m, k);
240648
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
240649
+ desc = { enumerable: true, get: function() { return m[k]; } };
240650
+ }
240651
+ Object.defineProperty(o, k2, desc);
240640
240652
  }) : (function(o, m, k, k2) {
240641
240653
  if (k2 === undefined) k2 = k;
240642
240654
  o[k2] = m[k];
@@ -240705,7 +240717,7 @@ exports.isOfficialRuntime = isOfficialRuntime;
240705
240717
  * Helper function to detect both `@vercel/static` and legacy `@now/static` official Runtimes.
240706
240718
  */
240707
240719
  const isStaticRuntime = (name) => {
240708
- return exports.isOfficialRuntime('static', name);
240720
+ return (0, exports.isOfficialRuntime)('static', name);
240709
240721
  };
240710
240722
  exports.isStaticRuntime = isStaticRuntime;
240711
240723
  //# sourceMappingURL=is-official-runtime.js.map
@@ -240751,11 +240763,11 @@ function supportsRootCommand(turboSemVer) {
240751
240763
  }
240752
240764
  async function getMonorepoDefaultSettings(projectName, projectPath, relativeToRoot, detectorFilesystem) {
240753
240765
  const [monorepoManager, packageManager] = await Promise.all([
240754
- detect_framework_1.detectFramework({
240766
+ (0, detect_framework_1.detectFramework)({
240755
240767
  fs: detectorFilesystem,
240756
240768
  frameworkList: monorepo_managers_1.monorepoManagers,
240757
240769
  }),
240758
- detect_framework_1.detectFramework({
240770
+ (0, detect_framework_1.detectFramework)({
240759
240771
  fs: detectorFilesystem,
240760
240772
  frameworkList: package_managers_1.packageManagers,
240761
240773
  }),
@@ -240822,10 +240834,10 @@ async function getMonorepoDefaultSettings(projectName, projectPath, relativeToRo
240822
240834
  if (!nxJSON?.targetDefaults?.build) {
240823
240835
  const [projectJSONBuf, packageJSONBuf] = await Promise.all([
240824
240836
  detectorFilesystem
240825
- .readFile(path_1.join(projectPath, 'project.json'))
240837
+ .readFile((0, path_1.join)(projectPath, 'project.json'))
240826
240838
  .catch(() => null),
240827
240839
  detectorFilesystem
240828
- .readFile(path_1.join(projectPath, 'package.json'))
240840
+ .readFile((0, path_1.join)(projectPath, 'package.json'))
240829
240841
  .catch(() => null),
240830
240842
  ]);
240831
240843
  let hasBuildTarget = false;
@@ -241189,9 +241201,9 @@ const isWin = process.platform === 'win32';
241189
241201
  const normalizePath = (p) => (isWin ? p.replace(/\\/g, '/') : p);
241190
241202
  async function getPackagePaths(packages, fs) {
241191
241203
  return (await Promise.all(packages.map(packageGlob => new Promise((resolve, reject) => {
241192
- glob_1.default(normalizePath(posixPath.join(packageGlob, 'package.json')), {
241204
+ (0, glob_1.default)(normalizePath(posixPath.join(packageGlob, 'package.json')), {
241193
241205
  cwd: '/',
241194
- fs: get_glob_fs_1.getGlobFs(fs),
241206
+ fs: (0, get_glob_fs_1.getGlobFs)(fs),
241195
241207
  }, (err, matches) => {
241196
241208
  if (err)
241197
241209
  reject(err);
@@ -241258,7 +241270,7 @@ const posixPath = path_1.default.posix;
241258
241270
  async function getWorkspaces({ fs, depth = MAX_DEPTH_TRAVERSE, cwd = '/', }) {
241259
241271
  if (depth === 0)
241260
241272
  return [];
241261
- const workspaceType = await detect_framework_1.detectFramework({
241273
+ const workspaceType = await (0, detect_framework_1.detectFramework)({
241262
241274
  fs,
241263
241275
  frameworkList: workspace_managers_1.workspaceManagers,
241264
241276
  });
@@ -241421,7 +241433,7 @@ function getConfig(project, sourcePath, schema) {
241421
241433
  return null;
241422
241434
  const config = getValue(configNode);
241423
241435
  // @ts-ignore
241424
- return validation_1.validate(schema || exports.BaseFunctionConfigSchema, config);
241436
+ return (0, validation_1.validate)(schema || exports.BaseFunctionConfigSchema, config);
241425
241437
  }
241426
241438
  exports.getConfig = getConfig;
241427
241439
  function getConfigNode(sourceFile) {
@@ -241514,6 +241526,7 @@ function validate(schema, data) {
241514
241526
  // TODO: better error message
241515
241527
  throw new Error('Invalid data');
241516
241528
  }
241529
+ // @ts-expect-error - this seems to work just fine, but TS complains it could be infinite nesting
241517
241530
  return data;
241518
241531
  }
241519
241532
  exports.validate = validate;
@@ -241528,7 +241541,11 @@ exports.validate = validate;
241528
241541
 
241529
241542
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
241530
241543
  if (k2 === undefined) k2 = k;
241531
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
241544
+ var desc = Object.getOwnPropertyDescriptor(m, k);
241545
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
241546
+ desc = { enumerable: true, get: function() { return m[k]; } };
241547
+ }
241548
+ Object.defineProperty(o, k2, desc);
241532
241549
  }) : (function(o, m, k, k2) {
241533
241550
  if (k2 === undefined) k2 = k;
241534
241551
  o[k2] = m[k];
@@ -241567,21 +241584,21 @@ const NuxtUtils = __importStar(__webpack_require__(3360));
241567
241584
  const tree_kill_1 = __importDefault(__webpack_require__(8384));
241568
241585
  const fs_detectors_1 = __webpack_require__(8995);
241569
241586
  const sleep = (n) => new Promise(resolve => setTimeout(resolve, n));
241570
- const DEV_SERVER_PORT_BIND_TIMEOUT = ms_1.default('5m');
241587
+ const DEV_SERVER_PORT_BIND_TIMEOUT = (0, ms_1.default)('5m');
241571
241588
  async function checkForPort(port, timeout) {
241572
241589
  const start = Date.now();
241573
- while (!(await is_port_reachable_1.default(port))) {
241590
+ while (!(await (0, is_port_reachable_1.default)(port))) {
241574
241591
  if (Date.now() - start > timeout) {
241575
- throw new Error(`Detecting port ${port} timed out after ${ms_1.default(timeout)}`);
241592
+ throw new Error(`Detecting port ${port} timed out after ${(0, ms_1.default)(timeout)}`);
241576
241593
  }
241577
241594
  await sleep(100);
241578
241595
  }
241579
241596
  }
241580
241597
  function validateDistDir(distDir) {
241581
241598
  const distDirName = path_1.default.basename(distDir);
241582
- const exists = () => fs_1.existsSync(distDir);
241583
- const isDirectory = () => fs_1.statSync(distDir).isDirectory();
241584
- const isEmpty = () => fs_1.readdirSync(distDir).length === 0;
241599
+ const exists = () => (0, fs_1.existsSync)(distDir);
241600
+ const isDirectory = () => (0, fs_1.statSync)(distDir).isDirectory();
241601
+ const isEmpty = () => (0, fs_1.readdirSync)(distDir).length === 0;
241585
241602
  const link = 'https://vercel.link/missing-public-directory';
241586
241603
  if (!exists()) {
241587
241604
  throw new build_utils_1.NowBuildError({
@@ -241660,8 +241677,8 @@ const nowDevChildProcesses = new Set();
241660
241677
  ['SIGINT', 'SIGTERM'].forEach(signal => {
241661
241678
  process.once(signal, async () => {
241662
241679
  for (const child of nowDevChildProcesses) {
241663
- build_utils_1.debug(`Got ${signal}, killing dev server child process (pid=${child.pid})`);
241664
- await new Promise(resolve => tree_kill_1.default(child.pid, signal, resolve));
241680
+ (0, build_utils_1.debug)(`Got ${signal}, killing dev server child process (pid=${child.pid})`);
241681
+ await new Promise(resolve => (0, tree_kill_1.default)(child.pid, signal, resolve));
241665
241682
  }
241666
241683
  process.exit(0);
241667
241684
  });
@@ -241695,7 +241712,7 @@ function getPkg(entrypoint, workPath) {
241695
241712
  }
241696
241713
  try {
241697
241714
  const pkgPath = path_1.default.join(workPath, entrypoint);
241698
- const pkg = JSON.parse(fs_1.readFileSync(pkgPath, 'utf8'));
241715
+ const pkg = JSON.parse((0, fs_1.readFileSync)(pkgPath, 'utf8'));
241699
241716
  return pkg;
241700
241717
  }
241701
241718
  catch (err) {
@@ -241723,7 +241740,7 @@ function getFramework(config, pkg) {
241723
241740
  return framework;
241724
241741
  }
241725
241742
  async function fetchBinary(url, framework, version) {
241726
- const res = await node_fetch_1.default(url);
241743
+ const res = await (0, node_fetch_1.default)(url);
241727
241744
  if (res.status === 404) {
241728
241745
  throw new build_utils_1.NowBuildError({
241729
241746
  code: 'STATIC_BUILD_BINARY_NOT_FOUND',
@@ -241731,7 +241748,7 @@ async function fetchBinary(url, framework, version) {
241731
241748
  link: 'https://vercel.link/framework-versioning',
241732
241749
  });
241733
241750
  }
241734
- await build_utils_1.spawnAsync(`curl -sSL ${url} | tar -zx -C /usr/local/bin`, [], {
241751
+ await (0, build_utils_1.spawnAsync)(`curl -sSL ${url} | tar -zx -C /usr/local/bin`, [], {
241735
241752
  shell: true,
241736
241753
  });
241737
241754
  }
@@ -241745,16 +241762,16 @@ async function getUpdatedDistPath(framework, outputDirPrefix, entrypointDir, dis
241745
241762
  if (!config || !config.distDir) {
241746
241763
  // Select either `dist` or `public` as directory
241747
241764
  const publicPath = path_1.default.join(entrypointDir, 'public');
241748
- if (!fs_1.existsSync(distPath) &&
241749
- fs_1.existsSync(publicPath) &&
241750
- fs_1.statSync(publicPath).isDirectory()) {
241765
+ if (!(0, fs_1.existsSync)(distPath) &&
241766
+ (0, fs_1.existsSync)(publicPath) &&
241767
+ (0, fs_1.statSync)(publicPath).isDirectory()) {
241751
241768
  return publicPath;
241752
241769
  }
241753
241770
  }
241754
241771
  return undefined;
241755
241772
  }
241756
241773
  const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
241757
- await build_utils_1.download(files, workPath, meta);
241774
+ await (0, build_utils_1.download)(files, workPath, meta);
241758
241775
  const mountpoint = path_1.default.dirname(entrypoint);
241759
241776
  const entrypointDir = path_1.default.join(workPath, mountpoint);
241760
241777
  let distPath = path_1.default.join(workPath, path_1.default.dirname(entrypoint), config.distDir || config.outputDirectory || 'dist');
@@ -241762,7 +241779,7 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
241762
241779
  const devScript = pkg ? getScriptName(pkg, 'dev', config) : null;
241763
241780
  const framework = getFramework(config, pkg);
241764
241781
  const localFileSystemDetector = new fs_detectors_1.LocalFileSystemDetector(workPath);
241765
- const { detectedVersion = null } = (await fs_detectors_1.detectFrameworkRecord({
241782
+ const { detectedVersion = null } = (await (0, fs_detectors_1.detectFrameworkRecord)({
241766
241783
  fs: localFileSystemDetector,
241767
241784
  frameworkList: frameworks_1.default,
241768
241785
  })) ?? {};
@@ -241802,8 +241819,8 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
241802
241819
  distPath = path_1.default.join(workPath, path_1.default.dirname(entrypoint), config.outputDirectory || 'public');
241803
241820
  }
241804
241821
  if (framework) {
241805
- build_utils_1.debug(`Detected ${framework.name} framework. Optimizing your deployment...`);
241806
- const prefixedEnvs = build_utils_1.getPrefixedEnvVars({
241822
+ (0, build_utils_1.debug)(`Detected ${framework.name} framework. Optimizing your deployment...`);
241823
+ const prefixedEnvs = (0, build_utils_1.getPrefixedEnvVars)({
241807
241824
  envPrefix: framework.envPrefix,
241808
241825
  envs: process.env,
241809
241826
  });
@@ -241820,13 +241837,13 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
241820
241837
  await NuxtUtils.injectVercelAnalyticsPlugin(frameworkDirectory);
241821
241838
  break;
241822
241839
  default:
241823
- build_utils_1.debug(`No analytics plugin injected for framework ${framework.slug}`);
241840
+ (0, build_utils_1.debug)(`No Web Vitals plugin injected for framework ${framework.slug}`);
241824
241841
  break;
241825
241842
  }
241826
241843
  }
241827
241844
  }
241828
- const nodeVersion = await build_utils_1.getNodeVersion(entrypointDir, undefined, config, meta);
241829
- const spawnOpts = build_utils_1.getSpawnOptions(meta, nodeVersion);
241845
+ const nodeVersion = await (0, build_utils_1.getNodeVersion)(entrypointDir, undefined, config, meta);
241846
+ const spawnOpts = (0, build_utils_1.getSpawnOptions)(meta, nodeVersion);
241830
241847
  if (!spawnOpts.env) {
241831
241848
  spawnOpts.env = {};
241832
241849
  }
@@ -241842,15 +241859,15 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
241842
241859
  if (framework?.slug === 'create-react-app') {
241843
241860
  spawnOpts.env.CI = 'false';
241844
241861
  }
241845
- const { cliType, lockfileVersion } = await build_utils_1.scanParentDirs(entrypointDir);
241846
- spawnOpts.env = build_utils_1.getEnvForPackageManager({
241862
+ const { cliType, lockfileVersion } = await (0, build_utils_1.scanParentDirs)(entrypointDir);
241863
+ spawnOpts.env = (0, build_utils_1.getEnvForPackageManager)({
241847
241864
  cliType,
241848
241865
  lockfileVersion,
241849
241866
  nodeVersion,
241850
241867
  env: spawnOpts.env || {},
241851
241868
  });
241852
241869
  if (meta.isDev) {
241853
- build_utils_1.debug('Skipping dependency installation because dev mode is enabled');
241870
+ (0, build_utils_1.debug)('Skipping dependency installation because dev mode is enabled');
241854
241871
  }
241855
241872
  else {
241856
241873
  let hasPrintedInstall = false;
@@ -241861,14 +241878,14 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
241861
241878
  }
241862
241879
  };
241863
241880
  if (!config.zeroConfig) {
241864
- build_utils_1.debug('Detected "builds" - not zero config');
241865
- await build_utils_1.runNpmInstall(entrypointDir, [], spawnOpts, meta, nodeVersion);
241881
+ (0, build_utils_1.debug)('Detected "builds" - not zero config');
241882
+ await (0, build_utils_1.runNpmInstall)(entrypointDir, [], spawnOpts, meta, nodeVersion);
241866
241883
  isNpmInstall = true;
241867
241884
  }
241868
241885
  else if (typeof installCommand === 'string') {
241869
241886
  if (installCommand.trim()) {
241870
241887
  console.log(`Running "install" command: \`${installCommand}\`...`);
241871
- await build_utils_1.execCommand(installCommand, {
241888
+ await (0, build_utils_1.execCommand)(installCommand, {
241872
241889
  ...spawnOpts,
241873
241890
  cwd: entrypointDir,
241874
241891
  });
@@ -241882,33 +241899,33 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
241882
241899
  }
241883
241900
  }
241884
241901
  else {
241885
- if (fs_1.existsSync(gemfilePath)) {
241886
- build_utils_1.debug('Detected Gemfile');
241902
+ if ((0, fs_1.existsSync)(gemfilePath)) {
241903
+ (0, build_utils_1.debug)('Detected Gemfile');
241887
241904
  printInstall();
241888
241905
  const opts = {
241889
- env: build_utils_1.cloneEnv(process.env, {
241906
+ env: (0, build_utils_1.cloneEnv)(process.env, {
241890
241907
  // See more: https://github.com/rubygems/rubygems/blob/a82d04856deba58be6b90f681a5e42a7c0f2baa7/bundler/lib/bundler/man/bundle-config.1.ronn
241891
241908
  BUNDLE_BIN: 'vendor/bin',
241892
241909
  BUNDLE_CACHE_PATH: 'vendor/cache',
241893
241910
  BUNDLE_PATH: 'vendor/bundle',
241894
241911
  BUNDLE_RETRY: '5',
241895
- BUNDLE_JOBS: String(os_1.cpus().length || 1),
241912
+ BUNDLE_JOBS: String((0, os_1.cpus)().length || 1),
241896
241913
  BUNDLE_SILENCE_ROOT_WARNING: '1',
241897
241914
  BUNDLE_DISABLE_SHARED_GEMS: '1',
241898
241915
  BUNDLE_DISABLE_VERSION_CHECK: '1',
241899
241916
  }),
241900
241917
  };
241901
- await build_utils_1.runBundleInstall(workPath, [], opts, meta);
241918
+ await (0, build_utils_1.runBundleInstall)(workPath, [], opts, meta);
241902
241919
  isBundleInstall = true;
241903
241920
  }
241904
- if (fs_1.existsSync(requirementsPath)) {
241905
- build_utils_1.debug('Detected requirements.txt');
241921
+ if ((0, fs_1.existsSync)(requirementsPath)) {
241922
+ (0, build_utils_1.debug)('Detected requirements.txt');
241906
241923
  printInstall();
241907
- await build_utils_1.runPipInstall(workPath, ['-r', requirementsPath], undefined, meta);
241924
+ await (0, build_utils_1.runPipInstall)(workPath, ['-r', requirementsPath], undefined, meta);
241908
241925
  isPipInstall = true;
241909
241926
  }
241910
241927
  if (pkg) {
241911
- await build_utils_1.runNpmInstall(entrypointDir, [], spawnOpts, meta, nodeVersion);
241928
+ await (0, build_utils_1.runNpmInstall)(entrypointDir, [], spawnOpts, meta, nodeVersion);
241912
241929
  isNpmInstall = true;
241913
241930
  }
241914
241931
  }
@@ -241919,21 +241936,21 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
241919
241936
  let gemHome = undefined;
241920
241937
  const pathList = [];
241921
241938
  if (isNpmInstall || (pkg && (buildCommand || devCommand))) {
241922
- const nodeBinPath = await build_utils_1.getNodeBinPath({ cwd: entrypointDir });
241939
+ const nodeBinPath = await (0, build_utils_1.getNodeBinPath)({ cwd: entrypointDir });
241923
241940
  pathList.push(nodeBinPath); // Add `./node_modules/.bin`
241924
- build_utils_1.debug(`Added "${nodeBinPath}" to PATH env because a package.json file was found`);
241941
+ (0, build_utils_1.debug)(`Added "${nodeBinPath}" to PATH env because a package.json file was found`);
241925
241942
  }
241926
241943
  if (isBundleInstall) {
241927
241944
  const vendorBin = path_1.default.join(workPath, 'vendor', 'bin');
241928
241945
  pathList.push(vendorBin); // Add `./vendor/bin`
241929
- build_utils_1.debug(`Added "${vendorBin}" to PATH env because a Gemfile was found`);
241946
+ (0, build_utils_1.debug)(`Added "${vendorBin}" to PATH env because a Gemfile was found`);
241930
241947
  const dir = path_1.default.join(workPath, 'vendor', 'bundle', 'ruby');
241931
- const rubyVersion = fs_1.existsSync(dir) && fs_1.statSync(dir).isDirectory()
241932
- ? fs_1.readdirSync(dir)[0]
241948
+ const rubyVersion = (0, fs_1.existsSync)(dir) && (0, fs_1.statSync)(dir).isDirectory()
241949
+ ? (0, fs_1.readdirSync)(dir)[0]
241933
241950
  : '';
241934
241951
  if (rubyVersion) {
241935
241952
  gemHome = path_1.default.join(dir, rubyVersion); // Add `./vendor/bundle/ruby/2.7.0`
241936
- build_utils_1.debug(`Set GEM_HOME="${gemHome}" because a Gemfile was found`);
241953
+ (0, build_utils_1.debug)(`Set GEM_HOME="${gemHome}" because a Gemfile was found`);
241937
241954
  }
241938
241955
  }
241939
241956
  if (isPipInstall) {
@@ -241953,12 +241970,12 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
241953
241970
  (pkg && devScript && pkg.scripts && pkg.scripts[devScript]))) {
241954
241971
  let devPort = nowDevScriptPorts.get(entrypoint);
241955
241972
  if (typeof devPort === 'number') {
241956
- build_utils_1.debug('`%s` server already running for %j', devCommand || devScript, entrypoint);
241973
+ (0, build_utils_1.debug)('`%s` server already running for %j', devCommand || devScript, entrypoint);
241957
241974
  }
241958
241975
  else {
241959
241976
  // Run the `now-dev` or `dev` script out-of-bounds, since it is assumed that
241960
241977
  // it will launch a dev server that never "completes"
241961
- devPort = await get_port_1.default();
241978
+ devPort = await (0, get_port_1.default)();
241962
241979
  nowDevScriptPorts.set(entrypoint, devPort);
241963
241980
  const opts = {
241964
241981
  cwd: entrypointDir,
@@ -241966,7 +241983,7 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
241966
241983
  env: { ...spawnOpts.env, PORT: String(devPort) },
241967
241984
  };
241968
241985
  const cmd = devCommand || `yarn run ${devScript}`;
241969
- const child = build_utils_1.spawnCommand(cmd, opts);
241986
+ const child = (0, build_utils_1.spawnCommand)(cmd, opts);
241970
241987
  child.on('close', () => nowDevScriptPorts.delete(entrypoint));
241971
241988
  nowDevChildProcesses.add(child);
241972
241989
  // Wait for the server to have listened on `$PORT`, after which we
@@ -241978,7 +241995,7 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
241978
241995
  catch (err) {
241979
241996
  throw new Error(`Failed to detect a server running on port ${devPort}.\nDetails: https://err.sh/vercel/vercel/now-static-build-failed-to-detect-a-server`);
241980
241997
  }
241981
- build_utils_1.debug('Detected dev server for %j', entrypoint);
241998
+ (0, build_utils_1.debug)('Detected dev server for %j', entrypoint);
241982
241999
  }
241983
242000
  let srcBase = mountpoint.replace(/^\.\/?/, '');
241984
242001
  if (srcBase.length > 0) {
@@ -241994,14 +242011,14 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
241994
242011
  }
241995
242012
  else {
241996
242013
  if (meta.isDev) {
241997
- build_utils_1.debug(`WARN: A dev script is missing`);
242014
+ (0, build_utils_1.debug)(`WARN: A dev script is missing`);
241998
242015
  }
241999
242016
  if (buildCommand) {
242000
- build_utils_1.debug(`Executing "${buildCommand}"`);
242017
+ (0, build_utils_1.debug)(`Executing "${buildCommand}"`);
242001
242018
  }
242002
242019
  try {
242003
242020
  const found = typeof buildCommand === 'string'
242004
- ? await build_utils_1.execCommand(buildCommand, {
242021
+ ? await (0, build_utils_1.execCommand)(buildCommand, {
242005
242022
  ...spawnOpts,
242006
242023
  // Yarn v2 PnP mode may be activated, so force
242007
242024
  // "node-modules" linker style
@@ -242011,7 +242028,7 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
242011
242028
  },
242012
242029
  cwd: entrypointDir,
242013
242030
  })
242014
- : await build_utils_1.runPackageJsonScript(entrypointDir, ['vercel-build', 'now-build', 'build'], spawnOpts);
242031
+ : await (0, build_utils_1.runPackageJsonScript)(entrypointDir, ['vercel-build', 'now-build', 'build'], spawnOpts);
242015
242032
  if (!found) {
242016
242033
  throw new Error(`Missing required "${buildCommand || 'vercel-build'}" script in "${entrypoint}"`);
242017
242034
  }
@@ -242072,21 +242089,21 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
242072
242089
  'package.json',
242073
242090
  '.vercel_build_output',
242074
242091
  ];
242075
- build_utils_1.debug(`Using ignore: ${JSON.stringify(ignore)}`);
242092
+ (0, build_utils_1.debug)(`Using ignore: ${JSON.stringify(ignore)}`);
242076
242093
  }
242077
- output = await build_utils_1.glob('**', { cwd: distPath, ignore }, mountpoint);
242094
+ output = await (0, build_utils_1.glob)('**', { cwd: distPath, ignore }, mountpoint);
242078
242095
  Object.assign(output, extraOutputs.functions);
242079
242096
  }
242080
242097
  }
242081
242098
  return { routes, images, output };
242082
242099
  }
242083
242100
  if (!config.zeroConfig && entrypoint.endsWith('.sh')) {
242084
- build_utils_1.debug(`Running build script "${entrypoint}"`);
242085
- const nodeVersion = await build_utils_1.getNodeVersion(entrypointDir, undefined, config, meta);
242086
- const spawnOpts = build_utils_1.getSpawnOptions(meta, nodeVersion);
242087
- await build_utils_1.runShellScript(path_1.default.join(workPath, entrypoint), [], spawnOpts);
242101
+ (0, build_utils_1.debug)(`Running build script "${entrypoint}"`);
242102
+ const nodeVersion = await (0, build_utils_1.getNodeVersion)(entrypointDir, undefined, config, meta);
242103
+ const spawnOpts = (0, build_utils_1.getSpawnOptions)(meta, nodeVersion);
242104
+ await (0, build_utils_1.runShellScript)(path_1.default.join(workPath, entrypoint), [], spawnOpts);
242088
242105
  validateDistDir(distPath);
242089
- const output = await build_utils_1.glob('**', distPath, mountpoint);
242106
+ const output = await (0, build_utils_1.glob)('**', distPath, mountpoint);
242090
242107
  return {
242091
242108
  output,
242092
242109
  routes: [],
@@ -242105,7 +242122,7 @@ const prepareCache = async ({ entrypoint, repoRootPath, workPath, config, }) =>
242105
242122
  const configV3 = await BuildOutputV3.readConfig(workPath);
242106
242123
  if (configV3?.cache && Array.isArray(configV3.cache)) {
242107
242124
  for (const cacheGlob of configV3.cache) {
242108
- Object.assign(cacheFiles, await build_utils_1.glob(cacheGlob, workPath));
242125
+ Object.assign(cacheFiles, await (0, build_utils_1.glob)(cacheGlob, workPath));
242109
242126
  }
242110
242127
  return cacheFiles;
242111
242128
  }
@@ -242116,17 +242133,17 @@ const prepareCache = async ({ entrypoint, repoRootPath, workPath, config, }) =>
242116
242133
  });
242117
242134
  if (buildConfigV1?.cache && Array.isArray(buildConfigV1.cache)) {
242118
242135
  for (const cacheGlob of buildConfigV1.cache) {
242119
- Object.assign(cacheFiles, await build_utils_1.glob(cacheGlob, workPath));
242136
+ Object.assign(cacheFiles, await (0, build_utils_1.glob)(cacheGlob, workPath));
242120
242137
  }
242121
242138
  return cacheFiles;
242122
242139
  }
242123
242140
  // Default cache files
242124
- Object.assign(cacheFiles, await build_utils_1.glob('**/{.shadow-cljs,node_modules}/**', repoRootPath || workPath));
242141
+ Object.assign(cacheFiles, await (0, build_utils_1.glob)('**/{.shadow-cljs,node_modules}/**', repoRootPath || workPath));
242125
242142
  // Framework cache files
242126
242143
  const pkg = getPkg(entrypoint, workPath);
242127
242144
  const framework = getFramework(config, pkg);
242128
242145
  if (framework?.cachePattern) {
242129
- Object.assign(cacheFiles, await build_utils_1.glob(framework.cachePattern, workPath));
242146
+ Object.assign(cacheFiles, await (0, build_utils_1.glob)(framework.cachePattern, workPath));
242130
242147
  }
242131
242148
  return cacheFiles;
242132
242149
  };
@@ -242221,8 +242238,8 @@ async function readBuildOutputDirectory({ workPath, nodeVersion, }) {
242221
242238
  configFileName: 'build.json',
242222
242239
  });
242223
242240
  const outputs = {
242224
- staticFiles: _shared_1.isObjectEmpty(staticFiles) ? null : staticFiles,
242225
- functions: _shared_1.isObjectEmpty(functions) ? null : functions,
242241
+ staticFiles: (0, _shared_1.isObjectEmpty)(staticFiles) ? null : staticFiles,
242242
+ functions: (0, _shared_1.isObjectEmpty)(functions) ? null : functions,
242226
242243
  routes: routes.length ? routes : null,
242227
242244
  images,
242228
242245
  build,
@@ -242247,7 +242264,7 @@ async function readBuildOutputDirectory({ workPath, nodeVersion, }) {
242247
242264
  exports.readBuildOutputDirectory = readBuildOutputDirectory;
242248
242265
  async function readStaticFiles({ workPath, }) {
242249
242266
  const staticFilePath = path_1.default.join(workPath, VERCEL_BUILD_OUTPUT, 'static');
242250
- const staticFiles = await build_utils_1.glob('**', {
242267
+ const staticFiles = await (0, build_utils_1.glob)('**', {
242251
242268
  cwd: staticFilePath,
242252
242269
  });
242253
242270
  return staticFiles;
@@ -242257,12 +242274,12 @@ async function readFunctions({ workPath, functionsMountPath, nodeVersion, }) {
242257
242274
  const functionsConfig = await readFunctionsConfig({ workPath });
242258
242275
  // Find all entrypoints and create a Lambda for each of them.
242259
242276
  let functionsPath = path_1.default.join(workPath, VERCEL_BUILD_OUTPUT, 'functions');
242260
- let functionEntrypoints = await build_utils_1.glob('*/index{,.*}', { cwd: functionsPath });
242277
+ let functionEntrypoints = await (0, build_utils_1.glob)('*/index{,.*}', { cwd: functionsPath });
242261
242278
  let isLegacyFunctions = false;
242262
242279
  // To not break existing projects, we have to keep supporting the `functions/node` folder.
242263
242280
  if (!Object.keys(functionEntrypoints).length) {
242264
242281
  functionsPath = path_1.default.join(functionsPath, 'node');
242265
- functionEntrypoints = await build_utils_1.glob('*/index.{js,mjs}', {
242282
+ functionEntrypoints = await (0, build_utils_1.glob)('*/index.{js,mjs}', {
242266
242283
  cwd: functionsPath,
242267
242284
  });
242268
242285
  isLegacyFunctions = true;
@@ -242272,7 +242289,7 @@ async function readFunctions({ workPath, functionsMountPath, nodeVersion, }) {
242272
242289
  const functionName = path_1.default.dirname(entrypointFile);
242273
242290
  const lambdaConfig = functionsConfig.get(functionName) || {};
242274
242291
  const { runtime, handler, ...config } = lambdaConfig;
242275
- const lambdaFiles = await build_utils_1.glob('**', {
242292
+ const lambdaFiles = await (0, build_utils_1.glob)('**', {
242276
242293
  cwd: path_1.default.join(functionsPath, functionName),
242277
242294
  });
242278
242295
  if (!lambdaConfig.runtime && isLegacyFunctions) {
@@ -242310,7 +242327,7 @@ async function readFunctions({ workPath, functionsMountPath, nodeVersion, }) {
242310
242327
  ? path_1.default.join(functionsMountPath, parsed.dir, parsed.name)
242311
242328
  : path_1.default.join(functionsMountPath, functionName);
242312
242329
  output[newPath] = lambda;
242313
- build_utils_1.debug(`Created Lambda "${newPath}" from "${path_1.default.join(functionsPath, entrypointFile)}".`);
242330
+ (0, build_utils_1.debug)(`Created Lambda "${newPath}" from "${path_1.default.join(functionsPath, entrypointFile)}".`);
242314
242331
  }
242315
242332
  return output;
242316
242333
  }
@@ -242400,6 +242417,7 @@ const build_utils_1 = __webpack_require__(3445);
242400
242417
  const _shared_1 = __webpack_require__(54);
242401
242418
  const ts_morph_1 = __webpack_require__(3817);
242402
242419
  const static_config_1 = __webpack_require__(6199);
242420
+ const error_utils_1 = __webpack_require__(9799);
242403
242421
  const BUILD_OUTPUT_DIR = '.output';
242404
242422
  const BRIDGE_MIDDLEWARE_V2_TO_V3 = `
242405
242423
 
@@ -242426,7 +242444,7 @@ async function getBuildOutputDirectory(workingDir) {
242426
242444
  const outputDir = path_1.default.join(workingDir, BUILD_OUTPUT_DIR);
242427
242445
  // check for one of several config files
242428
242446
  const finderPromises = CONFIG_FILES.map(configFile => {
242429
- return fs_extra_1.pathExists(path_1.default.join(outputDir, configFile));
242447
+ return (0, fs_extra_1.pathExists)(path_1.default.join(outputDir, configFile));
242430
242448
  });
242431
242449
  const finders = await Promise.all(finderPromises);
242432
242450
  if (finders.some(found => found)) {
@@ -242457,7 +242475,7 @@ async function readBuildOutputDirectory({ workPath, }) {
242457
242475
  regions: (() => {
242458
242476
  try {
242459
242477
  const project = new ts_morph_1.Project();
242460
- const config = static_config_1.getConfig(project, middleware.file.fsPath);
242478
+ const config = (0, static_config_1.getConfig)(project, middleware.file.fsPath);
242461
242479
  return config?.regions;
242462
242480
  }
242463
242481
  catch (err) {
@@ -242468,18 +242486,18 @@ async function readBuildOutputDirectory({ workPath, }) {
242468
242486
  }
242469
242487
  const staticFiles = await readStaticFiles({ workPath });
242470
242488
  const outputs = {
242471
- staticFiles: _shared_1.isObjectEmpty(staticFiles) ? null : staticFiles,
242472
- functions: _shared_1.isObjectEmpty(functions) ? null : functions,
242489
+ staticFiles: (0, _shared_1.isObjectEmpty)(staticFiles) ? null : staticFiles,
242490
+ functions: (0, _shared_1.isObjectEmpty)(functions) ? null : functions,
242473
242491
  routes: routes.length ? routes : null,
242474
242492
  };
242475
242493
  if (outputs.functions) {
242476
- build_utils_1.debug(`Detected Serverless Functions in "${BUILD_OUTPUT_DIR}"`);
242494
+ (0, build_utils_1.debug)(`Detected Serverless Functions in "${BUILD_OUTPUT_DIR}"`);
242477
242495
  }
242478
242496
  if (outputs.staticFiles) {
242479
- build_utils_1.debug(`Detected Static Assets in "${BUILD_OUTPUT_DIR}"`);
242497
+ (0, build_utils_1.debug)(`Detected Static Assets in "${BUILD_OUTPUT_DIR}"`);
242480
242498
  }
242481
242499
  if (outputs.routes) {
242482
- build_utils_1.debug(`Detected Routes Configuration in "${BUILD_OUTPUT_DIR}"`);
242500
+ (0, build_utils_1.debug)(`Detected Routes Configuration in "${BUILD_OUTPUT_DIR}"`);
242483
242501
  }
242484
242502
  return outputs;
242485
242503
  }
@@ -242487,19 +242505,22 @@ exports.readBuildOutputDirectory = readBuildOutputDirectory;
242487
242505
  async function getMiddleware(workPath) {
242488
242506
  const manifestPath = path_1.default.join(workPath, BUILD_OUTPUT_DIR, 'functions-manifest.json');
242489
242507
  try {
242490
- const manifest = await fs_extra_1.readJson(manifestPath);
242508
+ const manifest = await (0, fs_extra_1.readJson)(manifestPath);
242491
242509
  if (manifest.pages['_middleware.js'].runtime !== 'web') {
242492
242510
  return;
242493
242511
  }
242494
242512
  }
242495
242513
  catch (error) {
242496
- if (error.code !== 'ENOENT')
242514
+ if (!(0, error_utils_1.isErrnoException)(error)) {
242497
242515
  throw error;
242498
- return;
242516
+ }
242517
+ if (error.code !== 'ENOENT') {
242518
+ throw error;
242519
+ }
242499
242520
  }
242500
242521
  const middlewareRelativePath = path_1.default.join(BUILD_OUTPUT_DIR, 'server/pages/_middleware.js');
242501
242522
  const middlewareAbsoluatePath = path_1.default.join(workPath, middlewareRelativePath);
242502
- await fs_extra_1.appendFile(middlewareAbsoluatePath, BRIDGE_MIDDLEWARE_V2_TO_V3);
242523
+ await (0, fs_extra_1.appendFile)(middlewareAbsoluatePath, BRIDGE_MIDDLEWARE_V2_TO_V3);
242503
242524
  const route = {
242504
242525
  src: '/(.*)',
242505
242526
  middlewarePath: 'middleware',
@@ -242514,7 +242535,7 @@ async function getMiddleware(workPath) {
242514
242535
  }
242515
242536
  async function readStaticFiles({ workPath, }) {
242516
242537
  const staticFilePath = path_1.default.join(workPath, BUILD_OUTPUT_DIR, 'static');
242517
- const staticFiles = await build_utils_1.glob('**', {
242538
+ const staticFiles = await (0, build_utils_1.glob)('**', {
242518
242539
  cwd: staticFilePath,
242519
242540
  });
242520
242541
  return staticFiles;
@@ -242555,8 +242576,8 @@ const BUILD_OUTPUT_DIR = '.vercel/output';
242555
242576
  */
242556
242577
  async function getBuildOutputDirectory(path) {
242557
242578
  try {
242558
- const outputDir = path_1.join(path, BUILD_OUTPUT_DIR);
242559
- const configPath = path_1.join(outputDir, 'config.json');
242579
+ const outputDir = (0, path_1.join)(path, BUILD_OUTPUT_DIR);
242580
+ const configPath = (0, path_1.join)(outputDir, 'config.json');
242560
242581
  await fs_1.promises.stat(configPath);
242561
242582
  return outputDir;
242562
242583
  }
@@ -242569,8 +242590,8 @@ async function getBuildOutputDirectory(path) {
242569
242590
  exports.getBuildOutputDirectory = getBuildOutputDirectory;
242570
242591
  async function readConfig(path) {
242571
242592
  try {
242572
- const outputDir = path_1.join(path, BUILD_OUTPUT_DIR);
242573
- const configPath = path_1.join(outputDir, 'config.json');
242593
+ const outputDir = (0, path_1.join)(path, BUILD_OUTPUT_DIR);
242594
+ const configPath = (0, path_1.join)(outputDir, 'config.json');
242574
242595
  return JSON.parse(await fs_1.promises.readFile(configPath, 'utf8'));
242575
242596
  }
242576
242597
  catch (err) {
@@ -242608,7 +242629,11 @@ exports.createBuildOutput = createBuildOutput;
242608
242629
 
242609
242630
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
242610
242631
  if (k2 === undefined) k2 = k;
242611
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
242632
+ var desc = Object.getOwnPropertyDescriptor(m, k);
242633
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
242634
+ desc = { enumerable: true, get: function() { return m[k]; } };
242635
+ }
242636
+ Object.defineProperty(o, k2, desc);
242612
242637
  }) : (function(o, m, k, k2) {
242613
242638
  if (k2 === undefined) k2 = k;
242614
242639
  o[k2] = m[k];
@@ -242681,13 +242706,13 @@ async function updateGatsbyConfig(dir, plugins) {
242681
242706
  const gatsbyConfigPathTs = path.join(dir, `${GATSBY_CONFIG_FILE}.ts`);
242682
242707
  const gatsbyConfigPathMjs = path.join(dir, `${GATSBY_CONFIG_FILE}.mjs`);
242683
242708
  const gatsbyConfigPathJs = path.join(dir, `${GATSBY_CONFIG_FILE}.js`);
242684
- if (await _shared_1.fileExists(gatsbyConfigPathTs)) {
242709
+ if (await (0, _shared_1.fileExists)(gatsbyConfigPathTs)) {
242685
242710
  await updateGatsbyConfigTs(gatsbyConfigPathTs, plugins);
242686
242711
  }
242687
- else if (await _shared_1.fileExists(gatsbyConfigPathMjs)) {
242712
+ else if (await (0, _shared_1.fileExists)(gatsbyConfigPathMjs)) {
242688
242713
  await updateGatsbyConfigMjs(gatsbyConfigPathMjs, plugins);
242689
242714
  }
242690
- else if (await _shared_1.fileExists(gatsbyConfigPathJs)) {
242715
+ else if (await (0, _shared_1.fileExists)(gatsbyConfigPathJs)) {
242691
242716
  await updateGatsbyConfigJs(gatsbyConfigPathJs, plugins);
242692
242717
  }
242693
242718
  else {
@@ -242698,7 +242723,7 @@ module.exports = ${JSON.stringify({ plugins })}`);
242698
242723
  const GENERATED_FILE_COMMENT = `// This file was generated by @vercel/static-build`;
242699
242724
  async function updateGatsbyConfigTs(configPath, plugins) {
242700
242725
  const renamedPath = `${configPath}.__vercel_builder_backup__.ts`;
242701
- if (!(await _shared_1.fileExists(renamedPath))) {
242726
+ if (!(await (0, _shared_1.fileExists)(renamedPath))) {
242702
242727
  await fs_extra_1.default.rename(configPath, renamedPath);
242703
242728
  }
242704
242729
  await fs_extra_1.default.writeFile(configPath, `${GENERATED_FILE_COMMENT}
@@ -242733,7 +242758,7 @@ export default vercelConfig;
242733
242758
  }
242734
242759
  async function updateGatsbyConfigMjs(configPath, plugins) {
242735
242760
  const renamedPath = `${configPath}.__vercel_builder_backup__.mjs`;
242736
- if (!(await _shared_1.fileExists(renamedPath))) {
242761
+ if (!(await (0, _shared_1.fileExists)(renamedPath))) {
242737
242762
  await fs_extra_1.default.rename(configPath, renamedPath);
242738
242763
  }
242739
242764
  await fs_extra_1.default.writeFile(configPath, `${GENERATED_FILE_COMMENT}
@@ -242766,7 +242791,7 @@ export default vercelConfig;
242766
242791
  }
242767
242792
  async function updateGatsbyConfigJs(configPath, plugins) {
242768
242793
  const renamedPath = `${configPath}.__vercel_builder_backup__.js`;
242769
- if (!(await _shared_1.fileExists(renamedPath))) {
242794
+ if (!(await (0, _shared_1.fileExists)(renamedPath))) {
242770
242795
  await fs_extra_1.default.rename(configPath, renamedPath);
242771
242796
  }
242772
242797
  await fs_extra_1.default.writeFile(configPath, `${GENERATED_FILE_COMMENT}
@@ -242800,13 +242825,13 @@ async function updateGatsbyNode(dir) {
242800
242825
  const gatsbyNodePathTs = path.join(dir, `${GATSBY_NODE_FILE}.ts`);
242801
242826
  const gatsbyNodePathMjs = path.join(dir, `${GATSBY_NODE_FILE}.mjs`);
242802
242827
  const gatsbyNodePathJs = path.join(dir, `${GATSBY_NODE_FILE}.js`);
242803
- if (await _shared_1.fileExists(gatsbyNodePathTs)) {
242828
+ if (await (0, _shared_1.fileExists)(gatsbyNodePathTs)) {
242804
242829
  await updateGatsbyNodeTs(gatsbyNodePathTs);
242805
242830
  }
242806
- else if (await _shared_1.fileExists(gatsbyNodePathMjs)) {
242831
+ else if (await (0, _shared_1.fileExists)(gatsbyNodePathMjs)) {
242807
242832
  await updateGatsbyNodeMjs(gatsbyNodePathMjs);
242808
242833
  }
242809
- else if (await _shared_1.fileExists(gatsbyNodePathJs)) {
242834
+ else if (await (0, _shared_1.fileExists)(gatsbyNodePathJs)) {
242810
242835
  await updateGatsbyNodeJs(gatsbyNodePathJs);
242811
242836
  }
242812
242837
  else {
@@ -242816,7 +242841,7 @@ module.exports = require('@vercel/gatsby-plugin-vercel-builder/gatsby-node.js');
242816
242841
  }
242817
242842
  async function updateGatsbyNodeTs(configPath) {
242818
242843
  const renamedPath = `${configPath}.__vercel_builder_backup__.ts`;
242819
- if (!(await _shared_1.fileExists(renamedPath))) {
242844
+ if (!(await (0, _shared_1.fileExists)(renamedPath))) {
242820
242845
  await fs_extra_1.default.rename(configPath, renamedPath);
242821
242846
  }
242822
242847
  await fs_extra_1.default.writeFile(configPath, `${GENERATED_FILE_COMMENT}
@@ -242836,7 +242861,7 @@ export const onPostBuild: GatsbyNode['onPostBuild'] = async (args, options) => {
242836
242861
  }
242837
242862
  async function updateGatsbyNodeMjs(configPath) {
242838
242863
  const renamedPath = `${configPath}.__vercel_builder_backup__.mjs`;
242839
- if (!(await _shared_1.fileExists(renamedPath))) {
242864
+ if (!(await (0, _shared_1.fileExists)(renamedPath))) {
242840
242865
  await fs_extra_1.default.rename(configPath, renamedPath);
242841
242866
  }
242842
242867
  await fs_extra_1.default.writeFile(configPath, `${GENERATED_FILE_COMMENT}
@@ -242855,7 +242880,7 @@ export const onPostBuild = async (args, options) => {
242855
242880
  }
242856
242881
  async function updateGatsbyNodeJs(configPath) {
242857
242882
  const renamedPath = `${configPath}.__vercel_builder_backup__.js`;
242858
- if (!(await _shared_1.fileExists(renamedPath))) {
242883
+ if (!(await (0, _shared_1.fileExists)(renamedPath))) {
242859
242884
  await fs_extra_1.default.rename(configPath, renamedPath);
242860
242885
  }
242861
242886
  await fs_extra_1.default.writeFile(configPath, `${GENERATED_FILE_COMMENT}
@@ -242922,25 +242947,25 @@ const _shared_1 = __webpack_require__(54);
242922
242947
  // https://github.com/nuxt-modules/web-vitals
242923
242948
  const ANALYTICS_PLUGIN_PACKAGE = '@nuxtjs/web-vitals';
242924
242949
  async function injectVercelAnalyticsPlugin(dir) {
242925
- // First update the `.nuxtrc` file to inject the analytics plugin.
242950
+ // First update the `.nuxtrc` file to inject the Speed Insights (formerly Analytics) plugin.
242926
242951
  // See: https://gist.github.com/pi0/23b5253ac19b4ed5a70add3b971545c9
242927
- const nuxtrcPath = path_1.join(dir, '.nuxtrc');
242928
- console.log(`Injecting Nuxt.js analytics plugin "${ANALYTICS_PLUGIN_PACKAGE}" to \`${nuxtrcPath}\``);
242929
- rc9_1.update({
242952
+ const nuxtrcPath = (0, path_1.join)(dir, '.nuxtrc');
242953
+ console.log(`Injecting Nuxt.js Speed Insights plugin "${ANALYTICS_PLUGIN_PACKAGE}" to \`${nuxtrcPath}\``);
242954
+ (0, rc9_1.update)({
242930
242955
  'modules[]': ANALYTICS_PLUGIN_PACKAGE,
242931
242956
  }, {
242932
242957
  name: nuxtrcPath,
242933
242958
  });
242934
242959
  // The dependency needs to be listed in `package.json` as well so
242935
242960
  // that `npm i` installs the package.
242936
- const pkgJson = (await _shared_1.readPackageJson(dir));
242961
+ const pkgJson = (await (0, _shared_1.readPackageJson)(dir));
242937
242962
  if (!pkgJson.dependencies) {
242938
242963
  pkgJson.dependencies = {};
242939
242964
  }
242940
242965
  if (!pkgJson.dependencies[ANALYTICS_PLUGIN_PACKAGE]) {
242941
242966
  pkgJson.dependencies[ANALYTICS_PLUGIN_PACKAGE] = 'latest';
242942
242967
  console.log(`Adding "${ANALYTICS_PLUGIN_PACKAGE}" to \`package.json\` "dependencies"`);
242943
- await _shared_1.writePackageJson(dir, pkgJson);
242968
+ await (0, _shared_1.writePackageJson)(dir, pkgJson);
242944
242969
  }
242945
242970
  }
242946
242971
  exports.injectVercelAnalyticsPlugin = injectVercelAnalyticsPlugin;