Skip to content

fix: no more corrupted font in generated zip#8

Open
rockeek wants to merge 1 commit into
TryGhost:mainfrom
rockeek:FixCorruptedFontsInZip
Open

fix: no more corrupted font in generated zip#8
rockeek wants to merge 1 commit into
TryGhost:mainfrom
rockeek:FixCorruptedFontsInZip

Conversation

@rockeek
Copy link
Copy Markdown

@rockeek rockeek commented Apr 29, 2026

vinyl-fs v4 introduced a breaking change: src() now defaults to encoding: 'utf8'. We now disable the codec entirely.

The woff2 file in the zip was bigger than the original one. This lead to console warnings in browser.

Now, font file size is preserved.


Note

Low Risk
Small, localized build pipeline change that only affects how the release zip is packaged; minimal runtime impact outside packaging.

Overview
Fixes binary asset corruption in the zip build by passing {encoding: false} to gulp.src() inside zipper(), ensuring files are streamed as raw buffers when generating the dist/*.zip.

Reviewed by Cursor Bugbot for commit 96d4658. Bugbot is set up for automated code reviews on this repo. Configure here.

…a breaking change: src() now defaults to encoding: 'utf8'. We now disable the codec entirely.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4015b96d-38d2-4f40-8292-1805875b2d52

📥 Commits

Reviewing files that changed from the base of the PR and between 7d59c1a and 96d4658.

📒 Files selected for processing (1)
  • gulpfile.js

Walkthrough

The zipper task in gulpfile.js has been modified to add the {encoding: false} option to the src() function call. This configuration change prevents the default text encoding behavior when reading files for packaging, ensuring that raw binary buffers are passed directly to the gulp-zip plugin instead of encoded strings.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing corrupted fonts in the generated ZIP file by disabling text encoding.
Description check ✅ Passed The description clearly explains the root cause (vinyl-fs v4 breaking change), the problem (corrupted font files), and the solution (disabling encoding).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant