Skip to content

Commit c452531

Browse files
committed
refactor(@angular/cli): remove unneeded devkit core tag helper usage
Direct string usage can be leveraged to remove the need for the helpers and reduce imports of `@angular-devkit/core`.
1 parent 68bdc94 commit c452531

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

packages/angular/cli/src/command-builder/utilities/schematic-workflow.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import { logging, tags } from '@angular-devkit/core';
9+
import { logging } from '@angular-devkit/core';
1010
import { NodeWorkflow } from '@angular-devkit/schematics/tools';
1111
import { colors } from '../../utilities/color';
1212

@@ -33,15 +33,11 @@ export function subscribeToWorkflow(
3333
logger.error(`ERROR! ${eventPath} ${desc}.`);
3434
break;
3535
case 'update':
36-
logs.push(tags.oneLine`
37-
${colors.cyan('UPDATE')} ${eventPath} (${event.content.length} bytes)
38-
`);
36+
logs.push(`${colors.cyan('UPDATE')} ${eventPath} (${event.content.length} bytes)`);
3937
files.add(eventPath);
4038
break;
4139
case 'create':
42-
logs.push(tags.oneLine`
43-
${colors.green('CREATE')} ${eventPath} (${event.content.length} bytes)
44-
`);
40+
logs.push(`${colors.green('CREATE')} ${eventPath} (${event.content.length} bytes)`);
4541
files.add(eventPath);
4642
break;
4743
case 'delete':

packages/angular/cli/src/commands/add/cli.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import { tags } from '@angular-devkit/core';
109
import { NodePackageDoesNotSupportSchematics } from '@angular-devkit/schematics/tools';
1110
import { createRequire } from 'module';
1211
import npa from 'npm-package-arg';
@@ -397,10 +396,10 @@ export default class AddCommandModule
397396
});
398397
} catch (e) {
399398
if (e instanceof NodePackageDoesNotSupportSchematics) {
400-
this.context.logger.error(tags.oneLine`
401-
The package that you are trying to add does not support schematics. You can try using
402-
a different version of the package or contact the package author to add ng-add support.
403-
`);
399+
this.context.logger.error(
400+
'The package that you are trying to add does not support schematics.' +
401+
'You can try using a different version of the package or contact the package author to add ng-add support.',
402+
);
404403

405404
return 1;
406405
}

packages/angular/cli/src/commands/update/schematic/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import { logging, tags } from '@angular-devkit/core';
9+
import { logging } from '@angular-devkit/core';
1010
import { Rule, SchematicContext, SchematicsException, Tree } from '@angular-devkit/schematics';
1111
import * as npa from 'npm-package-arg';
1212
import type { Manifest } from 'pacote';
1313
import * as semver from 'semver';
14-
import { assertIsError } from '../../../utilities/error';
1514
import {
1615
NgPackageManifestProperties,
1716
NpmRepositoryPackageJson,
@@ -249,9 +248,11 @@ function _validateUpdatePackages(
249248
});
250249

251250
if (!force && peerErrors) {
252-
throw new SchematicsException(tags.stripIndents`Incompatible peer dependencies found.
253-
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
254-
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.`);
251+
throw new SchematicsException(
252+
'Incompatible peer dependencies found.\n' +
253+
'Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.\n' +
254+
`You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.`,
255+
);
255256
}
256257
}
257258

0 commit comments

Comments
 (0)