@se-studio/site-check 2.17.0 → 2.20.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/CHANGELOG.md +31 -0
- package/README.md +7 -0
- package/dist/site-type-audit/adapter.d.ts +17 -0
- package/dist/site-type-audit/adapter.d.ts.map +1 -0
- package/dist/site-type-audit/adapter.js +2 -0
- package/dist/site-type-audit/adapter.js.map +1 -0
- package/dist/site-type-audit/checks.d.ts +24 -0
- package/dist/site-type-audit/checks.d.ts.map +1 -0
- package/dist/site-type-audit/checks.js +730 -0
- package/dist/site-type-audit/checks.js.map +1 -0
- package/dist/site-type-audit/cli.d.ts +3 -0
- package/dist/site-type-audit/cli.d.ts.map +1 -0
- package/dist/site-type-audit/cli.js +84 -0
- package/dist/site-type-audit/cli.js.map +1 -0
- package/dist/site-type-audit/config.d.ts +5 -0
- package/dist/site-type-audit/config.d.ts.map +1 -0
- package/dist/site-type-audit/config.js +55 -0
- package/dist/site-type-audit/config.js.map +1 -0
- package/dist/site-type-audit/crawl.d.ts +40 -0
- package/dist/site-type-audit/crawl.d.ts.map +1 -0
- package/dist/site-type-audit/crawl.js +290 -0
- package/dist/site-type-audit/crawl.js.map +1 -0
- package/dist/site-type-audit/dead-links.d.ts +5 -0
- package/dist/site-type-audit/dead-links.d.ts.map +1 -0
- package/dist/site-type-audit/dead-links.js +35 -0
- package/dist/site-type-audit/dead-links.js.map +1 -0
- package/dist/site-type-audit/dom.d.ts +23 -0
- package/dist/site-type-audit/dom.d.ts.map +1 -0
- package/dist/site-type-audit/dom.js +155 -0
- package/dist/site-type-audit/dom.js.map +1 -0
- package/dist/site-type-audit/fetcher.d.ts +20 -0
- package/dist/site-type-audit/fetcher.d.ts.map +1 -0
- package/dist/site-type-audit/fetcher.js +81 -0
- package/dist/site-type-audit/fetcher.js.map +1 -0
- package/dist/site-type-audit/handoff.d.ts +19 -0
- package/dist/site-type-audit/handoff.d.ts.map +1 -0
- package/dist/site-type-audit/handoff.js +168 -0
- package/dist/site-type-audit/handoff.js.map +1 -0
- package/dist/site-type-audit/html-adapter.d.ts +18 -0
- package/dist/site-type-audit/html-adapter.d.ts.map +1 -0
- package/dist/site-type-audit/html-adapter.js +418 -0
- package/dist/site-type-audit/html-adapter.js.map +1 -0
- package/dist/site-type-audit/index.d.ts +15 -0
- package/dist/site-type-audit/index.d.ts.map +1 -0
- package/dist/site-type-audit/index.js +13 -0
- package/dist/site-type-audit/index.js.map +1 -0
- package/dist/site-type-audit/report.d.ts +6 -0
- package/dist/site-type-audit/report.d.ts.map +1 -0
- package/dist/site-type-audit/report.js +132 -0
- package/dist/site-type-audit/report.js.map +1 -0
- package/dist/site-type-audit/roles.d.ts +13 -0
- package/dist/site-type-audit/roles.d.ts.map +1 -0
- package/dist/site-type-audit/roles.js +135 -0
- package/dist/site-type-audit/roles.js.map +1 -0
- package/dist/site-type-audit/runner.d.ts +11 -0
- package/dist/site-type-audit/runner.d.ts.map +1 -0
- package/dist/site-type-audit/runner.js +113 -0
- package/dist/site-type-audit/runner.js.map +1 -0
- package/dist/site-type-audit/score.d.ts +24 -0
- package/dist/site-type-audit/score.d.ts.map +1 -0
- package/dist/site-type-audit/score.js +239 -0
- package/dist/site-type-audit/score.js.map +1 -0
- package/dist/site-type-audit/site-checks.d.ts +19 -0
- package/dist/site-type-audit/site-checks.d.ts.map +1 -0
- package/dist/site-type-audit/site-checks.js +192 -0
- package/dist/site-type-audit/site-checks.js.map +1 -0
- package/dist/site-type-audit/types.d.ts +248 -0
- package/dist/site-type-audit/types.d.ts.map +1 -0
- package/dist/site-type-audit/types.js +20 -0
- package/dist/site-type-audit/types.js.map +1 -0
- package/dist/smoke-test/cms-page-checks.d.ts.map +1 -1
- package/dist/smoke-test/cms-page-checks.js +1 -0
- package/dist/smoke-test/cms-page-checks.js.map +1 -1
- package/dist/smoke-test/config.d.ts.map +1 -1
- package/dist/smoke-test/config.js +106 -0
- package/dist/smoke-test/config.js.map +1 -1
- package/dist/smoke-test/content-assert.d.ts +14 -1
- package/dist/smoke-test/content-assert.d.ts.map +1 -1
- package/dist/smoke-test/content-assert.js +29 -5
- package/dist/smoke-test/content-assert.js.map +1 -1
- package/dist/smoke-test/dead-links.d.ts +58 -0
- package/dist/smoke-test/dead-links.d.ts.map +1 -0
- package/dist/smoke-test/dead-links.js +180 -0
- package/dist/smoke-test/dead-links.js.map +1 -0
- package/dist/smoke-test/environment.d.ts +19 -0
- package/dist/smoke-test/environment.d.ts.map +1 -0
- package/dist/smoke-test/environment.js +55 -0
- package/dist/smoke-test/environment.js.map +1 -0
- package/dist/smoke-test/index.d.ts +7 -2
- package/dist/smoke-test/index.d.ts.map +1 -1
- package/dist/smoke-test/index.js +4 -1
- package/dist/smoke-test/index.js.map +1 -1
- package/dist/smoke-test/runner.d.ts.map +1 -1
- package/dist/smoke-test/runner.js +90 -18
- package/dist/smoke-test/runner.js.map +1 -1
- package/dist/smoke-test/smoke-coverage/classify.d.ts +10 -0
- package/dist/smoke-test/smoke-coverage/classify.d.ts.map +1 -0
- package/dist/smoke-test/smoke-coverage/classify.js +90 -0
- package/dist/smoke-test/smoke-coverage/classify.js.map +1 -0
- package/dist/smoke-test/smoke-coverage/evaluate.d.ts +29 -0
- package/dist/smoke-test/smoke-coverage/evaluate.d.ts.map +1 -0
- package/dist/smoke-test/smoke-coverage/evaluate.js +270 -0
- package/dist/smoke-test/smoke-coverage/evaluate.js.map +1 -0
- package/dist/smoke-test/smoke-coverage/index.d.ts +8 -0
- package/dist/smoke-test/smoke-coverage/index.d.ts.map +1 -0
- package/dist/smoke-test/smoke-coverage/index.js +7 -0
- package/dist/smoke-test/smoke-coverage/index.js.map +1 -0
- package/dist/smoke-test/smoke-coverage/model.d.ts +20 -0
- package/dist/smoke-test/smoke-coverage/model.d.ts.map +1 -0
- package/dist/smoke-test/smoke-coverage/model.js +114 -0
- package/dist/smoke-test/smoke-coverage/model.js.map +1 -0
- package/dist/smoke-test/smoke-coverage/run.d.ts +19 -0
- package/dist/smoke-test/smoke-coverage/run.d.ts.map +1 -0
- package/dist/smoke-test/smoke-coverage/run.js +123 -0
- package/dist/smoke-test/smoke-coverage/run.js.map +1 -0
- package/dist/smoke-test/smoke-coverage/sitemap.d.ts +34 -0
- package/dist/smoke-test/smoke-coverage/sitemap.d.ts.map +1 -0
- package/dist/smoke-test/smoke-coverage/sitemap.js +148 -0
- package/dist/smoke-test/smoke-coverage/sitemap.js.map +1 -0
- package/dist/smoke-test/smoke-coverage/types.d.ts +74 -0
- package/dist/smoke-test/smoke-coverage/types.d.ts.map +1 -0
- package/dist/smoke-test/smoke-coverage/types.js +13 -0
- package/dist/smoke-test/smoke-coverage/types.js.map +1 -0
- package/dist/smoke-test/static.d.ts.map +1 -1
- package/dist/smoke-test/static.js +69 -6
- package/dist/smoke-test/static.js.map +1 -1
- package/dist/smoke-test/types.d.ts +23 -6
- package/dist/smoke-test/types.d.ts.map +1 -1
- package/dist/smoke-test/types.js.map +1 -1
- package/docs/llms.md +1 -0
- package/docs/site-type-audit-checklists.md +200 -0
- package/docs/site-type-audit.md +117 -0
- package/docs/smoke-assertions.md +72 -0
- package/docs/smoke-coverage.md +92 -0
- package/package.json +11 -3
- package/smoke-coverage-dry-run.mjs +61 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 11227f7: Add an opt-in `coverage` block to `smoke.cases.json`. It reads the Contentful content model (read-only) and the site's `sitemap.xml`, reports the type name when a routable type has no smoke case (default mode `warn`, staged adoption `warn` then `enforce`), and can sample one deterministic route per type. Adds `privacy` and `person-index` smoke categories and a read-only `smoke-coverage-dry-run` script. Behaviour change for existing `deadLinks` users: a block without `mode` now defaults to `warn` (set `mode: "error"` to keep failing on dead links), and a `production` environment with a `*.vercel.app` base URL adds a warning. Files without a `coverage` block behave as before.
|
|
8
|
+
- 473cca5: Smoke runner follow-ups, all opt-in and backward compatible: `contentAssert` accepts an array of blocks, `environments` scopes a block to `local`/`preview`/`production` (`SMOKE_TEST_ENVIRONMENT`, inferred otherwise, never `production` from a preview URL), and `allowNon2xx` runs assertions on an expected 404. A top-level `deadLinks` block checks same-origin links on each smoke page (capped, concurrency-limited, reports each dead link with its source page). `runStaticSmokeTest` takes `protectionBypass: true` to send `x-vercel-protection-bypass`. See `docs/smoke-assertions.md`.
|
|
9
|
+
|
|
10
|
+
## 2.19.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- ade58a3: site-type-audit: a 401 or 403 on a hand-off link still passes `site.handoff.resolves`, but the check message, evidence and report now list it as "protected, not verified" instead of a plain pass. 2xx and 3xx are unchanged, and the pass/fail rule is unchanged.
|
|
15
|
+
|
|
16
|
+
## 2.19.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- cc3cb59: site-type-audit: optional `handoff` site config (hosts and/or path pattern) scores a funnel site up to its app or sign-up hand-off (link present, resolves, not a 404 or soft-404, coverage) without auditing the app. The run output now stores the full dead-internal-link list (`deadLinks`: URL, status, every live referrer) and the report renders it in full.
|
|
21
|
+
|
|
22
|
+
## 2.18.1
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- 210a08e: site-type-audit: a site-level `<nav>` counts as the page header when the page has no `<header>` element, so `base.chrome` no longer fails every page of sites that omit the element.
|
|
27
|
+
|
|
28
|
+
## 2.18.0
|
|
29
|
+
|
|
30
|
+
### Minor Changes
|
|
31
|
+
|
|
32
|
+
- b293b8c: Add the site-type audit: a read-only runner (`site-type-audit`) that audits every page of a site (sitemap plus bounded crawl) against its kind, credibility or funnel, with per-role checklists, severity by kind, per-page and site scores, JSON and markdown output. Checks read an input-agnostic `PageModel`; an HTML adapter ships now and `PageModelAdapter` is the seam for a later Figma adapter (not built). New skill `site-type-audit`.
|
|
33
|
+
|
|
3
34
|
## 2.17.0
|
|
4
35
|
|
|
5
36
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -84,6 +84,7 @@ Headers from `-H` override the Vercel bypass header if the same name is used.
|
|
|
84
84
|
| `SITEMAP_PROD_URL` | Public production site base URL (sitemap-validate scripts, smoke case curation). Trailing slash is stripped. |
|
|
85
85
|
| `PRODUCTION_SITE_URL` | Production site base URL for audits and tooling that need a canonical prod origin. Trailing slash is stripped. |
|
|
86
86
|
| `VERCEL_PROTECTION_BYPASS_TOKEN` | Vercel Deployment Protection bypass secret (Vercel → Settings → Deployment Protection). Sent as `x-vercel-protection-bypass`. Aliases: `VERCEL_AUTOMATION_BYPASS_SECRET`, `VERCEL_BYPASS_TOKEN`. |
|
|
87
|
+
| `SMOKE_TEST_ENVIRONMENT` | `local`, `preview` or `production`. Scopes `contentAssert.environments` blocks; see [docs/smoke-assertions.md](./docs/smoke-assertions.md). Inferred when unset (never `production` from a preview URL). |
|
|
87
88
|
| `SMOKE_TEST_REQUIRE_BYPASS` | `smoke-test-live` only. Set to `false` for a site with Deployment Protection switched off: the live smoke then runs without a bypass token (a token, if present, is still sent). Default: a token is required, so a protected deployment fails loudly. |
|
|
88
89
|
|
|
89
90
|
## Production HTML audit (`@se-studio/site-check/production-audit`)
|
|
@@ -181,6 +182,10 @@ Map `routing` from the app’s `constants.ts` / URL rules. Use `runStaticSmokeTe
|
|
|
181
182
|
|
|
182
183
|
Import from `@se-studio/site-check/cms-integrity` for standalone checks: `runArticleLinkIntegrityFromSmokeConfig`, `evaluateArticleLinkIntegrity`, `getArticleLinkIntegrityExitCode`.
|
|
183
184
|
|
|
185
|
+
### Coverage check (`coverage` in `smoke.cases.json`)
|
|
186
|
+
|
|
187
|
+
Optional, opt-in. Compares the cases with the site's Contentful model and sitemap, fails (or samples) when a routable type has no case, and adds the `privacy` and `person-index` categories. Files without a `coverage` block run unchanged. See [docs/smoke-coverage.md](./docs/smoke-coverage.md) for the config, items, dry run (`smoke-coverage-dry-run`) and the customer migration note.
|
|
188
|
+
|
|
184
189
|
### Vercel build cache (`VERCEL_FORCE_NO_BUILD_CACHE`)
|
|
185
190
|
|
|
186
191
|
Not a smoke variable — set on the **Vercel project** when `next build` fails intermittently with webpack `WasmHash` errors (often with stale remote build cache; local `pnpm build` may still pass).
|
|
@@ -250,6 +255,8 @@ Optional per-case HTML checks for release verification (key blocks must render,
|
|
|
250
255
|
}
|
|
251
256
|
```
|
|
252
257
|
|
|
258
|
+
`contentAssert` also accepts an array of blocks, `environments` (run a block only in `local`/`preview`/`production`) and `allowNon2xx` (assert on an expected 404). A top-level `deadLinks` block adds an opt-in dead internal link check per page, and `runStaticSmokeTest` takes `protectionBypass: true` for protected previews. See [docs/smoke-assertions.md](./docs/smoke-assertions.md).
|
|
259
|
+
|
|
253
260
|
### Publish-state check (CDA vs CPA)
|
|
254
261
|
|
|
255
262
|
Before promoting when Contentful entries changed, compare Delivery vs Preview:
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PageModel } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The seam between "where a page comes from" and "what a page needs".
|
|
4
|
+
*
|
|
5
|
+
* Checks (checks.ts) are pure functions of a {@link PageModel}. An adapter turns one kind of input into
|
|
6
|
+
* that model. Today there is one adapter: {@link htmlPageAdapter} (html-adapter.ts).
|
|
7
|
+
*
|
|
8
|
+
* A later phase can run the same checks on Figma frames before build by adding a second adapter that
|
|
9
|
+
* maps a frame to a PageModel (frame name -> role, text nodes -> headings, button-like components -> CTAs,
|
|
10
|
+
* input components -> forms, node y-position vs the first viewport -> `aboveFold`). No check changes
|
|
11
|
+
* are needed. That adapter is deliberately NOT built here.
|
|
12
|
+
*/
|
|
13
|
+
export interface PageModelAdapter<TInput> {
|
|
14
|
+
readonly source: PageModel['source'];
|
|
15
|
+
toPageModel(input: TInput): PageModel;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/site-type-audit/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB,CAAC,MAAM;IACtC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IACrC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/site-type-audit/adapter.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CheckResult, CheckStatus, PageModel, PageRole, Severity, SiteKind } from './types.js';
|
|
2
|
+
export interface CheckOutcome {
|
|
3
|
+
status: Exclude<CheckStatus, 'na'> | 'na';
|
|
4
|
+
message: string;
|
|
5
|
+
evidence?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CheckDef {
|
|
8
|
+
id: string;
|
|
9
|
+
roles: readonly PageRole[] | 'all';
|
|
10
|
+
except?: readonly PageRole[];
|
|
11
|
+
description: string;
|
|
12
|
+
severity: Record<SiteKind, Severity>;
|
|
13
|
+
run(m: PageModel): CheckOutcome;
|
|
14
|
+
}
|
|
15
|
+
export declare const analyticsTrackers: (m: PageModel) => import("./types.js").PageTracker[];
|
|
16
|
+
export declare const consentGated: (m: PageModel) => boolean;
|
|
17
|
+
export declare const CHECKS: CheckDef[];
|
|
18
|
+
export declare function checksForRole(role: PageRole): CheckDef[];
|
|
19
|
+
export declare function runPageChecks(model: PageModel, role: PageRole, kind: SiteKind): CheckResult[];
|
|
20
|
+
export declare function describeRoleChecklists(): {
|
|
21
|
+
role: string;
|
|
22
|
+
checks: CheckDef[];
|
|
23
|
+
}[];
|
|
24
|
+
//# sourceMappingURL=checks.d.ts.map
|
|
@@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