neex 0.6.13 → 0.6.15

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.
@@ -43,35 +43,27 @@ async function fileExists(filePath) {
43
43
  }
44
44
  }
45
45
  // Helper function to determine the best command to run the file
46
- async function getBestCommand(filePath, showInfo) {
46
+ async function getBestCommand(filePath) {
47
47
  const ext = path.extname(filePath).toLowerCase();
48
48
  const absolutePath = path.resolve(process.cwd(), filePath);
49
49
  // Check if file exists
50
50
  if (!(await fileExists(absolutePath))) {
51
51
  throw new Error(`File not found: ${filePath}`);
52
52
  }
53
- if (showInfo) {
54
- console.log(chalk_1.default.blue(`${figures_1.default.info} neex dev: Analyzing ${chalk_1.default.cyan(path.basename(filePath))}`));
55
- }
53
+ console.log(chalk_1.default.blue(`${figures_1.default.info} neex dev: Analyzing file type for ${chalk_1.default.cyan(filePath)}`));
56
54
  switch (ext) {
57
55
  case '.ts':
58
56
  case '.mts':
59
57
  case '.cts':
60
- if (showInfo) {
61
- console.log(chalk_1.default.green(`${figures_1.default.tick} neex dev: TypeScript detected, ready to run`));
62
- }
58
+ console.log(chalk_1.default.green(`${figures_1.default.tick} neex dev: Detected TypeScript file, using ts-node for execution`));
63
59
  return `npx ts-node ${filePath}`;
64
60
  case '.js':
65
61
  case '.mjs':
66
62
  case '.cjs':
67
- if (showInfo) {
68
- console.log(chalk_1.default.green(`${figures_1.default.tick} neex dev: JavaScript detected, ready to run`));
69
- }
63
+ console.log(chalk_1.default.green(`${figures_1.default.tick} neex dev: Detected JavaScript file, using node for execution`));
70
64
  return `node ${filePath}`;
71
65
  default:
72
- if (showInfo) {
73
- console.log(chalk_1.default.yellow(`${figures_1.default.warning} neex dev: Unknown file type, using Node.js`));
74
- }
66
+ console.log(chalk_1.default.yellow(`${figures_1.default.warning} neex dev: Unknown file extension ${ext}, attempting to run with node`));
75
67
  return `node ${filePath}`;
76
68
  }
77
69
  }
@@ -93,30 +85,83 @@ function addDevCommands(program) {
93
85
  .option('-e, --ext <extensions...>', 'File extensions to watch (default: js,mjs,json,ts,tsx,jsx)')
94
86
  .option('-d, --delay <ms>', 'Delay before restart in milliseconds', parseInt)
95
87
  .option('--clear', 'Clear console on restart')
88
+ .option('--verbose', 'Verbose output')
96
89
  .option('--signal <signal>', 'Signal to send to processes on restart', 'SIGTERM')
97
90
  .action(async (file, options) => {
98
91
  try {
99
- const devRunner = new dev_runner_js_1.DevRunner({
100
- watch: options.watch,
101
- ignore: options.ignore,
102
- ext: options.ext,
103
- delay: options.delay,
104
- clearConsole: options.clear,
105
- signal: options.signal,
92
+ console.log(chalk_1.default.blue(`${figures_1.default.info} neex dev: Starting enhanced development server...`));
93
+ console.log(chalk_1.default.blue(`${figures_1.default.info} neex dev: Target file: ${chalk_1.default.cyan(file)}`));
94
+ // Validate file parameter
95
+ if (!file || file.trim() === '') {
96
+ console.error(chalk_1.default.red(`${figures_1.default.cross} neex dev: Error - No file specified!`));
97
+ console.error(chalk_1.default.yellow(`${figures_1.default.pointer} Usage: neex dev <file>`));
98
+ console.error(chalk_1.default.yellow(`${figures_1.default.pointer} Example: neex dev src/server.ts`));
99
+ process.exit(1);
100
+ }
101
+ // Get the best command to run the file
102
+ let commandToExecute;
103
+ try {
104
+ commandToExecute = await getBestCommand(file);
105
+ }
106
+ catch (error) {
107
+ console.error(chalk_1.default.red(`${figures_1.default.cross} neex dev: ${error instanceof Error ? error.message : 'Unknown error occurred'}`));
108
+ process.exit(1);
109
+ }
110
+ // Setup watch configuration
111
+ const watchPaths = options.watch ? [...options.watch, './'] : ['./'];
112
+ const ignorePatterns = options.ignore || [
113
+ 'node_modules/**',
114
+ '.git/**',
115
+ '*.log',
116
+ 'dist/**',
117
+ 'build/**',
118
+ 'coverage/**',
119
+ '.nyc_output/**',
120
+ '*.tmp',
121
+ '*.temp',
122
+ '.DS_Store',
123
+ 'Thumbs.db'
124
+ ];
125
+ const extensions = options.ext || ['js', 'mjs', 'json', 'ts', 'tsx', 'jsx', 'vue', 'svelte'];
126
+ // Log configuration
127
+ console.log(chalk_1.default.blue(`${figures_1.default.info} neex dev: Configuration:`));
128
+ console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Command: ${chalk_1.default.cyan(commandToExecute)}`));
129
+ console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Watch paths: ${chalk_1.default.cyan(watchPaths.join(', '))}`));
130
+ console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Extensions: ${chalk_1.default.cyan(extensions.join(', '))}`));
131
+ console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Ignore patterns: ${chalk_1.default.cyan(ignorePatterns.length)} patterns`));
132
+ console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Restart delay: ${chalk_1.default.cyan(options.delay || 1000)}ms`));
133
+ console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Clear console: ${chalk_1.default.cyan(options.clear ? 'Yes' : 'No')}`));
134
+ console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Signal: ${chalk_1.default.cyan(options.signal)}`));
135
+ if (options.verbose) {
136
+ console.log(chalk_1.default.blue(`${figures_1.default.info} neex dev: Verbose mode enabled - showing detailed logs`));
137
+ }
138
+ console.log(chalk_1.default.green(`${figures_1.default.tick} neex dev: Starting file watcher and process manager...`));
139
+ // Create DevRunner instance
140
+ devRunner = new dev_runner_js_1.DevRunner({
106
141
  runnerName: 'neex dev',
107
142
  parallel: false,
108
- printOutput: true,
109
- color: true,
110
- showTiming: true,
111
- prefix: true,
112
- stopOnError: false,
143
+ color: options.color,
144
+ showTiming: options.timing,
145
+ prefix: options.prefix,
146
+ stopOnError: options.stopOnError,
147
+ printOutput: options.output,
113
148
  minimalOutput: options.minimal,
114
- groupOutput: false,
115
- isServerMode: false,
149
+ watch: watchPaths,
150
+ ignore: ignorePatterns,
151
+ ext: extensions,
152
+ delay: options.delay || 1000,
153
+ clearConsole: options.clear,
154
+ verbose: options.verbose,
155
+ signal: options.signal,
116
156
  restartOnChange: true,
117
- verbose: false
157
+ groupOutput: false,
158
+ isServerMode: false
118
159
  });
119
- devRunner.start([await getBestCommand(file, false)]);
160
+ // Start the development server
161
+ console.log(chalk_1.default.green(`${figures_1.default.tick} neex dev: Launching ${chalk_1.default.cyan(path.basename(file))} with auto-restart capability...`));
162
+ console.log(chalk_1.default.blue(`${figures_1.default.info} neex dev: Press Ctrl+C to stop the development server`));
163
+ console.log(chalk_1.default.gray(`${'='.repeat(60)}`));
164
+ await devRunner.start([commandToExecute]);
120
165
  }
121
166
  catch (error) {
122
167
  console.error(chalk_1.default.red(`${figures_1.default.cross} neex dev: Fatal error occurred`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neex",
3
- "version": "0.6.13",
3
+ "version": "0.6.15",
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",