@v-office/site-checks 0.1.0 → 0.2.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/README.md +45 -23
- package/dist/astro.d.mts +2 -1
- package/dist/astro.mjs +5 -3
- package/dist/dist-checks.d.mts +1 -1
- package/dist/dist-checks.mjs +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/options-CANJso9Q.d.mts +95 -0
- package/dist/report-xp_FHnYb.mjs +2538 -0
- package/dist/{runner-Cra9mzYM.d.mts → runner-CK4iXk8Z.d.mts} +3 -1
- package/instructions/CHANGELOG.md +1 -0
- package/instructions/MIGRATION.md +1 -0
- package/instructions/versions/0.2.0/CHANGELOG.md +64 -0
- package/instructions/versions/0.2.0/MIGRATION.md +65 -0
- package/package.json +1 -1
- package/dist/options-XdHJYRcb.d.mts +0 -37
- package/dist/report-BJUPXJt0.mjs +0 -1089
package/README.md
CHANGED
|
@@ -41,32 +41,54 @@ A refused build ends with the failing checks and their first findings:
|
|
|
41
41
|
keys are accepted by `siteChecks({ … })`, and an option given there wins over the file's key.
|
|
42
42
|
Severities are fixed by the package: a site configures data, never whether a check blocks.
|
|
43
43
|
|
|
44
|
-
| Key
|
|
45
|
-
|
|
|
46
|
-
| `donorTerms`
|
|
47
|
-
| `optimizeDepsIgnore`
|
|
48
|
-
| `imageIgnore`
|
|
49
|
-
| `feedImagePatterns`
|
|
50
|
-
| `listingPages`
|
|
51
|
-
| `listingClientOnly`
|
|
52
|
-
| `consentAllowedHosts`
|
|
44
|
+
| Key | Used by | What |
|
|
45
|
+
| ------------------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
46
|
+
| `donorTerms` | `donor-terms` | Terms that must not ship: the template site's brand, people, places, phone, email, domain, asset names. Plain strings, matched case-insensitively with whitespace collapsed. |
|
|
47
|
+
| `optimizeDepsIgnore` | `optimize-deps` | Packages imported from `src/` that may stay out of `vite.optimizeDeps.include` (only server-side code uses them). Exact specifier or package name. |
|
|
48
|
+
| `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`). |
|
|
49
|
+
| `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, `dyn.v-office.com`). |
|
|
50
|
+
| `listingPages` | `listing-noindex`, `listing-links` | URL paths of pages that list rentals, in addition to the pages the check recognizes by their markup. |
|
|
51
|
+
| `listingClientOnly` | `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. |
|
|
52
|
+
| `consentAllowedHosts` | `consent-gate` | Hosts a `<script src>` or `<iframe src>` may load before consent. The site's own host (`site` in the Astro config) is always allowed. |
|
|
53
|
+
| `wiring` | `wiring` | Markup hooks `{ init, marker, scope: "section" \| "global", file? }` and kept texts `{ file, contains, guard }` (the former `scripts/wiring.json` `hooks`). |
|
|
54
|
+
| `hubFilterOptions` | `v9-hub-filters` | v9: the Website SDK options the Hub filter check needs (`rentalScope`, `customAttributeFilterDefinitions`), as the site passes them to the SDK. |
|
|
55
|
+
| `structureIgnore` | `page-structure` | Rules the site declines: `one-h1`, `heading-skip`, `landmark-main`, `img-alt`, `control-label`, `table-headers`, `heading-ratio`. |
|
|
56
|
+
| `bannedCopy` | `banned-copy` | Wordings recorded customer corrections ban, as `{ "pattern", "why" }` (a regular expression over the page's visible text). |
|
|
57
|
+
| `copyExcludePaths` | the copy checks | URL paths (and below) the copy checks skip, legal pages ported verbatim; `/impressum` also covers `/de/impressum`. |
|
|
58
|
+
| `bannedCopyExcludePaths` | `banned-copy` | URL paths only `banned-copy` skips (an FAQ whose answers port verbatim). |
|
|
59
|
+
| `allowDuplicateSentences` | `duplicate-sentences` | Sentences a page may render twice. |
|
|
60
|
+
| `quoteSources` | `quote-sources` | Files or directories holding the text a `<blockquote>` may quote (content captures, the feed's reviews written by the build). |
|
|
61
|
+
| `factCheckAccepted` | `rental-facts` | Disagreements the customer confirmed, as the finding prints them: `<slug> <kind> prose=<n> feed=<n>`. |
|
|
53
62
|
|
|
54
63
|
## The checks
|
|
55
64
|
|
|
56
|
-
| id
|
|
57
|
-
|
|
|
58
|
-
| `html-comments`
|
|
59
|
-
| `view-source`
|
|
60
|
-
| `donor-terms`
|
|
61
|
-
| `optimize-deps`
|
|
62
|
-
| `sync-once`
|
|
63
|
-
| `consent-gate`
|
|
64
|
-
| `image-formats`
|
|
65
|
-
| `feed-image-formats`
|
|
66
|
-
| `listing-noindex`
|
|
67
|
-
| `listing-links`
|
|
68
|
-
| `sitemap-noindex`
|
|
69
|
-
| `page-heads`
|
|
65
|
+
| id | Severity | What it refuses or reports | How to fix |
|
|
66
|
+
| --------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
67
|
+
| `html-comments` | error | An HTML comment (`<!-- … -->`) in `src/**/*.{astro,tsx,jsx,md,mdx,html}`: Astro passes it into the built page, readable with View Source. | `{/* … */}` in `.astro` and JSX markup, `//` in frontmatter, remove it from Markdown. |
|
|
68
|
+
| `view-source` | error | A developer's note a visitor can read with View Source: an HTML comment in a built page (the frameworks' own markers are allowed), a comment in an inline `<script>`, `<style>` or event handler or in shipped CSS, a line comment in shipped JS, a source map or a reference to one. | Remove the comment; turn source maps off in the build. |
|
|
69
|
+
| `donor-terms` | error | A configured term 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. Skipped without configured terms. | Replace the term; list the template site's terms in `donorTerms`. |
|
|
70
|
+
| `optimize-deps` | warning | A runtime package (`dependencies`) imported from `src/` that is not listed, with the exact specifier, in `vite.optimizeDeps.include`. Vite discovers it mid-session instead and re-bundles every dependency. | Add the specifier to `vite.optimizeDeps.include` in `astro.config`, or to `optimizeDepsIgnore` when only server-side code uses it. |
|
|
71
|
+
| `sync-once` | warning | An inline content loader in `src/content.config.ts` that fetches the PMS without the `CONTENT_SYNC_TOKEN` reuse idiom: `astro check` and `astro build` each run it, twice per build. | Keep the token in the store's meta (`meta.get`) and reuse the entries (`store.keys()`) when it matches. |
|
|
72
|
+
| `consent-gate` | error | A third-party `<script src>` or `<iframe src>` outside the consent kit's `ConsentEmbed` frame, loading before consent; a vendor in `ENABLED_VENDOR_IDS` that is not `approved` in `consent-registry.snapshot.json`. 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`. |
|
|
73
|
+
| `image-formats` | error | A raster image under `public/` without an `.avif` sibling. | Encode the AVIF (or list the file in `imageIgnore`). |
|
|
74
|
+
| `feed-image-formats` | warning | A feed photo from the vOffice image hosts requested as JPEG or PNG in `src`, `srcset` or `poster`; a warning because the photos come from the PMS feed. | Pass feed photos through `webpUrl()`. |
|
|
75
|
+
| `listing-noindex` | error | A page that lists rentals (the search page's `data-prerendered-results` container, the `SearchResults` island, or `listingPages`) that is noindex. Waits while every page is noindex. | Take the page out of the noindex routes. |
|
|
76
|
+
| `listing-links` | warning | A page that lists rentals that carries no links to rentals in its HTML, so a crawler without JavaScript sees an empty list. Runs once some listing has links or the build has more than ten pages; a warning because the links come from the PMS feed. | Render the list server-side, or list the page in `listingClientOnly` with the reason. |
|
|
77
|
+
| `sitemap-noindex` | error | A sitemap entry whose page says noindex or is not in the build; an `llms.txt` link to a page that is not there. Skipped without a sitemap and `llms.txt`. | Make the sitemap filter and the noindex routes agree; fix the link. |
|
|
78
|
+
| `page-heads` | warning | On indexable pages: a title over 60 characters, a description empty or over 160, a title or description another page repeats. A missing one is the build worker's `page-metadata`. | Shorten; give each page its own. |
|
|
79
|
+
| `wiring` | error | A component carrying a configured hook's marker whose initializer nothing calls (`section`: the component itself; `global`: anything in `src/`), through leaves marked `@bound-by-parent <init>`; a kept text gone from its file. Comments are stripped first. Skipped without `wiring`. | Call the initializer, mark the leaf `@bound-by-parent`, or put the kept text back. |
|
|
80
|
+
| `unused-initializers` | warning | An `init*` exported from `src/scripts/*.ts` that nothing calls. Skipped without `src/scripts/`. | Wire the feature, or delete the leftover. |
|
|
81
|
+
| `v9-hub-filters` | warning | v9 only (`CMS_BACKEND=v9` in the build's env or `.env` / `.env.production`, else AI Studio's `PMS_BACKEND=v9`): a Hub filter the site's search needs that the be-on! Hub does not serve, asked through the site's own `website-sdk hub-filters check`; a Hub that cannot be asked. A warning: the outcome is the Hub's data. | Add the entry in the Hub (`website-sdk hub-filters request`), or drop it from the SDK options. |
|
|
82
|
+
| `canonical-link` | error | On the launched site (a production `site`, some indexable page): an indexable page without an absolute `<link rel="canonical">`. | Build it from the Astro `site` and the page path. |
|
|
83
|
+
| `open-graph` | warning | On the launched site: an indexable page without an absolute `og:url` and `og:image`. | Add them, absolute. |
|
|
84
|
+
| `trailing-slash` | warning | On the launched site: `trailingSlash` is not `"never"`. | Set `trailingSlash: "never"`; write internal links without a trailing slash. |
|
|
85
|
+
| `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 committed `HUB_API_KEY` equal to `.env.local`'s. Waits for a production `site` and an indexable page. | Set the production stage or URLs and the customer's production key; untrack `.env.local`. |
|
|
86
|
+
| `page-structure` | warning | One `<h1>`, no skipped heading level, no flood of `<h3>` under few `<h2>`, a `<main>`, `alt` on every image, a label on every control, a caption and scoped `<th>` on every table. | Fix the component where a fault repeats; decline a rule in `structureIgnore`. |
|
|
87
|
+
| `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 first-paint photo from 100 KB up in one size only, a preloaded swap face without a `size-adjust` stand-in. | `import()` on demand; first slide only; width `srcset`; a `local()` stand-in. |
|
|
88
|
+
| `banned-copy` | warning | A `bannedCopy` wording in a page's visible text. Skipped without configured wordings. | Reword. |
|
|
89
|
+
| `duplicate-sentences` | warning | The same sentence rendered twice on one page. Waits while every page is noindex. | Remove one, or list it in `allowDuplicateSentences`. |
|
|
90
|
+
| `quote-sources` | warning | A `<blockquote>` not word for word in `quoteSources`; a configured source that is missing. Skipped without sources. | Quote the source exactly; restore the step that writes the source. |
|
|
91
|
+
| `rental-facts` | warning | On rental pages (the rental blocks' `data-rental-stats` / `data-rental-description` markers): 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. | The customer corrects the PMS; a confirmed one goes into `factCheckAccepted`. |
|
|
70
92
|
|
|
71
93
|
A check that does not apply to the site reports `skipped`; a check that fails itself reports
|
|
72
94
|
`failed` and never blocks.
|
package/dist/astro.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as SiteChecksOptions } from "./options-CANJso9Q.mjs";
|
|
2
2
|
//#region src/astro.d.ts
|
|
3
3
|
/** The part of Astro's resolved config the checks read. A structural subset, so that astro is a
|
|
4
4
|
* devDependency for the compile-time type test only; `__tests__/types.test.ts` proves Astro's
|
|
@@ -8,6 +8,7 @@ export interface SiteChecksAstroConfig {
|
|
|
8
8
|
srcDir: URL;
|
|
9
9
|
publicDir: URL;
|
|
10
10
|
site?: string | undefined;
|
|
11
|
+
trailingSlash?: string | undefined;
|
|
11
12
|
vite: {
|
|
12
13
|
optimizeDeps?: {
|
|
13
14
|
include?: string[] | undefined;
|
package/dist/astro.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as writeSiteChecksReport, d as runSiteChecks, i as summaryLines, l as blockingResults, m as checks, n as refusalMessage, p as loadOptions } from "./report-
|
|
1
|
+
import { a as writeSiteChecksReport, d as runSiteChecks, i as summaryLines, l as blockingResults, m as checks, n as refusalMessage, p as loadOptions } from "./report-xp_FHnYb.mjs";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
//#region src/astro.ts
|
|
4
4
|
/**
|
|
@@ -16,7 +16,8 @@ function siteChecks(options = {}) {
|
|
|
16
16
|
};
|
|
17
17
|
let config = {
|
|
18
18
|
site: void 0,
|
|
19
|
-
optimizeDepsInclude: []
|
|
19
|
+
optimizeDepsInclude: [],
|
|
20
|
+
trailingSlash: void 0
|
|
20
21
|
};
|
|
21
22
|
let resolved;
|
|
22
23
|
return {
|
|
@@ -30,7 +31,8 @@ function siteChecks(options = {}) {
|
|
|
30
31
|
};
|
|
31
32
|
config = {
|
|
32
33
|
site: astro.site,
|
|
33
|
-
optimizeDepsInclude: astro.vite.optimizeDeps?.include ?? []
|
|
34
|
+
optimizeDepsInclude: astro.vite.optimizeDeps?.include ?? [],
|
|
35
|
+
trailingSlash: astro.trailingSlash
|
|
34
36
|
};
|
|
35
37
|
resolved = loadOptions(paths.root, options);
|
|
36
38
|
},
|
package/dist/dist-checks.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as Severity, _ as CheckStatus, a as blockingResults, b as Finding, g as CheckRun, h as CheckResult, l as summarizeBlocking, m as CheckReport, n as MAX_MESSAGE_CHARS, r as MAX_PATH_CHARS, s as SITE_CHECKS_FILE, t as MAX_FINDINGS_PER_CHECK, v as DistCheck, x as Page, y as DistContext } from "./runner-
|
|
1
|
+
import { S as Severity, _ as CheckStatus, a as blockingResults, b as Finding, g as CheckRun, h as CheckResult, l as summarizeBlocking, m as CheckReport, n as MAX_MESSAGE_CHARS, r as MAX_PATH_CHARS, s as SITE_CHECKS_FILE, t as MAX_FINDINGS_PER_CHECK, v as DistCheck, x as Page, y as DistContext } from "./runner-CK4iXk8Z.mjs";
|
|
2
2
|
//#region src/distChecks/index.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* The dist checks: the platform's checks over a build's `dist/`, run by the build worker on every
|
package/dist/dist-checks.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as referencedUrls, c as MAX_PATH_CHARS, g as loadDistContext, h as isSameSiteReference, l as blockingResults, o as MAX_FINDINGS_PER_CHECK, r as summarizeBlocking, s as MAX_MESSAGE_CHARS, t as SITE_CHECKS_FILE, u as runChecks, v as resolveReference, y as xmlText } from "./report-
|
|
1
|
+
import { _ as referencedUrls, c as MAX_PATH_CHARS, g as loadDistContext, h as isSameSiteReference, l as blockingResults, o as MAX_FINDINGS_PER_CHECK, r as summarizeBlocking, s as MAX_MESSAGE_CHARS, t as SITE_CHECKS_FILE, u as runChecks, v as resolveReference, y as xmlText } from "./report-xp_FHnYb.mjs";
|
|
2
2
|
//#region src/distChecks/insecureResources.ts
|
|
3
3
|
/** `<link>` relations the browser fetches as a subresource; canonical,
|
|
4
4
|
* alternate, preconnect and friends are hints or metadata, not loads. */
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as SiteCheck, S as Severity, _ as CheckStatus, a as blockingResults, b as Finding, c as refusalMessage, d as writeSiteChecksReport, f as BuildOutput, g as CheckRun, h as CheckResult, i as RunInput, l as summarizeBlocking, m as CheckReport, n as MAX_MESSAGE_CHARS, o as runSiteChecks, p as Check, r as MAX_PATH_CHARS, s as SITE_CHECKS_FILE, t as MAX_FINDINGS_PER_CHECK, u as summaryLines, v as DistCheck, w as SiteCheckContext, x as Page, y as DistContext } from "./runner-
|
|
1
|
+
import { a as WiringEntry, c as loadOptions, i as SiteChecksOptions, n as CONFIG_FILE, o as WiringHook, r as ResolvedOptions, s as WiringKept, t as BannedCopy } from "./options-CANJso9Q.mjs";
|
|
2
|
+
import { C as SiteCheck, S as Severity, _ as CheckStatus, a as blockingResults, b as Finding, c as refusalMessage, d as writeSiteChecksReport, f as BuildOutput, g as CheckRun, h as CheckResult, i as RunInput, l as summarizeBlocking, m as CheckReport, n as MAX_MESSAGE_CHARS, o as runSiteChecks, p as Check, r as MAX_PATH_CHARS, s as SITE_CHECKS_FILE, t as MAX_FINDINGS_PER_CHECK, u as summaryLines, v as DistCheck, w as SiteCheckContext, x as Page, y as DistContext } from "./runner-CK4iXk8Z.mjs";
|
|
3
3
|
//#region src/checks/index.d.ts
|
|
4
4
|
/** The site checks, in the order the report shows them: the source first, then the built pages.
|
|
5
5
|
* The integration runs these inside the site's own `astro build`; the build worker's checks are
|
|
@@ -8,4 +8,4 @@ import { C as SiteCheck, S as Severity, _ as CheckStatus, a as blockingResults,
|
|
|
8
8
|
* entry. */
|
|
9
9
|
export declare const checks: readonly SiteCheck[];
|
|
10
10
|
//#endregion
|
|
11
|
-
export { type BuildOutput, CONFIG_FILE, type Check, type CheckReport, type CheckResult, type CheckRun, type CheckStatus, type DistCheck, type DistContext, type Finding, MAX_FINDINGS_PER_CHECK, MAX_MESSAGE_CHARS, MAX_PATH_CHARS, type Page, type ResolvedOptions, type RunInput, SITE_CHECKS_FILE, type Severity, type SiteCheck, type SiteCheckContext, type SiteChecksOptions, blockingResults, loadOptions, refusalMessage, runSiteChecks, summarizeBlocking, summaryLines, writeSiteChecksReport };
|
|
11
|
+
export { type BannedCopy, type BuildOutput, CONFIG_FILE, type Check, type CheckReport, type CheckResult, type CheckRun, type CheckStatus, type DistCheck, type DistContext, type Finding, MAX_FINDINGS_PER_CHECK, MAX_MESSAGE_CHARS, MAX_PATH_CHARS, type Page, type ResolvedOptions, type RunInput, SITE_CHECKS_FILE, type Severity, type SiteCheck, type SiteCheckContext, type SiteChecksOptions, type WiringEntry, type WiringHook, type WiringKept, blockingResults, loadOptions, refusalMessage, runSiteChecks, summarizeBlocking, summaryLines, writeSiteChecksReport };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as writeSiteChecksReport, c as MAX_PATH_CHARS, d as runSiteChecks, f as CONFIG_FILE, i as summaryLines, l as blockingResults, m as checks, n as refusalMessage, o as MAX_FINDINGS_PER_CHECK, p as loadOptions, r as summarizeBlocking, s as MAX_MESSAGE_CHARS, t as SITE_CHECKS_FILE } from "./report-
|
|
1
|
+
import { a as writeSiteChecksReport, c as MAX_PATH_CHARS, d as runSiteChecks, f as CONFIG_FILE, i as summaryLines, l as blockingResults, m as checks, n as refusalMessage, o as MAX_FINDINGS_PER_CHECK, p as loadOptions, r as summarizeBlocking, s as MAX_MESSAGE_CHARS, t as SITE_CHECKS_FILE } from "./report-xp_FHnYb.mjs";
|
|
2
2
|
export { CONFIG_FILE, MAX_FINDINGS_PER_CHECK, MAX_MESSAGE_CHARS, MAX_PATH_CHARS, SITE_CHECKS_FILE, blockingResults, checks, loadOptions, refusalMessage, runSiteChecks, summarizeBlocking, summaryLines, writeSiteChecksReport };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
//#region src/options.d.ts
|
|
2
|
+
/** A wording a recorded customer correction bans from the rendered pages. */
|
|
3
|
+
interface BannedCopy {
|
|
4
|
+
/** A regular expression (source), matched against each page's visible text, whitespace
|
|
5
|
+
* collapsed, so a line break cannot hide a match. */
|
|
6
|
+
pattern: string;
|
|
7
|
+
/** The correction behind it, shown with every finding. */
|
|
8
|
+
why: string;
|
|
9
|
+
}
|
|
10
|
+
/** Markup that stays inert until an initializer in `src/scripts/*.ts` binds it. */
|
|
11
|
+
interface WiringHook {
|
|
12
|
+
/** The exported initializer, e.g. `initImageCarousels`. */
|
|
13
|
+
init: string;
|
|
14
|
+
/** The text (a class, a data attribute) that identifies the markup it binds. */
|
|
15
|
+
marker: string;
|
|
16
|
+
/** "section": every component carrying the marker calls the initializer itself (a leaf that
|
|
17
|
+
* ships the markup for its parent opts out with `@bound-by-parent <init>`). "global": one call
|
|
18
|
+
* anywhere in `src/` binds every carrier. */
|
|
19
|
+
scope: "section" | "global";
|
|
20
|
+
/** Optional: a project-relative file that must still carry the marker in code; without it a
|
|
21
|
+
* renamed marker leaves nothing to bind and the call can go unnoticed. */
|
|
22
|
+
file?: string;
|
|
23
|
+
}
|
|
24
|
+
/** A text that must stay in a file: behaviour a site keeps apart from what it was built from. */
|
|
25
|
+
interface WiringKept {
|
|
26
|
+
/** Project-relative path. */
|
|
27
|
+
file: string;
|
|
28
|
+
/** The exact text, in code (a copy left in a comment does not count). */
|
|
29
|
+
contains: string;
|
|
30
|
+
/** Why it must stay, shown when it is gone. */
|
|
31
|
+
guard: string;
|
|
32
|
+
}
|
|
33
|
+
type WiringEntry = WiringHook | WiringKept;
|
|
34
|
+
/** What a site configures: data for the checks, never their severity. The same keys are read from
|
|
35
|
+
* `site-checks.config.json` at the project root and accepted by `siteChecks({ … })`; an option
|
|
36
|
+
* given to the integration wins over the file's key. */
|
|
37
|
+
interface SiteChecksOptions {
|
|
38
|
+
/** Terms that must not ship: the template ("donor") site's brand, people, places, phone, email,
|
|
39
|
+
* domain, asset names. Matched case-insensitively, whitespace collapsed. Empty: the check skips. */
|
|
40
|
+
donorTerms?: string[];
|
|
41
|
+
/** Packages imported from `src/` that may stay out of `vite.optimizeDeps.include`: a package
|
|
42
|
+
* only the server-side code imports, or one Vite handles itself. Exact specifier or package name. */
|
|
43
|
+
optimizeDepsIgnore?: string[];
|
|
44
|
+
/** Raster images under `public/` that ship without an AVIF sibling on purpose, as paths
|
|
45
|
+
* relative to the project root (`public/brand/logo.png`). */
|
|
46
|
+
imageIgnore?: string[];
|
|
47
|
+
/** Regular expressions (sources, case-insensitive) matching a feed photo URL that is still
|
|
48
|
+
* requested as JPEG or PNG. Defaults to the vOffice image hosts. */
|
|
49
|
+
feedImagePatterns?: string[];
|
|
50
|
+
/** URL paths of pages that list rentals, in addition to the pages the check recognizes by their
|
|
51
|
+
* markup (`/angebote`). */
|
|
52
|
+
listingPages?: string[];
|
|
53
|
+
/** Listing pages whose list stays client-only, with the reason: their list is the rentals free
|
|
54
|
+
* in a window, and a build-time list would show booked-out flats. */
|
|
55
|
+
listingClientOnly?: {
|
|
56
|
+
path: string;
|
|
57
|
+
reason: string;
|
|
58
|
+
}[];
|
|
59
|
+
/** Hosts a `<script src>` or `<iframe src>` may load before consent: the site's own CDN, a
|
|
60
|
+
* consent-free host. The site's own host (`site` in the Astro config) is always allowed. */
|
|
61
|
+
consentAllowedHosts?: string[];
|
|
62
|
+
/** Wordings recorded customer corrections ban. Empty: `banned-copy` skips. */
|
|
63
|
+
bannedCopy?: BannedCopy[];
|
|
64
|
+
/** URL paths (and everything below them) the copy checks do not read: legal pages ported
|
|
65
|
+
* verbatim. `/impressum` also covers `/de/impressum`. */
|
|
66
|
+
copyExcludePaths?: string[];
|
|
67
|
+
/** URL paths only `banned-copy` skips: pages whose prose is the site's but whose answers port
|
|
68
|
+
* verbatim (an FAQ). */
|
|
69
|
+
bannedCopyExcludePaths?: string[];
|
|
70
|
+
/** Sentences `duplicate-sentences` accepts twice on one page. */
|
|
71
|
+
allowDuplicateSentences?: string[];
|
|
72
|
+
/** Files or directories (project-relative) holding the text a `<blockquote>` may quote: content
|
|
73
|
+
* captures, the feed's review texts written by the build. Empty: `quote-sources` skips. */
|
|
74
|
+
quoteSources?: string[];
|
|
75
|
+
/** `rental-facts` disagreements the customer confirmed must ship as they are, one per line in
|
|
76
|
+
* the form the finding prints: `<slug> <kind> prose=<n> feed=<n>`. Either side changing makes
|
|
77
|
+
* it a finding again. */
|
|
78
|
+
factCheckAccepted?: string[];
|
|
79
|
+
/** The markup hooks and kept texts `wiring` holds (the former `scripts/wiring.json` `hooks`).
|
|
80
|
+
* Empty: the check skips. */
|
|
81
|
+
wiring?: WiringEntry[];
|
|
82
|
+
/** Rules of `page-structure` this site declines: `one-h1`, `heading-skip`, `landmark-main`,
|
|
83
|
+
* `img-alt`, `control-label`, `table-headers`, `heading-ratio`. */
|
|
84
|
+
structureIgnore?: string[];
|
|
85
|
+
/** v9 only: the Website SDK options the site's `website-sdk hub-filters check` needs
|
|
86
|
+
* (`rentalScope`, `customAttributeFilterDefinitions`), as the site passes them to the SDK. */
|
|
87
|
+
hubFilterOptions?: Record<string, unknown>;
|
|
88
|
+
}
|
|
89
|
+
type ResolvedOptions = Required<SiteChecksOptions>;
|
|
90
|
+
declare const CONFIG_FILE = "site-checks.config.json";
|
|
91
|
+
/** The file's keys with the integration's options on top. A file that cannot be parsed throws:
|
|
92
|
+
* a broken config must not silently disable a check. */
|
|
93
|
+
declare function loadOptions(root: string, overrides?: SiteChecksOptions): ResolvedOptions;
|
|
94
|
+
//#endregion
|
|
95
|
+
export { WiringEntry as a, loadOptions as c, SiteChecksOptions as i, CONFIG_FILE as n, WiringHook as o, ResolvedOptions as r, WiringKept as s, BannedCopy as t };
|