@vercel/next 3.3.20 → 3.4.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 +18 -2
- package/dist/server-build.js +2 -0
- package/dist/utils.js +16 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
@@ -42866,6 +42866,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
42866
42866
|
runtime: nodeVersion.runtime,
|
42867
42867
|
maxDuration: group.maxDuration,
|
42868
42868
|
isStreaming: group.isStreaming,
|
42869
|
+
cron: group.cron,
|
42869
42870
|
});
|
42870
42871
|
for (const page of group.pages) {
|
42871
42872
|
const pageNoExt = page.replace(/\.js$/, '');
|
@@ -42926,6 +42927,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
42926
42927
|
delete lambdas[path_1.default.posix.join('.', entryDirectory, route === '/' ? 'index' : route)];
|
42927
42928
|
});
|
42928
42929
|
const middleware = await (0, utils_1.getMiddlewareBundle)({
|
42930
|
+
config,
|
42929
42931
|
entryPath,
|
42930
42932
|
outputDirectory,
|
42931
42933
|
routesManifest,
|
@@ -44422,7 +44424,8 @@ async function getPageLambdaGroups({ entryPath, config, pages, prerenderRoutes,
|
|
44422
44424
|
let matchingGroup = groups.find(group => {
|
44423
44425
|
const matches = group.maxDuration === opts.maxDuration &&
|
44424
44426
|
group.memory === opts.memory &&
|
44425
|
-
group.isPrerenders === isPrerenderRoute
|
44427
|
+
group.isPrerenders === isPrerenderRoute &&
|
44428
|
+
!opts.cron; // Functions with a cronjob must be on their own
|
44426
44429
|
if (matches) {
|
44427
44430
|
let newTracedFilesSize = group.pseudoLayerBytes;
|
44428
44431
|
let newTracedFilesUncompressedSize = group.pseudoLayerUncompressedBytes;
|
@@ -45029,7 +45032,7 @@ async function getPrivateOutputs(dir, entries) {
|
|
45029
45032
|
return { files, routes };
|
45030
45033
|
}
|
45031
45034
|
exports.getPrivateOutputs = getPrivateOutputs;
|
45032
|
-
async function getMiddlewareBundle({ entryPath, outputDirectory, routesManifest, isCorrectMiddlewareOrder, prerenderBypassToken, }) {
|
45035
|
+
async function getMiddlewareBundle({ config = {}, entryPath, outputDirectory, routesManifest, isCorrectMiddlewareOrder, prerenderBypassToken, }) {
|
45033
45036
|
const middlewareManifest = await getMiddlewareManifest(entryPath, outputDirectory);
|
45034
45037
|
const sortedFunctions = [
|
45035
45038
|
...(!middlewareManifest
|
@@ -45059,6 +45062,18 @@ async function getMiddlewareBundle({ entryPath, outputDirectory, routesManifest,
|
|
45059
45062
|
i18n: routesManifest.i18n,
|
45060
45063
|
},
|
45061
45064
|
}, path_1.default.resolve(entryPath, outputDirectory), edgeFunction.wasm);
|
45065
|
+
const edgeFunctionOptions = {};
|
45066
|
+
if (config.functions) {
|
45067
|
+
const sourceFile = await getSourceFilePathFromPage({
|
45068
|
+
workPath: entryPath,
|
45069
|
+
page: `${edgeFunction.page}.js`,
|
45070
|
+
});
|
45071
|
+
const opts = await (0, build_utils_1.getLambdaOptionsFromFunction)({
|
45072
|
+
sourceFile,
|
45073
|
+
config,
|
45074
|
+
});
|
45075
|
+
edgeFunctionOptions.cron = opts.cron;
|
45076
|
+
}
|
45062
45077
|
return {
|
45063
45078
|
type,
|
45064
45079
|
page: edgeFunction.page,
|
@@ -45084,6 +45099,7 @@ async function getMiddlewareBundle({ entryPath, outputDirectory, routesManifest,
|
|
45084
45099
|
return acc;
|
45085
45100
|
}, {});
|
45086
45101
|
return new build_utils_1.EdgeFunction({
|
45102
|
+
...edgeFunctionOptions,
|
45087
45103
|
deploymentTarget: 'v8-worker',
|
45088
45104
|
name: edgeFunction.name,
|
45089
45105
|
files: {
|
package/dist/server-build.js
CHANGED
@@ -506,6 +506,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
506
506
|
runtime: nodeVersion.runtime,
|
507
507
|
maxDuration: group.maxDuration,
|
508
508
|
isStreaming: group.isStreaming,
|
509
|
+
cron: group.cron,
|
509
510
|
});
|
510
511
|
for (const page of group.pages) {
|
511
512
|
const pageNoExt = page.replace(/\.js$/, '');
|
@@ -566,6 +567,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
|
|
566
567
|
delete lambdas[path_1.default.posix.join('.', entryDirectory, route === '/' ? 'index' : route)];
|
567
568
|
});
|
568
569
|
const middleware = await (0, utils_1.getMiddlewareBundle)({
|
570
|
+
config,
|
569
571
|
entryPath,
|
570
572
|
outputDirectory,
|
571
573
|
routesManifest,
|
package/dist/utils.js
CHANGED
@@ -828,7 +828,8 @@ async function getPageLambdaGroups({ entryPath, config, pages, prerenderRoutes,
|
|
828
828
|
let matchingGroup = groups.find(group => {
|
829
829
|
const matches = group.maxDuration === opts.maxDuration &&
|
830
830
|
group.memory === opts.memory &&
|
831
|
-
group.isPrerenders === isPrerenderRoute
|
831
|
+
group.isPrerenders === isPrerenderRoute &&
|
832
|
+
!opts.cron; // Functions with a cronjob must be on their own
|
832
833
|
if (matches) {
|
833
834
|
let newTracedFilesSize = group.pseudoLayerBytes;
|
834
835
|
let newTracedFilesUncompressedSize = group.pseudoLayerUncompressedBytes;
|
@@ -1435,7 +1436,7 @@ async function getPrivateOutputs(dir, entries) {
|
|
1435
1436
|
return { files, routes };
|
1436
1437
|
}
|
1437
1438
|
exports.getPrivateOutputs = getPrivateOutputs;
|
1438
|
-
async function getMiddlewareBundle({ entryPath, outputDirectory, routesManifest, isCorrectMiddlewareOrder, prerenderBypassToken, }) {
|
1439
|
+
async function getMiddlewareBundle({ config = {}, entryPath, outputDirectory, routesManifest, isCorrectMiddlewareOrder, prerenderBypassToken, }) {
|
1439
1440
|
const middlewareManifest = await getMiddlewareManifest(entryPath, outputDirectory);
|
1440
1441
|
const sortedFunctions = [
|
1441
1442
|
...(!middlewareManifest
|
@@ -1465,6 +1466,18 @@ async function getMiddlewareBundle({ entryPath, outputDirectory, routesManifest,
|
|
1465
1466
|
i18n: routesManifest.i18n,
|
1466
1467
|
},
|
1467
1468
|
}, path_1.default.resolve(entryPath, outputDirectory), edgeFunction.wasm);
|
1469
|
+
const edgeFunctionOptions = {};
|
1470
|
+
if (config.functions) {
|
1471
|
+
const sourceFile = await getSourceFilePathFromPage({
|
1472
|
+
workPath: entryPath,
|
1473
|
+
page: `${edgeFunction.page}.js`,
|
1474
|
+
});
|
1475
|
+
const opts = await (0, build_utils_1.getLambdaOptionsFromFunction)({
|
1476
|
+
sourceFile,
|
1477
|
+
config,
|
1478
|
+
});
|
1479
|
+
edgeFunctionOptions.cron = opts.cron;
|
1480
|
+
}
|
1468
1481
|
return {
|
1469
1482
|
type,
|
1470
1483
|
page: edgeFunction.page,
|
@@ -1490,6 +1503,7 @@ async function getMiddlewareBundle({ entryPath, outputDirectory, routesManifest,
|
|
1490
1503
|
return acc;
|
1491
1504
|
}, {});
|
1492
1505
|
return new build_utils_1.EdgeFunction({
|
1506
|
+
...edgeFunctionOptions,
|
1493
1507
|
deploymentTarget: 'v8-worker',
|
1494
1508
|
name: edgeFunction.name,
|
1495
1509
|
files: {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/next",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.4.0",
|
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": "6.0
|
48
|
+
"@vercel/build-utils": "6.2.0",
|
49
49
|
"@vercel/nft": "0.22.5",
|
50
50
|
"@vercel/routing-utils": "2.1.8",
|
51
51
|
"async-sema": "3.0.1",
|
@@ -71,5 +71,5 @@
|
|
71
71
|
"typescript": "4.5.2",
|
72
72
|
"webpack-sources": "3.2.3"
|
73
73
|
},
|
74
|
-
"gitHead": "
|
74
|
+
"gitHead": "a585969dd3b77a4ed36d6a2ca11b34f9050489f1"
|
75
75
|
}
|