@uniweb/build 1.19.1 → 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.1",
3
+ "version": "1.19.2",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
@@ -56,12 +56,12 @@
56
56
  "js-yaml": "^4.3.2",
57
57
  "sharp": "^0.35.5",
58
58
  "yaml": "^2.5.0",
59
+ "@uniweb/content-reader": "~1.5.9",
59
60
  "@uniweb/schemas": "~1.6.11",
60
61
  "@uniweb/semantic-parser": "~1.13.2",
61
62
  "@uniweb/theming": "~1.3.2",
62
- "@uniweb/projections": "~1.2.13",
63
- "@uniweb/content-reader": "~1.5.9",
64
- "@uniweb/content-writer": "~1.3.1"
63
+ "@uniweb/content-writer": "~1.3.1",
64
+ "@uniweb/projections": "~1.2.13"
65
65
  },
66
66
  "optionalDependencies": {
67
67
  "@uniweb/runtime": "~1.5.4"
@@ -69,9 +69,11 @@ function typeRoot(dir, kind) {
69
69
  * Each name of a scope that two or more of the packages define, with the files that define it and
70
70
  * whether they say the same thing.
71
71
  *
72
- * @param {{ dir: string, kind: 'foundation'|'schemas', scope?: string|null }[]} packages - the
73
- * workspace's foundations and schemas packages; a `scope` given is used over what the package says
74
- * (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
75
77
  * @returns {Promise<{ ref: string, files: string[], differ: boolean }[]>} by name
76
78
  */
77
79
  export async function typesDefinedTwice(packages) {
@@ -81,7 +83,7 @@ export async function typesDefinedTwice(packages) {
81
83
  const dir = real(pkg.dir)
82
84
  if (seen.has(dir)) continue
83
85
  seen.add(dir)
84
- const scope = asScope(pkg.scope) || (await packageTypeScope(dir, pkg.kind))
86
+ const scope = await packageTypeScope(dir, pkg.kind)
85
87
  if (!scope) continue
86
88
  const root = typeRoot(dir, pkg.kind)
87
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
  }