@v-office/site-checks 0.5.2 → 0.5.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/README.md +51 -49
- package/dist/bin.mjs +1 -1
- package/dist/{cli-Xd9RQ91Q.mjs → cli-BZoXqFrK.mjs} +106 -15
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +1 -1
- package/instructions/CHANGELOG.md +2 -0
- package/instructions/MIGRATION.md +2 -0
- package/instructions/versions/0.5.3/CHANGELOG.md +22 -0
- package/instructions/versions/0.5.3/MIGRATION.md +46 -0
- package/instructions/versions/0.5.4/CHANGELOG.md +37 -0
- package/instructions/versions/0.5.4/MIGRATION.md +49 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -79,26 +79,26 @@ findings it excludes (below). Severities are fixed by the package. A key of a ch
|
|
|
79
79
|
an earlier version had (`wiring`, `optimizeDepsIgnore`) is noted and ignored; an unknown key stops
|
|
80
80
|
the command.
|
|
81
81
|
|
|
82
|
-
| Key | Used by | What
|
|
83
|
-
| ------------------------- | ---------------------------------- |
|
|
84
|
-
| `donorTerms` | the donor checks | Terms that must not ship: the template site's brand, people, places, phone, email, domain, asset names. Plain strings, matched as whole words, case-insensitively with whitespace collapsed.
|
|
85
|
-
| `donorPatterns` | the donor checks | Regular expressions for donor traces a term cannot say (`Brisen(hof\|haus)` also in "Brisenhofer"), matched as written: case-sensitive, in words, whitespace collapsed; no POSIX classes.
|
|
86
|
-
| `imageIgnore` | `image-formats` | Raster images under `public/` that ship without an AVIF sibling on purpose, as paths relative to the project root (`public/brand/logo.png`).
|
|
87
|
-
| `feedImagePatterns` | `feed-image-formats` | Regular expressions (case-insensitive) matching a feed photo URL still requested as JPEG or PNG. Defaults to the vOffice image hosts (imgproxy `plain` paths, `imgproxy.*` hosts, imgproxy base64 paths, `dyn.v-office.com`).
|
|
88
|
-
| `listingPages` | `listing-noindex`, `listing-links` | URL paths of pages that list rentals, in addition to the pages the check recognizes by their markup.
|
|
89
|
-
| `listingClientOnly` | `listing-noindex`, `listing-links` | Listing pages whose list stays client-only, as `{ "path", "reason" }`: their list is the rentals free in a window, and a build-time list would show booked-out flats.
|
|
90
|
-
| `consentAllowedHosts` | the consent checks | Hosts a `<script src>` or `<iframe src>` may load before consent. The site's own host is always allowed.
|
|
91
|
-
| `hubFilterOptions` | `v9-hub-filters` | v9: the Website SDK options the Hub filter check needs (`rentalScope`, `customAttributeFilterDefinitions`), as the site passes them; `src/data/hub-filters.json` wins over a copy here.
|
|
92
|
-
| `structureIgnore` | `page-structure`, `heading-ratio` | Rules the site declines: `one-h1`, `heading-skip`, `landmark-main`, `img-alt`, `control-label`, `table-headers`; `heading-ratio` turns that check off.
|
|
93
|
-
| `bannedCopy` | `banned-copy`, `banned-copy-src` | Wordings recorded customer corrections ban, as `{ "pattern", "why" }` (a regular expression over the page's
|
|
94
|
-
| `copyExcludePaths` | the copy checks | URL paths (and below) the copy checks skip, legal pages ported verbatim; `/impressum` also covers `/de/impressum`.
|
|
95
|
-
| `bannedCopyExcludePaths` | `banned-copy`
|
|
96
|
-
| `address` | `copy-address` | The one form of address of the site's German texts: `"du"` or `"Sie"`. Unset or `null`, the check waits.
|
|
97
|
-
| `addressAllow` | `copy-address` | German texts the check misreads (a sentence-initial „Sie" meaning she or they), as the text's exact wording.
|
|
98
|
-
| `allowDuplicateSentences` | `duplicate-sentences` | Sentences a page may render twice.
|
|
99
|
-
| `quoteSources` | `quote-sources` | Files or directories holding the text a `<blockquote>` may quote (content captures, the feed's reviews written by the build).
|
|
100
|
-
| `factCheckAccepted` | `rental-facts` | Disagreements the customer confirmed, as the finding prints them: `<slug> <kind> prose=<n> feed=<n>`.
|
|
101
|
-
| `exclude` | every check | The findings the site accepts, by check id: see [Excluding findings](#excluding-findings).
|
|
82
|
+
| Key | Used by | What |
|
|
83
|
+
| ------------------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
84
|
+
| `donorTerms` | the donor checks | Terms that must not ship: the template site's brand, people, places, phone, email, domain, asset names. Plain strings, matched as whole words, case-insensitively with whitespace collapsed. |
|
|
85
|
+
| `donorPatterns` | the donor checks | Regular expressions for donor traces a term cannot say (`Brisen(hof\|haus)` also in "Brisenhofer"), matched as written: case-sensitive, in words, whitespace collapsed; no POSIX classes. |
|
|
86
|
+
| `imageIgnore` | `image-formats` | Raster images under `public/` that ship without an AVIF sibling on purpose, as paths relative to the project root (`public/brand/logo.png`). |
|
|
87
|
+
| `feedImagePatterns` | `feed-image-formats` | Regular expressions (case-insensitive) matching a feed photo URL still requested as JPEG or PNG. Defaults to the vOffice image hosts (imgproxy `plain` paths, `imgproxy.*` hosts, imgproxy base64 paths, `dyn.v-office.com`). |
|
|
88
|
+
| `listingPages` | `listing-noindex`, `listing-links` | URL paths of pages that list rentals, in addition to the pages the check recognizes by their markup. |
|
|
89
|
+
| `listingClientOnly` | `listing-noindex`, `listing-links` | Listing pages whose list stays client-only, as `{ "path", "reason" }`: their list is the rentals free in a window, and a build-time list would show booked-out flats. |
|
|
90
|
+
| `consentAllowedHosts` | the consent checks | Hosts a `<script src>` or `<iframe src>` may load before consent. The site's own host is always allowed. |
|
|
91
|
+
| `hubFilterOptions` | `v9-hub-filters` | v9: the Website SDK options the Hub filter check needs (`rentalScope`, `customAttributeFilterDefinitions`), as the site passes them; `src/data/hub-filters.json` wins over a copy here. |
|
|
92
|
+
| `structureIgnore` | `page-structure`, `heading-ratio` | Rules the site declines: `one-h1`, `heading-skip`, `landmark-main`, `img-alt`, `control-label`, `table-headers`; `heading-ratio` turns that check off. |
|
|
93
|
+
| `bannedCopy` | `banned-copy`, `banned-copy-src` | Wordings recorded customer corrections ban, as `{ "pattern", "why" }` (a regular expression over the page's text and its attribute values; one equal to a built-in empty-state pattern is dropped: `empty-state-copy` reports it). With `"in": "src"` the ban reads the site's own text in `src/` instead (`banned-copy-src`), never the page, which also prints the feed's text; `"srcExclude"` lists path prefixes it skips (`src/data/legal/`). |
|
|
94
|
+
| `copyExcludePaths` | the copy checks | URL paths (and below) the copy checks skip, legal pages ported verbatim; `/impressum` also covers `/de/impressum`. |
|
|
95
|
+
| `bannedCopyExcludePaths` | `banned-copy`, `empty-state-copy` | URL paths only `banned-copy` and `empty-state-copy` skip (an FAQ whose answers port verbatim). |
|
|
96
|
+
| `address` | `copy-address` | The one form of address of the site's German texts: `"du"` or `"Sie"`. Unset or `null`, the check waits. |
|
|
97
|
+
| `addressAllow` | `copy-address` | German texts the check misreads (a sentence-initial „Sie" meaning she or they), as the text's exact wording. |
|
|
98
|
+
| `allowDuplicateSentences` | `duplicate-sentences` | Sentences a page may render twice. |
|
|
99
|
+
| `quoteSources` | `quote-sources` | Files or directories holding the text a `<blockquote>` may quote (content captures, the feed's reviews written by the build). |
|
|
100
|
+
| `factCheckAccepted` | `rental-facts` | Disagreements the customer confirmed, as the finding prints them: `<slug> <kind> prose=<n> feed=<n>`. |
|
|
101
|
+
| `exclude` | every check | The findings the site accepts, by check id: see [Excluding findings](#excluding-findings). |
|
|
102
102
|
|
|
103
103
|
## Excluding findings
|
|
104
104
|
|
|
@@ -187,6 +187,7 @@ unrelated findings, `match` picks one.
|
|
|
187
187
|
| `load-order` | `{ "match": "leaflet" }` | the findings about that library |
|
|
188
188
|
| `first-paint-photos` | `{ "match": "/img/hero.jpg" }` | the findings about that photo |
|
|
189
189
|
| `banned-copy` | `"/faq"` | that page (or `bannedCopyExcludePaths`) |
|
|
190
|
+
| `empty-state-copy` | `{ "path": "/unterkuenfte", "match": "Keine Unterkunft" }` | that wording on those pages (a rental's own text) |
|
|
190
191
|
| `duplicate-sentences` | `{ "match": "Wir freuen uns auf Ihre Anfrage" }` | that sentence on every page (or `allowDuplicateSentences`) |
|
|
191
192
|
| `quote-sources` | `"/bewertungen"` | that page |
|
|
192
193
|
| `rental-facts` | `"/unterkunft/seeblick"` | that rental (`factCheckAccepted` accepts one exact disagreement) |
|
|
@@ -224,35 +225,36 @@ unrelated findings, `match` picks one.
|
|
|
224
225
|
|
|
225
226
|
### `dist`: after the build
|
|
226
227
|
|
|
227
|
-
| id | Severity | What it refuses or reports
|
|
228
|
-
| --------------------- | -------- |
|
|
229
|
-
| `view-source` | error | A developer's note a visitor can read with View Source: an HTML comment in a built page, before or after `<html>` (exact framework markers and wordless ones allowed); a comment in an inline script, style, `style` attribute or handler, or in shipped JS or CSS (`_astro/`, `public/`), whose text is in a project file (not `node_modules`, `dist/`); a source map. Licence banners are allowed, and a library shipped from `public/` as it comes (`*.min.js`/`*.min.css`, a `vendor/` folder, or a licence banner on top) is not read.
|
|
230
|
-
| `donor-terms` | warning | A `donorTerms` term (whole word) or `donorPatterns` match in the visible text, the title, inline scripts and styles (JSON-LD) or an attribute of a built page, in a built file name, or in the shipped JS and CSS. A warning: pages carry the PMS feed's text; the site's own source is `donor-terms-source`. Skipped without terms and patterns.
|
|
231
|
-
| `consent-gate` | error | A third-party `<script src>` or `<iframe src>` outside the consent kit's `ConsentEmbed` frame, loading before consent (needs the site's host); an enabled vendor not `approved` in `consent-registry.snapshot.json`; an `ENABLED_VENDOR_IDS` that is not a literal of quoted ids, or a snapshot that does not parse. Skipped without `src/lib/consent/`.
|
|
232
|
-
| `feed-image-formats` | warning | A feed photo from the vOffice image hosts requested as JPEG or PNG: in `src`, `srcset` or `poster`, any other attribute (island props, `style`), inline scripts (JSON) and styles (`background-image`); a warning because the photos come from the PMS feed.
|
|
233
|
-
| `listing-noindex` | error | A page that lists rentals (the search page's `data-prerendered-results` container, the `SearchResults` island, or `listingPages`) that is noindex. Not a listing: a rental page (`data-rental-stats`), the favourites grid, a `listingClientOnly` page. Waits while no page but the 404 page and redirect stubs is indexable.
|
|
234
|
-
| `listing-links` | warning | A page that lists rentals whose list carries no link to a rental page (a page with `data-rental-stats`) in its HTML, so a crawler without JavaScript sees an empty list. Runs once the build has a rental page; a warning because the links come from the PMS feed.
|
|
235
|
-
| `sitemap-noindex` | error | A sitemap entry whose page says noindex (waits while every page is noindex; the 404 and 500 pages and redirect stubs do not count) or is not in the build, in every `sitemap*.xml` of the build and every sitemap an index names; an `llms.txt` link to a page that is not there; an `llms.txt` without the spec's shape (`# ` heading first, a `> ` summary above the first section, `## ` sections). Skipped without a sitemap and `llms.txt`.
|
|
236
|
-
| `sitemap-coverage` | warning | An indexable page the sitemap does not list; a `sitemap-index.xml` without a `/sitemap.xml` beside it. Skipped without a sitemap.
|
|
237
|
-
| `orphan-pages` | warning | An indexable page (not the home page) no other built page links to in its HTML; links an island renders in the browser do not count.
|
|
238
|
-
| `page-heads` | warning | On indexable pages: a title over 60 characters, a description empty or over 160, a title or description another page repeats (language versions naming each other as `hreflang` alternates do not count), a title naming the site (`og:site_name`) twice. A missing one is `page-metadata`.
|
|
239
|
-
| `canonical-link` | error | On the launched site (a production site URL, some indexable page), an indexable page whose `<link rel="canonical">` is missing, not absolute, on another origin than the site's, with a query or fragment, naming another page while the sitemap lists this one, or in the other URL form than `trailingSlash` (`"never"`: no trailing slash; `"always"`: one).
|
|
240
|
-
| `open-graph` | warning | On the launched site: an indexable page without an absolute `og:url` and `og:image`, or whose `og:url` is not its canonical URL.
|
|
241
|
-
| `trailing-slash` | warning | On the launched site: `trailingSlash` is not `"never"`.
|
|
242
|
-
| `json-ld` | error | A `<script type="application/ld+json">` block on any page that does not parse.
|
|
243
|
-
| `rental-markup` | error | On the launched site: an indexable rental page (the rental blocks' `data-rental-stats` marker) without `VacationRental` JSON-LD (in `@graph`, a type list or nested).
|
|
244
|
-
| `breadcrumbs` | warning | A `BreadcrumbList` item on the site's own origin (or relative) that no page of the build serves.
|
|
245
|
-
| `v9-production-hub` | error | v9 only, on the launched site: the build's env does not call the production Hub (`CMS_STAGE=production` or the production Hub URLs); a committed `.env.local`; a `HUB_API_KEY` equal to `.env.local`'s. Waits for a production site URL and an indexable page.
|
|
246
|
-
| `v10-production-api` | error | v10 only (`CMS_BACKEND=v10`, else AI Studio's `PMS_BACKEND=v10`), on the launched site: the build's env does not call the production vOffice API (`CMS_STAGE=production` or the production `VOFFICE_*` endpoints); a committed `.env.local`; a `VOFFICE_LOCAL_DEV_ACCESS_TOKEN` equal to `.env.local`'s. Waits like `v9-production-hub`.
|
|
247
|
-
| `page-structure` | warning | One `<h1>`, no skipped heading level, a `<main>`, `alt` on every image, a label on every control the keyboard reaches (only `aria-hidden` with `tabindex="-1"` is out of reach), a caption (or `aria-label`/`aria-labelledby`) and scoped `<th>` on every table.
|
|
248
|
-
| `heading-ratio` | warning | Ten or more `<h3>` and more than three times as many as `<h2>` on a page: usually card titles marked up as headings.
|
|
249
|
-
| `voffice-credit` | error | A page whose site footer (a `<footer>` outside `main`, `article`, `section`, `aside`, `nav`, `blockquote`, `figure`, `dialog`) has no link to `https://www.v-office.com` (look-alike hosts and `dyn.v-office.com` do not count); a home page (a locale's `de/index.html` too) without a site footer. The wording is not read.
|
|
250
|
-
| `load-order` | warning | At start: an on-demand library (map, chart, 3D) in the start-up code, a start-up chunk over 150 KB compressed, photos after the first in card swipe strips with a URL, a swap face without a `size-adjust` stand-in (preloaded, or apart: not preloaded).
|
|
251
|
-
| `first-paint-photos` | error | A first-paint photo (not lazy) or image preload from 100 KB up, a file of the build, in one size only (no width `srcset` / `imagesrcset`); in the `<header>`/`<section>` of the `fetchpriority="high"` photo, a hidden slide (`aria-hidden`, `inert`, `invisible` or `opacity-0`, also at a breakpoint, never a `hover:` state; `hidden` or a closed `<dialog>` when the image is not lazy) whose image carries a URL, an SVG icon aside.
|
|
252
|
-
| `banned-copy` | warning | A `bannedCopy` wording (not scoped `"in": "src"`) in a page's
|
|
253
|
-
| `
|
|
254
|
-
| `
|
|
255
|
-
| `
|
|
228
|
+
| id | Severity | What it refuses or reports | How to fix |
|
|
229
|
+
| --------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
230
|
+
| `view-source` | error | A developer's note a visitor can read with View Source: an HTML comment in a built page, before or after `<html>` (exact framework markers and wordless ones allowed); a comment in an inline script, style, `style` attribute or handler, or in shipped JS or CSS (`_astro/`, `public/`), whose text is in a project file (not `node_modules`, `dist/`); a source map. Licence banners are allowed, and a library shipped from `public/` as it comes (`*.min.js`/`*.min.css`, a `vendor/` folder, or a licence banner on top) is not read. | Remove the comment or move it where the build drops it (`//` in frontmatter); turn source maps off. |
|
|
231
|
+
| `donor-terms` | warning | A `donorTerms` term (whole word) or `donorPatterns` match in the visible text, the title, inline scripts and styles (JSON-LD) or an attribute of a built page, in a built file name, or in the shipped JS and CSS. A warning: pages carry the PMS feed's text; the site's own source is `donor-terms-source`. Skipped without terms and patterns. | Replace the term; list the template site's terms in `donorTerms`. |
|
|
232
|
+
| `consent-gate` | error | A third-party `<script src>` or `<iframe src>` outside the consent kit's `ConsentEmbed` frame, loading before consent (needs the site's host); an enabled vendor not `approved` in `consent-registry.snapshot.json`; an `ENABLED_VENDOR_IDS` that is not a literal of quoted ids, or a snapshot that does not parse. Skipped without `src/lib/consent/`. | Frame it with `ConsentEmbed`, or register the vendor so the kit injects it after consent; list a consent-free host in `consentAllowedHosts`. |
|
|
233
|
+
| `feed-image-formats` | warning | A feed photo from the vOffice image hosts requested as JPEG or PNG: in `src`, `srcset` or `poster`, any other attribute (island props, `style`), inline scripts (JSON) and styles (`background-image`); a warning because the photos come from the PMS feed. | Pass feed photos through `webpUrl()`; end an imgproxy URL in `.webp`. |
|
|
234
|
+
| `listing-noindex` | error | A page that lists rentals (the search page's `data-prerendered-results` container, the `SearchResults` island, or `listingPages`) that is noindex. Not a listing: a rental page (`data-rental-stats`), the favourites grid, a `listingClientOnly` page. Waits while no page but the 404 page and redirect stubs is indexable. | Take the page out of the noindex routes. |
|
|
235
|
+
| `listing-links` | warning | A page that lists rentals whose list carries no link to a rental page (a page with `data-rental-stats`) in its HTML, so a crawler without JavaScript sees an empty list. Runs once the build has a rental page; a warning because the links come from the PMS feed. | Render the list server-side, or list the page in `listingClientOnly` with the reason. |
|
|
236
|
+
| `sitemap-noindex` | error | A sitemap entry whose page says noindex (waits while every page is noindex; the 404 and 500 pages and redirect stubs do not count) or is not in the build, in every `sitemap*.xml` of the build and every sitemap an index names; an `llms.txt` link to a page that is not there; an `llms.txt` without the spec's shape (`# ` heading first, a `> ` summary above the first section, `## ` sections). Skipped without a sitemap and `llms.txt`. | Make the sitemap filter and the noindex routes agree; fix the link or the shape. |
|
|
237
|
+
| `sitemap-coverage` | warning | An indexable page the sitemap does not list; a `sitemap-index.xml` without a `/sitemap.xml` beside it. Skipped without a sitemap. | List the page or give it noindex; write a copy of the index as `sitemap.xml`. |
|
|
238
|
+
| `orphan-pages` | warning | An indexable page (not the home page) no other built page links to in its HTML; links an island renders in the browser do not count. | Link it from a page a crawler reaches. |
|
|
239
|
+
| `page-heads` | warning | On indexable pages: a title over 60 characters, a description empty or over 160, a title or description another page repeats (language versions naming each other as `hreflang` alternates do not count), a title naming the site (`og:site_name`) twice. A missing one is `page-metadata`. | Shorten; give each page its own; name the site once. |
|
|
240
|
+
| `canonical-link` | error | On the launched site (a production site URL, some indexable page), an indexable page whose `<link rel="canonical">` is missing, not absolute, on another origin than the site's, with a query or fragment, naming another page while the sitemap lists this one, or in the other URL form than `trailingSlash` (`"never"`: no trailing slash; `"always"`: one). | Build it from the Astro `site` and the page's own path. |
|
|
241
|
+
| `open-graph` | warning | On the launched site: an indexable page without an absolute `og:url` and `og:image`, or whose `og:url` is not its canonical URL. | Add them, absolute; use the canonical URL as `og:url`. |
|
|
242
|
+
| `trailing-slash` | warning | On the launched site: `trailingSlash` is not `"never"`. | Set `trailingSlash: "never"`; write internal links without a trailing slash. |
|
|
243
|
+
| `json-ld` | error | A `<script type="application/ld+json">` block on any page that does not parse. | Build the block from an object with `JSON.stringify`. |
|
|
244
|
+
| `rental-markup` | error | On the launched site: an indexable rental page (the rental blocks' `data-rental-stats` marker) without `VacationRental` JSON-LD (in `@graph`, a type list or nested). | Render the rental's `VacationRental` block from the feed's values, or exclude `rental-markup` with the reason. |
|
|
245
|
+
| `breadcrumbs` | warning | A `BreadcrumbList` item on the site's own origin (or relative) that no page of the build serves. | Point the item at the built page. |
|
|
246
|
+
| `v9-production-hub` | error | v9 only, on the launched site: the build's env does not call the production Hub (`CMS_STAGE=production` or the production Hub URLs); a committed `.env.local`; a `HUB_API_KEY` equal to `.env.local`'s. Waits for a production site URL and an indexable page. | Set the production stage or URLs and the customer's production key; untrack `.env.local`. |
|
|
247
|
+
| `v10-production-api` | error | v10 only (`CMS_BACKEND=v10`, else AI Studio's `PMS_BACKEND=v10`), on the launched site: the build's env does not call the production vOffice API (`CMS_STAGE=production` or the production `VOFFICE_*` endpoints); a committed `.env.local`; a `VOFFICE_LOCAL_DEV_ACCESS_TOKEN` equal to `.env.local`'s. Waits like `v9-production-hub`. | Set the production stage or endpoints and the customer's production token; untrack `.env.local`. |
|
|
248
|
+
| `page-structure` | warning | One `<h1>`, no skipped heading level, a `<main>`, `alt` on every image, a label on every control the keyboard reaches (only `aria-hidden` with `tabindex="-1"` is out of reach), a caption (or `aria-label`/`aria-labelledby`) and scoped `<th>` on every table. | Fix the component where a fault repeats; decline a rule in `structureIgnore`. |
|
|
249
|
+
| `heading-ratio` | warning | Ten or more `<h3>` and more than three times as many as `<h2>` on a page: usually card titles marked up as headings. | Style a `<p>` for a card's name; decline it in `structureIgnore`. |
|
|
250
|
+
| `voffice-credit` | error | A page whose site footer (a `<footer>` outside `main`, `article`, `section`, `aside`, `nav`, `blockquote`, `figure`, `dialog`) has no link to `https://www.v-office.com` (look-alike hosts and `dyn.v-office.com` do not count); a home page (a locale's `de/index.html` too) without a site footer. The wording is not read. | Add `Realisiert mit <a href="https://www.v-office.com">vOffice</a>` to the site footer, worded per language. |
|
|
251
|
+
| `load-order` | warning | At start: an on-demand library (map, chart, 3D) in the start-up code, a start-up chunk over 150 KB compressed, photos after the first in card swipe strips with a URL, a swap face without a `size-adjust` stand-in (preloaded, or apart: not preloaded), a used `font-display: optional` face. Stacks are read from `font-family` and `--font-*`. | `import()` on demand; first slide only; `swap` with a `local()` stand-in. |
|
|
252
|
+
| `first-paint-photos` | error | A first-paint photo (not lazy) or image preload from 100 KB up, a file of the build, in one size only (no width `srcset` / `imagesrcset`); in the `<header>`/`<section>` of the `fetchpriority="high"` photo, a hidden slide (`aria-hidden`, `inert`, `invisible` or `opacity-0`, also at a breakpoint, never a `hover:` state; `hidden` or a closed `<dialog>` when the image is not lazy) whose image carries a URL, an SVG icon aside. | Width variants in a `srcset` with a measured `sizes`; hidden slides get `data-src` and their URL after load. |
|
|
253
|
+
| `banned-copy` | warning | A `bannedCopy` wording (not scoped `"in": "src"`) in a page's text or one of its attribute values (an island's `props`), entities decoded; never inside a `<script>` or `<style>`. Once per wording and place per page. Skipped without configured wordings. | Reword. |
|
|
254
|
+
| `empty-state-copy` | warning | On every site, configured or not: a built-in German or English sentence true in one state only, as the kits word it: the search, map, favourites or offers finding nothing ("Keine Unterkunft gefunden", "An deinen Wunschdaten leider ausgebucht", "No exact matches"), the search failing, a rental not available for the chosen dates, in a page's HTML, read as `banned-copy` reads it: `hidden`, `<noscript>` and `<template>` text and attribute values count, `<script>` contents never. A reader that runs no script (an AI assistant) repeats it as a fact about the agency. Skips `copyExcludePaths` and `bannedCopyExcludePaths`. | Write the sentence in by script only while it applies (a JSON `<script>`, an inline script or the JS chunk), as search-results-kit 5.2.0/5.4.0 does. |
|
|
255
|
+
| `duplicate-sentences` | warning | The same sentence rendered twice on one page. Waits while every page but the 404 page is noindex. | Remove one, or list it in `allowDuplicateSentences`. |
|
|
256
|
+
| `quote-sources` | warning | A `<blockquote>` not word for word in `quoteSources`; a configured source that is missing (when none is there, only that). Skipped without sources. | Quote the source exactly; restore the step that writes the source. |
|
|
257
|
+
| `rental-facts` | warning | On rental pages (the rental blocks' `data-rental-stats` / `data-rental-description` markers, and a site's own `data-rental-facts` chip row): the fact row against the same number in the owner's German description; a perk line of `src/data/perks.ts` a unit's amenities do not back; rental pages on which nothing was compared at all (a description without its marker, or no figure stated). | The customer corrects the PMS; a confirmed one goes into `factCheckAccepted`. |
|
|
256
258
|
|
|
257
259
|
The `dist` stage also runs the platform's dist checks, warnings but for `not-found-beacon` (an
|
|
258
260
|
error: the 404 page's own code never calls `fetch` or `sendBeacon` with `/api/404-log`, in its scripts
|
package/dist/bin.mjs
CHANGED
|
@@ -634,21 +634,34 @@ const BLOCK_TAGS = new Set("ADDRESS ARTICLE ASIDE BLOCKQUOTE BR DD DETAILS DIV D
|
|
|
634
634
|
/** An element's readable text, whitespace collapsed: a space at every block boundary, so
|
|
635
635
|
* `<p>Schön.</p><p>3 Zimmer.</p>` reads "Schön. 3 Zimmer.", and none inside a word split across
|
|
636
636
|
* inline elements (`<b>Ha</b>us` stays "Haus"). Script, style, noscript and template text is left
|
|
637
|
-
* out. */
|
|
638
|
-
const blockText = (el) => {
|
|
637
|
+
* out, or the elements `skip` names. */
|
|
638
|
+
const blockText = (el, skip = SKIPPED_TEXT_TAGS) => {
|
|
639
639
|
if (!el) return "";
|
|
640
640
|
const walk = (node) => {
|
|
641
641
|
let text = "";
|
|
642
642
|
for (const child of node.childNodes) if (child.nodeType === 3) text += child.textContent ?? "";
|
|
643
643
|
else if (child.nodeType === 1) {
|
|
644
644
|
const inner = child;
|
|
645
|
-
if (
|
|
645
|
+
if (skip.has(inner.tagName)) continue;
|
|
646
646
|
text += BLOCK_TAGS.has(inner.tagName) ? ` ${walk(inner)} ` : walk(inner);
|
|
647
647
|
}
|
|
648
648
|
return text;
|
|
649
649
|
};
|
|
650
650
|
return walk(el).replace(/\s+/g, " ").trim();
|
|
651
651
|
};
|
|
652
|
+
const CODE_TAGS = /* @__PURE__ */ new Set(["SCRIPT", "STYLE"]);
|
|
653
|
+
/** What a reader that runs no script (an AI assistant fetching the page) takes from its HTML: the
|
|
654
|
+
* body's text, `hidden`, `<noscript>` and `<template>` included, and every attribute value,
|
|
655
|
+
* entities decoded (an `astro-island`'s `props` is JSON in an attribute). Never the contents of a
|
|
656
|
+
* `<script>`, of any type, or of a `<style>`: measured against the assistants, a sentence there
|
|
657
|
+
* never reached an answer, one in island props did. */
|
|
658
|
+
const htmlTexts = (page) => [{
|
|
659
|
+
in: "text",
|
|
660
|
+
text: blockText(page.document.body, CODE_TAGS)
|
|
661
|
+
}, ...page.attributeValues().map((value) => ({
|
|
662
|
+
in: "attribute",
|
|
663
|
+
text: value.replace(/\s+/g, " ").trim()
|
|
664
|
+
}))];
|
|
652
665
|
/** Same-site URL references only: no scheme (`https:`, `mailto:`, `tel:`, `data:`, …), not
|
|
653
666
|
* protocol-relative, not a fragment — or an absolute URL on the site's own `origin`. */
|
|
654
667
|
const isSameSiteReference = (value, origin) => {
|
|
@@ -797,17 +810,58 @@ const sentencesOf = (blocks) => blocks.flatMap((block) => {
|
|
|
797
810
|
}).map((s) => s.trim()).filter((s) => /[.!?…]$/.test(s));
|
|
798
811
|
/** A sentence shorter than this is a label ("Mehr erfahren."), not prose. */
|
|
799
812
|
const MIN_SENTENCE = 25;
|
|
800
|
-
/**
|
|
801
|
-
*
|
|
802
|
-
*
|
|
803
|
-
*
|
|
813
|
+
/** Each wording `re` matches in what a reader that runs no script takes from a page
|
|
814
|
+
* (`htmlTexts`), once per place: a title attribute that repeats a heading, or a feed
|
|
815
|
+
* text in both the page and an island's props, is one finding each, not one per copy. Inline
|
|
816
|
+
* formatting does not split a wording ("Jetzt <b>buchen</b>!"), a line break does not hide it. */
|
|
817
|
+
const wordingsIn = (texts, re) => {
|
|
818
|
+
const found = /* @__PURE__ */ new Map();
|
|
819
|
+
for (const { in: where, text } of texts) for (const match of text.matchAll(re)) if (match[0]) found.set(`${where} ${match[0]}`, {
|
|
820
|
+
in: where,
|
|
821
|
+
wording: match[0]
|
|
822
|
+
});
|
|
823
|
+
return [...found.values()];
|
|
824
|
+
};
|
|
825
|
+
const inAttribute = (where) => where === "attribute" ? " (in an attribute value)" : "";
|
|
826
|
+
/** Sentences true in one state only, in German and English, as the kits and the starter word them:
|
|
827
|
+
* the search, the map, the favourites and the offers finding nothing, the search failing, a rental
|
|
828
|
+
* not available for the chosen dates. A reader that runs no script (an AI assistant) ignores
|
|
829
|
+
* `hidden` and repeats such a sentence as a fact about the agency, to a guest asking whether
|
|
830
|
+
* anything is free. Anchored to those phrasings: the pages also print the owners' descriptions
|
|
831
|
+
* ("Über Silvester leider ausgebucht", "No stays under 3 nights"), which must not match. The booking
|
|
832
|
+
* and checkout kits' price messages ("Der Preis konnte gerade nicht geladen werden") are the same
|
|
833
|
+
* kind but left out until those kits write them in by script: they sit in the kits' island props
|
|
834
|
+
* on every rental and booking page, which a site cannot change itself. */
|
|
835
|
+
const EMPTY_STATE_PATTERNS = [
|
|
836
|
+
/Keine Unterkunft gefunden/,
|
|
837
|
+
/[Kk]eine (?:deiner |Ihrer )?(?:gemerkten )?Unterkünfte in diesem Kartenausschnitt|Kartenausschnitt liegt keine/,
|
|
838
|
+
/Keine der gemerkten Unterkünfte passt/,
|
|
839
|
+
/Die Merkliste ist leer/,
|
|
840
|
+
/ist gerade nichts reduziert/,
|
|
841
|
+
/haben wir leider keine passenden Unterkünfte gefunden/,
|
|
842
|
+
/(?:deinen|Ihren) Wunschdaten (?:ist )?leider/,
|
|
843
|
+
/Die Suche ist gerade nicht erreichbar/,
|
|
844
|
+
/ist die Unterkunft leider nicht verfügbar/,
|
|
845
|
+
/\bNo (?:exact )?matches\b/,
|
|
846
|
+
/\bNo stays in this part of the map|\bNone of [^.!?]{0,40}in this part of the map/,
|
|
847
|
+
/\bNone of your saved stays match/,
|
|
848
|
+
/\bNothing saved yet\b/,
|
|
849
|
+
/\bNo deals for these dates\b/,
|
|
850
|
+
/\bNothing is available on your dates|\bbooked on your dates/,
|
|
851
|
+
/\bSearch isn['’]t available right now/,
|
|
852
|
+
/\bisn['’]t available for these dates and guests/
|
|
853
|
+
].map((re) => re.source);
|
|
854
|
+
/** Wordings a recorded customer correction bans, found in what a page's HTML says: its text and
|
|
855
|
+
* its attribute values (`htmlTexts`). A warning: the pages include the feed's descriptions, and an
|
|
856
|
+
* owner's new wording must not stop the nightly builds. A ban scoped `"in": "src"` is the site's
|
|
857
|
+
* own text only: `banned-copy-src` reads it in `src/`, this check never. */
|
|
804
858
|
const bannedCopy = {
|
|
805
859
|
id: "banned-copy",
|
|
806
860
|
title: "Wordings banned by a recorded correction",
|
|
807
861
|
severity: "warning",
|
|
808
862
|
stage: "dist",
|
|
809
863
|
begin: (ctx) => {
|
|
810
|
-
const bans = ctx.options.bannedCopy.filter((ban) => ban.in !== "src").map((ban) => ({
|
|
864
|
+
const bans = ctx.options.bannedCopy.filter((ban) => ban.in !== "src" && !EMPTY_STATE_PATTERNS.includes(ban.pattern)).map((ban) => ({
|
|
811
865
|
...ban,
|
|
812
866
|
re: new RegExp(ban.pattern, "g")
|
|
813
867
|
}));
|
|
@@ -817,10 +871,37 @@ const bannedCopy = {
|
|
|
817
871
|
return {
|
|
818
872
|
visit: (page) => {
|
|
819
873
|
if (excluded(page, skip)) return;
|
|
820
|
-
const
|
|
821
|
-
for (const ban of bans) for (const
|
|
874
|
+
const texts = htmlTexts(page);
|
|
875
|
+
for (const ban of bans) for (const { in: where, wording } of wordingsIn(texts, ban.re)) findings.push({
|
|
876
|
+
path: page.path,
|
|
877
|
+
message: `"${excerpt$3(wording, 70)}" is a banned wording${inAttribute(where)}: ${ban.why}`
|
|
878
|
+
});
|
|
879
|
+
},
|
|
880
|
+
finish: () => findings
|
|
881
|
+
};
|
|
882
|
+
}
|
|
883
|
+
};
|
|
884
|
+
/** A sentence of `EMPTY_STATE_PATTERNS` in a page's HTML, on every site, configured or not; the
|
|
885
|
+
* pages `banned-copy` skips are skipped here too. A warning: the pages and the island props also
|
|
886
|
+
* carry the feed's descriptions, which no pattern can tell apart from the site's own words for
|
|
887
|
+
* sure. */
|
|
888
|
+
const emptyStateCopy = {
|
|
889
|
+
id: "empty-state-copy",
|
|
890
|
+
title: "Empty-state and error sentences in the page's HTML",
|
|
891
|
+
severity: "warning",
|
|
892
|
+
stage: "dist",
|
|
893
|
+
begin: (ctx) => {
|
|
894
|
+
if (!ctx.hasDist) return null;
|
|
895
|
+
const res = EMPTY_STATE_PATTERNS.map((pattern) => new RegExp(pattern, "g"));
|
|
896
|
+
const skip = [...ctx.options.copyExcludePaths, ...ctx.options.bannedCopyExcludePaths];
|
|
897
|
+
const findings = [];
|
|
898
|
+
return {
|
|
899
|
+
visit: (page) => {
|
|
900
|
+
if (excluded(page, skip)) return;
|
|
901
|
+
const texts = htmlTexts(page);
|
|
902
|
+
for (const re of res) for (const { in: where, wording } of wordingsIn(texts, re)) findings.push({
|
|
822
903
|
path: page.path,
|
|
823
|
-
message: `"${excerpt$3(
|
|
904
|
+
message: `"${excerpt$3(wording, 70)}" is a sentence for one state only (nothing found, not available) in the page's HTML${inAttribute(where)}: a reader that runs no script (an AI assistant) ignores \`hidden\` and repeats it as a fact about the agency, even to a guest asking what is free. Write it in by script only while it applies: from a JSON <script>, an inline script or the component's JS chunk, as search-results-kit 5.2.0 and 5.4.0 do.`
|
|
824
905
|
});
|
|
825
906
|
},
|
|
826
907
|
finish: () => findings
|
|
@@ -1714,7 +1795,11 @@ const hiddenWithin = (img, block) => {
|
|
|
1714
1795
|
* - on a page with two or more card swipe strips, a photo after a strip's first carrying a URL
|
|
1715
1796
|
* (native lazy loading reaches sideways on slow links);
|
|
1716
1797
|
* - a `font-display: swap` face without a `size-adjust` stand-in behind it, which reflows the line
|
|
1717
|
-
* (a preloaded one at first paint; one not preloaded, likely below the fold, named apart)
|
|
1798
|
+
* (a preloaded one at first paint; one not preloaded, likely below the fold, named apart);
|
|
1799
|
+
* - a used `font-display: optional` face, which a first visit keeps out for the whole page view
|
|
1800
|
+
* when it misses the ~100 ms block window (a homepage, where the hero photo competes).
|
|
1801
|
+
* Font stacks are read from `font-family` and from the `--font-*` custom properties Tailwind v4
|
|
1802
|
+
* puts them in (`font-family: var(--font-sans)`).
|
|
1718
1803
|
* A warning: each is a cost, not a fault. The first-paint photo rules are `first-paint-photos`. */
|
|
1719
1804
|
const loadOrder = {
|
|
1720
1805
|
id: "load-order",
|
|
@@ -1745,6 +1830,7 @@ const loadOrder = {
|
|
|
1745
1830
|
const strips = /* @__PURE__ */ new Map();
|
|
1746
1831
|
const faces = /* @__PURE__ */ new Map();
|
|
1747
1832
|
const lateFaces = /* @__PURE__ */ new Map();
|
|
1833
|
+
const optionalFaces = /* @__PURE__ */ new Map();
|
|
1748
1834
|
const startup = (page) => {
|
|
1749
1835
|
const roots = /* @__PURE__ */ new Set();
|
|
1750
1836
|
for (const script of page.document.querySelectorAll("script[type=\"module\"]")) {
|
|
@@ -1813,15 +1899,18 @@ const loadOrder = {
|
|
|
1813
1899
|
return {
|
|
1814
1900
|
family: (/font-family:\s*([^;]+)/.exec(m[1])?.[1] ?? "").trim().replace(/^["']|["']$/g, ""),
|
|
1815
1901
|
swap: /font-display:\s*swap/.test(m[1]),
|
|
1902
|
+
optional: /font-display:\s*optional/.test(m[1]),
|
|
1816
1903
|
file: url && !url.startsWith("data:") ? resolve(url, base) : "",
|
|
1817
1904
|
adjusted: /size-adjust\s*:/.test(m[1])
|
|
1818
1905
|
};
|
|
1819
1906
|
}));
|
|
1820
1907
|
const adjusted = new Set(declared.filter((f) => f.adjusted).map((f) => f.family));
|
|
1821
|
-
const stacks = [...css.replace(/@font-face\s*\{[^}]*\}/g, "").matchAll(/font-family:\s*([^;}]+)/g)].map((m) => m[1].split(",").map((s) => s.trim().replace(/^["']|["']$/g, "")));
|
|
1908
|
+
const stacks = [...css.replace(/@font-face\s*\{[^}]*\}/g, "").matchAll(/(?:font-family|--font-[\w-]+):\s*([^;}]+)/g)].map((m) => m[1].split(",").map((s) => s.trim().replace(/^["']|["']$/g, "")));
|
|
1822
1909
|
const preloaded = new Set([...page.document.querySelectorAll("link[rel=\"preload\"][href]")].map((l) => resolve(l.getAttribute("href"), page.base)));
|
|
1823
|
-
for (const face of declared)
|
|
1824
|
-
|
|
1910
|
+
for (const face of declared) {
|
|
1911
|
+
const users = stacks.filter((stack) => stack[0] === face.family);
|
|
1912
|
+
if (face.optional && users.length > 0) add(optionalFaces, face.family, page.path);
|
|
1913
|
+
if (face.swap && !face.adjusted && users.some((stack) => !adjusted.has(stack[1] ?? ""))) add(face.file && preloaded.has(face.file) ? faces : lateFaces, face.family, page.path);
|
|
1825
1914
|
}
|
|
1826
1915
|
};
|
|
1827
1916
|
return {
|
|
@@ -1841,6 +1930,7 @@ const loadOrder = {
|
|
|
1841
1930
|
});
|
|
1842
1931
|
for (const [family, pages] of faces) findings.push({ message: `The preloaded face "${family}" swaps in without a width-matched stand-in (size-adjust) behind it, on ${few(pages)}. Add a local() stand-in with size-adjust right after it in the stack.` });
|
|
1843
1932
|
for (const [family, pages] of lateFaces) if (!faces.has(family)) findings.push({ message: `The face "${family}" swaps in without a width-matched stand-in (size-adjust) behind it, on ${few(pages)}; not preloaded, so likely below the fold. A local() stand-in with size-adjust right after it in the stack keeps the line from moving.` });
|
|
1933
|
+
for (const [family, pages] of optionalFaces) findings.push({ message: `The face "${family}" uses font-display: optional, on ${few(pages)}: a first visit where it arrives after the ~100 ms block window keeps the fallback font for the whole page view, until a reload finds it cached. Use font-display: swap with a local() stand-in carrying size-adjust right after it in the stack.` });
|
|
1844
1934
|
return findings;
|
|
1845
1935
|
}
|
|
1846
1936
|
};
|
|
@@ -3473,6 +3563,7 @@ const checks = [
|
|
|
3473
3563
|
loadOrder,
|
|
3474
3564
|
firstPaintPhotos,
|
|
3475
3565
|
bannedCopy,
|
|
3566
|
+
emptyStateCopy,
|
|
3476
3567
|
duplicateSentences,
|
|
3477
3568
|
quoteSources,
|
|
3478
3569
|
rentalFacts
|
package/dist/index.d.mts
CHANGED
|
@@ -29,8 +29,9 @@ type Exclusion = string | {
|
|
|
29
29
|
type Exclusions = Record<string, true | Exclusion[]>;
|
|
30
30
|
/** A wording a recorded customer correction bans from the rendered pages. */
|
|
31
31
|
interface BannedCopy {
|
|
32
|
-
/** A regular expression (source), matched against each page's
|
|
33
|
-
* collapsed, so a line break cannot hide a match.
|
|
32
|
+
/** A regular expression (source), matched against each page's text and each of its attribute
|
|
33
|
+
* values, whitespace collapsed, so a line break cannot hide a match. A pattern equal to a
|
|
34
|
+
* built-in empty-state pattern is dropped: `empty-state-copy` reports it. */
|
|
34
35
|
pattern: string;
|
|
35
36
|
/** The correction behind it, shown with every finding. */
|
|
36
37
|
why: string;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { g as CONFIG_FILE, d as MAX_FINDINGS_PER_CHECK, f as MAX_MESSAGE_CHARS, p as MAX_PATH_CHARS, o as SITE_CHECKS_FILE, t as USAGE, m as blockingResults, v as checks, y as checksOf, n as cli, i as distChecks, s as findingLine, _ as loadOptions, b as readAstroConfig, c as refusalMessage, a as runDistChecks, h as runSiteChecks, r as runStage, l as summarizeBlocking, u as summaryLines } from "./cli-
|
|
1
|
+
export { g as CONFIG_FILE, d as MAX_FINDINGS_PER_CHECK, f as MAX_MESSAGE_CHARS, p as MAX_PATH_CHARS, o as SITE_CHECKS_FILE, t as USAGE, m as blockingResults, v as checks, y as checksOf, n as cli, i as distChecks, s as findingLine, _ as loadOptions, b as readAstroConfig, c as refusalMessage, a as runDistChecks, h as runSiteChecks, r as runStage, l as summarizeBlocking, u as summaryLines } from "./cli-BZoXqFrK.mjs";
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Release notes of `@v-office/site-checks`, newest first. Each version has its own directory.
|
|
6
6
|
|
|
7
|
+
- `versions/0.5.4/CHANGELOG.md`: release notes for 0.5.4
|
|
8
|
+
- `versions/0.5.3/CHANGELOG.md`: release notes for 0.5.3
|
|
7
9
|
- `versions/0.5.2/CHANGELOG.md`: release notes for 0.5.2
|
|
8
10
|
- `versions/0.5.1/CHANGELOG.md`: release notes for 0.5.1
|
|
9
11
|
- `versions/0.5.0/CHANGELOG.md`: release notes for 0.5.0
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Migration guides of `@v-office/site-checks`, newest first. Apply them in order when skipping versions.
|
|
6
6
|
|
|
7
|
+
- `versions/0.5.4/MIGRATION.md`: Migration: 0.5.3 to 0.5.4
|
|
8
|
+
- `versions/0.5.3/MIGRATION.md`: Migration: 0.5.2 to 0.5.3
|
|
7
9
|
- `versions/0.5.2/MIGRATION.md`: Migration: 0.5.1 to 0.5.2
|
|
8
10
|
- `versions/0.5.1/MIGRATION.md`: Migration: 0.5.0 to 0.5.1
|
|
9
11
|
- `versions/0.5.0/MIGRATION.md`: Migration: 0.4.2 to 0.5.0
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog: 0.5.3
|
|
2
|
+
|
|
3
|
+
`load-order` warns about web fonts declared with `font-display: optional`, and reads the font
|
|
4
|
+
stacks of a Tailwind v4 build, so its font rules now fire on real sites.
|
|
5
|
+
|
|
6
|
+
## Added
|
|
7
|
+
|
|
8
|
+
- `load-order` reports a used face declared with `font-display: optional` (first in a font stack),
|
|
9
|
+
once per family: "The face "Lato" uses font-display: optional, on …". Under `optional`, a first
|
|
10
|
+
visit where the font arrives after the browser's ~100 ms block window (typically the homepage,
|
|
11
|
+
where the hero photo competes for the connection) keeps the fallback font for the whole page
|
|
12
|
+
view, until a reload finds the font cached. A face declared but used in no stack is not reported.
|
|
13
|
+
|
|
14
|
+
## Fixed
|
|
15
|
+
|
|
16
|
+
- `load-order` reads font stacks from `--font-*` custom properties (`--font-sans: "Lato", …`,
|
|
17
|
+
`--font-display: …`) as well as from `font-family`. Tailwind v4 puts every stack there and the
|
|
18
|
+
rules only say `font-family: var(--font-sans)`, so the check saw no stack on a Tailwind site and
|
|
19
|
+
never reported a font. The existing warning for a `font-display: swap` face without a
|
|
20
|
+
`size-adjust` stand-in behind it is unchanged, and now also fires on such sites.
|
|
21
|
+
|
|
22
|
+
The levels, the configuration keys, the exit codes and the report's shape stay the same.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Migration: 0.5.2 to 0.5.3
|
|
2
|
+
|
|
3
|
+
## 1. Upgrade
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add --save-exact --save-dev @v-office/site-checks@0.5.3
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
No changes required to build. `load-order` is a warning and may now report the site's fonts.
|
|
10
|
+
|
|
11
|
+
## 2. Fix a face that uses `font-display: optional`
|
|
12
|
+
|
|
13
|
+
For each `@font-face` the warning names (usually in `src/styles/global.css`):
|
|
14
|
+
|
|
15
|
+
1. Set `font-display: swap`.
|
|
16
|
+
2. Add a stand-in face built from Arial, resized to the web font's metrics, so the swap barely
|
|
17
|
+
moves the text:
|
|
18
|
+
|
|
19
|
+
```css
|
|
20
|
+
@font-face {
|
|
21
|
+
font-family: "Lexend Fallback";
|
|
22
|
+
src: local("Arial"), local("ArialMT");
|
|
23
|
+
size-adjust: 109.52%;
|
|
24
|
+
ascent-override: 91.3%;
|
|
25
|
+
descent-override: 22.83%;
|
|
26
|
+
line-gap-override: 0%;
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
These are Lexend's values; never copy them to another font. Measure each font's own from the
|
|
31
|
+
site's woff2 file against Arial (average glyph width over German sample copy for
|
|
32
|
+
`size-adjust`; the font's ascent, descent and line gap divided by `size-adjust` for the
|
|
33
|
+
overrides). One stand-in per web font family; a variable font with all weights needs one.
|
|
34
|
+
|
|
35
|
+
3. Name the stand-in right after the web font in every `--font-*` stack that starts with it:
|
|
36
|
+
|
|
37
|
+
```css
|
|
38
|
+
@theme {
|
|
39
|
+
--font-sans: "Lexend Variable", "Lexend Fallback", ui-sans-serif, sans-serif;
|
|
40
|
+
--font-display: "Lexend Variable", "Lexend Fallback", ui-sans-serif, sans-serif;
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Keep the font's `<link rel="preload">` where it has one. A `swap` face whose stack has no
|
|
45
|
+
`size-adjust` stand-in right after it is reported by the same check ("swaps in without a
|
|
46
|
+
width-matched stand-in"); the same stand-in fixes that warning.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Changelog: 0.5.4
|
|
2
|
+
|
|
3
|
+
A new warning, `empty-state-copy`, finds sentences that are true in one state only ("nothing
|
|
4
|
+
found", "not available") in a page's HTML, on every site, and `banned-copy` now also reads attribute
|
|
5
|
+
values. A reader that runs no script (an AI assistant) ignores `hidden` and repeats such a sentence
|
|
6
|
+
as a fact about the agency, even to a guest asking what is free.
|
|
7
|
+
|
|
8
|
+
## Added
|
|
9
|
+
|
|
10
|
+
- `empty-state-copy` (warning, `dist` stage, on every site with no configuration): a sentence that
|
|
11
|
+
is true in one state only, in a page's HTML. Its built-in German and English patterns follow the
|
|
12
|
+
kits' and the starter's wordings: the search, the map, the favourites and the offers finding
|
|
13
|
+
nothing ("Keine Unterkunft gefunden", "Keine Unterkünfte in diesem Kartenausschnitt.", "An
|
|
14
|
+
deinen Wunschdaten leider ausgebucht", "Die Merkliste ist leer.", "No exact matches", "None of
|
|
15
|
+
your saved stays are in this part of the map.", "These stays are booked on your dates."), the
|
|
16
|
+
search failing ("Die Suche ist gerade nicht erreichbar.") and a rental not available for the
|
|
17
|
+
chosen dates ("Für diese Auswahl ist die Unterkunft leider nicht verfügbar."). They are anchored
|
|
18
|
+
to those phrasings, so an owner's "Über Silvester leider ausgebucht" or "No stays under 3 nights"
|
|
19
|
+
does not match. It reads the page's text, `hidden` elements, `<noscript>` and `<template>`
|
|
20
|
+
included, and every attribute value, entities decoded, so a sentence in an `astro-island`'s
|
|
21
|
+
`props` counts; the contents of a `<script>`, of any type, never do. It skips the pages in
|
|
22
|
+
`copyExcludePaths` and `bannedCopyExcludePaths`, as `banned-copy` does. A warning, not an error:
|
|
23
|
+
the pages and the island props also carry the PMS feed's descriptions, which no pattern can tell
|
|
24
|
+
apart from the site's own words for sure. The booking and checkout kits' price messages ("Der
|
|
25
|
+
Preis konnte gerade nicht geladen werden") are not reported yet: they come back once those kits
|
|
26
|
+
write them in by script.
|
|
27
|
+
|
|
28
|
+
## Changed
|
|
29
|
+
|
|
30
|
+
- `banned-copy` reads attribute values as well as the page's text (an island's `props`, `title`,
|
|
31
|
+
`aria-label`, `content`), entities decoded, and the text of `<noscript>` and `<template>`; never
|
|
32
|
+
the contents of a `<script>` or `<style>`. A finding in an attribute says "(in an attribute
|
|
33
|
+
value)". Each wording is reported once per page and place, however often it is printed there.
|
|
34
|
+
- `banned-copy` drops a `bannedCopy` entry whose `pattern` equals one of `empty-state-copy`'s
|
|
35
|
+
built-in patterns, so the same sentence is not reported twice.
|
|
36
|
+
|
|
37
|
+
The levels, the configuration keys, the exit codes and the report's shape stay the same.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Migration: 0.5.3 to 0.5.4
|
|
2
|
+
|
|
3
|
+
## 1. Upgrade
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add --save-exact --save-dev @v-office/site-checks@0.5.4
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
No changes required to build. The new `empty-state-copy` is a warning and may report the
|
|
10
|
+
empty-state sentences of the search, the map, the favourites and the offers; `banned-copy` may now
|
|
11
|
+
report a banned wording in an attribute value.
|
|
12
|
+
|
|
13
|
+
## 2. Move an empty-state sentence out of the page's HTML
|
|
14
|
+
|
|
15
|
+
For each page `empty-state-copy` names (usually the search, the map, the favourites, an offers page
|
|
16
|
+
and a theme page that lists rentals):
|
|
17
|
+
|
|
18
|
+
1. Find the component that prints the sentence: a `hidden` element, or a prop of a hydrated island
|
|
19
|
+
(the finding says "(in an attribute value)").
|
|
20
|
+
2. Write the sentence in by script only while it applies: put it in a
|
|
21
|
+
`<script type="application/json">` the component's script reads, pass it to an inline script, or
|
|
22
|
+
keep it in the component's JS chunk. Leave the empty element in the markup without text. This is
|
|
23
|
+
what search-results-kit 5.2.0 and 5.4.0 do; on a site with the kit, update it.
|
|
24
|
+
3. Build and run `site-checks dist`: the finding is gone.
|
|
25
|
+
|
|
26
|
+
A finding the site accepts (an owner's description that happens to use one of the wordings) goes
|
|
27
|
+
into `exclude`:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"exclude": {
|
|
32
|
+
"empty-state-copy": [
|
|
33
|
+
{
|
|
34
|
+
"path": "/unterkuenfte/haus-seeblick",
|
|
35
|
+
"match": "Keine Unterkunft gefunden",
|
|
36
|
+
"reason": "the owner's text"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 3. Delete the starter's two empty-state entries from `bannedCopy`
|
|
44
|
+
|
|
45
|
+
A site built from the starter has two `bannedCopy` entries whose `why` begins "An empty-state
|
|
46
|
+
sentence in the page's HTML". Delete both: `empty-state-copy` now reports those sentences with
|
|
47
|
+
patterns anchored to the kits' wordings. Until they are deleted, their broad patterns still report
|
|
48
|
+
under `banned-copy` (a warning), now in attribute values too, and their bare "leider ausgebucht"
|
|
49
|
+
and "No stays" also match an owner's description. Keep any other pattern of your own.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-office/site-checks",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "The checks over a v-office website in two stages, `site-checks src` before the build and `site-checks dist` after it, which AI Studio's build worker runs on every build from its own pinned copy; the report has the shape of the build worker's dist-check report, and a site excludes the findings it accepts in site-checks.config.json",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|