UNPKG

zyros

Version:

A developer-friendly static site generator built with Next.js and Tailwind CSS. Transform a simple JSON file into a beautiful, fast static website.

47 lines (39 loc) • 1.98 kB
#!/usr/bin/env node const { spawn } = require('child_process'); const fs = require('fs'); const path = require('path'); console.log('šŸš€ Starting zyros development server...\n'); // Check if site.json exists const siteJsonPath = path.join(process.cwd(), 'public', 'site.json'); if (!fs.existsSync(siteJsonPath)) { console.log('āš ļø No site.json found. Creating a sample configuration...\n'); const sampleConfig = { site: { title: "My Awesome Blog", theme: "ocean", description: "A beautiful static site built with zyros" }, pages: [ { title: "Welcome to zyros", slug: "welcome", description: "Get started with the most developer-friendly static site generator", content: "# Welcome to zyros\n\nCongratulations! You've successfully set up your new static site.\n\n## What's Next?\n\n1. **Customize your content** - Edit `public/site.json` to add your own pages\n2. **Choose a theme** - Try different themes like `dark`, `minimal`, `sunset`, or `neon`\n3. **Write in Markdown** - Use full Markdown syntax with code highlighting\n4. **Deploy anywhere** - Run `npm run export` to generate static files\n\n## Features\n\n- ⚔ Lightning fast static generation\n- šŸŽØ 8 beautiful themes\n- šŸ” Built-in search with ⌘+K\n- šŸ“± Mobile-first responsive design\n- 🌈 Dynamic theme switching\n\nHappy building! šŸŽ‰" } ] }; fs.writeFileSync(siteJsonPath, JSON.stringify(sampleConfig, null, 2)); console.log('āœ… Created sample site.json configuration\n'); } // Start the development server console.log('šŸ”„ Starting Next.js development server...\n'); const dev = spawn('npm', ['run', 'dev'], { stdio: 'inherit', shell: true }); dev.on('close', (code) => { console.log(`\nšŸ‘‹ Development server stopped with code ${code}`); }); dev.on('error', (err) => { console.error('āŒ Failed to start development server:', err); });