Skip to content

Commit 9ed6658

Browse files
committed
build: expand peer dependency range
Expands the peer dependency range for the framework to unblock angular/angular-cli#24462.
1 parent 89c4e6e commit 9ed6658

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

packages.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Each individual package uses a placeholder for the version of Angular to ensure they're
22
# all in-sync. This map is passed to each ng_package rule to stamp out the appropriate
33
# version for the placeholders.
4-
ANGULAR_PACKAGE_VERSION = "^15.0.0 || ^16.0.0"
4+
ANGULAR_PACKAGE_VERSION = "^15.0.0 || ^15.1.0-0 || ^16.0.0"
55
MDC_PACKAGE_VERSION = "15.0.0-canary.7971d6ad5.0"
66
TSLIB_PACKAGE_VERSION = "^2.3.0"
77
RXJS_PACKAGE_VERSION = "^6.5.3 || ^7.4.0"

tools/release-checks/check-framework-peer-dependency.mts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,19 @@ const bzlConfigPath = join(currentDir, '../../packages.bzl');
2323
*/
2424
export async function assertValidFrameworkPeerDependency(newVersion: semver.SemVer) {
2525
const currentVersionRange = _extractAngularVersionPlaceholderOrThrow();
26-
const isMajorWithPrerelease =
27-
newVersion.minor === 0 && newVersion.patch === 0 && !!newVersion.prerelease[0];
28-
const requiredRange = isMajorWithPrerelease
29-
? `^${newVersion.major}.0.0-0 || ^${newVersion.major + 1}.0.0`
30-
: `^${newVersion.major}.0.0 || ^${newVersion.major + 1}.0.0`;
26+
const isMinor = newVersion.minor !== 0;
27+
const isPrerelease = !!newVersion.prerelease[0];
28+
let requiredRange: string;
29+
30+
if (isPrerelease) {
31+
requiredRange = isMinor
32+
? `^${newVersion.major}.0.0 || ^${newVersion.major}.${newVersion.minor}.0-0 || ^${
33+
newVersion.major + 1
34+
}.0.0`
35+
: `^${newVersion.major}.0.0-0 || ^${newVersion.major + 1}.0.0`;
36+
} else {
37+
requiredRange = `^${newVersion.major}.0.0 || ^${newVersion.major + 1}.0.0`;
38+
}
3139

3240
if (requiredRange !== currentVersionRange) {
3341
Log.error(

0 commit comments

Comments
 (0)