@@ -57,14 +57,14 @@ export interface FunctionManifest {
57
57
name ?: string
58
58
path : string
59
59
cache ?: 'manual'
60
- generator ? : string
60
+ generator : string
61
61
}
62
62
| {
63
63
function : string
64
64
name ?: string
65
65
pattern : string
66
66
cache ?: 'manual'
67
- generator ? : string
67
+ generator : string
68
68
}
69
69
>
70
70
layers ?: Array < { name : `https://${string } /mod.ts`; flag : string } >
@@ -230,7 +230,7 @@ const middlewareMatcherToEdgeFunctionDefinition = (
230
230
name ?: string
231
231
pattern : string
232
232
cache ?: 'manual'
233
- generator ? : string
233
+ generator : string
234
234
} => {
235
235
const pattern = transformCaptureGroups ( stripLookahead ( matcher . regexp ) )
236
236
return { function : name , pattern, name, cache, generator }
@@ -243,12 +243,14 @@ export const cleanupEdgeFunctions = ({
243
243
export const writeDevEdgeFunction = async ( {
244
244
INTERNAL_EDGE_FUNCTIONS_SRC = '.netlify/edge-functions' ,
245
245
} : NetlifyPluginConstants ) => {
246
+ const generator = await getPluginVersion ( )
246
247
const manifest : FunctionManifest = {
247
248
functions : [
248
249
{
249
250
function : 'next-dev' ,
250
251
name : 'netlify dev handler' ,
251
252
path : '/*' ,
253
+ generator,
252
254
} ,
253
255
] ,
254
256
version : 1 ,
@@ -274,7 +276,7 @@ export const writeRscDataEdgeFunction = async ({
274
276
prerenderManifest ?: PrerenderManifest
275
277
appPathRoutesManifest ?: Record < string , string >
276
278
} ) : Promise < FunctionManifest [ 'functions' ] > => {
277
- const nextjsPluginVersion = await getPluginVersion ( )
279
+ const generator = await getPluginVersion ( )
278
280
if ( ! prerenderManifest || ! appPathRoutesManifest ) {
279
281
return [ ]
280
282
}
@@ -305,13 +307,13 @@ export const writeRscDataEdgeFunction = async ({
305
307
function : 'rsc-data' ,
306
308
name : 'RSC data routing' ,
307
309
path,
308
- generator : nextjsPluginVersion ,
310
+ generator,
309
311
} ) ) ,
310
312
...dynamicAppDirRoutes . map ( ( pattern ) => ( {
311
313
function : 'rsc-data' ,
312
314
name : 'RSC data routing' ,
313
315
pattern,
314
- generator : nextjsPluginVersion ,
316
+ generator,
315
317
} ) ) ,
316
318
]
317
319
}
@@ -351,7 +353,7 @@ export const writeEdgeFunctions = async ({
351
353
netlifyConfig : NetlifyConfig
352
354
routesManifest : RoutesManifest
353
355
} ) => {
354
- const nextjsPluginVersion = await getPluginVersion ( )
356
+ const generator = await getPluginVersion ( )
355
357
356
358
const manifest : FunctionManifest = {
357
359
functions : [ ] ,
@@ -411,9 +413,7 @@ export const writeEdgeFunctions = async ({
411
413
} )
412
414
413
415
manifest . functions . push (
414
- ...matchers . map ( ( matcher ) =>
415
- middlewareMatcherToEdgeFunctionDefinition ( matcher , functionName , nextjsPluginVersion ) ,
416
- ) ,
416
+ ...matchers . map ( ( matcher ) => middlewareMatcherToEdgeFunctionDefinition ( matcher , functionName , generator ) ) ,
417
417
)
418
418
}
419
419
// Functions (i.e. not middleware, but edge SSR and API routes)
@@ -453,7 +453,7 @@ export const writeEdgeFunctions = async ({
453
453
pattern,
454
454
// cache: "manual" is currently experimental, so we restrict it to sites that use experimental appDir
455
455
cache : usesAppDir ? 'manual' : undefined ,
456
- generator : nextjsPluginVersion ,
456
+ generator,
457
457
} )
458
458
// pages-dir page routes also have a data route. If there's a match, add an entry mapping that to the function too
459
459
const dataRoute = dataRoutesMap . get ( edgeFunctionDefinition . page )
@@ -463,7 +463,7 @@ export const writeEdgeFunctions = async ({
463
463
name : edgeFunctionDefinition . name ,
464
464
pattern : dataRoute ,
465
465
cache : usesAppDir ? 'manual' : undefined ,
466
- generator : nextjsPluginVersion ,
466
+ generator,
467
467
} )
468
468
}
469
469
}
@@ -489,7 +489,7 @@ export const writeEdgeFunctions = async ({
489
489
function : 'ipx' ,
490
490
name : 'next/image handler' ,
491
491
path : nextConfig . images . path || '/_next/image' ,
492
- generator : nextjsPluginVersion ,
492
+ generator,
493
493
} )
494
494
495
495
manifest . layers . push ( {
0 commit comments