zerostart-cli 0.0.47 → 0.0.49

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/.eslintrc.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "root": true,
3
+ "parser": "@typescript-eslint/parser",
4
+ "plugins": [
5
+ "@typescript-eslint"
6
+ ],
7
+ "extends": [
8
+ "eslint:recommended",
9
+ "plugin:@typescript-eslint/recommended"
10
+ ],
11
+ "env": {
12
+ "node": true,
13
+ "es2020": true
14
+ },
15
+ "rules": {
16
+ "@typescript-eslint/no-explicit-any": "off",
17
+ "@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }]
18
+ },
19
+ "ignorePatterns": ["out", "dist", "**/*.d.ts"]
20
+ }
package/README.md CHANGED
@@ -96,6 +96,13 @@ zerostart ml-py my-model
96
96
  | `zerostart test` | Set up a testing framework |
97
97
  | `zerostart add [feature]` | Add features to an existing project |
98
98
 
99
+ ### Development Commands
100
+
101
+ | Command | Description |
102
+ | :--- | :--- |
103
+ | `npm run lint` | Run ESLint to check for code issues |
104
+ | `npm run compile` | Compile TypeScript into JavaScript |
105
+
99
106
  ### Deployment
100
107
 
101
108
  | Command | Description |
package/out/cli.js CHANGED
@@ -143,6 +143,34 @@ async function initializeProject(name, language, type, options) {
143
143
  console.log(chalk_1.default.bold.green(' ✅ Success! Your project is ready!'));
144
144
  console.log(chalk_1.default.gray(' Location: ') + chalk_1.default.cyan(projectPath));
145
145
  console.log();
146
+ console.log(chalk_1.default.green(' ✨ Pro Tip: Try our new VS Code Extension for a better integrated experience! Search "ZeroStart" in the VS Code Marketplace.'));
147
+ console.log();
148
+ try {
149
+ const { installExtension } = await inquirer_1.default.prompt([{
150
+ type: 'confirm',
151
+ name: 'installExtension',
152
+ message: 'Would you like to install the ZeroStart VS Code extension?',
153
+ default: false
154
+ }]);
155
+ if (installExtension) {
156
+ const extSpinner = (0, ora_1.default)({ text: 'Installing VS Code extension...', color: 'cyan' }).start();
157
+ await new Promise((resolve) => {
158
+ (0, child_process_1.exec)('code --install-extension zerostart.zerostart-vscode', (error) => {
159
+ if (error) {
160
+ extSpinner.warn(chalk_1.default.yellow('Failed to install automatically. Please install it manually from the extensions tab (ID: zerostart.zerostart-vscode).'));
161
+ }
162
+ else {
163
+ extSpinner.succeed(chalk_1.default.green('VS Code extension installed successfully!'));
164
+ }
165
+ resolve();
166
+ });
167
+ });
168
+ console.log();
169
+ }
170
+ }
171
+ catch (e) {
172
+ // Ignore prompt errors if any
173
+ }
146
174
  // ── CP languages: open browser + interactive terminal ─────────────
147
175
  if (type === types_1.ProjectType.DSAPractice && [types_1.ProjectLanguage.Python, types_1.ProjectLanguage.Java, types_1.ProjectLanguage.CPP].includes(language)) {
148
176
  const cpChoice = options.cpInterface || 'both';
@@ -185,7 +213,7 @@ async function initializeProject(name, language, type, options) {
185
213
  program
186
214
  .name('zerostart')
187
215
  .description('Create and deploy a complete project with one command')
188
- .version('0.0.47');
216
+ .version('0.0.48');
189
217
  // zerostart init [project-name]
190
218
  program
191
219
  .command('init [project-name]')
@@ -523,7 +551,7 @@ program
523
551
  return;
524
552
  }
525
553
  const latestVersion = stdout.trim();
526
- const currentVersion = '0.0.47';
554
+ const currentVersion = '0.0.48';
527
555
  if (latestVersion === currentVersion) {
528
556
  spinner.succeed(chalk_1.default.green('You are using the latest version!'));
529
557
  }
@@ -546,6 +574,90 @@ program
546
574
  console.log(chalk_1.default.gray(' Explore commands, templates, and deployment guides at the site.'));
547
575
  openUrl(docsUrl);
548
576
  });
577
+ // zerostart info / stats
578
+ program
579
+ .command('stats')
580
+ .alias('info')
581
+ .description('Show live stats for ZeroStart')
582
+ .action(async () => {
583
+ showBanner();
584
+ const spinner = (0, ora_1.default)({ text: 'Fetching live stats...', color: 'cyan' }).start();
585
+ const currentVersion = program.version() || '0.0.48';
586
+ let latestVersion = currentVersion;
587
+ let npmDownloads = '890+';
588
+ let vscodeInstalls = '50+';
589
+ // Helper to fetch using https
590
+ const https = require('https');
591
+ const fetchJSON = (url, options = {}) => {
592
+ return new Promise((resolve, reject) => {
593
+ const req = https.request(url, options, (res) => {
594
+ let data = '';
595
+ res.on('data', (chunk) => data += chunk);
596
+ res.on('end', () => {
597
+ try {
598
+ resolve(JSON.parse(data));
599
+ }
600
+ catch (e) {
601
+ resolve(null);
602
+ }
603
+ });
604
+ });
605
+ req.on('error', () => resolve(null));
606
+ if (options.body)
607
+ req.write(options.body);
608
+ req.end();
609
+ });
610
+ };
611
+ try {
612
+ // Get NPM Downloads (last-month)
613
+ const npmData = await fetchJSON('https://api.npmjs.org/downloads/point/last-month/zerostart-cli');
614
+ if (npmData && npmData.downloads) {
615
+ npmDownloads = npmData.downloads.toLocaleString() + '+';
616
+ }
617
+ // Get VS Code Installs via Marketplace Query
618
+ const bodyStr = JSON.stringify({
619
+ filters: [{ criteria: [{ filterType: 7, value: 'zerostart.zerostart-vscode' }] }],
620
+ flags: 2
621
+ });
622
+ const vsData = await fetchJSON('https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery', {
623
+ method: 'POST',
624
+ headers: {
625
+ 'Accept': 'application/json;api-version=3.0-preview.1',
626
+ 'Content-Type': 'application/json',
627
+ 'Content-Length': Buffer.byteLength(bodyStr)
628
+ },
629
+ body: bodyStr
630
+ });
631
+ if (vsData && vsData.results && vsData.results[0] && vsData.results[0].extensions && vsData.results[0].extensions[0]) {
632
+ const ext = vsData.results[0].extensions[0];
633
+ const stat = ext.statistics.find((s) => s.statisticName === 'install');
634
+ if (stat)
635
+ vscodeInstalls = stat.value.toLocaleString() + '+';
636
+ }
637
+ // Get latest version
638
+ latestVersion = await new Promise((resolve) => {
639
+ (0, child_process_1.exec)('npm view zerostart-cli version', (error, stdout) => {
640
+ if (error || !stdout)
641
+ resolve(currentVersion);
642
+ else
643
+ resolve(stdout.trim());
644
+ });
645
+ });
646
+ spinner.stop();
647
+ console.log(chalk_1.default.bold.cyan(' 📊 Live Stats:'));
648
+ console.log(chalk_1.default.gray(' ----------------------------------------'));
649
+ console.log(chalk_1.default.gray(' NPM Downloads (Last Month): ') + chalk_1.default.white(npmDownloads));
650
+ console.log(chalk_1.default.gray(' VS Code Installs: ') + chalk_1.default.white(vscodeInstalls));
651
+ console.log(chalk_1.default.gray(' Latest Version: ') + chalk_1.default.white('v' + Math.max(0, parseInt(latestVersion.replace('v', ''), 10)) ? latestVersion : latestVersion));
652
+ console.log(chalk_1.default.gray(' ----------------------------------------\n'));
653
+ if (latestVersion && latestVersion !== currentVersion && latestVersion !== 'unknown') {
654
+ console.log(chalk_1.default.bold.yellow(` A new version of ZeroStart is available! Run `) + chalk_1.default.cyan(`npm i -g zerostart-cli`) + chalk_1.default.bold.yellow(` to update.`));
655
+ }
656
+ }
657
+ catch (e) {
658
+ spinner.fail(chalk_1.default.red('Failed to fetch some stats.'));
659
+ }
660
+ });
549
661
  // Standalone deployment commands
550
662
  program
551
663
  .command('deploy-vercel')
package/out/extension.js CHANGED
@@ -42,6 +42,7 @@ function activate(context) {
42
42
  // Set default auto-select family attempt timeout to 1000ms if available
43
43
  // This helps with connection issues in dual-stack (IPv4/IPv6) environments
44
44
  try {
45
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
45
46
  const net = require('net');
46
47
  if (typeof net.setDefaultAutoSelectFamilyAttemptTimeout === 'function') {
47
48
  net.setDefaultAutoSelectFamilyAttemptTimeout(1000);
@@ -51,7 +52,7 @@ function activate(context) {
51
52
  catch (error) {
52
53
  console.warn('Failed to set auto-select family attempt timeout:', error);
53
54
  }
54
- let disposable = vscode.commands.registerCommand('zerostart.create', async (projectName) => {
55
+ const disposable = vscode.commands.registerCommand('zerostart.create', async (projectName) => {
55
56
  const projectManager = new ProjectManager_1.ProjectManager();
56
57
  await projectManager.start(projectName);
57
58
  });
package/package.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "name": "zerostart-cli",
3
3
  "displayName": "ZeroStart",
4
4
  "bin": {
5
- "zerostart": "./out/cli.js"
5
+ "zerostart": "out/cli.js"
6
6
  },
7
7
  "description": "Create and deploy a complete project with one command.",
8
- "version": "0.0.47",
8
+ "version": "0.0.49",
9
9
  "engines": {
10
10
  "vscode": "^1.85.0"
11
11
  },
@@ -49,4 +49,4 @@
49
49
  "openai": "^6.25.0",
50
50
  "ora": "^5.4.1"
51
51
  }
52
- }
52
+ }