File tree 1 file changed +17
-1
lines changed
packages/schematics/angular/utility
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
+ /** Retrieve the minor version for the provided version string. */
10
+ function getEarliestMinorVersion ( version : string ) {
11
+ const versionMatching = version . match ( / ^ ( \d + ) \. ( \d + ) \. * / ) ;
12
+
13
+ if ( versionMatching === null ) {
14
+ throw Error ( 'Unable to determine the minor version for the provided version' ) ;
15
+ }
16
+ const [ _ , major , minor ] = versionMatching ;
17
+
18
+ return `${ major } .${ minor } .0` ;
19
+ }
20
+
9
21
export const latestVersions = {
10
22
// These versions should be kept up to date with latest Angular peer dependencies.
11
- Angular : '~12.1.2' ,
12
23
RxJs : '~6.6.0' ,
13
24
ZoneJs : '~0.11.4' ,
14
25
TypeScript : '~4.3.2' ,
15
26
TsLib : '^2.2.0' ,
16
27
28
+ // As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
29
+ // Angular CLI minor version with earliest prerelease (appended with `-`) will match the latest
30
+ // Angular Framework minor.
31
+ Angular : `~${ getEarliestMinorVersion ( require ( '../package.json' ) [ 'version' ] ) } -` ,
32
+
17
33
// Since @angular -devkit/build-angular and @schematics/angular are always
18
34
// published together from the same monorepo, and they are both
19
35
// non-experimental, they will always have the same version.
You can’t perform that action at this time.
0 commit comments