@gjsify/resolve-npm 0.10.0 → 0.12.0
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/lib/globals-map.mjs +25 -0
- package/package.json +1 -1
package/lib/globals-map.mjs
CHANGED
|
@@ -216,6 +216,31 @@ export const GJS_GLOBALS_MAP = {
|
|
|
216
216
|
navigator: '@gjsify/dom-elements/register/navigator',
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
+
/**
|
|
220
|
+
* Register subpaths whose module imports a GObject-Introspection typelib
|
|
221
|
+
* (`gi://…`) at load time, keyed by register-path PREFIX → the GI namespaces
|
|
222
|
+
* they pull. `--globals auto` injecting one of these makes the resulting
|
|
223
|
+
* bundle hard-require a GTK/GNOME runtime: under a GTK-less host (a headless
|
|
224
|
+
* type-check container, SSR generator, plain CI) the bundle crashes at import
|
|
225
|
+
* with `Typelib for <Ns> not found`.
|
|
226
|
+
*
|
|
227
|
+
* Consumed by `auto-globals.ts` to turn that otherwise-silent runtime crash
|
|
228
|
+
* into an actionable build-time note naming the trigger references. Matched by
|
|
229
|
+
* `path.startsWith(prefix)` so it covers every granular subpath of a package
|
|
230
|
+
* (e.g. `…/register/document`, `…/register/canvas`) with one entry.
|
|
231
|
+
*
|
|
232
|
+
* Keep in lockstep with the GI-backed register modules: when a package's
|
|
233
|
+
* `register/*` starts (or stops) importing a `gi://` namespace, update this
|
|
234
|
+
* map. (Step in the "Adding a new global" checklist when the register is
|
|
235
|
+
* GI-backed.) Only registers reachable via `GJS_GLOBALS_MAP` need an entry.
|
|
236
|
+
*/
|
|
237
|
+
export const GJS_GI_BACKED_REGISTERS = {
|
|
238
|
+
'@gjsify/dom-elements/register': ['Gdk', 'GdkPixbuf', 'Pango', 'PangoCairo'],
|
|
239
|
+
'@gjsify/webaudio/register': ['Gst', 'GstApp'],
|
|
240
|
+
'@gjsify/webrtc/register': ['Gst', 'GstWebRTC', 'GstSdp'],
|
|
241
|
+
'@gjsify/gamepad/register': ['Manette'],
|
|
242
|
+
};
|
|
243
|
+
|
|
219
244
|
// ─── Browser target ────────────────────────────────────────────────────────
|
|
220
245
|
//
|
|
221
246
|
// `GJS_GLOBALS_MAP` is the GJS-target authority — every identifier needs a
|