@pyreon/create-zero 0.4.1 → 0.11.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.
@@ -1,16 +1,16 @@
1
- import { useHead } from '@pyreon/head'
2
- import { Link } from '@pyreon/zero/link'
3
- import { posts } from '../../features/posts'
1
+ import { useHead } from "@pyreon/head"
2
+ import { Link } from "@pyreon/zero/link"
3
+ import { posts } from "../../features/posts"
4
4
 
5
5
  export default function NewPostPage() {
6
6
  useHead({
7
- title: 'New Post — Pyreon Zero',
8
- meta: [{ name: 'description', content: 'Create a new post.' }],
7
+ title: "New Post — Pyreon Zero",
8
+ meta: [{ name: "description", content: "Create a new post." }],
9
9
  })
10
10
 
11
11
  const form = posts.useForm({
12
12
  onSuccess: () => {
13
- window.location.href = '/posts'
13
+ window.location.href = "/posts"
14
14
  },
15
15
  })
16
16
 
@@ -25,31 +25,27 @@ export default function NewPostPage() {
25
25
 
26
26
  <h1>New Post</h1>
27
27
  <p style="color: var(--c-text-muted); margin-bottom: var(--space-xl);">
28
- This form is powered by <code>@pyreon/feature</code> +{' '}
29
- <code>@pyreon/form</code> + <code>@pyreon/validation</code> with
30
- automatic Zod schema validation.
28
+ This form is powered by <code>@pyreon/feature</code> + <code>@pyreon/form</code> +{" "}
29
+ <code>@pyreon/validation</code> with automatic Zod schema validation.
31
30
  </p>
32
31
 
33
32
  <form onSubmit={(e: Event) => form.handleSubmit(e)}>
34
33
  <div class="form-field">
35
34
  <label for="title">Title</label>
36
- <input id="title" {...form.register('title', {})} />
35
+ <input id="title" {...(form.register("title") as any)} />
37
36
  </div>
38
37
  <div class="form-field">
39
38
  <label for="body">Body</label>
40
- <textarea id="body" rows={6} {...form.register('body', {})} />
39
+ <textarea id="body" rows={6} {...(form.register("body") as any)} />
41
40
  </div>
42
41
  <div class="form-field">
43
42
  <label class="checkbox-label">
44
- <input
45
- type="checkbox"
46
- {...form.register('published', { type: 'checkbox' })}
47
- />
43
+ <input type="checkbox" {...(form.register("published", { type: "checkbox" }) as any)} />
48
44
  Published
49
45
  </label>
50
46
  </div>
51
47
  <button type="submit" class="btn" disabled={form.isSubmitting()}>
52
- {() => (form.isSubmitting() ? 'Creating...' : 'Create Post')}
48
+ {() => (form.isSubmitting() ? "Creating..." : "Create Post")}
53
49
  </button>
54
50
  </form>
55
51
  </div>
@@ -1,6 +1,6 @@
1
- import { defineStore, signal } from '@pyreon/store'
1
+ import { defineStore, signal } from "@pyreon/store"
2
2
 
3
- export const useAppStore = defineStore('app', () => {
3
+ export const useAppStore = defineStore("app", () => {
4
4
  const sidebarOpen = signal(true)
5
5
  const toggleSidebar = () => sidebarOpen.update((v) => !v)
6
6
  return { sidebarOpen, toggleSidebar }
@@ -1,28 +1,28 @@
1
- import pyreon from '@pyreon/vite-plugin'
2
- import zero from '@pyreon/zero'
3
- import { fontPlugin } from '@pyreon/zero/font'
4
- import { seoPlugin } from '@pyreon/zero/seo'
1
+ import pyreon from "@pyreon/vite-plugin"
2
+ import zero from "@pyreon/zero"
3
+ import { fontPlugin } from "@pyreon/zero/font"
4
+ import { seoPlugin } from "@pyreon/zero/seo"
5
5
 
6
6
  export default {
7
7
  plugins: [
8
8
  pyreon(),
9
- zero({ mode: 'ssr', ssr: { mode: 'stream' } }),
9
+ zero({ mode: "ssr", ssr: { mode: "stream" } }),
10
10
 
11
11
  // Google Fonts — self-hosted at build time, CDN in dev
12
12
  fontPlugin({
13
- google: ['Inter:wght@400;500;600;700;800', 'JetBrains Mono:wght@400'],
13
+ google: ["Inter:wght@400;500;600;700;800", "JetBrains Mono:wght@400"],
14
14
  // Size-adjusted fallbacks to eliminate CLS while fonts load
15
15
  fallbacks: {
16
- Inter: { fallback: 'Arial', sizeAdjust: 1.07, ascentOverride: 90 },
16
+ Inter: { fallback: "Arial", sizeAdjust: 1.07, ascentOverride: 90 },
17
17
  },
18
18
  }),
19
19
 
20
20
  // Generate sitemap.xml and robots.txt at build time
21
21
  seoPlugin({
22
- sitemap: { origin: 'https://example.com' },
22
+ sitemap: { origin: "https://example.com" },
23
23
  robots: {
24
- rules: [{ userAgent: '*', allow: ['/'] }],
25
- sitemap: 'https://example.com/sitemap.xml',
24
+ rules: [{ userAgent: "*", allow: ["/"] }],
25
+ sitemap: "https://example.com/sitemap.xml",
26
26
  },
27
27
  }),
28
28
  ],