@v-office/site-checks 0.4.1 → 0.5.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/dist/index.d.mts CHANGED
@@ -39,7 +39,15 @@ interface BannedCopy {
39
39
  pattern: string;
40
40
  /** The correction behind it, shown with every finding. */
41
41
  why: string;
42
+ /** `"src"`: the ban covers the site's own text only, read in `src/` (`banned-copy-src`, an
43
+ * error), never the rendered page, which also prints the PMS feed's descriptions. Absent: the
44
+ * rendered pages (`banned-copy`, a warning). */
45
+ in?: "src";
46
+ /** With `in: "src"`: project-relative path prefixes the ban does not read (`src/data/legal/`). */
47
+ srcExclude?: string[];
42
48
  }
49
+ /** The one form of address of the site's German texts. */
50
+ type Address = "du" | "Sie";
43
51
  /** What a site configures: data for the checks, never their severity. Read from
44
52
  * `site-checks.config.json` at the project root; a programmatic run may pass the same keys, and
45
53
  * those win over the file's. */
@@ -47,6 +55,11 @@ interface SiteChecksOptions {
47
55
  /** Terms that must not ship: the template ("donor") site's brand, people, places, phone, email,
48
56
  * domain, asset names. Matched case-insensitively, whitespace collapsed. Empty: the check skips. */
49
57
  donorTerms?: string[];
58
+ /** Regular expressions (sources) for donor traces a plain term cannot say: `Brisen(hof|haus)`
59
+ * also catches "Brisenhofer", `fewo-?[\s/*#]*brisenhof` a domain wrapped over a comment line.
60
+ * Matched as written, case-sensitively, anywhere in a word, whitespace collapsed to one space;
61
+ * JavaScript syntax (`\s`, not `[[:space:]]`). */
62
+ donorPatterns?: string[];
50
63
  /** Raster images under `public/` that ship without an AVIF sibling on purpose, as paths
51
64
  * relative to the project root (`public/brand/logo.png`). */
52
65
  imageIgnore?: string[];
@@ -73,6 +86,12 @@ interface SiteChecksOptions {
73
86
  /** URL paths only `banned-copy` skips: pages whose prose is the site's but whose answers port
74
87
  * verbatim (an FAQ). */
75
88
  bannedCopyExcludePaths?: string[];
89
+ /** The form of address every German text the site writes in `src/` uses (`copy-address`).
90
+ * Unset: the check waits. */
91
+ address?: Address | null;
92
+ /** German texts `copy-address` misreads (a sentence-initial „Sie" meaning she or they), as the
93
+ * text's exact wording; whitespace collapsed. */
94
+ addressAllow?: string[];
76
95
  /** Sentences `duplicate-sentences` accepts twice on one page. */
77
96
  allowDuplicateSentences?: string[];
78
97
  /** Files or directories (project-relative) holding the text a `<blockquote>` may quote: content
@@ -83,7 +102,7 @@ interface SiteChecksOptions {
83
102
  * it a finding again. */
84
103
  factCheckAccepted?: string[];
85
104
  /** Rules of `page-structure` this site declines: `one-h1`, `heading-skip`, `landmark-main`,
86
- * `img-alt`, `control-label`, `table-headers`, `heading-ratio`. */
105
+ * `img-alt`, `control-label`, `table-headers`; `heading-ratio` turns that check off. */
87
106
  structureIgnore?: string[];
88
107
  /** v9 only: the Website SDK options the site's `website-sdk hub-filters check` needs
89
108
  * (`rentalScope`, `customAttributeFilterDefinitions`), as the site passes them to the SDK. */
@@ -152,7 +171,8 @@ type Page = {
152
171
  visibleText: () => string;
153
172
  /** Every attribute value on the page (`alt`, `title`, `href`, island props, …). */
154
173
  attributeValues: () => string[];
155
- /** The data of every HTML comment node, outside script and style text. */
174
+ /** The data of every HTML comment node of the document, before and after `<html>` included,
175
+ * outside script and style text. */
156
176
  comments: () => string[];
157
177
  };
158
178
  /** A build's output, listed once: what both families read of `dist/`. */
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as loadOptions, a as runDistChecks, b as readAstroConfig, c as refusalMessage, d as MAX_FINDINGS_PER_CHECK, f as MAX_MESSAGE_CHARS, g as CONFIG_FILE, h as runSiteChecks, i as distChecks, l as summarizeBlocking, m as blockingResults, n as cli, o as SITE_CHECKS_FILE, p as MAX_PATH_CHARS, r as runStage, s as findingLine, t as USAGE, u as summaryLines, v as checks, y as checksOf } from "./cli-CYG52KHL.mjs";
1
+ import { _ as loadOptions, a as runDistChecks, b as readAstroConfig, c as refusalMessage, d as MAX_FINDINGS_PER_CHECK, f as MAX_MESSAGE_CHARS, g as CONFIG_FILE, h as runSiteChecks, i as distChecks, l as summarizeBlocking, m as blockingResults, n as cli, o as SITE_CHECKS_FILE, p as MAX_PATH_CHARS, r as runStage, s as findingLine, t as USAGE, u as summaryLines, v as checks, y as checksOf } from "./cli-ChBTZhc7.mjs";
2
2
  export { CONFIG_FILE, MAX_FINDINGS_PER_CHECK, MAX_MESSAGE_CHARS, MAX_PATH_CHARS, SITE_CHECKS_FILE, USAGE, blockingResults, checks, checksOf, cli, distChecks, findingLine, loadOptions, readAstroConfig, refusalMessage, runDistChecks, runSiteChecks, runStage, summarizeBlocking, summaryLines };
@@ -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.0/CHANGELOG.md`: release notes for 0.5.0
8
+ - `versions/0.4.2/CHANGELOG.md`: release notes for 0.4.2
7
9
  - `versions/0.4.1/CHANGELOG.md`: release notes for 0.4.1
8
10
  - `versions/0.4.0/CHANGELOG.md`: release notes for 0.4.0
9
11
  - `versions/0.3.3/CHANGELOG.md`: release notes for 0.3.3
@@ -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.0/MIGRATION.md`: Migration: 0.4.2 to 0.5.0
8
+ - `versions/0.4.2/MIGRATION.md`: Migration: 0.4.1 to 0.4.2
7
9
  - `versions/0.4.1/MIGRATION.md`: Migration: 0.4.0 to 0.4.1
8
10
  - `versions/0.4.0/MIGRATION.md`: Migration: 0.3.3 to 0.4.0
9
11
  - `versions/0.3.3/MIGRATION.md`: Migration: 0.3.2 to 0.3.3
@@ -0,0 +1,13 @@
1
+ # Changelog: 0.4.2
2
+
3
+ Two warnings that fired on correct pages no longer do.
4
+
5
+ ## Fixed
6
+
7
+ - `page-heads` no longer reports language versions of one page as duplicate titles or
8
+ descriptions: two pages that name each other as `<link rel="alternate" hreflang>` share a title
9
+ without competing, also when the links are absolute on the production host. A page that repeats a
10
+ title without that link both ways is still reported.
11
+ - `page-structure` (`table-headers`) takes `aria-label` or `aria-labelledby` as a table's name, as a
12
+ calendar grid (`<table role="grid" aria-label="November 2026">`) has it; a table with neither
13
+ and no `<caption>` is still reported.
@@ -0,0 +1,11 @@
1
+ # Migration: 0.4.1 to 0.4.2
2
+
3
+ No changes required. Fewer warnings: a table named by `aria-label` or `aria-labelledby` (a date
4
+ picker's grid) needs no `<caption>`, and language versions that name each other as `hreflang`
5
+ alternates may share a title and description. An `exclude` entry a site added for either can go.
6
+
7
+ ## 1. Upgrade
8
+
9
+ ```sh
10
+ pnpm add --save-exact --save-dev @v-office/site-checks@0.4.2
11
+ ```
@@ -0,0 +1,114 @@
1
+ # Changelog: 0.5.0
2
+
3
+ The checks now hold everything the blueprint guards (`copy-check`, `view-source-check`,
4
+ `fact-check`, `structure-check`, `credit-check`, `listing-links-check`, `sitemap-noindex-check`,
5
+ `not-found-log-check`, `photo-format-check`, `image-check`, `perf-check`, `donor-sweep`,
6
+ `consent-gate`, `sync-once-check`, `hub-filters-check` and the platform half of `seo-check`)
7
+ refused, so a site can drop them. Rules about the site's own code and content that those guards
8
+ blocked are `error`; a rule whose outcome PMS data can change stays `warning`.
9
+
10
+ ## Added
11
+
12
+ - `copy-address` (src, error): every German text (`"de-XX"`) in `src/` uses the site's one form of
13
+ address, `address` (`"du"` or `"Sie"`). Skipped without `address`; `addressAllow` lists a text
14
+ word for word that the check misreads (a sentence-initial "Sie" meaning she or they).
15
+ - `copy-english` (src, error): an English text (`"en-XX"`) in `src/` with an em dash or a
16
+ Germanism: Imprint, GTC, final cleaning, vacation apartment, house or flat, picture(s),
17
+ accommodations.
18
+ - `banned-copy-src` (src, error): a `bannedCopy` entry with `"in": "src"` is matched against the
19
+ site's own source files (comments and tags ignored, `"srcExclude"` folders skipped), no longer
20
+ against the rendered pages, which also carry the PMS feed's text. The three copy checks read a
21
+ literal's text as it renders (escapes decoded, in code and in JSON and YAML too), keep a string's
22
+ `//` and markup text past a URL, join a word across inline tags (`Ferien<em>wohnung</em>`), read
23
+ `.html` pages, take no property name of an object of texts, nor a trailing comment, for a text, and read the
24
+ values of text-bearing attributes and props (`title`, `alt`, `placeholder`, a component's
25
+ `heading="…"`; not `class`, `href`, `src` and the like).
26
+ - `donor-terms-source` (src, error): a donor term or pattern in the site's own source, the text
27
+ and data files under `public/` (`llms.txt`, a manifest, JSON, SVG; not the scripts and styles a
28
+ site ships there as they come), its Astro config,
29
+ `package.json`, a comment wrapped over two lines, or a file name under `src/` or `public/`.
30
+ - `donorPatterns`: regular expressions for donor traces a plain term cannot express
31
+ (`Brisen(hof|haus)`, a domain wrapped over a line), case-sensitive, matched inside words.
32
+ - `consent-gate-source` (src, error): a third-party `<script src>` or `<iframe src>` in the site's
33
+ markup outside the consent layer, including one only a `client:only` island renders. A tag in a
34
+ comment is not read; without a known site host it waits, as `consent-gate` does.
35
+ - `robots-txt` (src, error): a `public/robots.txt` beside a `src/pages/robots.txt.*` generator.
36
+ - `voffice-credit` (dist, error): a page whose site footer has no link to
37
+ `https://www.v-office.com`, and a home page (a locale's, `de/index.html`, too) without a site
38
+ footer.
39
+ - `heading-ratio` (dist, warning): the "many `<h3>` under few `<h2>`" rule, out of
40
+ `page-structure`.
41
+ - `first-paint-photos` (dist, error): a first-paint photo or image preload of 100 KB or more, a
42
+ file of the build, in one size only; a hidden slide carrying a URL next to the
43
+ `fetchpriority="high"` photo (`aria-hidden`, `inert`, `invisible` or `opacity-0`, also at a
44
+ breakpoint; `hidden` or a closed `<dialog>` for an image that is not lazy, which the browser
45
+ fetches all the same; a `hover:` state and an SVG icon are no slide).
46
+ - `json-ld` (dist, error): a JSON-LD block that does not parse.
47
+ - `rental-markup` (dist, error): on the launched site, a rental page (`data-rental-stats`) without
48
+ `VacationRental` JSON-LD.
49
+ - `v10-production-api` (dist, error): a launched v10 site whose env does not call the production
50
+ API, a committed `.env.local`, or the developer's token.
51
+ - Warnings: `sitemap-coverage` (an indexable page missing from the sitemap; a
52
+ `sitemap-index.xml` without `/sitemap.xml`), `orphan-pages` (an indexable page no other page
53
+ links to), `breadcrumbs` (a breadcrumb item to no built page).
54
+
55
+ ## Changed
56
+
57
+ - `not-found-beacon` and `v9-production-hub` are `error`. `page-structure` stays a `warning`, on
58
+ every build, previews included.
59
+ - `donor-terms` (built output) is a `warning`: built pages carry PMS feed text. The site's own
60
+ source is `donor-terms-source`.
61
+ - `page-structure`: a control is out of reach only with `tabindex="-1"` and `aria-hidden`;
62
+ `aria-hidden` alone no longer exempts it. A heading skip between two headings of one PMS text
63
+ (`data-part="rich-text"`) is the owner's and not reported.
64
+ - `view-source`: a trailing `//` or `/* */` comment in an inline script or event handler, a
65
+ comment in a `style=""` attribute, HTML comments before `<html>` or after `</html>`, and comments
66
+ in every shipped JS and CSS file (`_astro/` included) whose text is in the site's own files. A
67
+ library shipped from `public/` as it comes (`*.min.js`/`*.min.css`, a `vendor/` folder, or a
68
+ licence banner on top) is not read: its notes are its authors'.
69
+ Framework markers are allowed by exact name only (an HTML comment `astro: TODO`, a
70
+ `/* @todo */` are refused); licence banners and Vite's markers stay allowed. Provenance searches the whole
71
+ project, not only `src/` and `public/`.
72
+ - `html-comments` reads every text file under `src/`, not only `.astro/.tsx/.jsx/.md/.mdx/.html`.
73
+ - `canonical-link`: the canonical must be on the site's own origin, without a query or fragment,
74
+ in the `trailingSlash` form, and name the page's own path when the sitemap lists the page.
75
+ - `sitemap-noindex` reads every `sitemap*.xml` and refuses an `llms.txt` without a `# ` heading,
76
+ a `> ` summary and `## ` sections.
77
+ - `consent-gate` refuses an `ENABLED_VENDOR_IDS` that is not an array literal of quoted ids, and a
78
+ registry snapshot that does not parse.
79
+ - `rental-facts` reports rental pages on which no fact was compared at all, reads decimal counts
80
+ ("4,5 Badezimmer"), a site's own `data-rental-facts` chip row and "ca.130 qm".
81
+ - `listing-noindex` and `listing-links` leave the favourites grid and rental pages alone;
82
+ `listingClientOnly` exempts a page from both. `listing-links` counts only links to rental pages
83
+ and runs once the build has one.
84
+ - `not-found-beacon` needs a `fetch` or `sendBeacon` call with `/api/404-log`, written in the call
85
+ or held in a constant the call posts to, `fetch(new Request(…))` and optional calls
86
+ (`sendBeacon?.(…)`) too (a comment or an unused string naming the path does not count), and follows the chunks the 404 page's scripts import.
87
+ - `feed-image-formats` also finds JPEG/PNG feed photos in island props, other attributes, inline
88
+ JSON and CSS `background-image`, and imgproxy's hosts and base64 URLs.
89
+ - `load-order` no longer reports one-size photos (`first-paint-photos` does); it finds swipe strips
90
+ under variant classes (`md:overflow-x-auto`) and names swap faces that are not preloaded.
91
+ - `open-graph` reports an `og:url` that differs from the canonical; `page-heads` a title that
92
+ names the site twice.
93
+ - `sync-once` detects a loader that clears its store and the SDK imported under any name, and
94
+ warns about a `package.json` script chaining `astro check` and `astro build` without a
95
+ `CONTENT_SYNC_TOKEN`.
96
+ - `v9-hub-filters` reads `src/data/hub-filters.json` as the backend-filter definitions.
97
+ - Every check that waits for the launch counts the same pages: not noindex, not a redirect stub,
98
+ not a status page (`/404`, `/500`, also under a locale prefix).
99
+
100
+ ## Fixed
101
+
102
+ - `image-formats` no longer refuses an image the site's web manifest names, matched by its path
103
+ on the site's own origin (an unrelated image of the same name, or one an icon on another host
104
+ names, is still asked for its AVIF).
105
+ - `duplicate-sentences`, `listing-noindex` and `sitemap-noindex` no longer take a preview's
106
+ indexable 404 page for a launch.
107
+ - `quote-sources` reports only the missing sources when none of them exists.
108
+ - `rental-facts` no longer reports crockery capacities ("Geschirr für 8 Personen"), capacities
109
+ reached with a neighbouring unit ("Nachbarwohnung dazubuchen"), or counts scoped to a floor
110
+ ("im OG 2 Schlafzimmer"); blank `factCheckAccepted` entries are ignored again.
111
+ - `view-source` no longer reports `/* x */` inside a JavaScript or CSS string.
112
+ - The 0.2.0 migration guide said `copy-check.mjs` and `perf-check.mjs` were replaced whole. They
113
+ were not until this release: the form of address, English style, src-scoped bans, hidden slides
114
+ and the blocking first-paint rule were missing.
@@ -0,0 +1,74 @@
1
+ # Migration: 0.4.2 to 0.5.0
2
+
3
+ This release can refuse a push that 0.4.2 let through: several rules are new or now `error`. Run
4
+ `site-checks verify` after the upgrade and fix or exclude what it reports. A site that ran the
5
+ blueprint guards moves their per-site lists into `site-checks.config.json` (section 3) and can
6
+ then delete those guards.
7
+
8
+ ## 1. Upgrade
9
+
10
+ ```sh
11
+ pnpm add --save-exact --save-dev @v-office/site-checks@0.5.0
12
+ ```
13
+
14
+ Add the new keys (`address`, `addressAllow`, `donorPatterns`) only once AI Studio's build worker
15
+ runs 0.5.0 or later: an older worker stops on a key it does not know and runs no checks.
16
+
17
+ ## 2. What can now refuse a push
18
+
19
+ Each is the site's own code or content; the fix is in the site, or an `exclude` entry with its
20
+ reason.
21
+
22
+ - `not-found-beacon` is an error: the 404 page calls `fetch` or `sendBeacon` with `/api/404-log`.
23
+ - `v9-production-hub` is an error, and `v10-production-api` does the same for v10: a launched site
24
+ calls the production API.
25
+ - `voffice-credit`: the site footer links `https://www.v-office.com`
26
+ (`Realisiert mit <a href="https://www.v-office.com">vOffice</a>`).
27
+ - `view-source`: no note in an inline script (also after code on a line), a `style=""`, before
28
+ `<html>` or after `</html>`, or in a shipped JS or CSS file; write notes as `//` in frontmatter or
29
+ `{/* … */}` in markup. A library shipped from `public/` as it comes is not read when it is
30
+ minified (`*.min.js`), in a `vendor/` folder or opens with its licence banner; another one is
31
+ moved there or excluded (`"view-source": ["js/lib.js"]`).
32
+ - `html-comments` reads every text file under `src/`: no HTML comment in a `.ts` string for
33
+ `set:html`, a `.vue`, `.svg` or `.css` file.
34
+ - `first-paint-photos`: a first-paint photo of 100 KB or more gets width variants (`srcset` with a
35
+ measured `sizes`); a hidden slide next to it carries its URL in `data-src` until it is shown.
36
+ - `canonical-link`: the canonical is `site` plus the page's own path, in the `trailingSlash` form.
37
+ - `json-ld`: serialise JSON-LD with `JSON.stringify`. `rental-markup`: a rental page carries
38
+ `VacationRental` JSON-LD.
39
+ - `robots-txt`: delete `public/robots.txt` when `src/pages/robots.txt.*` generates it.
40
+ - `donor-terms-source`, `consent-gate-source`, `banned-copy-src`, `copy-english` and
41
+ `copy-address`: the site's own source, read before the build.
42
+ - `consent-gate`: write `ENABLED_VENDOR_IDS` as an array literal of quoted ids.
43
+
44
+ ## 3. Moving a blueprint guard's lists
45
+
46
+ | From | To |
47
+ | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
48
+ | `scripts/copy-check.json` `address`, `addressAllow` | `"address"`, `"addressAllow"` |
49
+ | `scripts/donor-terms.sh`: plain words | `"donorTerms"` |
50
+ | `scripts/donor-terms.sh`: regular expressions, asset fragments, a domain over two lines | `"donorPatterns"`, with `[[:space:]]` written as `\s` |
51
+ | `scripts/listing-links.allow` (`path # reason`) | `"listingClientOnly": [{ "path": "…", "reason": "…" }]` |
52
+ | `scripts/seo.deny` `rental-markup # reason` | `"exclude": { "rental-markup": [{ "match": "VacationRental", "reason": "…" }] }` |
53
+ | `scripts/gates.deny` `<guard> # reason` | `"exclude": { "<check id>": true }`, only where the site really declines it |
54
+ | `hubFilterOptions.customAttributeFilterDefinitions` | nothing: `src/data/hub-filters.json` is read directly; delete the copy |
55
+
56
+ An `exclude` entry moves with the rule it names:
57
+
58
+ - `{ "page-structure": [{ "match": "heading-ratio:" }] }` becomes `"heading-ratio"`.
59
+ - A `load-order` entry for a one-size photo becomes `"first-paint-photos"`.
60
+ - `donor-terms` now reads only the built pages; a term in the site's own source is
61
+ `"donor-terms-source"`.
62
+
63
+ ## What stays the same
64
+
65
+ - Every existing key keeps its meaning: `factCheckAccepted` entries match as before (a decimal one,
66
+ `prose=4,5`, matches again), `structureIgnore`, `imageIgnore`, `copyExcludePaths`,
67
+ `consentAllowedHosts`, `feedImagePatterns`, `quoteSources`, `allowDuplicateSentences`.
68
+ - The exit codes, the report's shape and `exclude`.
69
+ - `page-structure` stays a warning on every build. It now also asks a label of a control the
70
+ keyboard reaches under `aria-hidden` (only `aria-hidden` with `tabindex="-1"` is out of reach).
71
+ - A rule whose outcome PMS data can change stays a warning: `rental-facts`, `feed-image-formats`,
72
+ `listing-links`, `v9-hub-filters`, `sync-once`, `banned-copy` and now `donor-terms`.
73
+ - What the blueprints' own process checks (the launch seal, `launch-check`, `spec-audit`, the
74
+ docs and kit guards) is theirs; this package does not read `REVIEW.md` or `SPEC_AUDIT.md`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v-office/site-checks",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
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": {