@vercel/next 4.6.1 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +75 -37
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -824,7 +824,7 @@ var require_superstatic = __commonJS({
|
|
824
824
|
sourceToRegex: () => sourceToRegex
|
825
825
|
});
|
826
826
|
module2.exports = __toCommonJS2(superstatic_exports);
|
827
|
-
var
|
827
|
+
var import_url3 = require("url");
|
828
828
|
var import_path_to_regexp = require_dist();
|
829
829
|
var import_path_to_regexp_updated = require_dist2();
|
830
830
|
function cloneKeys(keys) {
|
@@ -1086,7 +1086,7 @@ var require_superstatic = __commonJS({
|
|
1086
1086
|
indexes[name] = "$" + name;
|
1087
1087
|
escapedDestination = escapeSegment(escapedDestination, name);
|
1088
1088
|
});
|
1089
|
-
const parsedDestination = (0,
|
1089
|
+
const parsedDestination = (0, import_url3.parse)(escapedDestination, true);
|
1090
1090
|
delete parsedDestination.href;
|
1091
1091
|
delete parsedDestination.path;
|
1092
1092
|
delete parsedDestination.search;
|
@@ -1138,7 +1138,7 @@ var require_superstatic = __commonJS({
|
|
1138
1138
|
}
|
1139
1139
|
}
|
1140
1140
|
}
|
1141
|
-
destination = (0,
|
1141
|
+
destination = (0, import_url3.format)({
|
1142
1142
|
...rest,
|
1143
1143
|
hostname,
|
1144
1144
|
pathname,
|
@@ -8173,24 +8173,24 @@ var require_util = __commonJS({
|
|
8173
8173
|
}
|
8174
8174
|
exports.urlParse = urlParse;
|
8175
8175
|
function urlGenerate(aParsedUrl) {
|
8176
|
-
let
|
8176
|
+
let url3 = "";
|
8177
8177
|
if (aParsedUrl.scheme) {
|
8178
|
-
|
8178
|
+
url3 += aParsedUrl.scheme + ":";
|
8179
8179
|
}
|
8180
|
-
|
8180
|
+
url3 += "//";
|
8181
8181
|
if (aParsedUrl.auth) {
|
8182
|
-
|
8182
|
+
url3 += aParsedUrl.auth + "@";
|
8183
8183
|
}
|
8184
8184
|
if (aParsedUrl.host) {
|
8185
|
-
|
8185
|
+
url3 += aParsedUrl.host;
|
8186
8186
|
}
|
8187
8187
|
if (aParsedUrl.port) {
|
8188
|
-
|
8188
|
+
url3 += ":" + aParsedUrl.port;
|
8189
8189
|
}
|
8190
8190
|
if (aParsedUrl.path) {
|
8191
|
-
|
8191
|
+
url3 += aParsedUrl.path;
|
8192
8192
|
}
|
8193
|
-
return
|
8193
|
+
return url3;
|
8194
8194
|
}
|
8195
8195
|
exports.urlGenerate = urlGenerate;
|
8196
8196
|
var MAX_CACHED_INPUTS = 32;
|
@@ -8218,12 +8218,12 @@ var require_util = __commonJS({
|
|
8218
8218
|
}
|
8219
8219
|
var normalize = lruMemoize(function normalize2(aPath) {
|
8220
8220
|
let path5 = aPath;
|
8221
|
-
const
|
8222
|
-
if (
|
8223
|
-
if (!
|
8221
|
+
const url3 = urlParse(aPath);
|
8222
|
+
if (url3) {
|
8223
|
+
if (!url3.path) {
|
8224
8224
|
return aPath;
|
8225
8225
|
}
|
8226
|
-
path5 =
|
8226
|
+
path5 = url3.path;
|
8227
8227
|
}
|
8228
8228
|
const isAbsolute = exports.isAbsolute(path5);
|
8229
8229
|
const parts = [];
|
@@ -8263,9 +8263,9 @@ var require_util = __commonJS({
|
|
8263
8263
|
if (path5 === "") {
|
8264
8264
|
path5 = isAbsolute ? "/" : ".";
|
8265
8265
|
}
|
8266
|
-
if (
|
8267
|
-
|
8268
|
-
return urlGenerate(
|
8266
|
+
if (url3) {
|
8267
|
+
url3.path = path5;
|
8268
|
+
return urlGenerate(url3);
|
8269
8269
|
}
|
8270
8270
|
return path5;
|
8271
8271
|
});
|
@@ -9586,13 +9586,13 @@ var require_source_map_consumer = __commonJS({
|
|
9586
9586
|
if (this.sourceRoot != null) {
|
9587
9587
|
relativeSource = util.relative(this.sourceRoot, relativeSource);
|
9588
9588
|
}
|
9589
|
-
let
|
9590
|
-
if (this.sourceRoot != null && (
|
9589
|
+
let url3;
|
9590
|
+
if (this.sourceRoot != null && (url3 = util.urlParse(this.sourceRoot))) {
|
9591
9591
|
const fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
|
9592
|
-
if (
|
9592
|
+
if (url3.scheme == "file" && this._sources.has(fileUriAbsPath)) {
|
9593
9593
|
return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
|
9594
9594
|
}
|
9595
|
-
if ((!
|
9595
|
+
if ((!url3.path || url3.path == "/") && this._sources.has("/" + relativeSource)) {
|
9596
9596
|
return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
|
9597
9597
|
}
|
9598
9598
|
}
|
@@ -10811,7 +10811,7 @@ var import_find_up = __toESM(require_find_up());
|
|
10811
10811
|
var import_fs_extra6 = __toESM(require_lib2());
|
10812
10812
|
var import_path5 = __toESM(require("path"));
|
10813
10813
|
var import_semver4 = __toESM(require_semver());
|
10814
|
-
var
|
10814
|
+
var import_url2 = __toESM(require("url"));
|
10815
10815
|
|
10816
10816
|
// src/create-serverless-config.ts
|
10817
10817
|
var import_fs_extra4 = __toESM(require_lib2());
|
@@ -13624,7 +13624,6 @@ var legacy_versions_default = [
|
|
13624
13624
|
|
13625
13625
|
// src/server-build.ts
|
13626
13626
|
var import_path4 = __toESM(require("path"));
|
13627
|
-
var import_url2 = __toESM(require("url"));
|
13628
13627
|
var import_semver3 = __toESM(require_semver());
|
13629
13628
|
var import_async_sema2 = __toESM(require_lib());
|
13630
13629
|
var import_build_utils2 = require("@vercel/build-utils");
|
@@ -13754,7 +13753,31 @@ async function serverBuild({
|
|
13754
13753
|
const rewrite = rewrites[i];
|
13755
13754
|
if (!rewrite.src || !rewrite.dest)
|
13756
13755
|
continue;
|
13757
|
-
|
13756
|
+
let protocol = null;
|
13757
|
+
if (rewrite.dest.startsWith("http://")) {
|
13758
|
+
protocol = "http://";
|
13759
|
+
} else if (rewrite.dest.startsWith("https://")) {
|
13760
|
+
protocol = "https://";
|
13761
|
+
}
|
13762
|
+
let pathname = null;
|
13763
|
+
let query = null;
|
13764
|
+
if (!protocol) {
|
13765
|
+
pathname = rewrite.dest;
|
13766
|
+
let index = pathname.indexOf("?");
|
13767
|
+
if (index !== -1) {
|
13768
|
+
query = pathname.substring(index + 1);
|
13769
|
+
pathname = pathname.substring(0, index);
|
13770
|
+
index = query.indexOf("#");
|
13771
|
+
if (index !== -1) {
|
13772
|
+
query = query.substring(0, index);
|
13773
|
+
}
|
13774
|
+
} else {
|
13775
|
+
index = pathname.indexOf("#");
|
13776
|
+
if (index !== -1) {
|
13777
|
+
pathname = pathname.substring(0, index);
|
13778
|
+
}
|
13779
|
+
}
|
13780
|
+
}
|
13758
13781
|
if (isAfterFilesRewrite) {
|
13759
13782
|
const parts = ["\\.rsc"];
|
13760
13783
|
if (isAppPPREnabled) {
|
@@ -13768,11 +13791,12 @@ async function serverBuild({
|
|
13768
13791
|
/\/?\(\?:\/\)\?/,
|
13769
13792
|
`(?:/)?(?<rscsuff>${rscSuffix})?`
|
13770
13793
|
);
|
13771
|
-
|
13794
|
+
const destQueryIndex = rewrite.dest.indexOf("?");
|
13772
13795
|
if (destQueryIndex === -1) {
|
13773
|
-
|
13796
|
+
rewrite.dest = `${rewrite.dest}$rscsuff`;
|
13797
|
+
} else {
|
13798
|
+
rewrite.dest = `${rewrite.dest.substring(0, destQueryIndex)}$rscsuff${rewrite.dest.substring(destQueryIndex)}`;
|
13774
13799
|
}
|
13775
|
-
rewrite.dest = rewrite.dest.substring(0, destQueryIndex) + "$rscsuff" + rewrite.dest.substring(destQueryIndex);
|
13776
13800
|
}
|
13777
13801
|
const { rewriteHeaders } = routesManifest;
|
13778
13802
|
if (!rewriteHeaders)
|
@@ -15762,7 +15786,8 @@ var build = async (buildOptions) => {
|
|
15762
15786
|
packageJsonPackageManager,
|
15763
15787
|
nodeVersion,
|
15764
15788
|
env: spawnOpts.env || {},
|
15765
|
-
turboSupportsCorepackHome
|
15789
|
+
turboSupportsCorepackHome,
|
15790
|
+
projectCreatedAt: config.projectSettings?.createdAt
|
15766
15791
|
});
|
15767
15792
|
const nowJsonPath = await (0, import_find_up.default)(["now.json", "vercel.json"], {
|
15768
15793
|
cwd: entryPath
|
@@ -15837,7 +15862,14 @@ var build = async (buildOptions) => {
|
|
15837
15862
|
cwd: entryPath
|
15838
15863
|
});
|
15839
15864
|
} else {
|
15840
|
-
await (0, import_build_utils3.runNpmInstall)(
|
15865
|
+
await (0, import_build_utils3.runNpmInstall)(
|
15866
|
+
entryPath,
|
15867
|
+
[],
|
15868
|
+
spawnOpts,
|
15869
|
+
meta,
|
15870
|
+
nodeVersion,
|
15871
|
+
config.projectSettings?.createdAt
|
15872
|
+
);
|
15841
15873
|
}
|
15842
15874
|
});
|
15843
15875
|
} else {
|
@@ -15938,10 +15970,15 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
15938
15970
|
env
|
15939
15971
|
});
|
15940
15972
|
} else if (buildScriptName) {
|
15941
|
-
await (0, import_build_utils3.runPackageJsonScript)(
|
15942
|
-
|
15943
|
-
|
15944
|
-
|
15973
|
+
await (0, import_build_utils3.runPackageJsonScript)(
|
15974
|
+
entryPath,
|
15975
|
+
buildScriptName,
|
15976
|
+
{
|
15977
|
+
...spawnOpts,
|
15978
|
+
env
|
15979
|
+
},
|
15980
|
+
config.projectSettings?.createdAt
|
15981
|
+
);
|
15945
15982
|
}
|
15946
15983
|
});
|
15947
15984
|
(0, import_build_utils3.debug)("build command exited");
|
@@ -16343,7 +16380,8 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
16343
16380
|
["--production"],
|
16344
16381
|
spawnOpts,
|
16345
16382
|
meta,
|
16346
|
-
nodeVersion
|
16383
|
+
nodeVersion,
|
16384
|
+
config.projectSettings?.createdAt
|
16347
16385
|
);
|
16348
16386
|
}
|
16349
16387
|
if (process.env.NPM_AUTH_TOKEN) {
|
@@ -17337,7 +17375,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
17337
17375
|
for (let i = 0; i < dynamicRoutes.length; i++) {
|
17338
17376
|
const route = dynamicRoutes[i];
|
17339
17377
|
mergedDynamicRoutesLambdaRoutes.push(route);
|
17340
|
-
const { pathname } =
|
17378
|
+
const { pathname } = import_url2.default.parse(route.dest);
|
17341
17379
|
if (pathname && pageLambdaMap[pathname]) {
|
17342
17380
|
mergedDynamicRoutesLambdaRoutes.push(
|
17343
17381
|
dynamicPageLambdaRoutesMap[pathname]
|
@@ -17347,7 +17385,7 @@ More info: http://err.sh/vercel/vercel/next-functions-config-optimized-lambdas`
|
|
17347
17385
|
for (let i = 0; i < dataRoutes.length; i++) {
|
17348
17386
|
const route = dataRoutes[i];
|
17349
17387
|
mergedDataRoutesLambdaRoutes.push(route);
|
17350
|
-
const { pathname } =
|
17388
|
+
const { pathname } = import_url2.default.parse(route.dest);
|
17351
17389
|
if (pathname && pageLambdaMap[pathname] && dynamicPageLambdaRoutesMap[pathname]) {
|
17352
17390
|
mergedDataRoutesLambdaRoutes.push(dynamicPageLambdaRoutesMap[pathname]);
|
17353
17391
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/next",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.7.0",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"main": "./dist/index",
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"@types/semver": "6.0.0",
|
31
31
|
"@types/text-table": "0.2.1",
|
32
32
|
"@types/webpack-sources": "3.2.0",
|
33
|
-
"@vercel/build-utils": "
|
33
|
+
"@vercel/build-utils": "10.2.0",
|
34
34
|
"@vercel/routing-utils": "5.0.4",
|
35
35
|
"async-sema": "3.0.1",
|
36
36
|
"buffer-crc32": "0.2.13",
|