From 3f8ee748ddfbed08203e623963d9a544766a19d8 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 3 Oct 2018 23:16:42 +0200 Subject: [PATCH] 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). --- src/cdk/schematics/tsconfig.json | 2 ++ src/lib/schematics/ng-update/upgrade-data.ts | 3 ++- src/lib/schematics/tsconfig.json | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/cdk/schematics/tsconfig.json b/src/cdk/schematics/tsconfig.json index fbc1d702b78..31de7d81b11 100644 --- a/src/cdk/schematics/tsconfig.json +++ b/src/cdk/schematics/tsconfig.json @@ -1,5 +1,7 @@ { "compilerOptions": { + "composite": true, + "declaration": true, "lib": ["es2017"], "module": "commonjs", "moduleResolution": "node", diff --git a/src/lib/schematics/ng-update/upgrade-data.ts b/src/lib/schematics/ng-update/upgrade-data.ts index 71e014bd25b..ed04b70d5e2 100644 --- a/src/lib/schematics/ng-update/upgrade-data.ts +++ b/src/lib/schematics/ng-update/upgrade-data.ts @@ -6,6 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ +import {RuleUpgradeData} from '@angular/cdk/schematics'; import { attributeSelectors, classNames, @@ -19,7 +20,7 @@ import { } from './data'; /** Upgrade data that will be used for the Angular Material ng-update schematic. */ -export const materialUpgradeData = { +export const materialUpgradeData: RuleUpgradeData = { attributeSelectors, classNames, constructorChecks, diff --git a/src/lib/schematics/tsconfig.json b/src/lib/schematics/tsconfig.json index 403a11ba9ae..427c18d3cb0 100644 --- a/src/lib/schematics/tsconfig.json +++ b/src/lib/schematics/tsconfig.json @@ -9,6 +9,7 @@ "skipDefaultLibCheck": true, "skipLibCheck": true, "sourceMap": true, + "declaration": true, "target": "es6", "types": [ "jasmine", @@ -16,9 +17,12 @@ ], "baseUrl": ".", "paths": { - "@angular/cdk/schematics": ["../../cdk/schematics/"] + "@angular/cdk/schematics": ["../../cdk/schematics"] } }, + "references": [ + {"path": "../../cdk/schematics"} + ], "exclude": [ "**/*.spec.ts", // Exclude the test-setup utility files. Those should not be part of the output.