@dcl-regenesislabs/opendcl 0.1.2 → 0.1.3-22334161920.commit-0b218cb

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.
@@ -41,7 +41,16 @@ const extension: ExtensionFactory = (pi) => {
41
41
 
42
42
  function cleanupPreview(): void {
43
43
  if (previewProcess && !previewProcess.killed) {
44
- previewProcess.kill();
44
+ const pid = previewProcess.pid;
45
+ if (pid) {
46
+ try {
47
+ process.kill(-pid, "SIGTERM");
48
+ } catch {
49
+ // Process group already exited
50
+ }
51
+ } else {
52
+ previewProcess.kill();
53
+ }
45
54
  }
46
55
  previewProcess = null;
47
56
  processes.delete("preview");
@@ -68,6 +77,7 @@ const extension: ExtensionFactory = (pi) => {
68
77
  cwd: sceneRoot,
69
78
  stdio: "pipe",
70
79
  shell: true,
80
+ detached: true,
71
81
  });
72
82
 
73
83
  processes.set("preview", {
@@ -23,3 +23,18 @@ if (!_global[REGISTRY_KEY]) {
23
23
 
24
24
  /** Shared registry of running background processes, keyed by unique id. */
25
25
  export const processes = _global[REGISTRY_KEY] as Map<string, BackgroundProcess>;
26
+
27
+ const EXIT_HANDLER_KEY = Symbol.for("opendcl.exitHandler");
28
+ if (!_global[EXIT_HANDLER_KEY]) {
29
+ _global[EXIT_HANDLER_KEY] = true;
30
+ process.on("exit", () => {
31
+ for (const [id, proc] of processes) {
32
+ try {
33
+ proc.kill();
34
+ } catch {
35
+ // Best-effort
36
+ }
37
+ processes.delete(id);
38
+ }
39
+ });
40
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl-regenesislabs/opendcl",
3
- "version": "0.1.2",
3
+ "version": "0.1.3-22334161920.commit-0b218cb",
4
4
  "description": "AI coding assistant for Decentraland SDK7 scene development",
5
5
  "type": "module",
6
6
  "bin": {
@@ -66,5 +66,5 @@
66
66
  "prompts/",
67
67
  "context/"
68
68
  ],
69
- "commit": "2f434a292d0f0316c7f41d799c7d699b15480a46"
69
+ "commit": "0b218cbd9244cde7009c99d2b61ec9824fe7c2af"
70
70
  }