neex 0.6.70 → 0.6.71

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/dist/src/cli.js CHANGED
@@ -11,6 +11,12 @@ const figures_1 = __importDefault(require("figures"));
11
11
  const { version } = require('../../package.json');
12
12
  function cli() {
13
13
  const program = new commander_1.Command();
14
+ // Special handling for the 'init' command to avoid conflicts
15
+ if (process.argv[2] === 'init') {
16
+ (0, index_js_1.addInitCommand)(program);
17
+ program.parse(process.argv);
18
+ return; // Exit early
19
+ }
14
20
  // Initialize cleanup handlers
15
21
  const cleanupHandlers = [];
16
22
  program
@@ -18,7 +24,7 @@ function cli() {
18
24
  .description('Professional script runner with nodemon and PM2 functionality')
19
25
  .version(version);
20
26
  // Add all command groups
21
- (0, index_js_1.addInitCommand)(program);
27
+ (0, index_js_1.addInitCommand)(program); // Keep it for --help
22
28
  (0, index_js_1.addRunCommands)(program);
23
29
  (0, index_js_1.addServerCommands)(program);
24
30
  const devCommands = (0, index_js_1.addDevCommands)(program);
@@ -9,24 +9,26 @@ const chalk_1 = __importDefault(require("chalk"));
9
9
  const figures_1 = __importDefault(require("figures"));
10
10
  function addInitCommand(program) {
11
11
  program
12
- .command('init')
13
- .description('Initialize a new neex project by running `npx create-neex`')
14
- .action(() => {
15
- console.log(chalk_1.default.green(`${figures_1.default.pointer} Running npx create-neex...`));
16
- const command = 'npx';
17
- const args = ['create-neex'];
12
+ .command('init [projectName]', { isDefault: false })
13
+ .description('Initialize a new neex project by running `npm create neex@latest`')
14
+ .action((projectName) => {
15
+ console.log(chalk_1.default.green(`${figures_1.default.pointer} Running npm create neex@latest...`));
16
+ const command = 'npm';
17
+ // Use 'create' which is an alias for 'init' in modern npm versions
18
+ const args = ['create', 'neex@latest'];
19
+ if (projectName) {
20
+ args.push(projectName);
21
+ }
18
22
  // Use spawn to execute the command and stream the output
19
23
  const child = (0, child_process_1.spawn)(command, args, {
20
24
  stdio: 'inherit',
21
- shell: true // Needed for 'npx' on some systems, especially Windows
25
+ shell: true // Needed for 'npm' on some systems, especially Windows
22
26
  });
23
27
  child.on('close', (code) => {
24
28
  if (code !== 0) {
25
- console.error(chalk_1.default.red(`${figures_1.default.cross} Error initializing project. 'npx create-neex' exited with code ${code}`));
26
- }
27
- else {
28
- console.log(chalk_1.default.green(`${figures_1.default.tick} Project initialized successfully!`));
29
+ console.error(chalk_1.default.red(`${figures_1.default.cross} Error initializing project. 'npm create neex@latest' exited with code ${code}`));
29
30
  }
31
+ // No success message here because create-neex provides its own.
30
32
  });
31
33
  child.on('error', (error) => {
32
34
  console.error(chalk_1.default.red(`${figures_1.default.cross} Failed to start command: ${error.message}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neex",
3
- "version": "0.6.70",
3
+ "version": "0.6.71",
4
4
  "description": "The Modern Build System for Polyrepo-in-Monorepo Architecture",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",