File tree 3 files changed +18
-2
lines changed
schematics/angular/application
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 27
27
"projects" : {
28
28
"type" : " object" ,
29
29
"patternProperties" : {
30
- "^(?:@[a-z0-9-~][a-z0-9-._~]* \/ )?[a-z0-9-~][a-z0-9-._~]* $" : {
30
+ "^(?:@[a-zA-Z0-9_-]+ \/ )?[a-zA-Z0-9_-]+ $" : {
31
31
"$ref" : " #/definitions/project"
32
32
}
33
33
},
Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ export default function (options: ApplicationOptions): Rule {
300
300
const isRootApp = options . projectRoot !== undefined ;
301
301
const appDir = isRootApp
302
302
? normalize ( options . projectRoot || '' )
303
- : join ( normalize ( newProjectRoot ) , options . name ) ;
303
+ : join ( normalize ( newProjectRoot ) , strings . dasherize ( options . name ) ) ;
304
304
const sourceDir = `${ appDir } /src/app` ;
305
305
306
306
const e2eOptions : E2eOptions = {
Original file line number Diff line number Diff line change @@ -451,4 +451,20 @@ describe('Application Schematic', () => {
451
451
expect ( content ) . toContain ( 'not IE 11' ) ;
452
452
expect ( content ) . toContain ( 'not IE 9-10' ) ;
453
453
} ) ;
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
+ } ) ;
454
470
} ) ;
You can’t perform that action at this time.
0 commit comments