@@ -47,15 +47,18 @@ async function main() {
47
47
const compareURL = `https://api.github.com/repos/vercel/next.js/compare/v${ previousVersion } ...v${ thisVersion } `
48
48
const compare = await fetch ( compareURL ) . then ( res => res . json ( ) )
49
49
const files = z . array ( fileSchema ) . parse ( compare . files )
50
- const appRouterFile = files . find (
51
- file =>
52
- file . filename === 'packages/next/src/client/components/app-router.tsx'
50
+ const relevantFiles = files . filter ( file =>
51
+ [
52
+ 'packages/next/src/client/components/app-router.tsx' ,
53
+ 'packages/next/src/client/components/search-params.ts' ,
54
+ 'packages/next/src/client/components/navigation.ts'
55
+ ] . includes ( file . filename )
53
56
)
54
- if ( ! appRouterFile ) {
55
- console . log ( 'No changes in app-router.tsx ' )
57
+ if ( relevantFiles . length === 0 ) {
58
+ console . log ( 'No relevant changes ' )
56
59
process . exit ( 0 )
57
60
}
58
- await sendNotificationEmail ( thisVersion , appRouterFile )
61
+ await sendNotificationEmail ( thisVersion , relevantFiles )
59
62
}
60
63
61
64
// --
@@ -78,28 +81,34 @@ function getPreviousVersion(version) {
78
81
/**
79
82
*
80
83
* @param {string } thisVersion
81
- * @param {z.infer<typeof fileSchema> } appRouterFile
84
+ * @param {z.infer<typeof fileSchema>[] } files
82
85
* @returns
83
86
*/
84
- async function sendNotificationEmail ( thisVersion , appRouterFile ) {
87
+ async function sendNotificationEmail ( thisVersion , files ) {
85
88
const client = new MailPace . DomainClient ( env . MAILPACE_API_TOKEN )
86
89
const release = await fetch (
87
90
`https://api.github.com/repos/vercel/next.js/releases/tags/v${ thisVersion } `
88
91
) . then ( res => res . json ( ) )
89
- const subject = `[nuqs] Next.js ${ thisVersion } has app router changes`
92
+ const subject = `[nuqs] Next.js ${ thisVersion } has relevant core changes`
93
+ const patchSection = files
94
+ . map ( file => {
95
+ if ( ! file . patch ) {
96
+ return `${ file . filename } : no patch available`
97
+ }
98
+ return `${ file . filename } :
99
+ \`\`\`diff
100
+ ${ file . patch }
101
+ \`\`\`
102
+ `
103
+ } )
104
+ . join ( '\n' )
105
+
90
106
const body = `Release: ${ release . html_url }
91
107
92
108
${ release . body }
93
109
---
94
110
95
- ${
96
- appRouterFile . patch
97
- ? `App router changes:
98
- \`\`\`diff
99
- ${ appRouterFile . patch }
100
- \`\`\``
101
- : 'No patch available'
102
- }
111
+ ${ patchSection }
103
112
`
104
113
console . info ( 'Sending email:' , subject )
105
114
console . info ( body )
0 commit comments