vercel 23.1.3-canary.52 → 23.1.3-canary.56

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 +294 -129
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -217473,6 +217473,8 @@ function convertRuntimeToPlugin(buildRuntime, packageName, ext) {
217473
217473
  // need to be able to easily inspect the output.
217474
217474
  `api-routes-${pluginName}`);
217475
217475
  await fs_extra_1.default.ensureDir(traceDir);
217476
+ let newPathsRuntime = new Set();
217477
+ let linkersRuntime = [];
217476
217478
  for (const entrypoint of Object.keys(entrypoints)) {
217477
217479
  const { output } = await buildRuntime({
217478
217480
  files: sourceFilesPreBuild,
@@ -217500,14 +217502,6 @@ function convertRuntimeToPlugin(buildRuntime, packageName, ext) {
217500
217502
  const handler = output.handler;
217501
217503
  const handlerMethod = handler.split('.').reverse()[0];
217502
217504
  const handlerFileName = handler.replace(`.${handlerMethod}`, '');
217503
- pages[entrypoint] = {
217504
- handler: handler,
217505
- runtime: output.runtime,
217506
- memory: output.memory,
217507
- maxDuration: output.maxDuration,
217508
- environment: output.environment,
217509
- allowQuery: output.allowQuery,
217510
- };
217511
217505
  // @ts-ignore This symbol is a private API
217512
217506
  const lambdaFiles = output[lambda_1.FILES_SYMBOL];
217513
217507
  // When deploying, the `files` that are passed to the Legacy Runtimes already
@@ -217527,48 +217521,148 @@ function convertRuntimeToPlugin(buildRuntime, packageName, ext) {
217527
217521
  throw new Error(`Could not find a handler file. Please ensure that the list of \`files\` defined for the returned \`Lambda\` contains a file with the name ${handlerFileName} (+ any extension).`);
217528
217522
  }
217529
217523
  const entry = path_1.join(workPath, '.output', 'server', 'pages', entrypoint);
217524
+ // We never want to link here, only copy, because the launcher
217525
+ // file often has the same name for every entrypoint, which means that
217526
+ // every build for every entrypoint overwrites the launcher of the previous
217527
+ // one, so linking would end with a broken reference.
217530
217528
  await fs_extra_1.default.ensureDir(path_1.dirname(entry));
217531
- await linkOrCopy(handlerFileOrigin, entry);
217532
- const toRemove = [];
217533
- // You can find more details about this at the point where the
217534
- // `sourceFilesAfterBuild` is created originally.
217529
+ await fs_extra_1.default.copy(handlerFileOrigin, entry);
217530
+ const newFilesEntrypoint = [];
217531
+ const newDirectoriesEntrypoint = [];
217532
+ const preBuildFiles = Object.values(sourceFilesPreBuild).map(file => {
217533
+ return file.fsPath;
217534
+ });
217535
+ // Generate a list of directories and files that weren't present
217536
+ // before the entrypoint was processed by the Legacy Runtime, so
217537
+ // that we can perform a cleanup later. We need to divide into files
217538
+ // and directories because only cleaning up files might leave empty
217539
+ // directories, and listing directories separately also speeds up the
217540
+ // build because we can just delete them, which wipes all of their nested
217541
+ // paths, instead of iterating through all files that should be deleted.
217535
217542
  for (const file in sourceFilesAfterBuild) {
217536
217543
  if (!sourceFilesPreBuild[file]) {
217537
217544
  const path = sourceFilesAfterBuild[file].fsPath;
217538
- toRemove.push(fs_extra_1.default.remove(path));
217545
+ const dirPath = path_1.dirname(path);
217546
+ // If none of the files that were present before the entrypoint
217547
+ // was processed are contained within the directory we're looking
217548
+ // at right now, then we know it's a newly added directory
217549
+ // and it can therefore be removed later on.
217550
+ const isNewDir = !preBuildFiles.some(filePath => {
217551
+ return path_1.dirname(filePath).startsWith(dirPath);
217552
+ });
217553
+ // Check out the list of tracked directories that were
217554
+ // newly added and see if one of them contains the path
217555
+ // we're looking at.
217556
+ const hasParentDir = newDirectoriesEntrypoint.some(dir => {
217557
+ return path.startsWith(dir);
217558
+ });
217559
+ // If we have already tracked a directory that was newly
217560
+ // added that sits above the file or directory that we're
217561
+ // looking at, we don't need to add more entries to the list
217562
+ // because when the parent will get removed in the future,
217563
+ // all of its children (and therefore the path we're looking at)
217564
+ // will automatically get removed anyways.
217565
+ if (hasParentDir) {
217566
+ continue;
217567
+ }
217568
+ if (isNewDir) {
217569
+ newDirectoriesEntrypoint.push(dirPath);
217570
+ }
217571
+ else {
217572
+ newFilesEntrypoint.push(path);
217573
+ }
217539
217574
  }
217540
217575
  }
217541
- await Promise.all(toRemove);
217542
217576
  const tracedFiles = [];
217543
- Object.entries(lambdaFiles).forEach(async ([relPath, file]) => {
217577
+ const linkers = Object.entries(lambdaFiles).map(async ([relPath, file]) => {
217544
217578
  const newPath = path_1.join(traceDir, relPath);
217545
217579
  // The handler was already moved into position above.
217546
217580
  if (relPath === handlerFilePath) {
217547
217581
  return;
217548
217582
  }
217549
217583
  tracedFiles.push({ absolutePath: newPath, relativePath: relPath });
217550
- if (file.fsPath) {
217551
- await linkOrCopy(file.fsPath, newPath);
217584
+ const { fsPath, type } = file;
217585
+ if (fsPath) {
217586
+ await fs_extra_1.default.ensureDir(path_1.dirname(newPath));
217587
+ const isNewFile = newFilesEntrypoint.includes(fsPath);
217588
+ const isInsideNewDirectory = newDirectoriesEntrypoint.some(dirPath => {
217589
+ return fsPath.startsWith(dirPath);
217590
+ });
217591
+ // With this, we're making sure that files in the `workPath` that existed
217592
+ // before the Legacy Runtime was invoked (source files) are linked from
217593
+ // `.output` instead of copying there (the latter only happens if linking fails),
217594
+ // which is the fastest solution. However, files that are created fresh
217595
+ // by the Legacy Runtimes are always copied, because their link destinations
217596
+ // are likely to be overwritten every time an entrypoint is processed by
217597
+ // the Legacy Runtime. This is likely to overwrite the destination on subsequent
217598
+ // runs, but that's also how `workPath` used to work originally, without
217599
+ // the File System API (meaning that there was one `workPath` for all entrypoints).
217600
+ if (isNewFile || isInsideNewDirectory) {
217601
+ _1.debug(`Copying from ${fsPath} to ${newPath}`);
217602
+ await fs_extra_1.default.copy(fsPath, newPath);
217603
+ }
217604
+ else {
217605
+ await linkOrCopy(fsPath, newPath);
217606
+ }
217552
217607
  }
217553
- else if (file.type === 'FileBlob') {
217608
+ else if (type === 'FileBlob') {
217554
217609
  const { data, mode } = file;
217555
217610
  await fs_extra_1.default.writeFile(newPath, data, { mode });
217556
217611
  }
217557
217612
  else {
217558
- throw new Error(`Unknown file type: ${file.type}`);
217613
+ throw new Error(`Unknown file type: ${type}`);
217559
217614
  }
217560
217615
  });
217616
+ linkersRuntime = linkersRuntime.concat(linkers);
217561
217617
  const nft = path_1.join(workPath, '.output', 'server', 'pages', `${entrypoint}.nft.json`);
217562
217618
  const json = JSON.stringify({
217563
217619
  version: 1,
217564
217620
  files: tracedFiles.map(file => ({
217565
- input: normalize_path_1.normalizePath(path_1.relative(nft, file.absolutePath)),
217621
+ input: normalize_path_1.normalizePath(path_1.relative(path_1.dirname(nft), file.absolutePath)),
217566
217622
  output: normalize_path_1.normalizePath(file.relativePath),
217567
217623
  })),
217568
217624
  });
217569
217625
  await fs_extra_1.default.ensureDir(path_1.dirname(nft));
217570
217626
  await fs_extra_1.default.writeFile(nft, json);
217627
+ // Extend the list of directories and files that were created by the
217628
+ // Legacy Runtime with the list of directories and files that were
217629
+ // created for the entrypoint that was just processed above.
217630
+ newPathsRuntime = new Set([
217631
+ ...newPathsRuntime,
217632
+ ...newFilesEntrypoint,
217633
+ ...newDirectoriesEntrypoint,
217634
+ ]);
217635
+ const apiRouteHandler = `${path_1.parse(entry).name}.${handlerMethod}`;
217636
+ // Add an entry that will later on be added to the `functions-manifest.json`
217637
+ // file that is placed inside of the `.output` directory.
217638
+ pages[entrypoint] = {
217639
+ handler: apiRouteHandler,
217640
+ runtime: output.runtime,
217641
+ memory: output.memory,
217642
+ maxDuration: output.maxDuration,
217643
+ environment: output.environment,
217644
+ allowQuery: output.allowQuery,
217645
+ };
217571
217646
  }
217647
+ // Instead of of waiting for all of the linking to be done for every
217648
+ // entrypoint before processing the next one, we immediately handle all
217649
+ // of them one after the other, while then waiting for the linking
217650
+ // to finish right here, before we clean up newly created files below.
217651
+ await Promise.all(linkersRuntime);
217652
+ // A list of all the files that were created by the Legacy Runtime,
217653
+ // which we'd like to remove from the File System.
217654
+ const toRemove = Array.from(newPathsRuntime).map(path => {
217655
+ _1.debug(`Removing ${path} as part of cleanup`);
217656
+ return fs_extra_1.default.remove(path);
217657
+ });
217658
+ // Once all the entrypoints have been processed, we'd like to
217659
+ // remove all the files from `workPath` that originally weren't present
217660
+ // before the Legacy Runtime began running, because the `workPath`
217661
+ // is nowadays the directory in which the user keeps their source code, since
217662
+ // we're no longer running separate parallel builds for every Legacy Runtime.
217663
+ await Promise.all(toRemove);
217664
+ // Add any Serverless Functions that were exposed by the Legacy Runtime
217665
+ // to the `functions-manifest.json` file provided in `.output`.
217572
217666
  await updateFunctionsManifest({ workPath, pages });
217573
217667
  };
217574
217668
  }
@@ -217656,12 +217750,12 @@ exports.updateRoutesManifest = updateRoutesManifest;
217656
217750
  /***/ }),
217657
217751
 
217658
217752
  /***/ 1868:
217659
- /***/ ((__unused_webpack_module, exports, __nested_webpack_require_929696__) => {
217753
+ /***/ ((__unused_webpack_module, exports, __nested_webpack_require_935813__) => {
217660
217754
 
217661
217755
  "use strict";
217662
217756
 
217663
217757
  Object.defineProperty(exports, "__esModule", ({ value: true }));
217664
- const _1 = __nested_webpack_require_929696__(2855);
217758
+ const _1 = __nested_webpack_require_935813__(2855);
217665
217759
  function debug(message, ...additional) {
217666
217760
  if (_1.getPlatformEnv('BUILDER_DEBUG')) {
217667
217761
  console.log(message, ...additional);
@@ -217673,7 +217767,7 @@ exports.default = debug;
217673
217767
  /***/ }),
217674
217768
 
217675
217769
  /***/ 4246:
217676
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_930081__) {
217770
+ /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_936198__) {
217677
217771
 
217678
217772
  "use strict";
217679
217773
 
@@ -217682,11 +217776,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
217682
217776
  };
217683
217777
  Object.defineProperty(exports, "__esModule", ({ value: true }));
217684
217778
  exports.detectBuilders = exports.detectOutputDirectory = exports.detectApiDirectory = exports.detectApiExtensions = exports.sortFiles = void 0;
217685
- const minimatch_1 = __importDefault(__nested_webpack_require_930081__(9566));
217686
- const semver_1 = __nested_webpack_require_930081__(2879);
217687
- const path_1 = __nested_webpack_require_930081__(5622);
217688
- const frameworks_1 = __importDefault(__nested_webpack_require_930081__(8438));
217689
- const _1 = __nested_webpack_require_930081__(2855);
217779
+ const minimatch_1 = __importDefault(__nested_webpack_require_936198__(9566));
217780
+ const semver_1 = __nested_webpack_require_936198__(2879);
217781
+ const path_1 = __nested_webpack_require_936198__(5622);
217782
+ const frameworks_1 = __importDefault(__nested_webpack_require_936198__(8438));
217783
+ const _1 = __nested_webpack_require_936198__(2855);
217690
217784
  const slugToFramework = new Map(frameworks_1.default.map(f => [f.slug, f]));
217691
217785
  // We need to sort the file paths by alphabet to make
217692
217786
  // sure the routes stay in the same order e.g. for deduping
@@ -218745,7 +218839,7 @@ function getSuggestion(topLevelProp, additionalProperty) {
218745
218839
  /***/ }),
218746
218840
 
218747
218841
  /***/ 2397:
218748
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_969465__) {
218842
+ /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_975582__) {
218749
218843
 
218750
218844
  "use strict";
218751
218845
 
@@ -218753,8 +218847,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
218753
218847
  return (mod && mod.__esModule) ? mod : { "default": mod };
218754
218848
  };
218755
218849
  Object.defineProperty(exports, "__esModule", ({ value: true }));
218756
- const assert_1 = __importDefault(__nested_webpack_require_969465__(2357));
218757
- const into_stream_1 = __importDefault(__nested_webpack_require_969465__(6130));
218850
+ const assert_1 = __importDefault(__nested_webpack_require_975582__(2357));
218851
+ const into_stream_1 = __importDefault(__nested_webpack_require_975582__(6130));
218758
218852
  class FileBlob {
218759
218853
  constructor({ mode = 0o100644, contentType, data }) {
218760
218854
  assert_1.default(typeof mode === 'number');
@@ -218786,7 +218880,7 @@ exports.default = FileBlob;
218786
218880
  /***/ }),
218787
218881
 
218788
218882
  /***/ 9331:
218789
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_970917__) {
218883
+ /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_977034__) {
218790
218884
 
218791
218885
  "use strict";
218792
218886
 
@@ -218794,11 +218888,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
218794
218888
  return (mod && mod.__esModule) ? mod : { "default": mod };
218795
218889
  };
218796
218890
  Object.defineProperty(exports, "__esModule", ({ value: true }));
218797
- const assert_1 = __importDefault(__nested_webpack_require_970917__(2357));
218798
- const fs_extra_1 = __importDefault(__nested_webpack_require_970917__(5392));
218799
- const multistream_1 = __importDefault(__nested_webpack_require_970917__(8179));
218800
- const path_1 = __importDefault(__nested_webpack_require_970917__(5622));
218801
- const async_sema_1 = __importDefault(__nested_webpack_require_970917__(5758));
218891
+ const assert_1 = __importDefault(__nested_webpack_require_977034__(2357));
218892
+ const fs_extra_1 = __importDefault(__nested_webpack_require_977034__(5392));
218893
+ const multistream_1 = __importDefault(__nested_webpack_require_977034__(8179));
218894
+ const path_1 = __importDefault(__nested_webpack_require_977034__(5622));
218895
+ const async_sema_1 = __importDefault(__nested_webpack_require_977034__(5758));
218802
218896
  const semaToPreventEMFILE = new async_sema_1.default(20);
218803
218897
  class FileFsRef {
218804
218898
  constructor({ mode = 0o100644, contentType, fsPath }) {
@@ -218864,7 +218958,7 @@ exports.default = FileFsRef;
218864
218958
  /***/ }),
218865
218959
 
218866
218960
  /***/ 5187:
218867
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_973721__) {
218961
+ /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_979838__) {
218868
218962
 
218869
218963
  "use strict";
218870
218964
 
@@ -218872,11 +218966,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
218872
218966
  return (mod && mod.__esModule) ? mod : { "default": mod };
218873
218967
  };
218874
218968
  Object.defineProperty(exports, "__esModule", ({ value: true }));
218875
- const assert_1 = __importDefault(__nested_webpack_require_973721__(2357));
218876
- const node_fetch_1 = __importDefault(__nested_webpack_require_973721__(2197));
218877
- const multistream_1 = __importDefault(__nested_webpack_require_973721__(8179));
218878
- const async_retry_1 = __importDefault(__nested_webpack_require_973721__(3691));
218879
- const async_sema_1 = __importDefault(__nested_webpack_require_973721__(5758));
218969
+ const assert_1 = __importDefault(__nested_webpack_require_979838__(2357));
218970
+ const node_fetch_1 = __importDefault(__nested_webpack_require_979838__(2197));
218971
+ const multistream_1 = __importDefault(__nested_webpack_require_979838__(8179));
218972
+ const async_retry_1 = __importDefault(__nested_webpack_require_979838__(3691));
218973
+ const async_sema_1 = __importDefault(__nested_webpack_require_979838__(5758));
218880
218974
  const semaToDownloadFromS3 = new async_sema_1.default(5);
218881
218975
  class BailableError extends Error {
218882
218976
  constructor(...args) {
@@ -218957,7 +219051,7 @@ exports.default = FileRef;
218957
219051
  /***/ }),
218958
219052
 
218959
219053
  /***/ 1611:
218960
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_977122__) {
219054
+ /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_983239__) {
218961
219055
 
218962
219056
  "use strict";
218963
219057
 
@@ -218966,10 +219060,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
218966
219060
  };
218967
219061
  Object.defineProperty(exports, "__esModule", ({ value: true }));
218968
219062
  exports.isSymbolicLink = void 0;
218969
- const path_1 = __importDefault(__nested_webpack_require_977122__(5622));
218970
- const debug_1 = __importDefault(__nested_webpack_require_977122__(1868));
218971
- const file_fs_ref_1 = __importDefault(__nested_webpack_require_977122__(9331));
218972
- const fs_extra_1 = __nested_webpack_require_977122__(5392);
219063
+ const path_1 = __importDefault(__nested_webpack_require_983239__(5622));
219064
+ const debug_1 = __importDefault(__nested_webpack_require_983239__(1868));
219065
+ const file_fs_ref_1 = __importDefault(__nested_webpack_require_983239__(9331));
219066
+ const fs_extra_1 = __nested_webpack_require_983239__(5392);
218973
219067
  const S_IFMT = 61440; /* 0170000 type of file */
218974
219068
  const S_IFLNK = 40960; /* 0120000 symbolic link */
218975
219069
  function isSymbolicLink(mode) {
@@ -219031,14 +219125,14 @@ exports.default = download;
219031
219125
  /***/ }),
219032
219126
 
219033
219127
  /***/ 3838:
219034
- /***/ ((__unused_webpack_module, exports, __nested_webpack_require_979947__) => {
219128
+ /***/ ((__unused_webpack_module, exports, __nested_webpack_require_986064__) => {
219035
219129
 
219036
219130
  "use strict";
219037
219131
 
219038
219132
  Object.defineProperty(exports, "__esModule", ({ value: true }));
219039
- const path_1 = __nested_webpack_require_979947__(5622);
219040
- const os_1 = __nested_webpack_require_979947__(2087);
219041
- const fs_extra_1 = __nested_webpack_require_979947__(5392);
219133
+ const path_1 = __nested_webpack_require_986064__(5622);
219134
+ const os_1 = __nested_webpack_require_986064__(2087);
219135
+ const fs_extra_1 = __nested_webpack_require_986064__(5392);
219042
219136
  async function getWritableDirectory() {
219043
219137
  const name = Math.floor(Math.random() * 0x7fffffff).toString(16);
219044
219138
  const directory = path_1.join(os_1.tmpdir(), name);
@@ -219051,7 +219145,7 @@ exports.default = getWritableDirectory;
219051
219145
  /***/ }),
219052
219146
 
219053
219147
  /***/ 4240:
219054
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_980527__) {
219148
+ /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_986644__) {
219055
219149
 
219056
219150
  "use strict";
219057
219151
 
@@ -219059,13 +219153,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
219059
219153
  return (mod && mod.__esModule) ? mod : { "default": mod };
219060
219154
  };
219061
219155
  Object.defineProperty(exports, "__esModule", ({ value: true }));
219062
- const path_1 = __importDefault(__nested_webpack_require_980527__(5622));
219063
- const assert_1 = __importDefault(__nested_webpack_require_980527__(2357));
219064
- const glob_1 = __importDefault(__nested_webpack_require_980527__(1104));
219065
- const util_1 = __nested_webpack_require_980527__(1669);
219066
- const fs_extra_1 = __nested_webpack_require_980527__(5392);
219067
- const normalize_path_1 = __nested_webpack_require_980527__(6261);
219068
- const file_fs_ref_1 = __importDefault(__nested_webpack_require_980527__(9331));
219156
+ const path_1 = __importDefault(__nested_webpack_require_986644__(5622));
219157
+ const assert_1 = __importDefault(__nested_webpack_require_986644__(2357));
219158
+ const glob_1 = __importDefault(__nested_webpack_require_986644__(1104));
219159
+ const util_1 = __nested_webpack_require_986644__(1669);
219160
+ const fs_extra_1 = __nested_webpack_require_986644__(5392);
219161
+ const normalize_path_1 = __nested_webpack_require_986644__(6261);
219162
+ const file_fs_ref_1 = __importDefault(__nested_webpack_require_986644__(9331));
219069
219163
  const vanillaGlob = util_1.promisify(glob_1.default);
219070
219164
  async function glob(pattern, opts, mountpoint) {
219071
219165
  let options;
@@ -219111,7 +219205,7 @@ exports.default = glob;
219111
219205
  /***/ }),
219112
219206
 
219113
219207
  /***/ 7903:
219114
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_982723__) {
219208
+ /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_988840__) {
219115
219209
 
219116
219210
  "use strict";
219117
219211
 
@@ -219120,9 +219214,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
219120
219214
  };
219121
219215
  Object.defineProperty(exports, "__esModule", ({ value: true }));
219122
219216
  exports.getSupportedNodeVersion = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = void 0;
219123
- const semver_1 = __nested_webpack_require_982723__(2879);
219124
- const errors_1 = __nested_webpack_require_982723__(3983);
219125
- const debug_1 = __importDefault(__nested_webpack_require_982723__(1868));
219217
+ const semver_1 = __nested_webpack_require_988840__(2879);
219218
+ const errors_1 = __nested_webpack_require_988840__(3983);
219219
+ const debug_1 = __importDefault(__nested_webpack_require_988840__(1868));
219126
219220
  const allOptions = [
219127
219221
  { major: 14, range: '14.x', runtime: 'nodejs14.x' },
219128
219222
  { major: 12, range: '12.x', runtime: 'nodejs12.x' },
@@ -219216,7 +219310,7 @@ exports.normalizePath = normalizePath;
219216
219310
  /***/ }),
219217
219311
 
219218
219312
  /***/ 7792:
219219
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_986591__) {
219313
+ /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_992708__) {
219220
219314
 
219221
219315
  "use strict";
219222
219316
 
@@ -219225,9 +219319,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
219225
219319
  };
219226
219320
  Object.defineProperty(exports, "__esModule", ({ value: true }));
219227
219321
  exports.readConfigFile = void 0;
219228
- const js_yaml_1 = __importDefault(__nested_webpack_require_986591__(6540));
219229
- const toml_1 = __importDefault(__nested_webpack_require_986591__(9434));
219230
- const fs_extra_1 = __nested_webpack_require_986591__(5392);
219322
+ const js_yaml_1 = __importDefault(__nested_webpack_require_992708__(6540));
219323
+ const toml_1 = __importDefault(__nested_webpack_require_992708__(9434));
219324
+ const fs_extra_1 = __nested_webpack_require_992708__(5392);
219231
219325
  async function readFileOrNull(file) {
219232
219326
  try {
219233
219327
  const data = await fs_extra_1.readFile(file);
@@ -219282,7 +219376,7 @@ exports.default = rename;
219282
219376
  /***/ }),
219283
219377
 
219284
219378
  /***/ 1442:
219285
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_988384__) {
219379
+ /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_994501__) {
219286
219380
 
219287
219381
  "use strict";
219288
219382
 
@@ -219291,14 +219385,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
219291
219385
  };
219292
219386
  Object.defineProperty(exports, "__esModule", ({ value: true }));
219293
219387
  exports.installDependencies = exports.getScriptName = exports.runPipInstall = exports.runBundleInstall = exports.runPackageJsonScript = exports.runNpmInstall = exports.walkParentDirs = exports.scanParentDirs = exports.getNodeVersion = exports.getSpawnOptions = exports.runShellScript = exports.getNodeBinPath = exports.execCommand = exports.spawnCommand = exports.execAsync = exports.spawnAsync = void 0;
219294
- const assert_1 = __importDefault(__nested_webpack_require_988384__(2357));
219295
- const fs_extra_1 = __importDefault(__nested_webpack_require_988384__(5392));
219296
- const path_1 = __importDefault(__nested_webpack_require_988384__(5622));
219297
- const debug_1 = __importDefault(__nested_webpack_require_988384__(1868));
219298
- const cross_spawn_1 = __importDefault(__nested_webpack_require_988384__(7618));
219299
- const util_1 = __nested_webpack_require_988384__(1669);
219300
- const errors_1 = __nested_webpack_require_988384__(3983);
219301
- const node_version_1 = __nested_webpack_require_988384__(7903);
219388
+ const assert_1 = __importDefault(__nested_webpack_require_994501__(2357));
219389
+ const fs_extra_1 = __importDefault(__nested_webpack_require_994501__(5392));
219390
+ const path_1 = __importDefault(__nested_webpack_require_994501__(5622));
219391
+ const debug_1 = __importDefault(__nested_webpack_require_994501__(1868));
219392
+ const cross_spawn_1 = __importDefault(__nested_webpack_require_994501__(7618));
219393
+ const util_1 = __nested_webpack_require_994501__(1669);
219394
+ const errors_1 = __nested_webpack_require_994501__(3983);
219395
+ const node_version_1 = __nested_webpack_require_994501__(7903);
219302
219396
  function spawnAsync(command, args, opts = {}) {
219303
219397
  return new Promise((resolve, reject) => {
219304
219398
  const stderrLogs = [];
@@ -219609,7 +219703,7 @@ exports.installDependencies = util_1.deprecate(runNpmInstall, 'installDependenci
219609
219703
  /***/ }),
219610
219704
 
219611
219705
  /***/ 2560:
219612
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_1002374__) {
219706
+ /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_1008491__) {
219613
219707
 
219614
219708
  "use strict";
219615
219709
 
@@ -219617,7 +219711,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
219617
219711
  return (mod && mod.__esModule) ? mod : { "default": mod };
219618
219712
  };
219619
219713
  Object.defineProperty(exports, "__esModule", ({ value: true }));
219620
- const end_of_stream_1 = __importDefault(__nested_webpack_require_1002374__(687));
219714
+ const end_of_stream_1 = __importDefault(__nested_webpack_require_1008491__(687));
219621
219715
  function streamToBuffer(stream) {
219622
219716
  return new Promise((resolve, reject) => {
219623
219717
  const buffers = [];
@@ -219646,7 +219740,7 @@ exports.default = streamToBuffer;
219646
219740
  /***/ }),
219647
219741
 
219648
219742
  /***/ 1148:
219649
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_1003442__) {
219743
+ /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_1009559__) {
219650
219744
 
219651
219745
  "use strict";
219652
219746
 
@@ -219654,9 +219748,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
219654
219748
  return (mod && mod.__esModule) ? mod : { "default": mod };
219655
219749
  };
219656
219750
  Object.defineProperty(exports, "__esModule", ({ value: true }));
219657
- const path_1 = __importDefault(__nested_webpack_require_1003442__(5622));
219658
- const fs_extra_1 = __importDefault(__nested_webpack_require_1003442__(5392));
219659
- const ignore_1 = __importDefault(__nested_webpack_require_1003442__(3556));
219751
+ const path_1 = __importDefault(__nested_webpack_require_1009559__(5622));
219752
+ const fs_extra_1 = __importDefault(__nested_webpack_require_1009559__(5392));
219753
+ const ignore_1 = __importDefault(__nested_webpack_require_1009559__(3556));
219660
219754
  function isCodedError(error) {
219661
219755
  return (error !== null &&
219662
219756
  error !== undefined &&
@@ -219713,7 +219807,7 @@ exports.default = default_1;
219713
219807
  /***/ }),
219714
219808
 
219715
219809
  /***/ 2855:
219716
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_1005824__) {
219810
+ /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_1011941__) {
219717
219811
 
219718
219812
  "use strict";
219719
219813
 
@@ -219744,29 +219838,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
219744
219838
  };
219745
219839
  Object.defineProperty(exports, "__esModule", ({ value: true }));
219746
219840
  exports.getInputHash = exports.getPlatformEnv = exports.isStaticRuntime = exports.isOfficialRuntime = exports.updateRoutesManifest = exports.updateFunctionsManifest = exports.convertRuntimeToPlugin = exports.normalizePath = exports.readConfigFile = exports.DetectorFilesystem = exports.detectFramework = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = exports.getIgnoreFilter = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isSymbolicLink = exports.debug = exports.shouldServe = exports.streamToBuffer = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.runShellScript = exports.runPipInstall = exports.runBundleInstall = exports.runNpmInstall = exports.getNodeBinPath = exports.walkParentDirs = exports.spawnCommand = exports.execCommand = exports.runPackageJsonScript = exports.installDependencies = exports.getScriptName = exports.spawnAsync = exports.execAsync = exports.rename = exports.glob = exports.getWriteableDirectory = exports.download = exports.Prerender = exports.createLambda = exports.Lambda = exports.FileRef = exports.FileFsRef = exports.FileBlob = void 0;
219747
- const crypto_1 = __nested_webpack_require_1005824__(6417);
219748
- const file_blob_1 = __importDefault(__nested_webpack_require_1005824__(2397));
219841
+ const crypto_1 = __nested_webpack_require_1011941__(6417);
219842
+ const file_blob_1 = __importDefault(__nested_webpack_require_1011941__(2397));
219749
219843
  exports.FileBlob = file_blob_1.default;
219750
- const file_fs_ref_1 = __importDefault(__nested_webpack_require_1005824__(9331));
219844
+ const file_fs_ref_1 = __importDefault(__nested_webpack_require_1011941__(9331));
219751
219845
  exports.FileFsRef = file_fs_ref_1.default;
219752
- const file_ref_1 = __importDefault(__nested_webpack_require_1005824__(5187));
219846
+ const file_ref_1 = __importDefault(__nested_webpack_require_1011941__(5187));
219753
219847
  exports.FileRef = file_ref_1.default;
219754
- const lambda_1 = __nested_webpack_require_1005824__(6721);
219848
+ const lambda_1 = __nested_webpack_require_1011941__(6721);
219755
219849
  Object.defineProperty(exports, "Lambda", ({ enumerable: true, get: function () { return lambda_1.Lambda; } }));
219756
219850
  Object.defineProperty(exports, "createLambda", ({ enumerable: true, get: function () { return lambda_1.createLambda; } }));
219757
219851
  Object.defineProperty(exports, "getLambdaOptionsFromFunction", ({ enumerable: true, get: function () { return lambda_1.getLambdaOptionsFromFunction; } }));
219758
- const prerender_1 = __nested_webpack_require_1005824__(2850);
219852
+ const prerender_1 = __nested_webpack_require_1011941__(2850);
219759
219853
  Object.defineProperty(exports, "Prerender", ({ enumerable: true, get: function () { return prerender_1.Prerender; } }));
219760
- const download_1 = __importStar(__nested_webpack_require_1005824__(1611));
219854
+ const download_1 = __importStar(__nested_webpack_require_1011941__(1611));
219761
219855
  exports.download = download_1.default;
219762
219856
  Object.defineProperty(exports, "isSymbolicLink", ({ enumerable: true, get: function () { return download_1.isSymbolicLink; } }));
219763
- const get_writable_directory_1 = __importDefault(__nested_webpack_require_1005824__(3838));
219857
+ const get_writable_directory_1 = __importDefault(__nested_webpack_require_1011941__(3838));
219764
219858
  exports.getWriteableDirectory = get_writable_directory_1.default;
219765
- const glob_1 = __importDefault(__nested_webpack_require_1005824__(4240));
219859
+ const glob_1 = __importDefault(__nested_webpack_require_1011941__(4240));
219766
219860
  exports.glob = glob_1.default;
219767
- const rename_1 = __importDefault(__nested_webpack_require_1005824__(6718));
219861
+ const rename_1 = __importDefault(__nested_webpack_require_1011941__(6718));
219768
219862
  exports.rename = rename_1.default;
219769
- const run_user_scripts_1 = __nested_webpack_require_1005824__(1442);
219863
+ const run_user_scripts_1 = __nested_webpack_require_1011941__(1442);
219770
219864
  Object.defineProperty(exports, "execAsync", ({ enumerable: true, get: function () { return run_user_scripts_1.execAsync; } }));
219771
219865
  Object.defineProperty(exports, "spawnAsync", ({ enumerable: true, get: function () { return run_user_scripts_1.spawnAsync; } }));
219772
219866
  Object.defineProperty(exports, "execCommand", ({ enumerable: true, get: function () { return run_user_scripts_1.execCommand; } }));
@@ -219783,38 +219877,38 @@ Object.defineProperty(exports, "getNodeVersion", ({ enumerable: true, get: funct
219783
219877
  Object.defineProperty(exports, "getSpawnOptions", ({ enumerable: true, get: function () { return run_user_scripts_1.getSpawnOptions; } }));
219784
219878
  Object.defineProperty(exports, "getNodeBinPath", ({ enumerable: true, get: function () { return run_user_scripts_1.getNodeBinPath; } }));
219785
219879
  Object.defineProperty(exports, "scanParentDirs", ({ enumerable: true, get: function () { return run_user_scripts_1.scanParentDirs; } }));
219786
- const node_version_1 = __nested_webpack_require_1005824__(7903);
219880
+ const node_version_1 = __nested_webpack_require_1011941__(7903);
219787
219881
  Object.defineProperty(exports, "getLatestNodeVersion", ({ enumerable: true, get: function () { return node_version_1.getLatestNodeVersion; } }));
219788
219882
  Object.defineProperty(exports, "getDiscontinuedNodeVersions", ({ enumerable: true, get: function () { return node_version_1.getDiscontinuedNodeVersions; } }));
219789
- const errors_1 = __nested_webpack_require_1005824__(3983);
219790
- const stream_to_buffer_1 = __importDefault(__nested_webpack_require_1005824__(2560));
219883
+ const errors_1 = __nested_webpack_require_1011941__(3983);
219884
+ const stream_to_buffer_1 = __importDefault(__nested_webpack_require_1011941__(2560));
219791
219885
  exports.streamToBuffer = stream_to_buffer_1.default;
219792
- const should_serve_1 = __importDefault(__nested_webpack_require_1005824__(2564));
219886
+ const should_serve_1 = __importDefault(__nested_webpack_require_1011941__(2564));
219793
219887
  exports.shouldServe = should_serve_1.default;
219794
- const debug_1 = __importDefault(__nested_webpack_require_1005824__(1868));
219888
+ const debug_1 = __importDefault(__nested_webpack_require_1011941__(1868));
219795
219889
  exports.debug = debug_1.default;
219796
- const get_ignore_filter_1 = __importDefault(__nested_webpack_require_1005824__(1148));
219890
+ const get_ignore_filter_1 = __importDefault(__nested_webpack_require_1011941__(1148));
219797
219891
  exports.getIgnoreFilter = get_ignore_filter_1.default;
219798
- var detect_builders_1 = __nested_webpack_require_1005824__(4246);
219892
+ var detect_builders_1 = __nested_webpack_require_1011941__(4246);
219799
219893
  Object.defineProperty(exports, "detectBuilders", ({ enumerable: true, get: function () { return detect_builders_1.detectBuilders; } }));
219800
219894
  Object.defineProperty(exports, "detectOutputDirectory", ({ enumerable: true, get: function () { return detect_builders_1.detectOutputDirectory; } }));
219801
219895
  Object.defineProperty(exports, "detectApiDirectory", ({ enumerable: true, get: function () { return detect_builders_1.detectApiDirectory; } }));
219802
219896
  Object.defineProperty(exports, "detectApiExtensions", ({ enumerable: true, get: function () { return detect_builders_1.detectApiExtensions; } }));
219803
- var detect_framework_1 = __nested_webpack_require_1005824__(5224);
219897
+ var detect_framework_1 = __nested_webpack_require_1011941__(5224);
219804
219898
  Object.defineProperty(exports, "detectFramework", ({ enumerable: true, get: function () { return detect_framework_1.detectFramework; } }));
219805
- var filesystem_1 = __nested_webpack_require_1005824__(461);
219899
+ var filesystem_1 = __nested_webpack_require_1011941__(461);
219806
219900
  Object.defineProperty(exports, "DetectorFilesystem", ({ enumerable: true, get: function () { return filesystem_1.DetectorFilesystem; } }));
219807
- var read_config_file_1 = __nested_webpack_require_1005824__(7792);
219901
+ var read_config_file_1 = __nested_webpack_require_1011941__(7792);
219808
219902
  Object.defineProperty(exports, "readConfigFile", ({ enumerable: true, get: function () { return read_config_file_1.readConfigFile; } }));
219809
- var normalize_path_1 = __nested_webpack_require_1005824__(6261);
219903
+ var normalize_path_1 = __nested_webpack_require_1011941__(6261);
219810
219904
  Object.defineProperty(exports, "normalizePath", ({ enumerable: true, get: function () { return normalize_path_1.normalizePath; } }));
219811
- var convert_runtime_to_plugin_1 = __nested_webpack_require_1005824__(7276);
219905
+ var convert_runtime_to_plugin_1 = __nested_webpack_require_1011941__(7276);
219812
219906
  Object.defineProperty(exports, "convertRuntimeToPlugin", ({ enumerable: true, get: function () { return convert_runtime_to_plugin_1.convertRuntimeToPlugin; } }));
219813
219907
  Object.defineProperty(exports, "updateFunctionsManifest", ({ enumerable: true, get: function () { return convert_runtime_to_plugin_1.updateFunctionsManifest; } }));
219814
219908
  Object.defineProperty(exports, "updateRoutesManifest", ({ enumerable: true, get: function () { return convert_runtime_to_plugin_1.updateRoutesManifest; } }));
219815
- __exportStar(__nested_webpack_require_1005824__(2416), exports);
219816
- __exportStar(__nested_webpack_require_1005824__(5748), exports);
219817
- __exportStar(__nested_webpack_require_1005824__(3983), exports);
219909
+ __exportStar(__nested_webpack_require_1011941__(2416), exports);
219910
+ __exportStar(__nested_webpack_require_1011941__(5748), exports);
219911
+ __exportStar(__nested_webpack_require_1011941__(3983), exports);
219818
219912
  /**
219819
219913
  * Helper function to support both `@vercel` and legacy `@now` official Runtimes.
219820
219914
  */
@@ -219867,7 +219961,7 @@ exports.getInputHash = getInputHash;
219867
219961
  /***/ }),
219868
219962
 
219869
219963
  /***/ 6721:
219870
- /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_1016802__) {
219964
+ /***/ (function(__unused_webpack_module, exports, __nested_webpack_require_1022919__) {
219871
219965
 
219872
219966
  "use strict";
219873
219967
 
@@ -219876,13 +219970,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
219876
219970
  };
219877
219971
  Object.defineProperty(exports, "__esModule", ({ value: true }));
219878
219972
  exports.getLambdaOptionsFromFunction = exports.createZip = exports.createLambda = exports.Lambda = exports.FILES_SYMBOL = void 0;
219879
- const assert_1 = __importDefault(__nested_webpack_require_1016802__(2357));
219880
- const async_sema_1 = __importDefault(__nested_webpack_require_1016802__(5758));
219881
- const yazl_1 = __nested_webpack_require_1016802__(1223);
219882
- const minimatch_1 = __importDefault(__nested_webpack_require_1016802__(9566));
219883
- const fs_extra_1 = __nested_webpack_require_1016802__(5392);
219884
- const download_1 = __nested_webpack_require_1016802__(1611);
219885
- const stream_to_buffer_1 = __importDefault(__nested_webpack_require_1016802__(2560));
219973
+ const assert_1 = __importDefault(__nested_webpack_require_1022919__(2357));
219974
+ const async_sema_1 = __importDefault(__nested_webpack_require_1022919__(5758));
219975
+ const yazl_1 = __nested_webpack_require_1022919__(1223);
219976
+ const minimatch_1 = __importDefault(__nested_webpack_require_1022919__(9566));
219977
+ const fs_extra_1 = __nested_webpack_require_1022919__(5392);
219978
+ const download_1 = __nested_webpack_require_1022919__(1611);
219979
+ const stream_to_buffer_1 = __importDefault(__nested_webpack_require_1022919__(2560));
219886
219980
  exports.FILES_SYMBOL = Symbol('files');
219887
219981
  class Lambda {
219888
219982
  constructor({ zipBuffer, handler, runtime, maxDuration, memory, environment, allowQuery, regions, }) {
@@ -220111,12 +220205,12 @@ exports.buildsSchema = {
220111
220205
  /***/ }),
220112
220206
 
220113
220207
  /***/ 2564:
220114
- /***/ ((__unused_webpack_module, exports, __nested_webpack_require_1025312__) => {
220208
+ /***/ ((__unused_webpack_module, exports, __nested_webpack_require_1031429__) => {
220115
220209
 
220116
220210
  "use strict";
220117
220211
 
220118
220212
  Object.defineProperty(exports, "__esModule", ({ value: true }));
220119
- const path_1 = __nested_webpack_require_1025312__(5622);
220213
+ const path_1 = __nested_webpack_require_1031429__(5622);
220120
220214
  function shouldServe({ entrypoint, files, requestPath, }) {
220121
220215
  requestPath = requestPath.replace(/\/$/, ''); // sanitize trailing '/'
220122
220216
  entrypoint = entrypoint.replace(/\\/, '/'); // windows compatibility
@@ -220353,7 +220447,7 @@ module.exports = __webpack_require__(78761);
220353
220447
  /******/ var __webpack_module_cache__ = {};
220354
220448
  /******/
220355
220449
  /******/ // The require function
220356
- /******/ function __nested_webpack_require_1125047__(moduleId) {
220450
+ /******/ function __nested_webpack_require_1131164__(moduleId) {
220357
220451
  /******/ // Check if module is in cache
220358
220452
  /******/ if(__webpack_module_cache__[moduleId]) {
220359
220453
  /******/ return __webpack_module_cache__[moduleId].exports;
@@ -220368,7 +220462,7 @@ module.exports = __webpack_require__(78761);
220368
220462
  /******/ // Execute the module function
220369
220463
  /******/ var threw = true;
220370
220464
  /******/ try {
220371
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_1125047__);
220465
+ /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_1131164__);
220372
220466
  /******/ threw = false;
220373
220467
  /******/ } finally {
220374
220468
  /******/ if(threw) delete __webpack_module_cache__[moduleId];
@@ -220381,11 +220475,11 @@ module.exports = __webpack_require__(78761);
220381
220475
  /************************************************************************/
220382
220476
  /******/ /* webpack/runtime/compat */
220383
220477
  /******/
220384
- /******/ __nested_webpack_require_1125047__.ab = __dirname + "/";/************************************************************************/
220478
+ /******/ __nested_webpack_require_1131164__.ab = __dirname + "/";/************************************************************************/
220385
220479
  /******/ // module exports must be returned from runtime so entry inlining is disabled
220386
220480
  /******/ // startup
220387
220481
  /******/ // Load entry module and return exports
220388
- /******/ return __nested_webpack_require_1125047__(2855);
220482
+ /******/ return __nested_webpack_require_1131164__(2855);
220389
220483
  /******/ })()
220390
220484
  ;
220391
220485
 
@@ -250604,8 +250698,12 @@ async function main(client) {
250604
250698
  // We cannot rely on the `framework` alone, as it might be a static export,
250605
250699
  // and the current build might use a differnt project that's not in the settings.
250606
250700
  const isNextOutput = Boolean(dotNextDir);
250607
- const outputDir = isNextOutput ? OUTPUT_DIR : path_1.join(OUTPUT_DIR, 'static');
250608
- const distDir = dotNextDir ||
250701
+ const nextExport = await getNextExportStatus(dotNextDir);
250702
+ const outputDir = isNextOutput && !nextExport ? OUTPUT_DIR : path_1.join(OUTPUT_DIR, 'static');
250703
+ const distDir = ((nextExport === null || nextExport === void 0 ? void 0 : nextExport.exportDetail.outDirectory)
250704
+ ? path_1.relative(cwd, nextExport.exportDetail.outDirectory)
250705
+ : false) ||
250706
+ dotNextDir ||
250609
250707
  userOutputDirectory ||
250610
250708
  (await framework.getFsOutputDir(cwd));
250611
250709
  await fs_extra_1.default.ensureDir(path_1.join(cwd, outputDir));
@@ -250663,7 +250761,38 @@ async function main(client) {
250663
250761
  await fs_extra_1.default.writeJSON(path_1.join(cwd, OUTPUT_DIR, 'routes-manifest.json'), routesManifest, { spaces: 2 });
250664
250762
  }
250665
250763
  // Special Next.js processing.
250666
- if (isNextOutput) {
250764
+ if (nextExport) {
250765
+ client.output.debug('Found `next export` output.');
250766
+ const htmlFiles = await build_utils_1.glob('**/*.html', path_1.join(cwd, OUTPUT_DIR, 'static'));
250767
+ if (nextExport.exportDetail.success !== true) {
250768
+ client.output.error(`Export of Next.js app failed. Please check your build logs.`);
250769
+ process.exit(1);
250770
+ }
250771
+ await fs_extra_1.default.mkdirp(path_1.join(cwd, OUTPUT_DIR, 'server', 'pages'));
250772
+ await fs_extra_1.default.mkdirp(path_1.join(cwd, OUTPUT_DIR, 'static'));
250773
+ await Promise.all(Object.keys(htmlFiles).map(async (fileName) => {
250774
+ await sema.acquire();
250775
+ const input = path_1.join(cwd, OUTPUT_DIR, 'static', fileName);
250776
+ const target = path_1.join(cwd, OUTPUT_DIR, 'server', 'pages', fileName);
250777
+ await fs_extra_1.default.mkdirp(path_1.dirname(target));
250778
+ await fs_extra_1.default.promises.rename(input, target).finally(() => {
250779
+ sema.release();
250780
+ });
250781
+ }));
250782
+ for (const file of [
250783
+ 'BUILD_ID',
250784
+ 'images-manifest.json',
250785
+ 'routes-manifest.json',
250786
+ 'build-manifest.json',
250787
+ ]) {
250788
+ const input = path_1.join(nextExport.dotNextDir, file);
250789
+ if (fs_extra_1.default.existsSync(input)) {
250790
+ // Do not use `smartCopy`, since we want to overwrite if they already exist.
250791
+ await fs_extra_1.default.copyFile(input, path_1.join(OUTPUT_DIR, file));
250792
+ }
250793
+ }
250794
+ }
250795
+ else if (isNextOutput) {
250667
250796
  // The contents of `.output/static` should be placed inside of `.output/static/_next/static`
250668
250797
  const tempStatic = '___static';
250669
250798
  await fs_extra_1.default.rename(path_1.join(cwd, OUTPUT_DIR, 'static'), path_1.join(cwd, OUTPUT_DIR, tempStatic));
@@ -250979,6 +251108,42 @@ async function resolveNftToOutput({ client, baseDir, outputDir, nftFileName, dis
250979
251108
  files: newFilesList,
250980
251109
  });
250981
251110
  }
251111
+ /**
251112
+ * Files will only exist when `next export` was used.
251113
+ */
251114
+ async function getNextExportStatus(dotNextDir) {
251115
+ if (!dotNextDir) {
251116
+ return null;
251117
+ }
251118
+ const exportDetail = await fs_extra_1.default
251119
+ .readJson(path_1.join(dotNextDir, 'export-detail.json'))
251120
+ .catch(error => {
251121
+ if (error.code === 'ENOENT') {
251122
+ return null;
251123
+ }
251124
+ throw error;
251125
+ });
251126
+ if (!exportDetail) {
251127
+ return null;
251128
+ }
251129
+ const exportMarker = await fs_extra_1.default
251130
+ .readJSON(path_1.join(dotNextDir, 'export-marker.json'))
251131
+ .catch(error => {
251132
+ if (error.code === 'ENOENT') {
251133
+ return null;
251134
+ }
251135
+ throw error;
251136
+ });
251137
+ return {
251138
+ dotNextDir,
251139
+ exportDetail,
251140
+ exportMarker: {
251141
+ trailingSlash: (exportMarker === null || exportMarker === void 0 ? void 0 : exportMarker.hasExportPathMap)
251142
+ ? exportMarker.exportTrailingSlash
251143
+ : false,
251144
+ },
251145
+ };
251146
+ }
250982
251147
 
250983
251148
 
250984
251149
  /***/ }),
@@ -271146,7 +271311,7 @@ module.exports = JSON.parse("[\"ac\",\"com.ac\",\"edu.ac\",\"gov.ac\",\"net.ac\"
271146
271311
  /***/ ((module) => {
271147
271312
 
271148
271313
  "use strict";
271149
- module.exports = JSON.parse("{\"name\":\"vercel\",\"version\":\"23.1.3-canary.52\",\"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\",\"test-unit\":\"jest --coverage --verbose\",\"test-integration-cli\":\"rimraf test/fixtures/integration && ava test/integration.js --serial --fail-fast --verbose\",\"test-integration-dev\":\"ava test/dev/integration.js --serial --fail-fast --verbose\",\"prepublishOnly\":\"yarn build\",\"coverage\":\"codecov\",\"build\":\"node -r ts-eager/register ./scripts/build.ts\",\"build-dev\":\"node -r ts-eager/register ./scripts/build.ts --dev\"},\"bin\":{\"vc\":\"./dist/index.js\",\"vercel\":\"./dist/index.js\"},\"files\":[\"dist\",\"scripts/preinstall.js\"],\"ava\":{\"compileEnhancements\":false,\"extensions\":[\"ts\"],\"require\":[\"ts-node/register/transpile-only\",\"esm\"]},\"engines\":{\"node\":\">= 12\"},\"dependencies\":{\"@vercel/build-utils\":\"2.12.3-canary.31\",\"@vercel/go\":\"1.2.4-canary.4\",\"@vercel/node\":\"1.12.2-canary.7\",\"@vercel/python\":\"2.1.2-canary.1\",\"@vercel/ruby\":\"1.2.8-canary.6\",\"update-notifier\":\"4.1.0\",\"vercel-plugin-middleware\":\"0.0.0-canary.7\",\"vercel-plugin-node\":\"1.12.2-canary.23\"},\"devDependencies\":{\"@next/env\":\"11.1.2\",\"@sentry/node\":\"5.5.0\",\"@sindresorhus/slugify\":\"0.11.0\",\"@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/inquirer\":\"7.3.1\",\"@types/jest\":\"27.0.1\",\"@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\":\"11.11.0\",\"@types/node-fetch\":\"2.5.10\",\"@types/npm-package-arg\":\"6.1.0\",\"@types/pluralize\":\"0.0.29\",\"@types/progress\":\"2.0.3\",\"@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\",\"@vercel/frameworks\":\"0.5.1-canary.16\",\"@vercel/ncc\":\"0.24.0\",\"@vercel/nft\":\"0.17.0\",\"@zeit/fun\":\"0.11.2\",\"@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\",\"bytes\":\"3.0.0\",\"chalk\":\"4.1.0\",\"chance\":\"1.1.7\",\"chokidar\":\"3.3.1\",\"clipboardy\":\"2.1.0\",\"codecov\":\"3.8.2\",\"cpy\":\"7.2.0\",\"credit-card\":\"3.0.1\",\"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\",\"glob\":\"7.1.2\",\"http-proxy\":\"1.18.1\",\"inquirer\":\"7.0.4\",\"is-docker\":\"2.2.1\",\"is-port-reachable\":\"3.0.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.1\",\"npm-package-arg\":\"6.1.0\",\"open\":\"8.2.0\",\"ora\":\"3.4.0\",\"pcre-to-regexp\":\"1.0.0\",\"pluralize\":\"7.0.0\",\"progress\":\"2.0.3\",\"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-eager\":\"2.0.2\",\"ts-node\":\"8.3.0\",\"typescript\":\"4.3.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\"},\"jest\":{\"preset\":\"ts-jest\",\"globals\":{\"ts-jest\":{\"diagnostics\":false,\"isolatedModules\":true}},\"verbose\":false,\"testEnvironment\":\"node\",\"testMatch\":[\"<rootDir>/test/**/*.test.ts\"]},\"gitHead\":\"6f4a1b527ba01973490e1fb2e4c48ccb2841cd86\"}");
271314
+ module.exports = JSON.parse("{\"name\":\"vercel\",\"version\":\"23.1.3-canary.56\",\"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\",\"test-unit\":\"jest --coverage --verbose\",\"test-integration-cli\":\"rimraf test/fixtures/integration && ava test/integration.js --serial --fail-fast --verbose\",\"test-integration-dev\":\"ava test/dev/integration.js --serial --fail-fast --verbose\",\"prepublishOnly\":\"yarn build\",\"coverage\":\"codecov\",\"build\":\"node -r ts-eager/register ./scripts/build.ts\",\"build-dev\":\"node -r ts-eager/register ./scripts/build.ts --dev\"},\"bin\":{\"vc\":\"./dist/index.js\",\"vercel\":\"./dist/index.js\"},\"files\":[\"dist\",\"scripts/preinstall.js\"],\"ava\":{\"compileEnhancements\":false,\"extensions\":[\"ts\"],\"require\":[\"ts-node/register/transpile-only\",\"esm\"]},\"engines\":{\"node\":\">= 12\"},\"dependencies\":{\"@vercel/build-utils\":\"2.12.3-canary.34\",\"@vercel/go\":\"1.2.4-canary.4\",\"@vercel/node\":\"1.12.2-canary.7\",\"@vercel/python\":\"2.1.2-canary.1\",\"@vercel/ruby\":\"1.2.8-canary.6\",\"update-notifier\":\"4.1.0\",\"vercel-plugin-middleware\":\"0.0.0-canary.10\",\"vercel-plugin-node\":\"1.12.2-canary.26\"},\"devDependencies\":{\"@next/env\":\"11.1.2\",\"@sentry/node\":\"5.5.0\",\"@sindresorhus/slugify\":\"0.11.0\",\"@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/inquirer\":\"7.3.1\",\"@types/jest\":\"27.0.1\",\"@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\":\"11.11.0\",\"@types/node-fetch\":\"2.5.10\",\"@types/npm-package-arg\":\"6.1.0\",\"@types/pluralize\":\"0.0.29\",\"@types/progress\":\"2.0.3\",\"@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\",\"@vercel/frameworks\":\"0.5.1-canary.16\",\"@vercel/ncc\":\"0.24.0\",\"@vercel/nft\":\"0.17.0\",\"@zeit/fun\":\"0.11.2\",\"@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\",\"bytes\":\"3.0.0\",\"chalk\":\"4.1.0\",\"chance\":\"1.1.7\",\"chokidar\":\"3.3.1\",\"clipboardy\":\"2.1.0\",\"codecov\":\"3.8.2\",\"cpy\":\"7.2.0\",\"credit-card\":\"3.0.1\",\"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\",\"glob\":\"7.1.2\",\"http-proxy\":\"1.18.1\",\"inquirer\":\"7.0.4\",\"is-docker\":\"2.2.1\",\"is-port-reachable\":\"3.0.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.1\",\"npm-package-arg\":\"6.1.0\",\"open\":\"8.2.0\",\"ora\":\"3.4.0\",\"pcre-to-regexp\":\"1.0.0\",\"pluralize\":\"7.0.0\",\"progress\":\"2.0.3\",\"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-eager\":\"2.0.2\",\"ts-node\":\"8.3.0\",\"typescript\":\"4.3.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\"},\"jest\":{\"preset\":\"ts-jest\",\"globals\":{\"ts-jest\":{\"diagnostics\":false,\"isolatedModules\":true}},\"verbose\":false,\"testEnvironment\":\"node\",\"testMatch\":[\"<rootDir>/test/**/*.test.ts\"]},\"gitHead\":\"34f4222ca2d3cc5134469daa355a7f67c2054c9b\"}");
271150
271315
 
271151
271316
  /***/ }),
271152
271317
 
@@ -271162,7 +271327,7 @@ module.exports = JSON.parse("{\"VISA\":\"Visa\",\"MASTERCARD\":\"MasterCard\",\"
271162
271327
  /***/ ((module) => {
271163
271328
 
271164
271329
  "use strict";
271165
- module.exports = JSON.parse("{\"name\":\"@vercel/client\",\"version\":\"10.2.3-canary.32\",\"main\":\"dist/index.js\",\"typings\":\"dist/index.d.ts\",\"homepage\":\"https://vercel.com\",\"license\":\"MIT\",\"files\":[\"dist\"],\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/vercel/vercel.git\",\"directory\":\"packages/client\"},\"scripts\":{\"build\":\"tsc\",\"test-integration-once\":\"jest --verbose --runInBand --bail tests/create-deployment.test.ts tests/create-legacy-deployment.test.ts tests/paths.test.ts\",\"test-unit\":\"jest --verbose --runInBand --bail tests/unit.*test.*\"},\"engines\":{\"node\":\">= 12\"},\"devDependencies\":{\"@types/async-retry\":\"1.4.1\",\"@types/fs-extra\":\"7.0.0\",\"@types/jest\":\"27.0.1\",\"@types/ms\":\"0.7.30\",\"@types/node\":\"12.0.4\",\"@types/node-fetch\":\"2.5.4\",\"@types/recursive-readdir\":\"2.2.0\",\"typescript\":\"4.3.4\"},\"jest\":{\"preset\":\"ts-jest\",\"testEnvironment\":\"node\",\"verbose\":false,\"setupFilesAfterEnv\":[\"<rootDir>/tests/setup/index.ts\"]},\"dependencies\":{\"@vercel/build-utils\":\"2.12.3-canary.31\",\"@zeit/fetch\":\"5.2.0\",\"async-retry\":\"1.2.3\",\"async-sema\":\"3.0.0\",\"fs-extra\":\"8.0.1\",\"ignore\":\"4.0.6\",\"ms\":\"2.1.2\",\"node-fetch\":\"2.6.1\",\"querystring\":\"^0.2.0\",\"recursive-readdir\":\"2.2.2\",\"sleep-promise\":\"8.0.1\"},\"gitHead\":\"6f4a1b527ba01973490e1fb2e4c48ccb2841cd86\"}");
271330
+ module.exports = JSON.parse("{\"name\":\"@vercel/client\",\"version\":\"10.2.3-canary.35\",\"main\":\"dist/index.js\",\"typings\":\"dist/index.d.ts\",\"homepage\":\"https://vercel.com\",\"license\":\"MIT\",\"files\":[\"dist\"],\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/vercel/vercel.git\",\"directory\":\"packages/client\"},\"scripts\":{\"build\":\"tsc\",\"test-integration-once\":\"jest --verbose --runInBand --bail tests/create-deployment.test.ts tests/create-legacy-deployment.test.ts tests/paths.test.ts\",\"test-unit\":\"jest --verbose --runInBand --bail tests/unit.*test.*\"},\"engines\":{\"node\":\">= 12\"},\"devDependencies\":{\"@types/async-retry\":\"1.4.1\",\"@types/fs-extra\":\"7.0.0\",\"@types/jest\":\"27.0.1\",\"@types/ms\":\"0.7.30\",\"@types/node\":\"12.0.4\",\"@types/node-fetch\":\"2.5.4\",\"@types/recursive-readdir\":\"2.2.0\",\"typescript\":\"4.3.4\"},\"jest\":{\"preset\":\"ts-jest\",\"testEnvironment\":\"node\",\"verbose\":false,\"setupFilesAfterEnv\":[\"<rootDir>/tests/setup/index.ts\"]},\"dependencies\":{\"@vercel/build-utils\":\"2.12.3-canary.34\",\"@zeit/fetch\":\"5.2.0\",\"async-retry\":\"1.2.3\",\"async-sema\":\"3.0.0\",\"fs-extra\":\"8.0.1\",\"ignore\":\"4.0.6\",\"ms\":\"2.1.2\",\"node-fetch\":\"2.6.1\",\"querystring\":\"^0.2.0\",\"recursive-readdir\":\"2.2.2\",\"sleep-promise\":\"8.0.1\"},\"gitHead\":\"34f4222ca2d3cc5134469daa355a7f67c2054c9b\"}");
271166
271331
 
271167
271332
  /***/ }),
271168
271333
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "23.1.3-canary.52",
3
+ "version": "23.1.3-canary.56",
4
4
  "preferGlobal": true,
5
5
  "license": "Apache-2.0",
6
6
  "description": "The command-line interface for Vercel",
@@ -43,14 +43,14 @@
43
43
  "node": ">= 12"
44
44
  },
45
45
  "dependencies": {
46
- "@vercel/build-utils": "2.12.3-canary.31",
46
+ "@vercel/build-utils": "2.12.3-canary.34",
47
47
  "@vercel/go": "1.2.4-canary.4",
48
48
  "@vercel/node": "1.12.2-canary.7",
49
49
  "@vercel/python": "2.1.2-canary.1",
50
50
  "@vercel/ruby": "1.2.8-canary.6",
51
51
  "update-notifier": "4.1.0",
52
- "vercel-plugin-middleware": "0.0.0-canary.7",
53
- "vercel-plugin-node": "1.12.2-canary.23"
52
+ "vercel-plugin-middleware": "0.0.0-canary.10",
53
+ "vercel-plugin-node": "1.12.2-canary.26"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@next/env": "11.1.2",
@@ -184,5 +184,5 @@
184
184
  "<rootDir>/test/**/*.test.ts"
185
185
  ]
186
186
  },
187
- "gitHead": "6f4a1b527ba01973490e1fb2e4c48ccb2841cd86"
187
+ "gitHead": "34f4222ca2d3cc5134469daa355a7f67c2054c9b"
188
188
  }