diff --git a/renderer/CreateForm.js b/renderer/CreateForm.js index da3422e..00410f2 100644 --- a/renderer/CreateForm.js +++ b/renderer/CreateForm.js @@ -85,7 +85,7 @@ class CreateForm extends React.Component { const { name, type, dirname } = this.state const appType = appTypes[type] const { install } = appType - const args = [ ...install.split(' '), name ] + const args = [ ...install(name).split(' ') ] update(pushLog([ 'npx', ...args ].join(' '))) update(pushLog('')) const promise = run('npx', args, { @@ -209,7 +209,7 @@ class CreateForm extends React.Component { h(Text, { fontSize: 1, my: 2 }, 'This will run: ', h(Code, { color: 'cyan' }, - [ 'npx', appType.install, name].join(' ') + [ 'npx', appType.install(name)].join(' ') ) ), pending && h(Text, { color: 'blue' }, 'Creating App...'), diff --git a/renderer/constants.js b/renderer/constants.js index a6970fc..cd34bf2 100644 --- a/renderer/constants.js +++ b/renderer/constants.js @@ -13,7 +13,7 @@ const modes = { const appTypes = { react: { name: 'React App', - install: 'create-react-app', + install: (name) => `create-react-app ${name}`, defaults: { type: 'create-react-app', port: 3000, @@ -22,7 +22,7 @@ const appTypes = { }, next: { name: 'Next.js App', - install: 'create-next-app', + install: (name) => `create-next-app ${name}`, defaults: { type: 'create-next-app', port: 3000, @@ -31,7 +31,7 @@ const appTypes = { }, gatsby: { name: 'Gatsby App', - install: 'gatsby-cli new', + install: (name) => `gatsby-cli new ${name}`, defaults: { type: 'gatsby-cli', port: 8000, @@ -40,7 +40,7 @@ const appTypes = { }, razzle: { name: 'Razzle App', - install: 'create-razzle-app', + install: (name) => `create-razzle-app ${name}`, defaults: { type: 'create-razzle-app', port: 3000, @@ -49,7 +49,7 @@ const appTypes = { }, nuxt: { name: 'Vue App', - install: 'vue create -d', + install: (name) => `vue create -d ${name}`, defaults: { type: 'create-vue-app', port: 8080, @@ -58,12 +58,21 @@ const appTypes = { }, preact: { name: 'Preact App', - install: 'preact-cli create default', + install: (name) => `preact-cli create default ${name}`, defaults: { type: 'preact-cli', port: 8080, run: 'run start' } + }, + reactStatic: { + name: 'React Static', + install: (name) => `react-static create --template=blank --name=${name}`, + defaults: { + type: 'react-static', + port: 3000, + run: 'run start' + } } }