neex 0.6.8 → 0.6.10
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.
|
@@ -93,89 +93,29 @@ function addDevCommands(program) {
|
|
|
93
93
|
.option('-e, --ext <extensions...>', 'File extensions to watch (default: js,mjs,json,ts,tsx,jsx)')
|
|
94
94
|
.option('-d, --delay <ms>', 'Delay before restart in milliseconds', parseInt)
|
|
95
95
|
.option('--clear', 'Clear console on restart')
|
|
96
|
-
.option('--verbose', 'Verbose output')
|
|
97
|
-
.option('--info', 'Show detailed information during startup')
|
|
98
96
|
.option('--signal <signal>', 'Signal to send to processes on restart', 'SIGTERM')
|
|
99
97
|
.action(async (file, options) => {
|
|
100
98
|
try {
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if (!file || file.trim() === '') {
|
|
108
|
-
console.error(chalk_1.default.red(`${figures_1.default.cross} neex dev: Error - No file specified!`));
|
|
109
|
-
console.error(chalk_1.default.yellow(`${figures_1.default.pointer} Usage: neex dev <file>`));
|
|
110
|
-
console.error(chalk_1.default.yellow(`${figures_1.default.pointer} Example: neex dev src/server.ts`));
|
|
111
|
-
process.exit(1);
|
|
112
|
-
}
|
|
113
|
-
// Get the best command to run the file
|
|
114
|
-
let commandToExecute;
|
|
115
|
-
let fileExtension;
|
|
116
|
-
try {
|
|
117
|
-
commandToExecute = await getBestCommand(file, showInfo);
|
|
118
|
-
fileExtension = path.extname(file).toLowerCase();
|
|
119
|
-
}
|
|
120
|
-
catch (error) {
|
|
121
|
-
console.error(chalk_1.default.red(`${figures_1.default.cross} neex dev: ${error instanceof Error ? error.message : 'Unknown error occurred'}`));
|
|
122
|
-
process.exit(1);
|
|
123
|
-
}
|
|
124
|
-
// Setup watch configuration
|
|
125
|
-
const watchPaths = options.watch ? [...options.watch, './'] : ['./'];
|
|
126
|
-
const ignorePatterns = options.ignore || [
|
|
127
|
-
'node_modules/**',
|
|
128
|
-
'.git/**',
|
|
129
|
-
'*.log',
|
|
130
|
-
'dist/**',
|
|
131
|
-
'build/**',
|
|
132
|
-
'coverage/**',
|
|
133
|
-
'.nyc_output/**',
|
|
134
|
-
'*.tmp',
|
|
135
|
-
'*.temp',
|
|
136
|
-
'.DS_Store',
|
|
137
|
-
'Thumbs.db'
|
|
138
|
-
];
|
|
139
|
-
const extensions = options.ext || ['js', 'mjs', 'json', 'ts', 'tsx', 'jsx', 'vue', 'svelte'];
|
|
140
|
-
// Log configuration only if --info flag is set
|
|
141
|
-
if (showInfo) {
|
|
142
|
-
console.log(chalk_1.default.blue(`${figures_1.default.info} neex dev: Configuration:`));
|
|
143
|
-
console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Target: ${chalk_1.default.cyan(file)}`));
|
|
144
|
-
console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Runtime: ${chalk_1.default.cyan(fileExtension === '.ts' || fileExtension === '.mts' || fileExtension === '.cts' ? 'TypeScript' : 'JavaScript')}`));
|
|
145
|
-
console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Watch paths: ${chalk_1.default.cyan(watchPaths.join(', '))}`));
|
|
146
|
-
console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Extensions: ${chalk_1.default.cyan(extensions.join(', '))}`));
|
|
147
|
-
console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Restart delay: ${chalk_1.default.cyan(options.delay || 1000)}ms`));
|
|
148
|
-
console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Clear console: ${chalk_1.default.cyan(options.clear ? 'Yes' : 'No')}`));
|
|
149
|
-
if (options.verbose) {
|
|
150
|
-
console.log(chalk_1.default.blue(`${figures_1.default.info} neex dev: Verbose mode enabled - showing detailed logs`));
|
|
151
|
-
}
|
|
152
|
-
console.log(chalk_1.default.green(`${figures_1.default.tick} neex dev: Starting file watcher and process manager...`));
|
|
153
|
-
console.log(chalk_1.default.green(`${figures_1.default.tick} neex dev: Launching ${chalk_1.default.cyan(path.basename(file))} with auto-restart capability...`));
|
|
154
|
-
console.log(chalk_1.default.blue(`${figures_1.default.info} neex dev: Press Ctrl+C to stop the development server`));
|
|
155
|
-
console.log(chalk_1.default.gray(`${'='.repeat(60)}`));
|
|
156
|
-
}
|
|
157
|
-
// Create DevRunner instance
|
|
158
|
-
devRunner = new dev_runner_js_1.DevRunner({
|
|
159
|
-
runnerName: 'neex dev',
|
|
160
|
-
parallel: false,
|
|
161
|
-
color: options.color,
|
|
162
|
-
showTiming: options.timing,
|
|
163
|
-
prefix: options.prefix,
|
|
164
|
-
stopOnError: options.stopOnError,
|
|
165
|
-
printOutput: options.output,
|
|
166
|
-
minimalOutput: options.minimal,
|
|
167
|
-
ignore: ignorePatterns,
|
|
168
|
-
delay: options.delay || 1000,
|
|
99
|
+
const devRunner = new dev_runner_js_1.DevRunner({
|
|
100
|
+
showInfo: false,
|
|
101
|
+
watch: options.watch,
|
|
102
|
+
ignore: options.ignore,
|
|
103
|
+
ext: options.ext,
|
|
104
|
+
delay: options.delay,
|
|
169
105
|
clearConsole: options.clear,
|
|
170
|
-
verbose: options.verbose,
|
|
171
|
-
showInfo: showInfo,
|
|
172
106
|
signal: options.signal,
|
|
173
|
-
|
|
107
|
+
runnerName: 'neex dev',
|
|
108
|
+
parallel: false,
|
|
109
|
+
printOutput: true,
|
|
110
|
+
color: true,
|
|
111
|
+
showTiming: true,
|
|
112
|
+
prefix: true,
|
|
113
|
+
stopOnError: false,
|
|
114
|
+
minimalOutput: false,
|
|
174
115
|
groupOutput: false,
|
|
175
116
|
isServerMode: false
|
|
176
117
|
});
|
|
177
|
-
|
|
178
|
-
await devRunner.start([commandToExecute]);
|
|
118
|
+
devRunner.start([await getBestCommand(file, false)]);
|
|
179
119
|
}
|
|
180
120
|
catch (error) {
|
|
181
121
|
console.error(chalk_1.default.red(`${figures_1.default.cross} neex dev: Fatal error occurred`));
|
package/dist/src/dev-runner.js
CHANGED
|
@@ -58,7 +58,7 @@ class DevRunner {
|
|
|
58
58
|
ignore: this.options.ignore,
|
|
59
59
|
ext: this.options.ext,
|
|
60
60
|
delay: this.options.delay,
|
|
61
|
-
verbose:
|
|
61
|
+
verbose: false // Always set to false to hide watcher logs
|
|
62
62
|
};
|
|
63
63
|
this.fileWatcher = new watcher_1.FileWatcher(watchOptions);
|
|
64
64
|
this.fileWatcher.on('change', (event) => {
|
|
@@ -68,10 +68,6 @@ class DevRunner {
|
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
async handleFileChange(event) {
|
|
71
|
-
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
72
|
-
if (this.options.showInfo) {
|
|
73
|
-
logger_1.default.printLine(`${prefix} File changed: ${chalk_1.default.yellow(event.relativePath)}`, 'info');
|
|
74
|
-
}
|
|
75
71
|
if (this.options.clearConsole) {
|
|
76
72
|
console.clear();
|
|
77
73
|
}
|