uniweb 1.32.0 → 1.33.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.
- package/README.md +33 -36
- package/package.json +7 -7
- package/partials/agents.md +5 -4
- package/partials/guides/foundation.md +1 -1
- package/partials/guides/i18n.md +1 -1
- package/partials/guides/ship.md +16 -2
- package/partials/guides/start.md +1 -0
- package/partials/start.md +9 -2
- package/src/backend/blueprint-reach.js +5 -2
- package/src/commands/add-library-section.js +302 -0
- package/src/commands/add-library.js +3 -3
- package/src/commands/add.js +63 -97
- package/src/commands/i18n.js +2 -1
- package/src/commands/update.js +5 -4
- package/src/framework-index.json +11 -11
- package/src/index.js +6 -0
- package/src/utils/lockfile-uniweb.js +18 -6
- package/src/utils/section-files.js +97 -0
- package/templates/workspace/README.md.hbs +59 -48
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
# {{projectName}}
|
|
2
2
|
|
|
3
|
-
A website made with [Uniweb](https://uniweb.io)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
**Developers define the vocabulary. Authors compose with it. Uniweb keeps both sides in sync.**
|
|
7
|
-
|
|
8
|
-
This project and the Uniweb app are two interfaces to the same website. Here, in code and git,
|
|
9
|
-
you build its **foundation**: React components, called section types, and the schemas of its
|
|
10
|
-
structured content. In the app, authors compose pages from those section types and manage records
|
|
11
|
-
through those schemas: visually, with live previews, and with no markdown, YAML or git to learn.
|
|
12
|
-
You build the components. Uniweb builds the authoring experience.
|
|
3
|
+
A website made with [Uniweb](https://uniweb.io), an open-source framework for building websites
|
|
4
|
+
with an AI agent. Your agent builds the site, Uniweb hosting runs it, and you and the people you
|
|
5
|
+
work with can edit it in the Uniweb app.
|
|
13
6
|
{{#if cloned}}
|
|
14
7
|
|
|
15
8
|
This project was cloned from a site in the Uniweb app (`uniweb clone`), so it is already in sync
|
|
16
9
|
with it. Its foundation is a registered one, not a folder of this project.
|
|
17
10
|
{{/if}}
|
|
18
11
|
|
|
19
|
-
##
|
|
12
|
+
## Working on it
|
|
13
|
+
|
|
14
|
+
**With an AI agent.** Open your agent in this directory, ask it to run `npx uniweb@latest start`
|
|
15
|
+
first, then ask for what you want. The guide it prints has your agent check whether the site was
|
|
16
|
+
changed in the Uniweb app before it starts. [AGENTS.md](./AGENTS.md) is the project's manual, for
|
|
17
|
+
your agent and for you.
|
|
18
|
+
|
|
19
|
+
**By hand:**
|
|
20
20
|
|
|
21
21
|
{{#if packages.length}}
|
|
22
22
|
```bash
|
|
@@ -37,6 +37,30 @@ pnpm uniweb dev # prints the address it serves the site at
|
|
|
37
37
|
```
|
|
38
38
|
{{/if}}
|
|
39
39
|
|
|
40
|
+
## Going live
|
|
41
|
+
|
|
42
|
+
We recommend Uniweb hosting, from the site's first pages:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pnpm uniweb login # sign in to your Uniweb account
|
|
46
|
+
pnpm uniweb publish # take the site live on Uniweb hosting, a paid service
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- **A site of static pages costs the least there**, because each service, live records included,
|
|
50
|
+
is priced on its own.
|
|
51
|
+
- **The page a visitor arrives on is prerendered at the edge**, close to them.
|
|
52
|
+
- **Every publish also updates the site in the [Uniweb app](https://uniweb.app)**, so you and the
|
|
53
|
+
people you work with can preview and edit it at any time, without waiting for a developer or
|
|
54
|
+
an agent.
|
|
55
|
+
- **The site grows there with no changes**: more languages, live records, forms, analytics, a
|
|
56
|
+
members' area, and payments through your own Stripe account.
|
|
57
|
+
|
|
58
|
+
`pnpm uniweb deploy` ships the site to a free static host instead: GitHub Pages, Cloudflare Pages,
|
|
59
|
+
Netlify, Vercel or S3 + CloudFront. A static host serves only what a build makes, so edits made in
|
|
60
|
+
the app reach the site through this project and a new build, records change at the next build,
|
|
61
|
+
and forms, analytics, accounts and payments each need a service of your own. The site can move to
|
|
62
|
+
Uniweb hosting at any time with `pnpm uniweb publish`.
|
|
63
|
+
|
|
40
64
|
## What's here
|
|
41
65
|
|
|
42
66
|
| Folder | What it holds |
|
|
@@ -76,28 +100,23 @@ export default function Hero({ content }) {
|
|
|
76
100
|
`text-heading` and `text-body` are theme tokens. A site's `theme.yml` sets their colors, so one
|
|
77
101
|
component works in light and dark sections, and on every site that uses it.
|
|
78
102
|
|
|
79
|
-
##
|
|
80
|
-
|
|
81
|
-
Start with a normal project, and connect the app when you want visual authoring:
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
pnpm uniweb login # sign in to your Uniweb account
|
|
85
|
-
pnpm uniweb sync # the first sync brings the site and its foundation into the app
|
|
86
|
-
```
|
|
103
|
+
## The project and the Uniweb app
|
|
87
104
|
|
|
88
|
-
|
|
105
|
+
A publish brings the site into the app, and so does a push, which sends it as a draft without
|
|
106
|
+
taking it live. From then on, the CLI keeps the two in step:
|
|
89
107
|
|
|
90
108
|
| Command | What it does |
|
|
91
109
|
|---|---|
|
|
110
|
+
| `pnpm uniweb status` | says what changed in the app and in git, and what to run |
|
|
92
111
|
| `pnpm uniweb push` | sends your section types, schemas and content to the app: a draft, not live |
|
|
93
|
-
| `pnpm uniweb pull` | brings
|
|
94
|
-
| `pnpm uniweb sync` | takes your teammates' commits and the
|
|
95
|
-
| `pnpm uniweb publish` | pushes, then takes the site live on Uniweb hosting
|
|
112
|
+
| `pnpm uniweb pull` | brings edits made in the app into your files, as a git merge |
|
|
113
|
+
| `pnpm uniweb sync` | takes your teammates' commits and the app's edits, then pushes yours |
|
|
114
|
+
| `pnpm uniweb publish` | pushes, then takes the site live on Uniweb hosting |
|
|
96
115
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
116
|
+
People editing in the app never deal with synchronization. On your side, edits to different
|
|
117
|
+
sections combine, and nothing overwrites an edit made in the app. When the same section changed
|
|
118
|
+
on both sides, `sync` stops at a git conflict for you to settle. Like git, a push sends what you
|
|
119
|
+
have committed; `--commit` commits the site's content first.
|
|
101
120
|
|
|
102
121
|
### Structured content, editable without an admin app
|
|
103
122
|
|
|
@@ -112,34 +131,26 @@ export default {
|
|
|
112
131
|
}
|
|
113
132
|
```
|
|
114
133
|
|
|
115
|
-
A standard schema needs `@uniweb/schemas` as a dependency of the foundation. In the app,
|
|
134
|
+
A standard schema needs `@uniweb/schemas` as a dependency of the foundation. In the app, people
|
|
116
135
|
get forms and records for those schemas. No separate admin application is needed to make the
|
|
117
136
|
data editable.
|
|
118
137
|
|
|
119
|
-
##
|
|
120
|
-
|
|
121
|
-
The framework works on its own, too.
|
|
138
|
+
## Foundations for your clients' sites
|
|
122
139
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
ships it to GitHub Pages, Cloudflare Pages, Netlify, Vercel or S3 + CloudFront.
|
|
126
|
-
- **Foundations for your clients' sites.** If the sites belong to your clients, who make and edit
|
|
127
|
-
them in the app, this project is where you build and test the foundation.
|
|
128
|
-
`pnpm uniweb register` publishes it to Uniweb for their sites.
|
|
140
|
+
If the sites belong to your clients, who make and edit them in the app, this project is where you
|
|
141
|
+
build and test the foundation. `pnpm uniweb register` publishes it to Uniweb for their sites.
|
|
129
142
|
|
|
130
|
-
##
|
|
143
|
+
## Prompts to try
|
|
131
144
|
|
|
132
145
|
A Uniweb project gives an agent a system to work within, its section types, schemas and content
|
|
133
|
-
conventions, instead of a blank canvas.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
[AGENTS.md](./AGENTS.md) is written for developers and AI agents alike. Many coding agents read it
|
|
137
|
-
on their own when they start in this folder; point any other agent at it first. `npx uniweb guide`
|
|
138
|
-
prints the rest of the manual, one subject at a time.
|
|
139
|
-
`npx uniweb@latest update` moves the project to the latest release of Uniweb, and AGENTS.md with
|
|
140
|
-
it.
|
|
146
|
+
conventions, instead of a blank canvas. `npx uniweb guide` prints the rest of the manual, one
|
|
147
|
+
subject at a time, and `npx uniweb@latest update --yes` moves the project to the latest release
|
|
148
|
+
of Uniweb, AGENTS.md with it.
|
|
141
149
|
|
|
142
|
-
|
|
150
|
+
**Adding a language:**
|
|
151
|
+
```
|
|
152
|
+
Add Spanish to the site and translate every page. Keep English as the default.
|
|
153
|
+
```
|
|
143
154
|
|
|
144
155
|
**Converting an existing design:**
|
|
145
156
|
```
|
|
@@ -166,6 +177,6 @@ the Hero section type from the homepage.
|
|
|
166
177
|
|
|
167
178
|
- [Documentation](https://uniweb.io/docs): guides and reference. For AI agents, its index is
|
|
168
179
|
https://uniweb.io/llms.txt
|
|
169
|
-
- [Uniweb app](https://uniweb.app): the visual
|
|
180
|
+
- [Uniweb app](https://uniweb.app): the visual editor
|
|
170
181
|
- `pnpm uniweb <command> --help`: every command's options
|
|
171
182
|
- `pnpm uniweb doctor`: checks the project's configuration
|