Repository navigation
fix(starter): check-dist flags WordPress runtime, not links to other sites; knip keeps social.ts - #752
Merged
Conversation
…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.
✅ Deploy Preview for contentrain-ai ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
scripts/check-dist.mjs: "references the WordPress runtime" now fails only<script>or<link>whose address names wp-includes / wp-content / wp-json / jQuery,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.tsjoins the other_sharedfiles withignoreIssues: exports. A site that ships a kit component using social.ts (team) without SocialLinks leftNETWORK_MARKSandhostOfunused, so knip failed.Why
A real migrated site failed both CI gates on its first push:
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>,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 lint0, 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.