create-tanstack-app
Advanced tools
Comparing version 1.0.1 to 1.0.2
33
index.js
@@ -1,10 +0,29 @@ | ||
#!/usr/bin/env node | ||
const { exec } = require('child_process'); | ||
const degit = require('degit'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
// Require the create.js script to handle the initialization | ||
require('./create'); | ||
async function initApp() { | ||
const projectName = process.argv[2] || 'my-tanstack-app'; // default to 'my-tanstack-app' if no name is provided | ||
const dest = path.join(process.cwd(), projectName); | ||
// If you want to call the script from `create.js` directly, you can also define it here. | ||
// If needed, you could also provide further customization options for users or more handling. | ||
// Check if the destination already exists | ||
if (fs.existsSync(dest)) { | ||
console.log('Directory already exists. Please choose another name or delete the existing directory.'); | ||
return; | ||
} | ||
console.log(`Downloading Tanstack app template from GitHub...`); | ||
// Use degit to download the template | ||
const emitter = degit('SH20RAJ/tanstack-start', { cache: false, force: true }); | ||
emitter.on('info', info => console.log(info)); | ||
try { | ||
await emitter.clone(dest); | ||
console.log(`Template successfully downloaded! Navigate to ${dest} and start working on your project.`); | ||
} catch (error) { | ||
console.error('Error during template download:', error); | ||
} | ||
} | ||
initApp(); |
{ | ||
"name": "create-tanstack-app", | ||
"version": "1.0.1", | ||
"main": "index.js", | ||
"scripts": { | ||
"create": "node create.js" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"description": "A CLI tool to create a Tanstack app", | ||
"dependencies": { | ||
"degit": "^2.8.4" | ||
} | ||
} | ||
"name": "create-tanstack-app", | ||
"version": "1.0.2", | ||
"main": "index.js", | ||
"bin": { | ||
"create-gi": "./index.js" | ||
}, | ||
"author": "sh20raj", | ||
"license": "ISC", | ||
"description": "A CLI tool to create a Tanstack app", | ||
"dependencies": { | ||
"degit": "^2.8.4" | ||
} | ||
} |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
1
0
4198
3
23