@uniweb/build 1.20.4 → 1.20.5

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.20.4",
3
+ "version": "1.20.5",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
@@ -58,14 +58,14 @@
58
58
  "sharp": "^0.35.5",
59
59
  "yaml": "^2.5.0",
60
60
  "@uniweb/content-reader": "~1.5.9",
61
+ "@uniweb/schemas": "~1.7.1",
62
+ "@uniweb/semantic-parser": "~1.13.2",
61
63
  "@uniweb/theming": "~1.3.2",
62
- "@uniweb/projections": "~1.2.14",
63
- "@uniweb/schemas": "~1.7.0",
64
64
  "@uniweb/content-writer": "~1.3.1",
65
- "@uniweb/semantic-parser": "~1.13.2"
65
+ "@uniweb/projections": "~1.2.15"
66
66
  },
67
67
  "optionalDependencies": {
68
- "@uniweb/runtime": "~1.5.5"
68
+ "@uniweb/runtime": "~1.5.6"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
@@ -74,8 +74,8 @@
74
74
  "@tailwindcss/vite": "^4.0.0",
75
75
  "@vitejs/plugin-react": "^4.0.0 || ^5.0.0",
76
76
  "vite-plugin-svgr": "^4.0.0",
77
- "@uniweb/core": "~1.6.10",
78
- "@uniweb/runtime": "~1.5.5"
77
+ "@uniweb/core": "~1.6.11",
78
+ "@uniweb/runtime": "~1.5.6"
79
79
  },
80
80
  "peerDependenciesMeta": {
81
81
  "vite": {
@@ -28,7 +28,7 @@ import {
28
28
  renderSiteIndex,
29
29
  renderPageMarkdown,
30
30
  resolveAgentsConfig,
31
- selectIndexablePages,
31
+ markdownPageRule,
32
32
  selectIndexBranches,
33
33
  pageMarkdownFilename,
34
34
  branchIndexFilename,
@@ -136,15 +136,18 @@ export function agentFiles(content, records, { sections = null } = {}) {
136
136
  }
137
137
 
138
138
  if (agents.markdown) {
139
- for (const page of selectIndexablePages(content.pages, { exclude: agents.exclude })) {
139
+ // ⭐ Which pages have one is `markdownPageRule`'s: the rule a host answers a request for one by
140
+ // (`resolvePageMarkdown`), so a static build writes a page's markdown exactly where a host
141
+ // serves one for the same content.
142
+ const rule = markdownPageRule(content)
143
+ for (const page of content.pages.filter(rule.page)) {
140
144
  const markdown = renderPageMarkdown(page, { sections: sections?.get(page.route) })
141
145
  if (markdown) files.push({ kind: 'markdown', fileName: `${prefix}${pageMarkdownFilename(at(page.route))}`, source: markdown, route: page.route })
142
146
  }
143
- // Each record's page, held to the exclusions a page is held to — the site's pages among them,
144
- // so a record under a branch `llms.txt` leaves out gets no file, as it gets no line there.
145
- const listed = indexableRecordRoutes(content.pages, records?.pages, agents.exclude)
147
+ // Each record's page, by the same rule: a record under a branch `llms.txt` leaves out gets no
148
+ // file, as it gets no line there.
146
149
  for (const { route, markdown } of records?.pages || []) {
147
- if (!listed.has(route)) continue
150
+ if (!rule.record(route)) continue
148
151
  files.push({ kind: 'markdown', fileName: `${prefix}${pageMarkdownFilename(routeOnDisk(at(route)))}`, source: markdown, route })
149
152
  }
150
153
  }
@@ -184,15 +187,3 @@ export function describeProjections(files) {
184
187
  if (markdown) lines.push(`Generated ${markdown} page markdown projections (the records their sections show are added by prerendering)`)
185
188
  return lines
186
189
  }
187
-
188
- /** The routes of the record pages `llms.txt` lists, judged among the site's own pages. */
189
- function indexableRecordRoutes(pages = [], recordPages = [], exclude) {
190
- if (!recordPages?.length) return new Set()
191
- const routes = new Set(recordPages.map((page) => page.route))
192
- const candidates = [...pages, ...recordPages.map(({ route }) => ({ route }))]
193
- return new Set(
194
- selectIndexablePages(candidates, { exclude })
195
- .map((page) => page.route)
196
- .filter((route) => routes.has(route))
197
- )
198
- }