zerostart-cli 0.0.27 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/cli.js +29 -21
- package/package.json +1 -1
package/out/cli.js
CHANGED
|
@@ -83,7 +83,7 @@ function showGitHubTokenHelp() {
|
|
|
83
83
|
program
|
|
84
84
|
.name('zerostart')
|
|
85
85
|
.description('Create and deploy a complete project with one command')
|
|
86
|
-
.version('0.0.
|
|
86
|
+
.version('0.0.30');
|
|
87
87
|
program
|
|
88
88
|
.command('deploy-vercel')
|
|
89
89
|
.description('Deploy the current project to Vercel')
|
|
@@ -335,13 +335,15 @@ program
|
|
|
335
335
|
name: 'visibility',
|
|
336
336
|
message: 'Select Repository Visibility:',
|
|
337
337
|
choices: ['Public', 'Private'],
|
|
338
|
-
default: 'Private'
|
|
338
|
+
default: 'Private',
|
|
339
|
+
when: (answers) => answers.type !== types_1.ProjectType.DSAPractice
|
|
339
340
|
},
|
|
340
341
|
{
|
|
341
342
|
type: 'confirm',
|
|
342
343
|
name: 'createRemote',
|
|
343
344
|
message: 'Push to GitHub?',
|
|
344
|
-
default: false
|
|
345
|
+
default: false,
|
|
346
|
+
when: (answers) => answers.type !== types_1.ProjectType.DSAPractice
|
|
345
347
|
}
|
|
346
348
|
]);
|
|
347
349
|
let githubToken = null;
|
|
@@ -420,21 +422,23 @@ program
|
|
|
420
422
|
await templateManager.createProjectStructure(config);
|
|
421
423
|
spinner.succeed(chalk_1.default.green('Project structure created'));
|
|
422
424
|
// 2. Git Init & Initial Commits
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
fs.
|
|
431
|
-
|
|
425
|
+
if (config.type !== types_1.ProjectType.DSAPractice) {
|
|
426
|
+
spinner.start(chalk_1.default.cyan('Initializing Git repository...'));
|
|
427
|
+
await gitManager.init(config.path);
|
|
428
|
+
await gitManager.commit(config.path, "Initial commit");
|
|
429
|
+
// Update README and create second commit
|
|
430
|
+
try {
|
|
431
|
+
const readmePath = path.join(config.path, 'README.md');
|
|
432
|
+
if (fs.existsSync(readmePath)) {
|
|
433
|
+
fs.appendFileSync(readmePath, '\n\nProject initialized by ZeroStart CLI');
|
|
434
|
+
await gitManager.commit(config.path, "Update README.md");
|
|
435
|
+
}
|
|
432
436
|
}
|
|
437
|
+
catch (error) {
|
|
438
|
+
console.warn(`Failed to update README: ${error}`);
|
|
439
|
+
}
|
|
440
|
+
spinner.succeed(chalk_1.default.green('Git repository initialized'));
|
|
433
441
|
}
|
|
434
|
-
catch (error) {
|
|
435
|
-
console.warn(`Failed to update README: ${error}`);
|
|
436
|
-
}
|
|
437
|
-
spinner.succeed(chalk_1.default.green('Git repository initialized'));
|
|
438
442
|
// 3. GitHub
|
|
439
443
|
if (answers.createRemote) {
|
|
440
444
|
spinner.start(chalk_1.default.cyan('Creating GitHub repository...'));
|
|
@@ -487,22 +491,26 @@ program
|
|
|
487
491
|
console.log(chalk_1.default.gray(' - ') + chalk_1.default.cyan(`cd ${name}`));
|
|
488
492
|
console.log(chalk_1.default.gray(' - ') + chalk_1.default.cyan('code .') + chalk_1.default.gray(' (or your favorite editor)'));
|
|
489
493
|
console.log();
|
|
490
|
-
// Conditional logic based on language
|
|
494
|
+
// Conditional logic based on language OR project type
|
|
491
495
|
const isWebLanguage = [types_1.ProjectLanguage.React, types_1.ProjectLanguage.HTMLCSS].includes(config.language);
|
|
492
|
-
|
|
496
|
+
const isPractice = config.type === types_1.ProjectType.DSAPractice;
|
|
497
|
+
if (!isWebLanguage || isPractice) {
|
|
493
498
|
const gdbLinks = {
|
|
494
499
|
[types_1.ProjectLanguage.Python]: 'https://www.onlinegdb.com/online_python_compiler',
|
|
495
500
|
[types_1.ProjectLanguage.Java]: 'https://www.onlinegdb.com/online_java_compiler',
|
|
496
501
|
[types_1.ProjectLanguage.CPP]: 'https://www.onlinegdb.com/online_c++_compiler',
|
|
497
|
-
[types_1.ProjectLanguage.NodeJS]: 'https://www.onlinegdb.com/online_node.js_compiler'
|
|
502
|
+
[types_1.ProjectLanguage.NodeJS]: 'https://www.onlinegdb.com/online_node.js_compiler',
|
|
503
|
+
[types_1.ProjectLanguage.React]: 'https://www.onlinegdb.com/' // Fallback
|
|
498
504
|
};
|
|
499
|
-
const link = gdbLinks[config.language];
|
|
505
|
+
const link = gdbLinks[config.language] || 'https://www.onlinegdb.com/';
|
|
500
506
|
if (link) {
|
|
501
507
|
console.log(chalk_1.default.bold.yellow(' Practice Online:'));
|
|
502
508
|
console.log(chalk_1.default.gray(' - ') + chalk_1.default.cyan(link));
|
|
509
|
+
console.log(chalk_1.default.gray(' (Opening in your browser...)'));
|
|
503
510
|
console.log();
|
|
511
|
+
openUrl(link);
|
|
504
512
|
}
|
|
505
|
-
return; // Skip deployment
|
|
513
|
+
return; // Skip deployment
|
|
506
514
|
}
|
|
507
515
|
// Deployment Integration (Only for Web)
|
|
508
516
|
const { deploymentTarget } = await inquirer_1.default.prompt([
|