11const path = require ( 'path' ) ;
22const fs = require ( 'fs' ) ;
3- const { spawn } = require ( 'child_process' ) ;
3+ const { spawn} = require ( 'child_process' ) ;
44
55module . exports = function reactfulInit ( config ) {
66 return new Promise ( ( resolve , reject ) => {
77 const pmCommand = config . useYarn ? 'yarn' : 'npm' ;
8- const { appName, appPath } = config ;
8+ const { appName, appPath} = config ;
99 const packageJson = {
1010 name : appName ,
1111 version : '0.1.0' ,
@@ -27,19 +27,15 @@ module.exports = function reactfulInit(config) {
2727 'prod-stop' : `pm2 stop ${ appName } Prod` ,
2828 'prod-reload' : `pm2 reload --update-env ${ appName } Prod` ,
2929 'prod-logs' : `pm2 logs ${ appName } Prod` ,
30- _reactful_commands : '_reactful_commands' ,
30+ _reactful_commands : '_reactful_commands'
3131 } ,
3232 babel : {
33- presets : [
34- 'react' ,
35- [ 'env' , { targets : { node : 'current' } } ] ,
36- 'stage-2' ,
37- ] ,
33+ presets : [ 'react' , [ 'env' , { targets : { node : 'current' } } ] , 'stage-2' ]
3834 } ,
3935 jest : {
4036 modulePaths : [ './src' ] ,
41- testPathIgnorePatterns : [ '/node_modules/' ] ,
42- } ,
37+ testPathIgnorePatterns : [ '/node_modules/' ]
38+ }
4339 } ;
4440
4541 fs . writeFileSync (
@@ -55,23 +51,15 @@ module.exports = function reactfulInit(config) {
5551 const reactfulJson = {
5652 main : 'main.js' ,
5753 styles : 'styles.js' ,
58- vendor : 'vendor.js' ,
54+ vendor : 'vendor.js'
5955 } ;
6056
6157 fs . writeFileSync (
6258 path . resolve ( appPath , '.reactful.json' ) ,
6359 JSON . stringify ( reactfulJson , null , 2 )
6460 ) ;
6561
66- const {
67- main : mainDeps ,
68- dev : devDeps ,
69- full : fullDeps ,
70- } = require ( './dependencies' ) ;
71-
72- if ( config . appType === 'full' ) {
73- mainDeps . push ( ...fullDeps ) ;
74- }
62+ const { main : mainDeps , dev : devDeps } = require ( './dependencies' ) ;
7563
7664 const installProdCmd = config . useYarn ? 'yarn add' : 'npm install --save' ;
7765 const installDevCmd = config . useYarn
@@ -87,7 +75,7 @@ module.exports = function reactfulInit(config) {
8775 {
8876 shell : true ,
8977 stdio : 'inherit' ,
90- cwd : path . resolve ( appPath ) ,
78+ cwd : path . resolve ( appPath )
9179 }
9280 ) ;
9381
0 commit comments