@goflag/cli 0.2.8 → 0.2.9
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 +10 -7
- package/dist/{chunk-SKX7UCGC.js → chunk-TAZEAIFI.js} +812 -13
- package/dist/chunk-TAZEAIFI.js.map +1 -0
- package/dist/cli.js +6 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +59 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/rules.json +366 -2
- package/dist/chunk-SKX7UCGC.js.map +0 -1
package/README.md
CHANGED
|
@@ -19,6 +19,8 @@ on the site. A human cannot check those on 400 pages. That is the whole job.
|
|
|
19
19
|
- **Missing translation pages** — builds a `route × locale` matrix and flags every route that exists in one locale but is missing in another, plus hreflang reciprocity gaps (`A → B` with no `B → A`), missing `x-default`, and locale tags naming a language, script or region that does not exist. Rows are keyed by pathname, unless the site declares its translation clusters — either with `xhtml:link` in the sitemap, or with reciprocal `hreflang` between two crawled pages' `<head>`. Then those declarations decide which URLs are one page, whatever their slugs, and the run reports `diagnostics.declaredClusters`. The sitemap source survives `--coverage structural`, where the two locales of a slug-translating family are rarely both sampled; the `<head>` source needs both pages in hand and is what fixes the common site that declares properly there and nothing in its sitemap.
|
|
20
20
|
- **robots.txt policy** — flags a site that forbids crawling while its pages ask to be indexed. The two declarations cannot both hold, and robots.txt wins, so the meta tag is never even read.
|
|
21
21
|
- **SEO metadata** — lints each page's `<head>` for the handful of mistakes that actually hurt in search and social and are invisible in a browser: missing/oversized `<title>` and description, missing/relative canonical, missing `og:title`/`og:description`/`og:image`, missing viewport, and contradictory `robots`/`googlebot`/`X-Robots-Tag` directives.
|
|
22
|
+
- **Open Graph, past its presence** — a declared `og:image` is judged as well as counted: relative URLs no crawler can resolve, an undeclared size (so the first share of a URL renders without the image), a shape far from the 1.91:1 the card is cropped to, a missing `og:image:alt`, and — the one no tag check can reach — whether the URL actually serves an image at all. On a translated page, `og:locale` and `og:locale:alternate` are checked against the hreflang cluster — two vocabularies for one fact, which nothing in a build keeps in step.
|
|
23
|
+
- **Icons** — whether anything declares one at all (nothing in a spec requires it, which is why nothing complains), whether iOS has an `apple-touch-icon` to use instead of screenshotting the page, whether the Web App Manifest and the `<head>` contradict each other about the same file, whether every declared icon answers with an image, whether a `sizes` attribute describes the file it points at (a `.ico` carrying 16, 32 and 48 declared as `48x48` advertises a third of itself), and whether the origin actually serves `/favicon.ico` — a 200 of HTML from a catch-all route does not count. Two icon lists that merely differ are the normal case and are not reported.
|
|
22
24
|
- **Unreachable pages** — a page the crawl reached that answered non-2xx, or that never answered at all (timeout, reset, DNS failure — recorded as `status: 0`), is reported in `unreachablePages`. goflag asks a second time, from the back of the queue, before calling a page unreachable. Each one is an `error`-severity finding: it turns the verdict red, counts toward `--max-debt`, and fails the build even under `--fail-on error`. A page that silently dropped out of the audited set is what poisons a baseline, so it is reported rather than warned about.
|
|
23
25
|
|
|
24
26
|
**Which pages get audited.** When goflag finds a sitemap it does not audit every URL in it. It groups URLs that share a path shape — and therefore a template — into families, audits every page that stands alone, and samples three pages per family. A cap answers "how many" and never "which": on a site of thousands of pages built from thirty templates, the first 200 pages a crawl reaches are four templates out of thirty.
|
|
@@ -138,11 +140,12 @@ npx @goflag/cli rules > rules.json
|
|
|
138
140
|
|
|
139
141
|
`rules` answers a question about goflag rather than about a site: no URL, no
|
|
140
142
|
crawl, no network. Every entry carries its scope, severity and summary; the
|
|
141
|
-
|
|
142
|
-
cite and — where a remedy is a line of code — a fix snippet.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
twenty-three page rules and four prose rules also carry a rigor, the documents they
|
|
144
|
+
cite and — where a remedy is a line of code — a fix snippet. Cross-page rules
|
|
145
|
+
may carry them too, and one does; the three that predate the field still emit
|
|
146
|
+
`rigor: null` with an empty `sources`, because choosing their citations is work
|
|
147
|
+
nobody has done and inventing an authority is worse than admitting the gap.
|
|
148
|
+
Write your consumer against that. The same document
|
|
146
149
|
ships inside the package as `rules.json`, if you would rather read it than run
|
|
147
150
|
anything.
|
|
148
151
|
|
|
@@ -478,7 +481,7 @@ Three rules, whichever you use:
|
|
|
478
481
|
stages: [build, deploy, audit]
|
|
479
482
|
|
|
480
483
|
variables:
|
|
481
|
-
GOFLAG_VERSION: "0.2.
|
|
484
|
+
GOFLAG_VERSION: "0.2.9"
|
|
482
485
|
|
|
483
486
|
# Before the merge: build the branch, let goflag boot it, audit that.
|
|
484
487
|
seo:mr:
|
|
@@ -530,7 +533,7 @@ jobs:
|
|
|
530
533
|
- run: corepack enable && pnpm install --frozen-lockfile
|
|
531
534
|
- run: pnpm build
|
|
532
535
|
- run: |
|
|
533
|
-
npx --yes @goflag/cli@0.2.
|
|
536
|
+
npx --yes @goflag/cli@0.2.9 http://localhost:3000 \
|
|
534
537
|
--start "pnpm start" --static --no-external \
|
|
535
538
|
--baseline .goflag/baseline.json --regressions-only --max-debt 41 \
|
|
536
539
|
--report goflag-report.json
|