@uniweb/build 0.26.1 → 0.27.1
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 +8 -8
- package/src/site/build-site-data.js +10 -3
- package/src/site/collection-processor.js +89 -6
- package/src/site/collections-config.js +260 -0
- package/src/site/config.js +6 -174
- package/src/site/content-collector.js +12 -0
- package/src/site/data-fetcher.js +47 -0
- package/src/site/foundation-ref.js +207 -0
- package/src/uwx/collection-source.js +57 -1
- package/src/uwx/collections-config.js +9 -125
- package/src/uwx/collections.js +105 -21
- package/src/uwx/site.js +18 -3
- package/src/uwx/sync-package.js +4 -0
- package/src/vite-foundation-plugin.js +19 -4
package/src/uwx/site.js
CHANGED
|
@@ -234,10 +234,25 @@ function buildPageData(config, ctx) {
|
|
|
234
234
|
// at `<base>/data/<name>.json`.
|
|
235
235
|
if (fetch && typeof fetch.collection === 'string') {
|
|
236
236
|
const { collection, ...rest } = fetch
|
|
237
|
+
// ⭐ BOTH, deliberately, and they are not redundant.
|
|
238
|
+
//
|
|
239
|
+
// `collection` — the author's query, unresolved. A consumer that can ask
|
|
240
|
+
// a host where collections live (`config.records`) resolves it there,
|
|
241
|
+
// which is the only way a live lane is reachable at all: a resolved
|
|
242
|
+
// path names one place and closes the question.
|
|
243
|
+
//
|
|
244
|
+
// `path` — the compiled artifact, the answer when nobody declares a lane.
|
|
245
|
+
// Also what a consumer still reading `fetch.path` gets, so teaching the
|
|
246
|
+
// wire a new field does not break one that has not learned it.
|
|
247
|
+
//
|
|
248
|
+
// `@uniweb/core`'s resolveFetchConfigs gives `collection` precedence and
|
|
249
|
+
// drops `path` once it has resolved an address — matching parseFetchConfig,
|
|
250
|
+
// which has always returned early on `collection`.
|
|
251
|
+
//
|
|
237
252
|
// `schema` (the collection name) is BOTH the content.data key and part of the
|
|
238
|
-
// dataStore cache key (deriveCacheKey hashes {path,url,schema,…};
|
|
239
|
-
// is ignored). Mirrors the static build's parseFetchConfig
|
|
240
|
-
fetch = { path: collectionDataUrl(collection), schema: collection, ...rest }
|
|
253
|
+
// dataStore cache key (deriveCacheKey hashes {path,url,endpoint,schema,…};
|
|
254
|
+
// `collection` is ignored). Mirrors the static build's parseFetchConfig.
|
|
255
|
+
fetch = { collection, path: collectionDataUrl(collection), schema: collection, ...rest }
|
|
241
256
|
}
|
|
242
257
|
setIf(data, 'fetch', fetch)
|
|
243
258
|
if (isDynamic) {
|
package/src/uwx/sync-package.js
CHANGED
|
@@ -265,6 +265,10 @@ export async function emitSyncPackages(siteRoot, opts = {}) {
|
|
|
265
265
|
...(opts.foundationDir ? { foundationDir: opts.foundationDir } : {}),
|
|
266
266
|
...(opts.resolveModel ? { resolveModel: opts.resolveModel } : {}),
|
|
267
267
|
...(sourceLocale ? { sourceLocale } : {}),
|
|
268
|
+
// The publish org — resolves a foundation-relative `@/x` model ref into
|
|
269
|
+
// `@org/x` before it ships. Absent on an offline probe, which is why
|
|
270
|
+
// buildCollectionEntities warns rather than throws.
|
|
271
|
+
...(opts.org ? { org: opts.org } : {}),
|
|
268
272
|
})
|
|
269
273
|
const warnings = [...col.warnings]
|
|
270
274
|
|
|
@@ -88,11 +88,25 @@ let _buildingSSRBundle = false
|
|
|
88
88
|
* foundation's own package.json is recorded alongside the runtime version,
|
|
89
89
|
* declaring the author's intent for the validation above.
|
|
90
90
|
*
|
|
91
|
-
* ⛔ **`policy`
|
|
91
|
+
* ⛔ **`policy` IS NOT SENT AT REGISTER — this half is ours and is certain.**
|
|
92
92
|
* `readRuntimePin()` (`cli/src/utils/code-upload.js`) returns only `.runtime`, so
|
|
93
93
|
* `register` carries the floor as `info.runtime` and the policy is dropped. A
|
|
94
94
|
* foundation author who sets `uniweb.runtimePolicy` gets it emitted into `dist/`
|
|
95
|
-
* and
|
|
95
|
+
* and no further.
|
|
96
|
+
*
|
|
97
|
+
* ⚠️ **Whether a HOST reads `runtime-pin.json` off the built foundation is that
|
|
98
|
+
* host's to answer, not ours — name the host before saying what is consumed.**
|
|
99
|
+
* A note here once read "nothing consumes it today", unscoped, which is a claim
|
|
100
|
+
* about every host the framework serves and framework can substantiate it for
|
|
101
|
+
* none of them.
|
|
102
|
+
*
|
|
103
|
+
* 📌 **The check that refutes it, so this is not a claim with no expiry:** grep a
|
|
104
|
+
* host's serving code for `runtime-pin` / `runtimePolicy`. Asked and answered for
|
|
105
|
+
* the Uniweb host on **2026-08-26 — zero consumers across its delivery worker,
|
|
106
|
+
* mirror, runtime host and capability worker**, and its runtime version comes
|
|
107
|
+
* solely from published site metadata and is part of a render-cache key, so a
|
|
108
|
+
* request-time policy would collide with its invalidation model. **That is one
|
|
109
|
+
* host on one date; a static host or a foreign backend is a separate question.**
|
|
96
110
|
*
|
|
97
111
|
* ⚖️ **This is a field with standing and no consumer — NOT a mistake to delete.**
|
|
98
112
|
* The architecture assigns this declaration to the foundation on principle: each
|
|
@@ -205,8 +219,9 @@ async function emitRuntimePin(outDir, projectRoot) {
|
|
|
205
219
|
// delivered implies both travel. Only the floor does.
|
|
206
220
|
if (policy) {
|
|
207
221
|
console.log(
|
|
208
|
-
` note: runtimePolicy "${policy}" is recorded
|
|
209
|
-
` The floor (runtime ${runtimeVersion}) does travel, as info.runtime
|
|
222
|
+
` note: runtimePolicy "${policy}" is recorded in dist/runtime-pin.json and is NOT sent at register.\n` +
|
|
223
|
+
` The floor (runtime ${runtimeVersion}) does travel, as info.runtime.\n` +
|
|
224
|
+
` Whether your host reads the file is its own to say — see the header for how to check.`
|
|
210
225
|
)
|
|
211
226
|
}
|
|
212
227
|
}
|