Skip to content

Commit 1b4523e

Browse files
chore: fix build issues
1 parent 54e728b commit 1b4523e

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

libs/angular-routing/schematics/ng-add/index.ts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import {
2-
chain, Rule,
3-
Tree, SchematicsException
2+
chain,
3+
Rule,
4+
Tree,
5+
SchematicsException,
46
} from '@angular-devkit/schematics';
57
import * as ts from 'typescript';
68
import { addImportToModule, insertImport } from '../utils/ast-utils';
7-
import { commitChanges } from '../utils/change';
9+
import { commitChanges, Change } from '../utils/change';
810
import { RouterOptions } from './schema';
911
import { findModuleFromOptions } from '../utils/find-module';
1012
import { getProjectPath } from '../utils/project';
@@ -22,7 +24,6 @@ function addImportToNgModule(options: RouterOptions): Rule {
2224
throw new Error('Specified module does not exist');
2325
}
2426

25-
2627
const text = host.read(modulePath);
2728
if (text === null) {
2829
throw new SchematicsException(`File ${modulePath} does not exist.`);
@@ -40,28 +41,21 @@ function addImportToNgModule(options: RouterOptions): Rule {
4041
source,
4142
modulePath,
4243
'RoutingModule.forRoot()',
43-
'angular-routing',
44+
'angular-routing'
4445
).shift();
4546

46-
4747
let changes = [
4848
insertImport(source, modulePath, 'RoutingModule', 'angular-routing'),
49-
importChanges
49+
importChanges,
5050
];
5151

52-
commitChanges(host, source.fileName, changes);
52+
commitChanges(host, source.fileName, changes as Change[]);
5353

5454
return host;
5555
};
5656
}
5757

5858
// Just return the tree
5959
export default function (options: RouterOptions): Rule {
60-
61-
return chain([
62-
addImportToNgModule(options)
63-
]);
60+
return chain([addImportToNgModule(options)]);
6461
}
65-
66-
67-

libs/angular-routing/schematics/utils/find-module.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8-
import {
9-
Path,
10-
join,
11-
normalize,
12-
strings,
13-
} from '@angular-devkit/core';
8+
import { Path, join, normalize, strings } from '@angular-devkit/core';
149
import { DirEntry, Tree } from '@angular-devkit/schematics';
1510

1611
export interface ModuleOptions {
@@ -35,7 +30,7 @@ export function findModuleFromOptions(
3530
if (!options.module) {
3631
const pathToCheck =
3732
(options.path || '') +
38-
(options.flat ? '' : '/' + strings.dasherize(options.name));
33+
(options.flat ? '' : '/' + strings.dasherize(options.name as string));
3934

4035
return normalize(findModule(host, pathToCheck));
4136
} else {

0 commit comments

Comments
 (0)