Skip to content

fix(starter): check-dist flags WordPress runtime, not links to other sites; knip keeps social.ts - #752

Merged
ABB65 merged 1 commit into
mainfrom
t7/starter-dist-knip
Nov 7, 2026
Merged

ABB65 merged 1 commit into
mainfrom
t7/starter-dist-knip

Conversation

@ABB65

@ABB65 ABB65 commented Nov 7, 2026

Copy link
Copy Markdown
Member

What

  • scripts/check-dist.mjs: "references the WordPress runtime" now fails only

    • a <script> or <link> whose address names wp-includes / wp-content / wp-json / jQuery,
    • a site path (relative or root) into them, on any tag,
    • inline script text that names them.

    A link (<a href>) or image on another site that happens to be a WordPress upload is content, not runtime, and passes.

  • knip.json: src/components/kit/_shared/social.ts joins the other _shared files with ignoreIssues: exports. A site that ships a kit component using social.ts (team) without SocialLinks left NETWORK_MARKS and hostOf unused, so knip failed.

Why

A real migrated site failed both CI gates on its first push:

  • check-dist failed 29 pages for body links to PDFs on other WordPress sites and two hotlinked images.
  • knip failed for the two social.ts exports.

Checked

  • check-dist on that site's build: 29 failures → 0.

  • The same page with an injected

    • <script src=…/wp-includes/js/jquery/jquery.min.js>,
    • <a href="/wp-content/uploads/x.pdf">,
    • <link rel=stylesheet href=…/wp-content/themes/a.css>,
    • inline fetch("/wp-json/…")

    each still fails. An <img> plus <a> to another site's wp-content passes.

  • knip on that site with this knip.json: 0 (it was 1).

  • pnpm lint 0, typecheck (hook) 0.

The starter is not a workspace package, so there is no changeset. migrate's vendored starter picks this up through sync-starter.

…sites; knip keeps social.ts

check-dist failed a page for any wp-content address, so a body link to a PDF on another
WordPress site, or a hotlinked image, read as the WordPress runtime. It now fails a script or
stylesheet from wp-includes / wp-content / jQuery, a site path into them, and inline script that
names them. A link or image on another site is content.

knip: a site that ships kit components using _shared/social.ts but not SocialLinks left
NETWORK_MARKS and hostOf unused. social.ts joins the other _shared files whose exports serve
optional components.
@netlify

netlify Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for contentrain-ai ready!

Name Link
🔨 Latest commit 0ebb26a
🔍 Latest deploy log https://app.netlify.com/projects/contentrain-ai/deploys/6aef12184102a969d4c91705
😎 Deploy Preview https://deploy-preview-752--contentrain-ai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ABB65
ABB65 merged commit d25fc72 into main Nov 7, 2026
8 checks passed
@ABB65
ABB65 deleted the t7/starter-dist-knip branch November 7, 2026 11:59
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant