Comparing version 2.6.3 to 2.6.4
17
07.js
@@ -5,2 +5,3 @@ #!/usr/bin/env node | ||
const cra = require('./commands/cra'); | ||
const vite = require('./commands/vite'); | ||
const gh = require('./commands/gh'); | ||
@@ -74,2 +75,18 @@ const umb = require('./commands/umb'); | ||
program | ||
.command('vite') | ||
.description( | ||
'Create a React App using create-react-app with 07_vite_template' | ||
) | ||
.option( | ||
'-n --name <projectName>', | ||
`Specify a project name ${'(e.g. byggma-kalkulator)'.meta}` | ||
) | ||
.action((options, command) => { | ||
if (options.debug) { | ||
console.error('Called %s with options %o', command.name(), options); | ||
} | ||
vite(options); | ||
}); | ||
program | ||
.command('craumb') | ||
@@ -76,0 +93,0 @@ .description('Create a React / Umb9 project') |
@@ -29,2 +29,4 @@ /* | ||
options.name && console.log(`Project name: ${options.name.info}`); | ||
options.start && | ||
console.log(`Starting project when ready since "-s" flag specified`.info); | ||
Object.values(options).length > 0 && console.log('#'.meta, '\n'); | ||
@@ -39,22 +41,14 @@ | ||
if (!exists) { | ||
// execSync( | ||
// `npm create vite ${name} -- --template react-ts && code ${name} && cd ${name} && npm i && ${ | ||
// process.platform === ('darwin' || 'linux') | ||
// ? `open http://localhost:3000/` | ||
// : `start http://localhost:3000/` | ||
// } && npm run dev`, | ||
// { | ||
// stdio: 'inherit', | ||
// } | ||
// ); | ||
execSync( | ||
`npx degit 07-media-sor/07_vite_template ${name} && code ${name} && cd ${name} && npm i && ${ | ||
process.platform === ('darwin' || 'linux') | ||
? `open http://localhost:3000/` | ||
: `start http://localhost:3000/` | ||
} && npm run start`, | ||
{ | ||
if (options.start === true) { | ||
execSync( | ||
`npx --yes create-react-app ${name} --template 07 && cd ${name} && yarn && yarn start && code .`, | ||
{ | ||
stdio: 'inherit', | ||
} | ||
); | ||
} else { | ||
execSync(`npx --yes create-react-app ${name} --template 07`, { | ||
stdio: 'inherit', | ||
} | ||
); | ||
}); | ||
} | ||
rl.close('success'); | ||
@@ -61,0 +55,0 @@ } else { |
{ | ||
"name": "07-cli", | ||
"version": "2.6.3", | ||
"version": "2.6.4", | ||
"description": "A command line tool for 07 organization", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69752
743