|
|
@@ -21,10 +21,14 @@ const modelsData = process.env.MODELS_DEV_API_JSON
|
|
|
? await Bun.file(process.env.MODELS_DEV_API_JSON).text()
|
|
|
: await fetch(`${modelsUrl}/api.json`).then((x) => x.text())
|
|
|
await Bun.write(
|
|
|
- path.join(dir, "src/provider/models-snapshot.ts"),
|
|
|
- `// Auto-generated by build.ts - do not edit\nexport const snapshot = ${modelsData} as const\n`,
|
|
|
+ path.join(dir, "src/provider/models-snapshot.js"),
|
|
|
+ `// @ts-nocheck\n// Auto-generated by build.ts - do not edit\nexport const snapshot = ${modelsData}\n`,
|
|
|
)
|
|
|
-console.log("Generated models-snapshot.ts")
|
|
|
+await Bun.write(
|
|
|
+ path.join(dir, "src/provider/models-snapshot.d.ts"),
|
|
|
+ `// Auto-generated by build.ts - do not edit\nexport declare const snapshot: Record<string, unknown>\n`,
|
|
|
+)
|
|
|
+console.log("Generated models-snapshot.js")
|
|
|
|
|
|
// Load migrations from migration directories
|
|
|
const migrationDirs = (
|