@@ -11,7 +11,7 @@ import {
1111const CACHE_HEADER = 's-maxage=3600, stale-while-revalidate=86400'
1212
1313/**
14- * Middleware to handle ALL llms.txt / llms_full .txt / .md routes.
14+ * Middleware to handle ALL llms.txt / llms-full .txt / .md routes.
1515 *
1616 * All llms.txt handling lives here rather than in file-based routes because
1717 * Vercel's ISR route rules with glob patterns (e.g. `/package/ ** /llms.txt`)
@@ -24,13 +24,13 @@ const CACHE_HEADER = 's-maxage=3600, stale-while-revalidate=86400'
2424 * - /package/@:org/:name.md (scoped, latest, raw README)
2525 * - /package/@:org/llms.txt (org package listing)
2626 * - /package/:name/llms.txt (unscoped, latest)
27- * - /package/:name/llms_full .txt (unscoped, latest, full)
27+ * - /package/:name/llms-full .txt (unscoped, latest, full)
2828 * - /package/@:org/:name/llms.txt (scoped, latest)
29- * - /package/@:org/:name/llms_full .txt (scoped, latest, full)
29+ * - /package/@:org/:name/llms-full .txt (scoped, latest, full)
3030 * - /package/:name/v/:version/llms.txt (unscoped, versioned)
31- * - /package/:name/v/:version/llms_full .txt (unscoped, versioned, full)
31+ * - /package/:name/v/:version/llms-full .txt (unscoped, versioned, full)
3232 * - /package/@:org/:name/v/:version/llms.txt (scoped, versioned)
33- * - /package/@:org/:name/v/:version/llms_full .txt (scoped, versioned, full)
33+ * - /package/@:org/:name/v/:version/llms-full .txt (scoped, versioned, full)
3434 */
3535export default defineEventHandler ( async event => {
3636 const path = event . path . split ( '?' ) [ 0 ] ?? '/'
@@ -58,10 +58,10 @@ export default defineEventHandler(async event => {
5858 }
5959 }
6060
61- if ( ! path . endsWith ( '/llms.txt' ) && ! path . endsWith ( '/llms_full .txt' ) ) return
61+ if ( ! path . endsWith ( '/llms.txt' ) && ! path . endsWith ( '/llms-full .txt' ) ) return
6262
63- const full = path . endsWith ( '/llms_full .txt' )
64- const suffix = full ? '/llms_full .txt' : '/llms.txt'
63+ const full = path . endsWith ( '/llms-full .txt' )
64+ const suffix = full ? '/llms-full .txt' : '/llms.txt'
6565
6666 // Root /llms.txt
6767 if ( path === '/llms.txt' ) {
@@ -129,7 +129,7 @@ export default defineEventHandler(async event => {
129129 } catch ( error : unknown ) {
130130 handleApiError ( error , {
131131 statusCode : 502 ,
132- message : `Failed to generate ${ full ? 'llms_full .txt' : 'llms.txt' } .` ,
132+ message : `Failed to generate ${ full ? 'llms-full .txt' : 'llms.txt' } .` ,
133133 } )
134134 }
135135} )
0 commit comments