neex 0.6.32 → 0.6.35
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/README.md +1 -1
- package/dist/src/build-manager.js +15 -12
- package/dist/src/commands/build-commands.js +3 -2
- package/dist/src/commands/dev-commands.js +3 -2
- package/dist/src/commands/start-commands.js +2 -2
- package/dist/src/dev-runner.js +13 -10
- package/dist/src/logger.js +2 -5
- package/dist/src/runner.js +2 -1
- package/dist/src/start-manager.js +20 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,7 @@ const path = __importStar(require("path"));
|
|
|
37
37
|
const fs = __importStar(require("fs/promises"));
|
|
38
38
|
class BuildManager {
|
|
39
39
|
constructor(options) {
|
|
40
|
+
var _a;
|
|
40
41
|
this.isBuilding = false;
|
|
41
42
|
this.buildCount = 0;
|
|
42
43
|
this.startTime = new Date();
|
|
@@ -69,11 +70,13 @@ class BuildManager {
|
|
|
69
70
|
clean: false,
|
|
70
71
|
sourceMap: false,
|
|
71
72
|
target: 'es2020',
|
|
72
|
-
module: 'commonjs'
|
|
73
|
+
module: 'commonjs',
|
|
74
|
+
silent: false,
|
|
73
75
|
};
|
|
74
76
|
this.options = {
|
|
75
77
|
...defaultOptions,
|
|
76
|
-
...options
|
|
78
|
+
...options,
|
|
79
|
+
silent: (_a = options.silent) !== null && _a !== void 0 ? _a : false,
|
|
77
80
|
};
|
|
78
81
|
}
|
|
79
82
|
setupFileWatcher() {
|
|
@@ -96,7 +99,7 @@ class BuildManager {
|
|
|
96
99
|
});
|
|
97
100
|
}
|
|
98
101
|
async handleFileChange(event) {
|
|
99
|
-
if (this.options.showInfo) {
|
|
102
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
100
103
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
101
104
|
logger_1.default.printLine(`${prefix} File changed: ${chalk_1.default.yellow(event.relativePath)}`, 'info');
|
|
102
105
|
}
|
|
@@ -107,7 +110,7 @@ class BuildManager {
|
|
|
107
110
|
await fs.mkdir(this.options.outputDir, { recursive: true });
|
|
108
111
|
}
|
|
109
112
|
catch (error) {
|
|
110
|
-
if (this.options.showInfo) {
|
|
113
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
111
114
|
logger_1.default.printLine(`Failed to create output directory: ${error.message}`, 'error');
|
|
112
115
|
}
|
|
113
116
|
throw error;
|
|
@@ -119,13 +122,13 @@ class BuildManager {
|
|
|
119
122
|
}
|
|
120
123
|
try {
|
|
121
124
|
await fs.rm(this.options.outputDir, { recursive: true, force: true });
|
|
122
|
-
if (this.options.showInfo) {
|
|
125
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
123
126
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
124
127
|
logger_1.default.printLine(`${prefix} Cleaned output directory: ${chalk_1.default.yellow(this.options.outputDir)}`, 'info');
|
|
125
128
|
}
|
|
126
129
|
}
|
|
127
130
|
catch (error) {
|
|
128
|
-
if (this.options.showInfo) {
|
|
131
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
129
132
|
logger_1.default.printLine(`Failed to clean output directory: ${error.message}`, 'error');
|
|
130
133
|
}
|
|
131
134
|
throw error;
|
|
@@ -250,7 +253,7 @@ class BuildManager {
|
|
|
250
253
|
// Set up graceful shutdown
|
|
251
254
|
this.setupGracefulShutdown();
|
|
252
255
|
if (this.options.watch) {
|
|
253
|
-
if (this.options.showInfo) {
|
|
256
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
254
257
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
255
258
|
logger_1.default.printLine(`${prefix} Build completed. Watching for changes...`, 'info');
|
|
256
259
|
logger_1.default.printLine(`${prefix} Press ${chalk_1.default.cyan('Ctrl+C')} to stop`, 'info');
|
|
@@ -261,7 +264,7 @@ class BuildManager {
|
|
|
261
264
|
if (this.isBuilding) {
|
|
262
265
|
return;
|
|
263
266
|
}
|
|
264
|
-
if (this.options.showInfo) {
|
|
267
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
265
268
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
266
269
|
logger_1.default.printLine(`${prefix} Rebuilding due to file changes...`, 'info');
|
|
267
270
|
}
|
|
@@ -277,7 +280,7 @@ class BuildManager {
|
|
|
277
280
|
}
|
|
278
281
|
// Run build again
|
|
279
282
|
await this.runBuild();
|
|
280
|
-
if (this.options.showInfo) {
|
|
283
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
281
284
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
282
285
|
logger_1.default.printLine(`${prefix} Rebuild completed. Watching for changes...`, 'info');
|
|
283
286
|
}
|
|
@@ -290,7 +293,7 @@ class BuildManager {
|
|
|
290
293
|
if (!this.isBuilding && !this.options.watch) {
|
|
291
294
|
return;
|
|
292
295
|
}
|
|
293
|
-
if (this.options.showInfo) {
|
|
296
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
294
297
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
295
298
|
logger_1.default.printLine(`${prefix} Stopping build process...`, 'info');
|
|
296
299
|
}
|
|
@@ -302,7 +305,7 @@ class BuildManager {
|
|
|
302
305
|
if (this.runner) {
|
|
303
306
|
this.runner.cleanup('SIGTERM');
|
|
304
307
|
}
|
|
305
|
-
if (this.options.showInfo) {
|
|
308
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
306
309
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
307
310
|
const uptime = Math.floor((Date.now() - this.startTime.getTime()) / 1000);
|
|
308
311
|
const uptimeStr = this.formatUptime(uptime);
|
|
@@ -314,7 +317,7 @@ class BuildManager {
|
|
|
314
317
|
}
|
|
315
318
|
setupGracefulShutdown() {
|
|
316
319
|
const handleSignal = (signal) => {
|
|
317
|
-
if (this.options.showInfo) {
|
|
320
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
318
321
|
console.log(`\n${chalk_1.default.yellow(`${figures_1.default.warning} Received ${signal}. Shutting down build process...`)}`);
|
|
319
322
|
}
|
|
320
323
|
this.stop().then(() => {
|
|
@@ -133,7 +133,6 @@ function addBuildCommands(program) {
|
|
|
133
133
|
outputDir: options.output,
|
|
134
134
|
buildType: buildConfig.buildType,
|
|
135
135
|
buildCommand: buildConfig.buildCommand,
|
|
136
|
-
showInfo: showInfo,
|
|
137
136
|
color: !options.noColor,
|
|
138
137
|
showTiming: false,
|
|
139
138
|
watch: options.watch,
|
|
@@ -149,7 +148,9 @@ function addBuildCommands(program) {
|
|
|
149
148
|
printOutput: false,
|
|
150
149
|
prefix: false,
|
|
151
150
|
stopOnError: true,
|
|
152
|
-
minimalOutput: true
|
|
151
|
+
minimalOutput: true,
|
|
152
|
+
showInfo: true,
|
|
153
|
+
silent: true, // Silence the logger
|
|
153
154
|
});
|
|
154
155
|
// Start the build process
|
|
155
156
|
try {
|
|
@@ -170,11 +170,12 @@ function addDevCommands(program) {
|
|
|
170
170
|
delay: options.delay || 1000,
|
|
171
171
|
clearConsole: options.clear,
|
|
172
172
|
verbose: options.verbose,
|
|
173
|
-
showInfo: showInfo,
|
|
174
173
|
signal: options.signal,
|
|
175
174
|
restartOnChange: true,
|
|
176
175
|
groupOutput: false,
|
|
177
|
-
isServerMode: false
|
|
176
|
+
isServerMode: false,
|
|
177
|
+
showInfo: true,
|
|
178
|
+
silent: true // Silence the logger
|
|
178
179
|
});
|
|
179
180
|
// Start the development server
|
|
180
181
|
await devRunner.start([commandToExecute]);
|
|
@@ -213,7 +213,6 @@ function addStartCommands(program) {
|
|
|
213
213
|
maxRestarts: options.maxRestarts,
|
|
214
214
|
restartDelay: options.restartDelay || 3000,
|
|
215
215
|
verbose: options.verbose,
|
|
216
|
-
showInfo: showInfo,
|
|
217
216
|
signal: options.signal,
|
|
218
217
|
cluster: options.cluster,
|
|
219
218
|
clusterInstances: options.clusterInstances,
|
|
@@ -221,7 +220,8 @@ function addStartCommands(program) {
|
|
|
221
220
|
cpuLimit: options.cpuLimit,
|
|
222
221
|
groupOutput: false,
|
|
223
222
|
isServerMode: true,
|
|
224
|
-
stopOnError: false
|
|
223
|
+
stopOnError: false,
|
|
224
|
+
silent: true // Silence the logger
|
|
225
225
|
});
|
|
226
226
|
// Start the application server
|
|
227
227
|
await startManager.start();
|
package/dist/src/dev-runner.js
CHANGED
|
@@ -12,6 +12,7 @@ const figures_1 = __importDefault(require("figures"));
|
|
|
12
12
|
const logger_1 = __importDefault(require("./logger"));
|
|
13
13
|
class DevRunner {
|
|
14
14
|
constructor(options) {
|
|
15
|
+
var _a;
|
|
15
16
|
this.commands = [];
|
|
16
17
|
this.isRunning = false;
|
|
17
18
|
this.restartCount = 0;
|
|
@@ -46,10 +47,12 @@ class DevRunner {
|
|
|
46
47
|
verbose: false,
|
|
47
48
|
showInfo: false,
|
|
48
49
|
runnerName: 'neex dev',
|
|
50
|
+
silent: false,
|
|
49
51
|
};
|
|
50
52
|
this.options = {
|
|
51
53
|
...defaultOptions,
|
|
52
|
-
...options
|
|
54
|
+
...options,
|
|
55
|
+
silent: (_a = options.silent) !== null && _a !== void 0 ? _a : false,
|
|
53
56
|
};
|
|
54
57
|
}
|
|
55
58
|
setupFileWatcher() {
|
|
@@ -69,7 +72,7 @@ class DevRunner {
|
|
|
69
72
|
}
|
|
70
73
|
async handleFileChange(event) {
|
|
71
74
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
72
|
-
if (this.options.showInfo) {
|
|
75
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
73
76
|
logger_1.default.printLine(`${prefix} File changed: ${chalk_1.default.yellow(event.relativePath)}`, 'info');
|
|
74
77
|
}
|
|
75
78
|
if (this.options.clearConsole) {
|
|
@@ -102,7 +105,7 @@ class DevRunner {
|
|
|
102
105
|
return results;
|
|
103
106
|
}
|
|
104
107
|
catch (error) {
|
|
105
|
-
if (this.options.showInfo) {
|
|
108
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
106
109
|
logger_1.default.printLine(`Execution failed: ${error.message}`, 'error');
|
|
107
110
|
}
|
|
108
111
|
return [];
|
|
@@ -156,13 +159,13 @@ class DevRunner {
|
|
|
156
159
|
}
|
|
157
160
|
// Run initial commands
|
|
158
161
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
159
|
-
if (this.options.showInfo) {
|
|
162
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
160
163
|
logger_1.default.printLine(`${prefix} Starting development server...`, 'info');
|
|
161
164
|
}
|
|
162
165
|
await this.runCommands();
|
|
163
166
|
// Set up graceful shutdown
|
|
164
167
|
this.setupGracefulShutdown();
|
|
165
|
-
if (this.options.showInfo) {
|
|
168
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
166
169
|
logger_1.default.printLine(`${prefix} Development server started. Watching for changes...`, 'info');
|
|
167
170
|
logger_1.default.printLine(`${prefix} Press ${chalk_1.default.cyan('Ctrl+C')} to stop`, 'info');
|
|
168
171
|
}
|
|
@@ -172,7 +175,7 @@ class DevRunner {
|
|
|
172
175
|
if (!this.isRunning) {
|
|
173
176
|
return;
|
|
174
177
|
}
|
|
175
|
-
if (this.options.showInfo) {
|
|
178
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
176
179
|
logger_1.default.printLine(`${prefix} Restarting due to file changes...`, 'info');
|
|
177
180
|
}
|
|
178
181
|
this.restartCount++;
|
|
@@ -186,7 +189,7 @@ class DevRunner {
|
|
|
186
189
|
this.printDevBanner();
|
|
187
190
|
// Run commands again
|
|
188
191
|
await this.runCommands();
|
|
189
|
-
if (this.options.showInfo) {
|
|
192
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
190
193
|
logger_1.default.printLine(`${prefix} Restart completed. Watching for changes...`, 'info');
|
|
191
194
|
}
|
|
192
195
|
}
|
|
@@ -195,7 +198,7 @@ class DevRunner {
|
|
|
195
198
|
if (!this.isRunning) {
|
|
196
199
|
return;
|
|
197
200
|
}
|
|
198
|
-
if (this.options.showInfo) {
|
|
201
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
199
202
|
logger_1.default.printLine(`${prefix} Stopping development server...`, 'info');
|
|
200
203
|
}
|
|
201
204
|
this.isRunning = false;
|
|
@@ -209,7 +212,7 @@ class DevRunner {
|
|
|
209
212
|
}
|
|
210
213
|
const uptime = Math.floor((Date.now() - this.startTime.getTime()) / 1000);
|
|
211
214
|
const uptimeStr = this.formatUptime(uptime);
|
|
212
|
-
if (this.options.showInfo) {
|
|
215
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
213
216
|
logger_1.default.printLine(`${prefix} ${this.options.runnerName} development server stopped after ${uptimeStr}`, 'info');
|
|
214
217
|
if (this.restartCount > 0) {
|
|
215
218
|
logger_1.default.printLine(`${prefix} Total restarts: ${this.restartCount}`, 'info');
|
|
@@ -218,7 +221,7 @@ class DevRunner {
|
|
|
218
221
|
}
|
|
219
222
|
setupGracefulShutdown() {
|
|
220
223
|
const handleSignal = (signal) => {
|
|
221
|
-
if (this.options.showInfo) {
|
|
224
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
222
225
|
console.log(`\n${chalk_1.default.yellow(`${figures_1.default.warning} Received ${signal}. Shutting down development server...`)}`);
|
|
223
226
|
}
|
|
224
227
|
this.stop().then(() => {
|
package/dist/src/logger.js
CHANGED
|
@@ -147,11 +147,8 @@ class Logger {
|
|
|
147
147
|
process.stdout.write('\r' + ' '.repeat(process.stdout.columns || 80) + '\r');
|
|
148
148
|
}
|
|
149
149
|
console.log(`${prefix} ${color('Starting...')}`);
|
|
150
|
-
//
|
|
151
|
-
|
|
152
|
-
// Start spinner for this command
|
|
153
|
-
this.startSpinner(command);
|
|
154
|
-
}
|
|
150
|
+
// Start spinner for this command
|
|
151
|
+
this.startSpinner(command);
|
|
155
152
|
}
|
|
156
153
|
startSpinner(command) {
|
|
157
154
|
// Only create a spinner if one doesn't already exist for this command
|
package/dist/src/runner.js
CHANGED
|
@@ -163,9 +163,10 @@ class Runner {
|
|
|
163
163
|
FORCE_COLOR: this.options.color ? '1' : '0'
|
|
164
164
|
};
|
|
165
165
|
const proc = (0, child_process_1.spawn)(cmd, args, {
|
|
166
|
-
stdio: '
|
|
166
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
167
167
|
shell: true,
|
|
168
168
|
env,
|
|
169
|
+
detached: true,
|
|
169
170
|
cwd
|
|
170
171
|
});
|
|
171
172
|
this.activeProcesses.set(originalCommand, proc);
|
|
@@ -36,6 +36,7 @@ const logger_1 = __importDefault(require("./logger"));
|
|
|
36
36
|
const os = __importStar(require("os"));
|
|
37
37
|
class StartManager {
|
|
38
38
|
constructor(options) {
|
|
39
|
+
var _a;
|
|
39
40
|
this.isRunning = false;
|
|
40
41
|
this.restartCount = 0;
|
|
41
42
|
this.crashCount = 0;
|
|
@@ -79,11 +80,13 @@ class StartManager {
|
|
|
79
80
|
restartDelay: 3000,
|
|
80
81
|
signal: 'SIGTERM',
|
|
81
82
|
cluster: false,
|
|
82
|
-
clusterInstances: os.cpus().length
|
|
83
|
+
clusterInstances: os.cpus().length,
|
|
84
|
+
silent: false,
|
|
83
85
|
};
|
|
84
86
|
this.options = {
|
|
85
87
|
...defaultOptions,
|
|
86
|
-
...options
|
|
88
|
+
...options,
|
|
89
|
+
silent: (_a = options.silent) !== null && _a !== void 0 ? _a : false,
|
|
87
90
|
};
|
|
88
91
|
}
|
|
89
92
|
setupFileWatcher() {
|
|
@@ -107,7 +110,7 @@ class StartManager {
|
|
|
107
110
|
}
|
|
108
111
|
async handleFileChange(event) {
|
|
109
112
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
110
|
-
if (this.options.showInfo) {
|
|
113
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
111
114
|
logger_1.default.printLine(`${prefix} File changed: ${chalk_1.default.yellow(event.relativePath)}`, 'info');
|
|
112
115
|
}
|
|
113
116
|
await this.gracefulRestart();
|
|
@@ -164,7 +167,7 @@ class StartManager {
|
|
|
164
167
|
}
|
|
165
168
|
catch (error) {
|
|
166
169
|
this.crashCount++;
|
|
167
|
-
if (this.options.showInfo) {
|
|
170
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
168
171
|
logger_1.default.printLine(`Application crashed: ${error.message}`, 'error');
|
|
169
172
|
}
|
|
170
173
|
// Check if we should restart
|
|
@@ -182,7 +185,7 @@ class StartManager {
|
|
|
182
185
|
}
|
|
183
186
|
async handleCrash() {
|
|
184
187
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
185
|
-
if (this.options.showInfo) {
|
|
188
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
186
189
|
logger_1.default.printLine(`${prefix} ${chalk_1.default.red(`${figures_1.default.cross} Application crashed`)}`, 'error');
|
|
187
190
|
logger_1.default.printLine(`${prefix} ${chalk_1.default.yellow(`${figures_1.default.warning} Attempting restart in ${this.options.restartDelay}ms...`)}`, 'info');
|
|
188
191
|
}
|
|
@@ -263,12 +266,14 @@ class StartManager {
|
|
|
263
266
|
// Check memory limit
|
|
264
267
|
if (this.options.memoryLimit && this.processStats.memoryUsage > this.options.memoryLimit) {
|
|
265
268
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
266
|
-
|
|
269
|
+
if (!this.options.silent)
|
|
270
|
+
logger_1.default.printLine(`${prefix} ${chalk_1.default.red(`${figures_1.default.warning} Memory limit exceeded: ${this.processStats.memoryUsage}MB > ${this.options.memoryLimit}MB`)}`, 'warn');
|
|
267
271
|
}
|
|
268
272
|
// Log stats every 30 seconds in verbose mode
|
|
269
273
|
if (this.options.verbose && this.processStats.uptime % 30 === 0) {
|
|
270
274
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
271
|
-
|
|
275
|
+
if (!this.options.silent)
|
|
276
|
+
logger_1.default.printLine(`${prefix} ${chalk_1.default.gray(`Stats: ${this.processStats.memoryUsage}MB memory, ${this.formatUptime(this.processStats.uptime)} uptime`)}`, 'info');
|
|
272
277
|
}
|
|
273
278
|
}, 1000);
|
|
274
279
|
}
|
|
@@ -289,13 +294,13 @@ class StartManager {
|
|
|
289
294
|
this.monitorResources();
|
|
290
295
|
// Start application
|
|
291
296
|
const prefix = chalk_1.default.cyan(`[${this.options.runnerName}]`);
|
|
292
|
-
if (this.options.showInfo) {
|
|
297
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
293
298
|
logger_1.default.printLine(`${prefix} Starting ${this.options.processName}...`, 'info');
|
|
294
299
|
}
|
|
295
300
|
await this.startApplication();
|
|
296
301
|
// Set up graceful shutdown
|
|
297
302
|
this.setupGracefulShutdown();
|
|
298
|
-
if (this.options.showInfo) {
|
|
303
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
299
304
|
logger_1.default.printLine(`${prefix} ${this.options.processName} is running in ${this.options.environment} mode`, 'info');
|
|
300
305
|
if (this.options.watch) {
|
|
301
306
|
logger_1.default.printLine(`${prefix} Watching for changes...`, 'info');
|
|
@@ -309,13 +314,13 @@ class StartManager {
|
|
|
309
314
|
return;
|
|
310
315
|
}
|
|
311
316
|
if (!this.shouldRestart()) {
|
|
312
|
-
if (this.options.showInfo) {
|
|
317
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
313
318
|
logger_1.default.printLine(`${prefix} ${chalk_1.default.red(`${figures_1.default.cross} Max restarts reached (${this.options.maxRestarts}). Stopping application.`)}`, 'error');
|
|
314
319
|
}
|
|
315
320
|
await this.stop();
|
|
316
321
|
return;
|
|
317
322
|
}
|
|
318
|
-
if (this.options.showInfo) {
|
|
323
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
319
324
|
logger_1.default.printLine(`${prefix} ${chalk_1.default.yellow(`${figures_1.default.warning} Gracefully restarting ${this.options.processName}...`)}`, 'info');
|
|
320
325
|
}
|
|
321
326
|
this.restartCount++;
|
|
@@ -330,7 +335,7 @@ class StartManager {
|
|
|
330
335
|
this.printStartBanner();
|
|
331
336
|
// Start application again
|
|
332
337
|
await this.startApplication();
|
|
333
|
-
if (this.options.showInfo) {
|
|
338
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
334
339
|
logger_1.default.printLine(`${prefix} ${chalk_1.default.green(`${figures_1.default.tick} ${this.options.processName} restarted successfully`)}`, 'info');
|
|
335
340
|
}
|
|
336
341
|
}
|
|
@@ -339,7 +344,7 @@ class StartManager {
|
|
|
339
344
|
if (!this.isRunning) {
|
|
340
345
|
return;
|
|
341
346
|
}
|
|
342
|
-
if (this.options.showInfo) {
|
|
347
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
343
348
|
logger_1.default.printLine(`${prefix} ${chalk_1.default.yellow(`${figures_1.default.warning} Stopping ${this.options.processName}...`)}`, 'info');
|
|
344
349
|
}
|
|
345
350
|
this.isRunning = false;
|
|
@@ -354,14 +359,14 @@ class StartManager {
|
|
|
354
359
|
// Calculate final stats
|
|
355
360
|
const uptime = Math.floor((Date.now() - this.startTime.getTime()) / 1000);
|
|
356
361
|
const uptimeStr = this.formatUptime(uptime);
|
|
357
|
-
if (this.options.showInfo) {
|
|
362
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
358
363
|
logger_1.default.printLine(`${prefix} ${chalk_1.default.green(`${figures_1.default.tick} ${this.options.processName} stopped successfully`)}`, 'info');
|
|
359
364
|
logger_1.default.printLine(`${prefix} Final stats: ${uptimeStr} uptime, ${this.restartCount} restarts, ${this.crashCount} crashes`, 'info');
|
|
360
365
|
}
|
|
361
366
|
}
|
|
362
367
|
setupGracefulShutdown() {
|
|
363
368
|
const handleSignal = (signal) => {
|
|
364
|
-
if (this.options.showInfo) {
|
|
369
|
+
if (this.options.showInfo && !this.options.silent) {
|
|
365
370
|
console.log(`\n${chalk_1.default.yellow(`${figures_1.default.warning} Received ${signal}. Gracefully shutting down ${this.options.processName}...`)}`);
|
|
366
371
|
}
|
|
367
372
|
this.stop().then(() => {
|