@goflag/cli 0.2.11 → 0.2.12

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/README.md CHANGED
@@ -130,6 +130,19 @@ npx @goflag/cli https://example.com --report report.json # write JSON to a
130
130
 
131
131
  The terminal view is just a render of that JSON.
132
132
 
133
+ ### Four verbs
134
+
135
+ ```sh
136
+ goflag <url> [options] # audit a site
137
+ goflag preview <url> # render its share cards, and look at them
138
+ goflag rules # print the rule catalogue as JSON
139
+ goflag flags # print the flag reference as JSON
140
+ ```
141
+
142
+ The last two answer a question about goflag rather than about a site, so they
143
+ take no URL and touch no network. `preview` takes one and audits like a normal
144
+ run — [what it writes](#goflag-preview--look-at-the-cards-before-you-ship-them) is further down.
145
+
133
146
  ### The catalogue is data too
134
147
 
135
148
  ```sh
@@ -137,7 +150,7 @@ npx @goflag/cli rules > rules.json
137
150
  ```
138
151
 
139
152
  `rules` answers a question about goflag rather than about a site: no URL, no
140
- crawl, no network. It ships fifty-six rules — twenty-three page rules,
153
+ crawl, no network. It ships fifty-eight rules — twenty-five page rules,
141
154
  twenty-eight site rules and five prose rules — and every entry carries its
142
155
  scope, severity and summary. All but one also carry a rigor, the documents they
143
156
  cite and, where a remedy is a line of code, a fix snippet. The exception is
@@ -170,7 +183,8 @@ documentation site came to quote a message the engine had stopped printing.
170
183
  --json Print the JSON report to stdout (nothing else).
171
184
  --summary, -s Roll findings up (dedup by link/rule/code). Pairs with
172
185
  --json for a compact payload; --report always writes
173
- the full report regardless.
186
+ the full report regardless. Not available with
187
+ --baseline: there the diff is the answer.
174
188
  --report <file> Write the JSON report to <file>.
175
189
  --depth <n> How far to follow links out of each page (0 = follow
176
190
  none). Sitemap URLs are seeded regardless, so --depth 0
@@ -431,6 +445,30 @@ should boot. In a monorepo audited from the root, point it at the package:
431
445
  goflag http://localhost:3000 --start "pnpm start" --start-cwd apps/web
432
446
  ```
433
447
 
448
+ ### `goflag preview` — look at the cards before you ship them
449
+
450
+ Some things are only settleable by looking. `og.image.representative` asks
451
+ whether the shared image survives being cropped to 1.91:1 — a question the
452
+ catalogue states and refuses to answer, because no rule can.
453
+
454
+ ```sh
455
+ goflag preview http://localhost:3000 --start "pnpm start"
456
+ ```
457
+
458
+ It audits like a normal run, then writes `.goflag/preview.html`: one
459
+ self-contained file showing what Google, Open Graph, X, LinkedIn, Slack, Discord
460
+ and WhatsApp make of each page, with the findings pinned on the cards they
461
+ concern and the page's JSON-LD shown beside them.
462
+
463
+ Each surface is labelled with how well its geometry is actually documented.
464
+ Three of the seven publish real numbers; Slack calls its own rendering a
465
+ "micro-approximation"; Discord publishes nothing; X's card documentation is not
466
+ reachable, and its shape changed twice since 2023. Drawing all seven with the
467
+ same confidence would be six unearned claims, so the file says which is which.
468
+
469
+ It never gates — it exits 0 unless the run itself failed — and it prints the
470
+ path it wrote, so `open "$(goflag preview http://localhost:3000)"` opens it.
471
+
434
472
  ### Multilingual sites
435
473
 
436
474
  Discovery is seeded from the sitemap, not just from links. That matters because
@@ -509,7 +547,7 @@ Three rules, whichever you use:
509
547
  stages: [build, deploy, audit]
510
548
 
511
549
  variables:
512
- GOFLAG_VERSION: "0.2.11"
550
+ GOFLAG_VERSION: "0.2.12"
513
551
 
514
552
  # Before the merge: build the branch, let goflag boot it, audit that.
515
553
  seo:mr:
@@ -561,7 +599,7 @@ jobs:
561
599
  - run: corepack enable && pnpm install --frozen-lockfile
562
600
  - run: pnpm build
563
601
  - run: |
564
- npx --yes @goflag/cli@0.2.11 http://localhost:3000 \
602
+ npx --yes @goflag/cli@0.2.12 http://localhost:3000 \
565
603
  --start "pnpm start" --static --no-external \
566
604
  --baseline .goflag/baseline.json --regressions-only --max-debt 41 \
567
605
  --report goflag-report.json