Skip to content

feat: CSS per live stylesheet in head order, media originals on resize hosts, copy-assets and link-exceptions scripts, reconcile and review fixes - #8

Merged
ethanplusai merged 15 commits into
mainfrom
feat/f13-css-media-assets
Oct 23, 2026
Merged

ethanplusai merged 15 commits into
mainfrom
feat/f13-css-media-assets

Conversation

@ethanplusai

@ethanplusai ethanplusai commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

What

Findings from the second sxsw.com run and the harvard.edu run (WordPress VIP block theme; WordPress multisite).

CSS (convert-site, parity-gates)

  • css-prune now writes each linked stylesheet, pruned by its own coverage, to public/ at its live path, and each head <style> block to src/styles/inline/; every page's head CSS list is recorded in live order and Base.astro prints it, so the cascade equals live. Both sxsw runs and the harvard run had fixed the merged-site.css cascade breakage by hand this way. --single-sheet keeps the old merged output for simple classic themes.
  • media attributes kept and print sheets never coverage-pruned; identical sheets under several paths (multisite) pruned separately; unparsable sheets kept byte for byte and listed; same pathname under different queries handled; sheets only an @import reaches are written; http/non-www links to the site's own sheets served from public/.
  • baseline/css.json lists the captured stylesheets and the routes gate accepts them at their live paths (no --allow-extra needed).

Media (capture-site)

  • On query-string resize hosts (WordPress VIP, Photon) the capture downloads the bare path as the original and lists each ?w=/?resize= variant; a resized stand-in is used only when the original answers 4xx/5xx and is marked resized through the baseline and the media gate. Before, a ?w=1024 copy could be recorded as the 3 MB original, and the Blob upload would have shipped it.

Scripts the docs promised (convert-site)

  • copy-assets.mjs (npm run assets:copy): scripts of every kind, fonts, root icons, the web manifest, and media outside the plan prefix to public/ at live paths; VIP /_static/??a,b concat URLs to /_static/concat/<sha1>.js; refuses sources outside the capture; skips excluded prefixes.
  • link-exceptions.mjs (npm run links:exceptions): one link exception per WordPress API head link and per link already broken on live, no duplicates on rerun.

Review and launch

  • prelaunch-reconcile: a pre-launch check cut at 20 rows is accepted when a decision names it and the count equals live's; an og:image the media rewrite serves off-origin is accepted; a utility page live indexed is accepted with a decision.
  • --block-hosts on shoot, styles and css-coverage (a consent manager that disables theme scripts off the live host).
  • The contact sheet writes an index plus one page per route with images by path, so 142 pairs no longer overflow a string.
  • preflight waits 30 s for a CLI and reports "no answer" instead of "logged out".

Verified

  • npm test: 844 pass, 0 fail (fixture e2e included). npm run hygiene OK, no trailers.
  • Three tasks, each with failing tests first, a separate reviewer, one fix round, re-review approved; a read-only run of the new css-prune on the real sxsw capture exited 0 (10 sheets, 82 page heads, 0 unmatched).

…ing image hosts, lists each variant, and marks a resized fallback
…e the media cache, only a 4xx/5xx original gets a stand-in, and the baseline and media gate carry and count resized
…equals live's, an og:image the media rewrite serves, and a utility page live indexed
… linked by path, so a large site no longer overflows one string
…and skips excluded paths, prefixes and exclusions match like the links gate, a rewrite must send the whole prefix off-origin, the sheet removes its stale route pages
…ch page's head order; media, multisite and unparsable sheets
…der; the e2e run serves sheets at their live paths
… routes gate takes each at its live path as built
…'s media in --single-sheet; a malformed url() is left as written
…mport reaches, and the site's host variants are served from public/
@ethanplusai
ethanplusai merged commit db360b4 into main Oct 23, 2026
4 checks passed
@ethanplusai
ethanplusai deleted the feat/f13-css-media-assets branch October 23, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant