@@ -41,28 +41,25 @@ export function assertCompatibleAngularVersion(projectRoot: string, logger: logg
4141 const angularCliPkgPath = require . resolve ( '@angular/cli/package.json' , resolveOptions ) ;
4242 angularCliPkgJson = require ( angularCliPkgPath ) ;
4343 if ( ! ( angularCliPkgJson && angularCliPkgJson [ 'version' ] ) ) {
44- throw new Error ( ) ;
44+ return ;
4545 }
4646 } catch {
4747 // Not using @angular -devkit/build-angular with @angular/cli is ok too.
4848 // In this case we don't provide as many version checks.
4949 return ;
5050 }
5151
52- if ( angularCliPkgJson [ 'version' ] === '0.0.0' ) {
53- // Internal testing version
52+ if ( angularCliPkgJson [ 'version' ] === '0.0.0' || angularPkgJson [ 'version' ] === '0.0.0-PLACEHOLDER' ) {
53+ // Internal CLI testing version or integration testing in the angular/angular
54+ // repository with the generated development @angular /core npm package which is versioned "0.0.0-PLACEHOLDER".
5455 return ;
5556 }
5657
57- const cliMajor = new SemVer ( angularCliPkgJson [ 'version' ] ) . major ;
58- // e.g. CLI 8.0 supports '>=8.0.0 <9.0.0', including pre-releases (betas, rcs, snapshots)
59- // of both 8 and 9. Also allow version "0.0.0" for integration testing in the angular/angular
60- // repository with the generated development @angular /core npm package which is versioned "0.0.0".
61- const supportedAngularSemver =
62- `0.0.0 || ^${ cliMajor } .0.0-beta || ` + `>=${ cliMajor } .0.0 <${ cliMajor + 1 } .0.0` ;
63-
6458 const angularVersion = new SemVer ( angularPkgJson [ 'version' ] ) ;
65- const rxjsVersion = new SemVer ( rxjsPkgJson [ 'version' ] ) ;
59+ const cliMajor = new SemVer ( angularCliPkgJson [ 'version' ] ) . major ;
60+ // e.g. CLI 8.0 supports '>=8.0.0 <9.0.0', including pre-releases (next, rcs, snapshots)
61+ // of both 8 and 9.
62+ const supportedAngularSemver = `^${ cliMajor } .0.0-next || >=${ cliMajor } .0.0 <${ cliMajor + 1 } .0.0` ;
6663
6764 if ( ! satisfies ( angularVersion , supportedAngularSemver , { includePrerelease : true } ) ) {
6865 logger . error (
@@ -76,30 +73,5 @@ export function assertCompatibleAngularVersion(projectRoot: string, logger: logg
7673 ) ;
7774
7875 process . exit ( 3 ) ;
79- } else if (
80- gte ( angularVersion , '6.0.0-rc.0' ) &&
81- ! gte ( rxjsVersion , '5.6.0-forward-compat.0' ) &&
82- ! gte ( rxjsVersion , '6.0.0-beta.0' )
83- ) {
84- logger . error (
85- tags . stripIndents `
86- This project uses version ${ rxjsVersion } of RxJs, which is not supported by Angular v6+.
87- The official RxJs version that is supported is 5.6.0-forward-compat.0 and greater.
88-
89- Please visit the link below to find instructions on how to update RxJs.
90- https://docs.google.com/document/d/12nlLt71VLKb-z3YaSGzUfx6mJbc34nsMXtByPUN35cg/edit#
91- ` + '\n' ,
92- ) ;
93-
94- process . exit ( 3 ) ;
95- } else if ( gte ( angularVersion , '6.0.0-rc.0' ) && ! gte ( rxjsVersion , '6.0.0-beta.0' ) ) {
96- logger . warn (
97- tags . stripIndents `
98- This project uses a temporary compatibility version of RxJs (${ rxjsVersion } ).
99-
100- Please visit the link below to find instructions on how to update RxJs.
101- https://docs.google.com/document/d/12nlLt71VLKb-z3YaSGzUfx6mJbc34nsMXtByPUN35cg/edit#
102- ` + '\n' ,
103- ) ;
10476 }
10577}
0 commit comments