Fix metadata.config exceeding Hex 2.4.2's 128KB limit#350
Open
crayment wants to merge 1 commit into
Open
Conversation
Add explicit files: list to package/0 in mix.exs to exclude unused static assets from the published Hex package. Without this, Hex includes all 1,591 FontAwesome SVG icons and other development-only assets, pushing metadata.config to 134,692 bytes — over the 131,072 byte limit enforced by hex_core v0.15.0 (shipped in Hex 2.4.2). After this change metadata.config is 7,259 bytes. The excluded assets (FontAwesome SVGs/JS/sprites, SCSS sources, demo images) are not referenced by any of kaffy's shipped templates or code. All runtime-required assets are preserved. Fixes: aesmail#349
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.
Problem
kaffy0.10.3 and 0.11.0 fail to install under Hex 2.4.2+ with:Hex 2.4.2 (released April 30, 2026) vendors
hex_core v0.15.0, which introduced a hard limit of 128KB (131,072 bytes) onmetadata.configduring tarball extraction. kaffy'smetadata.configis currently 134,692 bytes — 3,620 bytes over the limit — becausemix.exshas no explicitfiles:list, so Hex includes all 1,591 FontAwesome SVG icons and other development-only assets in the published package.Any project depending on kaffy that runs
mix deps.getwithout a warmdeps/cache will fail. Projects with warm caches won't notice until the cache expires or they set up a fresh environment.You can reproduce it locally:
rm -rf deps/kaffy mix local.hex --force # ensure Hex 2.4.2+ mix deps.getFix
Add an explicit
files:list topackage/0inmix.exs, keeping only the assets that kaffy's templates and code actually reference at runtime. This reducesmetadata.configfrom 134,692 bytes → 7,259 bytes.What's excluded:
fontawesome/svgs/) — the main offenderfontawesome/js/) — templates use CSS approach, not SVG-with-JSfontawesome/sprites/)faces/,faces-clipart/, unused dashboard images)favicon-32x32.pngis referenced by templates)What's kept: everything kaffy's shipped templates and code actually load — all CSS, JS, Ubuntu fonts, FontAwesome webfonts, and the handful of images referenced by templates.
Verified against the full template and source scan:
all.cssloads fonts via../webfonts/*✓style.cssloads Ubuntu fonts via../fonts/Ubuntu/*✓resource_form.exorutils.exare missed ✓backup.html.eexuses only CDN URLs, no local assets ✓References
hex_corePR that introduced the limit: Add file-based unpack and size validations for tarball files hexpm/hex_core#166