Skip to content

Commit 66230b3

Browse files
clydinalexeagle
authored andcommitted
fix(@angular-devkit/core): allow scoped names for workspace projects
Library projects support scoped package names as project names.
1 parent cbce3d3 commit 66230b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/angular_devkit/core/src/workspace/definitions.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ export class ProjectDefinitionCollection extends DefinitionCollection<ProjectDef
201201
}
202202

203203
private _validateName(name: string): void {
204-
if (typeof name !== 'string' || !/^[a-zA-Z][.0-9a-zA-Z]*(-[.0-9a-zA-Z]*)*$/.test(name)) {
205-
throw new Error('Project name must be a valid npm package name without a scope.');
204+
if (typeof name !== 'string' || !/^(?:@\w[\w\.-]*\/)?\w[\w\.-]*$/.test(name)) {
205+
throw new Error('Project name must be a valid npm package name.');
206206
}
207207
}
208208

0 commit comments

Comments
 (0)