@vercel/next 4.15.28 → 4.15.29

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.
@@ -9711,6 +9711,37 @@ async function handleStaticOutputs(outputs, {
9711
9711
  );
9712
9712
  }
9713
9713
  var vercelConfig = JSON.parse(process.env.NEXT_ADAPTER_VERCEL_CONFIG || "{}");
9714
+ function isGeneratedStep(routeName) {
9715
+ return routeName.includes(".well-known/workflow/v1/step") || routeName.includes("api/generated/steps");
9716
+ }
9717
+ function isGeneratedWorkflow(routeName) {
9718
+ return routeName.includes(".well-known/workflow/v1/flow") || routeName.includes("api/generated/workflows");
9719
+ }
9720
+ async function getGeneratedWorkflowLambdaOptions({
9721
+ projectDir,
9722
+ routeName,
9723
+ sourceFile
9724
+ }) {
9725
+ const generatedStep = isGeneratedStep(routeName);
9726
+ const generatedWorkflow = isGeneratedWorkflow(routeName);
9727
+ if (!generatedStep && !generatedWorkflow) {
9728
+ return;
9729
+ }
9730
+ const isAppRouterRoute = sourceFile.endsWith("/route.js") || sourceFile.endsWith("/route.ts");
9731
+ const configRelativePath = isAppRouterRoute ? "../config.json" : "./config.json";
9732
+ const generatedConfig = JSON.parse(
9733
+ await import_promises.default.readFile(
9734
+ import_node_path.default.join(projectDir, import_node_path.default.dirname(sourceFile), configRelativePath),
9735
+ "utf8"
9736
+ ).catch(() => "{}")
9737
+ );
9738
+ if (generatedStep && generatedConfig.steps) {
9739
+ return generatedConfig.steps;
9740
+ }
9741
+ if (generatedWorkflow && generatedConfig.workflows) {
9742
+ return generatedConfig.workflows;
9743
+ }
9744
+ }
9714
9745
  async function writeDeterministicRoutesManifest(distDir) {
9715
9746
  const manifest = require(import_node_path.default.join(distDir, "routes-manifest.json"));
9716
9747
  manifest.headers = [];
@@ -9810,6 +9841,15 @@ async function handleNodeOutputs(nodeOutputs, {
9810
9841
  sourceFile,
9811
9842
  config: vercelConfig
9812
9843
  });
9844
+ const generatedConfigOpts = await getGeneratedWorkflowLambdaOptions({
9845
+ projectDir,
9846
+ routeName: output.pathname,
9847
+ sourceFile
9848
+ });
9849
+ if (generatedConfigOpts) {
9850
+ Object.assign(vercelConfigOpts, generatedConfigOpts);
9851
+ }
9852
+ const maxDuration = generatedConfigOpts?.maxDuration ?? output.config.maxDuration;
9813
9853
  await writeIfNotExists(
9814
9854
  import_node_path.default.join(functionDir, `.vc-config.json`),
9815
9855
  JSON.stringify(
@@ -9827,7 +9867,7 @@ async function handleNodeOutputs(nodeOutputs, {
9827
9867
  "___next_launcher.cjs"
9828
9868
  ),
9829
9869
  runtime: nodeVersion.runtime,
9830
- maxDuration: output.config.maxDuration,
9870
+ maxDuration,
9831
9871
  supportsResponseStreaming: true,
9832
9872
  experimentalAllowBundling: true,
9833
9873
  // middleware handler always expects Request/Response interface
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "4.15.28",
3
+ "version": "4.15.29",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -16,7 +16,7 @@
16
16
  "@vercel/nft": "1.1.1"
17
17
  },
18
18
  "devDependencies": {
19
- "@next-community/adapter-vercel": "0.0.1-beta.6",
19
+ "@next-community/adapter-vercel": "0.0.1-beta.7",
20
20
  "@types/aws-lambda": "8.10.19",
21
21
  "@types/buffer-crc32": "0.2.0",
22
22
  "@types/bytes": "3.1.1",
@@ -53,8 +53,8 @@
53
53
  "test-listen": "1.1.0",
54
54
  "text-table": "0.2.0",
55
55
  "webpack-sources": "3.2.3",
56
- "@vercel/build-utils": "13.3.3",
57
- "@vercel/routing-utils": "5.3.2"
56
+ "@vercel/build-utils": "13.4.1",
57
+ "@vercel/routing-utils": "5.3.3"
58
58
  },
59
59
  "scripts": {
60
60
  "build": "node build.mjs",