uniweb 1.25.2 → 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.2",
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/schemas": "~1.6.7",
44
+ "@uniweb/core": "~1.6.1",
45
45
  "@uniweb/content-writer": "~1.3.1",
46
46
  "@uniweb/semantic-parser": "~1.13.2",
47
- "@uniweb/core": "~1.6.0"
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.0"
52
+ "@uniweb/semantic-parser": "~1.13.2"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "@uniweb/build": {
@@ -2320,7 +2320,42 @@ 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.
2323
+ below** — the vendor measures its own way, and nothing you `track()` reaches it. On a
2324
+ site you publish, an entry with no endpoint also asks the host for its collector;
2325
+ `enabled: false` beside `scripts` loads the script alone.
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.
2324
2359
 
2325
2360
  **Some events you get for free.** These are reported for you, with no call from
2326
2361
  your foundation and regardless of how it renders:
@@ -2330,9 +2365,16 @@ your foundation and regardless of how it renders:
2330
2365
  | `page_view` | every route change, including the first |
2331
2366
  | `outbound_click` | a visitor follows a link off the site — the destination **host** only, never the full URL |
2332
2367
  | `section_view` | a section first becomes half-visible, on pages that ask for it (`trackSections`, below) |
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` |
2369
+ | `engagement` | a sign-in through `@uniweb/api` (`name: sign_in`) |
2333
2370
 
2334
- ⛔ **So don't write your own link-click or scroll-into-view listener for these.**
2335
- A second one double-counts against a collector that already has them.
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
+
2375
+ ⛔ **So don't write your own link-click or scroll-into-view listener for these,**
2376
+ and don't report a sign-up, a sign-in or an accepted form that goes through kit or
2377
+ `@uniweb/api`. A second report double-counts against a collector that already has them.
2336
2378
 
2337
2379
  Everything else is yours to report:
2338
2380
 
@@ -2351,11 +2393,13 @@ const { track } = useTracker()
2351
2393
  <button onClick={() => track('brochure_download', { file: 'specs.pdf' })}>…</button>
2352
2394
  ```
2353
2395
 
2354
- The event name is yours — there is no list of permitted names. Five are already
2355
- in use, so reach for these rather than inventing a synonym: the three automatic
2356
- ones above — **`page_view`**, **`outbound_click`**, **`section_view`** — plus
2357
- **`video_milestone`**, which kit's `<Media>` reports for any video you render
2358
- through it, and **`read_depth`** from `useReadingDepth()` below. Put the
2396
+ The event name is yours — there is no list of permitted names. Seven are already
2397
+ in use, so reach for these rather than inventing a synonym: the automatic ones
2398
+ above — **`page_view`**, **`outbound_click`**, **`section_view`**, **`conversion`**,
2399
+ **`engagement`** — plus **`video_milestone`**, which kit's `<Media>` reports for any
2400
+ video you render through it, and **`read_depth`** from `useReadingDepth()` below.
2401
+ What your foundation alone can see that a site counts is
2402
+ `block.track('conversion', { name: 'quote_requested' })`, with a short name. Put the
2359
2403
  varying part in a **field**, never in the name — four names for one event turn a
2360
2404
  collector's event dimension into a cardinality problem.
2361
2405
 
@@ -2975,7 +3019,8 @@ yours answers. **On a site your host publishes, a service is off unless `service
2975
3019
  list the ones the site uses (the templates list theirs). `records: true` asks for your records to be
2976
3020
  delivered live to the published pages. Turn it on before the first publish of a page that shows
2977
3021
  records with a data schema: without it those records never reach the published page, and `publish`
2978
- 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
2979
3024
  says everything about its service: a setting you remove from it is removed on the next push, and
2980
3025
  removing the entry switches the service off. `uniweb push` and `uniweb publish` send each service
2981
3026
  `site.yml` lists; a service the site has that this copy has never seen (turned on in the app since
@@ -183,9 +183,19 @@ export function serviceNotes({ siteYml, supports = null, warn = () => {} }) {
183
183
  // past that entry, is wrong: `search: yes` was "site.yml turns on `search`" (F14).
184
184
  if (unreadableServices(siteYml?.services).length) return []
185
185
  const asks = readServicesRequest(siteYml?.services, { warn }) || []
186
- if (!Array.isArray(supports)) return []
187
186
  const notes = []
188
- const ignored = new Set(['tracking', 'records'])
187
+ // A site's own list replaces what its host states, key by key (`readServiceOptions`), and
188
+ // `services.google` reaches the page as the host's list.
189
+ if (siteYml?.services?.google && siteYml?.services?.tracking?.scripts) {
190
+ notes.push(
191
+ '`services.tracking.scripts` replaces the script your host loads for `services.google`, ' +
192
+ "so Google's tag will not load. Keep one of them."
193
+ )
194
+ }
195
+ if (!Array.isArray(supports)) return notes
196
+ // None of these is something a foundation renders: `google` and `tracking` load or report
197
+ // whatever the foundation is, and `records` is invisible to it.
198
+ const ignored = new Set(['tracking', 'records', 'google'])
189
199
  const has = (ask) => ask.enabled !== false || typeof ask.config?.endpoint === 'string'
190
200
  const unrendered = asks.filter((a) => has(a) && !ignored.has(a.name) && !supports.includes(a.name)).map((a) => a.name)
191
201
  if (unrendered.length) {
@@ -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,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-11-02T00:59:43.168Z",
3
+ "generatedAt": "2026-11-02T06:00:38.485Z",
4
4
  "packages": {
5
5
  "@uniweb/api": {
6
- "version": "1.6.8"
6
+ "version": "1.6.9"
7
7
  },
8
8
  "@uniweb/build": {
9
- "version": "1.14.0"
9
+ "version": "1.14.1"
10
10
  },
11
11
  "@uniweb/content-reader": {
12
12
  "version": "1.5.8"
@@ -15,7 +15,7 @@
15
15
  "version": "1.3.1"
16
16
  },
17
17
  "@uniweb/core": {
18
- "version": "1.6.0"
18
+ "version": "1.6.1"
19
19
  },
20
20
  "@uniweb/frame-bridge": {
21
21
  "version": "1.0.3"
@@ -24,7 +24,7 @@
24
24
  "version": "1.0.8"
25
25
  },
26
26
  "@uniweb/kit": {
27
- "version": "1.7.0"
27
+ "version": "1.7.1"
28
28
  },
29
29
  "@uniweb/loom": {
30
30
  "version": "1.1.2"
@@ -36,7 +36,7 @@
36
36
  "version": "1.2.10"
37
37
  },
38
38
  "@uniweb/runtime": {
39
- "version": "1.3.9"
39
+ "version": "1.3.11"
40
40
  },
41
41
  "@uniweb/scene": {
42
42
  "version": "1.0.1"