uniweb 1.34.1 → 1.34.2

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.34.1",
3
+ "version": "1.34.2",
4
4
  "description": "Create structured Vite + React sites with content/code separation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -43,11 +43,11 @@
43
43
  "tar": "^7.5.21",
44
44
  "@uniweb/content-writer": "~1.3.2",
45
45
  "@uniweb/core": "~1.6.12",
46
- "@uniweb/schemas": "~1.7.2",
46
+ "@uniweb/schemas": "~1.7.3",
47
47
  "@uniweb/semantic-parser": "~1.13.4"
48
48
  },
49
49
  "peerDependencies": {
50
- "@uniweb/build": "~1.23.1",
50
+ "@uniweb/build": "~1.23.2",
51
51
  "@uniweb/semantic-parser": "~1.13.4",
52
52
  "@uniweb/content-reader": "~1.5.10"
53
53
  },
@@ -45,7 +45,7 @@ site/
45
45
  | `form` | a form an author designs | a list of controls |
46
46
  | `scene` | a Scene Composition Format document | flat |
47
47
 
48
- Each type's fields, with what each is for: https://github.com/uniweb/schemas/tree/main/src/standard. A record holds only its type's fields: a push refuses one with a field the type lacks, though a static build keeps it. What a site says differently (a topic) goes in a field the type has (`tags`), or the type is not the one.
48
+ Each type's fields, with what each is for: https://github.com/uniweb/schemas/tree/main/src/standard. A record holds only its type's fields: `uniweb validate` reports one the type lacks and a push refuses it, while a build notes it and still delivers it. What a site says differently (a topic) goes in a field the type has (`tags`), or the type is not the one.
49
49
 
50
50
  Keep directories flat — `records/article/2025/x.md` reads as the `2025` schema of an `article` org. A `_`-prefixed file is not a record.
51
51
 
@@ -176,7 +176,7 @@ function Article({ content, block }) { // data: { article: { schema: '@std/art
176
176
 
177
177
  **Component-side fetching** for a search box, "load more", a lazy popover: `useFetched`, `useCacheEntry`, `useWholeRecord` share the framework's cache and dedupe same-key requests. On a prerendered page a hook's first render finds only the page's own data; anything else prerenders as the loading state. Declare a key for whatever a page must show without JavaScript.
178
178
 
179
- **`uniweb validate`** checks every record file against declared schemas (missing required, type/enum/format, nested fields); a violation fails it (`--lax` only reports), and `push`/`publish` refuse the same findings. External queries are reported as deferred. A `ref` must name a record in the project (a uuid is left alone); an `options` value isn't checked against the entity it names.
179
+ **`uniweb validate`** checks every record file against declared schemas (missing required, type/enum/format, nested fields, and what a push cannot carry: a field the schema lacks, a markdown body with no field for it); a violation fails it (`--lax` only reports), and `push`/`publish` refuse the same findings. External queries are reported as deferred. A `ref` must name a record in the project (a uuid is left alone); an `options` value isn't checked against the entity it names.
180
180
 
181
181
  ## External sources and transports
182
182
 
@@ -156,8 +156,10 @@ function printSiteHuman(result) {
156
156
  )
157
157
  }
158
158
  for (const f of g.findings) {
159
+ // A finding on the record itself (its markdown body, its shape) names no field.
160
+ const at = f.field ? ` › ${f.field}` : ''
159
161
  log(
160
- ` ${colors.yellow}•${colors.reset} item ${colors.bright}"${f.item}"${colors.reset} › ${f.field} — ${f.message}`
162
+ ` ${colors.yellow}•${colors.reset} item ${colors.bright}"${f.item}"${colors.reset}${at} — ${f.message}`
161
163
  )
162
164
  }
163
165
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-11-11T22:21:29.972Z",
3
+ "generatedAt": "2026-11-11T23:15:48.024Z",
4
4
  "packages": {
5
5
  "@uniweb/api": {
6
6
  "version": "1.7.0"
7
7
  },
8
8
  "@uniweb/build": {
9
- "version": "1.23.1"
9
+ "version": "1.23.2"
10
10
  },
11
11
  "@uniweb/content-reader": {
12
12
  "version": "1.5.10"
@@ -42,7 +42,7 @@
42
42
  "version": "1.0.1"
43
43
  },
44
44
  "@uniweb/schemas": {
45
- "version": "1.7.2"
45
+ "version": "1.7.3"
46
46
  },
47
47
  "@uniweb/scholar": {
48
48
  "version": "1.1.2"
@@ -24,7 +24,7 @@
24
24
 
25
25
  import { execFile, execFileSync } from 'node:child_process'
26
26
  import { existsSync, readFileSync, realpathSync } from 'node:fs'
27
- import { join, relative, resolve, sep } from 'node:path'
27
+ import { basename, dirname, join, relative, resolve, sep } from 'node:path'
28
28
  import yaml from 'js-yaml'
29
29
  import { repoOf } from './sync-point.js'
30
30
  import { quietGitEnv, upstreamOf } from './git.js'
@@ -148,11 +148,15 @@ export function mountHolding(siteDir, abs) {
148
148
 
149
149
  // git names a repository's top by its real path, and a mount may be reached through a link (a
150
150
  // temporary folder on macOS is): compared as written, it would read as outside the repository.
151
+ // ⭐ A folder that is not there — one inside a submodule no clone checked out — is its nearest
152
+ // folder that is, resolved, and the rest as written. ⛔ Until 2026-11-11 it was compared as written,
153
+ // so a mount inside such a submodule read as a folder no repository holds.
151
154
  function realOf(abs) {
152
155
  try {
153
156
  return realpathSync(abs)
154
157
  } catch {
155
- return abs // not there: compared as written
158
+ const parent = dirname(abs)
159
+ return parent === abs ? abs : join(realOf(parent), basename(abs))
156
160
  }
157
161
  }
158
162
 
@@ -184,7 +184,12 @@ export function writableMounts(siteDir) {
184
184
  if (holding.kind === 'submodule') {
185
185
  const top = join(repo.top, holding.submodule.path)
186
186
  const sub = repoOf(top)
187
- if (!sub?.head) why = 'unchecked'
187
+ // ⛔ A submodule never checked out (a clone made without `--recurse-submodules`) is an empty
188
+ // folder of the site's own repository, and git answers for it with the site's: only a
189
+ // repository whose top is the submodule's folder is the submodule. Until 2026-11-11 the site's
190
+ // answer counted, and a pull in such a clone wrote the mounted pages into the top of the site's
191
+ // repository, committed them, and pinned the submodule to a commit of the site's.
192
+ if (!sub?.head || realOf(sub.top) !== realOf(top)) why = 'unchecked'
188
193
  else submodules.push({ segment, at: holding.submodule.path, root: relative(realOf(top), realOf(abs)).split(sep).join('/') || '.', repo: sub })
189
194
  } else if (holding.kind !== 'site') why = holding.kind
190
195
  } else {