uniweb 1.31.2 → 1.31.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniweb",
3
- "version": "1.31.2",
3
+ "version": "1.31.3",
4
4
  "description": "Create structured Vite + React sites with content/code separation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -43,13 +43,13 @@
43
43
  "tar": "^7.5.21",
44
44
  "@uniweb/core": "~1.6.9",
45
45
  "@uniweb/semantic-parser": "~1.13.2",
46
- "@uniweb/content-writer": "~1.3.1",
47
- "@uniweb/schemas": "~1.7.0"
46
+ "@uniweb/schemas": "~1.7.0",
47
+ "@uniweb/content-writer": "~1.3.1"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@uniweb/semantic-parser": "~1.13.2",
51
51
  "@uniweb/content-reader": "~1.5.9",
52
- "@uniweb/build": "~1.20.2"
52
+ "@uniweb/build": "~1.20.3"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "@uniweb/build": {
@@ -326,7 +326,7 @@ Every guide ships with the CLI this project pins, so it describes the version in
326
326
  | start a project, grow the workspace, learn from a template | `uniweb guide start` |
327
327
  | work with records, queries, `[slug]` pages, external APIs, schemas, Loom | `uniweb guide data` |
328
328
  | add search, forms, tracking, Google Analytics or Tag Manager, an assistant | `uniweb guide services` |
329
- | the site has accounts or member data (`services.backend`, `@uniweb/api`) | `uniweb guide backend` |
329
+ | the site has accounts or member data (`services.backend`, `blueprint.yml`, `@uniweb/api`) | `uniweb guide backend` |
330
330
  | add a language | `uniweb guide i18n` |
331
331
  | publish, deploy, push/pull, register, CI, workspaces, updates | `uniweb guide ship` |
332
332
  | port a React / Next / generated design | `uniweb guide migrate` |
@@ -58,7 +58,7 @@ await writer.update(item.id, { ...item.data, bio: 'Bonjour' }, { language: 'fr'
58
58
 
59
59
  Gate controls on what the viewer may do — a record's `can_edit` from a single-entity read — but never rely on that for safety: a foundation runs with the viewer's authority, so hiding a button hides a button. Not on `viewer.roles` alone: a session holds its roles as a reader's until elevated, so a gate on `system_admin` shows the operator nothing until then. Draw a role-acting control from `useElevation().rolesInFull` and let the record answer.
60
60
 
61
- What protects content is the **entry**: a member writes their own entries and not another's, enforced by the store. **Models are open** — anyone signed in may create entries of any Model. A schema protects how an item changes and who reads an entry:
61
+ What protects content is the **entry**: a member writes their own entries and not another's, enforced by the store. **Every type starts closed**: the operator adds its entries, and anyone else only where the site's `blueprint.yml` opens it (below). A schema protects how an item changes and who reads an entry:
62
62
 
63
63
  ```yaml
64
64
  # schemas/attendance.yml
@@ -81,6 +81,29 @@ fields:
81
81
 
82
82
  `readable_with` (`read` | `edit` | `admin`, only on a reference) is one step; a backend refuses adding it to a field entries already fill. `grantable: false` keeps entries from being shared with a person or team. `sold_with` only on a reference; an unmarked one carries nothing. `visitor_fills: true` marks a field a site's visitor may fill, and a type with one takes visitors' submissions, confirmed by email. Mark it per field, on a top-level section's fields only. The build refuses it on files, on a reference with `readable_with`/`sold_with`, and in a section that leaves a `required` field unmarked.
83
83
 
84
+ ## Who adds and reads each type: `blueprint.yml`
85
+
86
+ Beside `site.yml`, in a site whose `services` names `backend`: how a backend started from the site begins.
87
+
88
+ ```yaml
89
+ signup: invite_only # or open, the default: who may create an account
90
+ teams: # founded empty; people join them in the backend's administration
91
+ sales: { label: Sales }
92
+ access:
93
+ '@/vehicle':
94
+ add: [sales] # who adds entries: open (every signed-in account) · [teams] · [] (the operator alone)
95
+ all: { sales: edit } # every entry of the type, not only one's own: <team> or members → read | edit
96
+ '@/request': { add: open } # each member keeps their own
97
+ publicQueries: # what visitors who aren't signed in may read
98
+ '@/vehicle': { whole: true, where: { status: { in: [available, pending] } } } # whole is required; false = briefs
99
+ ```
100
+
101
+ - **Applied once**, when a backend is started from the site: its own, a clone's of a template, or one started again after it was destroyed. Then the operator changes these in the backend's administration. An edited file is pushed and pulled with the site, and reaches no backend already running.
102
+ - A type not listed stays closed. Name types as `queries.yml` does: `@/vehicle` for the foundation's own, sent in its scope.
103
+ - A build, a push and `uniweb doctor` refuse a malformed file, naming the key; a push refuses whole. A type none of the site's foundations declares only warns: a backend started from the site leaves that line out, and the publish says so. `where`, `sort` and `limit` are the backend's to judge, and one it refuses is left out the same way.
104
+ - A team's `all: edit` reaches the entries once the member confirms it is them (below); a team's `add` and `members: edit` need no confirming. Who is in a team, and roles, are never the file's.
105
+ - A static build carries none of it. A pull writes it back here, never into `site.yml`.
106
+
84
107
  ## Acting as an administrator
85
108
 
86
109
  An administrator's session reads what their role reaches and changes nothing through the role until they confirm it is them; their own records they edit as always.
@@ -152,8 +175,11 @@ $devBackend: ./mock/api.js # what answers in `uniweb dev`; `$` keys are never
152
175
 
153
176
  ```js
154
177
  // site/mock/api.js
178
+ import { fileURLToPath } from 'node:url'
155
179
  import { createMockBackend } from '@uniweb/api/mock'
156
- export default createMockBackend({ seed }).fetch
180
+ import { readBlueprint } from '@uniweb/build/blueprint'
181
+ const blueprint = readBlueprint(fileURLToPath(new URL('..', import.meta.url))) // the site's blueprint.yml
182
+ export default createMockBackend({ seed, blueprint }).fetch
157
183
  ```
158
184
 
159
- `uniweb dev` answers the `backend` service with it at an address on its own origin (cookies behave as in production). Write no address of your own: under `services:` an address means a backend you run. The mock **enforces** entry ownership and `append_only`; it doesn't model `readable_with`, `sold_with`, second factors or password rules. Mail it would send prints in the terminal with its link on the site's root. Seed `offers: [{ email, invitations: 1 }]` to try an invitation; a seeded entity takes `grants: { member: 'read' }`; `units: [{ handle, parent?, members, floor? }]` gives a create somewhere to land. The seed names your own types `@/track`. State is in memory; restart to reset. `uniweb create my-event --template conference` is a worked example.
185
+ `uniweb dev` answers the `backend` service with it at an address on its own origin (cookies behave as in production). Write no address of your own: under `services:` an address means a backend you run. The mock begins as a backend started from the site does: every type closed until the blueprint opens it, its `signup`, its teams (a seeded account names its own, `teams: ['sales']`). It **enforces** those, entry ownership and `append_only`; it doesn't model public queries, `readable_with`, `sold_with`, second factors or password rules. Mail it would send prints in the terminal with its link on the site's root. Seed `offers: [{ email, invitations: 1 }]` to try an invitation; a seeded entity takes `grants: { member: 'read' }`; `units: [{ handle, parent?, members, floor? }]` gives a create somewhere to land. The seed names your own types `@/track`. State is in memory; restart to reset. `uniweb create my-event --template conference` is a worked example.
@@ -108,7 +108,7 @@ When `status` names a newer release, take it: update, restart any running dev se
108
108
  | `[dir]` / `[path]` as parametric folder names; a folder inside `[...path]/` | `[slug]`, `[uuid]`, `[<field>]`, `[...path]` |
109
109
  | `fonts.mono` | `fonts.code` |
110
110
  | `seo.baseUrl`; `seo.defaultImage`; `seo.locales`; `url:`, `trailingSlash:` in `site.yml` | `seo.origin` (scheme + host, no path); `seo.image`; `languages:`; `seo.origin` again |
111
- | `creatable_by` in a schema | models are open; protect with `append_only`, `readable_with`, `grantable` |
111
+ | `creatable_by` in a schema | who adds a type's entries is `blueprint.yml`'s `access.<type>.add`; a schema protects them with `append_only`, `readable_with`, `grantable` |
112
112
  | `uniweb.id`, `uniweb.scope` in a foundation's `package.json` | `name: '@scope/name'` in `main.js` |
113
113
  | `main.jsx`, `foundation.js`; JSX in a `.js` component | `main.js` (plain JS); `.jsx` |
114
114
  | `visuals:` in `meta.js`; `data` as a `content:` element | a `media:` element in `content:`; declare the tag in `data:` |
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-11-09T22:12:50.994Z",
3
+ "generatedAt": "2026-11-09T23:18:54.820Z",
4
4
  "packages": {
5
5
  "@uniweb/api": {
6
6
  "version": "1.7.0"
7
7
  },
8
8
  "@uniweb/build": {
9
- "version": "1.20.2"
9
+ "version": "1.20.3"
10
10
  },
11
11
  "@uniweb/content-reader": {
12
12
  "version": "1.5.9"