@vercel/next 3.1.13 → 3.1.16

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
@@ -42724,14 +42724,13 @@ const build = async ({ files, workPath, repoRootPath, entrypoint, config = {}, m
42724
42724
  entryDirectory,
42725
42725
  outputDirectory,
42726
42726
  }, null, 2));
42727
- Object.keys(process.env)
42728
- .filter(key => key.startsWith('VERCEL_'))
42729
- .forEach(key => {
42730
- const newKey = `NEXT_PUBLIC_${key}`;
42731
- if (!(newKey in process.env)) {
42732
- process.env[newKey] = process.env[key];
42733
- }
42727
+ const prefixedEnvs = (0, build_utils_1.getPrefixedEnvVars)({
42728
+ envPrefix: 'NEXT_PUBLIC_',
42729
+ envs: process.env,
42734
42730
  });
42731
+ for (const [key, value] of Object.entries(prefixedEnvs)) {
42732
+ process.env[key] = value;
42733
+ }
42735
42734
  await (0, build_utils_1.download)(files, workPath, meta);
42736
42735
  if (config.rootDirectory) {
42737
42736
  // this must come after the download step since files outside
@@ -44826,7 +44825,6 @@ const CORRECT_MIDDLEWARE_ORDER_VERSION = 'v12.1.7-canary.29';
44826
44825
  const NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION = 'v12.1.7-canary.33';
44827
44826
  const EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION = 'v12.2.0';
44828
44827
  const CORRECTED_MANIFESTS_VERSION = 'v12.2.0';
44829
- const NON_NESTED_MIDDLEWARE_VERSION = 'v12.1.7-canary.9';
44830
44828
  async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs, baseDir, workPath, entryPath, nodeVersion, buildId, escapedBuildId, dynamicPrefix, entryDirectory, outputDirectory, redirects, beforeFilesRewrites, afterFilesRewrites, fallbackRewrites, headers, dataRoutes, hasIsr404Page, imagesManifest, wildcardConfig, routesManifest, staticPages, lambdaPages, nextVersion, canUsePreviewMode, trailingSlash, prerenderManifest, omittedPrerenderRoutes, trailingSlashRedirects, isCorrectLocaleAPIRoutes, lambdaCompressedByteLimit, requiredServerFilesManifest, }) {
44831
44829
  const lambdas = {};
44832
44830
  const prerenders = {};
@@ -44837,7 +44835,6 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
44837
44835
  const isCorrectNotFoundRoutes = semver_1.default.gte(nextVersion, CORRECT_NOT_FOUND_ROUTES_VERSION);
44838
44836
  const isCorrectMiddlewareOrder = semver_1.default.gte(nextVersion, CORRECT_MIDDLEWARE_ORDER_VERSION);
44839
44837
  const isCorrectManifests = semver_1.default.gte(nextVersion, CORRECTED_MANIFESTS_VERSION);
44840
- const isNonNestedMiddleware = semver_1.default.gte(nextVersion, NON_NESTED_MIDDLEWARE_VERSION);
44841
44838
  let hasStatic500 = !!staticPages[path_1.default.join(entryDirectory, '500')];
44842
44839
  if (lambdaPageKeys.length === 0) {
44843
44840
  throw new build_utils_1.NowBuildError({
@@ -45417,22 +45414,6 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
45417
45414
  fsPath: catchallFsPath,
45418
45415
  });
45419
45416
  }
45420
- // We stopped duplicating matchers for _next/data routes when we added
45421
- // x-nextjs-data header resolving but we should still resolve middleware
45422
- // when the header isn't present so we augment the source to include that.
45423
- // We don't apply this modification for nested middleware > 1 staticRoute
45424
- if (isNonNestedMiddleware) {
45425
- middleware.staticRoutes.forEach(route => {
45426
- if (!route.src?.match(/_next[\\/]{1,}data/)) {
45427
- route.src =
45428
- `^(\\/_next\\/data\\/${escapedBuildId})?(` +
45429
- route.src
45430
- ?.replace(/\|\^/g, '|')
45431
- .replace(/\$$/, ')$')
45432
- .replace(/\$/g, '(\\.json)?$');
45433
- }
45434
- });
45435
- }
45436
45417
  return {
45437
45418
  wildcard: wildcardConfig,
45438
45419
  images: imagesManifest?.images?.loader === 'default'
@@ -21,7 +21,6 @@ const CORRECT_MIDDLEWARE_ORDER_VERSION = 'v12.1.7-canary.29';
21
21
  const NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION = 'v12.1.7-canary.33';
22
22
  const EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION = 'v12.2.0';
23
23
  const CORRECTED_MANIFESTS_VERSION = 'v12.2.0';
24
- const NON_NESTED_MIDDLEWARE_VERSION = 'v12.1.7-canary.9';
25
24
  async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs, baseDir, workPath, entryPath, nodeVersion, buildId, escapedBuildId, dynamicPrefix, entryDirectory, outputDirectory, redirects, beforeFilesRewrites, afterFilesRewrites, fallbackRewrites, headers, dataRoutes, hasIsr404Page, imagesManifest, wildcardConfig, routesManifest, staticPages, lambdaPages, nextVersion, canUsePreviewMode, trailingSlash, prerenderManifest, omittedPrerenderRoutes, trailingSlashRedirects, isCorrectLocaleAPIRoutes, lambdaCompressedByteLimit, requiredServerFilesManifest, }) {
26
25
  const lambdas = {};
27
26
  const prerenders = {};
@@ -32,7 +31,6 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
32
31
  const isCorrectNotFoundRoutes = semver_1.default.gte(nextVersion, CORRECT_NOT_FOUND_ROUTES_VERSION);
33
32
  const isCorrectMiddlewareOrder = semver_1.default.gte(nextVersion, CORRECT_MIDDLEWARE_ORDER_VERSION);
34
33
  const isCorrectManifests = semver_1.default.gte(nextVersion, CORRECTED_MANIFESTS_VERSION);
35
- const isNonNestedMiddleware = semver_1.default.gte(nextVersion, NON_NESTED_MIDDLEWARE_VERSION);
36
34
  let hasStatic500 = !!staticPages[path_1.default.join(entryDirectory, '500')];
37
35
  if (lambdaPageKeys.length === 0) {
38
36
  throw new build_utils_1.NowBuildError({
@@ -612,22 +610,6 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
612
610
  fsPath: catchallFsPath,
613
611
  });
614
612
  }
615
- // We stopped duplicating matchers for _next/data routes when we added
616
- // x-nextjs-data header resolving but we should still resolve middleware
617
- // when the header isn't present so we augment the source to include that.
618
- // We don't apply this modification for nested middleware > 1 staticRoute
619
- if (isNonNestedMiddleware) {
620
- middleware.staticRoutes.forEach(route => {
621
- if (!route.src?.match(/_next[\\/]{1,}data/)) {
622
- route.src =
623
- `^(\\/_next\\/data\\/${escapedBuildId})?(` +
624
- route.src
625
- ?.replace(/\|\^/g, '|')
626
- .replace(/\$$/, ')$')
627
- .replace(/\$/g, '(\\.json)?$');
628
- }
629
- });
630
- }
631
613
  return {
632
614
  wildcard: wildcardConfig,
633
615
  images: imagesManifest?.images?.loader === 'default'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "3.1.13",
3
+ "version": "3.1.16",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -11,8 +11,7 @@
11
11
  "test-unit": "yarn test test/build.test.ts test/unit/",
12
12
  "test-next-local": "jest --env node --verbose --bail --forceExit --testTimeout=360000 test/integration/*.test.js test/integration/*.test.ts",
13
13
  "test-next-local:middleware": "jest --env node --verbose --bail --useStderr --testTimeout=360000 test/integration/middleware.test.ts",
14
- "test-integration-once": "rm test/builder-info.json; jest --env node --verbose --runInBand --bail test/fixtures/**/*.test.js",
15
- "prepublishOnly": "yarn build"
14
+ "test-integration-once": "rm test/builder-info.json; jest --env node --verbose --runInBand --bail test/fixtures/**/*.test.js"
16
15
  },
17
16
  "repository": {
18
17
  "type": "git",
@@ -45,9 +44,9 @@
45
44
  "@types/semver": "6.0.0",
46
45
  "@types/text-table": "0.2.1",
47
46
  "@types/webpack-sources": "3.2.0",
48
- "@vercel/build-utils": "5.1.0",
47
+ "@vercel/build-utils": "5.3.0",
49
48
  "@vercel/nft": "0.21.0",
50
- "@vercel/routing-utils": "2.0.0",
49
+ "@vercel/routing-utils": "2.0.2",
51
50
  "async-sema": "3.0.1",
52
51
  "buffer-crc32": "0.2.13",
53
52
  "cheerio": "1.0.0-rc.10",
@@ -70,5 +69,5 @@
70
69
  "typescript": "4.5.2",
71
70
  "webpack-sources": "3.2.3"
72
71
  },
73
- "gitHead": "7db6436797d0b4131113f0b8dccc3b66bc9b1981"
72
+ "gitHead": "47e3381c6df661168e8be335cc58df03f3cf2414"
74
73
  }