uniweb 1.25.3 → 1.25.4

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",
3
- "version": "1.25.3",
3
+ "version": "1.25.4",
4
4
  "description": "Create structured Vite + React sites with content/code separation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,15 +41,15 @@
41
41
  "js-yaml": "^4.3.2",
42
42
  "prompts": "^2.4.2",
43
43
  "tar": "^7.5.21",
44
- "@uniweb/content-writer": "~1.3.1",
45
- "@uniweb/schemas": "~1.6.7",
46
44
  "@uniweb/core": "~1.6.1",
47
- "@uniweb/semantic-parser": "~1.13.2"
45
+ "@uniweb/content-writer": "~1.3.1",
46
+ "@uniweb/semantic-parser": "~1.13.2",
47
+ "@uniweb/schemas": "~1.6.7"
48
48
  },
49
49
  "peerDependencies": {
50
- "@uniweb/semantic-parser": "~1.13.2",
50
+ "@uniweb/build": "~1.14.1",
51
51
  "@uniweb/content-reader": "~1.5.8",
52
- "@uniweb/build": "~1.14.1"
52
+ "@uniweb/semantic-parser": "~1.13.2"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "@uniweb/build": {
@@ -2320,12 +2320,43 @@ product's own shape.
2320
2320
  A site may also name a vendor's own script under `services.tracking.scripts`, which the
2321
2321
  runtime loads once, after consent when a gate is declared, and never in a frame
2322
2322
  or during prerender. That is a **separate path with no connection to the stream
2323
- below** — the vendor measures its own way, and nothing you `track()` reaches it.
2324
- An entry is a URL and nothing else, so a vendor whose install also runs inline
2325
- lines does not work this way: Google Analytics and Google Tag Manager both do. On a
2323
+ below** — the vendor measures its own way, and nothing you `track()` reaches it. On a
2326
2324
  site you publish, an entry with no endpoint also asks the host for its collector;
2327
2325
  `enabled: false` beside `scripts` loads the script alone.
2328
2326
 
2327
+ ⛔ **An entry is a URL and nothing else, so Google Analytics, Google Tag Manager and
2328
+ Meta's pixel can't be installed this way.** Each one's install runs inline lines, and
2329
+ from a URL alone Google Analytics sends nothing and Tag Manager never gets its
2330
+ page-load event. A tag carrying an attribute the vendor reads, like `data-domain` or
2331
+ `data-website-id`, has the same problem. What works for these depends on who builds
2332
+ the pages:
2333
+
2334
+ - **The framework builds them** (`uniweb export`, `uniweb deploy --host=<adapter>`): the
2335
+ vendor's snippet goes in `head.html` next to `site.yml`, and the build adds it to every
2336
+ page's `<head>`. A `services.google` entry does nothing here.
2337
+ - **Uniweb Cloud builds them** (`uniweb publish`): `head.html` is kept and synced but not
2338
+ applied. For Google's two, name the ID and the host loads the tag from the next publish,
2339
+ with no code, on any foundation:
2340
+
2341
+ ```yaml
2342
+ services:
2343
+ google:
2344
+ id: G-XXXXXXXXXX # or GTM-XXXXXXX, or a list of both
2345
+ ```
2346
+
2347
+ The app's site settings edit the same entry, and a pull or a push carries a change across.
2348
+ Leave `services.tracking.scripts` unset beside it: a site's own list replaces what the host
2349
+ states, so Google's tag would not load. `tracking: { enabled: false, consent: required }`
2350
+ beside it holds the tag until a visitor answers, and takes a component using
2351
+ `useTrackingConsent()`, or it never loads.
2352
+
2353
+ Any other such vendor has to run from the foundation's code, so a site whose foundation you
2354
+ can't change can't add one. Say so to the person rather than writing a `head.html` that does
2355
+ nothing.
2356
+
2357
+ Either way, tell the person that Google Analytics counts in-app navigation only with the
2358
+ browser-history setting on, under Enhanced measurement in their data stream's settings.
2359
+
2329
2360
  **Some events you get for free.** These are reported for you, with no call from
2330
2361
  your foundation and regardless of how it renders:
2331
2362
 
@@ -2337,6 +2368,10 @@ your foundation and regardless of how it renders:
2337
2368
  | `conversion` | a phone or email tap (`name: phone`, `email`), and a link or page the site lists in `services.tracking.conversions`; also a form accepted by a provider of the site's own through `useFormSubmit`, and a sign-up through `@uniweb/api` |
2338
2369
  | `engagement` | a sign-in through `@uniweb/api` (`name: sign_in`) |
2339
2370
 
2371
+ A `services.tracking.conversions` list is public, since it is in every page's data, so a
2372
+ listed link must not carry a token. On a site you publish it also asks the host for its
2373
+ collector, as any `tracking` entry with no endpoint does.
2374
+
2340
2375
  ⛔ **So don't write your own link-click or scroll-into-view listener for these,**
2341
2376
  and don't report a sign-up, a sign-in or an accepted form that goes through kit or
2342
2377
  `@uniweb/api`. A second report double-counts against a collector that already has them.
@@ -2984,7 +3019,8 @@ yours answers. **On a site your host publishes, a service is off unless `service
2984
3019
  list the ones the site uses (the templates list theirs). `records: true` asks for your records to be
2985
3020
  delivered live to the published pages. Turn it on before the first publish of a page that shows
2986
3021
  records with a data schema: without it those records never reach the published page, and `publish`
2987
- warns. A static build reads records from files and ignores it. An entry
3022
+ warns. A static build reads records from files and ignores it. `google: { id: G-XXXXXXXXXX }`
3023
+ asks the host to load Google's tag, also ignored by a static build (see Tracking). An entry
2988
3024
  says everything about its service: a setting you remove from it is removed on the next push, and
2989
3025
  removing the entry switches the service off. `uniweb push` and `uniweb publish` send each service
2990
3026
  `site.yml` lists; a service the site has that this copy has never seen (turned on in the app since
@@ -168,6 +168,16 @@ function readSiteYml(path) {
168
168
  }
169
169
  }
170
170
 
171
+ // The backend's own sentences about a publish, for the person: what it changed (`applied`, a
172
+ // confirmed change or a reduction), then what it did not change and they should know (`notes`),
173
+ // such as something asked for that this deployment does not serve. The publish went through, so
174
+ // nothing else would say so.
175
+ export function publishSentences(result) {
176
+ return [result?.applied, result?.notes]
177
+ .flatMap((list) => (Array.isArray(list) ? list : []))
178
+ .filter((line) => typeof line === 'string' && line)
179
+ }
180
+
171
181
  // Languages from the BUILT site — the authority after a build: `config.languages` where
172
182
  // the site declares them (three accepted shapes: 'en', { value, label }, { code, label }),
173
183
  // else its default and each language the build produced (`dist/<locale>/site-content.json`).
@@ -1141,11 +1151,7 @@ export async function publish(args = []) {
1141
1151
  say.ok(
1142
1152
  `Published ${c.bold}${siteUuid}${c.reset}${result.status ? ` (${result.status})` : ''}`
1143
1153
  )
1144
- // What the request changed, in the backend's own sentences — a confirmed change, or a reduction
1145
- // (`applied`, its §4A). Absent when nothing changed.
1146
- for (const line of Array.isArray(result.applied) ? result.applied : []) {
1147
- if (typeof line === 'string' && line) say.info(line)
1148
- }
1154
+ for (const line of publishSentences(result)) say.info(line)
1149
1155
 
1150
1156
  // ⛔ SAY IT WHEN A LANGUAGE ASKED FOR DID NOT GO OUT.
1151
1157
  //
@@ -1384,6 +1384,14 @@ function workflowsCheck(siteDir) {
1384
1384
 
1385
1385
  const list = (names) => names.map((n) => `\`${n}\``).join(', ')
1386
1386
 
1387
+ /**
1388
+ * Asked for, and never among what a publish reports delivering (`last_published_services`):
1389
+ * a host loads Google's tag, so nothing answers at an address and nothing is sold. By that
1390
+ * comparison it would read "not live yet" for ever, and send an agent back to publish. A row
1391
+ * changed since the last publish still says so, as `draft_dirty`.
1392
+ */
1393
+ const NOT_REPORTED_AS_LIVE = new Set(['google'])
1394
+
1387
1395
  /**
1388
1396
  * `app.services`: what `site.yml` asks for, beside what the backend holds — the request it
1389
1397
  * stored, and what the last publish delivered (`last_published_services`). Comparing the
@@ -1421,7 +1429,7 @@ async function servicesCheck({ siteDir, siteYml, site }) {
1421
1429
  }
1422
1430
  const live = on(site.last_published_services)
1423
1431
  const requested = on(site.services)
1424
- const waiting = requested.filter((n) => !live.includes(n))
1432
+ const waiting = requested.filter((n) => !live.includes(n) && !NOT_REPORTED_AS_LIVE.has(n))
1425
1433
  if (waiting.length && site.published) {
1426
1434
  lines.push(`Requested, not live yet: ${list(waiting)} — publishing makes ${waiting.length === 1 ? 'it' : 'them'} live, and may ask for payment.`)
1427
1435
  proposals.push({ step: 'publish', command: 'npx uniweb publish', why: 'make those changes live — the person decides', ask: true })
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-11-02T04:09:19.127Z",
3
+ "generatedAt": "2026-11-02T06:00:38.485Z",
4
4
  "packages": {
5
5
  "@uniweb/api": {
6
6
  "version": "1.6.9"
@@ -36,7 +36,7 @@
36
36
  "version": "1.2.10"
37
37
  },
38
38
  "@uniweb/runtime": {
39
- "version": "1.3.10"
39
+ "version": "1.3.11"
40
40
  },
41
41
  "@uniweb/scene": {
42
42
  "version": "1.0.1"