create-nexus-app
Advanced tools
Comparing version 1.1.3 to 1.1.4
106
nexus.js
@@ -5,3 +5,6 @@ #!/usr/bin/env node | ||
const { exec } = require("child_process"); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
async function main(){ | ||
@@ -38,5 +41,5 @@ const inquirerModule = await import("inquirer"); | ||
]); | ||
const ora = (await import('ora')).default; | ||
if (answers.template === "Dashboard") { | ||
try{ | ||
try { | ||
const emitter = degit('NexusDesignSystem/template-dashboard', { | ||
@@ -47,20 +50,28 @@ cache: false, | ||
}); | ||
emitter.clone(`${answers.projectName}`).then(() => { | ||
console.log('Dashboard repository cloned successfully!'); | ||
}); | ||
await emitter.clone(`${answers.projectName}`); | ||
console.log('Dashboard repository cloned successfully!'); | ||
const projectPath = path.resolve(process.cwd(), answers.projectName); | ||
if (fs.existsSync(projectPath)) { | ||
process.chdir(projectPath); | ||
const spinner = ora('Installing dependencies...').start(); // Create a loading spinner | ||
exec("npm i", (error) => { | ||
if (error) { | ||
console.error("Error installing dependencies:", error); | ||
return; | ||
} | ||
console.log("Dependencies installed successfully."); | ||
}); | ||
exec("npm i", (error) => { | ||
spinner.stop(); // Stop the spinner when 'npm i' is done | ||
if (error) { | ||
console.error("Error installing dependencies:", error); | ||
return; | ||
} | ||
console.log("Dependencies installed successfully."); | ||
}); | ||
} else { | ||
console.error("Project directory not found:", projectPath); | ||
} | ||
} catch (error) { | ||
console.error("Error creating dashboard", error); | ||
} | ||
catch(error){ | ||
console.error("Error creating dashboard",error); | ||
} | ||
} | ||
} | ||
else if (answers.template == "Landing Page") { | ||
@@ -74,8 +85,15 @@ try{ | ||
emitter.clone(`${answers.projectName}`).then(() => { | ||
console.log("Landing Page repository cloned successfully!") | ||
}); | ||
await emitter.clone(`${answers.projectName}`); | ||
console.log('Dashboard repository cloned successfully!'); | ||
const projectPath = path.resolve(process.cwd(), answers.projectName); | ||
if (fs.existsSync(projectPath)) { | ||
process.chdir(projectPath); | ||
const spinner = ora('Installing dependencies...').start(); // Create a loading spinner | ||
exec("npm i", (error) => { | ||
spinner.stop(); // Stop the spinner when 'npm i' is done | ||
if (error) { | ||
@@ -87,8 +105,9 @@ console.error("Error installing dependencies:", error); | ||
}); | ||
} else { | ||
console.error("Project directory not found:", projectPath); | ||
} | ||
catch(error){ | ||
console.error("Error creating blank template",error); | ||
} | ||
} | ||
} catch (error) { | ||
console.error("Error creating dashboard", error); | ||
} | ||
} | ||
else if(answers.template == "Blank Template") { | ||
@@ -102,8 +121,15 @@ try{ | ||
emitter.clone(`${answers.projectName}`).then(() => { | ||
console.log('Blank Template repository cloned successfully!"'); | ||
}); | ||
await emitter.clone(`${answers.projectName}`); | ||
console.log('Dashboard repository cloned successfully!'); | ||
const projectPath = path.resolve(process.cwd(), answers.projectName); | ||
if (fs.existsSync(projectPath)) { | ||
process.chdir(projectPath); | ||
const spinner = ora('Installing dependencies...').start(); // Create a loading spinner | ||
exec("npm i", (error) => { | ||
spinner.stop(); // Stop the spinner when 'npm i' is done | ||
if (error) { | ||
@@ -115,16 +141,10 @@ console.error("Error installing dependencies:", error); | ||
}); | ||
} else { | ||
console.error("Project directory not found:", projectPath); | ||
} | ||
catch(error){ | ||
console.error("Error creating blank template",error); | ||
} | ||
} | ||
else { | ||
console.log(`Unsupported template: ${answers.framework}`); | ||
} catch (error) { | ||
console.error("Error creating dashboard", error); | ||
} | ||
console.log("Project initialized successfully!"); | ||
} | ||
} | ||
main(); |
{ | ||
"dependencies": { | ||
"child_process": "^1.0.2", | ||
"degit": "^2.8.4", | ||
"inquirer": "^9.2.11", | ||
"child_process": "^1.0.2" | ||
"ora": "^7.0.1" | ||
}, | ||
"name": "create-nexus-app", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"bin": { | ||
@@ -10,0 +11,0 @@ "create-nexus-app": "./nexus.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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
4637
120
4
2
+ Addedora@^7.0.1
+ Addedansi-regex@6.1.0(transitive)
+ Addedbl@5.1.0(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedchalk@5.3.0(transitive)
+ Addedcli-cursor@4.0.0(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@10.4.0(transitive)
+ Addedis-interactive@2.0.0(transitive)
+ Addedis-unicode-supported@1.3.0(transitive)
+ Addedlog-symbols@5.1.0(transitive)
+ Addedora@7.0.1(transitive)
+ Addedrestore-cursor@4.0.0(transitive)
+ Addedstdin-discarder@0.1.0(transitive)
+ Addedstring-width@6.1.0(transitive)
+ Addedstrip-ansi@7.1.0(transitive)