@@ -14,7 +14,7 @@ generate.prototype.createComponentFile = function(re, componentName, answersInne
1414 const _modFile = file . replace ( re , componentName ) ;
1515 const __modFile = this . createModFile ( _modFile , answersInner , componentName ) ;
1616 console . log ( __modFile ) ;
17- fs . writeFileSync ( path . join ( process . cwd ( ) , 'src/components' , module , componentName + '.react. js' ) , __modFile , 'utf-8' ) ;
17+ fs . writeFileSync ( path . join ( process . cwd ( ) , 'src/components' , module , componentName + '.js' ) , __modFile , 'utf-8' ) ;
1818}
1919
2020/**
@@ -29,31 +29,31 @@ generate.prototype.generateComponent = function(type, module, componentName, ans
2929 try {
3030 if ( componentName !== undefined ) {
3131 const exists = fs . accessSync ( path . join ( process . cwd ( ) , getSourceDirectory ( ) , 'components' , module , componentName ) , fs . F_OK ) ;
32- cb ( `${ componentName } .react. js already exists` ) ;
32+ cb ( `${ componentName } .js already exists` ) ;
3333 return ;
3434 }
3535 else {
36- const exists = fs . accessSync ( path . join ( process . cwd ( ) , getSourceDirectory ( ) , 'components' , module + '.react. js' ) , fs . F_OK ) ;
37- cb ( `${ componentName } .react. js already exists` ) ;
36+ const exists = fs . accessSync ( path . join ( process . cwd ( ) , getSourceDirectory ( ) , 'components' , module + '.js' ) , fs . F_OK ) ;
37+ cb ( `${ componentName } .js already exists` ) ;
3838 return ;
3939 }
4040 }
4141 catch ( e ) {
42- const file = fs . readFileSync ( path . join ( __dirname , '..' , `templates/components/${ type } -component.react. js` ) , 'utf-8' ) ;
42+ const file = fs . readFileSync ( path . join ( __dirname , '..' , `templates/components/${ type } -component.js` ) , 'utf-8' ) ;
4343 const re = / < n a m e > / gi;
4444 if ( componentName !== undefined ) {
4545 try {
4646 if ( answers . propTypes === 'no' ) {
4747 fs . mkdirSync ( path . join ( process . cwd ( ) , getSourceDirectory ( ) , 'components' , module ) , 0755 ) ;
4848 const _modFile = file . replace ( re , componentName ) ;
49- fs . writeFileSync ( path . join ( process . cwd ( ) , getSourceDirectory ( ) , 'components' , module , componentName + '.react. js' ) , _modFile , 'utf-8' ) ;
49+ fs . writeFileSync ( path . join ( process . cwd ( ) , getSourceDirectory ( ) , 'components' , module , componentName + '.js' ) , _modFile , 'utf-8' ) ;
5050 cb ( true ) ;
5151 }
5252 else {
5353 fs . mkdirSync ( path . join ( process . cwd ( ) , getSourceDirectory ( ) , 'components' , module ) , 0755 ) ;
5454 const _modFile = file . replace ( re , componentName ) ;
5555 const __modFile = this . createModFile ( _modFile , answersInner , componentName ) ;
56- fs . writeFileSync ( path . join ( process . cwd ( ) , getSourceDirectory ( ) , 'components' , module , componentName + '.react. js' ) , __modFile , 'utf-8' ) ;
56+ fs . writeFileSync ( path . join ( process . cwd ( ) , getSourceDirectory ( ) , 'components' , module , componentName + '.js' ) , __modFile , 'utf-8' ) ;
5757 cb ( true ) ;
5858 }
5959 }
@@ -64,7 +64,7 @@ generate.prototype.generateComponent = function(type, module, componentName, ans
6464 else {
6565 const _modFile = file . replace ( re , componentName ) ;
6666 const __modFile = this . createModFile ( _modFile , answersInner , componentName ) ;
67- fs . writeFileSync ( path . join ( process . cwd ( ) , getSourceDirectory ( ) , 'components' , module , componentName + '.react. js' ) , __modFile , 'utf-8' ) ;
67+ fs . writeFileSync ( path . join ( process . cwd ( ) , getSourceDirectory ( ) , 'components' , module , componentName + '.js' ) , __modFile , 'utf-8' ) ;
6868 cb ( true ) ;
6969 }
7070 }
@@ -73,7 +73,7 @@ generate.prototype.generateComponent = function(type, module, componentName, ans
7373 try {
7474 const _modFile = file . replace ( re , module ) ;
7575 const __modFile = this . createModFile ( _modFile , answersInner , module ) ;
76- fs . writeFileSync ( path . join ( process . cwd ( ) , getSourceDirectory ( ) , 'components' , module + '.react. js' ) , __modFile , 'utf-8' ) ;
76+ fs . writeFileSync ( path . join ( process . cwd ( ) , getSourceDirectory ( ) , 'components' , module + '.js' ) , __modFile , 'utf-8' ) ;
7777 cb ( true ) ;
7878 }
7979 catch ( ex ) {
0 commit comments