#!/usr/bin/env node /** * WordPress-specific build script for TigerStyle Life9 * * This script compiles Astro pages into WordPress-compatible HTML and assets */ import { fileURLToPath } from 'url'; import { dirname, join } from 'path'; import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const srcDir = join(__dirname, 'src/astro/pages'); const outDir = join(__dirname, 'admin/assets/dist'); // Ensure output directory exists if (!existsSync(outDir)) { mkdirSync(outDir, { recursive: true }); } // Create a simple manifest for WordPress const manifest = { 'admin-dashboard.html': { isEntry: true, src: 'src/astro/pages/admin-dashboard.astro' }, 'backup.html': { isEntry: true, src: 'src/astro/pages/backup.astro' }, 'restore.html': { isEntry: true, src: 'src/astro/pages/restore.astro' }, 'settings.html': { isEntry: true, src: 'src/astro/pages/settings.astro' } }; // Write manifest writeFileSync( join(outDir, 'manifest.json'), JSON.stringify(manifest, null, 2) ); console.log('✅ WordPress build manifest created!'); console.log('📁 Files in output directory:', outDir); console.log('📄 Manifest created with page entries'); console.log('\nNote: For now, Astro pages will be rendered server-side by WordPress.'); console.log('The PHP admin class will handle loading and rendering the .astro files.');