@vercel/next 3.3.2 → 3.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EDGE_FUNCTION_SIZE_LIMIT = void 0;
4
- const KIB = 1024;
5
- const MIB = 1024 * KIB;
4
+ const utils_1 = require("../utils");
6
5
  /**
7
6
  * The maximum size of a *compressed* edge function.
8
7
  */
9
- exports.EDGE_FUNCTION_SIZE_LIMIT = 4 * MIB;
8
+ exports.EDGE_FUNCTION_SIZE_LIMIT = 4 * utils_1.MIB;
package/dist/index.js CHANGED
@@ -43565,18 +43565,17 @@ exports.default = createServerlessConfig;
43565
43565
  /***/ }),
43566
43566
 
43567
43567
  /***/ 6974:
43568
- /***/ ((__unused_webpack_module, exports) => {
43568
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
43569
43569
 
43570
43570
  "use strict";
43571
43571
 
43572
43572
  Object.defineProperty(exports, "__esModule", ({ value: true }));
43573
43573
  exports.EDGE_FUNCTION_SIZE_LIMIT = void 0;
43574
- const KIB = 1024;
43575
- const MIB = 1024 * KIB;
43574
+ const utils_1 = __webpack_require__(4411);
43576
43575
  /**
43577
43576
  * The maximum size of a *compressed* edge function.
43578
43577
  */
43579
- exports.EDGE_FUNCTION_SIZE_LIMIT = 4 * MIB;
43578
+ exports.EDGE_FUNCTION_SIZE_LIMIT = 4 * utils_1.MIB;
43580
43579
 
43581
43580
 
43582
43581
  /***/ }),
@@ -43779,7 +43778,7 @@ const build = async ({ files, workPath, repoRootPath, entrypoint, config = {}, m
43779
43778
  (0, utils_1.validateEntrypoint)(entrypoint);
43780
43779
  // Limit for max size each lambda can be, 50 MB if no custom limit
43781
43780
  const lambdaCompressedByteLimit = (config.maxLambdaSize ||
43782
- 50 * 1000 * 1000);
43781
+ 50 * utils_1.MIB);
43783
43782
  let entryDirectory = path_1.default.dirname(entrypoint);
43784
43783
  let entryPath = path_1.default.join(workPath, entryDirectory);
43785
43784
  // allow testing root directory setting with vercel.json
@@ -47174,7 +47173,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
47174
47173
  return (mod && mod.__esModule) ? mod : { "default": mod };
47175
47174
  };
47176
47175
  Object.defineProperty(exports, "__esModule", ({ value: true }));
47177
- exports.upgradeMiddlewareManifest = exports.getMiddlewareManifest = exports.getMiddlewareBundle = exports.getSourceFilePathFromPage = exports.isDynamicRoute = exports.normalizePage = exports.getNextConfig = exports.normalizePackageJson = exports.validateEntrypoint = exports.excludeFiles = exports.getPrivateOutputs = exports.updateRouteSrc = exports.getNextServerPath = exports.normalizeIndexOutput = exports.getStaticFiles = exports.onPrerenderRoute = exports.onPrerenderRouteInitial = exports.detectLambdaLimitExceeding = exports.outputFunctionFileSizeInfo = exports.getPageLambdaGroups = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = exports.addLocaleOrDefault = exports.normalizeLocalePath = exports.getPrerenderManifest = exports.getRequiredServerFilesManifest = exports.getExportStatus = exports.getExportIntent = exports.createLambdaFromPseudoLayers = exports.createPseudoLayer = exports.ExperimentalTraceVersion = exports.collectTracedFiles = exports.getFilesMapFromReasons = exports.filterStaticPages = exports.getImagesManifest = exports.localizeDynamicRoutes = exports.getDynamicRoutes = exports.getRoutesManifest = exports.prettyBytes = void 0;
47176
+ exports.upgradeMiddlewareManifest = exports.getMiddlewareManifest = exports.getMiddlewareBundle = exports.getSourceFilePathFromPage = exports.isDynamicRoute = exports.normalizePage = exports.getNextConfig = exports.normalizePackageJson = exports.validateEntrypoint = exports.excludeFiles = exports.getPrivateOutputs = exports.updateRouteSrc = exports.getNextServerPath = exports.normalizeIndexOutput = exports.getStaticFiles = exports.onPrerenderRoute = exports.onPrerenderRouteInitial = exports.detectLambdaLimitExceeding = exports.outputFunctionFileSizeInfo = exports.getPageLambdaGroups = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = exports.addLocaleOrDefault = exports.normalizeLocalePath = exports.getPrerenderManifest = exports.getRequiredServerFilesManifest = exports.getExportStatus = exports.getExportIntent = exports.createLambdaFromPseudoLayers = exports.createPseudoLayer = exports.ExperimentalTraceVersion = exports.collectTracedFiles = exports.getFilesMapFromReasons = exports.filterStaticPages = exports.getImagesManifest = exports.localizeDynamicRoutes = exports.getDynamicRoutes = exports.getRoutesManifest = exports.prettyBytes = exports.MIB = exports.KIB = void 0;
47178
47177
  const build_utils_1 = __webpack_require__(3445);
47179
47178
  const async_sema_1 = __webpack_require__(7916);
47180
47179
  const buffer_crc32_1 = __importDefault(__webpack_require__(360));
@@ -47187,12 +47186,13 @@ const url_1 = __importDefault(__webpack_require__(8835));
47187
47186
  const escape_string_regexp_1 = __importDefault(__webpack_require__(1426));
47188
47187
  const _1 = __webpack_require__(2855);
47189
47188
  const text_table_1 = __importDefault(__webpack_require__(3221));
47190
- const pretty_bytes_1 = __importDefault(__webpack_require__(539));
47191
47189
  const get_edge_function_source_1 = __webpack_require__(8055);
47192
47190
  const sourcemapped_1 = __webpack_require__(9239);
47193
47191
  const bytes_1 = __importDefault(__webpack_require__(1446));
47194
- const _prettyBytes = (n) => (0, bytes_1.default)(n, { unitSeparator: ' ' });
47195
- exports.prettyBytes = _prettyBytes;
47192
+ exports.KIB = 1024;
47193
+ exports.MIB = 1024 * exports.KIB;
47194
+ const prettyBytes = (n) => (0, bytes_1.default)(n, { unitSeparator: ' ' });
47195
+ exports.prettyBytes = prettyBytes;
47196
47196
  // Identify /[param]/ in route string
47197
47197
  // eslint-disable-next-line no-useless-escape
47198
47198
  const TEST_DYNAMIC_ROUTE = /\/\[[^\/]+?\](?=\/|$)/;
@@ -47940,9 +47940,9 @@ function addLocaleOrDefault(pathname, routesManifest, locale) {
47940
47940
  : pathname;
47941
47941
  }
47942
47942
  exports.addLocaleOrDefault = addLocaleOrDefault;
47943
- exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = 250 * 1000 * 1000; // 250MB
47944
- const LAMBDA_RESERVED_UNCOMPRESSED_SIZE = 2.5 * 1000 * 1000; // 2.5MB
47945
- const LAMBDA_RESERVED_COMPRESSED_SIZE = 250 * 1000; // 250KB
47943
+ exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = 250 * exports.MIB;
47944
+ const LAMBDA_RESERVED_UNCOMPRESSED_SIZE = 2.5 * exports.MIB;
47945
+ const LAMBDA_RESERVED_COMPRESSED_SIZE = 250 * exports.KIB;
47946
47946
  async function getPageLambdaGroups({ entryPath, config, pages, prerenderRoutes, pageTraces, compressedPages, tracedPseudoLayer, initialPseudoLayer, initialPseudoLayerUncompressed, lambdaCompressedByteLimit, internalPages, pageExtensions, }) {
47947
47947
  const groups = [];
47948
47948
  for (const page of pages) {
@@ -48070,14 +48070,14 @@ const outputFunctionFileSizeInfo = (pages, pseudoLayer, pseudoLayerBytes, pseudo
48070
48070
  })
48071
48071
  .forEach(depKey => {
48072
48072
  const dep = dependencies[depKey];
48073
- if (dep.compressed < 100 * 1000 && dep.uncompressed < 500 * 1000) {
48073
+ if (dep.compressed < 100 * exports.KIB && dep.uncompressed < 500 * exports.KIB) {
48074
48074
  // ignore smaller dependencies to reduce noise
48075
48075
  return;
48076
48076
  }
48077
48077
  exceededLimitOutput.push([
48078
48078
  depKey,
48079
- (0, pretty_bytes_1.default)(dep.uncompressed),
48080
- (0, pretty_bytes_1.default)(dep.compressed),
48079
+ (0, exports.prettyBytes)(dep.uncompressed),
48080
+ (0, exports.prettyBytes)(dep.compressed),
48081
48081
  ]);
48082
48082
  numLargeDependencies += 1;
48083
48083
  });
@@ -48089,8 +48089,8 @@ const outputFunctionFileSizeInfo = (pages, pseudoLayer, pseudoLayerBytes, pseudo
48089
48089
  exceededLimitOutput.push([]);
48090
48090
  exceededLimitOutput.push([
48091
48091
  'All dependencies',
48092
- (0, pretty_bytes_1.default)(pseudoLayerUncompressedBytes),
48093
- (0, pretty_bytes_1.default)(pseudoLayerBytes),
48092
+ (0, exports.prettyBytes)(pseudoLayerUncompressedBytes),
48093
+ (0, exports.prettyBytes)(pseudoLayerBytes),
48094
48094
  ]);
48095
48095
  console.log((0, text_table_1.default)(exceededLimitOutput, {
48096
48096
  align: ['l', 'r', 'r'],
@@ -48099,8 +48099,8 @@ const outputFunctionFileSizeInfo = (pages, pseudoLayer, pseudoLayerBytes, pseudo
48099
48099
  exports.outputFunctionFileSizeInfo = outputFunctionFileSizeInfo;
48100
48100
  const detectLambdaLimitExceeding = async (lambdaGroups, compressedSizeLimit, compressedPages) => {
48101
48101
  // show debug info if within 5 MB of exceeding the limit
48102
- const COMPRESSED_SIZE_LIMIT_CLOSE = compressedSizeLimit - 5 * 1000 * 1000;
48103
- const UNCOMPRESSED_SIZE_LIMIT_CLOSE = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE - 5 * 1000 * 1000;
48102
+ const COMPRESSED_SIZE_LIMIT_CLOSE = compressedSizeLimit - 5 * exports.MIB;
48103
+ const UNCOMPRESSED_SIZE_LIMIT_CLOSE = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE - 5 * exports.MIB;
48104
48104
  let numExceededLimit = 0;
48105
48105
  let numCloseToLimit = 0;
48106
48106
  let loggedHeadInfo = false;
@@ -48127,7 +48127,7 @@ const detectLambdaLimitExceeding = async (lambdaGroups, compressedSizeLimit, com
48127
48127
  for (const group of filteredGroups) {
48128
48128
  if (!loggedHeadInfo) {
48129
48129
  if (numExceededLimit || numCloseToLimit) {
48130
- console.log(`Warning: Max serverless function size of ${(0, pretty_bytes_1.default)(compressedSizeLimit)} compressed or ${(0, pretty_bytes_1.default)(exports.MAX_UNCOMPRESSED_LAMBDA_SIZE)} uncompressed${numExceededLimit ? '' : ' almost'} reached`);
48130
+ console.log(`Warning: Max serverless function size of ${(0, exports.prettyBytes)(compressedSizeLimit)} compressed or ${(0, exports.prettyBytes)(exports.MAX_UNCOMPRESSED_LAMBDA_SIZE)} uncompressed${numExceededLimit ? '' : ' almost'} reached`);
48131
48131
  }
48132
48132
  else {
48133
48133
  console.log(`Serverless function size info`);
package/dist/utils.js CHANGED
@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.upgradeMiddlewareManifest = exports.getMiddlewareManifest = exports.getMiddlewareBundle = exports.getSourceFilePathFromPage = exports.isDynamicRoute = exports.normalizePage = exports.getNextConfig = exports.normalizePackageJson = exports.validateEntrypoint = exports.excludeFiles = exports.getPrivateOutputs = exports.updateRouteSrc = exports.getNextServerPath = exports.normalizeIndexOutput = exports.getStaticFiles = exports.onPrerenderRoute = exports.onPrerenderRouteInitial = exports.detectLambdaLimitExceeding = exports.outputFunctionFileSizeInfo = exports.getPageLambdaGroups = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = exports.addLocaleOrDefault = exports.normalizeLocalePath = exports.getPrerenderManifest = exports.getRequiredServerFilesManifest = exports.getExportStatus = exports.getExportIntent = exports.createLambdaFromPseudoLayers = exports.createPseudoLayer = exports.ExperimentalTraceVersion = exports.collectTracedFiles = exports.getFilesMapFromReasons = exports.filterStaticPages = exports.getImagesManifest = exports.localizeDynamicRoutes = exports.getDynamicRoutes = exports.getRoutesManifest = exports.prettyBytes = void 0;
25
+ exports.upgradeMiddlewareManifest = exports.getMiddlewareManifest = exports.getMiddlewareBundle = exports.getSourceFilePathFromPage = exports.isDynamicRoute = exports.normalizePage = exports.getNextConfig = exports.normalizePackageJson = exports.validateEntrypoint = exports.excludeFiles = exports.getPrivateOutputs = exports.updateRouteSrc = exports.getNextServerPath = exports.normalizeIndexOutput = exports.getStaticFiles = exports.onPrerenderRoute = exports.onPrerenderRouteInitial = exports.detectLambdaLimitExceeding = exports.outputFunctionFileSizeInfo = exports.getPageLambdaGroups = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = exports.addLocaleOrDefault = exports.normalizeLocalePath = exports.getPrerenderManifest = exports.getRequiredServerFilesManifest = exports.getExportStatus = exports.getExportIntent = exports.createLambdaFromPseudoLayers = exports.createPseudoLayer = exports.ExperimentalTraceVersion = exports.collectTracedFiles = exports.getFilesMapFromReasons = exports.filterStaticPages = exports.getImagesManifest = exports.localizeDynamicRoutes = exports.getDynamicRoutes = exports.getRoutesManifest = exports.prettyBytes = exports.MIB = exports.KIB = void 0;
26
26
  const build_utils_1 = require("@vercel/build-utils");
27
27
  const async_sema_1 = require("async-sema");
28
28
  const buffer_crc32_1 = __importDefault(require("buffer-crc32"));
@@ -35,12 +35,13 @@ const url_1 = __importDefault(require("url"));
35
35
  const escape_string_regexp_1 = __importDefault(require("escape-string-regexp"));
36
36
  const _1 = require(".");
37
37
  const text_table_1 = __importDefault(require("text-table"));
38
- const pretty_bytes_1 = __importDefault(require("pretty-bytes"));
39
38
  const get_edge_function_source_1 = require("./edge-function-source/get-edge-function-source");
40
39
  const sourcemapped_1 = require("./sourcemapped");
41
40
  const bytes_1 = __importDefault(require("bytes"));
42
- const _prettyBytes = (n) => (0, bytes_1.default)(n, { unitSeparator: ' ' });
43
- exports.prettyBytes = _prettyBytes;
41
+ exports.KIB = 1024;
42
+ exports.MIB = 1024 * exports.KIB;
43
+ const prettyBytes = (n) => (0, bytes_1.default)(n, { unitSeparator: ' ' });
44
+ exports.prettyBytes = prettyBytes;
44
45
  // Identify /[param]/ in route string
45
46
  // eslint-disable-next-line no-useless-escape
46
47
  const TEST_DYNAMIC_ROUTE = /\/\[[^\/]+?\](?=\/|$)/;
@@ -788,9 +789,9 @@ function addLocaleOrDefault(pathname, routesManifest, locale) {
788
789
  : pathname;
789
790
  }
790
791
  exports.addLocaleOrDefault = addLocaleOrDefault;
791
- exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = 250 * 1000 * 1000; // 250MB
792
- const LAMBDA_RESERVED_UNCOMPRESSED_SIZE = 2.5 * 1000 * 1000; // 2.5MB
793
- const LAMBDA_RESERVED_COMPRESSED_SIZE = 250 * 1000; // 250KB
792
+ exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = 250 * exports.MIB;
793
+ const LAMBDA_RESERVED_UNCOMPRESSED_SIZE = 2.5 * exports.MIB;
794
+ const LAMBDA_RESERVED_COMPRESSED_SIZE = 250 * exports.KIB;
794
795
  async function getPageLambdaGroups({ entryPath, config, pages, prerenderRoutes, pageTraces, compressedPages, tracedPseudoLayer, initialPseudoLayer, initialPseudoLayerUncompressed, lambdaCompressedByteLimit, internalPages, pageExtensions, }) {
795
796
  const groups = [];
796
797
  for (const page of pages) {
@@ -918,14 +919,14 @@ const outputFunctionFileSizeInfo = (pages, pseudoLayer, pseudoLayerBytes, pseudo
918
919
  })
919
920
  .forEach(depKey => {
920
921
  const dep = dependencies[depKey];
921
- if (dep.compressed < 100 * 1000 && dep.uncompressed < 500 * 1000) {
922
+ if (dep.compressed < 100 * exports.KIB && dep.uncompressed < 500 * exports.KIB) {
922
923
  // ignore smaller dependencies to reduce noise
923
924
  return;
924
925
  }
925
926
  exceededLimitOutput.push([
926
927
  depKey,
927
- (0, pretty_bytes_1.default)(dep.uncompressed),
928
- (0, pretty_bytes_1.default)(dep.compressed),
928
+ (0, exports.prettyBytes)(dep.uncompressed),
929
+ (0, exports.prettyBytes)(dep.compressed),
929
930
  ]);
930
931
  numLargeDependencies += 1;
931
932
  });
@@ -937,8 +938,8 @@ const outputFunctionFileSizeInfo = (pages, pseudoLayer, pseudoLayerBytes, pseudo
937
938
  exceededLimitOutput.push([]);
938
939
  exceededLimitOutput.push([
939
940
  'All dependencies',
940
- (0, pretty_bytes_1.default)(pseudoLayerUncompressedBytes),
941
- (0, pretty_bytes_1.default)(pseudoLayerBytes),
941
+ (0, exports.prettyBytes)(pseudoLayerUncompressedBytes),
942
+ (0, exports.prettyBytes)(pseudoLayerBytes),
942
943
  ]);
943
944
  console.log((0, text_table_1.default)(exceededLimitOutput, {
944
945
  align: ['l', 'r', 'r'],
@@ -947,8 +948,8 @@ const outputFunctionFileSizeInfo = (pages, pseudoLayer, pseudoLayerBytes, pseudo
947
948
  exports.outputFunctionFileSizeInfo = outputFunctionFileSizeInfo;
948
949
  const detectLambdaLimitExceeding = async (lambdaGroups, compressedSizeLimit, compressedPages) => {
949
950
  // show debug info if within 5 MB of exceeding the limit
950
- const COMPRESSED_SIZE_LIMIT_CLOSE = compressedSizeLimit - 5 * 1000 * 1000;
951
- const UNCOMPRESSED_SIZE_LIMIT_CLOSE = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE - 5 * 1000 * 1000;
951
+ const COMPRESSED_SIZE_LIMIT_CLOSE = compressedSizeLimit - 5 * exports.MIB;
952
+ const UNCOMPRESSED_SIZE_LIMIT_CLOSE = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE - 5 * exports.MIB;
952
953
  let numExceededLimit = 0;
953
954
  let numCloseToLimit = 0;
954
955
  let loggedHeadInfo = false;
@@ -975,7 +976,7 @@ const detectLambdaLimitExceeding = async (lambdaGroups, compressedSizeLimit, com
975
976
  for (const group of filteredGroups) {
976
977
  if (!loggedHeadInfo) {
977
978
  if (numExceededLimit || numCloseToLimit) {
978
- console.log(`Warning: Max serverless function size of ${(0, pretty_bytes_1.default)(compressedSizeLimit)} compressed or ${(0, pretty_bytes_1.default)(exports.MAX_UNCOMPRESSED_LAMBDA_SIZE)} uncompressed${numExceededLimit ? '' : ' almost'} reached`);
979
+ console.log(`Warning: Max serverless function size of ${(0, exports.prettyBytes)(compressedSizeLimit)} compressed or ${(0, exports.prettyBytes)(exports.MAX_UNCOMPRESSED_LAMBDA_SIZE)} uncompressed${numExceededLimit ? '' : ' almost'} reached`);
979
980
  }
980
981
  else {
981
982
  console.log(`Serverless function size info`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "3.3.2",
3
+ "version": "3.3.3",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -45,7 +45,7 @@
45
45
  "@types/semver": "6.0.0",
46
46
  "@types/text-table": "0.2.1",
47
47
  "@types/webpack-sources": "3.2.0",
48
- "@vercel/build-utils": "5.7.0",
48
+ "@vercel/build-utils": "5.7.1",
49
49
  "@vercel/nft": "0.22.1",
50
50
  "@vercel/routing-utils": "2.1.3",
51
51
  "async-sema": "3.0.1",
@@ -61,7 +61,6 @@
61
61
  "get-port": "5.0.0",
62
62
  "nanoid": "3.3.4",
63
63
  "ndjson": "2.0.0",
64
- "pretty-bytes": "5.6.0",
65
64
  "resolve-from": "5.0.0",
66
65
  "semver": "6.1.1",
67
66
  "set-cookie-parser": "2.4.6",
@@ -71,5 +70,5 @@
71
70
  "typescript": "4.5.2",
72
71
  "webpack-sources": "3.2.3"
73
72
  },
74
- "gitHead": "b37ac5f798acbfb8f04e047301766440ad0d4c59"
73
+ "gitHead": "4484c134487214af68bc97da322688ec027db532"
75
74
  }