Skip to content

Commit

Permalink
add version to function config manifest (#52507)
Browse files Browse the repository at this point in the history
Adds `version` to function config manifest as suggested in vercel/vercel#10069 (comment)
  • Loading branch information
ecklf committed Jul 10, 2023
1 parent d175aea commit 0648a10
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 21 deletions.
10 changes: 9 additions & 1 deletion packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1737,9 +1737,17 @@ export default async function build(
}

if (Object.keys(functionsConfigManifest).length > 0) {
const manifest: {
version: number
functions: Record<string, Record<string, string | number>>
} = {
version: 1,
functions: functionsConfigManifest,
}

await fs.writeFile(
path.join(distDir, SERVER_DIRECTORY, FUNCTIONS_CONFIG_MANIFEST),
JSON.stringify(functionsConfigManifest, null, 2)
JSON.stringify(manifest, null, 2)
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,30 @@ createNextDescribe(

expect(functionsConfigManifest).toMatchInlineSnapshot(`
Object {
"/api/page-route": Object {
"maxDuration": 1,
},
"/app-route": Object {
"maxDuration": 1,
},
"/app-route-edge": Object {
"maxDuration": 2,
},
"/app-ssr": Object {
"maxDuration": 3,
},
"/app-ssr-edge": Object {
"maxDuration": 4,
},
"/page": Object {
"maxDuration": 2,
},
"/page-ssr": Object {
"maxDuration": 3,
"functions": Object {
"/api/page-route": Object {
"maxDuration": 1,
},
"/app-route": Object {
"maxDuration": 1,
},
"/app-route-edge": Object {
"maxDuration": 2,
},
"/app-ssr": Object {
"maxDuration": 3,
},
"/app-ssr-edge": Object {
"maxDuration": 4,
},
"/page": Object {
"maxDuration": 2,
},
"/page-ssr": Object {
"maxDuration": 3,
},
},
"version": 1,
}
`)
}
Expand Down

0 comments on commit 0648a10

Please sign in to comment.