@aravindc26/velu 0.12.1 → 0.12.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.ts +8 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aravindc26/velu",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "description": "A modern documentation site generator powered by Markdown and JSON configuration",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/cli.ts CHANGED
@@ -526,11 +526,17 @@ async function previewServer(port: number) {
526
526
  },
527
527
  });
528
528
 
529
- child.on("exit", (code) => process.exit(code ?? 0));
530
-
531
529
  const cleanup = () => child.kill("SIGTERM");
532
530
  process.on("SIGINT", cleanup);
533
531
  process.on("SIGTERM", cleanup);
532
+
533
+ // Wait for the child to exit — prevents the caller from reaching process.exit(0)
534
+ await new Promise<void>((res) => {
535
+ child.on("exit", (code) => {
536
+ process.exitCode = code ?? 0;
537
+ res();
538
+ });
539
+ });
534
540
  }
535
541
 
536
542
  // ── run ──────────────────────────────────────────────────────────────────────────