@uniweb/build 1.19.0 → 1.19.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/build",
3
- "version": "1.19.0",
3
+ "version": "1.19.2",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
@@ -59,12 +59,12 @@
59
59
  "@uniweb/content-reader": "~1.5.9",
60
60
  "@uniweb/schemas": "~1.6.11",
61
61
  "@uniweb/semantic-parser": "~1.13.2",
62
- "@uniweb/content-writer": "~1.3.1",
63
62
  "@uniweb/theming": "~1.3.2",
63
+ "@uniweb/content-writer": "~1.3.1",
64
64
  "@uniweb/projections": "~1.2.13"
65
65
  },
66
66
  "optionalDependencies": {
67
- "@uniweb/runtime": "~1.5.3"
67
+ "@uniweb/runtime": "~1.5.4"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
@@ -73,8 +73,8 @@
73
73
  "@tailwindcss/vite": "^4.0.0",
74
74
  "@vitejs/plugin-react": "^4.0.0 || ^5.0.0",
75
75
  "vite-plugin-svgr": "^4.0.0",
76
- "@uniweb/core": "~1.6.8",
77
- "@uniweb/runtime": "~1.5.3"
76
+ "@uniweb/core": "~1.6.9",
77
+ "@uniweb/runtime": "~1.5.4"
78
78
  },
79
79
  "peerDependenciesMeta": {
80
80
  "vite": {
@@ -1,20 +1,14 @@
1
1
  /**
2
- * ⭐ ONE NAME IN A SCOPE IS ONE TYPE. A data schema registers by its name alone — `@acme/member`, its
3
- * scope and its name — and a registry holds one type under each. A register whose declaration of it
4
- * differs from the one held makes a new version of that type, which every site using it then reads.
5
- * So two packages of one scope in a workspace that each define `member` — two foundations, or a
6
- * foundation and the scope's schemas package — are two definitions of one type, and whichever
7
- * registers last decides what it is for the other's sites too. Copies that agree today come apart the
8
- * first time one is edited.
2
+ * ⭐ A REGISTERED DATA SCHEMA IS USABLE BY ANY FOUNDATION OR SITE, by its full name — `@acme/member`.
3
+ * Its scope is a namespace, so that names never collide, and says who may publish under it, never who
4
+ * may use it *[Diego, 2026-09-25; 2026-11-08]*. A foundation that renders another's type declares it by
5
+ * that name, and a register names it and sends no definition of it (`uwx/registry-package.js`).
9
6
  *
10
- * A type several foundations of a scope use is defined once — in the scope's schemas package, or in
11
- * the one foundation that owns it — and every other foundation names it in full (`@acme/member`), with
12
- * `schemas.config.js` routing the scope to the folder that holds it (`resolve-data-schema.js`). A full
13
- * name is a reference, which a register names and does not send (`uwx/registry-package.js`).
14
- *
15
- * `uniweb register` refuses a definition that differs from another of the same name in the workspace,
16
- * since that is when a register changes what another foundation's sites read; `uniweb doctor` names
17
- * every name defined twice, agreeing or not.
7
+ * So a copy of a type's file in a second package of the same scope is a second definition of one type,
8
+ * and the copies come apart the first time one is edited. `typesDefinedTwice` names each such type, for
9
+ * `uniweb doctor` to recommend one definition, named in full elsewhere, with `schemas.config.js`
10
+ * giving a local build the file (`resolve-data-schema.js`). It refuses nothing: what a register of a
11
+ * changed definition does is the registry's to judge.
18
12
  */
19
13
 
20
14
  import { existsSync, readFileSync, realpathSync } from 'node:fs'
@@ -75,9 +69,11 @@ function typeRoot(dir, kind) {
75
69
  * Each name of a scope that two or more of the packages define, with the files that define it and
76
70
  * whether they say the same thing.
77
71
  *
78
- * @param {{ dir: string, kind: 'foundation'|'schemas', scope?: string|null }[]} packages - the
79
- * workspace's foundations and schemas packages; a `scope` given is used over what the package says
80
- * (a name `register` has just settled)
72
+ * A package whose name gives no scope yet is left out: until `register` writes one into its name, its
73
+ * types have no full name to compare.
74
+ *
75
+ * @param {{ dir: string, kind: 'foundation'|'schemas' }[]} packages - the workspace's foundations and
76
+ * schemas packages
81
77
  * @returns {Promise<{ ref: string, files: string[], differ: boolean }[]>} by name
82
78
  */
83
79
  export async function typesDefinedTwice(packages) {
@@ -87,7 +83,7 @@ export async function typesDefinedTwice(packages) {
87
83
  const dir = real(pkg.dir)
88
84
  if (seen.has(dir)) continue
89
85
  seen.add(dir)
90
- const scope = asScope(pkg.scope) || (await packageTypeScope(dir, pkg.kind))
86
+ const scope = await packageTypeScope(dir, pkg.kind)
91
87
  if (!scope) continue
92
88
  const root = typeRoot(dir, pkg.kind)
93
89
  if (!existsSync(join(root, 'schemas'))) continue
@@ -1582,13 +1582,10 @@ async function processPage(pagePath, pageName, siteRoot, { isIndex = false, pare
1582
1582
  page: {
1583
1583
  route,
1584
1584
  sourcePath: parentRoute === '/' ? `/${pageName}` : `${parentRoute}/${pageName}`,
1585
- id: authoredId(pageConfig.id),
1586
1585
  isIndex,
1587
- title: resolveDisplayTitle(pageConfig.title, pageName, null),
1588
- description: pageConfig.description || '',
1589
- label: pageConfig.label || null,
1590
- hidden: pageConfig.hidden || false,
1591
- hideIn: normalizeHideIn(pageConfig),
1586
+ // Its settings by the one rule every page's are read by, so a localized `slug:` gives it
1587
+ // its routes in each language, as a push sends it. A page with no content is never indexed.
1588
+ ...pageSettingFields(pageConfig, resolveDisplayTitle(pageConfig.title, pageName, null)),
1592
1589
  layout: {},
1593
1590
  seo: { noindex: true },
1594
1591
  redirect: target,
@@ -1608,13 +1605,10 @@ async function processPage(pagePath, pageName, siteRoot, { isIndex = false, pare
1608
1605
  page: {
1609
1606
  route,
1610
1607
  sourcePath: parentRoute === '/' ? `/${pageName}` : `${parentRoute}/${pageName}`,
1611
- id: authoredId(pageConfig.id),
1612
1608
  isIndex,
1613
- title: resolveDisplayTitle(pageConfig.title, pageName, null),
1614
- description: pageConfig.description || '',
1615
- label: pageConfig.label || null,
1616
- hidden: pageConfig.hidden || false,
1617
- hideIn: normalizeHideIn(pageConfig),
1609
+ // Its settings by the one rule every page's are read by, so a localized `slug:` gives it
1610
+ // its routes in each language, as a push sends it. A page with no content is never indexed.
1611
+ ...pageSettingFields(pageConfig, resolveDisplayTitle(pageConfig.title, pageName, null)),
1618
1612
  layout: {},
1619
1613
  seo: { noindex: true },
1620
1614
  rewrite: pageConfig.rewrite,
@@ -1124,9 +1124,14 @@ function writeMdPage({ record, place, route, ctx, report, pageContext, sourceLoc
1124
1124
  /**
1125
1125
  * An atomic page's settings as its frontmatter says them (`site/page-settings.js`), by the inverse a
1126
1126
  * `page.yml` is written by (`pageRecordToYml`): each page key, `undefined` for one the page does not
1127
- * have, so the file's is removed. Its `title:` only where its first heading, else its name, does not
1128
- * give it, and its localized URL segments added and never removed, as a `page.yml`'s are
1129
- * (`pageSlugToYml`).
1127
+ * have, so the file's is removed. Its localized URL segments are added and never removed, as a
1128
+ * `page.yml`'s are (`pageSlugToYml`).
1129
+ *
1130
+ * Its `title:` is kept as the author wrote it: a file that holds one keeps it, holding the page's
1131
+ * title, and a file that holds none gains one only where its first heading, else its name, does not
1132
+ * give the title. So a pull of what was pushed leaves the file as it was, and a title the author fixed
1133
+ * in the file stays fixed when the heading changes. ⛔ Until 2026-11-09 a `title:` equal to the
1134
+ * heading's was removed, a change nobody made, after which the heading named the page.
1130
1135
  *
1131
1136
  * @returns {object}
1132
1137
  */
@@ -1135,7 +1140,7 @@ function atomicPageSettings(record, { name, sourceLocale, existing, canon, ctx }
1135
1140
  const yml = pageRecordToYml(record, null, sourceLocale, existing, { slug })
1136
1141
  const out = {}
1137
1142
  for (const key of ATOMIC_PAGE_KEYS) out[key] = yml[key]
1138
- if (out.title === mdPageImpliedTitle(record, { name, sourceLocale })) out.title = undefined
1143
+ if (existing?.title === undefined && out.title === mdPageImpliedTitle(record, { name, sourceLocale })) out.title = undefined
1139
1144
  if (out.slug === undefined && existing?.slug !== undefined) out.slug = existing.slug
1140
1145
  return out
1141
1146
  }