create-fiyuu-app 0.4.1 → 0.5.0

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.
@@ -987,7 +987,7 @@ export const description = "Loads starter websocket metadata for the live counte
987
987
 
988
988
  function createLivePage() {
989
989
  return `import { Component } from "@geajs/core";
990
- import { definePage, escapeHtml, html, type PageProps } from "fiyuu/client";
990
+ import { definePage, escapeHtml, html, raw, type PageProps } from "fiyuu/client";
991
991
 
992
992
  type LiveData = {
993
993
  initialCount: number;
@@ -1279,73 +1279,64 @@ export const description = "Loads the starter content for the Fiyuu home page";
1279
1279
  }
1280
1280
 
1281
1281
  function createHomePage(answers) {
1282
- const themeMainClasses = answers.theming
1283
- ? 'min-h-screen bg-[linear-gradient(180deg,#f7f3ea_0%,#f1ebde_58%,#e9e0d0_100%)] px-4 py-4 text-[#33412f] dark:bg-[linear-gradient(180deg,#121614_0%,#171f1a_100%)] dark:text-[#e6efe8] sm:px-6 sm:py-5'
1284
- : 'min-h-screen bg-[linear-gradient(180deg,#f7f3ea_0%,#f1ebde_58%,#e9e0d0_100%)] px-4 py-4 text-[#33412f] sm:px-6 sm:py-5';
1285
- const themeSectionClasses = answers.theming
1286
- ? 'flex min-h-[calc(100vh-2rem)] w-full flex-col justify-between rounded-[1.5rem] border border-[#7a8f6b]/20 bg-[#f8f4ec]/80 p-5 dark:border-[#4f6756]/35 dark:bg-[#1b241f]/90 sm:min-h-[calc(100vh-2.5rem)] sm:p-7'
1287
- : 'flex min-h-[calc(100vh-2rem)] w-full flex-col justify-between rounded-[1.5rem] border border-[#7a8f6b]/20 bg-[#f8f4ec]/80 p-5 sm:min-h-[calc(100vh-2.5rem)] sm:p-7';
1288
- const themeNav = answers.theming
1289
- ? '<nav class="flex items-center justify-between"><p class="text-xs uppercase tracking-[0.22em] text-[#627356] dark:text-[#95b39d]">Fiyuu starter</p><button id="fiyuu-theme-toggle" type="button" class="rounded-full border border-[#7a8f6b]/20 px-3 py-1 text-xs text-[#43523f] dark:border-[#6f8d77]/30 dark:text-[#d1e3d6]">Dark</button></nav>'
1290
- : '<p class="text-xs uppercase tracking-[0.22em] text-[#627356]">Fiyuu starter</p>';
1291
1282
  const themeScript = answers.theming
1292
- ? "const root=document.documentElement;const button=document.getElementById('fiyuu-theme-toggle');const saved=localStorage.getItem('fiyuu-theme');const initial=saved||'light';if(initial==='dark'){root.classList.add('dark');}if(button){button.textContent=root.classList.contains('dark')?'Light':'Dark';button.addEventListener('click',()=>{const next=root.classList.contains('dark')?'light':'dark';root.classList.toggle('dark',next==='dark');localStorage.setItem('fiyuu-theme',next);button.textContent=next==='dark'?'Light':'Dark';});}"
1283
+ ? `const root=document.documentElement;const saved=localStorage.getItem('fiyuu-theme');const prefersDark=window.matchMedia('(prefers-color-scheme: dark)').matches;if(saved==='dark'||(!saved&&prefersDark)){root.classList.add('dark');}`
1293
1284
  : "";
1285
+
1294
1286
  return `import { Component } from "@geajs/core";
1295
- import { definePage, escapeHtml, html, type PageProps } from "fiyuu/client";
1296
-
1297
- type HomeData = {
1298
- stats: Array<{
1299
- label: string;
1300
- value: string;
1301
- }>;
1302
- skills: string[];
1303
- };
1287
+ import { definePage, html, type PageProps } from "fiyuu/client";
1304
1288
 
1305
1289
  export const page = definePage({
1306
- intent: "Minimal one-page home route for a focused Fiyuu starter",
1290
+ intent: "Simple one-page personal site",
1307
1291
  });
1308
1292
 
1309
- export default class Page extends Component<PageProps<HomeData>> {
1310
- template({ data }: PageProps<HomeData> = this.props) {
1311
- const statsHtml = (data?.stats ?? [])
1312
- .map(
1313
- (item) => html\`<div class="rounded-xl border border-[#7a8f6b]/18 bg-[#fcfaf5] px-4 py-3"><p class="text-[11px] uppercase tracking-[0.2em] text-[#708067]">\${escapeHtml(item.label)}</p><p class="mt-1 text-2xl font-semibold text-[#263320]">\${escapeHtml(item.value)}</p></div>\`,
1314
- )
1315
- .join("");
1316
- const skillsHtml = (data?.skills ?? [])
1317
- .map((skill) => html\`<span class="rounded-full border border-[#7a8f6b]/20 px-3 py-1 text-xs text-[#44513f]">\${escapeHtml(skill)}</span>\`)
1318
- .join("");
1319
- const explainHtml = [
1320
- { title: "Single structure", body: "Routes, queries, actions, and metadata live in predictable folders." },
1321
- { title: "AI-readable", body: "Project docs and contracts stay explicit so assistants can reason safely." },
1322
- { title: "Gea-first runtime", body: "Rendering is optimized for Gea components with deterministic behavior." },
1323
- ]
1324
- .map((item) => html\`<article class="rounded-xl border border-[#7a8f6b]/16 bg-[#fcfaf5] px-4 py-4"><h2 class="text-sm font-semibold text-[#24311f]">\${item.title}</h2><p class="mt-2 text-sm leading-6 text-[#5c6955]">\${item.body}</p></article>\`)
1325
- .join("");
1326
- return html\`
1327
- <main class="${themeMainClasses}">
1328
- <section class="${themeSectionClasses}">
1329
- ${themeNav}
1330
- <header>
1331
- <h1 class="mt-3 text-4xl font-semibold tracking-tight text-[#24311f] dark:text-[#ecf5ef] sm:text-5xl lg:text-6xl">Fiyuu is a structured fullstack framework for humans and AI.</h1>
1332
- <p class="mt-4 max-w-4xl text-base leading-7 text-[#56654e] dark:text-[#b9cabc] sm:text-lg">It keeps route UI, server logic, and metadata in one deterministic layout so teams ship faster without losing clarity.</p>
1333
- </header>
1334
- <div class="mt-5 grid gap-3 lg:grid-cols-3">\${explainHtml}</div>
1335
- <div class="grid gap-3 sm:grid-cols-2 lg:grid-cols-4">\${statsHtml}</div>
1336
- <footer class="mt-5 flex flex-wrap items-center justify-between gap-3 border-t border-[#7a8f6b]/15 pt-4">
1337
- <p class="text-sm text-[#5f6d58] dark:text-[#acc1b1]">AI-first fullstack framework structure with deterministic routing.</p>
1338
- <div class="flex flex-wrap gap-2">\${skillsHtml}</div>
1339
- </footer>
1340
- </section>
1293
+ export default class HomePage extends Component<PageProps> {
1294
+ template() {
1295
+ return html\\`
1296
+ <main class="min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 flex items-center justify-center p-6">
1297
+ <div class="max-w-md w-full text-center">
1298
+ <div class="mb-8">
1299
+ <div class="w-24 h-24 mx-auto mb-4 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white text-2xl font-bold shadow-lg">
1300
+ YN
1301
+ </div>
1302
+ <h1 class="text-3xl font-bold text-slate-800 dark:text-white mb-2">
1303
+ Your Name
1304
+ </h1>
1305
+ <p class="text-slate-600 dark:text-slate-300">
1306
+ Developer & Creator
1307
+ </p>
1308
+ </div>
1309
+
1310
+ <p class="text-slate-600 dark:text-slate-300 mb-8 leading-relaxed">
1311
+ Building things with code. Focused on creating simple, beautiful, and functional web experiences.
1312
+ </p>
1313
+
1314
+ <div class="space-y-3">
1315
+ <a href="https://github.com" target="_blank" rel="noopener"
1316
+ class="block w-full py-3 px-6 rounded-xl bg-slate-800 dark:bg-white text-white dark:text-slate-900 font-medium hover:opacity-90 transition-opacity shadow-md">
1317
+ GitHub
1318
+ </a>
1319
+ <a href="https://twitter.com" target="_blank" rel="noopener"
1320
+ class="block w-full py-3 px-6 rounded-xl bg-blue-500 text-white font-medium hover:opacity-90 transition-opacity shadow-md">
1321
+ Twitter
1322
+ </a>
1323
+ <a href="mailto:hello@example.com"
1324
+ class="block w-full py-3 px-6 rounded-xl border-2 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-200 font-medium hover:border-slate-400 dark:hover:border-slate-500 transition-colors">
1325
+ Contact
1326
+ </a>
1327
+ </div>
1328
+
1329
+ <p class="mt-8 text-sm text-slate-400 dark:text-slate-500">
1330
+ Built with Fiyuu
1331
+ </p>
1332
+ </div>
1341
1333
  </main>
1342
- ${answers.theming ? `<script type="module">${themeScript}</script>` : ''}
1343
- \`;
1334
+ ${answers.theming ? `<script>${themeScript}</script>` : ''}
1335
+ \\`;
1344
1336
  }
1345
1337
  }
1346
1338
  `;
1347
1339
  }
1348
-
1349
1340
  function createF1Schema() {
1350
1341
  return `message TodoDraft {
1351
1342
  string id = 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fiyuu-app",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "create-fiyuu-app": "./bin/create-fiyuu-app.mjs"