@mulanjs/mulanjs 1.0.1-dev.20260310071649 → 1.0.1-dev.20260314141520

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mulanjs/mulanjs",
3
- "version": "1.0.1-dev.20260310071649",
3
+ "version": "1.0.1-dev.20260314141520",
4
4
  "description": "A powerful, secure, and enterprise-grade JavaScript framework.",
5
5
  "main": "dist/mulan.js",
6
6
  "module": "dist/mulan.esm.js",
package/src/cli/index.js CHANGED
@@ -492,16 +492,38 @@ if (app) {
492
492
  console.log(` 2. npm install`);
493
493
  console.log(` 3. npm run dev`);
494
494
 
495
- // Auto-install VS Code Extension
495
+ // Auto-install extension
496
496
  try {
497
- const vsixPath = path.join(__dirname, 'extensions', 'mulanjs-vscode-1.0.1.vsix');
497
+ const vsixPath = path.join(__dirname, 'extensions', 'mulanjs-vscode-1.1.0.vsix');
498
498
  if (fs.existsSync(vsixPath)) {
499
- console.log('\nšŸ“¦ Installing MulanJS VS Code Extension...');
500
- shell(`code --install-extension "${vsixPath}" --force`);
501
- console.log('āœ… Extension installed successfully!');
499
+ console.log('\nšŸ“¦ Installing MulanJS Extension...');
500
+
501
+ let installed = false;
502
+
503
+ // Try Antigravity first then VS Code
504
+ const commands = [
505
+ { cmd: 'antigravity', name: 'Antigravity' },
506
+ { cmd: 'code', name: 'VS Code' }
507
+ ];
508
+
509
+ for (const { cmd, name } of commands) {
510
+ try {
511
+ execSync(`${cmd} --version`, { stdio: 'ignore' });
512
+ console.log(`šŸš€ Installing extension via ${name} CLI...`);
513
+ shell(`${cmd} --install-extension "${vsixPath}" --force`);
514
+ console.log(`āœ… Extension installed successfully in ${name}!`);
515
+ installed = true;
516
+ } catch (e) {
517
+ // Command not found, continue to next
518
+ }
519
+ }
520
+
521
+ if (!installed) {
522
+ console.warn('āš ļø Could not auto-install extension (Neither Antigravity nor VS Code CLI found).');
523
+ }
502
524
  }
503
525
  } catch (e) {
504
- console.warn('āš ļø Could not install VS Code extension (VS Code CLI not found or failed).');
526
+ console.warn('āš ļø Extension installation process failed.');
505
527
  }
506
528
 
507
529
 
@@ -603,24 +625,40 @@ program
603
625
  .description('Install the MulanJS VS Code Extension for icons and syntax highlighting')
604
626
  .action(async () => {
605
627
  await printBanner();
606
- console.log('šŸ“¦ Locating MulanJS VS Code Extension...');
628
+ console.log('šŸ“¦ Locating MulanJS Extension...');
607
629
  try {
608
- // Find where mulanjs is installed. If run via npx, __dirname is the cli folder.
609
- const vsixPath = path.join(__dirname, 'extensions', 'mulanjs-vscode-1.0.1.vsix');
630
+ const vsixPath = path.join(__dirname, 'extensions', 'mulanjs-vscode-1.1.0.vsix');
610
631
 
611
632
  if (!fs.existsSync(vsixPath)) {
612
633
  console.error('āŒ Error: Extension file not found at:', vsixPath);
613
- console.log('Ensure you have a full installation of the mulanjs package.');
614
634
  return;
615
635
  }
616
636
 
617
- console.log('šŸš€ Installing extension via VS Code CLI...');
618
- shell(`code --install-extension "${vsixPath}" --force`);
619
- console.log('āœ… Success! Restart VS Code to see your new .mujs icons.');
637
+ let installed = false;
638
+ const commands = [
639
+ { cmd: 'antigravity', name: 'Antigravity' },
640
+ { cmd: 'code', name: 'VS Code' }
641
+ ];
642
+
643
+ for (const { cmd, name } of commands) {
644
+ try {
645
+ execSync(`${cmd} --version`, { stdio: 'ignore' });
646
+ console.log(`šŸš€ Installing extension via ${name} CLI...`);
647
+ shell(`${cmd} --install-extension "${vsixPath}" --force`);
648
+ console.log(`āœ… Success! Restart ${name} to see your new .mujs icons.`);
649
+ installed = true;
650
+ } catch (e) {
651
+ // Command not found
652
+ }
653
+ }
654
+
655
+ if (!installed) {
656
+ console.error('\nāŒ Failed to install extension.');
657
+ console.log('Make sure "antigravity" or "code" (VS Code CLI) is in your PATH.');
658
+ console.log('Manual Install: You can also drag the .vsix file from your node_modules/mulanjs/src/cli/extensions into your editor.');
659
+ }
620
660
  } catch (e) {
621
661
  console.error('\nāŒ Failed to install extension.');
622
- console.log('Make sure "code" (VS Code CLI) is in your PATH.');
623
- console.log('Manual Install: You can also drag the .vsix file from your node_modules/mulanjs/src/cli/extensions into VS Code.');
624
662
  }
625
663
  });
626
664