Skip to content

Commit 3f8ee74

Browse files
devversionvivian-hu-zz
authored andcommitted
fix(schematics): @angular/material schematics not working (#13406)
* Due to the upgrade to TypeScript 3.0.0 and the fact that we refer to the actual sources instead of `../../../dist/packages/cdk` (for path mappings), TypeScript will output the Material schematics in an incorrect output structure. This can be fixed by taking advantage of the new "Project References" feature. https://github.com/angular/material2-builds/tree/master/schematics/lib/schematics (Notice the additional `lib/schematics` folder in the `@angular/material/schematics` folder).
1 parent 4bee73b commit 3f8ee74

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/cdk/schematics/tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"compilerOptions": {
3+
"composite": true,
4+
"declaration": true,
35
"lib": ["es2017"],
46
"module": "commonjs",
57
"moduleResolution": "node",

src/lib/schematics/ng-update/upgrade-data.ts

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

9+
import {RuleUpgradeData} from '@angular/cdk/schematics';
910
import {
1011
attributeSelectors,
1112
classNames,
@@ -19,7 +20,7 @@ import {
1920
} from './data';
2021

2122
/** Upgrade data that will be used for the Angular Material ng-update schematic. */
22-
export const materialUpgradeData = {
23+
export const materialUpgradeData: RuleUpgradeData = {
2324
attributeSelectors,
2425
classNames,
2526
constructorChecks,

src/lib/schematics/tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@
99
"skipDefaultLibCheck": true,
1010
"skipLibCheck": true,
1111
"sourceMap": true,
12+
"declaration": true,
1213
"target": "es6",
1314
"types": [
1415
"jasmine",
1516
"node"
1617
],
1718
"baseUrl": ".",
1819
"paths": {
19-
"@angular/cdk/schematics": ["../../cdk/schematics/"]
20+
"@angular/cdk/schematics": ["../../cdk/schematics"]
2021
}
2122
},
23+
"references": [
24+
{"path": "../../cdk/schematics"}
25+
],
2226
"exclude": [
2327
"**/*.spec.ts",
2428
// Exclude the test-setup utility files. Those should not be part of the output.

0 commit comments

Comments
 (0)