uniweb 1.20.3 → 1.20.4

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/README.md CHANGED
@@ -1,68 +1,68 @@
1
1
  # uniweb
2
2
 
3
- A component content architecture for React. Build sites where content authors and component developers can't break each other's work—and scale from local files to visual editing without rewrites.
3
+ The CLI for [Uniweb](https://uniweb.io): an open-source React framework and a connected visual authoring platform.
4
4
 
5
- Create well-structured Vite + React projects with file-based routing, localization, and clean content/code separation out of the box.
5
+ **Developers define the vocabulary. Authors compose with it. Uniweb keeps both sides in sync.**
6
6
 
7
- ## Quick Start
7
+ Developers build real React components, schemas and content structures in a normal codebase. Those definitions become the vocabulary authors use in the Uniweb app to create pages, manage content and work with structured data. Your project and the authors' workspace are two interfaces to the same website, and the CLI keeps them in sync, so both sides keep working.
8
8
 
9
- ```bash
10
- npm create uniweb
9
+ ```text
10
+ Traditional: developer builds → hands off → CMS users edit
11
+
12
+ Uniweb: developer project ⇄ Uniweb ⇄ author workspace
13
+ ↑ ↑
14
+ └──── both keep working ───┘
11
15
  ```
12
16
 
13
- The interactive prompt asks for a project name and template. Pick one, then:
17
+ ## Quick Start
14
18
 
15
19
  ```bash
16
- cd my-project
17
- pnpm install # or npm install
18
- pnpm dev # or npm run dev
20
+ npx uniweb@latest create my-site
21
+ cd my-site
22
+ pnpm install # or npm install
23
+ pnpm dev # or npm run dev — prints the address it serves the site at
19
24
  ```
20
25
 
21
- Edit files in `site/pages/` and `src/sections/` to see changes instantly.
22
-
23
- > **pnpm ready** — `pnpm create uniweb` works out of the box. Projects include both `pnpm-workspace.yaml` and npm workspaces.
26
+ At a terminal, `create` asks which template to start from (`npm create uniweb` does the same). Edit the pages in `site/pages/` and the section types in `src/sections/`, and the page updates as you save.
24
27
 
25
- ### Templates
28
+ Start with a normal project, and connect the authoring app when you want it:
26
29
 
27
- | Template | Description |
28
- | --- | --- |
29
- | **Starter** | Foundation + site + sample content (default) |
30
- | **None** | Foundation + site with no content |
31
- | **Marketing** | Landing page, features, pricing, testimonials |
32
- | **Docs** | Documentation with sidebar and search |
33
- | **Academic** | Research site with publications and team |
34
- | **International** | Multilingual site with i18n and blog |
35
- | **Dynamic** | Live API data fetching with loading states |
36
- | **Store** | E-commerce with product grid |
37
- | **Extensions** | Multi-foundation with visual effects extension |
30
+ ```bash
31
+ pnpm uniweb login # sign in to your Uniweb account
32
+ pnpm uniweb sync # the first sync brings the site and its foundation into the app
33
+ ```
38
34
 
39
- **See them live:** [View all template demos](https://uniweb.github.io/templates/)
35
+ > **pnpm ready** — `pnpm create uniweb` works out of the box. Projects include both `pnpm-workspace.yaml` and npm workspaces.
40
36
 
41
- Use `--blank` for an empty workspace (no packages) — grow with `uniweb add`.
37
+ ### With an AI agent
42
38
 
43
- **Two starting points.** Either let the CLI create a new directory:
39
+ Building a site with an AI coding agent? Ask it to run `npx uniweb@latest start` first. It prints a short guide written for the agent: how to create the project, where its manual is (`AGENTS.md`), how to run it, and how to bring the site into the Uniweb app. The agent runs every command; you only use your browser, to sign in and to pay when the site goes live.
44
40
 
45
- ```bash
46
- pnpm create uniweb my-site --template docs
47
- ```
41
+ ## Two Interfaces to One Website
48
42
 
49
- …or scaffold inside an existing directory (e.g., a freshly-cloned GitHub repo):
43
+ | Developers | Authors |
44
+ | --- | --- |
45
+ | React components | Visual components |
46
+ | Schemas and configuration | Forms and structured records |
47
+ | Vite and local development | Live visual editing |
48
+ | Files and Git | Content and composition |
49
+ | `push` · `pull` · `sync` · `publish` | Changes appear live |
50
50
 
51
- ```bash
52
- pnpm create uniweb . --template docs
53
- ```
51
+ **For developers, it's a normal project.** Section types are React components, content is markdown in the repository, Vite builds it, and git holds the history. You keep your editor, terminal and deployment workflow.
54
52
 
55
- ### Local Scripts
53
+ **For authors, it's the Uniweb app.** Your section types become their building blocks: they compose pages from them, set the options each one declares in its `meta.js`, and manage records through your schemas, with live previews. They never see JSX, markdown, YAML or git, and you never build an editing UI. You build the components; Uniweb builds the authoring experience.
56
54
 
57
- Run these from the **project root**:
55
+ ### The CLI is the bridge
58
56
 
59
- ```bash
60
- pnpm dev # Start development server
61
- pnpm build # Build foundation + site for production
62
- pnpm preview # Preview the production build
63
- ```
57
+ | Command | What it does |
58
+ | --- | --- |
59
+ | `uniweb push` | Sends your section types, schemas and content to the app: a draft, not live |
60
+ | `uniweb pull` | Brings authors' edits into your files, as a git merge |
61
+ | `uniweb sync` | Takes your teammates' commits and the authors' edits, then pushes yours |
62
+ | `uniweb publish` | Pushes, then takes the site live on Uniweb hosting (paid) |
63
+ | `uniweb clone <site-uuid>` | Starts a local project from a site made in the app (`uniweb site list` shows its uuid) |
64
64
 
65
- The `build` command outputs to `site/dist/`. With pre-rendering enabled (the default for official templates), you get static HTML files ready to deploy anywhere. For the actual deploy step (and the `uniweb deploy` / `uniweb register` commands), see [Deployment](#deployment) below.
65
+ Edits to different sections combine. When the same section changed on both sides, `pull` stops at a git conflict for you to settle, and a push stops rather than overwrite what an author changed (only `--force` goes past it), so neither edit is lost. Like git, a push sends what you have committed; `--commit` commits the site's content first.
66
66
 
67
67
  ## What You Get
68
68
 
@@ -71,7 +71,7 @@ Every project starts as a workspace with two packages:
71
71
  - **`site/`** — Content, pages, entry point (package name: `site`)
72
72
  - **`src/`** — React components, the site's source code (package name: `src`)
73
73
 
74
- A site is pure content. A foundation is the site's source code — that's why it lives in `src/`. Content authors work in markdown. Component authors work in React. Neither can break the other's work. As your project grows, use `uniweb add` to add more foundations, sites, and extensions.
74
+ A site is pure content. A foundation is the site's source code — that's why it lives in `src/`. Content lives in markdown and component code in React, so neither can break the other. As your project grows, use `uniweb add` to add more foundations, sites, and extensions.
75
75
 
76
76
  ```
77
77
  my-project/
@@ -79,25 +79,26 @@ my-project/
79
79
  │ ├── pages/ # File-based routing
80
80
  │ │ └── home/
81
81
  │ │ ├── page.yml # Page metadata
82
- │ │ └── hero.md # Section content
83
- │ ├── locales/ # i18n (hash-based translations)
82
+ │ │ └── 1-welcome.md # A section
83
+ │ ├── site.yml # Site configuration
84
+ │ ├── theme.yml # Colors, fonts, appearance
84
85
  │ ├── entry.js # Entry point (~6 lines)
85
- │ ├── vite.config.js # 3-line config
86
+ │ ├── vite.config.js # One-line config
86
87
  │ └── public/ # Static assets
87
88
  │
88
- └── src/ # Foundation package (the site's source)
89
- ├── sections/ # Section types (addressable from markdown)
90
- │ ├── Hero.jsx # Bare file → section type (no meta.js needed)
91
- │ └── Features/
92
- │ ├── meta.js # Content interface (params, presets)
93
- │ └── Features.jsx
94
- ├── components/ # Regular React components
95
- │ └── Button.jsx
96
- ├── main.js # Package exports (vars, defaultLayout, props)
97
- ├── styles.css # Tailwind v4 + CSS tokens
98
- ├── package.json # name: "src"
99
- ├── vite.config.js # 3-line config
100
- └── dist/ # Built output
89
+ ├── src/ # Foundation package (the site's source)
90
+ │ ├── sections/ # Section types (addressable from markdown)
91
+ │ │ ├── Hero.jsx # Bare file → section type (no meta.js needed)
92
+ │ │ └── Features/
93
+ │ │ ├── index.jsx
94
+ │ │ └── meta.js # Content interface (params, presets)
95
+ │ ├── components/ # Regular React components
96
+ │ ├── main.js # Foundation declarations (name, theme variables, default layout)
97
+ │ ├── styles.css # Tailwind v4 + CSS tokens
98
+ │ ├── package.json # name: "src"
99
+ │ └── vite.config.js # 3-line config
100
+ │
101
+ └── AGENTS.md # The project's manual, for developers and AI agents
101
102
  ```
102
103
 
103
104
  **Pages are folders.** Create `pages/about/` with markdown files inside → visit `/about`. That's the whole routing model.
@@ -119,7 +120,7 @@ Build something great.
119
120
  [Get Started](#)
120
121
  ```
121
122
 
122
- Frontmatter specifies the component type and configuration. The body contains the actual content—headings, paragraphs, links, images—which gets semantically parsed into structured data your component receives.
123
+ Frontmatter names the section type and its configuration — `theme: dark` sets the section's color context. The body contains the actual content—headings, paragraphs, links, images—which gets semantically parsed into structured data your component receives.
123
124
 
124
125
  ### Beyond Markdown
125
126
 
@@ -145,32 +146,34 @@ function TeamCard({ content }) {
145
146
  }
146
147
  ```
147
148
 
148
- Natural content stays in markdown; structured data goes in tagged blocks (YAML or JSON).
149
+ Natural content stays in markdown; structured data goes in tagged blocks (YAML or JSON). Content that many pages share — people, publications, events — can live as records instead, typed by your foundation's schemas, which is what authors then manage as forms in the app.
149
150
 
150
151
  ### Components as React
151
152
 
152
153
  ```jsx
153
- export default function Hero({ content, params }) {
154
+ import { H1, P, Link } from '@uniweb/kit'
155
+
156
+ export default function Hero({ content }) {
154
157
  const { title, paragraphs, links } = content
155
158
 
156
159
  return (
157
- <section className="py-20 text-center">
158
- <h1 className="text-4xl font-bold">{title}</h1>
159
- <p className="text-xl text-gray-600">{paragraphs[0]}</p>
160
+ <div className="py-20 text-center">
161
+ <H1 text={title} className="text-4xl font-bold text-heading" />
162
+ <P text={paragraphs[0]} className="mt-4 text-xl text-body" />
160
163
  {links[0] && (
161
- <a
162
- href={links[0].href}
163
- className="mt-8 px-6 py-3 bg-blue-600 text-white rounded inline-block"
164
+ <Link
165
+ to={links[0].href}
166
+ className="mt-8 inline-block rounded bg-primary px-6 py-3 text-primary-foreground"
164
167
  >
165
168
  {links[0].label}
166
- </a>
169
+ </Link>
167
170
  )}
168
- </section>
171
+ </div>
169
172
  )
170
173
  }
171
174
  ```
172
175
 
173
- Standard React. Standard Tailwind. The `{ content, params }` interface is only for _section types_ — components that content creators select in markdown frontmatter. Everything else uses regular React props.
176
+ Standard React. Standard Tailwind. Classes like `text-heading` and `bg-primary` are theme tokens, so one component adapts to light and dark sections and to every site's colors; the runtime wraps each section in its `<section>` and paints its background. The `{ content, params }` interface is only for _section types_ — components that content creators select in markdown frontmatter. Everything else uses regular React props.
174
177
 
175
178
  ### Composition
176
179
 
@@ -194,13 +197,48 @@ Authors can also compose layouts from reusable section types using child section
194
197
 
195
198
  ```
196
199
  pages/home/
197
- ├── highlights.md # type: Grid, columns: 3
200
+ ├── page.yml # nest: { highlights: [stats, testimonial, demo] }
201
+ ├── highlights.md # type: Grid
198
202
  ├── @stats.md # type: StatCard
199
203
  ├── @testimonial.md # type: Testimonial
200
204
  └── @demo.md # type: SplitContent (with an embedded @LiveDemo inset)
201
205
  ```
202
206
 
203
- Three different section types, arranged in a grid, one with an interactive component inside it — all authored in markdown. The developer builds reusable pieces; the content author composes them. See the [Component Patterns guide](https://github.com/uniweb/docs/blob/main/development/component-patterns.md) for the full composition model.
207
+ Three different section types, arranged in a grid, one with an interactive component inside it — all authored in markdown. An `@` file is a child section, and `nest:` in `page.yml` says whose. The developer builds reusable pieces; the content author composes them. See the [Component Patterns guide](https://github.com/uniweb/docs/blob/main/development/component-patterns.md) for the full composition model.
208
+
209
+ ## Templates
210
+
211
+ | Template | Description |
212
+ | --- | --- |
213
+ | **Starter** | Foundation + site + sample content (default) |
214
+ | **None** | Foundation + site with no content |
215
+ | **Blank** (`--blank`) | An empty workspace — grow it with `uniweb add` |
216
+
217
+ **Official templates** — marketing sites, documentation, blogs, academic sites and more — each come with a working foundation and sample content. `uniweb template list` shows the ones your CLI scaffolds, and you can [see them live](https://uniweb.github.io/templates/).
218
+
219
+ **Two starting points.** Either let the CLI create a new directory:
220
+
221
+ ```bash
222
+ pnpm create uniweb my-site --template docs
223
+ ```
224
+
225
+ …or scaffold inside an existing directory (e.g., a freshly-cloned GitHub repo):
226
+
227
+ ```bash
228
+ pnpm create uniweb . --template docs
229
+ ```
230
+
231
+ ### Local Scripts
232
+
233
+ Run these from the **project root**:
234
+
235
+ ```bash
236
+ pnpm dev # Start development server
237
+ pnpm build # Build foundation + site for production
238
+ pnpm preview # Preview the production build
239
+ ```
240
+
241
+ The `build` command outputs to `site/dist/`. With pre-rendering enabled (the default for official templates), you get static HTML files ready to deploy anywhere.
204
242
 
205
243
  ## Next Steps
206
244
 
@@ -212,17 +250,17 @@ After creating your project:
212
250
 
213
251
  3. **Learn the configuration** — Run `uniweb docs site` or `uniweb docs page` for quick reference on configuration options.
214
252
 
215
- 4. **Create a section type** — Add a file to `src/sections/` (e.g., `Banner.jsx`) and rebuild. Bare files at the root are discovered automatically — no `meta.js` needed. Add `meta.js` when you want to declare params or presets. See the [Component Metadata Reference](https://github.com/uniweb/docs/blob/main/reference/component-metadata.md) for the full schema.
253
+ 4. **Create a section type** — `uniweb add section Banner` scaffolds one, or add a file to `src/sections/` (e.g., `Banner.jsx`): the dev server picks it up. Bare files at the root are discovered automatically — no `meta.js` needed. Add `meta.js` when you want to declare params or presets. See the [Component Metadata Reference](https://github.com/uniweb/docs/blob/main/reference/component-metadata.md) for the full schema.
216
254
 
217
- The `meta.js` file defines what content and parameters a component accepts. The runtime uses this metadata to apply defaults and guarantee content structure—no defensive null checks needed in your component code.
255
+ `meta.js` declares what content and parameters a section type accepts. The runtime fills each param from its default there, and hands every section the full content shape, so your components need no defensive null checks.
218
256
 
219
257
  ### Your First Content Change
220
258
 
221
- Open `site/pages/home/hero.md` and edit the headline:
259
+ Open a section of the home page (in the starter, `site/pages/home/1-welcome.md`) and edit the headline:
222
260
 
223
261
  ```markdown
224
262
  ---
225
- type: Hero
263
+ type: Section
226
264
  ---
227
265
 
228
266
  # Your New Headline Here
@@ -236,10 +274,10 @@ Save and see the change instantly in your browser.
236
274
 
237
275
  ### Your First Component Change
238
276
 
239
- Open `src/sections/Hero.jsx`. The component receives parsed content:
277
+ Open the section type that renders it (in the starter, `src/sections/Section/index.jsx`). The component receives parsed content:
240
278
 
241
279
  ```jsx
242
- export default function Hero({ content }) {
280
+ export default function Section({ content, params }) {
243
281
  const { title, paragraphs, links, images, items } = content
244
282
  // Edit the JSX below...
245
283
  }
@@ -249,7 +287,7 @@ The parser extracts semantic elements from markdown—`title` from the first hea
249
287
 
250
288
  ## Foundations Are Portable
251
289
 
252
- The `src/` folder (your project's foundation) ships with your project as a convenience, but a foundation is dynamically loaded — sites reference it by configuration, not by folder proximity.
290
+ The `src/` folder (your project's foundation) ships with your project as a convenience, but sites reference a foundation by configuration, not by folder proximity.
253
291
 
254
292
  **Two ways to use a foundation:**
255
293
 
@@ -258,7 +296,7 @@ The `src/` folder (your project's foundation) ships with your project as a conve
258
296
  | **Local folder** | Foundation lives in your workspace | Developing site and components together |
259
297
  | **Runtime link** | Foundation loads from a URL | Independent release cycles, platform-managed sites |
260
298
 
261
- You can delete the `src/` folder entirely and point your site at a registered foundation. Or develop a foundation locally, then register it for other sites to consume. The site doesn't care where its components come from.
299
+ Develop a foundation locally, then register it for other sites to use. A site can also name a registered foundation instead of a local one — a project made by `uniweb clone` does — and `uniweb dev` runs it, while Uniweb hosting builds and serves it. The site doesn't care where its components come from.
262
300
 
263
301
  **This enables two development patterns:**
264
302
 
@@ -282,10 +320,10 @@ cd my-workspace
282
320
  uniweb add project blog
283
321
 
284
322
  # Add a second foundation at root
285
- uniweb add foundation DocKit
323
+ uniweb add foundation doc-kit
286
324
 
287
325
  # Add a site wired to a specific foundation
288
- uniweb add site docs --foundation DocKit
326
+ uniweb add site docs --foundation doc-kit
289
327
 
290
328
  # Add an extension (auto-wired to the only site)
291
329
  uniweb add extension effects
@@ -300,18 +338,13 @@ pnpm dev # or npm run dev
300
338
 
301
339
  The workspace grows organically. `add` handles placement, wires dependencies, updates workspace globs, and generates root scripts. The name you provide becomes both the directory name and the package name. Use `--path` to override default placement, or `--project` for explicit co-located layouts.
302
340
 
303
- ## Deployment
304
-
305
- A Uniweb project produces two artifacts — a **site** (content) and a **foundation** (code). **Who manages the content** decides what you ship:
341
+ ## Other Ways to Ship
306
342
 
307
- - If you (or your dev team) manage the content, you ship them together — the site and its foundation, bundled or linked.
308
- - If someone else manages the content, you ship only the foundation. Content authors compose sites in the Uniweb apps; there's no site to deploy from your repo.
343
+ A Uniweb project produces two artifacts — a **site** (content) and a **foundation** (code). Connected to the app, both sides edit one site, as above. The framework also works on its own, and **who manages the content** decides what you ship.
309
344
 
310
- ### Path 1 — You manage the content
345
+ ### You manage the content, in files
311
346
 
312
- You (or your dev team) write the markdown. Deploy site + foundation together.
313
-
314
- The shortest path to a live site is free, on GitHub Pages, with a custom domain:
347
+ You (or your dev team) write the markdown. Deploy site + foundation together. The shortest path to a live site is free, on GitHub Pages, with a custom domain:
315
348
 
316
349
  ```bash
317
350
  uniweb create . # from within a freshly-cloned GitHub repo
@@ -325,7 +358,7 @@ uniweb add ci --host=github-pages
325
358
 
326
359
  **When to choose Uniweb hosting instead** (paid): when you need dynamic-page prerender at the edge (for collections fetched at runtime, not just at build time), foundation/runtime version propagation without redeploying every site, or edge SSR. If your site's content lives in markdown and updates ship via git, free CI is the right call.
327
360
 
328
- ### Path 2 — Someone else manages the content
361
+ ### Your clients manage the content, in the app
329
362
 
330
363
  You're building a foundation for clients, content authors, or any team that won't write markdown. The foundation is your product; the repo's `site/` is a test harness for the code (run `pnpm dev` to preview your components against sample content). You don't deploy a site — you register a foundation:
331
364
 
@@ -338,10 +371,6 @@ Real sites built on your foundation are managed in the **Uniweb app** — a visu
338
371
 
339
372
  This is the best path when site content has a life independent of the foundation's release cycle — agencies, design studios, multi-client teams, or any project where content authors aren't the same people as the developers.
340
373
 
341
- ### Hybrid
342
-
343
- Markdown in a git repo and content in the Uniweb apps can share the same site. `uniweb push` sends local content to the backend, `uniweb pull` brings the backend's content back — in a git repository by merging it into your branch, like `git pull`, so edits made on both surfaces at once are combined and only a genuine overlap is a conflict to settle — and `uniweb clone` bootstraps a local project from a site that already lives in the backend. Authors edit visually, devs edit in their IDE, both surfaces work on the same content. Review flows and branch isolation across the two are still evolving.
344
-
345
374
  ### Commands at a glance
346
375
 
347
376
  | Command | What it does |
@@ -349,22 +378,20 @@ Markdown in a git repo and content in the Uniweb apps can share the same site. `
349
378
  | `uniweb deploy` | Ask where the site should go, then do it. Remembers the answer in `deploy.yml`. |
350
379
  | `uniweb add ci --host=<adapter>` | Scaffold a CI workflow (+ PR previews) so every push deploys. `github-pages`, `cloudflare-pages`, `netlify`, `vercel`. |
351
380
  | `uniweb add ci --target foundation` | Publish foundations at permanent versioned GitHub Pages URLs — the free alternative to the catalog. |
352
- | `uniweb publish` | Go live on Uniweb hosting (paid) — syncs content, brings the site's foundation along, and serves dynamically. The canonical verb for Uniweb hosting. |
381
+ | `uniweb publish` | Go live on Uniweb hosting (paid) — brings the site's foundation along, pushes the content, and serves the site dynamically. The canonical verb for Uniweb hosting. |
353
382
  | `uniweb deploy --host=<adapter>` | Ship to a third-party static host in one step — builds `dist/`, uploads, invalidates. Drives that host's own CLI. |
354
383
  | `uniweb export` | Produce a self-contained `dist/` for any static host. You upload it yourself. `--host=<adapter>` adds host-specific helper files. |
355
- | `uniweb register --scope @org` | Register a foundation to the registry (path 2). |
384
+ | `uniweb register --scope @org` | Register a foundation to the registry, for sites managed in the app. |
356
385
  | `uniweb build` | Inspect a build locally. For shipping, use `publish` (Uniweb hosting) or `deploy`/`export` (static hosts). |
357
386
  | `uniweb update` | Align this project with the CLI you're running: bump `@uniweb/*` deps in every `package.json` to the CLI's matrix (then install), and refresh `AGENTS.md`. Pins to *this* CLI's matrix — run `npx uniweb@latest update` to align to the latest release. Updating the CLI itself is your package manager's job (`npm i -g uniweb@latest`). |
358
387
 
359
388
  `--host=<adapter>` is the same option across `deploy`, `export`, and `add ci`. Built-in adapters: `github-pages`, `cloudflare-pages`, `netlify`, `vercel`, `s3-cloudfront`, and `generic-static` (an artifact shape for `export`, not a deploy target). Each adapter implements only the operations it supports, and the CLI never offers one it can't perform: `add ci` lists only hosts that can scaffold a workflow, and `deploy`'s picker lists only destinations with a working deploy hook.
360
389
 
361
- ---
362
-
363
- Both paths use the same framework. The difference is who edits content, where it lives, and what gets deployed. For the deeper menu — standalone vs cataloged foundations, S3+CloudFront, manual exports, per-host recipes, foundation propagation — see → **[Deploying](https://github.com/uniweb/docs/blob/main/development/deploying.md)**.
390
+ For the deeper menu — standalone vs cataloged foundations, S3+CloudFront, manual exports, per-host recipes, foundation propagation — see → **[Deploying](https://github.com/uniweb/docs/blob/main/development/deploying.md)**.
364
391
 
365
392
  ---
366
393
 
367
- ## Keeping a Project in Sync
394
+ ## Keeping a Project Current
368
395
 
369
396
  Uniweb projects pin to specific `@uniweb/*` versions in their `package.json` files and ship an `AGENTS.md` stamped with the CLI version that wrote it. As the framework releases, both can drift from what the CLI you're running expects.
370
397
 
@@ -395,7 +422,7 @@ yarn global add uniweb@latest # yarn
395
422
 
396
423
  ## Documentation
397
424
 
398
- Full documentation is available at **[github.com/uniweb/docs](https://github.com/uniweb/docs)**:
425
+ Full documentation is at **[uniweb.io/docs](https://uniweb.io/docs)**, written in the public [uniweb/docs](https://github.com/uniweb/docs) repository:
399
426
 
400
427
  | Section | Topics |
401
428
  | ------- | ------ |
@@ -404,6 +431,8 @@ Full documentation is available at **[github.com/uniweb/docs](https://github.com
404
431
  | [Development](https://github.com/uniweb/docs/tree/main/development) | Building foundations, component patterns, data fetching, layouts |
405
432
  | [Reference](https://github.com/uniweb/docs/tree/main/reference) | Configuration files, kit API, CLI commands, deployment |
406
433
 
434
+ For AI agents, the documentation's index is [uniweb.io/llms.txt](https://uniweb.io/llms.txt).
435
+
407
436
  ### Quick Reference
408
437
 
409
438
  | Topic | Guide |
@@ -443,7 +472,6 @@ import { defineFoundationConfig } from '@uniweb/build'
443
472
 
444
473
  export default defineFoundationConfig({
445
474
  // All options are optional - entry is auto-generated
446
- fileName: 'foundation', // Output file name
447
475
  externals: [], // Additional packages to externalize
448
476
  includeDefaultExternals: true, // Include react, @uniweb/core, etc.
449
477
  tailwind: true, // Enable Tailwind CSS v4 Vite plugin
@@ -495,21 +523,25 @@ packages:
495
523
 
496
524
  ## FAQ
497
525
 
498
- **How is this different from MDX?**
526
+ **Do I need the Uniweb app?**
499
527
 
500
- MDX blends markdown and JSX—content authors write code. Uniweb keeps them separate: content stays in markdown, components stay in React. Authors can still embed interactive components (via `![](@Component)` syntax), but they never see JSX. Component updates don't require content changes, and content changes can't break components.
528
+ No. The framework works on its own: content in markdown, built and deployed like any Vite project, to any static host. Connect the app when people who don't write code need to edit the site — or when you'd rather not build an editing interface for them.
529
+
530
+ **Is the app a CMS?**
501
531
 
502
- **How is this different from Astro?**
532
+ It's where authors work: they compose pages from your section types and manage records through your schemas, with live previews. There's no admin interface or editing UI for you to build, and a site's content isn't locked in it: `uniweb clone` or `uniweb pull` brings it into a project as files in git, kept in sync both ways.
503
533
 
504
- Astro is a static site generator. Uniweb is a component content architecture that works with any deployment (static, SSR, or platform-managed). The foundation model means components are portable across sites and ready for integration with visual editors.
534
+ **How is this different from MDX?**
535
+
536
+ MDX blends markdown and JSX—content authors write code. Uniweb keeps them separate: content stays in markdown, components stay in React. Authors can still embed interactive components (via `![](@Component)` syntax), but they never see JSX. Component updates don't require content changes, and content changes can't break components.
505
537
 
506
- **Do I need uniweb.app?**
538
+ **How is this different from Astro and other site frameworks?**
507
539
 
508
- No. Local markdown files work great for developer-managed sites. The platform adds dynamic content, visual editing, and team collaboration when you need it.
540
+ They build sites from code and content files, and so does Uniweb. Uniweb adds the other interface: a visual authoring app, kept in sync with your project, where your components are the authors' building blocks. The foundation model also makes components portable across sites, with any deployment — static, SSR, or platform-managed.
509
541
 
510
542
  **Can I use an existing component library?**
511
543
 
512
- Yes. Foundations are standard React. Import any library into your foundation components. The `{ content, params }` interface only applies to section types (components with `meta.js`) — everything else uses regular React props.
544
+ Yes. Foundations are standard React. Import any library into your foundation components. The `{ content, params }` interface only applies to section types (the components authors pick from markdown) — everything else uses regular React props.
513
545
 
514
546
  **Is this SEO-friendly?**
515
547
 
@@ -531,4 +563,4 @@ Yes — documentation is a natural fit. Content stays in markdown (easy to versi
531
563
 
532
564
  ## License
533
565
 
534
- Apache 2.0
566
+ Apache 2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniweb",
3
- "version": "1.20.3",
3
+ "version": "1.20.4",
4
4
  "description": "Create structured Vite + React sites with content/code separation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,15 +41,15 @@
41
41
  "js-yaml": "^4.3.2",
42
42
  "prompts": "^2.4.2",
43
43
  "tar": "^7.5.21",
44
+ "@uniweb/content-writer": "~1.3.1",
44
45
  "@uniweb/core": "~1.4.7",
45
46
  "@uniweb/schemas": "~1.6.5",
46
- "@uniweb/semantic-parser": "~1.13.0",
47
- "@uniweb/content-writer": "~1.3.1"
47
+ "@uniweb/semantic-parser": "~1.13.0"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@uniweb/build": "~1.10.2",
51
- "@uniweb/semantic-parser": "~1.13.0",
52
- "@uniweb/content-reader": "~1.5.7"
51
+ "@uniweb/content-reader": "~1.5.7",
52
+ "@uniweb/semantic-parser": "~1.13.0"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "@uniweb/build": {
@@ -59,7 +59,7 @@ This guide covers what you can't derive by reading code. Everything else is in t
59
59
  **Start at the index.** One address, and it's the only documentation URL worth memorizing:
60
60
 
61
61
  ```
62
- https://www.uniweb.io/llms.txt
62
+ https://uniweb.io/llms.txt
63
63
  ```
64
64
 
65
65
  It lists every documentation page with a one-line description and a fetchable link. Go there whenever your question isn't answered in this file — and *especially* when you don't know whether a feature exists at all. That's where guessing does the most damage: **a 404 on a path you invented tells you your guess was wrong, not that the feature is missing.** Concluding "the framework doesn't support X" from a failed fetch is a mistake worth actively guarding against; the index answers the existence question directly.
@@ -76,7 +76,7 @@ Same content, greppable, and one network operation instead of many. `grep -ri "q
76
76
 
77
77
  Documentation paths in this guide are given bare — `development/creating-components.md` — so they resolve three ways: as a key in the index, as a file in a clone, or at `https://raw.githubusercontent.com/uniweb/docs/main/{path}`.
78
78
 
79
- > **Don't confuse the two doc sites.** `www.uniweb.io/docs` is the **developer** documentation — this is the one you want. `docs.uniweb.app` is the *author-facing* app documentation, written for non-technical people using the visual editor; it won't answer framework questions.
79
+ > **Don't confuse the two doc sites.** `uniweb.io/docs` is the **developer** documentation — this is the one you want. `docs.uniweb.app` is the *author-facing* app documentation, written for non-technical people using the visual editor; it won't answer framework questions.
80
80
 
81
81
  **The table below saves you the round trip** for the tasks that come up most:
82
82
 
@@ -3134,7 +3134,7 @@ Loud failures:
3134
3134
 
3135
3135
  ## Documentation index
3136
3136
 
3137
- **Index of every page: https://www.uniweb.io/llms.txt** — start there when you don't know which page you need.
3137
+ **Index of every page: https://uniweb.io/llms.txt** — start there when you don't know which page you need.
3138
3138
 
3139
3139
  Source repo (public, cloneable): **https://github.com/uniweb/docs** · any page as raw markdown at `https://raw.githubusercontent.com/uniweb/docs/main/{section}/{page}.md`. See *Documentation* in Part 0 for when to fetch versus clone.
3140
3140
 
@@ -0,0 +1,109 @@
1
+ {{#if project}}
2
+ # Working on a Uniweb project
3
+
4
+ You're in the Uniweb project at `{{root}}`.
5
+
6
+ Its pages are markdown files, and how they look and behave comes from its foundation:
7
+ React components that the pages pick by name. The `uniweb` CLI builds and runs the
8
+ project, and brings it into the Uniweb app, where the person you're working with can keep
9
+ editing it visually.
10
+
11
+ `uniweb start` only prints this guide; `npx uniweb dev` runs the site. To start a new
12
+ project instead, run `npx uniweb@latest start` in a folder outside this one.
13
+ {{else}}
14
+ # Build a website with Uniweb
15
+
16
+ You're building a website for the person you're working with. In Uniweb, the pages are
17
+ markdown files, and how they look and behave comes from a foundation: React components
18
+ that the pages pick by name. One project holds both. The `uniweb` CLI builds and runs it,
19
+ and brings it into the Uniweb app, where the person can keep editing it visually.
20
+ {{/if}}
21
+
22
+ ## The person doesn't use a terminal
23
+
24
+ Run every command yourself, and never ask them to run one. They do two things, in their
25
+ browser: sign in, and pay when the site goes live. When a command prints an address to
26
+ finish something in a browser, open it for them and say what it's for.
27
+
28
+ Uniweb needs Node.js 22.12 or later. If `node --version` shows an older one, install a
29
+ current one yourself.
30
+ {{#unless project}}
31
+
32
+ ## Create the project
33
+
34
+ ```bash
35
+ npx uniweb@latest create <name> --template starter
36
+ cd <name>
37
+ ```
38
+
39
+ `<name>` is lowercase letters, digits and hyphens, and becomes the project's folder.
40
+ `create` asks no questions when it runs without a terminal. `starter` has one generic
41
+ section type and two short pages: a working example of each convention, to replace as
42
+ you build. `--template none` is the same project without them.
43
+ {{#if otherProject}}
44
+
45
+ Create it outside `{{otherProject}}`: that folder holds another project, and `create`
46
+ does not make one inside it.
47
+ {{/if}}
48
+ {{/unless}}
49
+
50
+ ## Read the project's guide
51
+
52
+ {{#if agents}}
53
+ AGENTS.md, at the project's root, is the manual for this project and its version of
54
+ Uniweb. Read its Part 0 before writing code: it says which parts your task needs.
55
+ {{else}}
56
+ This project has no AGENTS.md, the manual for a Uniweb project. Write one with
57
+ `npx uniweb update --agents-only`, then read its Part 0 before writing code: it says
58
+ which parts your task needs.
59
+ {{/if}}
60
+
61
+ Uniweb's mistakes are quiet: an unknown section type or param builds fine and renders
62
+ wrong. AGENTS.md says how to check.
63
+
64
+ ## Install and run
65
+
66
+ ```bash
67
+ {{install}}
68
+ npx uniweb dev
69
+ ```
70
+
71
+ Run `dev` in the background. Once the server listens, it prints
72
+ `Serving <site> at <url>`: open that address to show the person.
73
+ `npx uniweb dev --stop` stops it.
74
+
75
+ ## Sign them in to Uniweb
76
+
77
+ When they want the site in the Uniweb app, to edit it there or to take it live:
78
+
79
+ ```bash
80
+ npx uniweb login --browser --personal
81
+ ```
82
+
83
+ This opens their browser. If they're signed in to Uniweb there, it finishes on its own;
84
+ otherwise they sign in, or sign up if they're new, and it waits up to five minutes. Never
85
+ ask for a password or a token.
86
+
87
+ `--personal` puts their sites in their own workspace. If they ask for one of their
88
+ organizations instead, use `--org @<its handle>`.
89
+
90
+ ## Bring the site into the app, and take it live
91
+
92
+ ```bash
93
+ npx uniweb push --commit -m "<what you built>" # to see or edit it in the app
94
+ npx uniweb publish --commit -m "<what you built>" # to take it live
95
+ ```
96
+
97
+ `push` sends the site and its foundation to their workspace, where they'll find it in
98
+ the app. `publish` does the same and then takes the site live, so it needs no push
99
+ first. `--commit` commits the site's content first: in a git repository, both send only
100
+ what is committed.
101
+
102
+ If the site needs paying for, `publish` prints an address instead of going live. Open
103
+ it for the person, tell them it's where they pay, and run `publish` again once they're
104
+ done.
105
+
106
+ ## More
107
+
108
+ - Documentation index: https://uniweb.io/llms.txt
109
+ - Every command's options: `npx uniweb <command> --help`