neex 0.6.80 → 0.6.83
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.
|
@@ -17,7 +17,8 @@ function addDevCommands(program) {
|
|
|
17
17
|
.option('-w, --watch <patterns>', 'Watch additional patterns (comma-separated)', 'src/**/*')
|
|
18
18
|
.option('-i, --ignore <patterns>', 'Ignore patterns (comma-separated)', 'node_modules,dist,build,.git,coverage')
|
|
19
19
|
.option('-e, --ext <extensions>', 'File extensions to watch (comma-separated)', 'ts,tsx,js,jsx,json')
|
|
20
|
-
.option('-d, --delay <ms>', 'Delay before restart (ms)', parseInt,
|
|
20
|
+
.option('-d, --delay <ms>', 'Delay before restart (ms)', parseInt, 500)
|
|
21
|
+
.option('--fast', 'Enable fast hot reload (shorter delays)')
|
|
21
22
|
.option('-c, --no-color', 'Disable colored output')
|
|
22
23
|
.option('-q, --quiet', 'Reduce output verbosity')
|
|
23
24
|
.option('-v, --verbose', 'Verbose output')
|
|
@@ -33,6 +34,8 @@ function addDevCommands(program) {
|
|
|
33
34
|
.action(async (file, options) => {
|
|
34
35
|
try {
|
|
35
36
|
const targetFile = file || 'src/index.ts';
|
|
37
|
+
// تنظیمات fast mode
|
|
38
|
+
const delay = options.fast ? 200 : options.delay;
|
|
36
39
|
if (!options.quiet) {
|
|
37
40
|
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.blue(figures_1.default.info)} Starting ${chalk_1.default.cyan('neex dev')} for ${chalk_1.default.cyan(targetFile)}`, 'info');
|
|
38
41
|
if (options.verbose) {
|
|
@@ -49,7 +52,7 @@ function addDevCommands(program) {
|
|
|
49
52
|
watch: options.watch.split(',').map((p) => p.trim()),
|
|
50
53
|
ignore: options.ignore.split(',').map((p) => p.trim()),
|
|
51
54
|
extensions: options.ext.split(',').map((e) => e.trim()),
|
|
52
|
-
delay:
|
|
55
|
+
delay: delay,
|
|
53
56
|
color: options.color,
|
|
54
57
|
quiet: options.quiet,
|
|
55
58
|
verbose: options.verbose,
|
package/dist/src/dev-manager.js
CHANGED
|
@@ -99,21 +99,26 @@ class DevManager {
|
|
|
99
99
|
try {
|
|
100
100
|
const envContent = fs_1.default.readFileSync(this.options.envFile, 'utf8');
|
|
101
101
|
const lines = envContent.split('\n');
|
|
102
|
+
let loadedCount = 0;
|
|
102
103
|
for (const line of lines) {
|
|
103
104
|
const trimmed = line.trim();
|
|
104
105
|
if (trimmed && !trimmed.startsWith('#')) {
|
|
105
106
|
const [key, ...values] = trimmed.split('=');
|
|
106
107
|
if (key && values.length > 0) {
|
|
107
108
|
process.env[key.trim()] = values.join('=').trim().replace(/^["']|["']$/g, '');
|
|
109
|
+
loadedCount++;
|
|
108
110
|
}
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
|
-
if (this.options.
|
|
112
|
-
logger_manager_js_1.loggerManager.printLine(
|
|
113
|
+
if (!this.options.quiet && loadedCount > 0) {
|
|
114
|
+
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.dim(figures_1.default.info)} Loaded ${loadedCount} env variable${loadedCount > 1 ? 's' : ''} from ${path_1.default.basename(this.options.envFile)}`, 'info');
|
|
115
|
+
}
|
|
116
|
+
else if (this.options.verbose) {
|
|
117
|
+
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.dim(figures_1.default.info)} No env variables found in ${this.options.envFile}`, 'info');
|
|
113
118
|
}
|
|
114
119
|
}
|
|
115
120
|
catch (error) {
|
|
116
|
-
logger_manager_js_1.loggerManager.printLine(
|
|
121
|
+
logger_manager_js_1.loggerManager.printLine(`${chalk_1.default.yellow(figures_1.default.warning)} Failed to load ${this.options.envFile}: ${error.message}`, 'warn');
|
|
117
122
|
}
|
|
118
123
|
}
|
|
119
124
|
}
|
|
@@ -389,7 +394,11 @@ class DevManager {
|
|
|
389
394
|
ignoreInitial: true,
|
|
390
395
|
followSymlinks: false,
|
|
391
396
|
usePolling: false,
|
|
392
|
-
atomic:
|
|
397
|
+
atomic: 200,
|
|
398
|
+
awaitWriteFinish: {
|
|
399
|
+
stabilityThreshold: 100,
|
|
400
|
+
pollInterval: 50
|
|
401
|
+
}
|
|
393
402
|
});
|
|
394
403
|
this.watcher.on('change', (filePath) => {
|
|
395
404
|
this.invalidateCache(filePath);
|