create-oven 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -95
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -131,14 +131,14 @@ async function main() {
|
|
|
131
131
|
|
|
132
132
|
// Show version
|
|
133
133
|
if (args.includes('--version') || args.includes('-v')) {
|
|
134
|
-
console.log('create-oven v0.2.
|
|
134
|
+
console.log('create-oven v0.2.2');
|
|
135
135
|
process.exit(0);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
console.log(`
|
|
139
139
|
${c.bold}${c.cyan} ╔═══════════════════════════════════════╗
|
|
140
140
|
║ ║
|
|
141
|
-
║ 🔥 Create Oven App v0.2.
|
|
141
|
+
║ 🔥 Create Oven App v0.2.2 ║
|
|
142
142
|
║ ║
|
|
143
143
|
║ Next.js-style framework for Bun ║
|
|
144
144
|
║ ║
|
|
@@ -216,8 +216,6 @@ ${c.bold}${c.cyan} ╔═══════════════════
|
|
|
216
216
|
// Create directories
|
|
217
217
|
const dirs = [
|
|
218
218
|
appDir,
|
|
219
|
-
path.join(appDir, 'api', 'hello'),
|
|
220
|
-
path.join(appDir, 'about'),
|
|
221
219
|
path.join(projectDir, 'public'),
|
|
222
220
|
];
|
|
223
221
|
|
|
@@ -497,11 +495,8 @@ export default function HomePage({ searchParams }${useTypescript ? ': PageProps'
|
|
|
497
495
|
</p>
|
|
498
496
|
|
|
499
497
|
<div ${useTailwind ? 'class="flex gap-4 flex-wrap justify-center"' : 'style="display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center;"'}>
|
|
500
|
-
<a href="/
|
|
501
|
-
|
|
502
|
-
</a>
|
|
503
|
-
<a href="/api/hello" ${useTailwind ? 'class="px-6 py-3 bg-gray-900 text-white rounded-lg font-medium hover:bg-gray-800 transition"' : 'style="padding: 0.75rem 1.5rem; background: #1a1a1a; color: white; border-radius: 8px; font-weight: 500;"'}>
|
|
504
|
-
API Example
|
|
498
|
+
<a href="https://github.com/oven-ttta/oven-framework" target="_blank" ${useTailwind ? 'class="px-6 py-3 bg-gradient-to-r from-oven-400 to-oven-500 text-white rounded-lg font-medium hover:opacity-90 transition"' : 'style="padding: 0.75rem 1.5rem; background: linear-gradient(135deg, #ff6b35, #f7931e); color: white; border-radius: 8px; font-weight: 500;"'}>
|
|
499
|
+
Documentation →
|
|
505
500
|
</a>
|
|
506
501
|
<a href="https://github.com/oven-ttta/oven-framework" target="_blank" ${useTailwind ? 'class="px-6 py-3 border border-gray-300 rounded-lg font-medium hover:border-gray-400 transition"' : 'style="padding: 0.75rem 1.5rem; border: 1px solid #ddd; border-radius: 8px; font-weight: 500;"'}>
|
|
507
502
|
GitHub ⭐
|
|
@@ -537,87 +532,6 @@ export default function HomePage({ searchParams }${useTypescript ? ': PageProps'
|
|
|
537
532
|
`;
|
|
538
533
|
fs.writeFileSync(path.join(appDir, `page.${ext}x`), homePageContent);
|
|
539
534
|
|
|
540
|
-
// About Page
|
|
541
|
-
const aboutPageContent = `import${useTypescript ? ' type' : ''} { PageProps, Metadata } from '../types';
|
|
542
|
-
|
|
543
|
-
export const metadata${useTypescript ? ': Metadata' : ''} = {
|
|
544
|
-
title: 'About',
|
|
545
|
-
description: 'About ${projectName}',
|
|
546
|
-
};
|
|
547
|
-
|
|
548
|
-
export default function AboutPage({ params }${useTypescript ? ': PageProps' : ''}) {
|
|
549
|
-
return \`
|
|
550
|
-
<main ${useTailwind ? 'class="max-w-4xl mx-auto px-6 py-16"' : 'style="max-width: 900px; margin: 0 auto; padding: 4rem 1.5rem;"'}>
|
|
551
|
-
<a href="/" ${useTailwind ? 'class="text-oven-400 hover:underline mb-8 inline-block"' : 'style="color: #ff6b35; margin-bottom: 2rem; display: inline-block;"'}>
|
|
552
|
-
← Back to Home
|
|
553
|
-
</a>
|
|
554
|
-
|
|
555
|
-
<h1 ${useTailwind ? 'class="text-4xl font-bold mb-6"' : 'style="font-size: 2.5rem; font-weight: bold; margin-bottom: 1.5rem;"'}>
|
|
556
|
-
About ${projectName}
|
|
557
|
-
</h1>
|
|
558
|
-
|
|
559
|
-
<p ${useTailwind ? 'class="text-lg text-gray-600 mb-8 leading-relaxed"' : 'style="font-size: 1.1rem; color: #666; margin-bottom: 2rem; line-height: 1.8;"'}>
|
|
560
|
-
This project was bootstrapped with <strong>create-oven</strong>,
|
|
561
|
-
a Next.js-style framework powered by the Bun runtime.
|
|
562
|
-
</p>
|
|
563
|
-
|
|
564
|
-
<div ${useTailwind ? 'class="bg-oven-50 border-l-4 border-oven-400 p-6 rounded-r-lg mb-8"' : 'style="background: #fff5f2; border-left: 4px solid #ff6b35; padding: 1.5rem; border-radius: 0 8px 8px 0; margin-bottom: 2rem;"'}>
|
|
565
|
-
<h2 ${useTailwind ? 'class="text-xl font-semibold mb-4"' : 'style="font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem;"'}>
|
|
566
|
-
🚀 Why Oven?
|
|
567
|
-
</h2>
|
|
568
|
-
<ul ${useTailwind ? 'class="space-y-2 text-gray-700"' : 'style="list-style: none;"'}>
|
|
569
|
-
<li ${useTailwind ? '' : 'style="margin-bottom: 0.5rem; color: #444;"'}>✓ Built for Bun runtime - 4x faster than Node.js</li>
|
|
570
|
-
<li ${useTailwind ? '' : 'style="margin-bottom: 0.5rem; color: #444;"'}>✓ Next.js-style file-based routing</li>
|
|
571
|
-
<li ${useTailwind ? '' : 'style="margin-bottom: 0.5rem; color: #444;"'}>✓ Zero configuration needed</li>
|
|
572
|
-
<li ${useTailwind ? '' : 'style="margin-bottom: 0.5rem; color: #444;"'}>✓ Full TypeScript support</li>
|
|
573
|
-
${useTailwind ? "<li>✓ Tailwind CSS integration</li>" : ""}
|
|
574
|
-
</ul>
|
|
575
|
-
</div>
|
|
576
|
-
|
|
577
|
-
<h2 ${useTailwind ? 'class="text-2xl font-semibold mb-4"' : 'style="font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem;"'}>
|
|
578
|
-
Learn More
|
|
579
|
-
</h2>
|
|
580
|
-
|
|
581
|
-
<div ${useTailwind ? 'class="flex gap-4 flex-wrap"' : 'style="display: flex; gap: 1rem; flex-wrap: wrap;"'}>
|
|
582
|
-
<a href="https://github.com/oven-ttta/oven-framework" target="_blank"
|
|
583
|
-
${useTailwind ? 'class="px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition"' : 'style="padding: 0.5rem 1rem; background: #1a1a1a; color: white; border-radius: 8px;"'}>
|
|
584
|
-
GitHub
|
|
585
|
-
</a>
|
|
586
|
-
<a href="https://bun.sh/docs" target="_blank"
|
|
587
|
-
${useTailwind ? 'class="px-4 py-2 border border-gray-300 rounded-lg hover:border-gray-400 transition"' : 'style="padding: 0.5rem 1rem; border: 1px solid #ddd; border-radius: 8px;"'}>
|
|
588
|
-
Bun Docs
|
|
589
|
-
</a>
|
|
590
|
-
</div>
|
|
591
|
-
</main>
|
|
592
|
-
\`;
|
|
593
|
-
}
|
|
594
|
-
`;
|
|
595
|
-
fs.writeFileSync(path.join(appDir, 'about', `page.${ext}x`), aboutPageContent);
|
|
596
|
-
|
|
597
|
-
// API Route
|
|
598
|
-
const apiRouteContent = `// API Route: GET /api/hello
|
|
599
|
-
|
|
600
|
-
export async function GET(request${useTypescript ? ': Request' : ''}) {
|
|
601
|
-
return Response.json({
|
|
602
|
-
message: 'Hello from ${projectName}!',
|
|
603
|
-
timestamp: new Date().toISOString(),
|
|
604
|
-
framework: 'Oven 🔥',
|
|
605
|
-
runtime: 'Bun',
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
export async function POST(request${useTypescript ? ': Request' : ''}) {
|
|
610
|
-
const body = await request.json().catch(() => ({}));
|
|
611
|
-
|
|
612
|
-
return Response.json({
|
|
613
|
-
message: 'Data received!',
|
|
614
|
-
data: body,
|
|
615
|
-
timestamp: new Date().toISOString(),
|
|
616
|
-
}, { status: 201 });
|
|
617
|
-
}
|
|
618
|
-
`;
|
|
619
|
-
fs.writeFileSync(path.join(appDir, 'api', 'hello', `route.${ext}`), apiRouteContent);
|
|
620
|
-
|
|
621
535
|
// Server file
|
|
622
536
|
const serverContent = `/**
|
|
623
537
|
* Oven Server - ${projectName}
|
|
@@ -809,11 +723,7 @@ ${projectName}/
|
|
|
809
723
|
│ ├── layout.${ext}x # Root layout
|
|
810
724
|
│ ├── page.${ext}x # Home page (/)
|
|
811
725
|
│ ├── globals.css # Global styles
|
|
812
|
-
│
|
|
813
|
-
│ │ └── page.${ext}x # About page (/about)
|
|
814
|
-
│ └── api/
|
|
815
|
-
│ └── hello/
|
|
816
|
-
│ └── route.${ext} # API route (/api/hello)
|
|
726
|
+
│ └── types.${ext} # TypeScript types
|
|
817
727
|
├── public/ # Static files
|
|
818
728
|
${useTailwind ? '├── tailwind.config.js # Tailwind config\n' : ''}├── oven.config.${ext} # Oven config
|
|
819
729
|
└── package.json
|