make fmt rewrites vendored static/js/alpine.min.js (missing .prettierignore) #185
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while working #175: running
make fmtreformatsstatic/js/alpine.min.js—script/fmtpasses the globstatic/js/*.jsto prettier and there is no.prettierignore, sothe vendored minified Alpine.js bundle gets expanded/rewritten.
Vendored artifacts must never be reformatted; a formatter pass
should leave the tree identical unless first-party code changed.
Remediation: add a
.prettierignorecontaining at leaststatic/js/alpine.min.js(or*.min.js). Verifyscript/fmt'sexplicit file arguments still respect the ignore file (prettier
requires
--ignore-pathhandling to be confirmed when files arepassed explicitly); if not, adjust the glob in
script/fmttoexclude minified files.
Definition of done:
make fmton a clean tree produces zero modifications(
git statusclean afterward)static/js/alpine.min.jsbyte-identical before and aftermake fmtdashboard.js,deployment.js,utils.js) isstill formatted
mainConfirmed still open — and the damage is already committed to
mainRe-verified on 2026-09-03. There is still no
.prettierignore, andscript/fmtstill passes the bare glob:Important detail this issue did not capture: the rewrite has already happened and was merged. It landed in
594537e("rework: address review feedback on PR #126", 2026-02-22), where it was recorded innocuously as "Fix pre-existing JS formatting (prettier)":594537emaintodayThe vendored Alpine.js bundle was un-minified in place and is now 2.07x its original size. Since
static/js/alpine.min.jsis served to browsers, this is not just a hygiene problem — every user of the dashboard has been downloading ~49 KB of unnecessary bytes for six months, and the file named.min.jsis no longer minified.This changes the remediation
Adding
.prettierignorealone is necessary but not sufficient — it would only freeze the corrupted file in place. The fix must also restore the artifact:.prettierignorecoveringstatic/js/*.min.js(at minimumstatic/js/alpine.min.js).--ignore-path. If it does not, narrow the glob inscript/fmtinstead of relying on the ignore file. Verify by actually runningmake fmttwice on a clean tree.alpine.min.jsat the pinned upstream version and record that version + date in a comment orstatic/js/README, perREPO_POLICIES.mdpinning rules. Do not attempt to re-minify the expanded copy — fetch the real upstream artifact.Existing DoD bullets all still apply; bullet 2 ("byte-identical before and after
make fmt") should be read against the restored file, not the current one.