feat(cli): add progress bar to generation pipeline#680
feat(cli): add progress bar to generation pipeline#680shivxmsharma wants to merge 1 commit intonodejs:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds an optional CLI progress bar to the generation pipeline so users can see per-target generator completion while running doc-kit generate.
Changes:
- Introduces
src/utils/progressBar.mjs, a small wrapper aroundcli-progressthat renders tostderrand auto-disables whenstderrisn’t a TTY. - Hooks the progress bar into
src/generators.mjsso it starts after scheduling and increments once each target generator’s result collection finishes. - Adds
--no-progressto thegeneratecommand and wires it intorunGenerators, plus adds thecli-progressdependency.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/utils/progressBar.mjs | New utility to create a TTY-aware progress bar that writes to stderr. |
| src/generators.mjs | Starts/increments/stops the progress bar around target result collection. |
| bin/commands/generate.mjs | Adds --no-progress and passes opts.progress into the generator runner. |
| package.json | Adds cli-progress dependency. |
| package-lock.json | Locks cli-progress and its transitive dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
ca20ac3 to
4f07217
Compare
avivkeller
left a comment
There was a problem hiding this comment.
cc @ovflowd given that the tooling is really fast, is a progress bar still needed?
bin/commands/generate.mjs
Outdated
| errorWrap(async opts => { | ||
| const config = await setConfig(opts); | ||
| await runGenerators(config); | ||
| await runGenerators(config, opts.progress); |
There was a problem hiding this comment.
The progress bar should be a part of global config
There was a problem hiding this comment.
Should I wait for @ovflowd's response or make the possible changes to this?
There was a problem hiding this comment.
IMO progress bar should be disabled/enabled behind cli arg since it's related to cli.
src/utils/progressBar.mjs
Outdated
| return { | ||
| /** @param {number} total */ | ||
| start: total => bar.start(total, 0, { phase: 'Starting...' }), | ||
| /** @param {string} phase */ | ||
| increment: phase => bar.increment({ phase }), | ||
| /** @returns {void} */ | ||
| stop: () => bar.stop(), | ||
| }; |
There was a problem hiding this comment.
Couldn't this just return bar?
There was a problem hiding this comment.
Made the relevant changes, please review!
4f07217 to
57a244e
Compare
|
Deployment failed with the following error: |
AugustinMauroy
left a comment
There was a problem hiding this comment.
LGMT ! and IMO it's still a good thing to have progress bar
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #680 +/- ##
==========================================
- Coverage 74.74% 74.22% -0.52%
==========================================
Files 146 147 +1
Lines 13255 13393 +138
Branches 960 967 +7
==========================================
+ Hits 9907 9941 +34
- Misses 3342 3446 +104
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Adds a
cli-progressprogress bar to thegeneratecommand that tracks each target generator as it completes.src/utils/progressBar.mjsutility wrapscli-progressand writes tostderrto avoid conflicts with the existing logger (stdout)--no-progressflag to explicitly disable itThe bar starts after all generators are scheduled and increments once per target generator as its result collection finishes. The phase label shows the generator name:
Validation
All 312 existing tests pass.
Related Issues
Closes #58
Check List
npm run formatto ensure the code follows the style guide.npm testto check if all tests are passing.