@v-office/site-checks 0.4.2 → 0.5.1
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 +92 -56
- package/dist/bin.mjs +2 -3
- package/dist/{cli-AmQJK-Qj.mjs → cli-DDeid5ml.mjs} +2007 -788
- package/dist/index.d.mts +22 -24
- package/dist/index.mjs +1 -2
- package/instructions/CHANGELOG.md +2 -0
- package/instructions/MIGRATION.md +2 -0
- package/instructions/versions/0.1.0/MIGRATION.md +2 -1
- package/instructions/versions/0.2.0/CHANGELOG.md +1 -1
- package/instructions/versions/0.5.0/CHANGELOG.md +114 -0
- package/instructions/versions/0.5.0/MIGRATION.md +74 -0
- package/instructions/versions/0.5.1/CHANGELOG.md +11 -0
- package/instructions/versions/0.5.1/MIGRATION.md +9 -0
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { parseHTML } from "linkedom";
|
|
2
|
-
//#region src/astroConfig.d.ts
|
|
3
2
|
type AstroConfigFacts = {
|
|
4
3
|
/** Whether the project has an Astro config file at all: a Vite app has none. */
|
|
5
4
|
found: boolean;
|
|
@@ -18,8 +17,6 @@ type AstroConfigFacts = {
|
|
|
18
17
|
* process.env.SITE_URL`) or ambiguous is not taken; the builder passes the site URL, and without
|
|
19
18
|
* one the checks that need it wait. */
|
|
20
19
|
export declare const readAstroConfig: (root: string) => AstroConfigFacts;
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/exclude.d.ts
|
|
23
20
|
/** One exclusion of a check's findings: a path, or a path and text the finding's message contains.
|
|
24
21
|
* `reason` is for whoever reads the config next. */
|
|
25
22
|
type Exclusion = string | {
|
|
@@ -30,8 +27,6 @@ type Exclusion = string | {
|
|
|
30
27
|
/** A site's exclusions (`exclude` in `site-checks.config.json`), by check id: `true` turns the
|
|
31
28
|
* check off for the site, a list hides the findings an entry covers. */
|
|
32
29
|
type Exclusions = Record<string, true | Exclusion[]>;
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/options.d.ts
|
|
35
30
|
/** A wording a recorded customer correction bans from the rendered pages. */
|
|
36
31
|
interface BannedCopy {
|
|
37
32
|
/** A regular expression (source), matched against each page's visible text, whitespace
|
|
@@ -39,7 +34,15 @@ interface BannedCopy {
|
|
|
39
34
|
pattern: string;
|
|
40
35
|
/** The correction behind it, shown with every finding. */
|
|
41
36
|
why: string;
|
|
37
|
+
/** `"src"`: the ban covers the site's own text only, read in `src/` (`banned-copy-src`, an
|
|
38
|
+
* error), never the rendered page, which also prints the PMS feed's descriptions. Absent: the
|
|
39
|
+
* rendered pages (`banned-copy`, a warning). */
|
|
40
|
+
in?: "src";
|
|
41
|
+
/** With `in: "src"`: project-relative path prefixes the ban does not read (`src/data/legal/`). */
|
|
42
|
+
srcExclude?: string[];
|
|
42
43
|
}
|
|
44
|
+
/** The one form of address of the site's German texts. */
|
|
45
|
+
type Address = "du" | "Sie";
|
|
43
46
|
/** What a site configures: data for the checks, never their severity. Read from
|
|
44
47
|
* `site-checks.config.json` at the project root; a programmatic run may pass the same keys, and
|
|
45
48
|
* those win over the file's. */
|
|
@@ -47,6 +50,11 @@ interface SiteChecksOptions {
|
|
|
47
50
|
/** Terms that must not ship: the template ("donor") site's brand, people, places, phone, email,
|
|
48
51
|
* domain, asset names. Matched case-insensitively, whitespace collapsed. Empty: the check skips. */
|
|
49
52
|
donorTerms?: string[];
|
|
53
|
+
/** Regular expressions (sources) for donor traces a plain term cannot say: `Brisen(hof|haus)`
|
|
54
|
+
* also catches "Brisenhofer", `fewo-?[\s/*#]*brisenhof` a domain wrapped over a comment line.
|
|
55
|
+
* Matched as written, case-sensitively, anywhere in a word, whitespace collapsed to one space;
|
|
56
|
+
* JavaScript syntax (`\s`, not `[[:space:]]`). */
|
|
57
|
+
donorPatterns?: string[];
|
|
50
58
|
/** Raster images under `public/` that ship without an AVIF sibling on purpose, as paths
|
|
51
59
|
* relative to the project root (`public/brand/logo.png`). */
|
|
52
60
|
imageIgnore?: string[];
|
|
@@ -73,6 +81,12 @@ interface SiteChecksOptions {
|
|
|
73
81
|
/** URL paths only `banned-copy` skips: pages whose prose is the site's but whose answers port
|
|
74
82
|
* verbatim (an FAQ). */
|
|
75
83
|
bannedCopyExcludePaths?: string[];
|
|
84
|
+
/** The form of address every German text the site writes in `src/` uses (`copy-address`).
|
|
85
|
+
* Unset: the check waits. */
|
|
86
|
+
address?: Address | null;
|
|
87
|
+
/** German texts `copy-address` misreads (a sentence-initial „Sie" meaning she or they), as the
|
|
88
|
+
* text's exact wording; whitespace collapsed. */
|
|
89
|
+
addressAllow?: string[];
|
|
76
90
|
/** Sentences `duplicate-sentences` accepts twice on one page. */
|
|
77
91
|
allowDuplicateSentences?: string[];
|
|
78
92
|
/** Files or directories (project-relative) holding the text a `<blockquote>` may quote: content
|
|
@@ -83,7 +97,7 @@ interface SiteChecksOptions {
|
|
|
83
97
|
* it a finding again. */
|
|
84
98
|
factCheckAccepted?: string[];
|
|
85
99
|
/** Rules of `page-structure` this site declines: `one-h1`, `heading-skip`, `landmark-main`,
|
|
86
|
-
* `img-alt`, `control-label`, `table-headers
|
|
100
|
+
* `img-alt`, `control-label`, `table-headers`; `heading-ratio` turns that check off. */
|
|
87
101
|
structureIgnore?: string[];
|
|
88
102
|
/** v9 only: the Website SDK options the site's `website-sdk hub-filters check` needs
|
|
89
103
|
* (`rentalScope`, `customAttributeFilterDefinitions`), as the site passes them to the SDK. */
|
|
@@ -98,8 +112,6 @@ export declare const CONFIG_FILE = "site-checks.config.json";
|
|
|
98
112
|
/** The file's keys with the given options on top. A file that cannot be parsed throws: a broken
|
|
99
113
|
* config must not silently disable a check. `note` hears about a retired key. */
|
|
100
114
|
export declare function loadOptions(root: string, overrides?: SiteChecksOptions, note?: (message: string) => void): ResolvedOptions;
|
|
101
|
-
//#endregion
|
|
102
|
-
//#region src/types.d.ts
|
|
103
115
|
/** Two families of checks share these types, one runner and one report shape:
|
|
104
116
|
* - the site checks (`checks/`) over a site's source and built output, at the site's pinned
|
|
105
117
|
* version: `site-checks src` before the build, `site-checks dist` after it;
|
|
@@ -152,7 +164,8 @@ type Page = {
|
|
|
152
164
|
visibleText: () => string;
|
|
153
165
|
/** Every attribute value on the page (`alt`, `title`, `href`, island props, …). */
|
|
154
166
|
attributeValues: () => string[];
|
|
155
|
-
/** The data of every HTML comment node,
|
|
167
|
+
/** The data of every HTML comment node of the document, before and after `<html>` included,
|
|
168
|
+
* outside script and style text. */
|
|
156
169
|
comments: () => string[];
|
|
157
170
|
};
|
|
158
171
|
/** A build's output, listed once: what both families read of `dist/`. */
|
|
@@ -227,8 +240,6 @@ type DistCheck = Check<DistContext>;
|
|
|
227
240
|
/** What the `dist` stage runs over: the site's context with the build, which is also everything a
|
|
228
241
|
* dist check reads, so both families see each page once. */
|
|
229
242
|
type DistStageContext = SiteCheckContext & DistContext;
|
|
230
|
-
//#endregion
|
|
231
|
-
//#region src/checks/index.d.ts
|
|
232
243
|
/** The site checks, in the order the report shows them: the `src` stage first, then the `dist`
|
|
233
244
|
* stage. Each check names its stage; `site-checks src` runs the first group before the build and
|
|
234
245
|
* `site-checks dist` the second after it, together with the platform's dist checks
|
|
@@ -236,8 +247,6 @@ type DistStageContext = SiteCheckContext & DistContext;
|
|
|
236
247
|
* is one file here, one entry, one test, a README row and a CHANGELOG entry. */
|
|
237
248
|
export declare const checks: readonly SiteCheck[];
|
|
238
249
|
export declare const checksOf: (stage: Stage) => readonly SiteCheck[];
|
|
239
|
-
//#endregion
|
|
240
|
-
//#region src/cli.d.ts
|
|
241
250
|
type Io = {
|
|
242
251
|
out: (line: string) => void;
|
|
243
252
|
err: (line: string) => void;
|
|
@@ -245,8 +254,6 @@ type Io = {
|
|
|
245
254
|
export declare const USAGE = "Usage: site-checks <src | dist | verify> [options]\n\n src the source checks, before the build (reads the project, never dist/)\n dist the checks over the built output, after the build\n verify what AI Studio's build runs, stopping at the first failure: src, astro check, the\n build script, dist (--root and --site only)\n\nOptions:\n --root <dir> the project (default: the current directory)\n --dist <dir> the build output, relative to the root (default: dist; dist stage only)\n --site <url> the site's public URL (default: `site` in the Astro config file)\n --report <file> write the report as JSON here (default for dist: <dist>/site-checks.json)\n -h, --help this text\n\nExits 0 when nothing refused, 1 when a check with severity error found something or (verify)\nastro check or the build failed, 2 on a usage or configuration error. Data for the checks:\nsite-checks.config.json at the project root.";
|
|
246
255
|
/** The command line. Returns the exit code; prints to `io`. */
|
|
247
256
|
export declare function cli(argv: readonly string[], io: Io, cwd?: string): Promise<number>;
|
|
248
|
-
//#endregion
|
|
249
|
-
//#region src/report.d.ts
|
|
250
257
|
/** The `dist` stage's report file under `dist/`. The build worker reads it after the build and
|
|
251
258
|
* never uploads it (it names source paths and configured terms). */
|
|
252
259
|
export declare const SITE_CHECKS_FILE = "site-checks.json";
|
|
@@ -259,8 +266,6 @@ export declare const summaryLines: (report: CheckReport) => string[];
|
|
|
259
266
|
export declare const refusalMessage: (report: CheckReport, stage: string, reportFile?: string) => string;
|
|
260
267
|
/** One line naming what refused the build, for the studio: the failing checks and their counts. */
|
|
261
268
|
export declare const summarizeBlocking: (report: CheckReport) => string;
|
|
262
|
-
//#endregion
|
|
263
|
-
//#region src/context.d.ts
|
|
264
269
|
type ContextInput = {
|
|
265
270
|
root: string;
|
|
266
271
|
srcDir: string;
|
|
@@ -273,8 +278,6 @@ type ContextInput = {
|
|
|
273
278
|
config: SiteCheckContext["config"];
|
|
274
279
|
options: ResolvedOptions;
|
|
275
280
|
};
|
|
276
|
-
//#endregion
|
|
277
|
-
//#region src/runner.d.ts
|
|
278
281
|
/** Findings kept per check in the report; the rest is counted in `omitted`. */
|
|
279
282
|
export declare const MAX_FINDINGS_PER_CHECK = 25;
|
|
280
283
|
/** The controller's `siteCheckReportSchema` accepts a finding message of at most 2000 characters
|
|
@@ -298,8 +301,6 @@ type RunInput = {
|
|
|
298
301
|
export declare const runSiteChecks: (input: RunInput, list?: readonly SiteCheck[]) => Promise<CheckReport>;
|
|
299
302
|
/** Results with status `error`: the ones `site-checks` exits non-zero for. */
|
|
300
303
|
export declare const blockingResults: (report: CheckReport) => CheckResult[];
|
|
301
|
-
//#endregion
|
|
302
|
-
//#region src/distChecks/index.d.ts
|
|
303
304
|
/**
|
|
304
305
|
* The dist checks: the platform's checks over a build's `dist/`. They are part of the `dist`
|
|
305
306
|
* stage (`site-checks dist` runs them after the site's own), and the build worker also runs them
|
|
@@ -318,8 +319,6 @@ export declare const runDistChecks: (distDir: string, opts: {
|
|
|
318
319
|
siteUrl?: string | undefined;
|
|
319
320
|
root?: string | undefined;
|
|
320
321
|
}, list?: readonly DistCheck[]) => Promise<CheckReport>;
|
|
321
|
-
//#endregion
|
|
322
|
-
//#region src/stages.d.ts
|
|
323
322
|
type StageInput = {
|
|
324
323
|
root: string;
|
|
325
324
|
/** The build output; `<root>/dist` by default. Read by the `dist` stage only. */
|
|
@@ -343,5 +342,4 @@ type StageInput = {
|
|
|
343
342
|
* this version does not have.
|
|
344
343
|
*/
|
|
345
344
|
export declare const runStage: (stage: Stage, input: StageInput) => Promise<CheckReport>;
|
|
346
|
-
//#endregion
|
|
347
345
|
export type { AstroConfigFacts, BannedCopy, BuildOutput, Check, CheckReport, CheckResult, CheckRun, CheckStatus, DistCheck, DistContext, DistStageContext, Exclusion, Exclusions, Finding, Io, Page, ResolvedOptions, RunInput, Severity, SiteCheck, SiteCheckContext, SiteChecksOptions, Stage, StageInput };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
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 };
|
|
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-DDeid5ml.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.1/CHANGELOG.md`: release notes for 0.5.1
|
|
8
|
+
- `versions/0.5.0/CHANGELOG.md`: release notes for 0.5.0
|
|
7
9
|
- `versions/0.4.2/CHANGELOG.md`: release notes for 0.4.2
|
|
8
10
|
- `versions/0.4.1/CHANGELOG.md`: release notes for 0.4.1
|
|
9
11
|
- `versions/0.4.0/CHANGELOG.md`: release notes for 0.4.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.1/MIGRATION.md`: Migration: 0.5.0 to 0.5.1
|
|
8
|
+
- `versions/0.5.0/MIGRATION.md`: Migration: 0.4.2 to 0.5.0
|
|
7
9
|
- `versions/0.4.2/MIGRATION.md`: Migration: 0.4.1 to 0.4.2
|
|
8
10
|
- `versions/0.4.1/MIGRATION.md`: Migration: 0.4.0 to 0.4.1
|
|
9
11
|
- `versions/0.4.0/MIGRATION.md`: Migration: 0.3.3 to 0.4.0
|
|
@@ -10,8 +10,9 @@ pnpm add --save-exact --save-dev @v-office/site-checks@0.1.0
|
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
12
|
// astro.config.mjs
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
import { siteChecks } from "@v-office/site-checks/astro";
|
|
15
|
+
import { siteManifest } from "@v-office/site-manifest/astro";
|
|
15
16
|
|
|
16
17
|
export default defineConfig({
|
|
17
18
|
integrations: [siteManifest(), siteChecks()],
|
|
@@ -22,7 +22,7 @@ PMS or Hub data is a warning; the nightly builds that update prices never stop o
|
|
|
22
22
|
- `v9-hub-filters` (warning, v9 only): the be-on! Hub the site builds against serves every filter
|
|
23
23
|
the site's search needs (the scope filter, the Merkliste's rental-id filter, each searchable
|
|
24
24
|
backend-filter definition). It asks the Hub through the site's own `website-sdk hub-filters
|
|
25
|
-
check`, with the build's env and `hubFilterOptions`; a site that sets the SDK CLI's
|
|
25
|
+
check`, with the build's env and `hubFilterOptions`; a site that sets the SDK CLI's
|
|
26
26
|
`HUB_RENTAL_SCOPE_PROPERTY_KIND` or `HUB_RENTAL_IDS_SEARCH` has them forwarded. A Hub that cannot be asked (no
|
|
27
27
|
`website-sdk`, an SDK without the command, no key) is reported, never passed.
|
|
28
28
|
- `v9-production-hub` (error, v9 only): a launched v9 site builds against the production Hub:
|
|
@@ -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`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog: 0.5.1
|
|
2
|
+
|
|
3
|
+
Dependency update; the checks report the same.
|
|
4
|
+
|
|
5
|
+
## Changed
|
|
6
|
+
|
|
7
|
+
- `linkedom` 0.18.13 → 0.18.15, the HTML parser the checks read the built pages with: an attribute
|
|
8
|
+
selector on `class` no longer matches an element without the attribute.
|
|
9
|
+
|
|
10
|
+
The rules, their levels, the configuration keys, the exit codes and the report's shape stay the
|
|
11
|
+
same.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-office/site-checks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
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": {
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"linkedom": "0.18.
|
|
29
|
+
"linkedom": "0.18.15"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/node": "
|
|
33
|
-
"oxfmt": "0.
|
|
34
|
-
"oxlint": "1.
|
|
35
|
-
"tsdown": "0.23.
|
|
32
|
+
"@types/node": "24.19.2",
|
|
33
|
+
"oxfmt": "0.79.0",
|
|
34
|
+
"oxlint": "1.94.0",
|
|
35
|
+
"tsdown": "0.23.7",
|
|
36
36
|
"typescript": "7.0.2",
|
|
37
|
-
"vitest": "^5.
|
|
37
|
+
"vitest": "^5.1.0"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|
|
40
40
|
"node": "^22.0.0 || ^24.0.0 || ^25.0.0 || >=26.0.0"
|