neex 0.6.43 → 0.6.45
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/build-manager.js +12 -12
- package/dist/src/dev-runner.js +8 -8
- package/dist/src/logger-process.js +11 -42
- package/dist/src/logger.js +3 -1
- package/dist/src/start-manager.js +17 -17
- package/dist/src/watcher.js +15 -10
- package/package.json +1 -1
|
@@ -32,7 +32,7 @@ const watcher_1 = require("./watcher");
|
|
|
32
32
|
const runner_1 = require("./runner");
|
|
33
33
|
const chalk_1 = __importDefault(require("chalk"));
|
|
34
34
|
const figures_1 = __importDefault(require("figures"));
|
|
35
|
-
const
|
|
35
|
+
const logger_process_1 = require("./logger-process");
|
|
36
36
|
const path = __importStar(require("path"));
|
|
37
37
|
const fs = __importStar(require("fs/promises"));
|
|
38
38
|
class BuildManager {
|
|
@@ -98,7 +98,7 @@ class BuildManager {
|
|
|
98
98
|
async handleFileChange(event) {
|
|
99
99
|
if (this.options.showInfo) {
|
|
100
100
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
101
|
-
|
|
101
|
+
logger_process_1.logger.printLine(`${prefix} File changed: ${chalk_1.default.yellow(event.relativePath)}`, 'info');
|
|
102
102
|
}
|
|
103
103
|
await this.rebuild();
|
|
104
104
|
}
|
|
@@ -108,7 +108,7 @@ class BuildManager {
|
|
|
108
108
|
}
|
|
109
109
|
catch (error) {
|
|
110
110
|
if (this.options.showInfo) {
|
|
111
|
-
|
|
111
|
+
logger_process_1.logger.printLine(`Failed to create output directory: ${error.message}`, 'error');
|
|
112
112
|
}
|
|
113
113
|
throw error;
|
|
114
114
|
}
|
|
@@ -121,12 +121,12 @@ class BuildManager {
|
|
|
121
121
|
await fs.rm(this.options.outputDir, { recursive: true, force: true });
|
|
122
122
|
if (this.options.showInfo) {
|
|
123
123
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
124
|
-
|
|
124
|
+
logger_process_1.logger.printLine(`${prefix} Cleaned output directory: ${chalk_1.default.yellow(this.options.outputDir)}`, 'info');
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
catch (error) {
|
|
128
128
|
if (this.options.showInfo) {
|
|
129
|
-
|
|
129
|
+
logger_process_1.logger.printLine(`Failed to clean output directory: ${error.message}`, 'error');
|
|
130
130
|
}
|
|
131
131
|
throw error;
|
|
132
132
|
}
|
|
@@ -252,8 +252,8 @@ class BuildManager {
|
|
|
252
252
|
if (this.options.watch) {
|
|
253
253
|
if (this.options.showInfo) {
|
|
254
254
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
logger_process_1.logger.printLine(`${prefix} Build completed. Watching for changes...`, 'info');
|
|
256
|
+
logger_process_1.logger.printLine(`${prefix} Press ${chalk_1.default.cyan('Ctrl+C')} to stop`, 'info');
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
}
|
|
@@ -263,7 +263,7 @@ class BuildManager {
|
|
|
263
263
|
}
|
|
264
264
|
if (this.options.showInfo) {
|
|
265
265
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
266
|
-
|
|
266
|
+
logger_process_1.logger.printLine(`${prefix} Rebuilding due to file changes...`, 'info');
|
|
267
267
|
}
|
|
268
268
|
// Stop current processes
|
|
269
269
|
if (this.runner) {
|
|
@@ -279,7 +279,7 @@ class BuildManager {
|
|
|
279
279
|
await this.runBuild();
|
|
280
280
|
if (this.options.showInfo) {
|
|
281
281
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
282
|
-
|
|
282
|
+
logger_process_1.logger.printLine(`${prefix} Rebuild completed. Watching for changes...`, 'info');
|
|
283
283
|
}
|
|
284
284
|
else {
|
|
285
285
|
// Show rebuild completion even without showInfo for watch mode
|
|
@@ -292,7 +292,7 @@ class BuildManager {
|
|
|
292
292
|
}
|
|
293
293
|
if (this.options.showInfo) {
|
|
294
294
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
295
|
-
|
|
295
|
+
logger_process_1.logger.printLine(`${prefix} Stopping build process...`, 'info');
|
|
296
296
|
}
|
|
297
297
|
// Stop file watcher
|
|
298
298
|
if (this.fileWatcher) {
|
|
@@ -306,9 +306,9 @@ class BuildManager {
|
|
|
306
306
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
307
307
|
const uptime = Math.floor((Date.now() - this.startTime.getTime()) / 1000);
|
|
308
308
|
const uptimeStr = this.formatUptime(uptime);
|
|
309
|
-
|
|
309
|
+
logger_process_1.logger.printLine(`${prefix} Build process stopped after ${uptimeStr}`, 'info');
|
|
310
310
|
if (this.buildCount > 0) {
|
|
311
|
-
|
|
311
|
+
logger_process_1.logger.printLine(`${prefix} Total builds: ${this.buildCount}`, 'info');
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
}
|
package/dist/src/dev-runner.js
CHANGED
|
@@ -9,7 +9,7 @@ const watcher_1 = require("./watcher");
|
|
|
9
9
|
const runner_1 = require("./runner");
|
|
10
10
|
const chalk_1 = __importDefault(require("chalk"));
|
|
11
11
|
const figures_1 = __importDefault(require("figures"));
|
|
12
|
-
const
|
|
12
|
+
const logger_process_1 = require("./logger-process");
|
|
13
13
|
class DevRunner {
|
|
14
14
|
constructor(options) {
|
|
15
15
|
this.commands = [];
|
|
@@ -70,7 +70,7 @@ class DevRunner {
|
|
|
70
70
|
async handleFileChange(event) {
|
|
71
71
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
72
72
|
if (this.options.showInfo) {
|
|
73
|
-
|
|
73
|
+
logger_process_1.logger.printLine(`${prefix} File changed: ${chalk_1.default.yellow(event.relativePath)}`, 'info');
|
|
74
74
|
}
|
|
75
75
|
if (this.options.clearConsole) {
|
|
76
76
|
console.clear();
|
|
@@ -103,7 +103,7 @@ class DevRunner {
|
|
|
103
103
|
}
|
|
104
104
|
catch (error) {
|
|
105
105
|
if (this.options.showInfo) {
|
|
106
|
-
|
|
106
|
+
logger_process_1.logger.printLine(`Execution failed: ${error.message}`, 'error');
|
|
107
107
|
}
|
|
108
108
|
return [];
|
|
109
109
|
}
|
|
@@ -157,14 +157,14 @@ class DevRunner {
|
|
|
157
157
|
// Run initial commands
|
|
158
158
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
159
159
|
if (this.options.showInfo) {
|
|
160
|
-
|
|
160
|
+
logger_process_1.logger.printLine(`${prefix} Starting development server...`, 'info');
|
|
161
161
|
}
|
|
162
162
|
await this.runCommands();
|
|
163
163
|
// Set up graceful shutdown
|
|
164
164
|
this.setupGracefulShutdown();
|
|
165
165
|
if (this.options.showInfo) {
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
logger_process_1.logger.printLine(`${prefix} Development server started. Watching for changes...`, 'info');
|
|
167
|
+
logger_process_1.logger.printLine(`${prefix} Press ${chalk_1.default.cyan('Ctrl+C')} to stop`, 'info');
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
async restart() {
|
|
@@ -173,7 +173,7 @@ class DevRunner {
|
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
175
|
if (this.options.showInfo) {
|
|
176
|
-
|
|
176
|
+
logger_process_1.logger.printLine(`${prefix} Restarting due to file changes...`, 'info');
|
|
177
177
|
}
|
|
178
178
|
this.restartCount++;
|
|
179
179
|
// Stop current processes
|
|
@@ -187,7 +187,7 @@ class DevRunner {
|
|
|
187
187
|
// Run commands again
|
|
188
188
|
await this.runCommands();
|
|
189
189
|
if (this.options.showInfo) {
|
|
190
|
-
|
|
190
|
+
logger_process_1.logger.printLine(`${prefix} Restart completed. Watching for changes...`, 'info');
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
async stop() {
|
|
@@ -3,46 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
// src/.logger-process.ts
|
|
6
|
+
exports.logger = void 0;
|
|
8
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
chalk_1.default.blue,
|
|
20
|
-
chalk_1.default.yellow,
|
|
21
|
-
chalk_1.default.green,
|
|
22
|
-
chalk_1.default.red
|
|
23
|
-
];
|
|
24
|
-
let hash = 0;
|
|
25
|
-
for (let i = 0; i < command.length; i++) {
|
|
26
|
-
hash = (hash << 5) - hash + command.charCodeAt(i);
|
|
27
|
-
hash |= 0;
|
|
28
|
-
}
|
|
29
|
-
return colors[Math.abs(hash) % colors.length];
|
|
30
|
-
}
|
|
31
|
-
log(data) {
|
|
32
|
-
this.print(data.toString(), process.stdout);
|
|
33
|
-
}
|
|
34
|
-
error(data) {
|
|
35
|
-
this.print(data.toString(), process.stderr, chalk_1.default.red);
|
|
36
|
-
}
|
|
37
|
-
print(data, stream, colorizer) {
|
|
38
|
-
const lines = data.split('\n').filter(line => line.trim().length > 0);
|
|
39
|
-
for (const line of lines) {
|
|
40
|
-
const coloredLine = colorizer ? colorizer(line) : line;
|
|
41
|
-
stream.write(`${this.prefix}${coloredLine}\n`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
info(message) {
|
|
45
|
-
console.log(`${this.prefix}${chalk_1.default.blue(message)}`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.LoggerProcess = LoggerProcess;
|
|
8
|
+
exports.logger = {
|
|
9
|
+
printLine: (message, level = "info") => {
|
|
10
|
+
const prefix = {
|
|
11
|
+
info: chalk_1.default.blue("i"),
|
|
12
|
+
warn: chalk_1.default.yellow("!"),
|
|
13
|
+
error: chalk_1.default.red("x"),
|
|
14
|
+
}[level];
|
|
15
|
+
console.log(`${prefix} ${message}`);
|
|
16
|
+
},
|
|
17
|
+
};
|
package/dist/src/logger.js
CHANGED
|
@@ -76,7 +76,9 @@ class Logger {
|
|
|
76
76
|
return chalk_1.default.hex(vibrantColors[colorIndex]);
|
|
77
77
|
}
|
|
78
78
|
formatPrefix(command) {
|
|
79
|
-
|
|
79
|
+
const color = this.commandColors.get(command) || chalk_1.default.white;
|
|
80
|
+
const prefix = `${command}:`.padEnd(this.prefixLength);
|
|
81
|
+
return color(prefix);
|
|
80
82
|
}
|
|
81
83
|
bufferOutput(output) {
|
|
82
84
|
const currentBuffer = this.outputBuffer.get(output.command) || [];
|
|
@@ -32,7 +32,7 @@ const watcher_1 = require("./watcher");
|
|
|
32
32
|
const runner_1 = require("./runner");
|
|
33
33
|
const chalk_1 = __importDefault(require("chalk"));
|
|
34
34
|
const figures_1 = __importDefault(require("figures"));
|
|
35
|
-
const
|
|
35
|
+
const logger_process_1 = require("./logger-process");
|
|
36
36
|
const os = __importStar(require("os"));
|
|
37
37
|
class StartManager {
|
|
38
38
|
constructor(options) {
|
|
@@ -108,7 +108,7 @@ class StartManager {
|
|
|
108
108
|
async handleFileChange(event) {
|
|
109
109
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
110
110
|
if (this.options.showInfo) {
|
|
111
|
-
|
|
111
|
+
logger_process_1.logger.printLine(`${prefix} File changed: ${chalk_1.default.yellow(event.relativePath)}`, 'info');
|
|
112
112
|
}
|
|
113
113
|
await this.gracefulRestart();
|
|
114
114
|
}
|
|
@@ -165,7 +165,7 @@ class StartManager {
|
|
|
165
165
|
catch (error) {
|
|
166
166
|
this.crashCount++;
|
|
167
167
|
if (this.options.showInfo) {
|
|
168
|
-
|
|
168
|
+
logger_process_1.logger.printLine(`Application crashed: ${error.message}`, 'error');
|
|
169
169
|
}
|
|
170
170
|
// Check if we should restart
|
|
171
171
|
if (this.shouldRestart()) {
|
|
@@ -183,8 +183,8 @@ class StartManager {
|
|
|
183
183
|
async handleCrash() {
|
|
184
184
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
185
185
|
if (this.options.showInfo) {
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
logger_process_1.logger.printLine(`${prefix} ${chalk_1.default.red(`${figures_1.default.cross} Application crashed`)}`, 'error');
|
|
187
|
+
logger_process_1.logger.printLine(`${prefix} ${chalk_1.default.yellow(`${figures_1.default.warning} Attempting restart in ${this.options.restartDelay}ms...`)}`, 'info');
|
|
188
188
|
}
|
|
189
189
|
// Wait before restarting
|
|
190
190
|
await new Promise(resolve => setTimeout(resolve, this.options.restartDelay));
|
|
@@ -263,12 +263,12 @@ class StartManager {
|
|
|
263
263
|
// Check memory limit
|
|
264
264
|
if (this.options.memoryLimit && this.processStats.memoryUsage > this.options.memoryLimit) {
|
|
265
265
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
266
|
-
|
|
266
|
+
logger_process_1.logger.printLine(`${prefix} ${chalk_1.default.red(`${figures_1.default.warning} Memory limit exceeded: ${this.processStats.memoryUsage}MB > ${this.options.memoryLimit}MB`)}`, 'warn');
|
|
267
267
|
}
|
|
268
268
|
// Log stats every 30 seconds in verbose mode
|
|
269
269
|
if (this.options.verbose && this.processStats.uptime % 30 === 0) {
|
|
270
270
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
271
|
-
|
|
271
|
+
logger_process_1.logger.printLine(`${prefix} ${chalk_1.default.gray(`Stats: ${this.processStats.memoryUsage}MB memory, ${this.formatUptime(this.processStats.uptime)} uptime`)}`, 'info');
|
|
272
272
|
}
|
|
273
273
|
}, 1000);
|
|
274
274
|
}
|
|
@@ -290,17 +290,17 @@ class StartManager {
|
|
|
290
290
|
// Start application
|
|
291
291
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
292
292
|
if (this.options.showInfo) {
|
|
293
|
-
|
|
293
|
+
logger_process_1.logger.printLine(`${prefix} Starting ${this.options.processName}...`, 'info');
|
|
294
294
|
}
|
|
295
295
|
await this.startApplication();
|
|
296
296
|
// Set up graceful shutdown
|
|
297
297
|
this.setupGracefulShutdown();
|
|
298
298
|
if (this.options.showInfo) {
|
|
299
|
-
|
|
299
|
+
logger_process_1.logger.printLine(`${prefix} ${this.options.processName} is running in ${this.options.environment} mode`, 'info');
|
|
300
300
|
if (this.options.watch) {
|
|
301
|
-
|
|
301
|
+
logger_process_1.logger.printLine(`${prefix} Watching for changes...`, 'info');
|
|
302
302
|
}
|
|
303
|
-
|
|
303
|
+
logger_process_1.logger.printLine(`${prefix} Press ${chalk_1.default.cyan('Ctrl+C')} to stop`, 'info');
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
async gracefulRestart() {
|
|
@@ -310,13 +310,13 @@ class StartManager {
|
|
|
310
310
|
}
|
|
311
311
|
if (!this.shouldRestart()) {
|
|
312
312
|
if (this.options.showInfo) {
|
|
313
|
-
|
|
313
|
+
logger_process_1.logger.printLine(`${prefix} ${chalk_1.default.red(`${figures_1.default.cross} Max restarts reached (${this.options.maxRestarts}). Stopping application.`)}`, 'error');
|
|
314
314
|
}
|
|
315
315
|
await this.stop();
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
318
|
if (this.options.showInfo) {
|
|
319
|
-
|
|
319
|
+
logger_process_1.logger.printLine(`${prefix} ${chalk_1.default.yellow(`${figures_1.default.warning} Gracefully restarting ${this.options.processName}...`)}`, 'info');
|
|
320
320
|
}
|
|
321
321
|
this.restartCount++;
|
|
322
322
|
this.lastRestartTime = new Date();
|
|
@@ -331,7 +331,7 @@ class StartManager {
|
|
|
331
331
|
// Start application again
|
|
332
332
|
await this.startApplication();
|
|
333
333
|
if (this.options.showInfo) {
|
|
334
|
-
|
|
334
|
+
logger_process_1.logger.printLine(`${prefix} ${chalk_1.default.green(`${figures_1.default.tick} ${this.options.processName} restarted successfully`)}`, 'info');
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
async stop() {
|
|
@@ -340,7 +340,7 @@ class StartManager {
|
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
342
|
if (this.options.showInfo) {
|
|
343
|
-
|
|
343
|
+
logger_process_1.logger.printLine(`${prefix} ${chalk_1.default.yellow(`${figures_1.default.warning} Stopping ${this.options.processName}...`)}`, 'info');
|
|
344
344
|
}
|
|
345
345
|
this.isRunning = false;
|
|
346
346
|
// Stop file watcher
|
|
@@ -355,8 +355,8 @@ class StartManager {
|
|
|
355
355
|
const uptime = Math.floor((Date.now() - this.startTime.getTime()) / 1000);
|
|
356
356
|
const uptimeStr = this.formatUptime(uptime);
|
|
357
357
|
if (this.options.showInfo) {
|
|
358
|
-
|
|
359
|
-
|
|
358
|
+
logger_process_1.logger.printLine(`${prefix} ${chalk_1.default.green(`${figures_1.default.tick} ${this.options.processName} stopped successfully`)}`, 'info');
|
|
359
|
+
logger_process_1.logger.printLine(`${prefix} Final stats: ${uptimeStr} uptime, ${this.restartCount} restarts, ${this.crashCount} crashes`, 'info');
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
setupGracefulShutdown() {
|
package/dist/src/watcher.js
CHANGED
|
@@ -32,7 +32,7 @@ const fs = __importStar(require("fs"));
|
|
|
32
32
|
const path = __importStar(require("path"));
|
|
33
33
|
const events_1 = require("events");
|
|
34
34
|
const chalk_1 = __importDefault(require("chalk"));
|
|
35
|
-
const
|
|
35
|
+
const logger_process_1 = require("./logger-process");
|
|
36
36
|
class FileWatcher extends events_1.EventEmitter {
|
|
37
37
|
constructor(options) {
|
|
38
38
|
super();
|
|
@@ -121,7 +121,7 @@ class FileWatcher extends events_1.EventEmitter {
|
|
|
121
121
|
try {
|
|
122
122
|
const absolutePath = path.resolve(dirPath);
|
|
123
123
|
if (this.options.verbose) {
|
|
124
|
-
|
|
124
|
+
logger_process_1.logger.printLine(`Watching directory: ${chalk_1.default.cyan(absolutePath)}`, 'info');
|
|
125
125
|
}
|
|
126
126
|
const watcher = fs.watch(absolutePath, { recursive: true }, async (eventType, filename) => {
|
|
127
127
|
if (!filename)
|
|
@@ -139,7 +139,7 @@ class FileWatcher extends events_1.EventEmitter {
|
|
|
139
139
|
}
|
|
140
140
|
catch (error) {
|
|
141
141
|
if (this.options.verbose) {
|
|
142
|
-
|
|
142
|
+
logger_process_1.logger.printLine(`Failed to watch directory ${dirPath}: ${error.message}`, 'warn');
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
}
|
|
@@ -153,7 +153,7 @@ class FileWatcher extends events_1.EventEmitter {
|
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
if (this.options.verbose) {
|
|
156
|
-
|
|
156
|
+
logger_process_1.logger.printLine(`Watching file: ${chalk_1.default.cyan(absolutePath)}`, 'info');
|
|
157
157
|
}
|
|
158
158
|
const watcher = fs.watch(absolutePath, (eventType) => {
|
|
159
159
|
this.handleFileChange(absolutePath, eventType);
|
|
@@ -163,13 +163,13 @@ class FileWatcher extends events_1.EventEmitter {
|
|
|
163
163
|
}
|
|
164
164
|
catch (error) {
|
|
165
165
|
if (this.options.verbose) {
|
|
166
|
-
|
|
166
|
+
logger_process_1.logger.printLine(`Failed to watch file ${filePath}: ${error.message}`, 'warn');
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
handleFileChange(filePath, eventType) {
|
|
171
171
|
if (this.options.verbose) {
|
|
172
|
-
|
|
172
|
+
logger_process_1.logger.printLine(`File ${eventType}: ${chalk_1.default.yellow(path.relative(process.cwd(), filePath))}`, 'info');
|
|
173
173
|
}
|
|
174
174
|
// Debounce file changes
|
|
175
175
|
if (this.debounceTimer) {
|
|
@@ -188,7 +188,7 @@ class FileWatcher extends events_1.EventEmitter {
|
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
190
|
this.isWatching = true;
|
|
191
|
-
|
|
191
|
+
logger_process_1.logger.printLine('Starting file watcher...', 'info');
|
|
192
192
|
for (const watchPath of this.options.watch) {
|
|
193
193
|
const absolutePath = path.resolve(watchPath);
|
|
194
194
|
try {
|
|
@@ -201,15 +201,20 @@ class FileWatcher extends events_1.EventEmitter {
|
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
catch (error) {
|
|
204
|
-
|
|
204
|
+
logger_process_1.logger.printLine(`Cannot watch ${watchPath}: ${error.message}`, 'warn');
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
+
const watchedCount = this.watchers.length;
|
|
208
|
+
logger_process_1.logger.printLine(`File watcher started. Monitoring ${chalk_1.default.green(watchedCount)} locations`, 'info');
|
|
209
|
+
if (this.options.ext && this.options.ext.length > 0) {
|
|
210
|
+
logger_process_1.logger.printLine(`Watching extensions: ${chalk_1.default.cyan(this.options.ext.join(', '))}`, 'info');
|
|
211
|
+
}
|
|
207
212
|
}
|
|
208
213
|
stop() {
|
|
209
214
|
if (!this.isWatching) {
|
|
210
215
|
return;
|
|
211
216
|
}
|
|
212
|
-
|
|
217
|
+
logger_process_1.logger.printLine('Stopping file watcher...', 'info');
|
|
213
218
|
this.watchers.forEach(watcher => {
|
|
214
219
|
try {
|
|
215
220
|
watcher.close();
|
|
@@ -225,7 +230,7 @@ class FileWatcher extends events_1.EventEmitter {
|
|
|
225
230
|
clearTimeout(this.debounceTimer);
|
|
226
231
|
this.debounceTimer = null;
|
|
227
232
|
}
|
|
228
|
-
|
|
233
|
+
logger_process_1.logger.printLine('File watcher stopped', 'info');
|
|
229
234
|
}
|
|
230
235
|
isActive() {
|
|
231
236
|
return this.isWatching;
|