Applies the owner's Lighthouse targets

Three pages no longer need an exception and the homepage target rises to its
measured score, so the gain cannot slip away unnoticed. Also adds the third
unit's code summary and updates the shared docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-01 20:07:24 +01:00
co-authored by Claude Opus 5.5
parent 498be43020
commit b6d5a85e41
12 changed files with 181 additions and 44 deletions
@@ -123,7 +123,7 @@ Text alternative: client.tsx starts Sentry and hydrates the prerendered page (pr
### config/ (build-time, Node)
- **Purpose**: Server configuration as code
- **Responsibilities**: `securityHeaders.ts` (CSP + headers for dev/preview/prod), `serverConfig.ts` (generates `deploy/iis/web.config` and nginx confs; a test checks they are in sync), sitemap plugin, test seed; prerendering adds `pageFiles.ts`, `inlineScripts.ts`, `externalizeInlineScripts.ts` (post-build step: moves inline scripts to `/assets/inline-<hash>.js` so the CSP stays) and `previewServer.ts` (serves `dist/client` with the real server rules, 404 for unknown paths)
- **Responsibilities**: `securityHeaders.ts` (CSP + headers for dev/preview/prod), `serverConfig.ts` (generates `deploy/iis/web.config` and nginx confs; a test checks they are in sync), sitemap plugin, test seed; prerendering adds `pageFiles.ts`, `inlineScripts.ts`, `externalizeInlineScripts.ts` (post-build step: moves inline scripts to `/assets/inline-<hash>.js` so the CSP stays) and `previewServer.ts` (serves `dist/client` with the real server rules, 404 for unknown paths; unit 3 of prerendering: also the 301 redirects of `canonicalUrls.ts` and the opt-in `--audit-route`, which serves the 404 page with 200 at `/__audit/404` for Lighthouse only); unit 3 adds `canonicalUrls.ts` (one page list for the URL contract) and `compressibleTypes.ts` (one type list for gzip and the IIS MIME pins)
- **Type**: Infrastructure-as-code (small)
### theme.ts / recipes/
@@ -159,6 +159,6 @@ Text alternative: a visitor navigates, the router renders the root layout (AppSh
## Infrastructure Components
- **IaC**: None beyond generated web server configs in `web/deploy/`
- **Deployment Model**: Static prerendered build (prerendering: `dist/client` holds one HTML file per page plus `404.html`; `dist/server` is not deployed; server rules still to be changed in unit 3 of prerendering). Test: scp to nginx on a Raspberry Pi (auto on push to master). Production: FTPS to an IIS webhost (manual, `release/*` only, after Lighthouse)
- **Deployment Model**: Static prerendered build (prerendering: `dist/client` holds one HTML file per page plus `404.html`; `dist/server` is not deployed; unit 3 of prerendering: one URL contract on nginx, IIS and the preview server: `/x` serves `x.html` with 200, variants of a known page get one 301 to the canonical path with the query kept, unknown URLs and `/404`, `/404.html` give a real 404; the generated nginx block has its own gzip configuration; production upload in three passes (assets, then all HTML and `web.config`, then deletion of stale files, `deploy/upload-production.sh`) after `deploy/check-artifact.sh`; `deploy/verify-deployment.sh` checks the result after a deploy; the IIS rules are generated as text and are unverified until a host exists). Test: scp to nginx on a Raspberry Pi (auto on push to master). Production: FTPS to an IIS webhost (manual, `release/*` only, after Lighthouse)
- **Security headers**: Strict CSP — `script-src 'self'` + Umami, `connect-src 'self'` + Umami + Sentry, **`form-action 'self'`**, `frame-ancestors 'none'`. Any third-party form or script endpoint must be added here (and regenerated into the server configs)
- **Networking**: N/A