From e1ffd45ff353d01a1401d460401962b73179d88b Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Fri, 27 May 2022 07:30:13 +0000 Subject: [PATCH 1/2] fix(material/schematics): use `workingDirectory` smart provider in path option The Angular CLI, handles options with both name and format `path` as a special case. This behaviour has been deprecated and instead the `workingDirectory` smart provider should be used instead. Currently, when not using the provider a deprecation warning will be issue. See: https://github.com/angular/angular-cli/pull/23212 --- src/material/schematics/ng-generate/address-form/schema.json | 3 +++ src/material/schematics/ng-generate/dashboard/schema.json | 3 +++ src/material/schematics/ng-generate/navigation/schema.json | 3 +++ src/material/schematics/ng-generate/table/schema.json | 3 +++ src/material/schematics/ng-generate/tree/schema.json | 3 +++ 5 files changed, 15 insertions(+) diff --git a/src/material/schematics/ng-generate/address-form/schema.json b/src/material/schematics/ng-generate/address-form/schema.json index c7f4e3ca168a..f6c11bbf4d02 100644 --- a/src/material/schematics/ng-generate/address-form/schema.json +++ b/src/material/schematics/ng-generate/address-form/schema.json @@ -7,6 +7,9 @@ "path": { "type": "string", "format": "path", + "$default": { + "$source": "workingDirectory" + }, "description": "The path to create the component.", "visible": false }, diff --git a/src/material/schematics/ng-generate/dashboard/schema.json b/src/material/schematics/ng-generate/dashboard/schema.json index aab7e2ea45f4..110df244f638 100644 --- a/src/material/schematics/ng-generate/dashboard/schema.json +++ b/src/material/schematics/ng-generate/dashboard/schema.json @@ -7,6 +7,9 @@ "path": { "type": "string", "format": "path", + "$default": { + "$source": "workingDirectory" + }, "description": "The path to create the component.", "visible": false }, diff --git a/src/material/schematics/ng-generate/navigation/schema.json b/src/material/schematics/ng-generate/navigation/schema.json index f7c9e0e458d0..d1dc5e06bcd3 100644 --- a/src/material/schematics/ng-generate/navigation/schema.json +++ b/src/material/schematics/ng-generate/navigation/schema.json @@ -7,6 +7,9 @@ "path": { "type": "string", "format": "path", + "$default": { + "$source": "workingDirectory" + }, "description": "The path to create the component.", "visible": false }, diff --git a/src/material/schematics/ng-generate/table/schema.json b/src/material/schematics/ng-generate/table/schema.json index 5a65ff348d7a..a26002024616 100644 --- a/src/material/schematics/ng-generate/table/schema.json +++ b/src/material/schematics/ng-generate/table/schema.json @@ -7,6 +7,9 @@ "path": { "type": "string", "format": "path", + "$default": { + "$source": "workingDirectory" + }, "description": "The path to create the component.", "visible": false }, diff --git a/src/material/schematics/ng-generate/tree/schema.json b/src/material/schematics/ng-generate/tree/schema.json index 1d629a86a296..79df17d33dbc 100644 --- a/src/material/schematics/ng-generate/tree/schema.json +++ b/src/material/schematics/ng-generate/tree/schema.json @@ -7,6 +7,9 @@ "path": { "type": "string", "format": "path", + "$default": { + "$source": "workingDirectory" + }, "description": "The path to create the component.", "visible": false }, From b396e9dfb59638334d29fcd39c561c38f6a302e3 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Fri, 27 May 2022 07:30:22 +0000 Subject: [PATCH 2/2] fix(cdk/schematics): use `workingDirectory` smart provider in path option The Angular CLI, handles options with both name and format `path` as a special case. This behaviour has been deprecated and instead the `workingDirectory` smart provider should be used instead. Currently, when not using the provider a deprecation warning will be issue. See: https://github.com/angular/angular-cli/pull/23212 --- src/cdk/schematics/ng-generate/drag-drop/schema.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cdk/schematics/ng-generate/drag-drop/schema.json b/src/cdk/schematics/ng-generate/drag-drop/schema.json index cc7f69170d95..4ad396b91496 100644 --- a/src/cdk/schematics/ng-generate/drag-drop/schema.json +++ b/src/cdk/schematics/ng-generate/drag-drop/schema.json @@ -7,6 +7,9 @@ "path": { "type": "string", "format": "path", + "$default": { + "$source": "workingDirectory" + }, "description": "The path to create the component.", "visible": false },