feat(validate): enforce .png for client assets, warn on missing story avatar#79
Merged
Merged
Conversation
… avatar Client logos/avatars are resolved by the website at content/clients/<slug>-avatar.png and <slug>-white.png with a hardcoded .png extension; the story frontmatter has no avatar field. A .jpeg avatar (beev) uploaded to Blob fine but the site requested .png and 404'd — a broken avatar shipped while pnpm validate passed. Add validate-client-assets: hard-error on any non-png image under assets/clients/, plus a warning when a story has no <slug>-avatar.png. Wired into validate-content.
Contributor
|
🔍 Preview: https://website-pptn5kjir-ocobo-22231b32.vercel.app Built from website |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Contexte
La PR #74 (story Beev) a expédié un avatar en
.jpeg. Il s'est optimisé et uploadé sur le Blob sans erreur, mais le site résout les avatars/logos clients àcontent/clients/<slug>-avatar.png(et<slug>-white.png) avec l'extension.pngcodée en dur — la story n'a aucun champ avatar dans son frontmatter. Résultat : l'URL.pngattendue renvoyait 404 et l'avatar partait cassé en prod, alors quepnpm validatepassait au vert.Changements
scripts/validate-client-assets.js(fonctions pures + wrapper fs) :.pngsousassets/clients/→pnpm validateéchoue.<slug>-avatar.png(non bloquant : certains clients n'ont qu'un-whitepar design).scripts/validate-content.js.scripts/__tests__/validate-client-assets.test.js).Vérifs
pnpm test: 189 tests ✅ (dont les 8 nouveaux)pnpm validatesur le contenu actuel : vert (tous les assets clients sont déjà.png).Garde-fou contre la classe de bug rencontrée sur #74. Ne couvre que l'extension, pas la couleur du logo (contrôle visuel).