@se-studio/site-check 2.16.4 → 2.19.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.
Files changed (74) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +24 -0
  3. package/check-class-gaps.mjs +284 -0
  4. package/dist/site-type-audit/adapter.d.ts +17 -0
  5. package/dist/site-type-audit/adapter.d.ts.map +1 -0
  6. package/dist/site-type-audit/adapter.js +2 -0
  7. package/dist/site-type-audit/adapter.js.map +1 -0
  8. package/dist/site-type-audit/checks.d.ts +24 -0
  9. package/dist/site-type-audit/checks.d.ts.map +1 -0
  10. package/dist/site-type-audit/checks.js +730 -0
  11. package/dist/site-type-audit/checks.js.map +1 -0
  12. package/dist/site-type-audit/cli.d.ts +3 -0
  13. package/dist/site-type-audit/cli.d.ts.map +1 -0
  14. package/dist/site-type-audit/cli.js +84 -0
  15. package/dist/site-type-audit/cli.js.map +1 -0
  16. package/dist/site-type-audit/config.d.ts +5 -0
  17. package/dist/site-type-audit/config.d.ts.map +1 -0
  18. package/dist/site-type-audit/config.js +55 -0
  19. package/dist/site-type-audit/config.js.map +1 -0
  20. package/dist/site-type-audit/crawl.d.ts +40 -0
  21. package/dist/site-type-audit/crawl.d.ts.map +1 -0
  22. package/dist/site-type-audit/crawl.js +290 -0
  23. package/dist/site-type-audit/crawl.js.map +1 -0
  24. package/dist/site-type-audit/dead-links.d.ts +5 -0
  25. package/dist/site-type-audit/dead-links.d.ts.map +1 -0
  26. package/dist/site-type-audit/dead-links.js +35 -0
  27. package/dist/site-type-audit/dead-links.js.map +1 -0
  28. package/dist/site-type-audit/dom.d.ts +23 -0
  29. package/dist/site-type-audit/dom.d.ts.map +1 -0
  30. package/dist/site-type-audit/dom.js +155 -0
  31. package/dist/site-type-audit/dom.js.map +1 -0
  32. package/dist/site-type-audit/fetcher.d.ts +20 -0
  33. package/dist/site-type-audit/fetcher.d.ts.map +1 -0
  34. package/dist/site-type-audit/fetcher.js +81 -0
  35. package/dist/site-type-audit/fetcher.js.map +1 -0
  36. package/dist/site-type-audit/handoff.d.ts +19 -0
  37. package/dist/site-type-audit/handoff.d.ts.map +1 -0
  38. package/dist/site-type-audit/handoff.js +168 -0
  39. package/dist/site-type-audit/handoff.js.map +1 -0
  40. package/dist/site-type-audit/html-adapter.d.ts +18 -0
  41. package/dist/site-type-audit/html-adapter.d.ts.map +1 -0
  42. package/dist/site-type-audit/html-adapter.js +418 -0
  43. package/dist/site-type-audit/html-adapter.js.map +1 -0
  44. package/dist/site-type-audit/index.d.ts +15 -0
  45. package/dist/site-type-audit/index.d.ts.map +1 -0
  46. package/dist/site-type-audit/index.js +13 -0
  47. package/dist/site-type-audit/index.js.map +1 -0
  48. package/dist/site-type-audit/report.d.ts +6 -0
  49. package/dist/site-type-audit/report.d.ts.map +1 -0
  50. package/dist/site-type-audit/report.js +132 -0
  51. package/dist/site-type-audit/report.js.map +1 -0
  52. package/dist/site-type-audit/roles.d.ts +13 -0
  53. package/dist/site-type-audit/roles.d.ts.map +1 -0
  54. package/dist/site-type-audit/roles.js +135 -0
  55. package/dist/site-type-audit/roles.js.map +1 -0
  56. package/dist/site-type-audit/runner.d.ts +11 -0
  57. package/dist/site-type-audit/runner.d.ts.map +1 -0
  58. package/dist/site-type-audit/runner.js +113 -0
  59. package/dist/site-type-audit/runner.js.map +1 -0
  60. package/dist/site-type-audit/score.d.ts +24 -0
  61. package/dist/site-type-audit/score.d.ts.map +1 -0
  62. package/dist/site-type-audit/score.js +239 -0
  63. package/dist/site-type-audit/score.js.map +1 -0
  64. package/dist/site-type-audit/site-checks.d.ts +19 -0
  65. package/dist/site-type-audit/site-checks.d.ts.map +1 -0
  66. package/dist/site-type-audit/site-checks.js +192 -0
  67. package/dist/site-type-audit/site-checks.js.map +1 -0
  68. package/dist/site-type-audit/types.d.ts +248 -0
  69. package/dist/site-type-audit/types.d.ts.map +1 -0
  70. package/dist/site-type-audit/types.js +20 -0
  71. package/dist/site-type-audit/types.js.map +1 -0
  72. package/docs/site-type-audit-checklists.md +200 -0
  73. package/docs/site-type-audit.md +117 -0
  74. package/package.json +11 -3
@@ -0,0 +1,200 @@
1
+ # Site-type audit: checklists per role
2
+
3
+ Generated from `src/site-type-audit/checks.ts` and `site-checks.ts` (`site-type-audit --print-checklists`). Do not edit by hand.
4
+
5
+ Severity weights: critical 10, major 5, minor 2, info 0 (reported, not scored). `-` means the check is skipped for that site kind.
6
+
7
+ ## every page
8
+
9
+ | Check | What it asks | Credibility | Funnel |
10
+ |---|---|---|---|
11
+ | `base.status-ok` | Page loads with HTTP 200 after redirects. | critical | critical |
12
+ | `base.rendered-content` | The delivered HTML contains real content (not an empty shell filled in by JavaScript). | major | major |
13
+ | `base.title` | Has a <title> of 10-70 characters. | minor | minor |
14
+ | `base.h1` | Exactly one <h1>. | minor | minor |
15
+ | `base.meta-description` | Has a meta description. | minor | minor |
16
+ | `base.indexable` | Page is not set to noindex. | major | major |
17
+ | `base.chrome` | Has a header with navigation and a footer. | major | minor |
18
+ | `base.alt-text` | At most 10% of images lack alt text. | minor | minor |
19
+
20
+ ## home
21
+
22
+ | Check | What it asks | Credibility | Funnel |
23
+ |---|---|---|---|
24
+ | `home.value-prop` | Has an h1 and enough copy to say what the organisation does. | major | major |
25
+ | `home.cta-above-fold` | A clear primary call to action sits above the fold. | minor | critical |
26
+ | `home.cta-repeated` | The call to action is repeated further down the page or in the footer. | - | major |
27
+ | `home.contact-path` | A route to contact is visible (contact link, email, phone or form). | major | major |
28
+ | `home.proof` | Shows proof behind its claims: customers/partners, testimonials, numbers, certifications or case studies. | major | major |
29
+ | `home.trust-near-cta` | Trust wording (customers, rating, security, guarantee) sits near the above-the-fold call to action. | - | major |
30
+ | `home.who-we-are` | Links to an about/company/team page. | major | minor |
31
+ | `home.legal-links` | Footer links to the privacy policy. | minor | major |
32
+ | `home.analytics` | Analytics or tag manager is present. | minor | major |
33
+ | `home.org-schema` | Organization (or WebSite) structured data present. | minor | info |
34
+
35
+ ## privacy
36
+
37
+ | Check | What it asks | Credibility | Funnel |
38
+ |---|---|---|---|
39
+ | `privacy.substance` | Privacy policy has real content (300+ words). | major | major |
40
+ | `privacy.contact-detail` | Says how to contact the organisation about data. | minor | minor |
41
+
42
+ ## terms
43
+
44
+ | Check | What it asks | Credibility | Funnel |
45
+ |---|---|---|---|
46
+ | `terms.substance` | Terms/cookies page has real content (150+ words). | minor | minor |
47
+
48
+ ## contact
49
+
50
+ | Check | What it asks | Credibility | Funnel |
51
+ |---|---|---|---|
52
+ | `contact.method` | Gives at least one way to reach the organisation (email, phone, address, form). | critical | major |
53
+ | `contact.org-details` | Shows organisation details: an address, or both phone and email. | major | minor |
54
+ | `contact.form-works` | Contact form (if any) has labelled fields, a submit control and a real handler. | major | critical |
55
+ | `contact.consent-near-form` | Privacy/consent wording sits next to the form. | minor | major |
56
+ | `contact.analytics` | Analytics present on the contact step. | info | major |
57
+
58
+ ## not-found
59
+
60
+ | Check | What it asks | Credibility | Funnel |
61
+ |---|---|---|---|
62
+ | `notfound.status-404` | An unknown URL returns HTTP 404 (not a soft 404 with status 200). | major | major |
63
+ | `notfound.recovery` | The 404 page offers a way back (home, contact or search link). | minor | major |
64
+ | `notfound.branded` | The 404 page keeps the site header and footer and says what happened. | minor | minor |
65
+
66
+ ## about
67
+
68
+ | Check | What it asks | Credibility | Funnel |
69
+ |---|---|---|---|
70
+ | `about.substance` | About page has real content (150+ words) with structure (2+ sub-headings). | major | minor |
71
+ | `about.people-or-history` | Names people or links to the team. | major | minor |
72
+ | `about.next-step` | Points to a next step (contact or enquiry). | minor | minor |
73
+
74
+ ## team
75
+
76
+ | Check | What it asks | Credibility | Funnel |
77
+ |---|---|---|---|
78
+ | `team.members` | Lists three or more people. | major | minor |
79
+ | `team.roles` | Gives each person a role or title. | major | minor |
80
+ | `team.photos` | Has photos of the team (3+ images). | minor | minor |
81
+
82
+ ## person
83
+
84
+ | Check | What it asks | Credibility | Funnel |
85
+ |---|---|---|---|
86
+ | `person.name` | Has an h1 with the person’s name. | major | minor |
87
+ | `person.bio` | Has a bio (60+ words). | major | minor |
88
+ | `person.role-and-photo` | Shows a role/title and a photo. | minor | minor |
89
+
90
+ ## news
91
+
92
+ | Check | What it asks | Credibility | Funnel |
93
+ |---|---|---|---|
94
+ | `news.items` | Lists three or more items. | major | minor |
95
+ | `news.dates` | Items are dated. | minor | minor |
96
+
97
+ ## post
98
+
99
+ | Check | What it asks | Credibility | Funnel |
100
+ |---|---|---|---|
101
+ | `post.substance` | Post has real content (200+ words). | major | minor |
102
+ | `post.date` | Post is dated. | major | minor |
103
+ | `post.author` | Post names an author. | major | minor |
104
+ | `post.schema` | Article structured data present. | minor | minor |
105
+ | `post.next-step` | Leads somewhere: a call to action or related links. | minor | major |
106
+
107
+ ## landing
108
+
109
+ | Check | What it asks | Credibility | Funnel |
110
+ |---|---|---|---|
111
+ | `landing.value-prop` | Has one h1 and supporting copy. | minor | major |
112
+ | `landing.cta-above-fold` | A clear primary call to action sits above the fold. | minor | critical |
113
+ | `landing.cta-repeated` | The call to action is repeated lower on the page. | - | major |
114
+ | `landing.has-destination` | Has a form, or a call to action that points at one. | - | critical |
115
+ | `landing.few-exits` | Few exits: 12 or fewer header/footer links. | - | major |
116
+ | `landing.trust-near-cta` | Trust signals sit near the call to action. | - | major |
117
+ | `landing.analytics` | Analytics present on the landing page. | - | major |
118
+
119
+ ## product
120
+
121
+ | Check | What it asks | Credibility | Funnel |
122
+ |---|---|---|---|
123
+ | `product.cta-above-fold` | A primary call to action sits above the fold. | minor | critical |
124
+ | `product.features` | Explains the offer: 3+ features/benefits. | minor | major |
125
+ | `product.price-signal` | Shows a price or links to pricing/plans. | - | major |
126
+ | `product.trust-near-cta` | Trust signals sit near the call to action. | - | major |
127
+ | `product.analytics` | Analytics present. | - | major |
128
+
129
+ ## pricing
130
+
131
+ | Check | What it asks | Credibility | Funnel |
132
+ |---|---|---|---|
133
+ | `pricing.prices` | States prices, or says how to get one. | - | major |
134
+ | `pricing.plan-ctas` | Each plan/option has a call to action. | - | critical |
135
+ | `pricing.comparison` | Presents two or more options to compare. | - | minor |
136
+ | `pricing.faq` | Answers objections (FAQ). | - | minor |
137
+ | `pricing.analytics` | Analytics present. | - | major |
138
+
139
+ ## location
140
+
141
+ | Check | What it asks | Credibility | Funnel |
142
+ |---|---|---|---|
143
+ | `location.nap` | Shows address and/or phone. | minor | major |
144
+ | `location.cta` | Has a call to action (book, contact, directions). | minor | critical |
145
+ | `location.schema` | LocalBusiness/Place structured data present. | minor | minor |
146
+
147
+ ## form
148
+
149
+ | Check | What it asks | Credibility | Funnel |
150
+ |---|---|---|---|
151
+ | `form.exists` | The page has a working-looking form (2+ visible fields) or a hosted form embed. | minor | critical |
152
+ | `form.labels` | Every visible field has a label. | minor | major |
153
+ | `form.submit` | The form has a submit control. | minor | critical |
154
+ | `form.handler` | The form is wired to a handler (not mailto:/empty GET). Submission itself is never exercised. | minor | major |
155
+ | `form.length` | Short form: 8 or fewer visible fields. | - | minor |
156
+ | `form.consent` | Privacy/consent wording sits next to the form. | minor | major |
157
+ | `form.trust-near` | Trust signals sit near the form. | - | minor |
158
+ | `form.analytics` | Analytics present on the form step. | - | major |
159
+
160
+ ## thank-you
161
+
162
+ | Check | What it asks | Credibility | Funnel |
163
+ |---|---|---|---|
164
+ | `thankyou.confirmation` | Confirms what happened and what comes next. | minor | major |
165
+ | `thankyou.next-step` | Offers a next step (link or call to action). | minor | major |
166
+ | `thankyou.tracking` | Analytics present so the conversion can be counted. | minor | critical |
167
+ | `thankyou.noindex` | Thank-you page is noindex (keeps conversions honest). | - | minor |
168
+
169
+ ## Site level
170
+
171
+ | Check | What it asks | Credibility | Funnel |
172
+ |---|---|---|---|
173
+ | `site.role.privacy` | A privacy page exists. | major | major |
174
+ | `site.role.terms` | A terms or cookies page exists. | minor | minor |
175
+ | `site.role.contact` | A contact page exists. | critical | major |
176
+ | `site.role.about` | An about page exists. | major | info |
177
+ | `site.role.team` | A team or person page exists. | major | minor |
178
+ | `site.role.news` | A news/blog index or post exists. | minor | info |
179
+ | `site.role.offer` | A landing, product/plan or pricing page exists. | - | major |
180
+ | `site.role.pricing` | A pricing page exists. | - | minor |
181
+ | `site.role.thank-you` | A thank-you / next-step page exists (found by URL; a read-only crawl cannot submit a form to reach one). | - | major |
182
+ | `site.funnel.has-form` | Some page carries a form or hosted form embed. | - | critical |
183
+ | `site.funnel.tracking-coverage` | Every conversion-step page has analytics. | - | major |
184
+ | `site.broken-links` | No audited page links to a URL that failed to load (critical for a funnel when it is behind a CTA). | major | major |
185
+ | `site.handoff.present` | Home links to the app or sign-up hand-off (only for a site with a `handoff` config). | critical | critical |
186
+ | `site.handoff.resolves` | Each distinct hand-off link (up to 4) answers GET with a status below 400, or a sign-in wall (401/403, listed as protected, not verified), and is not a 404 or soft-404 page. | critical | critical |
187
+ | `site.handoff.coverage` | Half or more of the home, landing, product, pricing and location pages link to the hand-off. | minor | minor |
188
+
189
+ ## Overlay: `enquiry-path` (light funnel layer for a credibility site)
190
+
191
+ Reported separately; not part of the credibility score.
192
+
193
+ | Check | What it asks | Severity |
194
+ |---|---|---|
195
+ | `enquiry.home-cta` | Home has an enquiry call to action in the header or above the fold. | major |
196
+ | `enquiry.contact-route` | Contact page offers a form, embed or email. | major |
197
+ | `enquiry.contact-linked-sitewide` | 90%+ of pages link to contact from header/nav/footer. | minor |
198
+ | `enquiry.contact-tracked` | Analytics on the contact page. | minor |
199
+
200
+ Score: page score = 100 x (1 - failed weight / scored weight). Site score = 75% weighted page average + 25% site-level checks, capped at 69 while any critical check fails.
@@ -0,0 +1,117 @@
1
+ # Site-type audit
2
+
3
+ Audits **every page** of a site (sitemap plus a bounded crawl of internal links) against what that kind of site is for, and rolls the result up to a per-page result and a site score. Read-only: it only issues `GET` requests, submits no forms, writes nothing and fixes nothing.
4
+
5
+ Two site kinds:
6
+
7
+ | Kind | The site exists to | Needs |
8
+ |---|---|---|
9
+ | `credibility` | prove the company is real and has substance | team, customers/partners, proof behind claims, clear organisation, contact details |
10
+ | `funnel` | bring customers in | a clear call to action above the fold and repeated, forms that work, a thank-you / next step, trust signals near the call to action, tracking on every conversion step, landing pages with few exits |
11
+
12
+ **Severity depends on kind.** A funnel site with no call to action is `critical`; a credibility site with none is `minor`. A team page missing is `major` on a credibility site and `minor` on a funnel. Every check carries a severity for each kind (`-` = skipped for that kind). The full per-role checklist, generated from the code, is [site-type-audit-checklists.md](./site-type-audit-checklists.md).
13
+
14
+ ## Running it
15
+
16
+ The runner ships in `@se-studio/site-check` (bin `site-type-audit`). From a repo checkout (no publish needed):
17
+
18
+ ```bash
19
+ pnpm install --frozen-lockfile
20
+ pnpm --filter @se-studio/site-check build
21
+ node packages/site-check/dist/site-type-audit/cli.js \
22
+ --config <file-or-dir-of-site-configs> --out <output-dir> \
23
+ [--site key1,key2] [--max-pages 150] [--concurrency 2] [--delay-ms 300]
24
+ node packages/site-check/dist/site-type-audit/cli.js --print-checklists # regenerate the checklist doc
25
+ ```
26
+
27
+ Output per site: `<out>/<key>.json` (machine-readable, `schemaVersion: 1`), `<out>/<key>.md` (short report), plus `<out>/index.json` (one line per site).
28
+
29
+ Politeness: concurrency 2 (max 4), a default of 300 ms between requests across the run (floor 100 ms), a page cap per site (default 150, `capped: true` in the output and the report when it bites), `robots.txt` honoured (`User-agent: *` rules), one retry on 429/503 with `Retry-After` of 10 s or less. The cap samples every site section round-robin so a 600-post blog cannot crowd out `/about` and `/contact`. The fetcher (`fetcher.ts`) exposes only `get()`; a test asserts every request is a GET. The unknown-URL probe for the 404 page is a plain GET of a path that should not exist.
30
+
31
+ ## Site configs (live outside core)
32
+
33
+ Core contains no customer names. Each site has one JSON file kept outside this repo (a worker config folder, or the site repo). Schema (`SiteConfig` in `types.ts`):
34
+
35
+ ```jsonc
36
+ {
37
+ "key": "example", // lowercase, dashes
38
+ "displayName": "Example",
39
+ "baseUrl": "https://www.example.test", // production URL (the CMS Edit tenant registry's productionSiteUrl)
40
+ "kind": "funnel", // or "credibility"
41
+ "overlays": ["enquiry-path"], // optional: light funnel layer on a credibility site, reported separately
42
+ "handoff": { "hosts": ["app.example.test"], "pathPattern": "^/signup(/|$)", "maxProbes": 4 }, // optional: where the site hands over to its app or sign-up (hosts and/or path regex)
43
+ "roleMap": [ // first match wins, before the built-in rules
44
+ { "role": "pricing", "urlPattern": "^/plans(/|$)" }, // regex on the lowercased path
45
+ { "role": "post", "schemaType": "Article|BlogPosting" }, // JSON-LD @type
46
+ { "role": "form", "minFormFields": 3 }, // page has a form with N+ visible fields
47
+ { "role": "landing", "titlePattern": "^Offer:" } // also: ogType
48
+ ],
49
+ "expectedRoles": { "add": ["location"], "remove": ["terms"] },
50
+ "seedPaths": ["/start"],
51
+ "excludePatterns": ["^/account"],
52
+ "maxPages": 150,
53
+ "notes": "why this classification"
54
+ }
55
+ ```
56
+
57
+ ## Page roles
58
+
59
+ Every site: `home`, `privacy`, `terms` (terms or cookies), `contact`, `not-found`. Credibility pages: `about`, `team`, `person`, `news` (index), `post`. Funnel pages: `landing`, `product` (product or plan), `pricing`, `location`, `form`, `thank-you`. Anything else is `other` and gets only the every-page checks.
60
+
61
+ Role is decided in order: home by path; the config `roleMap`; built-in path patterns (`/privacy*`, `/team/<name>`, `/blog/<slug>`, ...; a `xx-YY` locale prefix is stripped first); structured data (`Article`, `Product`, `LocalBusiness`, ...); a form in the page content. The 404 page is the probe URL.
62
+
63
+ ## Scoring
64
+
65
+ - Check weights: critical 10, major 5, minor 2, info 0 (reported, never scored). `unverified` (cannot be decided read-only or statically) and `na` are never scored.
66
+ - Page score = 100 x (1 - failed weight / scored weight).
67
+ - Site score = 75% weighted page average (home, contact and the kind's key roles count 2-3x) + 25% site-level checks (is there a contact page, a privacy page, a form, ... ; broken internal links; analytics coverage on conversion steps). **Capped at 69 while any critical check fails.**
68
+ - Findings are grouped by check, ordered critical first then by the share of pages affected.
69
+ - A site with a `handoff` config is scored up to the hand-off into its app or sign-up, never beyond it: `site.handoff.present` (home links to it) and `site.handoff.resolves` (each distinct link, up to `maxProbes`, answers GET below 400 or with a sign-in wall, and is not a 404 or soft-404 page; a 401 or 403 still passes but is listed in the report as "protected, not verified", never as a plain pass) are critical, `site.handoff.coverage` is minor. A verified hand-off settles `site.funnel.has-form` when there is no on-site form. The off-site app is fetched only to check the link; it is not audited.
70
+ - The run output carries `deadLinks`: every dead internal link target with its status and every live page that links to it (the report renders the full table). The check message still shows three examples.
71
+ - The `enquiry-path` overlay (a credibility site with a light funnel layer) is reported in its own section and does not change the credibility score.
72
+ - Classification check: heuristic funnel-vs-credibility signals (CTA share above the fold, funnel page roles, forms, event hooks vs. credibility roles, proof, long-form content). Reported as `suggestedKind` and `mismatch`; never applied.
73
+
74
+ ## What it cannot see (read-only limits)
75
+
76
+ - **Thank-you pages** are usually reachable only after a form post. They are found by URL when linked or in the sitemap; otherwise `site.role.thank-you` is `unverified`, not failed.
77
+ - **Form submission** is never exercised. `form.handler` flags `mailto:` actions and GET-submitted email fields; a form with no `action` is `unverified` (JS-handled).
78
+ - **Hosted form embeds** (HubSpot, Typeform, Calendly, ...) count as a form but are not inspected.
79
+ - **Tracking** is detected from tags in the delivered HTML (GTM, GA4, HubSpot, Segment, Meta, LinkedIn, ...) plus counts of `data-track` / `dataLayer.push` hooks. Whether a conversion event actually fires needs a browser and consent state.
80
+ - **Above the fold** is approximated as the first ~1800 visible characters in document order (`ABOVE_FOLD_CHARS`). **Trust near the CTA** is trust wording within ~900 characters of an above-the-fold CTA. Both are heuristics for HTML; a design adapter has real geometry.
81
+ - Client-rendered pages (empty HTML shell) will read as thin. The audit says so rather than guessing.
82
+
83
+ ## Design: input-agnostic checks and the Figma seam
84
+
85
+ ```
86
+ input (HTML page | Figma frame | ...)
87
+ │
88
+ ▼ PageModelAdapter<TInput>.toPageModel() adapter.ts <- the seam
89
+ PageModel (sections, headings, CTAs, forms, links, trackers, evidence, ...) types.ts
90
+ │
91
+ ▼ role + checks (pure functions of PageModel, severity by kind) roles.ts, checks.ts
92
+ CheckResult[] -> page score -> site roll-up -> JSON + markdown score.ts, runner.ts, report.ts
93
+ ```
94
+
95
+ - Checks never see HTML. They read only `PageModel`. Adding a check, or changing a severity, needs no adapter change.
96
+ - Today there is one adapter: `HtmlPageAdapter` (`html-adapter.ts`, tolerant tree builder in `dom.ts`, zero dependencies). It is the only code that knows about tags, classes and `<script>` bodies.
97
+ - The crawler (`crawl.ts`), fetcher and robots/sitemap handling belong to the HTML side. They produce `HtmlPageInput`s; a Figma run would skip them.
98
+
99
+ **Later phase: the same checks on Figma frames before build.** Not built. What the adapter has to do:
100
+
101
+ | PageModel field | From a Figma frame |
102
+ |---|---|
103
+ | role | frame name or page convention mapped through the same `roleMap` idea (name pattern -> role) |
104
+ | `headings` (level, text, `aboveFold`) | text nodes by text style (H1..H6 styles); `aboveFold` from the node's y-position against the first viewport height of the frame |
105
+ | `ctas` (label, `strength`, `aboveFold`, `conversion`) | button/link components (by component name or variant); primary variant -> `primary`; destination from prototype link or a naming convention |
106
+ | `forms` (fields, `labelled`, `hasSubmit`, `consentNear`) | input components and their label text nodes; a submit button component inside the same group |
107
+ | `links`, `exitLinks` | link components and nav/footer component instances, region from the component's parent frame name |
108
+ | `trackers`, `eventHooks` | not in a design: set empty and mark tracker checks `unverified` (add a `PageModel.meta.designOnly` flag for the checks to read) |
109
+ | `evidence`, `trustNearCta` | text/image content by the same keyword rules; logo-strip components for `logoImages`; distance in design units for "near" |
110
+ | `text`, `wordCount`, `mainText` | concatenated text nodes (copy may be placeholder; word-count checks should be skipped or relaxed for placeholder text) |
111
+ | `landmarks` | header/nav/footer component instances |
112
+
113
+ Open points for that phase: placeholder copy (substance checks), no HTTP status or `<title>` (status/title/meta checks become `na`), and a stable way to declare a frame's role. All three are adapter or `roleMap` concerns, not check changes. `PageModel.source` already records `'html' | 'figma'` so checks and reports can tell them apart.
114
+
115
+ ## Files
116
+
117
+ `packages/site-check/src/site-type-audit/`: `types.ts` (PageModel, config, results), `adapter.ts` (the seam), `dom.ts` + `html-adapter.ts` (HTML adapter), `roles.ts`, `checks.ts` (per-page checks), `site-checks.ts` (site-level checks), `score.ts` (roll-up, findings, classification signals, overlay), `fetcher.ts` (GET only), `crawl.ts` (robots, sitemap, bounded crawl, 404 probe), `runner.ts`, `report.ts`, `config.ts`, `cli.ts`. Tests: `scripts/site-type-audit.test.mjs`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/site-check",
3
- "version": "2.16.4",
3
+ "version": "2.19.1",
4
4
  "description": "Validate SE marketing sites (sitemap, llms.txt) and download markdown files preserving structure",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,6 +44,11 @@
44
44
  "import": "./dist/publish-state/index.js",
45
45
  "require": "./dist/publish-state/index.js",
46
46
  "default": "./dist/publish-state/index.js"
47
+ },
48
+ "./site-type-audit": {
49
+ "types": "./dist/site-type-audit/index.d.ts",
50
+ "import": "./dist/site-type-audit/index.js",
51
+ "default": "./dist/site-type-audit/index.js"
47
52
  }
48
53
  },
49
54
  "bin": {
@@ -59,7 +64,9 @@
59
64
  "check-no-context-workarounds": "./check-no-context-workarounds.mjs",
60
65
  "check-publish-state": "./check-publish-state.mjs",
61
66
  "check-cms-driven": "./check-cms-driven.mjs",
62
- "check-comments": "./check-comments.mjs"
67
+ "check-comments": "./check-comments.mjs",
68
+ "check-class-gaps": "./check-class-gaps.mjs",
69
+ "site-type-audit": "./dist/site-type-audit/cli.js"
63
70
  },
64
71
  "files": [
65
72
  "dist",
@@ -79,6 +86,7 @@
79
86
  "check-publish-state.mjs",
80
87
  "check-cms-driven.mjs",
81
88
  "check-comments.mjs",
89
+ "check-class-gaps.mjs",
82
90
  "cms-driven-baseline.mjs",
83
91
  "screaming-frog"
84
92
  ],
@@ -112,6 +120,6 @@
112
120
  "type-check": "tsc --noEmit",
113
121
  "lint": "biome lint .",
114
122
  "clean": "rm -rf dist .turbo *.tsbuildinfo",
115
- "test": "pnpm build && node --test scripts/screaming-frog-audit.test.mjs scripts/screaming-frog-config.test.mjs scripts/production-audit.test.mjs scripts/discovery.test.mjs scripts/smoke-test.test.mjs scripts/analytics-context-bundle.test.mjs scripts/check-no-context-workarounds.test.mjs scripts/check-cms-driven.test.mjs scripts/check-comments.test.mjs scripts/revalidation-matrix.test.mjs scripts/develop-sites-timing.test.mjs scripts/markdown-accuracy-audit.test.mjs scripts/publish-state.test.mjs"
123
+ "test": "pnpm build && node --test scripts/screaming-frog-audit.test.mjs scripts/screaming-frog-config.test.mjs scripts/production-audit.test.mjs scripts/discovery.test.mjs scripts/smoke-test.test.mjs scripts/analytics-context-bundle.test.mjs scripts/check-no-context-workarounds.test.mjs scripts/check-cms-driven.test.mjs scripts/check-comments.test.mjs scripts/check-class-gaps.test.mjs scripts/revalidation-matrix.test.mjs scripts/develop-sites-timing.test.mjs scripts/markdown-accuracy-audit.test.mjs scripts/publish-state.test.mjs scripts/site-type-audit.test.mjs"
116
124
  }
117
125
  }