From 77738dfe8d69ceaf994667add6b5a679aa2c4370 Mon Sep 17 00:00:00 2001 From: Emir Herrera Date: Fri, 18 Dec 2020 23:34:47 -0600 Subject: [PATCH] new: user: newProjectRoot CLI argument for "library" schematic --- packages/schematics/angular/library/index.ts | 2 +- packages/schematics/angular/library/schema.json | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/schematics/angular/library/index.ts b/packages/schematics/angular/library/index.ts index 2ed7ef293354..444c8b0a0c81 100644 --- a/packages/schematics/angular/library/index.ts +++ b/packages/schematics/angular/library/index.ts @@ -187,7 +187,7 @@ export default function (options: LibraryOptions): Rule { } const workspace = await getWorkspace(host); - const newProjectRoot = workspace.extensions.newProjectRoot as (string | undefined) || ''; + const newProjectRoot = options.newProjectRoot || workspace.extensions.newProjectRoot as (string | undefined) || ''; const scopeFolder = scopeName ? strings.dasherize(scopeName) + '/' : ''; const folderName = `${scopeFolder}${strings.dasherize(options.name)}`; diff --git a/packages/schematics/angular/library/schema.json b/packages/schematics/angular/library/schema.json index 427c8ffc0a69..57a85c16de35 100644 --- a/packages/schematics/angular/library/schema.json +++ b/packages/schematics/angular/library/schema.json @@ -21,6 +21,12 @@ "description": "The path at which to create the library's public API file, relative to the workspace root.", "default": "public-api" }, + "newProjectRoot": { + "type": "string", + "format": "path", + "description": "Override newProjectRoot path for new library.", + "alias": "r" + }, "prefix": { "type": "string", "format": "html-selector",