File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,10 +21,14 @@ const modelsData = process.env.MODELS_DEV_API_JSON
2121 ? await Bun . file ( process . env . MODELS_DEV_API_JSON ) . text ( )
2222 : await fetch ( `${ modelsUrl } /api.json` ) . then ( ( x ) => x . text ( ) )
2323await Bun . write (
24- path . join ( dir , "src/provider/models-snapshot.ts " ) ,
25- `// Auto-generated by build.ts - do not edit\nexport const snapshot = ${ modelsData } as const \n` ,
24+ path . join ( dir , "src/provider/models-snapshot.js " ) ,
25+ `// @ts-nocheck\n// Auto-generated by build.ts - do not edit\nexport const snapshot = ${ modelsData } \n` ,
2626)
27- console . log ( "Generated models-snapshot.ts" )
27+ await Bun . write (
28+ path . join ( dir , "src/provider/models-snapshot.d.ts" ) ,
29+ `// Auto-generated by build.ts - do not edit\nexport declare const snapshot: Record<string, unknown>\n` ,
30+ )
31+ console . log ( "Generated models-snapshot.js" )
2832
2933// Load migrations from migration directories
3034const migrationDirs = (
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ export namespace ModelsDev {
8989 const result = await Filesystem . readJson ( Flag . OPENCODE_MODELS_PATH ?? filepath ) . catch ( ( ) => { } )
9090 if ( result ) return result
9191 // @ts -ignore
92- const snapshot = await import ( "./models-snapshot" )
92+ const snapshot = await import ( "./models-snapshot.js " )
9393 . then ( ( m ) => m . snapshot as Record < string , unknown > )
9494 . catch ( ( ) => undefined )
9595 if ( snapshot ) return snapshot
You can’t perform that action at this time.
0 commit comments