Skip to content

Deduplicate CLI help file#6223

Merged
lukastaegert merged 7 commits intomasterfrom
deduplicate-help-md
Dec 28, 2025
Merged

Deduplicate CLI help file#6223
lukastaegert merged 7 commits intomasterfrom
deduplicate-help-md

Conversation

@lukastaegert
Copy link
Member

@lukastaegert lukastaegert commented Dec 27, 2025

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

We currently duplicate the CLI options between the CLI help.md file that is printed when running rollup without options and the website. This is addressed by instead including the file in the website and using Vitepress tricks to remove header and examples.

We use vitepress features to directly include and truncate the help.md file. We
use a VSCode region to trim the CLI options, which means we need to filter the
comments when loading the file.
Copilot AI review requested due to automatic review settings December 27, 2025 21:27
@vercel
Copy link

vercel bot commented Dec 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
rollup Ready Ready Preview, Comment Dec 28, 2025 7:14am

There were some changes that were not committed with some dependency update.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the CLI help documentation to eliminate duplication between the CLI help file and the website documentation. Instead of maintaining two separate copies of the CLI options, the website now includes the help file content using VitePress's snippet inclusion feature.

Key changes:

  • Created a custom Rollup plugin to load and process the help file with version replacement and line length validation
  • Updated the help file to use region markers for VitePress snippet extraction and consistent formatting
  • Modified the documentation to include the help file content rather than duplicating it

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
build-plugins/load-cli-help.ts New custom plugin that loads help.md, strips comment markers, validates 80-character line limit, and replaces version placeholder
cli/cli.ts Simplified to output help text directly without version replacement (now handled by build plugin)
cli/help.md Added VitePress region markers, reformatted multi-line descriptions to use consistent spacing instead of tabs
docs/command-line-interface/index.md Replaced duplicated CLI options list with VitePress snippet inclusion syntax
rollup.config.ts Replaced rollup-plugin-string with custom loadCliHelp plugin
typings/declarations.ts Removed unused declaration for rollup-plugin-string
package.json Removed rollup-plugin-string dependency
package-lock.json Updated lock file to remove rollup-plugin-string and adjust peer dependency markers
wasm/bindings_wasm.d.ts Added blank lines between function declarations for improved formatting

@github-actions
Copy link

github-actions bot commented Dec 27, 2025

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#deduplicate-help-md

Notice: 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:
https://rollup-ebc29pmtf-rollup-js.vercel.app/repl/?pr=6223

@github-actions
Copy link

github-actions bot commented Dec 27, 2025

Performance report

  • BUILD: 6781ms, 840 MB
    • initialize: 0ms, 24.2 MB
    • generate module graph: 2554ms, 633 MB
      • generate ast: 1354ms, 624 MB
    • sort and bind modules: 390ms, 691 MB
    • mark included statements: 3845ms, 840 MB
      • treeshaking pass 1: 2249ms (-51ms, -2.2%), 831 MB
      • treeshaking pass 2: 448ms, 826 MB
      • treeshaking pass 3: 386ms, 838 MB
      • treeshaking pass 4: 375ms, 823 MB
      • treeshaking pass 5: 372ms, 840 MB
  • GENERATE: 672ms, 914 MB
    • initialize render: 0ms, 840 MB
    • generate chunks: 47ms, 825 MB
      • optimize chunks: 0ms, 834 MB (+2%)
    • render chunks: 613ms, 893 MB
    • transform chunks: 16ms, 914 MB
    • generate bundle: 0ms, 914 MB

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 10 changed files in this pull request and generated 2 comments.

@codecov
Copy link

codecov bot commented Dec 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.81%. Comparing base (6166a59) to head (0ba4473).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6223      +/-   ##
==========================================
+ Coverage   98.79%   98.81%   +0.01%     
==========================================
  Files         271      272       +1     
  Lines       10683    10684       +1     
  Branches     2862     2862              
==========================================
+ Hits        10554    10557       +3     
+ Misses         86       85       -1     
+ Partials       43       42       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 12 changed files in this pull request and generated 2 comments.

@lukastaegert lukastaegert merged commit fe42b2d into master Dec 28, 2025
45 checks passed
@lukastaegert lukastaegert deleted the deduplicate-help-md branch December 28, 2025 07:32
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.

2 participants