11import { SemVer , satisfies } from 'semver' ;
22import chalk from 'chalk' ;
3- import { stripIndents , stripIndent } from 'common-tags ' ;
3+ import { tags } from '@angular-devkit/core ' ;
44import * as path from 'path' ;
55import { isWarningEnabled } from '../utilities/config' ;
66import { requireProjectModule } from '../utilities/require-project-module' ;
@@ -64,14 +64,14 @@ export class Version {
6464 angularPkgJson = requireProjectModule ( projectRoot , '@angular/core/package.json' ) ;
6565 rxjsPkgJson = requireProjectModule ( projectRoot , 'rxjs/package.json' ) ;
6666 } catch {
67- console . error ( bold ( red ( stripIndents `
67+ console . error ( bold ( red ( tags . stripIndents `
6868 You seem to not be depending on "@angular/core" and/or "rxjs". This is an error.
6969 ` ) ) ) ;
7070 process . exit ( 2 ) ;
7171 }
7272
7373 if ( ! ( angularPkgJson && angularPkgJson [ 'version' ] && rxjsPkgJson && rxjsPkgJson [ 'version' ] ) ) {
74- console . error ( bold ( red ( stripIndents `
74+ console . error ( bold ( red ( tags . stripIndents `
7575 Cannot determine versions of "@angular/core" and/or "rxjs".
7676 This likely means your local installation is broken. Please reinstall your packages.
7777 ` ) ) ) ;
@@ -87,7 +87,7 @@ export class Version {
8787 }
8888
8989 if ( ! angularVersion . isGreaterThanOrEqualTo ( new SemVer ( '5.0.0' ) ) ) {
90- console . error ( bold ( red ( stripIndents `
90+ console . error ( bold ( red ( tags . stripIndents `
9191 This version of CLI is only compatible with Angular version 5.0.0 or higher.
9292
9393 Please visit the link below to find instructions on how to update Angular.
@@ -99,7 +99,7 @@ export class Version {
9999 && ! rxjsVersion . isGreaterThanOrEqualTo ( new SemVer ( '5.6.0-forward-compat.0' ) )
100100 && ! rxjsVersion . isGreaterThanOrEqualTo ( new SemVer ( '6.0.0-beta.0' ) )
101101 ) {
102- console . error ( bold ( red ( stripIndents `
102+ console . error ( bold ( red ( tags . stripIndents `
103103 This project uses version ${ rxjsVersion } of RxJs, which is not supported by Angular v6.
104104 The official RxJs version that is supported is 5.6.0-forward-compat.0 and greater.
105105
@@ -111,7 +111,7 @@ export class Version {
111111 angularVersion . isGreaterThanOrEqualTo ( new SemVer ( '6.0.0-rc.0' ) )
112112 && ! rxjsVersion . isGreaterThanOrEqualTo ( new SemVer ( '6.0.0-beta.0' ) )
113113 ) {
114- console . warn ( bold ( red ( stripIndents `
114+ console . warn ( bold ( red ( tags . stripIndents `
115115 This project uses a temporary compatibility version of RxJs (${ rxjsVersion } .
116116
117117 Please visit the link below to find instructions on how to update RxJs.
@@ -129,7 +129,7 @@ export class Version {
129129 compilerVersion = requireProjectModule ( projectRoot , '@angular/compiler-cli' ) . VERSION . full ;
130130 tsVersion = requireProjectModule ( projectRoot , 'typescript' ) . version ;
131131 } catch {
132- console . error ( bold ( red ( stripIndents `
132+ console . error ( bold ( red ( tags . stripIndents `
133133 Versions of @angular/compiler-cli and typescript could not be determined.
134134 The most common reason for this is a broken npm install.
135135
@@ -153,7 +153,7 @@ export class Version {
153153
154154 if ( currentCombo && ! satisfies ( tsVersion , currentCombo . typescript ) ) {
155155 // 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 `
157157 @angular/compiler-cli@${ compilerVersion } requires typescript@'${
158158 currentCombo . typescript } ' but ${ tsVersion } was found instead.
159159 Using this version can result in undefined behaviour and difficult to debug problems.
0 commit comments