@pyreon/create-zero 0.14.0 → 0.15.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.
Files changed (65) hide show
  1. package/README.md +85 -22
  2. package/bin/create-pyreon-app.js +2 -0
  3. package/lib/index.js +1254 -191
  4. package/package.json +5 -2
  5. package/templates/{default → app}/src/routes/_layout.tsx +5 -2
  6. package/templates/blog/.mcp.json +8 -0
  7. package/templates/blog/CLAUDE.md +59 -0
  8. package/templates/blog/index.html +18 -0
  9. package/templates/blog/public/favicon.svg +4 -0
  10. package/templates/blog/src/content/posts/static-vs-ssr.tsx +54 -0
  11. package/templates/blog/src/content/posts/welcome.tsx +70 -0
  12. package/templates/blog/src/content/posts/why-signals.tsx +57 -0
  13. package/templates/blog/src/entry-client.ts +5 -0
  14. package/templates/blog/src/global.css +292 -0
  15. package/templates/blog/src/lib/posts.ts +45 -0
  16. package/templates/blog/src/routes/_layout.tsx +40 -0
  17. package/templates/blog/src/routes/about.tsx +28 -0
  18. package/templates/blog/src/routes/api/rss.ts +55 -0
  19. package/templates/blog/src/routes/blog/[slug].tsx +67 -0
  20. package/templates/blog/src/routes/blog/index.tsx +43 -0
  21. package/templates/blog/src/routes/index.tsx +52 -0
  22. package/templates/blog/tsconfig.json +16 -0
  23. package/templates/dashboard/.mcp.json +8 -0
  24. package/templates/dashboard/CLAUDE.md +50 -0
  25. package/templates/dashboard/index.html +16 -0
  26. package/templates/dashboard/public/favicon.svg +4 -0
  27. package/templates/dashboard/src/entry-client.ts +5 -0
  28. package/templates/dashboard/src/global.css +451 -0
  29. package/templates/dashboard/src/lib/auth.ts +106 -0
  30. package/templates/dashboard/src/lib/db.ts +118 -0
  31. package/templates/dashboard/src/routes/_layout.tsx +28 -0
  32. package/templates/dashboard/src/routes/api/signout.ts +15 -0
  33. package/templates/dashboard/src/routes/app/_layout.tsx +76 -0
  34. package/templates/dashboard/src/routes/app/dashboard.tsx +92 -0
  35. package/templates/dashboard/src/routes/app/invoices/[id].tsx +197 -0
  36. package/templates/dashboard/src/routes/app/invoices/index.tsx +61 -0
  37. package/templates/dashboard/src/routes/app/settings/account.tsx +31 -0
  38. package/templates/dashboard/src/routes/app/settings/billing.tsx +28 -0
  39. package/templates/dashboard/src/routes/app/settings/index.tsx +29 -0
  40. package/templates/dashboard/src/routes/app/users.tsx +50 -0
  41. package/templates/dashboard/src/routes/index.tsx +40 -0
  42. package/templates/dashboard/src/routes/login.tsx +79 -0
  43. package/templates/dashboard/src/routes/signup.tsx +78 -0
  44. package/templates/dashboard/tsconfig.json +16 -0
  45. package/lib/index.js.map +0 -1
  46. /package/templates/{default → app}/.mcp.json +0 -0
  47. /package/templates/{default → app}/CLAUDE.md +0 -0
  48. /package/templates/{default → app}/index.html +0 -0
  49. /package/templates/{default → app}/public/favicon.svg +0 -0
  50. /package/templates/{default → app}/src/entry-client.ts +0 -0
  51. /package/templates/{default → app}/src/features/posts.ts +0 -0
  52. /package/templates/{default → app}/src/global.css +0 -0
  53. /package/templates/{default → app}/src/routes/(admin)/dashboard.tsx +0 -0
  54. /package/templates/{default → app}/src/routes/_error.tsx +0 -0
  55. /package/templates/{default → app}/src/routes/_loading.tsx +0 -0
  56. /package/templates/{default → app}/src/routes/about.tsx +0 -0
  57. /package/templates/{default → app}/src/routes/api/health.ts +0 -0
  58. /package/templates/{default → app}/src/routes/api/posts.ts +0 -0
  59. /package/templates/{default → app}/src/routes/counter.tsx +0 -0
  60. /package/templates/{default → app}/src/routes/index.tsx +0 -0
  61. /package/templates/{default → app}/src/routes/posts/[id].tsx +0 -0
  62. /package/templates/{default → app}/src/routes/posts/index.tsx +0 -0
  63. /package/templates/{default → app}/src/routes/posts/new.tsx +0 -0
  64. /package/templates/{default → app}/src/stores/app.ts +0 -0
  65. /package/templates/{default → app}/tsconfig.json +0 -0
package/README.md CHANGED
@@ -1,41 +1,104 @@
1
- # @pyreon/create-zero
1
+ # @pyreon/create-zero · `create-pyreon-app`
2
2
 
3
- Interactive scaffolding tool for [Pyreon Zero](https://github.com/pyreon/zero) projects.
3
+ Interactive scaffolder for [Pyreon Zero](https://github.com/pyreon/pyreon) projects.
4
4
 
5
- ## Usage
5
+ This package ships **two bin aliases** — both invoke the same scaffolder:
6
6
 
7
7
  ```bash
8
+ # Canonical (recommended in docs)
9
+ bunx create-pyreon-app my-app
10
+
11
+ # Back-compat (older docs / `bun create` flow)
8
12
  bun create @pyreon/zero my-app
9
13
  ```
10
14
 
11
- Or via the CLI:
15
+ Pick whichever you prefer; the interactive prompts and the resulting project are identical.
16
+
17
+ ## Templates
18
+
19
+ Three curated starting points:
20
+
21
+ | Template | Default mode | What you get |
22
+ | --- | --- | --- |
23
+ | **`app`** | SSR streaming | Counter, posts, layout, admin route group — the full-featured starter. |
24
+ | **`blog`** | Static (SSG) | Markdown-style TSX posts in `src/content/posts/`, RSS feed at `/rss.xml`, SEO-ready. |
25
+ | **`dashboard`** | SSR streaming | SaaS-shape: marketing landing → auth-gated `/app/*` routes (overview, users, invoices, settings) → invoice export demo using `@pyreon/document-primitives` (the same component tree renders in browser AND exports to PDF/email). |
26
+
27
+ Force a template non-interactively:
12
28
 
13
29
  ```bash
14
- zero create my-app
30
+ bunx create-pyreon-app my-app --template blog
15
31
  ```
16
32
 
17
- ## Interactive Setup
33
+ ## Deployment adapters
34
+
35
+ Pick a target during the prompt or pass `--adapter`. Each adapter writes the platform-specific deploy artefact alongside the project:
36
+
37
+ | Adapter | Files written |
38
+ | --- | --- |
39
+ | `vercel` | `vercel.json` |
40
+ | `cloudflare` | `wrangler.toml`, `_routes.json` |
41
+ | `netlify` | `netlify.toml` |
42
+ | `node` | `Dockerfile`, `.dockerignore` |
43
+ | `bun` | `Dockerfile` (bun-based), `.dockerignore` |
44
+ | `static` | (none — `dist/` is the artefact) |
45
+
46
+ The `vite.config.ts` automatically imports the matching `*Adapter()` factory from `@pyreon/zero/server`.
47
+
48
+ ## Backend integrations
49
+
50
+ Two scaffolders that write **plain files into your project** — no Pyreon-side wrapper packages, no version coupling. You own the integration code and update it independently of Pyreon releases.
18
51
 
19
- The CLI prompts you to configure:
52
+ | Integration | Files written | Replaces |
53
+ | --- | --- | --- |
54
+ | `supabase` | `src/lib/supabase.ts`, `src/lib/auth.ts`, `src/lib/db.ts` (in dashboard) | The dashboard template's in-memory auth + db stubs |
55
+ | `email` | `src/lib/email.ts`, `src/emails/welcome.tsx`, `src/routes/api/email/welcome.ts` | — |
20
56
 
21
- 1. **Rendering mode** SSR Streaming, SSR String, SSG, or SPA
22
- 2. **Features** — pick from store, query, forms, feature CRUD, i18n, tables, virtual lists, CSS-in-JS, UI elements, animations, hooks
23
- 3. **AI toolchain** — MCP server config, CLAUDE.md, doctor scripts
57
+ The `dashboard` template preselects both. For `app` / `blog`, integrations are off by default but selectable.
24
58
 
25
- ## What Gets Generated
59
+ The email integration is the **headline Pyreon angle**: the same `<DocDocument>` / `<DocSection>` / `<DocText>` component tree renders in the browser AND exports to email HTML via `@pyreon/document-primitives` — one author for many output formats.
26
60
 
27
- Based on your selections:
61
+ ## AI tooling
62
+
63
+ Multi-select for the AI rule files you want generated:
64
+
65
+ | Option | File | Default |
66
+ | --- | --- | --- |
67
+ | `mcp` | `.mcp.json` | ✓ |
68
+ | `claude` | `CLAUDE.md` | ✓ |
69
+ | `cursor` | `.cursor/rules/pyreon.md` | — |
70
+ | `copilot` | `.github/copilot-instructions.md` | — |
71
+ | `agents` | `AGENTS.md` | — |
72
+
73
+ All five share a canonical "Pyreon principles" body so guidance stays consistent across tools.
74
+
75
+ ## Compat mode
76
+
77
+ Migrating from another framework? Pick `react` / `vue` / `solid` / `preact` and the scaffolder configures `@pyreon/vite-plugin` with the matching shim layer (`useState`, `useEffect`, `<Suspense>`, etc.).
78
+
79
+ ## CLI flags (one-shot, non-interactive)
80
+
81
+ ```bash
82
+ bunx create-pyreon-app my-app --template dashboard \
83
+ --adapter vercel \
84
+ --integrations supabase,email \
85
+ --ai mcp,claude,cursor \
86
+ --yes
87
+ ```
28
88
 
29
- - `package.json` only the dependencies you chose
30
- - `vite.config.ts` configured for your rendering mode
31
- - `src/entry-server.ts` matching SSR/stream config with CORS + rate limiting
32
- - `src/routes/` example pages, API routes, protected dashboard
33
- - `src/features/` feature example with Zod schema (if selected)
34
- - `src/stores/` store example (if selected)
35
- - `.mcp.json` AI IDE integration (if AI toolchain selected)
36
- - `CLAUDE.md` project rules for AI agents (if AI toolchain selected)
37
- - `env.d.ts` virtual module type declarations
89
+ | Flag | Values |
90
+ | --- | --- |
91
+ | `--template` | `app` / `blog` / `dashboard` |
92
+ | `--adapter` | `vercel` / `cloudflare` / `netlify` / `node` / `bun` / `static` |
93
+ | `--mode` | `ssr-stream` / `ssr-string` / `ssg` / `spa` |
94
+ | `--features` | csv (`store,query,forms,…`) |
95
+ | `--integrations` | csv (`supabase,email`) |
96
+ | `--ai` | csv (`mcp,claude,cursor,copilot,agents`) |
97
+ | `--compat` | `none` / `react` / `vue` / `solid` / `preact` |
98
+ | `--lint` / `--no-lint` | toggle `@pyreon/lint` |
99
+ | `--yes` | accept defaults, skip prompts |
100
+ | `--help`, `-h` | show usage |
38
101
 
39
102
  ## License
40
103
 
41
- [MIT](LICENSE)
104
+ MIT
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import('../lib/index.js')