@clawos-dev/clawd 0.2.109 → 0.2.110-beta.210.1f607c1
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/cli.cjs +31 -4
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -41717,24 +41717,51 @@ var DevServerSupervisor = class extends import_node_events2.EventEmitter {
|
|
|
41717
41717
|
// key: sessionId
|
|
41718
41718
|
startForSession(args) {
|
|
41719
41719
|
if (this.running.has(args.sessionId)) return;
|
|
41720
|
+
const augmentedPath = [
|
|
41721
|
+
process.env.PATH ?? "",
|
|
41722
|
+
"/opt/homebrew/bin",
|
|
41723
|
+
"/usr/local/bin",
|
|
41724
|
+
`${process.env.HOME}/.nvm/versions/node`,
|
|
41725
|
+
`${process.env.HOME}/.local/share/pnpm`
|
|
41726
|
+
].filter(Boolean).join(":");
|
|
41720
41727
|
const env = {
|
|
41721
41728
|
...process.env,
|
|
41729
|
+
PATH: augmentedPath,
|
|
41722
41730
|
CLAWD_TUNNEL_HOST: args.tunnelHost ?? "",
|
|
41723
41731
|
CLAWD_PREVIEW_PORT: String(args.port)
|
|
41724
41732
|
};
|
|
41725
|
-
const
|
|
41733
|
+
const tag = `[dev-server ${args.projectName}@${args.port}]`;
|
|
41734
|
+
const child = (0, import_node_child_process7.spawn)("pnpm", ["dev"], { cwd: args.cwd, env, stdio: "pipe", shell: true });
|
|
41726
41735
|
const entry = { ...args, process: child };
|
|
41727
41736
|
this.running.set(args.sessionId, entry);
|
|
41737
|
+
child.stdout?.on("data", (chunk) => {
|
|
41738
|
+
process.stderr.write(`${tag} ${chunk}`);
|
|
41739
|
+
});
|
|
41740
|
+
child.stderr?.on("data", (chunk) => {
|
|
41741
|
+
process.stderr.write(`${tag} ${chunk}`);
|
|
41742
|
+
});
|
|
41743
|
+
child.on("error", (err) => {
|
|
41744
|
+
this.running.delete(args.sessionId);
|
|
41745
|
+
process.stderr.write(`${tag} spawn failed: ${err.message}
|
|
41746
|
+
`);
|
|
41747
|
+
this.emit("devServer:failed", {
|
|
41748
|
+
sessionId: args.sessionId,
|
|
41749
|
+
projectName: args.projectName,
|
|
41750
|
+
port: args.port,
|
|
41751
|
+
exitCode: null
|
|
41752
|
+
});
|
|
41753
|
+
});
|
|
41728
41754
|
child.on("exit", (code) => {
|
|
41729
41755
|
this.running.delete(args.sessionId);
|
|
41730
41756
|
if (code !== 0 && code !== null) {
|
|
41731
|
-
|
|
41757
|
+
process.stderr.write(`${tag} exited with code ${code}
|
|
41758
|
+
`);
|
|
41759
|
+
this.emit("devServer:failed", {
|
|
41732
41760
|
sessionId: args.sessionId,
|
|
41733
41761
|
projectName: args.projectName,
|
|
41734
41762
|
port: args.port,
|
|
41735
41763
|
exitCode: code
|
|
41736
|
-
};
|
|
41737
|
-
this.emit("devServer:failed", ev);
|
|
41764
|
+
});
|
|
41738
41765
|
}
|
|
41739
41766
|
});
|
|
41740
41767
|
}
|
package/package.json
CHANGED