@uniweb/build 0.15.6 → 0.15.7

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": "0.15.6",
3
+ "version": "0.15.7",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
@@ -59,13 +59,13 @@
59
59
  "js-yaml": "^4.1.0",
60
60
  "sharp": "^0.33.2",
61
61
  "yaml": "^2.5.0",
62
- "@uniweb/projections": "0.1.1",
63
62
  "@uniweb/theming": "0.1.14",
64
- "@uniweb/content-writer": "0.2.8"
63
+ "@uniweb/projections": "0.1.2",
64
+ "@uniweb/content-writer": "0.2.9"
65
65
  },
66
66
  "optionalDependencies": {
67
- "@uniweb/content-reader": "1.1.16",
68
- "@uniweb/runtime": "0.8.37",
67
+ "@uniweb/runtime": "0.8.38",
68
+ "@uniweb/content-reader": "1.1.17",
69
69
  "@uniweb/schemas": "0.2.4"
70
70
  },
71
71
  "peerDependencies": {
@@ -75,7 +75,7 @@
75
75
  "@tailwindcss/vite": "^4.0.0",
76
76
  "@vitejs/plugin-react": "^4.0.0 || ^5.0.0",
77
77
  "vite-plugin-svgr": "^4.0.0",
78
- "@uniweb/core": "0.7.30"
78
+ "@uniweb/core": "0.7.31"
79
79
  },
80
80
  "peerDependenciesMeta": {
81
81
  "vite": {
@@ -56,7 +56,7 @@ function collectionOf(relPath) {
56
56
  * @returns {Promise<{ data: Object, search: Object }|null>} null when there is nothing
57
57
  * to deliver (no schema-less data AND no search index).
58
58
  */
59
- export async function assembleDataBall(distDir, schemalessNames = [], { projections = false } = {}) {
59
+ export async function assembleDataBall(distDir, schemalessNames = []) {
60
60
  const schemaless = new Set(schemalessNames)
61
61
  const allData = await readJsonTree(join(distDir, 'data'))
62
62
  const data = {}
@@ -65,47 +65,22 @@ export async function assembleDataBall(distDir, schemalessNames = [], { projecti
65
65
  }
66
66
  const search = await readJsonTree(join(distDir, '_search'))
67
67
 
68
- // Agent projections ride the same ball — same shape of thing (precomputed
69
- // at publish, opaque to the backend, served as-is), just text rather than
70
- // JSON. Off by default: what the artifacts are called and how they are
71
- // addressed on the serving side is the backend's to specify, and shipping
72
- // an unrecognized key into a payload the backend unwraps is not something
73
- // to decide unilaterally. Flip this on once that contract is agreed.
74
- const projectionFiles = projections ? await readTextTree(distDir) : {}
68
+ // Agent projections deliberately do NOT ride the ball.
69
+ //
70
+ // A backend that stores the site's content derives them itself at publish —
71
+ // one producer, so shipping ours would upload an artifact to the one host
72
+ // that does not need it, and invite two answers for one site. The projections
73
+ // this build emits into `dist/` are for hosts with no backend to derive them:
74
+ // static hosts and foreign backends. That is `@uniweb/projections`' scope and
75
+ // it is unchanged.
76
+ //
77
+ // (An opt-in `projections` bucket lived here while the delivery contract was
78
+ // open. It never shipped enabled, and the one-producer ruling closed the
79
+ // question — removed rather than left as a flag nobody may turn on.)
75
80
 
76
- const empty =
77
- Object.keys(data).length === 0 &&
78
- Object.keys(search).length === 0 &&
79
- Object.keys(projectionFiles).length === 0
80
- if (empty) return null
81
+ if (Object.keys(data).length === 0 && Object.keys(search).length === 0) return null
81
82
 
82
- return projections ? { data, search, projections: projectionFiles } : { data, search }
83
- }
84
-
85
- /**
86
- * Collect the agent projections from a built dist/ — `llms.txt` plus every
87
- * `.md` page projection, keyed by their served path.
88
- *
89
- * Deliberately excludes `node_modules`-shaped noise and anything under the
90
- * bundle's own asset directories; a site's `dist/` at this point holds only
91
- * what the link lane emitted.
92
- *
93
- * @param {string} distDir
94
- * @returns {Promise<Object<string, string>>}
95
- */
96
- async function readTextTree(distDir) {
97
- if (!existsSync(distDir)) return {}
98
- const out = {}
99
- const entries = await readdir(distDir, { withFileTypes: true, recursive: true })
100
- for (const entry of entries) {
101
- if (!entry.isFile()) continue
102
- const isProjection = entry.name === 'llms.txt' || entry.name.endsWith('.md')
103
- if (!isProjection) continue
104
- const full = join(entry.parentPath || entry.path, entry.name)
105
- const rel = relative(distDir, full).split(sep).join('/')
106
- out[rel] = await readFile(full, 'utf8')
107
- }
108
- return out
83
+ return { data, search }
109
84
  }
110
85
 
111
86
  // --- local media in the ball -------------------------------------------------