@getvitops/astro 3.0.0 → 4.0.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/CHANGELOG.md +159 -0
- package/README.md +1 -1
- package/dist/index.d.mts +68 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +51 -4
- package/dist/index.mjs.map +1 -1
- package/dist/routes/conversion.d.mts +45 -0
- package/dist/routes/conversion.d.mts.map +1 -0
- package/dist/routes/conversion.mjs +95 -0
- package/dist/routes/conversion.mjs.map +1 -0
- package/package.json +19 -6
- package/src/components/CookieConsent.astro +23 -15
- package/src/components/Head.astro +39 -1
- package/src/components/Tracking.astro +43 -0
- package/src/components/Tree.astro +82 -0
- package/src/components/TreeNode.astro +63 -0
- package/src/components/WebComponentLoader.astro +1 -1
- package/src/components/tree.ts +19 -0
- package/src/scripts/tracking.ts +147 -0
- package/src/tracking.ts +82 -0
- package/virtual.d.ts +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,164 @@
|
|
|
1
1
|
# @getvitops/astro
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- c6b99e7: Consent is now demand-driven: the banner appears when something actually needs permission, not on every first visit.
|
|
8
|
+
|
|
9
|
+
Previously, enabling the gate showed a banner to every new visitor regardless of what the site did — including sites whose only analytics provider was cookieless, where there was nothing to consent to. The build decided whether the machinery shipped and the runtime showed the banner because no cookie existed yet.
|
|
10
|
+
|
|
11
|
+
Now those are two separate facts. The build decides what the banner _can_ ask (rows in the markup); the runtime decides what it _does_ ask. A gated tag registers its demand when it reaches its loading strategy, and `<color-scheme-toggle>` registers `preferences` when a visitor picks a scheme. A site that gates nothing never interrupts anyone.
|
|
12
|
+
|
|
13
|
+
**Breaking — consent cookie schema (v1 → v2).** Consent is now recorded per category as granted / declined / **not yet asked**. The third state is what lets a later demand ask about a category an earlier prompt didn't cover: accepting an analytics banner no longer silently declines preferences. Every stored v1 choice is invalid and re-prompts once — a v1 cookie asserted a definite answer for categories the visitor was never shown.
|
|
14
|
+
|
|
15
|
+
**Breaking — `ConsentApi`.**
|
|
16
|
+
- `needed()` now means "something demanded a category the visitor hasn't answered", not "no cookie yet". A custom banner calling it will now stay hidden until something asks.
|
|
17
|
+
- `ConsentState.decided` (a single boolean) is gone. Use `decidedFor(state, category)`, or `undecidedCategories(state)`.
|
|
18
|
+
- New: `require(category)` registers a demand and reports whether it is granted; `request(category)` resolves once the visitor answers it; `demanded()` lists what has asked so far.
|
|
19
|
+
- `acceptAll()` / `rejectAll()` still mean every optional category. The banner no longer routes its buttons through them — "Accept" applies to the categories on screen.
|
|
20
|
+
|
|
21
|
+
**Breaking — `<color-scheme-toggle>` persistence.** The chosen scheme still applies immediately, but writing it to `localStorage` now waits on the `preferences` category **when the site has a consent gate**. Sites without `consent` enabled are unaffected and keep storing as before. If your site enables consent and offers a theme toggle, make sure `preferences` is among the offered categories (it is by default).
|
|
22
|
+
|
|
23
|
+
**Changed — offered categories.** `consent.categories` defaults to `['analytics', 'preferences']` (plus `marketing` when a configured tag needs it) rather than only what analytics detection could see. An unused row is hidden markup, so offering broadly costs nothing and covers `data-consent` markup no build-time scan can find. Pass `categories` explicitly to narrow it.
|
|
24
|
+
|
|
25
|
+
**Added — `<Head />` emits a small inline consent stub** when the gate is on. `consent.js` and `elements.js` are both deferred with no ordering between them, so without it a theme toggle could be clicked before the gate existed, read "no gate", and store. The stub answers `false` and queues, and the runtime replays the queue on load.
|
|
26
|
+
|
|
27
|
+
**Fixed — the generated cookie notice** now discloses the stored display preference when `preferences` is offered, and no longer promises a banner "shown when you first visit", which is no longer how the banner works.
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- c6b99e7: Ad-click attribution and conversion notifications ship as part of the toolchain.
|
|
32
|
+
|
|
33
|
+
A visitor arriving on an ad carries a click ID in the URL; `<Tracking />` captures it into a first-party `_ac` cookie, and when that visitor later submits a form or taps a `tel:` link, the conversion handler reads the cookie back and notifies whoever the config says. Previously this was per-site code.
|
|
34
|
+
|
|
35
|
+
**Added — `@getvitops/utils/tracking`.** The attribution vocabulary and cookie, as pure functions over a cookie _string_ so the browser capture and the server-side handler share one implementation: `parseTrackingCookie`, `serializeTrackingCookie`, `mergeTracking`, `identifyPlatform`, `getPrimaryClickId`, plus the click-ID/UTM tables. No DOM, no network, no clock — every function that needs "now" takes it as an argument, so it runs unchanged in a Worker.
|
|
36
|
+
|
|
37
|
+
**Added — `@getvitops/utils/notify`.** Conversion notifications, split the way `indexing/` is: `plan.ts` decides everything purely (which channels fire, who they reach, and **why anything is skipped**), `render.ts` turns the event into prose, `email.ts` executes and decides nothing. A misconfigured site can therefore be told exactly why no notification will arrive — a silently unsent one is indistinguishable from no conversion.
|
|
38
|
+
|
|
39
|
+
The `ConversionEvent` is the abstraction: the event is the _fact_, and how it reads is the channel's business.
|
|
40
|
+
|
|
41
|
+
**Added — the `email` channel, via Cloudflare Email Sending.** Uses the current structured binding (`env.EMAIL.send({ to, from, subject, html, text })`), not the legacy `EmailMessage` + hand-built MIME path. The binding is **passed in, never imported**, so `@getvitops/utils` takes no Cloudflare dependency and the sender is testable with a stub. Retries only the transient error codes; a configuration fault like `E_SENDER_NOT_VERIFIED` is surfaced verbatim rather than collapsed into "send failed". With no binding it prints the notification — the dev path.
|
|
42
|
+
|
|
43
|
+
Remember to onboard the sending domain (`wrangler email sending enable <domain>`) and add `"send_email": [{ "name": "EMAIL" }]` to `wrangler.jsonc`, or every send fails.
|
|
44
|
+
|
|
45
|
+
**Added — `<Tracking />` and `createConversionRoute()`** in `@getvitops/astro` (`@getvitops/astro/Tracking.astro`, `@getvitops/astro/routes`). The route factory handles both the `tel:` beacon and a form POST; validation and business rules stay the consumer's, because every site's form differs. A failed notification never fails the request — the visitor has already submitted, and refusing them because our mail didn't go out turns a lost notification into a lost conversion.
|
|
46
|
+
|
|
47
|
+
**Added — `site.tracking` and a widened `site.notifications`.** `notifications.email` now accepts a full channel object as well as a bare address (which still means what it did). `tracking` gains `category`.
|
|
48
|
+
|
|
49
|
+
**Fixed — the capture script now asks for consent instead of only reading it.** It previously checked `granted('marketing')` passively, which under the demand-driven banner is a permanent no-op: nothing else on a page demands `marketing`, so the banner never offered it, so it was never granted, so `_ac` was never written — silently, on every site with the gate enabled. It now calls `require()`, which is what raises the banner, and only when the URL actually carried a click ID or UTM. A visitor arriving organically has nothing to attribute and is never asked.
|
|
50
|
+
|
|
51
|
+
The integration adds `marketing` to the offered categories when tracking is on, so the banner has a row for the category the script will demand, and warns when tracking is enabled with `consent` off.
|
|
52
|
+
|
|
53
|
+
**Fixed — revoking consent now clears `_ac`.** The marker `<Tracking />` emits carries `data-consent-cookies`, which the consent runtime's cleanup reads. There was no cleanup path for this cookie before.
|
|
54
|
+
|
|
55
|
+
**Fixed — the cookie notice discloses `_ac`.** It is first-party, so no provider table would ever name it, and a site running attribution alongside a cookieless analytics provider was previously described as setting no cookies at all.
|
|
56
|
+
|
|
57
|
+
- 14813fa: Add `<wc-tree>`, and a schema walker that feeds it.
|
|
58
|
+
|
|
59
|
+
`<wc-tree>` is progressive enhancement for the existing `.tree` pattern: given a nested
|
|
60
|
+
`<details>` disclosure tree it adds a filter, expand-all / collapse-all, and hash deep-linking.
|
|
61
|
+
It ships in `elements.js`.
|
|
62
|
+
|
|
63
|
+
`@getvitops/astro` gains `./components/Tree.astro` and `./components/tree.ts` (its `TreeItem`
|
|
64
|
+
type) to build that markup from data. As with every wrapper over a web component, `<Tree />`
|
|
65
|
+
emits the `<wc-tree>` tag itself with the accessible fallback inside — so `<Tree items={…} />`
|
|
66
|
+
is the whole call, and wrapping it in your own `<wc-tree>` nests two elements on one tree.
|
|
67
|
+
|
|
68
|
+
The slotted markup is the whole content and works without it — every node readable, expandable
|
|
69
|
+
and linkable — so the element only adds what CSS cannot do. Four things worth knowing:
|
|
70
|
+
- **The toolbar is generated, never authored.** A search field that does nothing is worse than
|
|
71
|
+
no search field, so the controls exist only once the element upgrades.
|
|
72
|
+
- **Deep-linking is the non-obvious one.** A node inside a closed `<details>` has no layout box,
|
|
73
|
+
so the browser's own fragment navigation finds nothing and silently stays at the top of the
|
|
74
|
+
page. `<wc-tree>` opens the target's ancestors — and the target's own disclosure — then scrolls.
|
|
75
|
+
- **Filtering matches a node's own label and description, never its subtree's text.** The obvious
|
|
76
|
+
`textContent` implementation makes every ancestor of a hit match, so the root matches any query
|
|
77
|
+
and the filter narrows nothing. That decision lives in a pure, tested module (`matchTree`)
|
|
78
|
+
rather than in the DOM wiring.
|
|
79
|
+
- **It initialises even when upgraded mid-insertion.** An element connected during an
|
|
80
|
+
`innerHTML` write — a view-transition swap, a client-side navigation — has no children yet
|
|
81
|
+
(measured: zero). Setup retries once the insertion completes, because the failure mode was
|
|
82
|
+
silent: no toolbar, no filter, no deep link, no error.
|
|
83
|
+
|
|
84
|
+
`patterns/tree.css` now supports two markup shapes: the item may be the `<details>` (the
|
|
85
|
+
pattern's original contract) or an `<li class="tree__item">` wrapping one, which is what gives
|
|
86
|
+
assistive tech list position and depth.
|
|
87
|
+
|
|
88
|
+
**`.tree` indent is fixed and now fluid**, which matters for any deep tree. Three separate leaks
|
|
89
|
+
compounded, each invisible in the CSS and each charging roughly one extra indent per level:
|
|
90
|
+
- the rule set both `margin-inline-start` and `padding-inline-start` to `--tree-indent`;
|
|
91
|
+
- `.tree { padding: var(--_p) }` applied to every nested `.tree`, not just the outermost — on all
|
|
92
|
+
four sides, so it narrowed from the end as well;
|
|
93
|
+
- `patterns/details.css` gives every non-summary child of a `<details>`
|
|
94
|
+
`margin-inline: var(--_content-margin)`, and its `details, .details` selector takes `:is()`
|
|
95
|
+
specificity under CSS nesting (**0-1-1**), so `.tree { margin: 0 }` at 0-1-0 _loses_ to it. A
|
|
96
|
+
nested tree is exactly such a child.
|
|
97
|
+
|
|
98
|
+
Measured in a browser: **41px per level against a 24px design**, so a 9-deep tree spent 382px on
|
|
99
|
+
indent and left its deepest label 162px wide. Now 24px per level, 198px total, and 653px of label.
|
|
100
|
+
The nested rule resets both box axes before applying the one indent it owes, and the default is
|
|
101
|
+
`clamp(0.75rem, 2.5vw, 1.5rem)` — 12px on a phone, 24px on a desktop — because a tree's depth is a
|
|
102
|
+
property of the data and cannot be known when the pattern is written. `--tree-indent` still
|
|
103
|
+
overrides it, and the `--lines` elbow derives from the same resolved value so the two cannot
|
|
104
|
+
disagree.
|
|
105
|
+
|
|
106
|
+
**Leaf rows now align with their branch siblings.** A branch spends a toggle column on its chevron
|
|
107
|
+
before its label; a leaf has none, so every leaf label sat one full column (24px, measured) to the
|
|
108
|
+
inline-start of its siblings and nothing at a given depth lined up. `.tree` exposes
|
|
109
|
+
`--_node-indent` (the toggle column) and `--_leaf-indent` (what a row without a toggle owes to
|
|
110
|
+
reach the same label column); `.tree__content` and `.tree__desc` both read the latter rather than
|
|
111
|
+
re-deriving the sum.
|
|
112
|
+
|
|
113
|
+
`<wc-tree>` also wraps its generated filter in `.input-group`, because `forms.css` styles text
|
|
114
|
+
controls as `.form-group > input` / `.input-group > input` — a bare `<input>` rendered with the
|
|
115
|
+
browser's 2px inset border and square corners next to the framework's own rounded controls.
|
|
116
|
+
|
|
117
|
+
`schemaTreeNodes(schema, { idPrefix, maxDepth, prune })` is new in `@getvitops/generator`: it walks
|
|
118
|
+
a JSON Schema — the same walk behind the `authoring.md` / `config.md` references — and returns tree
|
|
119
|
+
**data**, not markup, so each medium renders it (markdown for agents, an accessible `<details>`
|
|
120
|
+
tree for a site). Field ids are dotted config paths (`site.analytics.clarityId`), so any field can
|
|
121
|
+
be linked to directly.
|
|
122
|
+
|
|
123
|
+
`prune` exists for a specific hazard. The project config declares `designSystem.themes` as a
|
|
124
|
+
looser shape than `DesignSystemSchema`, because the full one is applied separately by
|
|
125
|
+
`resolveTheme` — so its embedded copy is an **approximation**, and measurably missing the
|
|
126
|
+
descriptions for `colors`, `colors.palette`, `colors.roles` and `colors.utilities`. Anything
|
|
127
|
+
rendering that copy as the token reference would silently document the colour system less well
|
|
128
|
+
than the toolchain already does; `prune` lets a caller stop at the wrapper and render `jsonSchema`
|
|
129
|
+
alongside instead.
|
|
130
|
+
|
|
131
|
+
`renderInlineMarkdown()` is exported for schema description text. It **lifts code spans out before
|
|
132
|
+
applying emphasis**, and that ordering is load-bearing rather than tidy: `colors.utilities`
|
|
133
|
+
describes its families as `` `bg-*` ``, `` `text-*` ``, `` `border-*` `` — literal asterisk
|
|
134
|
+
_wildcards_. Run emphasis over the raw string and the `*` closing `bg-*` pairs with the one
|
|
135
|
+
closing `text-*`, italicising the text between two unrelated utilities and eating both asterisks,
|
|
136
|
+
leaving prose that names families which don't exist. It also now renders single-asterisk emphasis,
|
|
137
|
+
which the schema does use (`*presentation*`, `*domain properties*`) and which previously printed
|
|
138
|
+
the asterisks literally.
|
|
139
|
+
|
|
140
|
+
Also fixed: `config.md` claimed "Only the wrapper is listed here" under `designSystem` and then
|
|
141
|
+
emitted the entire token schema anyway — `themes.<name>` _is_ a design system, so the walk
|
|
142
|
+
descended into it. It now stops at the wrapper and delegates to `authoring.md` as it always said
|
|
143
|
+
it did.
|
|
144
|
+
|
|
145
|
+
### Patch Changes
|
|
146
|
+
|
|
147
|
+
- Updated dependencies [14813fa]
|
|
148
|
+
- Updated dependencies [c6b99e7]
|
|
149
|
+
- Updated dependencies [c6b99e7]
|
|
150
|
+
- Updated dependencies [f7bc0a0]
|
|
151
|
+
- Updated dependencies [14813fa]
|
|
152
|
+
- Updated dependencies [ceed51f]
|
|
153
|
+
- Updated dependencies [a9d7916]
|
|
154
|
+
- Updated dependencies [14813fa]
|
|
155
|
+
- Updated dependencies
|
|
156
|
+
- Updated dependencies [14813fa]
|
|
157
|
+
- @getvitops/generator@4.0.0
|
|
158
|
+
- @getvitops/utils@4.0.0
|
|
159
|
+
- @getvitops/core@4.0.0
|
|
160
|
+
- @getvitops/vite@4.0.0
|
|
161
|
+
|
|
3
162
|
## 3.0.0
|
|
4
163
|
|
|
5
164
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -171,7 +171,7 @@ weighs `lastmod` only while it stays consistent with what actually changed:
|
|
|
171
171
|
- **A shallow clone gets nothing, loudly.** It shells out to `git`, so `fetch-depth: 1` (the
|
|
172
172
|
actions/checkout default) yields no history — it warns and emits no dates. Set `fetch-depth: 0`.
|
|
173
173
|
|
|
174
|
-
This is also what makes `vitops
|
|
174
|
+
This is also what makes `vitops search notify` able to submit only what changed, rather than everything on
|
|
175
175
|
every deploy.
|
|
176
176
|
|
|
177
177
|
## `<Seo />`
|
package/dist/index.d.mts
CHANGED
|
@@ -324,6 +324,57 @@ interface SeoContext {
|
|
|
324
324
|
*/
|
|
325
325
|
declare function resolveSeo(defaults: GetvitopsSeoOptions, props: SeoProps, ctx: SeoContext): ResolvedSeo;
|
|
326
326
|
//#endregion
|
|
327
|
+
//#region src/tracking.d.ts
|
|
328
|
+
/**
|
|
329
|
+
* The `<Tracking />` resolution layer — tracking config in, what to emit out.
|
|
330
|
+
*
|
|
331
|
+
* Separate from `Tracking.astro` for the same reason `analytics.ts` is separate
|
|
332
|
+
* from `Analytics.astro`: everything decidable is a pure function asserted in
|
|
333
|
+
* `tracking.test.ts`, and the component only renders what this returns.
|
|
334
|
+
*
|
|
335
|
+
* The one decision here is **which consent category the `_ac` cookie waits on**,
|
|
336
|
+
* and it is stated rather than inferred. `_ac` is a 90-day identifier tying a
|
|
337
|
+
* visitor to the ad that brought them, so `marketing` is the default — but a site
|
|
338
|
+
* using click IDs purely for its own campaign reporting may reasonably file it
|
|
339
|
+
* under `analytics`, and that is the consumer's call to make, not ours to guess.
|
|
340
|
+
*/
|
|
341
|
+
/** Which consent category the attribution cookie waits on. */
|
|
342
|
+
type TrackingCategory = 'marketing' | 'analytics';
|
|
343
|
+
interface GetvitopsTrackingOptions {
|
|
344
|
+
/** Capture ad click IDs and UTMs into `_ac`. */
|
|
345
|
+
enabled?: boolean;
|
|
346
|
+
/** Default `marketing`. */
|
|
347
|
+
category?: TrackingCategory;
|
|
348
|
+
/** Informational; capture recognises every known click-ID parameter regardless. */
|
|
349
|
+
platforms?: string[];
|
|
350
|
+
}
|
|
351
|
+
/** The cookie the capture script writes. Mirrors `TRACKING_COOKIE` in utils. */
|
|
352
|
+
declare const TRACKING_COOKIE = "_ac";
|
|
353
|
+
interface ResolvedTracking {
|
|
354
|
+
enabled: boolean;
|
|
355
|
+
category: TrackingCategory;
|
|
356
|
+
/** Cookie names to clear on revoke — rides on `data-consent-cookies`. */
|
|
357
|
+
cookies: string[];
|
|
358
|
+
/** Configuration problems, as prose. The integration logs these. */
|
|
359
|
+
warnings: string[];
|
|
360
|
+
}
|
|
361
|
+
interface ResolveTrackingContext {
|
|
362
|
+
/** Is the consent gate enabled on this site (`vitops({ consent })`)? */
|
|
363
|
+
consent?: boolean;
|
|
364
|
+
/** Categories the banner offers, so we can catch a demand with no row. */
|
|
365
|
+
consentCategories?: readonly string[];
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Resolve the tracking config into what the component emits.
|
|
369
|
+
*
|
|
370
|
+
* Two warnings, both about the same failure — a persistent identifier written
|
|
371
|
+
* with no way for the visitor to decline, or a permission asked for with no way
|
|
372
|
+
* to answer. Returned as data rather than logged here so the check is a test
|
|
373
|
+
* rather than a line someone might scroll past, exactly as `resolveAnalytics`
|
|
374
|
+
* does.
|
|
375
|
+
*/
|
|
376
|
+
declare function resolveTracking(opts: GetvitopsTrackingOptions | undefined, ctx?: ResolveTrackingContext): ResolvedTracking;
|
|
377
|
+
//#endregion
|
|
327
378
|
//#region src/integration.d.ts
|
|
328
379
|
interface GetvitopsFaviconOptions {
|
|
329
380
|
/** Source SVG or PNG. */
|
|
@@ -400,7 +451,7 @@ interface GetvitopsCssOptions {
|
|
|
400
451
|
*
|
|
401
452
|
* Off by default: turning it on flips the site dark for dark-OS visitors, which
|
|
402
453
|
* is a visible change to an existing site. Turning it **on** is what makes
|
|
403
|
-
* `<color-scheme-toggle>`'s "System" position do anything (System removes the
|
|
454
|
+
* `<wc-color-scheme-toggle>`'s "System" position do anything (System removes the
|
|
404
455
|
* theme attribute, so without this block it falls through to light), and it is
|
|
405
456
|
* the only way a no-JS page gets the OS appearance at all.
|
|
406
457
|
*
|
|
@@ -663,6 +714,21 @@ interface GetvitopsOptions {
|
|
|
663
714
|
* actually offers.
|
|
664
715
|
*/
|
|
665
716
|
consent?: boolean | GetvitopsConsentOptions;
|
|
717
|
+
/**
|
|
718
|
+
* Ad-click attribution for `<Tracking />` — capture click IDs and UTMs from the
|
|
719
|
+
* landing URL into the `_ac` cookie, so a conversion can be attributed to the
|
|
720
|
+
* ad that produced it. Off unless provided.
|
|
721
|
+
*
|
|
722
|
+
* `_ac` is a 90-day identifier, so writing it waits on consent (`marketing` by
|
|
723
|
+
* default) — and **asking for that permission is what raises the banner**, on
|
|
724
|
+
* the arrival that carried a click ID and on no other. A visitor who arrives
|
|
725
|
+
* organically has nothing to attribute and is never asked.
|
|
726
|
+
*
|
|
727
|
+
* Read the cookie back with `parseTrackingCookie` from
|
|
728
|
+
* `@getvitops/utils/tracking`, and turn a conversion into a notification with
|
|
729
|
+
* `@getvitops/utils/notify`.
|
|
730
|
+
*/
|
|
731
|
+
tracking?: boolean | GetvitopsTrackingOptions;
|
|
666
732
|
}
|
|
667
733
|
interface GetvitopsFontsOptions {
|
|
668
734
|
/** Path to a site config (JSON) whose `fonts` array holds the declarations. */
|
|
@@ -747,5 +813,5 @@ declare function slugFromContent(file: string): string | undefined;
|
|
|
747
813
|
*/
|
|
748
814
|
declare function gitLastmod(options?: GitLastmodOptions): Promise<(item: GetvitopsSitemapEntry) => GetvitopsSitemapEntry>;
|
|
749
815
|
//#endregion
|
|
750
|
-
export { type AnalyticsStrategy, type ClarityOptions, type ConsentCategory, type GetvitopsAnalyticsOptions, type GetvitopsConsentOptions, type GetvitopsCssOptions, type GetvitopsFaviconOptions, type GetvitopsMediaOptions, type GetvitopsOptions, type GetvitopsSeoOptions, type GetvitopsSitemapChangeFreq, type GetvitopsSitemapEntry, type GetvitopsSitemapOptions, type GitLastmodOptions, type GoogleAnalyticsOptions, type MatomoOptions, type OptionalConsentCategory, type PlausibleOptions, type ResolveAnalyticsContext, type ResolvedAnalytics, type ResolvedSeo, type ResolvedTag, type SeoContext, type SeoNameTag, type SeoOgType, type SeoPropertyTag, type SeoProps, type SeoTwitterCard, consentCategories, vitops as default, gitLastmod, resolveAnalytics, resolveSeo, routeFromPage, slugFromContent };
|
|
816
|
+
export { type AnalyticsStrategy, type ClarityOptions, type ConsentCategory, type GetvitopsAnalyticsOptions, type GetvitopsConsentOptions, type GetvitopsCssOptions, type GetvitopsFaviconOptions, type GetvitopsMediaOptions, type GetvitopsOptions, type GetvitopsSeoOptions, type GetvitopsSitemapChangeFreq, type GetvitopsSitemapEntry, type GetvitopsSitemapOptions, type GetvitopsTrackingOptions, type GitLastmodOptions, type GoogleAnalyticsOptions, type MatomoOptions, type OptionalConsentCategory, type PlausibleOptions, type ResolveAnalyticsContext, type ResolveTrackingContext, type ResolvedAnalytics, type ResolvedSeo, type ResolvedTag, type ResolvedTracking, type SeoContext, type SeoNameTag, type SeoOgType, type SeoPropertyTag, type SeoProps, type SeoTwitterCard, TRACKING_COOKIE, type TrackingCategory, consentCategories, vitops as default, gitLastmod, resolveAnalytics, resolveSeo, resolveTracking, routeFromPage, slugFromContent };
|
|
751
817
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/analytics.ts","../src/seo.ts","../src/integration.ts","../src/lastmod.ts"],"mappings":";;;;;;;;;;;;;;;AA2BA;;;;AAA6B;AAQ7B;;;;AAA2B;AAE3B;;;;AAA6D;AAE7D;;;AAF6D,KAVjD,iBAAA;;;;;;;KAQA,eAAA;AAAA,KAEA,uBAAA,GAA0B,OAAO,CAAC,eAAA;AAAA,UAE7B,sBAAA;;EAEf,EAAA;EA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iBA8Cc,UAAA,CACd,QAAA,EAAU,mBAAA,EACV,KAAA,EAAO,QAAA,EACP,GAAA,EAAK,UAAA,GACJ,WAAA;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/analytics.ts","../src/seo.ts","../src/tracking.ts","../src/integration.ts","../src/lastmod.ts"],"mappings":";;;;;;;;;;;;;;;AA2BA;;;;AAA6B;AAQ7B;;;;AAA2B;AAE3B;;;;AAA6D;AAE7D;;;AAF6D,KAVjD,iBAAA;;;;;;;KAQA,eAAA;AAAA,KAEA,uBAAA,GAA0B,OAAO,CAAC,eAAA;AAAA,UAE7B,sBAAA;;EAEf,EAAA;EAYA;;;;EAPA,QAAA,GAAW,uBAAA;EAWI;EATf,MAAA,GAAS,MAAM;AAAA;AAAA,UAGA,cAAA;EAQf;EANA,EAAA;EACA,QAAA,GAAW,uBAAuB;AAAA;AAAA,UAGnB,aAAA;EAgBA;EAdf,GAAA;;EAEA,MAAA;EAgBG;AAGL;;;;;;;EAVE,OAAA;AAAA;AAAA,UAGe,gBAAA;EAQf;EANA,MAAA;EAOA;EALA,GAAG;AAAA;AAAA,UAGY,yBAAA;EACf,eAAA,YAA2B,sBAAA;EAC3B,OAAA,YAAmB,cAAA;EACnB,MAAA,GAAS,aAAA;EACT,SAAA,YAAqB,gBAAA;EAEO;EAA5B,QAAA,GAAW,iBAAA;AAAA;;;;;;;;AAkBF;UAPM,uBAAA;EAWW;;;;EAN1B,UAAA,GAAa,uBAAuB;EAwBvB;EAtBb,SAAA;AAAA;;UAIe,WAAA;EACf,GAAA;EAIA;EAFA,QAAA;EACA,QAAA,EAAU,eAAA;EACV,WAAA;EASA;EAPA,OAAA;EACA,QAAA,EAAU,iBAAA;EAUV;;;AAAa;AAGf;EAPE,KAAA;;EAEA,MAAA;EACA,GAAA;EACA,KAAA,EAAO,MAAA;AAAA;AAAA,UAGQ,iBAAA;EACf,IAAA,EAAM,WAAW;EAIT;EAFR,YAAA;EAKsC;EAHtC,QAA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;AAAA;;;;AJlBiB;AAQ7B;;;iBIoBgB,aAAA,CAAc,IAAY;AJpBf;AAAA,iBIiCX,eAAA,CAAgB,IAAY;;;;AJ/BiB;AAE7D;;;;iBIiFsB,UAAA,CACpB,OAAA,GAAS,iBAAA,GACR,OAAA,EAAS,IAAA,EAAM,qBAAA,KAA0B,qBAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -225,6 +225,39 @@ function resolveFonts(decls) {
|
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region src/tracking.ts
|
|
230
|
+
/** The cookie the capture script writes. Mirrors `TRACKING_COOKIE` in utils. */
|
|
231
|
+
const TRACKING_COOKIE = "_ac";
|
|
232
|
+
/**
|
|
233
|
+
* Resolve the tracking config into what the component emits.
|
|
234
|
+
*
|
|
235
|
+
* Two warnings, both about the same failure — a persistent identifier written
|
|
236
|
+
* with no way for the visitor to decline, or a permission asked for with no way
|
|
237
|
+
* to answer. Returned as data rather than logged here so the check is a test
|
|
238
|
+
* rather than a line someone might scroll past, exactly as `resolveAnalytics`
|
|
239
|
+
* does.
|
|
240
|
+
*/
|
|
241
|
+
function resolveTracking(opts, ctx = {}) {
|
|
242
|
+
const warnings = [];
|
|
243
|
+
const category = opts?.category ?? "marketing";
|
|
244
|
+
const enabled = opts?.enabled === true;
|
|
245
|
+
if (!enabled) return {
|
|
246
|
+
enabled: false,
|
|
247
|
+
category,
|
|
248
|
+
cookies: [],
|
|
249
|
+
warnings
|
|
250
|
+
};
|
|
251
|
+
if (!ctx.consent) warnings.push(`tracking is on, so this site writes the \`${"_ac"}\` cookie — a 90-day identifier tying a visitor to the ad that brought them — and \`consent\` is off, so it is written for every visitor with no way to decline. Set \`consent: true\`.`);
|
|
252
|
+
else if (ctx.consentCategories && !ctx.consentCategories.includes(category)) warnings.push(`tracking demands the \`${category}\` consent category, but the banner offers ${ctx.consentCategories.join(", ") || "nothing"}. Add \`${category}\` to \`consent.categories\`, or the visitor is asked about something the banner never names.`);
|
|
253
|
+
return {
|
|
254
|
+
enabled,
|
|
255
|
+
category,
|
|
256
|
+
cookies: ["_ac"],
|
|
257
|
+
warnings
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
228
261
|
//#endregion
|
|
229
262
|
//#region src/integration.ts
|
|
230
263
|
/**
|
|
@@ -358,9 +391,18 @@ function vitops(opts = {}) {
|
|
|
358
391
|
const consentEnabled = !!opts.consent;
|
|
359
392
|
const consentOpts = typeof opts.consent === "object" ? opts.consent : {};
|
|
360
393
|
const analytics = resolveAnalytics(opts.analytics, { consent: consentEnabled });
|
|
394
|
+
const trackingOpts = opts.tracking === true ? { enabled: true } : opts.tracking || void 0;
|
|
361
395
|
const detectedCategories = consentCategories(analytics.tags);
|
|
362
|
-
const
|
|
396
|
+
const defaultCategories = ["analytics", "preferences"];
|
|
397
|
+
const trackingCategory = trackingOpts?.enabled ? trackingOpts.category ?? "marketing" : null;
|
|
398
|
+
if (detectedCategories.includes("marketing") || trackingCategory === "marketing") defaultCategories.push("marketing");
|
|
399
|
+
const offeredCategories = consentOpts.categories ?? defaultCategories;
|
|
363
400
|
for (const warning of analytics.warnings) logger.warn(warning);
|
|
401
|
+
const tracking = resolveTracking(trackingOpts, {
|
|
402
|
+
consent: consentEnabled,
|
|
403
|
+
consentCategories: offeredCategories
|
|
404
|
+
});
|
|
405
|
+
for (const warning of tracking.warnings) logger.warn(warning);
|
|
364
406
|
if (opts.analytics && legalInput) {
|
|
365
407
|
const undisclosed = undisclosedProviders(resolve(root, legalInput), opts.analytics);
|
|
366
408
|
if (undisclosed.length) logger.warn(`analytics: ${undisclosed.join(", ")} ${undisclosed.length === 1 ? "is" : "are"} configured here but absent from your site config's \`analytics\` block, so the cookie notice \`legal\` generates will not disclose ${undisclosed.length === 1 ? "it" : "them"}. Add ${undisclosed.map((k) => SITE_CONFIG_KEYS[k]).join(", ")} to ${legalInput}.`);
|
|
@@ -558,7 +600,12 @@ function vitops(opts = {}) {
|
|
|
558
600
|
consent: consentEnabled,
|
|
559
601
|
consentCategories: offeredCategories,
|
|
560
602
|
consentPolicyUrl: consentOpts.policyUrl ?? null,
|
|
561
|
-
consentRuntime
|
|
603
|
+
consentRuntime,
|
|
604
|
+
tracking: tracking.enabled ? {
|
|
605
|
+
enabled: true,
|
|
606
|
+
category: tracking.category,
|
|
607
|
+
cookies: tracking.cookies
|
|
608
|
+
} : null
|
|
562
609
|
})] } });
|
|
563
610
|
if (opts.css) {
|
|
564
611
|
const format = opts.css.format ?? "tailwind";
|
|
@@ -609,7 +656,7 @@ function vitops(opts = {}) {
|
|
|
609
656
|
* Real per-page `<lastmod>` for the sitemap, derived from git.
|
|
610
657
|
*
|
|
611
658
|
* This is the one lever that reliably moves Google. It is also load-bearing for
|
|
612
|
-
* `vitops
|
|
659
|
+
* `vitops search notify`, which decides what to submit by diffing lastmod against the
|
|
613
660
|
* previous build — with no lastmod, that diff can see pages appear and disappear
|
|
614
661
|
* but never see one *change*, so an edited page is never resubmitted.
|
|
615
662
|
*
|
|
@@ -886,5 +933,5 @@ function resolveSeo(defaults, props, ctx) {
|
|
|
886
933
|
}
|
|
887
934
|
|
|
888
935
|
//#endregion
|
|
889
|
-
export { consentCategories, vitops as default, gitLastmod, resolveAnalytics, resolveSeo, routeFromPage, slugFromContent };
|
|
936
|
+
export { TRACKING_COOKIE, consentCategories, vitops as default, gitLastmod, resolveAnalytics, resolveSeo, resolveTracking, routeFromPage, slugFromContent };
|
|
890
937
|
//# sourceMappingURL=index.mjs.map
|