create-oven 0.2.2 → 0.2.3
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 +7 -41
- 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.3');
|
|
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.3 ║
|
|
142
142
|
║ ║
|
|
143
143
|
║ Next.js-style framework for Bun ║
|
|
144
144
|
║ ║
|
|
@@ -361,36 +361,6 @@ export default config;
|
|
|
361
361
|
// Create app files
|
|
362
362
|
const spin3 = spinner('Creating app files...');
|
|
363
363
|
|
|
364
|
-
// Types
|
|
365
|
-
const typesContent = `export interface PageProps {
|
|
366
|
-
params: Record<string, string>;
|
|
367
|
-
searchParams: Record<string, string | string[] | undefined>;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
export interface LayoutProps {
|
|
371
|
-
children: ${useTypescript ? 'string' : 'any'};
|
|
372
|
-
params: Record<string, string>;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
export interface Metadata {
|
|
376
|
-
title?: string | { default: string; template?: string };
|
|
377
|
-
description?: string;
|
|
378
|
-
keywords?: string[];
|
|
379
|
-
openGraph?: {
|
|
380
|
-
title?: string;
|
|
381
|
-
description?: string;
|
|
382
|
-
images?: { url: string }[];
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
export interface OvenConfig {
|
|
387
|
-
port?: number;
|
|
388
|
-
appDir?: string;
|
|
389
|
-
publicDir?: string;
|
|
390
|
-
}
|
|
391
|
-
`;
|
|
392
|
-
fs.writeFileSync(path.join(appDir, `types.${ext}`), typesContent);
|
|
393
|
-
|
|
394
364
|
// globals.css
|
|
395
365
|
const globalsCss = useTailwind ? `@tailwind base;
|
|
396
366
|
@tailwind components;
|
|
@@ -442,8 +412,7 @@ a {
|
|
|
442
412
|
fs.writeFileSync(path.join(projectDir, 'public', '.gitkeep'), '');
|
|
443
413
|
|
|
444
414
|
// Root Layout
|
|
445
|
-
const layoutContent = `import
|
|
446
|
-
import './globals.css';
|
|
415
|
+
const layoutContent = `import './globals.css';
|
|
447
416
|
|
|
448
417
|
export const metadata = {
|
|
449
418
|
title: {
|
|
@@ -453,7 +422,7 @@ export const metadata = {
|
|
|
453
422
|
description: 'Built with Oven - A Next.js-style framework for Bun',
|
|
454
423
|
};
|
|
455
424
|
|
|
456
|
-
export default function RootLayout({ children }${useTypescript ? ':
|
|
425
|
+
export default function RootLayout({ children }${useTypescript ? ': { children: string }' : ''}) {
|
|
457
426
|
return \`
|
|
458
427
|
<!DOCTYPE html>
|
|
459
428
|
<html lang="en">
|
|
@@ -472,14 +441,12 @@ export default function RootLayout({ children }${useTypescript ? ': LayoutProps'
|
|
|
472
441
|
fs.writeFileSync(path.join(appDir, `layout.${ext}x`), layoutContent);
|
|
473
442
|
|
|
474
443
|
// Home Page
|
|
475
|
-
const homePageContent = `
|
|
476
|
-
|
|
477
|
-
export const metadata${useTypescript ? ': Metadata' : ''} = {
|
|
444
|
+
const homePageContent = `export const metadata = {
|
|
478
445
|
title: 'Home',
|
|
479
446
|
description: 'Welcome to ${projectName}',
|
|
480
447
|
};
|
|
481
448
|
|
|
482
|
-
export default function HomePage(
|
|
449
|
+
export default function HomePage() {
|
|
483
450
|
return \`
|
|
484
451
|
<main ${useTailwind ? 'class="flex min-h-screen flex-col items-center justify-center p-24"' : 'style="display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 6rem;"'}>
|
|
485
452
|
<div ${useTailwind ? 'class="text-center"' : 'style="text-align: center;"'}>
|
|
@@ -722,8 +689,7 @@ ${projectName}/
|
|
|
722
689
|
├── ${useSrcDir ? 'src/' : ''}app/
|
|
723
690
|
│ ├── layout.${ext}x # Root layout
|
|
724
691
|
│ ├── page.${ext}x # Home page (/)
|
|
725
|
-
│
|
|
726
|
-
│ └── types.${ext} # TypeScript types
|
|
692
|
+
│ └── globals.css # Global styles
|
|
727
693
|
├── public/ # Static files
|
|
728
694
|
${useTailwind ? '├── tailwind.config.js # Tailwind config\n' : ''}├── oven.config.${ext} # Oven config
|
|
729
695
|
└── package.json
|