Does not add an extra leading line feed for addons#6403
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via npm install rollup/rollup#fix/6401Notice: Ensure you have installed the latest nightly Rust toolchain. If you haven't installed it yet, please see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust. or load it into the REPL: |
There was a problem hiding this comment.
Pull request overview
Fixes a formatting bug where addon hooks (banner/intro/outro/footer) could introduce an unintended leading line feed when the first addon content originates from plugins (i.e., the initial option value is empty), aligning output with expected “addon starts at byte 0” behavior (resolves #6401).
Changes:
- Update addon concatenation logic to only insert separators (
\n/\n\n) when there is already prior content. - Adjust the existing
enforce-addon-orderexpected output to match the corrected newline behavior. - Add a new form sample that asserts no extra leading line feed across all major output formats.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/addons.ts | Prevents leading separators when concatenating the first addon contribution. |
| test/form/samples/enforce-addon-order/_expected.js | Updates fixture to remove now-unwanted leading/extra blank lines. |
| test/form/samples/addon-functions-no-extra-leading-line-feed/_config.js | New regression test config covering plugin-provided addons with empty initial values. |
| test/form/samples/addon-functions-no-extra-leading-line-feed/main.js | Minimal entry for the new regression sample. |
| test/form/samples/addon-functions-no-extra-leading-line-feed/_expected/amd.js | Expected output ensuring banner starts without a leading LF (AMD). |
| test/form/samples/addon-functions-no-extra-leading-line-feed/_expected/cjs.js | Expected output ensuring banner starts without a leading LF (CJS). |
| test/form/samples/addon-functions-no-extra-leading-line-feed/_expected/es.js | Expected output ensuring banner starts without a leading LF (ES). |
| test/form/samples/addon-functions-no-extra-leading-line-feed/_expected/iife.js | Expected output ensuring banner starts without a leading LF (IIFE). |
| test/form/samples/addon-functions-no-extra-leading-line-feed/_expected/system.js | Expected output ensuring banner starts without a leading LF (System). |
| test/form/samples/addon-functions-no-extra-leading-line-feed/_expected/umd.js | Expected output ensuring banner starts without a leading LF (UMD). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Performance report
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6403 +/- ##
=======================================
Coverage 98.78% 98.78%
=======================================
Files 274 274
Lines 10785 10785
Branches 2882 2882
=======================================
Hits 10654 10654
Misses 89 89
Partials 42 42 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Lukas Taegert-Atkinson <[email protected]>
|
This PR has been released as part of [email protected]. You can test it via |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
resolves #6401
Description