1
1
import { SemVer , satisfies } from 'semver' ;
2
2
import chalk from 'chalk' ;
3
- import { stripIndents , stripIndent } from 'common-tags ' ;
3
+ import { tags } from '@angular-devkit/core ' ;
4
4
import * as path from 'path' ;
5
5
import { isWarningEnabled } from '../utilities/config' ;
6
6
import { requireProjectModule } from '../utilities/require-project-module' ;
@@ -64,14 +64,14 @@ export class Version {
64
64
angularPkgJson = requireProjectModule ( projectRoot , '@angular/core/package.json' ) ;
65
65
rxjsPkgJson = requireProjectModule ( projectRoot , 'rxjs/package.json' ) ;
66
66
} catch {
67
- console . error ( bold ( red ( stripIndents `
67
+ console . error ( bold ( red ( tags . stripIndents `
68
68
You seem to not be depending on "@angular/core" and/or "rxjs". This is an error.
69
69
` ) ) ) ;
70
70
process . exit ( 2 ) ;
71
71
}
72
72
73
73
if ( ! ( angularPkgJson && angularPkgJson [ 'version' ] && rxjsPkgJson && rxjsPkgJson [ 'version' ] ) ) {
74
- console . error ( bold ( red ( stripIndents `
74
+ console . error ( bold ( red ( tags . stripIndents `
75
75
Cannot determine versions of "@angular/core" and/or "rxjs".
76
76
This likely means your local installation is broken. Please reinstall your packages.
77
77
` ) ) ) ;
@@ -87,7 +87,7 @@ export class Version {
87
87
}
88
88
89
89
if ( ! angularVersion . isGreaterThanOrEqualTo ( new SemVer ( '5.0.0' ) ) ) {
90
- console . error ( bold ( red ( stripIndents `
90
+ console . error ( bold ( red ( tags . stripIndents `
91
91
This version of CLI is only compatible with Angular version 5.0.0 or higher.
92
92
93
93
Please visit the link below to find instructions on how to update Angular.
@@ -99,7 +99,7 @@ export class Version {
99
99
&& ! rxjsVersion . isGreaterThanOrEqualTo ( new SemVer ( '5.6.0-forward-compat.0' ) )
100
100
&& ! rxjsVersion . isGreaterThanOrEqualTo ( new SemVer ( '6.0.0-beta.0' ) )
101
101
) {
102
- console . error ( bold ( red ( stripIndents `
102
+ console . error ( bold ( red ( tags . stripIndents `
103
103
This project uses version ${ rxjsVersion } of RxJs, which is not supported by Angular v6.
104
104
The official RxJs version that is supported is 5.6.0-forward-compat.0 and greater.
105
105
@@ -111,7 +111,7 @@ export class Version {
111
111
angularVersion . isGreaterThanOrEqualTo ( new SemVer ( '6.0.0-rc.0' ) )
112
112
&& ! rxjsVersion . isGreaterThanOrEqualTo ( new SemVer ( '6.0.0-beta.0' ) )
113
113
) {
114
- console . warn ( bold ( red ( stripIndents `
114
+ console . warn ( bold ( red ( tags . stripIndents `
115
115
This project uses a temporary compatibility version of RxJs (${ rxjsVersion } .
116
116
117
117
Please visit the link below to find instructions on how to update RxJs.
@@ -129,7 +129,7 @@ export class Version {
129
129
compilerVersion = requireProjectModule ( projectRoot , '@angular/compiler-cli' ) . VERSION . full ;
130
130
tsVersion = requireProjectModule ( projectRoot , 'typescript' ) . version ;
131
131
} catch {
132
- console . error ( bold ( red ( stripIndents `
132
+ console . error ( bold ( red ( tags . stripIndents `
133
133
Versions of @angular/compiler-cli and typescript could not be determined.
134
134
The most common reason for this is a broken npm install.
135
135
@@ -153,7 +153,7 @@ export class Version {
153
153
154
154
if ( currentCombo && ! satisfies ( tsVersion , currentCombo . typescript ) ) {
155
155
// First line of warning looks weird being split in two, disable tslint for it.
156
- console . log ( ( yellow ( '\n' + stripIndent `
156
+ console . log ( ( yellow ( '\n' + tags . stripIndent `
157
157
@angular/compiler-cli@${ compilerVersion } requires typescript@'${
158
158
currentCombo . typescript } ' but ${ tsVersion } was found instead.
159
159
Using this version can result in undefined behaviour and difficult to debug problems.
0 commit comments