feat: add cooldown format and improved visibility for skipped updates#1711
Open
onemen wants to merge 2 commits intoraineorshine:mainfrom
Open
feat: add cooldown format and improved visibility for skipped updates#1711onemen wants to merge 2 commits intoraineorshine:mainfrom
onemen wants to merge 2 commits intoraineorshine:mainfrom
Conversation
57ce238 to
2645ccf
Compare
- Implement `--format cooldown` to display packages skipped due to the `--cooldown` timer. - Add a dedicated "Skipped due to x-day cooldown" section to the terminal output. - Enhance visibility by listing current version, target version, and release age for skipped packages.
5368fe7 to
ff2ec77
Compare
Contributor
Author
|
this PR is ready for review |
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.
closes #1690
Technical Refactor:
npm.ts& Cooldown VisibilityI have performed a major refactor of
npm.tsto support the new--format cooldownoption while improving overall performance and code maintainability.Key Changes:
findTargetAndFallback: Introduced a single-pass reducer that filters and resolves both the target upgrade version and a cooldown fallback simultaneously. By iterating through available versions only once, it avoids multiple loops for filtering and sorting, making the detection of "cooldown-safe" versions significantly more efficient.toVersionResult: This new utility standardizes how raw resolution data is formatted into aVersionResultobject. It wraps the target version with its publish time and, if a cooldown is active, attaches the fallback version and relevant metadata.targetfunctions is now uniform, significantly reducing boilerplate and improving readability.PR Highlights:
--format cooldownto display a dedicated "Skipped due to x-day cooldown" section in the terminal, listing version changes and release ages.cooldown.test.tsto verify the logic and the new formatting output.--formatoptions table in theREADME.md.README.mdat the end ofcooldownsection.@raineorshine,
Currently, this new format logic does not apply when
options.jsonis used. Please let me know if you would like me to extend this support to the JSON output as well.