File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
schematics/angular/application Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 2727 "projects" : {
2828 "type" : " object" ,
2929 "patternProperties" : {
30- "^(?:@[a-z0-9-~][a-z0-9-._~]* \/ )?[a-z0-9-~][a-z0-9-._~]* $" : {
30+ "^(?:@[a-zA-Z0-9_-]+ \/ )?[a-zA-Z0-9_-]+ $" : {
3131 "$ref" : " #/definitions/project"
3232 }
3333 },
Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ export default function (options: ApplicationOptions): Rule {
301301 const isRootApp = options . projectRoot !== undefined ;
302302 const appDir = isRootApp
303303 ? normalize ( options . projectRoot || '' )
304- : join ( normalize ( newProjectRoot ) , options . name ) ;
304+ : join ( normalize ( newProjectRoot ) , strings . dasherize ( options . name ) ) ;
305305 const sourceDir = `${ appDir } /src/app` ;
306306
307307 const e2eOptions : E2eOptions = {
Original file line number Diff line number Diff line change @@ -451,4 +451,20 @@ describe('Application Schematic', () => {
451451 expect ( content ) . toContain ( 'not IE 11' ) ;
452452 expect ( content ) . toContain ( 'not IE 9-10' ) ;
453453 } ) ;
454+
455+ it ( `should create kebab-case project folder names with camelCase project name` , async ( ) => {
456+ const options : ApplicationOptions = { ...defaultOptions , name : 'myCool' } ;
457+ const tree = await schematicRunner . runSchematicAsync ( 'application' , options , workspaceTree )
458+ . toPromise ( ) ;
459+ const exists = tree . exists ( '/projects/my-cool/.browserslistrc' ) ;
460+ expect ( exists ) . toBeTrue ( ) ;
461+ } ) ;
462+
463+ it ( `should create kebab-case project folder names with PascalCase project name` , async ( ) => {
464+ const options : ApplicationOptions = { ...defaultOptions , name : 'MyCool' } ;
465+ const tree = await schematicRunner . runSchematicAsync ( 'application' , options , workspaceTree )
466+ . toPromise ( ) ;
467+ const exists = tree . exists ( '/projects/my-cool/.browserslistrc' ) ;
468+ expect ( exists ) . toBeTrue ( ) ;
469+ } ) ;
454470} ) ;
You can’t perform that action at this time.
0 commit comments