@getvitops/cli 6.0.0 → 8.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 CHANGED
@@ -1,5 +1,227 @@
1
1
  # @getvitops/cli
2
2
 
3
+ ## 8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Rebuild the lightbox on one dialog + the existing carousel, fixing the flicker on
8
+ prev/next and the stutter on open.
9
+
10
+ **Breaking (`css`/`bricks` and `tailwind` formats — `.lightbox-dialog`'s markup
11
+ contract changed):**
12
+
13
+ - `<Gallery />` now emits ONE `<dialog class="lightbox-dialog">` per gallery,
14
+ wrapping a `<Carousel />`, instead of one dialog per image. A `.gallery__trigger`
15
+ is now a plain `<a href="#slide-id">`, not a `command="show-modal"` button.
16
+ - `.lightbox-dialog__content` / `__image` / `__nav` / `__nav-button` /
17
+ `__caption` are gone. The dialog's child is `.lightbox-dialog__track` (a
18
+ `.carousel`) — prev/next, dots, arrow keys and swipe are the carousel's,
19
+ reused rather than reimplemented. `.lightbox-dialog__close` is unchanged.
20
+ - `<wc-gallery>` no longer builds nav buttons or steps between images — the
21
+ nested `<wc-carousel>` does. It fires `gallery-open` (unchanged shape) and
22
+ re-emits the carousel's own stepping as `gallery-change`.
23
+ - `packages/core/src/web-components/utils/gallery.ts` dropped `keyToAction` and
24
+ `swipeAction` (the carousel's own key/swipe handling covers both now).
25
+ `stepIndex`/`preloadTargets` are unchanged.
26
+
27
+ **Why:** stepping used to close one `<dialog>` and open another, which made
28
+ `animation.css`'s top-layer driver play a full exit-then-entry transition on
29
+ every step — visible as a flicker on prev/next, by construction, not a bug to
30
+ tune away. Opening also awaited the full image's `decode()` before starting the
31
+ view-transition morph, so the dialog visibly stalled on a slow network. One
32
+ dialog containing one carousel makes the first failure mode unrepresentable
33
+ (stepping is a scroll, not a close/open pair) and removes the wait for the
34
+ second (the morph starts immediately, painting the thumbnail as a CSS
35
+ background placeholder until the full image arrives).
36
+
37
+ **Also improved, not just fixed:** the no-JS fallback is no longer a _stripped_
38
+ lightbox — it's a genuine one. Each trigger is ordinary fragment navigation
39
+ (`:has(:target)` in `lightbox.css` reveals the dialog), which needs no Invoker
40
+ Commands polyfill in any engine, and it now has working prev/next with no
41
+ JavaScript at all — the previous per-dialog fallback had no way to express that.
42
+
43
+ **Migration:** a consumer using `<Gallery />` needs no changes — the component's
44
+ props are unchanged. Anyone who hand-authored `.lightbox-dialog` markup (per
45
+ `docs/concepts/patterns.md` / `docs/css/classes.md`) must move to the new single-
46
+ dialog-wrapping-a-carousel shape; see `patterns.astro`'s "Gallery, hand-authored"
47
+ demo for the reference markup. `<wc-gallery>` consumers listening for
48
+ `gallery-change` keep the same event shape (`{ index, total }`).
49
+
50
+ ### Minor Changes
51
+
52
+ - Add Google Business Profile reviews: fetch, cache, render.
53
+
54
+ - **`vitops reviews`** (new CLI command) fetches a client's GBP reviews (legacy v4 API — the only
55
+ one that has them) and writes them to `.vitops/reviews.json`, meant to be committed so a build
56
+ never needs a live Google credential. `--dry` prints the plan; `--check` diffs against the cache
57
+ without writing. Requires the same `VITOPS_GOOGLE_CLIENT_ID`/`_CLIENT_SECRET`/`_REFRESH_TOKEN` (or
58
+ ADC login) `search setup` uses, scoped to `business.manage` — **and the calling GCP project must
59
+ be allowlisted by Google first**, a separate one-time approval from every other Google API here.
60
+ - **`site.reviews`** (config): which `organization.locations` to fetch, and per-location
61
+ `featured`/`minRating`/`sort`/`limit` selection. `schema` (JSON-LD) and `avatars` both default to
62
+ **off** — see the migration notes below.
63
+ - **`@getvitops/utils/reviews`** (new subpath): the pure plan/select/merge functions plus the GBP
64
+ fetcher and cache reader/writer, mirroring `./indexing`'s pure/IO split.
65
+ - **`<ReviewCard>`** (new Astro component, `@getvitops/astro`): one review card from a cache entry.
66
+ No web component — nothing here needs progressive enhancement. Composes the existing
67
+ `schemas/Review.astro` for JSON-LD only when both `schema` and `itemReviewed` are passed.
68
+ - **`<Marquee>`** (new Astro component): the tier-3 wrapper `wc-marquee`/`marquee.css` was missing.
69
+ - **`.review` pattern** (`css`/`bricks` and `tailwind` formats): a new config-generated
70
+ `patterns.items.review` entry plus `packages/core/css/patterns/review.css` for the structural
71
+ parts (rating, identity, body, reply, source link). Two new semantic icon names, `star` and
72
+ `star-half`, across every icon set.
73
+
74
+ **Migration:** no breaking change. A site adding `site.reviews` should read the "Google reviews"
75
+ section in AGENTS.md before enabling `schema` — Google's structured-data policy treats a business
76
+ marking up reviews of itself as ineligible for review rich results and risks a manual action, which
77
+ is why it defaults off.
78
+
79
+ - Repo-wide simplification pass: de-boilerplate the CLI, dedupe shared cache/plan
80
+ primitives in `@getvitops/utils`, drop dead code, and tighten dependency hygiene.
81
+
82
+ No breaking changes. (`vitops icons`'s `--site` flag was briefly going to be renamed to
83
+ `--input` for consistency with the other `Config`-anchored commands — deferred rather than
84
+ spending a major bump on a rename with no other breaking change riding along; it stays
85
+ `--site` for now.)
86
+
87
+ **Fixed:**
88
+
89
+ - `@getvitops/core`'s 12 runtime deps (`lit`, both `@oddbird` polyfills, both
90
+ `@webcomponents` packages, `colorjs.io`, etc.) were listed as `dependencies` despite
91
+ being bundled into `dist/elements.js`/`dist/polyfills.js`/`dist/deferred.js` — a
92
+ consumer installed them twice for nothing. Moved to `devDependencies`; no change to
93
+ what ships.
94
+ - Deleted `old-css-lib/` (59 files), superseded by `packages/core/css/` since the
95
+ in-memory bundling change — no consumer-facing effect, it was not part of any
96
+ published output.
97
+ - Deleted a dead Astro module (`packages/astro/src/scripts/deferred.ts`) that had
98
+ silently diverged from `packages/core/src/js/deferred.ts` and had zero importers.
99
+
100
+ **No consumer-facing change in `@getvitops/vite`** beyond the fixed-group version bump —
101
+ task-graph and caching fixes internal to this repo's own build.
102
+
103
+ Everything else (the `cli.ts` file split into `commands/{search,ads}.ts`, shared
104
+ `json-store.ts`/`plan-format.ts` helpers in `@getvitops/utils`, a `.github/actions/setup`
105
+ composite action, restatement-comment cleanup) is internal refactoring with no change to
106
+ any published API, CLI flag, or generated output.
107
+
108
+ ### Patch Changes
109
+
110
+ - Updated dependencies
111
+ - Updated dependencies
112
+ - Updated dependencies
113
+ - Updated dependencies [a84839b]
114
+ - @getvitops/generator@8.0.0
115
+ - @getvitops/utils@8.0.0
116
+
117
+ ## 7.0.0
118
+
119
+ ### Minor Changes
120
+
121
+ - c0c092b: `vitops search` now works from a `gcloud` login, and attributes API usage per site.
122
+
123
+ **Being logged in is enough.** With no `VITOPS_GOOGLE_*` set, an Application Default Credentials
124
+ login is used — the credential `gcloud auth application-default login` already wrote. It needs the
125
+ Search Console scopes, which are not in the default ADC set:
126
+
127
+ ```
128
+ gcloud auth application-default login \
129
+ --scopes=openid,https://www.googleapis.com/auth/siteverification,\
130
+ https://www.googleapis.com/auth/webmasters,https://www.googleapis.com/auth/cloud-platform
131
+ ```
132
+
133
+ Explicit `VITOPS_GOOGLE_*` vars still win. Ambient credentials are only a fallback, because a stale
134
+ local login silently overriding a deliberate CI secret is the worst available precedence.
135
+
136
+ Beyond convenience, this removes a documented footgun: an OAuth client you create yourself sits in
137
+ _Testing_ publishing status, where Google **expires the refresh token after 7 days**. The Cloud SDK
138
+ client is published, so an ADC credential doesn't rot between onboarding runs.
139
+
140
+ **New: `site.google.project`** — the Google Cloud project API usage is attributed to, sent as
141
+ `x-goog-user-project`. One project per site is what keeps each site's usage and billing separate,
142
+ and it is the same field Maps or anything else will read later, rather than a `quotaProject` here
143
+ and a `mapsProject` there.
144
+
145
+ It is **required for a user credential and wrong for a service account**, which is why it is not
146
+ sent unconditionally. A user credential authenticates through a shared OAuth client that owns no
147
+ project, so Google refuses the call outright — measured: `403 "requires a quota project, which is
148
+ not set by default"`. A service account already belongs to a project, and pointing it at a
149
+ different one would newly require `serviceusage.services.use` there, turning a working CI
150
+ credential into a 403 for no benefit.
151
+
152
+ Using it needs both APIs (`searchconsole.googleapis.com`, `siteverification.googleapis.com`)
153
+ enabled on that project, and `serviceusage.services.use` for the identity — one grant per site,
154
+ which suits an agency administering many sites from one admin identity.
155
+
156
+ An ADC credential with no `site.google.project` is now **refused before any request is made**,
157
+ naming the file the credential came from and the project gcloud recorded with it:
158
+
159
+ ```
160
+ ✖ this Google credential comes from ~/.config/gcloud/application_default_credentials.json,
161
+ which authenticates through a shared OAuth client that owns no project — so it needs
162
+ "site.google.project" in site.json to say which project the API usage belongs to.
163
+ gcloud recorded "acme-web" as the quota project for that login, so that is probably the value.
164
+ ```
165
+
166
+ That is the mistake waiting for the _second_ site: the command gets copied from whatever
167
+ onboarded the first one, the field is left out, and Google's own answer names neither the config
168
+ field nor the credential.
169
+
170
+ **Fixed: an ADC file in `GOOGLE_APPLICATION_CREDENTIALS` no longer hard-exits.** That variable is
171
+ Google's own convention _and_ where gcloud writes ADC, so the same variable carries two kinds of
172
+ credential. Parsing an `authorized_user` file as a service account failed with `service account
173
+ JSON is missing client_email or private_key` — while holding a credential the command already knew
174
+ how to use. It is now discriminated on `type`, the field Google's own libraries switch on.
175
+
176
+ **Also fixed — `search setup --dry` and `--check` are not offline.** The docs implied otherwise. The
177
+ state gather runs before the planner, so both read from Cloudflare and Google and both need
178
+ credentials. They still create and change nothing; `notify --dry` remains genuinely request-free.
179
+
180
+ New in `@getvitops/utils/indexing`: `parseAdcUser`, `adcQuotaProject`, `adcCredentialsPath` (pure,
181
+ so what is decidable is asserted without a filesystem), plus `googleHeaders` and the `GoogleAuth` /
182
+ `GoogleAuthLike` types. The seven exported Google request functions now take a token **or** a
183
+ `{ token, quotaProject }` — a bare string still works everywhere, so nothing needs changing.
184
+
185
+ ### Patch Changes
186
+
187
+ - **Added — `utils`.** `itemListGraph()`, a pure schema.org `ItemList` JSON-LD builder — a sibling
188
+ of `breadcrumbGraph()`/`localBusinessGraph()`. Extracted from `@getvitops/astro`'s `<Carousel />`
189
+ so any consumer can build a valid `ItemList` (Google's "all-in-one page" carousel format:
190
+ `ListItem.item` carrying `@type`/`name`/`url`) for content that isn't one of the six Google
191
+ carousel rich-result types (`Article`/`Recipe`/`Movie`/`Course`/`Restaurant`/`Product`) — the
192
+ entity type is no longer constrained to that set.
193
+
194
+ **Changed — `astro`.** `<Carousel />`'s `CarouselItem['type']` now accepts any string, not just
195
+ the six carousel rich-result types — non-breaking, the union only widens. It's a thin wrapper
196
+ over `itemListGraph()` now; behaviour for existing callers is unchanged.
197
+
198
+ No consumer-facing change in this release outside `utils` and `astro` — `generator`, `cli` and
199
+ `vite` still ship in this release only because the six share one version.
200
+
201
+ **Fixed — `core` (`css`/`bricks`/`tailwind` build output, all formats).** The CSS and HTML
202
+ authored inside Lit's `css`/`html` tagged templates in `<wc-*>` component sources previously
203
+ survived JS minification verbatim — a JS minifier treats a template literal's cooked text as
204
+ opaque, so `elements.js` shipped ~690 lines of indented, unminified CSS (and the equivalent in
205
+ HTML) inside an otherwise-minified 886-line file. Two source-level build transforms now collapse
206
+ both before bundling: `postcss` + `postcss-lit` + `cssnano` for `css` templates, `minify-html-literals`
207
+ (`conservativeCollapse: true`, so whitespace between inline elements in light-DOM components never
208
+ collapses to zero) for `html` templates. `elements.js` drops from 886 lines / ~101 KB to 49 lines /
209
+ ~96 KB. A second build step deduplicates the 17 `@license` comment blocks (only 6 are textually
210
+ distinct) down to one verbatim copy of each — required by BSD-3/MIT/Apache-2.0's notice-retention
211
+ terms either way, just no longer repeated once per source file that carries it. No API change;
212
+ build-time only, and none of the added tooling (`postcss`, `postcss-lit`, `cssnano`,
213
+ `minify-html-literals`) is a runtime or published dependency.
214
+
215
+ - Updated dependencies [c0c092b]
216
+ - Updated dependencies
217
+ - Updated dependencies [aad43b7]
218
+ - Updated dependencies [2b50f9e]
219
+ - Updated dependencies [a6a8b39]
220
+ - Updated dependencies [7b391b3]
221
+ - Updated dependencies [eb9ac79]
222
+ - @getvitops/utils@7.0.0
223
+ - @getvitops/generator@7.0.0
224
+
3
225
  ## 6.0.0
4
226
 
5
227
  **No consumer-facing change in this package.** The major is the toolchain's shared version, bumped
@@ -550,28 +772,20 @@ carousel vocabulary, because they render live from the generator.
550
772
  {
551
773
  "designSystem": {
552
774
  "themes": {
553
- "default": {
554
- /* … */
555
- },
775
+ "default": {/* … */},
556
776
  },
557
777
  },
558
778
  "organization": {
559
779
  "name": "Acme",
560
780
  "contact": "hq",
561
781
  "locations": {
562
- "hq": {
563
- /* … */
564
- },
782
+ "hq": {/* … */},
565
783
  },
566
784
  },
567
785
  "site": {
568
786
  "defaultLocale": "en",
569
- "domains": {
570
- /* … */
571
- },
572
- "analytics": {
573
- /* … */
574
- },
787
+ "domains": {/* … */},
788
+ "analytics": {/* … */},
575
789
  },
576
790
  }
577
791
  ```
@@ -647,7 +861,7 @@ carousel vocabulary, because they render live from the generator.
647
861
  Also new, and worth wiring at the same time — **`gitLastmod()` for real sitemap dates**:
648
862
 
649
863
  ```js
650
- import vitops, { gitLastmod } from '@getvitops/astro';
864
+ import vitops, { gitLastmod } from "@getvitops/astro";
651
865
  vitops({ sitemap: { serialize: await gitLastmod() } });
652
866
  ```
653
867
 
@@ -741,7 +955,7 @@ ffmpeg`, `apt install ffmpeg`, `winget install Gyan.FFmpeg`). The command fails
741
955
 
742
956
  ```js
743
957
  // astro.config.mjs
744
- getvitops({ css: { input: 'company.json', format: 'css' } });
958
+ getvitops({ css: { input: "company.json", format: "css" } });
745
959
  ```
746
960
 
747
961
  ```
@@ -1228,15 +1442,15 @@ ffmpeg`, `apt install ffmpeg`, `winget install Gyan.FFmpeg`). The command fails
1228
1442
  which `@getvitops/astro` re-exports wholesale. So from `astro.config.mjs`:
1229
1443
 
1230
1444
  ```js
1231
- import { generateIconInclude } from '@getvitops/astro';
1232
- import icon from 'astro-icon';
1445
+ import { generateIconInclude } from "@getvitops/astro";
1446
+ import icon from "astro-icon";
1233
1447
 
1234
1448
  integrations: [
1235
1449
  icon({
1236
1450
  include: generateIconInclude({
1237
- ui: 'fa7-solid',
1238
- brand: 'simple-icons',
1239
- semantic: ['menu', 'close', 'search', 'github'],
1451
+ ui: "fa7-solid",
1452
+ brand: "simple-icons",
1453
+ semantic: ["menu", "close", "search", "github"],
1240
1454
  }),
1241
1455
  }),
1242
1456
  ];