@gjsify/node-gi 0.64.14 → 0.64.16

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.
@@ -0,0 +1,47 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // @gjsify/node-gi — host.node.js with ONE export overridden: foreign parent classes are
3
+ // allowed. Selected by the `gjsify-foreign-parents` condition (package.json `imports` →
4
+ // `#host`), i.e. only by a program launched as `node --conditions=gjsify-foreign-parents`.
5
+ //
6
+ // WHY A HOST AND NOT A FLAG. host.node.js keeps FOREIGN_PARENT_CLASSES false on purpose and
7
+ // its comment says why: on Node/Bun/Deno/GJS a program can also be run under real GJS, so
8
+ // `registerClass` must keep throwing GJS's invalid-base error rather than accept a base GJS
9
+ // would reject. That reasoning is about PROGRAMS, and it is the right default for every one of
10
+ // them. It is not a statement about the capability: route D is host-agnostic C++, and flipping
11
+ // this one export is enough to drive it on a desktop — measured, 2026-10-31.
12
+ //
13
+ // WHAT IT BUYS, and why the hole is worth having. Route D (`withProperties` over a foreign
14
+ // NativeScript base, ADR 0105 § 2) had NO harness anywhere but an Android device run: the
15
+ // pure-JS leg answers from the seam's own accessors and passes by construction, so the one path
16
+ // that can break was measured only by plugging in a phone. It broke exactly there —
17
+ // `Gtk.MenuButton` reached the device with `resolved.giConnect === undefined` and five red
18
+ // cases (ADR 0128 Amendment § A5). With this condition the same five fail on a laptop in 17ms,
19
+ // which is the difference between a regression test and a field report.
20
+ //
21
+ // WHY IT IS NOT A BACK DOOR. The condition has to be passed on the COMMAND LINE of the process:
22
+ // no dependency, bundle, env var or config file can select it, and nothing in node-gi reads it
23
+ // at runtime. A consumer that types it has made the same deliberate choice a NativeScript build
24
+ // makes, and has this file's name in their command to say so. The GJS-compatibility promise
25
+ // holds for every program that does not.
26
+ //
27
+ // The only consumer is `@gjsify/adwaita-nativescript`'s `test:gjs-on-node` leg. Everything other
28
+ // than the one flag comes from host.node.js, so this file cannot drift from it.
29
+ export {
30
+ setImmediate,
31
+ setInterval,
32
+ clearInterval,
33
+ runtimeProcess,
34
+ windowingEnvWrites,
35
+ bundledLocaleDir,
36
+ refreshLocale,
37
+ RUNTIME,
38
+ LAZY_NATIVE,
39
+ loadNativeHost,
40
+ } from './host.node.js';
41
+
42
+ /**
43
+ * Whether `GObject.registerClass` may register a class whose JS parent is NOT a node-gi
44
+ * GObject class. TRUE here — the one export this host overrides; see the header.
45
+ * @type {boolean}
46
+ */
47
+ export const FOREIGN_PARENT_CLASSES = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/node-gi",
3
- "version": "0.64.14",
3
+ "version": "0.64.16",
4
4
  "description": "GObject-Introspection runtime for Node.js — load gi:// namespaces (GLib/GObject/Gio/…) with GJS-compatible semantics. Vendored + rewritten from node-gtk under MIT.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -11,6 +11,7 @@
11
11
  "#host": {
12
12
  "nativescript": "./host.nativescript.js",
13
13
  "wasm": "./host.wasm.js",
14
+ "gjsify-foreign-parents": "./host.node.foreign.js",
14
15
  "default": "./host.node.js"
15
16
  }
16
17
  },
@@ -48,6 +49,7 @@
48
49
  "files": [
49
50
  "index.js",
50
51
  "host.node.js",
52
+ "host.node.foreign.js",
51
53
  "host.nativescript.js",
52
54
  "nativescript.webpack.js",
53
55
  "index.d.ts",
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file