zerostart-cli 0.0.45 → 0.0.46

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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/out/cli.js +75 -28
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -31,6 +31,7 @@ npm install -g zerostart-cli
31
31
  - **🚀 One-Command Setup**: Scaffold, initialize Git, and deploy in seconds.
32
32
  - **📦 Pre-built Templates**: React, Next.js, Express, C++, Java, Python, and more.
33
33
  - **🐙 GitHub Integration**: Auto-create repositories and push with human-style commits.
34
+ - **🏆 CP Smart Practice**: Choose between an online compiler, local terminal, or both for your competitive programming practice.
34
35
  - **🌐 Instant Deployment**: Vercel and Netlify support built-in.
35
36
 
36
37
  ---
package/out/cli.js CHANGED
@@ -144,26 +144,31 @@ async function initializeProject(name, language, type, options) {
144
144
  console.log(chalk_1.default.gray(' Location: ') + chalk_1.default.cyan(projectPath));
145
145
  console.log();
146
146
  // ── CP languages: open browser + interactive terminal ─────────────
147
- if ([types_1.ProjectLanguage.Python, types_1.ProjectLanguage.Java, types_1.ProjectLanguage.CPP].includes(language)) {
148
- const gdbLinks = {
149
- [types_1.ProjectLanguage.Python]: 'https://www.onlinegdb.com/online_python_compiler',
150
- [types_1.ProjectLanguage.Java]: 'https://www.onlinegdb.com/online_java_compiler',
151
- [types_1.ProjectLanguage.CPP]: 'https://www.onlinegdb.com/online_c++_compiler'
152
- };
153
- const link = gdbLinks[language];
154
- console.log(chalk_1.default.bold.yellow(' Practice Online:'));
155
- console.log(chalk_1.default.gray(' - ') + chalk_1.default.cyan(link));
156
- console.log(chalk_1.default.gray(' (Opening in your browser...)'));
157
- openUrl(link);
158
- const terminalCmds = {
159
- [types_1.ProjectLanguage.Python]: 'start cmd /k "python"',
160
- [types_1.ProjectLanguage.Java]: `start cmd /k "cd /d ${projectPath} && javac src/main/java/com/example/Main.java && java -cp src/main/java com.example.Main"`,
161
- [types_1.ProjectLanguage.CPP]: `start cmd /k "cd /d ${projectPath} && g++ main.cpp -o main && main"`,
162
- };
163
- const termCmd = terminalCmds[language];
164
- if (termCmd) {
165
- console.log(chalk_1.default.bold.yellow(' Opening interactive terminal...'));
166
- (0, child_process_1.exec)(termCmd, { cwd: projectPath });
147
+ if (type === types_1.ProjectType.DSAPractice && [types_1.ProjectLanguage.Python, types_1.ProjectLanguage.Java, types_1.ProjectLanguage.CPP].includes(language)) {
148
+ const cpChoice = options.cpInterface || 'both';
149
+ if (cpChoice === 'online' || cpChoice === 'both') {
150
+ const gdbLinks = {
151
+ [types_1.ProjectLanguage.Python]: 'https://www.onlinegdb.com/online_python_compiler',
152
+ [types_1.ProjectLanguage.Java]: 'https://www.onlinegdb.com/online_java_compiler',
153
+ [types_1.ProjectLanguage.CPP]: 'https://www.onlinegdb.com/online_c++_compiler'
154
+ };
155
+ const link = gdbLinks[language];
156
+ console.log(chalk_1.default.bold.yellow(' Practice Online:'));
157
+ console.log(chalk_1.default.gray(' - ') + chalk_1.default.cyan(link));
158
+ console.log(chalk_1.default.gray(' (Opening in your browser...)'));
159
+ openUrl(link);
160
+ }
161
+ if (cpChoice === 'terminal' || cpChoice === 'both') {
162
+ const terminalCmds = {
163
+ [types_1.ProjectLanguage.Python]: 'start cmd /k "python"',
164
+ [types_1.ProjectLanguage.Java]: `start cmd /k "cd /d ${projectPath} && javac src/main/java/com/example/Main.java && java -cp src/main/java com.example.Main"`,
165
+ [types_1.ProjectLanguage.CPP]: `start cmd /k "cd /d ${projectPath} && g++ main.cpp -o main && main"`,
166
+ };
167
+ const termCmd = terminalCmds[language];
168
+ if (termCmd) {
169
+ console.log(chalk_1.default.bold.yellow(' Opening interactive terminal...'));
170
+ (0, child_process_1.exec)(termCmd, { cwd: projectPath });
171
+ }
167
172
  }
168
173
  }
169
174
  console.log(chalk_1.default.bold('\n Get started:'));
@@ -180,7 +185,7 @@ async function initializeProject(name, language, type, options) {
180
185
  program
181
186
  .name('zerostart')
182
187
  .description('Create and deploy a complete project with one command')
183
- .version('0.0.45');
188
+ .version('0.0.46');
184
189
  // zerostart init [project-name]
185
190
  program
186
191
  .command('init [project-name]')
@@ -518,7 +523,7 @@ program
518
523
  return;
519
524
  }
520
525
  const latestVersion = stdout.trim();
521
- const currentVersion = '0.0.45';
526
+ const currentVersion = '0.0.46';
522
527
  if (latestVersion === currentVersion) {
523
528
  spinner.succeed(chalk_1.default.green('You are using the latest version!'));
524
529
  }
@@ -593,9 +598,30 @@ const shortcuts = [
593
598
  { cmd: 'ml-cpp', lang: types_1.ProjectLanguage.CPP, type: types_1.ProjectType.MLProject },
594
599
  ];
595
600
  shortcuts.forEach(s => {
596
- program.command(s.cmd).argument('[name]', 'Project name', `my-${s.cmd}`).action(n => {
601
+ program.command(s.cmd).argument('[name]', 'Project name', `my-${s.cmd}`).action(async (n) => {
597
602
  showBanner();
598
- initializeProject(n, s.lang, s.type, { isPublic: false, createRemote: false, githubToken: null, authMethod: 'none' });
603
+ let cpInterface = 'both';
604
+ if (s.type === types_1.ProjectType.DSAPractice) {
605
+ const ans = await inquirer_1.default.prompt([{
606
+ type: 'list',
607
+ name: 'cpInterface',
608
+ message: 'Choose Practice Interface:',
609
+ choices: [
610
+ { name: '🌐 Online Compiler (browser)', value: 'online' },
611
+ { name: '💻 Local Terminal (cmd)', value: 'terminal' },
612
+ { name: '🔥 Both', value: 'both' }
613
+ ],
614
+ default: 'both'
615
+ }]);
616
+ cpInterface = ans.cpInterface;
617
+ }
618
+ await initializeProject(n, s.lang, s.type, {
619
+ isPublic: false,
620
+ createRemote: false,
621
+ githubToken: null,
622
+ authMethod: 'none',
623
+ cpInterface
624
+ });
599
625
  });
600
626
  });
601
627
  async function startWizard(initialName) {
@@ -613,6 +639,7 @@ async function startWizard(initialName) {
613
639
  let language;
614
640
  let github = false;
615
641
  let githubToken = null;
642
+ let cpInterface = 'both';
616
643
  const BACK = '< Back';
617
644
  const CAT_WEB = '🌐 Web Development (React, TS, HTML/CSS)';
618
645
  const CAT_CP = '🏆 Competitive Programming (C++, Java, Python)';
@@ -696,9 +723,28 @@ async function startWizard(initialName) {
696
723
  }
697
724
  }
698
725
  else {
699
- // CP projects skip straight to done
700
- github = false;
701
- step = 7; // jump past all web dev steps
726
+ const ans = await inquirer_1.default.prompt([{
727
+ type: 'list',
728
+ name: 'cpInterface',
729
+ message: 'Choose Practice Interface:',
730
+ choices: [
731
+ { name: '🌐 Online Compiler (browser)', value: 'online' },
732
+ { name: '💻 Local Terminal (cmd)', value: 'terminal' },
733
+ { name: '🔥 Both', value: 'both' },
734
+ new inquirer_1.default.Separator(),
735
+ { name: BACK, value: 'back' }
736
+ ],
737
+ default: 'both'
738
+ }]);
739
+ if (ans.cpInterface === 'back') {
740
+ name = undefined;
741
+ step--;
742
+ }
743
+ else {
744
+ cpInterface = ans.cpInterface;
745
+ github = false;
746
+ step = 7; // CP projects skip to execution
747
+ }
702
748
  }
703
749
  // ── STEP 5: GitHub Token ────────────────────────────────────────────
704
750
  }
@@ -778,7 +824,8 @@ async function startWizard(initialName) {
778
824
  isPublic: false,
779
825
  createRemote: !!githubToken,
780
826
  githubToken,
781
- authMethod: 'none'
827
+ authMethod: 'none',
828
+ cpInterface: cpInterface
782
829
  });
783
830
  // ── Post-creation: Web Dev deploy / local run ─────────────────────
784
831
  const deployChoice = startWizard._deployChoice;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "zerostart": "./out/cli.js"
6
6
  },
7
7
  "description": "Create and deploy a complete project with one command.",
8
- "version": "0.0.45",
8
+ "version": "0.0.46",
9
9
  "engines": {
10
10
  "vscode": "^1.85.0"
11
11
  },