@gjsify/cluster 0.4.30 → 0.4.32

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/globals.mjs ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Re-exports native `node:cluster` for use in Node.js builds.
3
+ *
4
+ * On Node, `node:cluster` is built into the runtime — so a Node-target
5
+ * bundle that imports `@gjsify/cluster` is routed here by the
6
+ * resolver's `gjsify.runtimes.node === "native"` rule. This avoids dragging
7
+ * the GJS polyfill into Node bundles entirely.
8
+ *
9
+ * GJS bundles do NOT consult this file; they route to `@gjsify/cluster`'s
10
+ * own `lib/esm/index.js` (the polyfill).
11
+ */
12
+ export * from 'node:cluster';
13
+ export { default } from 'node:cluster';
@@ -2,11 +2,11 @@ import { EventEmitter } from 'node:events';
2
2
  export declare const isPrimary = true;
3
3
  export declare const isMaster = true;
4
4
  export declare const isWorker = false;
5
- export declare const workers: Record<number, any>;
6
- export declare const settings: any;
7
- export declare function setupPrimary(_settings?: any): void;
5
+ export declare const workers: Record<number, unknown>;
6
+ export declare const settings: Record<string, unknown>;
7
+ export declare function setupPrimary(_settings?: Record<string, unknown>): void;
8
8
  export declare const setupMaster: typeof setupPrimary;
9
- export declare function fork(_env?: any): any;
9
+ export declare function fork(_env?: Record<string, string | undefined>): never;
10
10
  export declare function disconnect(_callback?: () => void): void;
11
11
  export declare const schedulingPolicy = 2;
12
12
  export declare const SCHED_NONE = 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/cluster",
3
- "version": "0.4.30",
3
+ "version": "0.4.32",
4
4
  "description": "Node.js cluster module for Gjs",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -9,10 +9,12 @@
9
9
  ".": {
10
10
  "types": "./lib/types/index.d.ts",
11
11
  "default": "./lib/esm/index.js"
12
- }
12
+ },
13
+ "./globals": "./globals.mjs"
13
14
  },
14
15
  "files": [
15
- "lib"
16
+ "lib",
17
+ "globals.mjs"
16
18
  ],
17
19
  "scripts": {
18
20
  "clear": "rm -rf lib tsconfig.tsbuildinfo tsconfig.types.tsbuildinfo test.gjs.mjs test.node.mjs || exit 0",
@@ -33,12 +35,19 @@
33
35
  "cluster"
34
36
  ],
35
37
  "dependencies": {
36
- "@gjsify/events": "^0.4.30"
38
+ "@gjsify/events": "^0.4.32"
37
39
  },
38
40
  "devDependencies": {
39
- "@gjsify/cli": "^0.4.30",
40
- "@gjsify/unit": "^0.4.30",
41
+ "@gjsify/cli": "^0.4.32",
42
+ "@gjsify/unit": "^0.4.32",
41
43
  "@types/node": "^25.9.1",
42
44
  "typescript": "^6.0.3"
45
+ },
46
+ "gjsify": {
47
+ "runtimes": {
48
+ "gjs": "polyfill",
49
+ "node": "native",
50
+ "browser": "polyfill"
51
+ }
43
52
  }
44
53
  }