Skip to content
Merged
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/angular/cli/lib/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"projects": {
"type": "object",
"patternProperties": {
"^(?:@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$": {
"^(?:@[a-zA-Z0-9_-]+\/)?[a-zA-Z0-9_-]+$": {
"$ref": "#/definitions/project"
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/schematics/angular/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export default function (options: ApplicationOptions): Rule {
const isRootApp = options.projectRoot !== undefined;
const appDir = isRootApp
? normalize(options.projectRoot || '')
: join(normalize(newProjectRoot), options.name);
: join(normalize(newProjectRoot), strings.dasherize(options.name));
const sourceDir = `${appDir}/src/app`;

const e2eOptions: E2eOptions = {
Expand Down
16 changes: 16 additions & 0 deletions packages/schematics/angular/application/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,4 +451,20 @@ describe('Application Schematic', () => {
expect(content).toContain('not IE 11');
expect(content).toContain('not IE 9-10');
});

it(`should create kebab-case project folder names with camelCase project name`, async () => {
const options: ApplicationOptions = { ...defaultOptions, name: 'myCool' };
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)
.toPromise();
const exists = tree.exists('/projects/my-cool/.browserslistrc');
expect(exists).toBeTrue();
});

it(`should create kebab-case project folder names with PascalCase project name`, async () => {
const options: ApplicationOptions = { ...defaultOptions, name: 'MyCool' };
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)
.toPromise();
const exists = tree.exists('/projects/my-cool/.browserslistrc');
expect(exists).toBeTrue();
});
});