feat: respect minimumReleaseAge in outdated command#10030
Conversation
| if (opts.minimumReleaseAge) { | ||
| const isExcluded = opts.minimumReleaseAgeExclude && createMatcher(opts.minimumReleaseAgeExclude)(packageName) | ||
| if (!isExcluded) { | ||
| publishedBy = new Date(Date.now() - opts.minimumReleaseAge * 60 * 1000) |
There was a problem hiding this comment.
calculated publishedBy outside of getManifest and pass it in.
There was a problem hiding this comment.
Thanks, fixed in this commit.
refactor: move publishedBy and matcher creation outside getManifest
| return resolution?.manifest ?? null | ||
| let publishedBy: Date | undefined | ||
| if (opts.minimumReleaseAge) { | ||
| const isExcluded = opts.minimumReleaseAgeExclude && createMatcher(opts.minimumReleaseAgeExclude)(packageName) |
There was a problem hiding this comment.
pass in the created matched function instead of creating it here.
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for the minimumReleaseAge configuration option to the outdated command, allowing users to filter out packages that are too new. The feature includes two configuration options: minimumReleaseAge (to set an age threshold in minutes) and minimumReleaseAgeExclude (to exclude specific packages from the age filter).
- Added
minimumReleaseAgeandminimumReleaseAgeExcludeoptions to outdated command handlers - Modified manifest getter to respect release age filtering when resolving package versions
- Enhanced error handling to gracefully handle cases where no versions meet the age requirement
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| reviewing/plugin-commands-outdated/src/recursive.ts | Passes through minimumReleaseAge options to recursive outdated handler |
| reviewing/plugin-commands-outdated/src/outdated.ts | Adds minimumReleaseAge options to command type and handler |
| reviewing/outdated/test/outdated.spec.ts | Comprehensive test coverage for both minimumReleaseAge features |
| reviewing/outdated/test/getManifest.spec.ts | Tests for manifest getter with age filtering and exclusions |
| reviewing/outdated/src/outdatedDepsOfProjects.ts | Passes minimumReleaseAge options through to outdated function |
| reviewing/outdated/src/outdated.ts | Adds minimumReleaseAge parameters to outdated function signature |
| reviewing/outdated/src/createManifestGetter.ts | Core implementation of age filtering logic with exclusion support |
| .changeset/dry-impalas-mate.md | Changeset documenting the new feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Congrats on merging your first pull request! 🎉🎉🎉 |
a particular fix in 10.18 pnpm/pnpm#10030 should resolve Azure#36426
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [pnpm](https://pnpm.io) ([source](https://github.com/pnpm/pnpm/tree/HEAD/pnpm)) | [`10.17.1` -> `10.18.0`](https://renovatebot.com/diffs/npm/pnpm/10.17.1/10.18.0) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>pnpm/pnpm (pnpm)</summary> ### [`v10.18.0`](https://github.com/pnpm/pnpm/blob/HEAD/pnpm/CHANGELOG.md#10180) [Compare Source](pnpm/pnpm@v10.17.1...v10.18.0) ##### Minor Changes - Added network performance monitoring to pnpm by implementing warnings for slow network requests, including both metadata fetches and tarball downloads. Added configuration options for warning thresholds: `fetchWarnTimeoutMs` and `fetchMinSpeedKiBps`. Warning messages are displayed when requests exceed time thresholds or fall below speed minimums Related PR: [#​10025](pnpm/pnpm#10025). ##### Patch Changes - Retry filesystem operations on EAGAIN errors [#​9959](pnpm/pnpm#9959). - Outdated command respects `minimumReleaseAge` configuration [#​10030](pnpm/pnpm#10030). - Correctly apply the `cleanupUnusedCatalogs` configuration when removing dependent packages. - Don't fail with a meaningless error when `scriptShell` is set to `false` [#​8748](pnpm/pnpm#8748). - `pnpm dlx` should not fail when `minimumReleaseAge` is set [#​10037](pnpm/pnpm#10037). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or PR is renamed to start with "rebase!". 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Related work items: #30372
a particular fix in 10.18 pnpm/pnpm#10030 should resolve #36426
Fixes #10009
Added
minimumReleaseAgesupport to outdated command.