accounts/dashboard-fresh/scripts/build.ts
Haitao Pan 9c877ceb3c feat(dashboard-fresh): migrate and integrate dashboard source
- Add fresh app structure (auth, tenant, mail, insight, docs, panel)
- Include CMS content, API routes, scripts, and config
- Migrate UI components, themes, and extensions to fresh runtime
2025-11-04 18:06:21 +08:00

48 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env -S deno run --allow-all
/**
* Main build script for Fresh + Deno dashboard
* Runs all prebuild steps and prepares static assets
*/
console.log('🏗️ Building dashboard-fresh...\n')
const steps = [
{ name: 'Template Manifest', script: 'scripts/build-manifest.ts' },
{ name: 'Export Slugs', script: 'scripts/export-slugs.ts' },
{ name: 'Scan Markdown', script: 'scripts/scan-md.ts' },
{ name: 'Fetch Download Index', script: 'scripts/fetch-dl-index.ts' },
]
let failed = false
for (const step of steps) {
console.log(`📦 ${step.name}...`)
const command = new Deno.Command('deno', {
args: ['run', '-A', step.script],
stdout: 'inherit',
stderr: 'inherit',
})
const process = command.spawn()
const status = await process.status
if (!status.success) {
console.error(`${step.name} failed`)
failed = true
break
}
console.log(`${step.name} completed\n`)
}
if (failed) {
console.error('\n❌ Build failed!')
Deno.exit(1)
} else {
console.log('🎉 Build completed successfully!')
console.log('\n📁 Static assets generated in: static/_build/')
console.log('\n▶ Run `deno task start` to start the server')
}