fix(@angular/cli): respect client-side release age settings during update resolution#33468
fix(@angular/cli): respect client-side release age settings during update resolution#33468clydin wants to merge 1 commit into
Conversation
dc88f1f to
b4ea3b0
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces support for a minimum release age gate configuration (such as minimum-release-age for pnpm, npmMinimalAgeGate for yarn, or environment variables) to filter out package versions that were published too recently. It updates the RegistryClient and PackageManager to retrieve and respect this configuration when resolving package versions, and adds corresponding tests and parsers. The review feedback suggests extracting the release age validation logic into a reusable helper function isReleaseAgeSatisfied to reduce code duplication across several functions and safely handle potential NaN values from Date.parse.
b4ea3b0 to
f4ad109
Compare
| expect(manifest).toEqual({ name: 'foo', version: '1.0.0' }); | ||
| }); | ||
| }); | ||
|
|
There was a problem hiding this comment.
Bun also supports release age.
https://bun.com/docs/pm/cli/install#minimum-release-age
| } | ||
| } | ||
|
|
||
| function isReleaseAgeSatisfied( |
There was a problem hiding this comment.
Technically, this isn't 100% accurate behavior, since packages can also be explicitly excluded. Although handling this, would make this far more complex.
f4ad109 to
84cd6ed
Compare
…date resolution Query the active package manager's release age gate configuration (like pnpm's `minimum-release-age` or yarn's `npmMinimalAgeGate`) and parse it into milliseconds. This config limit is passed to the `RegistryClient` in `resolveUserUpdatePlan` and is used to filter out version candidates that violate the release-age gate by checking the package's publish timestamps in the metadata `time` record. This guarantees that `ng update` resolves targeting versions that satisfy all active client-side release-age restrictions.
84cd6ed to
1e97b57
Compare
Query the active package manager's release age gate configuration (like pnpm's
minimum-release-ageor yarn'snpmMinimalAgeGate) and parse it into milliseconds.This config limit is passed to the
RegistryClientinresolveUserUpdatePlanand is used to filter out version candidates that violate the release-age gate by checking the package's publish timestamps in the metadatatimerecord. This guarantees thatng updateresolves targeting versions that satisfy all active client-side release-age restrictions.