Skip to content

Commit 743c676

Browse files
committed
refactor(@schematics/angular): import TargetDefinition type from utilities in application builder migration
The workspace `TargetDefinition` type is exported from the workspace utilities file along with the other workspace schematics related rules. This change avoids an additional import statement.
1 parent 181b375 commit 743c676

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

packages/schematics/angular/migrations/update-17/use-application-builder.ts

Lines changed: 4 additions & 9 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 type { workspaces } from '@angular-devkit/core';
109
import {
1110
DirEntry,
1211
Rule,
@@ -18,14 +17,14 @@ import {
1817
} from '@angular-devkit/schematics';
1918
import { basename, dirname, extname, join } from 'node:path/posix';
2019
import { JSONFile } from '../../utility/json-file';
21-
import { allTargetOptions, updateWorkspace } from '../../utility/workspace';
20+
import { TargetDefinition, allTargetOptions, updateWorkspace } from '../../utility/workspace';
2221
import { Builders, ProjectType } from '../../utility/workspace-models';
2322
import { findImports } from './css-import-lexer';
2423

2524
function* updateBuildTarget(
2625
projectName: string,
27-
buildTarget: workspaces.TargetDefinition,
28-
serverTarget: workspaces.TargetDefinition | undefined,
26+
buildTarget: TargetDefinition,
27+
serverTarget: TargetDefinition | undefined,
2928
tree: Tree,
3029
context: SchematicContext,
3130
): Iterable<Rule> {
@@ -266,11 +265,7 @@ function* potentialSassImports(
266265
}
267266
}
268267

269-
function updateStyleImports(
270-
tree: Tree,
271-
projectSourceRoot: string,
272-
buildTarget: workspaces.TargetDefinition,
273-
) {
268+
function updateStyleImports(tree: Tree, projectSourceRoot: string, buildTarget: TargetDefinition) {
274269
const external = new Set<string>();
275270
let needWorkspaceIncludePath = false;
276271
for (const file of visit(tree.getDir(projectSourceRoot))) {

0 commit comments

Comments
 (0)