create-kywi-app 0.18.0 → 0.19.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 (3) hide show
  1. package/README.md +20 -9
  2. package/lib/templates.mjs +266 -1789
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -83,9 +83,8 @@ CLAUDE.md thin pointer that sends a Claude Code session
83
83
  .claude/skills/kywi-personalization/SKILL.md Claude Code project skill: confirm the use case, then
84
84
  build audiences, page variants, or A/B experiments — loaded
85
85
  automatically when the owner wants personalization or A/B testing
86
- lib/kywi.ts server runtime: DB, API handler, content scope (memoised)
87
- lib/config.ts re-export of kywi.config
88
- middleware.ts auth gate + session refresh + cookie→bearer bridge (over core/host)
86
+ lib/kywi.ts the ONE wiring point: kywi.config.ts core's render path
87
+ middleware.ts re-exports core's middleware (auth gate, session refresh, cookie→bearer bridge)
89
88
  app/api/v1/[...kywi]/route.ts the versioned API (delegates to core; lifts tokens into httpOnly cookies)
90
89
  app/layout.tsx root <html>/<body>
91
90
  app/icon.svg favicon
@@ -93,8 +92,19 @@ app/admin/[[...admin]]/page.tsx mounts the FULL core admin (KywiAdminApp, eve
93
92
  ```
94
93
 
95
94
  **coupled** additionally gets `app/(site)/layout.tsx` + `app/(site)/[[...slug]]/page.tsx`
96
- (the public site — renders "/" and every published page at its slug). **headless**
97
- and **decoupled** instead get `app/page.tsx` (returns 404 no public rendering).
95
+ (the public site — renders "/" and every published page at its slug), plus
96
+ `app/(site)/site.css` and `components/site-nav.tsx`. **headless** and **decoupled**
97
+ instead get `app/page.tsx` (returns 404 — no public rendering).
98
+
99
+ Those two route files, `middleware.ts` and `lib/kywi.ts` are **thin,
100
+ version-stamped delegates** (each opens with a `// kywi-render v…` comment). The
101
+ public render path itself — content and locale resolution, SEO metadata, JSON-LD,
102
+ feed and nav hydration, personalization, A/B assignment and the front-of-site
103
+ editor — is shipped as `@kywi-software/core/next`, so `pnpm up
104
+ @kywi-software/core` upgrades it. Before this, ~1,370 lines of it were copied
105
+ into every project, where no upgrade could ever reach them again. What a project
106
+ owns: `kywi.config.ts`, `app/(site)/site.css`, `lib/modules.tsx` and
107
+ `components/site-nav.tsx`.
98
108
 
99
109
  Note what's *not* in this list: there is no `components/admin-shell.tsx`, no
100
110
  per-route `app/admin/content/**`, no `lib/admin-auth.ts`. Since 0.2.0 the whole
@@ -137,10 +147,11 @@ It writes the same five files (`AGENTS.md`, `CLAUDE.md`, and the three
137
147
  (otherwise it exits with an error), reads the project name from `package.json`
138
148
  (falling back to the directory name) and the deployment mode from the config.
139
149
  - **Writes the real `AGENTS.md` header** — the "where things live" section is
140
- generated from the landmarks it actually finds on disk (e.g. `lib/site.ts`,
141
- `lib/modules.tsx`, the public `app/(site)/[[...slug]]/page.tsx`), so a
142
- hand-built app that predates part of the scaffold gets an honest header rather
143
- than one that asserts files it doesn't have.
150
+ generated from the landmarks it actually finds on disk (e.g. `lib/modules.tsx`,
151
+ the public `app/(site)/[[...slug]]/page.tsx`, and a `lib/site.ts` which only
152
+ a project scaffolded before the layered render path still has), so a hand-built
153
+ or older app gets an honest header rather than one that asserts files it
154
+ doesn't have, or claims a thin delegate where it holds its own copy.
144
155
  - **Never clobbers by default** — existing files are skipped (a customized
145
156
  `AGENTS.md` is left untouched); pass `--force` to overwrite. It prints a
146
157
  created/updated/skipped summary either way.