@uniweb/build 0.22.0 → 0.24.0

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.22.0",
3
+ "version": "0.24.0",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
@@ -59,16 +59,16 @@
59
59
  "js-yaml": "^4.1.0",
60
60
  "sharp": "^0.35.3",
61
61
  "yaml": "^2.5.0",
62
- "@uniweb/projections": "^0.3.1",
63
- "@uniweb/content-writer": "^0.3.3",
64
62
  "@uniweb/theming": "^0.1.15",
63
+ "@uniweb/content-writer": "^0.3.3",
64
+ "@uniweb/projections": "^0.3.3",
65
65
  "@uniweb/schemas": "^0.2.10"
66
66
  },
67
67
  "optionalDependencies": {
68
- "@uniweb/content-reader": "^1.2.2",
68
+ "@uniweb/runtime": "^0.12.0",
69
+ "@uniweb/semantic-parser": "^1.2.2",
69
70
  "@uniweb/schemas": "^0.2.10",
70
- "@uniweb/runtime": "^0.11.7",
71
- "@uniweb/semantic-parser": "^1.2.2"
71
+ "@uniweb/content-reader": "^1.2.2"
72
72
  },
73
73
  "peerDependencies": {
74
74
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
@@ -77,7 +77,7 @@
77
77
  "@tailwindcss/vite": "^4.0.0",
78
78
  "@vitejs/plugin-react": "^4.0.0 || ^5.0.0",
79
79
  "vite-plugin-svgr": "^4.0.0",
80
- "@uniweb/core": "^0.8.5"
80
+ "@uniweb/core": "^0.10.0"
81
81
  },
82
82
  "peerDependenciesMeta": {
83
83
  "vite": {
@@ -110,12 +110,27 @@ const INFO_TO_SITE_YML = {
110
110
  // through `config.services` and resolved at render time, so it never enters
111
111
  // `info` and a pull cannot launder it into authored config.
112
112
  //
113
- // ⚠️ One asymmetry worth knowing: push STRIPS credential-shaped keys, so a
114
- // block that carried an `apiKey` comes back without it and the pull rewrites
115
- // the author's file minus that line. That is intended the key must not be
116
- // there and the push already warned but it is the one case where a pull
117
- // removes something the author typed.
113
+ // ⚠️ Credential-shaped keys are STRIPPED ON PUSH (`stripCredentials`), so the
114
+ // backend never stores one and it cannot come back. What that does to the
115
+ // author's file depends on which direction they are pulling into, and the two
116
+ // differ this comment asserted the wrong one until it was run:
117
+ //
118
+ // - `pull` over an EXISTING site.yml — the local `apiKey` SURVIVES.
119
+ // `mergeYamlConfig` spreads one level (`{...existing[key], ...value}`), so
120
+ // the projected `{endpoint, …}` merges over the local block and nothing
121
+ // removes a key the document does not carry.
122
+ // - `clone` into a fresh directory — no local block exists, so the file is
123
+ // written from the document alone and has no `apiKey`.
124
+ //
125
+ // Both are correct: a pull does not silently delete something the author
126
+ // typed, and the push already warned them. The security property is upheld at
127
+ // the push, not by the pull. Measured end-to-end against a live uniwebd —
128
+ // every unit test passed before and after, so only a real push touched it.
118
129
  assistant: 'assistant',
130
+ // Authored-only, like `submit` and `assistant`: a host's tracking endpoint is
131
+ // offered through `config.services.tracking` and resolved at render, so it
132
+ // never enters `info` and a pull cannot launder it into authored config.
133
+ tracking: 'tracking',
119
134
  paths: 'paths',
120
135
  data: 'data',
121
136
  template: 'template',
package/src/uwx/site.js CHANGED
@@ -761,6 +761,20 @@ export async function siteProjectToDocument(siteRoot, opts = {}) {
761
761
  //
762
762
  // ⛔ Credentials are stripped, not trusted — see `stripCredentials`.
763
763
  setIf(info, 'assistant', stripCredentials(siteYml.assistant, 'assistant'))
764
+ // `tracking` — where this site's usage events go (`endpoint`, read by the
765
+ // runtime through `resolveService`, plus `consent:`). Same family as
766
+ // `search`/`submit`/`assistant` and here for the same reason: the bundle lane
767
+ // spreads all of site.yml while this one is an allowlist, so without this line
768
+ // an authored `tracking:` works on a static host and vanishes silently on the
769
+ // synced lane.
770
+ //
771
+ // ⛔ Credentials stripped like `assistant`. A collector that wants a write key
772
+ // is a real shape, and this block is published world-readable — but note the
773
+ // strip only reaches a KEYED FIELD: a key embedded in the endpoint URL itself
774
+ // (`https://collector/e?key=…`) is invisible here and is disclosed. The host's
775
+ // secret store is the only right home either way.
776
+ // (kb/framework/plans/tracking.md)
777
+ setIf(info, 'tracking', stripCredentials(siteYml.tracking, 'tracking'))
764
778
  setIf(info, 'paths', siteYml.paths)
765
779
  setIf(info, 'data', siteYml.data ?? siteYml.fetch)
766
780
  // `app` — the deployment's `@uniweb/app-spec` reference (a bare uuid string),