bm2 1.0.25 → 1.0.27

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bm2",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "A blazing-fast, full-featured process manager built entirely on Bun native APIs. The modern PM2 replacement — zero Node.js dependencies, pure Bun performance.",
5
5
  "main": "src/api.ts",
6
6
  "module": "src/api.ts",
@@ -13,11 +13,12 @@
13
13
  * License: GPL-3.0-only
14
14
  * Author: Zak <zak@maxxpainn.com>
15
15
  */
16
- import type { Subprocess } from "bun";
17
- import type { ProcessDescription } from "./types";
18
- import { getCpuCount } from "./utils";
16
+ import type { Subprocess } from "bun";
17
+ import type { ProcessDescription } from "./types";
18
+ import { getCpuCount } from "./utils";
19
+ import path from "path"
19
20
 
20
- export class ClusterManager {
21
+ export class ClusterManager {
21
22
  private workers: Map<number, Map<number, Subprocess>> = new Map();
22
23
 
23
24
  resolveInstances(instances: number | string | undefined): number {
@@ -67,7 +68,7 @@
67
68
  cmd.push(...config.nodeArgs);
68
69
  }
69
70
 
70
- cmd.push(config.script);
71
+ cmd.push(path.resolve(config.script));
71
72
  if (config.args?.length) cmd.push(...config.args);
72
73
 
73
74
  return cmd;
@@ -67,6 +67,8 @@ import path from "path";
67
67
  if (isCluster) {
68
68
  // In cluster mode, each instance is a separate container
69
69
  for (let i = 0; i < resolvedInstances; i++) {
70
+
71
+ options.script = path.resolve(options.script);
70
72
 
71
73
  const id = this.nextId++;
72
74
  const baseName = options.name || options.script.split("/").pop()?.replace(/\.\w+$/, "") || `app-${id}`;