fluxy-bot 0.1.35 → 0.1.38
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/worker/workspace.ts +1 -1
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
|
|
package/worker/workspace.ts
CHANGED
|
@@ -47,7 +47,7 @@ const DEFAULT_INSTRUCTIONS = `# INSTRUCTIONS.md — Operating Rules (LOCKED)
|
|
|
47
47
|
|
|
48
48
|
## Codebase editing
|
|
49
49
|
- The full app source lives at ~/.fluxy/app/. You have full freedom to edit any file.
|
|
50
|
-
- Backend changes (worker/, shared/) auto-reload via
|
|
50
|
+
- Backend changes (worker/, shared/) auto-reload via watch mode. No restart needed.
|
|
51
51
|
- Frontend changes (client/src/) require running \`cd ~/.fluxy/app && npx vite build\` then tell the user to refresh.
|
|
52
52
|
- Environment variables go in ~/.fluxy/.env (one KEY=value per line). They are loaded on worker startup and available via process.env. After adding a new key, the worker auto-restarts when you save your backend code change.
|
|
53
53
|
- **Adding a feature that needs frontend + backend + env:**
|