fluxy-bot 0.1.35 → 0.1.36
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/package.json +1 -1
- package/supervisor/worker.ts +14 -7
package/package.json
CHANGED
package/supervisor/worker.ts
CHANGED
|
@@ -14,12 +14,19 @@ export function getWorkerPort(basePort: number): number {
|
|
|
14
14
|
export function spawnWorker(port: number): ChildProcess {
|
|
15
15
|
const workerPath = path.join(PKG_DIR, 'worker', 'index.ts');
|
|
16
16
|
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
child = spawn(
|
|
17
|
+
// --watch: Node built-in file watcher (stable since Node 22).
|
|
18
|
+
// Keeps the parent process alive and internally restarts
|
|
19
|
+
// the worker when imported files change.
|
|
20
|
+
// --watch-path: scope watching to worker/ and shared/ so frontend
|
|
21
|
+
// edits don't cause unnecessary restarts.
|
|
22
|
+
child = spawn(process.execPath, [
|
|
23
|
+
'--watch',
|
|
24
|
+
'--watch-preserve-output',
|
|
25
|
+
`--watch-path=${path.join(PKG_DIR, 'worker')}`,
|
|
26
|
+
`--watch-path=${path.join(PKG_DIR, 'shared')}`,
|
|
27
|
+
'--import', 'tsx/esm',
|
|
28
|
+
workerPath,
|
|
29
|
+
], {
|
|
23
30
|
cwd: PKG_DIR,
|
|
24
31
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
25
32
|
env: { ...process.env, WORKER_PORT: String(port) },
|
|
@@ -46,7 +53,7 @@ export function spawnWorker(port: number): ChildProcess {
|
|
|
46
53
|
}
|
|
47
54
|
});
|
|
48
55
|
|
|
49
|
-
log.ok(`Worker spawned on port ${port} (
|
|
56
|
+
log.ok(`Worker spawned on port ${port} (watch mode)`);
|
|
50
57
|
return child;
|
|
51
58
|
}
|
|
52
59
|
|