Skip to content

new: user: newProjectRoot CLI argument for "library" schematic #19650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/schematics/angular/library/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`;
Expand Down
6 changes: 6 additions & 0 deletions packages/schematics/angular/library/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down