@gjsify/resolve-npm 0.44.0 → 0.45.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 +255 -153
- package/lib/index.d.ts +47 -23
- package/lib/index.mjs +194 -203
- package/lib/runtime-aliases.mjs +49 -24
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -65,7 +65,7 @@ import { getDerivedAliasesSync as _getDerivedAliasesSync } from './runtime-alias
|
|
|
65
65
|
* direct indexing.
|
|
66
66
|
*
|
|
67
67
|
* @param {Record<string,string>} table
|
|
68
|
-
* @param {'
|
|
68
|
+
* @param {import('./runtime-aliases.mjs').Target} target
|
|
69
69
|
* @returns {Record<string,string>}
|
|
70
70
|
*/
|
|
71
71
|
function withDerivedSlotRouting(table, target) {
|
|
@@ -83,12 +83,10 @@ function withDerivedSlotRouting(table, target) {
|
|
|
83
83
|
return routed;
|
|
84
84
|
};
|
|
85
85
|
return new Proxy(table, {
|
|
86
|
-
get: (_t, prop) =>
|
|
87
|
-
typeof prop === 'string' ? materialise()[prop] : Reflect.get(table, prop),
|
|
86
|
+
get: (_t, prop) => (typeof prop === 'string' ? materialise()[prop] : Reflect.get(table, prop)),
|
|
88
87
|
has: (_t, prop) => Reflect.has(materialise(), prop),
|
|
89
88
|
ownKeys: () => Reflect.ownKeys(materialise()),
|
|
90
|
-
getOwnPropertyDescriptor: (_t, prop) =>
|
|
91
|
-
Reflect.getOwnPropertyDescriptor(materialise(), prop),
|
|
89
|
+
getOwnPropertyDescriptor: (_t, prop) => Reflect.getOwnPropertyDescriptor(materialise(), prop),
|
|
92
90
|
});
|
|
93
91
|
}
|
|
94
92
|
|
|
@@ -148,13 +146,10 @@ export const EXTERNALS_NODE = [
|
|
|
148
146
|
'sqlite',
|
|
149
147
|
'worker_threads',
|
|
150
148
|
'zlib',
|
|
151
|
-
]
|
|
149
|
+
];
|
|
152
150
|
|
|
153
151
|
/** Array of NPM module names for which we have our own implementation */
|
|
154
|
-
export const EXTERNALS_NPM = [
|
|
155
|
-
'readable-stream',
|
|
156
|
-
'node-fetch'
|
|
157
|
-
]
|
|
152
|
+
export const EXTERNALS_NPM = ['readable-stream', 'node-fetch'];
|
|
158
153
|
|
|
159
154
|
/** General record of modules for Gjs */
|
|
160
155
|
export const ALIASES_GENERAL_FOR_GJS = {
|
|
@@ -163,7 +158,7 @@ export const ALIASES_GENERAL_FOR_GJS = {
|
|
|
163
158
|
// DOMParser is not available; on GJS we provide DOMParser via
|
|
164
159
|
// @gjsify/domparser, so jsdom and its whatwg-url/webidl-conversions
|
|
165
160
|
// deps (which use SharedArrayBuffer — unavailable in GJS) are never needed.
|
|
166
|
-
|
|
161
|
+
jsdom: '@gjsify/empty',
|
|
167
162
|
|
|
168
163
|
// engine.io-client ships both polling-xhr.node.js (uses xmlhttprequest-ssl /
|
|
169
164
|
// Node http.request) and polling-xhr.js (uses globalThis.XMLHttpRequest).
|
|
@@ -176,66 +171,65 @@ export const ALIASES_GENERAL_FOR_GJS = {
|
|
|
176
171
|
'./polling-xhr.node.js': './polling-xhr.js',
|
|
177
172
|
'./websocket.node.js': './websocket.js',
|
|
178
173
|
'./globals.node.js': './globals.js',
|
|
179
|
-
|
|
180
|
-
}
|
|
174
|
+
};
|
|
181
175
|
|
|
182
176
|
/** Record of Node.js modules (build in or not) and his replacement for Gjs */
|
|
183
177
|
export const ALIASES_NODE_FOR_GJS = {
|
|
184
178
|
// Internal Node.js modules
|
|
185
|
-
|
|
179
|
+
assert: '@gjsify/assert',
|
|
186
180
|
'assert/strict': '@gjsify/assert/strict',
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
181
|
+
async_hooks: '@gjsify/async_hooks',
|
|
182
|
+
buffer: '@gjsify/buffer',
|
|
183
|
+
child_process: '@gjsify/child_process',
|
|
184
|
+
cluster: '@gjsify/cluster',
|
|
185
|
+
console: '@gjsify/console',
|
|
186
|
+
constants: '@gjsify/constants',
|
|
187
|
+
crypto: '@gjsify/crypto',
|
|
188
|
+
dgram: '@gjsify/dgram',
|
|
189
|
+
diagnostics_channel: '@gjsify/diagnostics_channel',
|
|
190
|
+
dns: '@gjsify/dns',
|
|
197
191
|
'dns/promises': '@gjsify/dns/promises',
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
192
|
+
domain: '@gjsify/domain',
|
|
193
|
+
events: '@gjsify/events',
|
|
194
|
+
fs: '@gjsify/fs',
|
|
201
195
|
'fs/promises': '@gjsify/fs/promises',
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
196
|
+
http: '@gjsify/http',
|
|
197
|
+
http2: '@gjsify/http2',
|
|
198
|
+
https: '@gjsify/https',
|
|
199
|
+
inspector: '@gjsify/inspector',
|
|
200
|
+
module: '@gjsify/module',
|
|
201
|
+
net: '@gjsify/net',
|
|
202
|
+
os: '@gjsify/os',
|
|
203
|
+
path: '@gjsify/path',
|
|
210
204
|
'path/posix': '@gjsify/path/posix',
|
|
211
205
|
'path/win32': '@gjsify/path/win32',
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
206
|
+
perf_hooks: '@gjsify/perf_hooks',
|
|
207
|
+
process: '@gjsify/process',
|
|
208
|
+
punycode: '@gjsify/punycode', // stub — deprecated, low priority
|
|
209
|
+
querystring: '@gjsify/querystring',
|
|
210
|
+
readline: '@gjsify/readline',
|
|
217
211
|
'readline/promises': '@gjsify/readline/promises',
|
|
218
|
-
|
|
219
|
-
|
|
212
|
+
repl: '@gjsify/repl', // stub — low priority
|
|
213
|
+
stream: '@gjsify/stream',
|
|
220
214
|
'stream/web': '@gjsify/stream/web',
|
|
221
215
|
'stream/consumers': '@gjsify/stream/consumers',
|
|
222
216
|
'stream/promises': '@gjsify/stream/promises',
|
|
223
|
-
|
|
224
|
-
|
|
217
|
+
string_decoder: '@gjsify/string_decoder',
|
|
218
|
+
sys: '@gjsify/sys',
|
|
225
219
|
// 'test': '@gjsify/test', // not planned — use @gjsify/unit instead
|
|
226
|
-
|
|
220
|
+
timers: '@gjsify/timers',
|
|
227
221
|
'timers/promises': '@gjsify/timers/promises',
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
222
|
+
tls: '@gjsify/tls',
|
|
223
|
+
tty: '@gjsify/tty',
|
|
224
|
+
url: '@gjsify/url',
|
|
225
|
+
util: '@gjsify/util',
|
|
232
226
|
'util/types': '@gjsify/util/types',
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
227
|
+
v8: '@gjsify/v8',
|
|
228
|
+
vm: '@gjsify/vm',
|
|
229
|
+
wasi: '@gjsify/wasi', // stub — low priority (WebAssembly System Interface)
|
|
230
|
+
sqlite: '@gjsify/sqlite',
|
|
231
|
+
worker_threads: '@gjsify/worker_threads',
|
|
232
|
+
zlib: '@gjsify/zlib',
|
|
239
233
|
|
|
240
234
|
// Third party Node Modules
|
|
241
235
|
'node-fetch': '@gjsify/fetch',
|
|
@@ -249,7 +243,7 @@ export const ALIASES_NODE_FOR_GJS = {
|
|
|
249
243
|
// resolves to @gjsify/ws unchanged, including the `typeof ws ===
|
|
250
244
|
// 'function'` heuristic used by @thaunknown/simple-websocket and
|
|
251
245
|
// similar transitive users.
|
|
252
|
-
|
|
246
|
+
ws: '@gjsify/ws',
|
|
253
247
|
|
|
254
248
|
// isomorphic-ws's browser.js is literally `module.exports = WebSocket`
|
|
255
249
|
// — just the native class. On GJS that native class is @gjsify/websocket
|
|
@@ -258,7 +252,7 @@ export const ALIASES_NODE_FOR_GJS = {
|
|
|
258
252
|
// Consumers who do `import WS from 'isomorphic-ws'` get our class
|
|
259
253
|
// unchanged — one less delegation hop than going through @gjsify/ws.
|
|
260
254
|
'isomorphic-ws': '@gjsify/websocket',
|
|
261
|
-
}
|
|
255
|
+
};
|
|
262
256
|
|
|
263
257
|
/**
|
|
264
258
|
* Record of Node.js modules (built-in or 3rd-party) and their `@gjsify/<X>`
|
|
@@ -332,65 +326,65 @@ export const ALIASES_NODE_FOR_GJS = {
|
|
|
332
326
|
* made the `crypto` / `zlib` root-body routing read as latent.)
|
|
333
327
|
*/
|
|
334
328
|
const ALIASES_NODE_FOR_BROWSER_TABLE = {
|
|
335
|
-
|
|
336
|
-
'assert/strict':
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
'dns/promises':
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
'fs/promises':
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
'path/posix':
|
|
361
|
-
'path/win32':
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
'readline/promises':
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
'stream/web':
|
|
371
|
-
'stream/consumers':
|
|
372
|
-
'stream/promises':
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
'timers/promises':
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
'util/types':
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
329
|
+
assert: '@gjsify/assert',
|
|
330
|
+
'assert/strict': '@gjsify/assert/strict',
|
|
331
|
+
async_hooks: '@gjsify/async_hooks',
|
|
332
|
+
buffer: '@gjsify/buffer',
|
|
333
|
+
child_process: '@gjsify/child_process/browser', // none slot — NAMED throwing stub
|
|
334
|
+
cluster: '@gjsify/empty', // (B) simulatable over Web Workers — unbuilt
|
|
335
|
+
console: '@gjsify/console',
|
|
336
|
+
constants: '@gjsify/constants',
|
|
337
|
+
crypto: '@gjsify/crypto/browser', // partial slot — name the platform entry
|
|
338
|
+
dgram: '@gjsify/empty', // (B) simulatable over WebRTC data channels — unbuilt
|
|
339
|
+
diagnostics_channel: '@gjsify/diagnostics_channel',
|
|
340
|
+
dns: '@gjsify/dns/browser', // partial slot — name the platform entry
|
|
341
|
+
'dns/promises': '@gjsify/empty', // (A) blocked: no ./browser/promises subpath yet
|
|
342
|
+
domain: '@gjsify/domain',
|
|
343
|
+
events: '@gjsify/events',
|
|
344
|
+
fs: '@gjsify/fs/browser', // partial slot — name the platform entry
|
|
345
|
+
'fs/promises': '@gjsify/fs/browser/promises',
|
|
346
|
+
http: '@gjsify/http/browser', // partial slot — name the platform entry
|
|
347
|
+
http2: '@gjsify/empty', // (C) impossible — needs a named throwing stub
|
|
348
|
+
https: '@gjsify/https/browser', // partial slot — name the platform entry
|
|
349
|
+
inspector: '@gjsify/empty', // (C) impossible — needs a named throwing stub
|
|
350
|
+
module: '@gjsify/module/browser', // partial slot — name the platform entry
|
|
351
|
+
net: '@gjsify/net/browser', // none slot — NAMED throwing stub
|
|
352
|
+
os: '@gjsify/os',
|
|
353
|
+
path: '@gjsify/path',
|
|
354
|
+
'path/posix': '@gjsify/path/posix',
|
|
355
|
+
'path/win32': '@gjsify/path/win32',
|
|
356
|
+
perf_hooks: '@gjsify/perf_hooks',
|
|
357
|
+
process: '@gjsify/process', // PR-D: flips today's `@gjsify/empty`
|
|
358
|
+
punycode: '@gjsify/punycode',
|
|
359
|
+
querystring: '@gjsify/querystring',
|
|
360
|
+
readline: '@gjsify/empty', // (B) stream-generic; simulatable — unbuilt
|
|
361
|
+
'readline/promises': '@gjsify/empty', // (B) stream-generic; simulatable — unbuilt
|
|
362
|
+
repl: '@gjsify/empty', // (C) impossible, and no @gjsify/repl package exists
|
|
363
|
+
stream: '@gjsify/stream',
|
|
364
|
+
'stream/web': '@gjsify/stream/web',
|
|
365
|
+
'stream/consumers': '@gjsify/stream/consumers',
|
|
366
|
+
'stream/promises': '@gjsify/stream/promises',
|
|
367
|
+
string_decoder: '@gjsify/string_decoder',
|
|
368
|
+
sys: '@gjsify/sys',
|
|
369
|
+
timers: '@gjsify/timers',
|
|
370
|
+
'timers/promises': '@gjsify/timers/promises',
|
|
371
|
+
tls: '@gjsify/tls/browser', // none slot — NAMED throwing stub
|
|
372
|
+
tty: '@gjsify/empty', // (B) isatty()===false is honest — unbuilt
|
|
373
|
+
url: '@gjsify/url',
|
|
374
|
+
util: '@gjsify/util',
|
|
375
|
+
'util/types': '@gjsify/util/types',
|
|
376
|
+
v8: '@gjsify/empty', // (B) serialize/deserialize over structuredClone — unbuilt
|
|
377
|
+
vm: '@gjsify/vm',
|
|
378
|
+
wasi: '@gjsify/empty', // (C) impossible, and no @gjsify/wasi package exists
|
|
379
|
+
sqlite: '@gjsify/sqlite/browser', // partial slot — name the platform entry
|
|
380
|
+
worker_threads: '@gjsify/worker_threads/browser', // partial slot — name the platform entry
|
|
381
|
+
zlib: '@gjsify/zlib/browser', // partial slot — name the platform entry
|
|
388
382
|
|
|
389
383
|
// Third-party
|
|
390
|
-
'node-fetch':
|
|
391
|
-
|
|
392
|
-
'isomorphic-ws':
|
|
393
|
-
}
|
|
384
|
+
'node-fetch': '@gjsify/empty', // (A') native-available: wants @gjsify/fetch/globals
|
|
385
|
+
ws: '@gjsify/ws/browser', // partial slot — name the platform entry
|
|
386
|
+
'isomorphic-ws': '@gjsify/empty', // (A') native-available: wants a WebSocket re-export
|
|
387
|
+
};
|
|
394
388
|
|
|
395
389
|
/**
|
|
396
390
|
* Bare Node-builtin specifier → polyfill / empty-stub mapping for `--app
|
|
@@ -399,10 +393,7 @@ const ALIASES_NODE_FOR_BROWSER_TABLE = {
|
|
|
399
393
|
* and it exports a `./browser` subpath). See `withDerivedSlotRouting` above for
|
|
400
394
|
* why the two-pass chain has to be collapsed here.
|
|
401
395
|
*/
|
|
402
|
-
export const ALIASES_NODE_FOR_BROWSER = withDerivedSlotRouting(
|
|
403
|
-
ALIASES_NODE_FOR_BROWSER_TABLE,
|
|
404
|
-
'browser',
|
|
405
|
-
);
|
|
396
|
+
export const ALIASES_NODE_FOR_BROWSER = withDerivedSlotRouting(ALIASES_NODE_FOR_BROWSER_TABLE, 'browser');
|
|
406
397
|
|
|
407
398
|
/**
|
|
408
399
|
* Bare Node-builtin specifier → polyfill / empty-stub mapping for `--app
|
|
@@ -438,66 +429,66 @@ export const ALIASES_NODE_FOR_BROWSER = withDerivedSlotRouting(
|
|
|
438
429
|
*/
|
|
439
430
|
export const ALIASES_NODE_FOR_NATIVESCRIPT = {
|
|
440
431
|
// Server-only Node built-ins → empty stub
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
'dns/promises':
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
432
|
+
child_process: '@gjsify/empty',
|
|
433
|
+
cluster: '@gjsify/empty',
|
|
434
|
+
dgram: '@gjsify/empty',
|
|
435
|
+
dns: '@gjsify/empty',
|
|
436
|
+
'dns/promises': '@gjsify/empty',
|
|
437
|
+
inspector: '@gjsify/empty',
|
|
438
|
+
net: '@gjsify/empty',
|
|
439
|
+
tls: '@gjsify/empty',
|
|
440
|
+
tty: '@gjsify/empty',
|
|
441
|
+
http: '@gjsify/empty',
|
|
442
|
+
https: '@gjsify/empty',
|
|
443
|
+
http2: '@gjsify/empty',
|
|
444
|
+
readline: '@gjsify/empty',
|
|
445
|
+
repl: '@gjsify/empty',
|
|
446
|
+
v8: '@gjsify/empty',
|
|
447
|
+
vm: '@gjsify/empty',
|
|
448
|
+
worker_threads: '@gjsify/empty',
|
|
449
|
+
perf_hooks: '@gjsify/empty',
|
|
450
|
+
diagnostics_channel: '@gjsify/empty',
|
|
451
|
+
domain: '@gjsify/empty',
|
|
452
|
+
sqlite: '@gjsify/empty',
|
|
453
|
+
sys: '@gjsify/empty',
|
|
454
|
+
zlib: '@gjsify/empty',
|
|
464
455
|
|
|
465
456
|
// Mobile-tractable Node built-ins → @gjsify/<X>
|
|
466
|
-
|
|
467
|
-
'assert/strict':
|
|
468
|
-
|
|
469
|
-
|
|
457
|
+
assert: '@gjsify/assert',
|
|
458
|
+
'assert/strict': '@gjsify/assert',
|
|
459
|
+
async_hooks: '@gjsify/async_hooks',
|
|
460
|
+
buffer: '@gjsify/buffer',
|
|
470
461
|
// `@gjsify/module` (not `@gjsify/empty`): provides the named exports
|
|
471
462
|
// `createRequire` / `builtinModules` / `isBuiltin`, so `import { createRequire }
|
|
472
463
|
// from 'module'` in deps (e.g. css-tree) resolves instead of failing the build.
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
464
|
+
module: '@gjsify/module',
|
|
465
|
+
crypto: '@gjsify/crypto',
|
|
466
|
+
events: '@gjsify/events',
|
|
476
467
|
// @gjsify/fs uses gi://Gio (GJS-only). On NS, route to the native bridge.
|
|
477
|
-
|
|
478
|
-
'fs/promises':
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
'path/posix':
|
|
482
|
-
'path/win32':
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
'stream/promises':
|
|
486
|
-
'stream/web':
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
'util/types':
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
'timers/promises':
|
|
468
|
+
fs: '@gjsify/native-fs-bridge',
|
|
469
|
+
'fs/promises': '@gjsify/native-fs-bridge',
|
|
470
|
+
os: '@gjsify/os',
|
|
471
|
+
path: '@gjsify/path',
|
|
472
|
+
'path/posix': '@gjsify/path/posix',
|
|
473
|
+
'path/win32': '@gjsify/path/win32',
|
|
474
|
+
process: '@gjsify/process',
|
|
475
|
+
stream: '@gjsify/stream',
|
|
476
|
+
'stream/promises': '@gjsify/stream/promises',
|
|
477
|
+
'stream/web': '@gjsify/stream/web',
|
|
478
|
+
string_decoder: '@gjsify/string_decoder',
|
|
479
|
+
url: '@gjsify/url',
|
|
480
|
+
util: '@gjsify/util',
|
|
481
|
+
'util/types': '@gjsify/util/types',
|
|
482
|
+
querystring: '@gjsify/querystring',
|
|
483
|
+
console: '@gjsify/console',
|
|
484
|
+
timers: '@gjsify/timers',
|
|
485
|
+
'timers/promises': '@gjsify/timers/promises',
|
|
495
486
|
|
|
496
487
|
// Third-party
|
|
497
|
-
'node-fetch':
|
|
498
|
-
|
|
499
|
-
'isomorphic-ws':
|
|
500
|
-
}
|
|
488
|
+
'node-fetch': '@gjsify/empty', // NS has native fetch
|
|
489
|
+
ws: '@gjsify/empty', // NS has its own WebSocket
|
|
490
|
+
'isomorphic-ws': '@gjsify/empty',
|
|
491
|
+
};
|
|
501
492
|
|
|
502
493
|
/** Record of Web modules and his replacement for Gjs */
|
|
503
494
|
export const ALIASES_WEB_FOR_GJS = {
|
|
@@ -508,14 +499,14 @@ export const ALIASES_WEB_FOR_GJS = {
|
|
|
508
499
|
'dom-exception': '@gjsify/dom-exception',
|
|
509
500
|
'event-target-shim': '@gjsify/dom-events',
|
|
510
501
|
'message-channel': '@gjsify/message-channel',
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
502
|
+
eventsource: '@gjsify/eventsource',
|
|
503
|
+
fetch: '@gjsify/fetch',
|
|
504
|
+
formdata: '@gjsify/formdata',
|
|
514
505
|
'html-image-element': '@gjsify/html-image-element',
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
506
|
+
webcrypto: '@gjsify/webcrypto',
|
|
507
|
+
webgl: '@gjsify/webgl',
|
|
508
|
+
websocket: '@gjsify/websocket',
|
|
509
|
+
webstorage: '@gjsify/webstorage',
|
|
519
510
|
|
|
520
511
|
// /register subpaths (side-effect only — opt-in to global registration)
|
|
521
512
|
'abort-controller/register': '@gjsify/abort-controller/register',
|
|
@@ -540,23 +531,23 @@ export const ALIASES_WEB_FOR_GJS = {
|
|
|
540
531
|
'web-streams/register/queuing': '@gjsify/web-streams/register/queuing',
|
|
541
532
|
|
|
542
533
|
// xmlhttprequest (implemented in @gjsify/fetch)
|
|
543
|
-
|
|
534
|
+
xmlhttprequest: '@gjsify/fetch',
|
|
544
535
|
'xmlhttprequest/register': '@gjsify/fetch/register/xhr',
|
|
545
536
|
'@gjsify/xmlhttprequest': '@gjsify/fetch',
|
|
546
537
|
'@gjsify/xmlhttprequest/register': '@gjsify/fetch/register/xhr',
|
|
547
|
-
|
|
538
|
+
domparser: '@gjsify/domparser',
|
|
548
539
|
'domparser/register': '@gjsify/domparser/register',
|
|
549
540
|
|
|
550
541
|
// Web Audio API (GStreamer backend)
|
|
551
|
-
|
|
542
|
+
webaudio: '@gjsify/webaudio',
|
|
552
543
|
'webaudio/register': '@gjsify/webaudio/register',
|
|
553
544
|
|
|
554
545
|
// Gamepad API (libmanette backend)
|
|
555
|
-
|
|
546
|
+
gamepad: '@gjsify/gamepad',
|
|
556
547
|
'gamepad/register': '@gjsify/gamepad/register',
|
|
557
548
|
|
|
558
549
|
// WebRTC API (GStreamer webrtcbin backend)
|
|
559
|
-
|
|
550
|
+
webrtc: '@gjsify/webrtc',
|
|
560
551
|
'webrtc/register': '@gjsify/webrtc/register',
|
|
561
552
|
'webrtc/register/peer-connection': '@gjsify/webrtc/register/peer-connection',
|
|
562
553
|
'webrtc/register/data-channel': '@gjsify/webrtc/register/data-channel',
|
|
@@ -567,10 +558,10 @@ export const ALIASES_WEB_FOR_GJS = {
|
|
|
567
558
|
// WebAssembly Promise APIs polyfill — wraps the synchronous Module/Instance
|
|
568
559
|
// constructors so WebAssembly.{compile,instantiate,validate,...} resolve
|
|
569
560
|
// instead of throwing the SpiderMonkey 128 stub error.
|
|
570
|
-
|
|
561
|
+
webassembly: '@gjsify/webassembly',
|
|
571
562
|
'webassembly/register': '@gjsify/webassembly/register',
|
|
572
563
|
'webassembly/register/promise': '@gjsify/webassembly/register/promise',
|
|
573
|
-
}
|
|
564
|
+
};
|
|
574
565
|
|
|
575
566
|
/** General record of modules for Node */
|
|
576
567
|
export const ALIASES_GENERAL_FOR_NODE = {
|
|
@@ -587,7 +578,7 @@ export const ALIASES_GENERAL_FOR_NODE = {
|
|
|
587
578
|
'@gjsify/web-globals/register': '@gjsify/empty',
|
|
588
579
|
'@gjsify/web-globals/register/performance': '@gjsify/empty',
|
|
589
580
|
'@gjsify/web-globals/register/formdata': '@gjsify/empty',
|
|
590
|
-
}
|
|
581
|
+
};
|
|
591
582
|
|
|
592
583
|
/**
|
|
593
584
|
* Record of GJS built-in module specifiers and their replacement for the
|
|
@@ -611,10 +602,10 @@ export const ALIASES_GENERAL_FOR_NODE = {
|
|
|
611
602
|
* the engine's foreign-struct seam knows about).
|
|
612
603
|
*/
|
|
613
604
|
const ALIASES_GJS_FOR_NODE = {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
}
|
|
605
|
+
system: '@gjsify/node-gi/system',
|
|
606
|
+
gettext: '@gjsify/node-gi/gettext',
|
|
607
|
+
cairo: '@gjsify/node-gi/cairo',
|
|
608
|
+
};
|
|
618
609
|
|
|
619
610
|
export { ALIASES_GJS_FOR_NODE };
|
|
620
611
|
|
|
@@ -643,19 +634,19 @@ export const ALIASES_WEB_FOR_NODE = {
|
|
|
643
634
|
// works without any GJS deps; routing to it gives consumers a working
|
|
644
635
|
// EventSource on Node out of the box. Same fix pattern as the `dom-events`
|
|
645
636
|
// entry above.
|
|
646
|
-
|
|
637
|
+
eventsource: '@gjsify/eventsource',
|
|
647
638
|
// 'fetch' routes to @gjsify/fetch/globals on Node — the globals.mjs
|
|
648
639
|
// re-exports the native globalThis.{fetch,Request,Response,Headers,
|
|
649
640
|
// FormData} as named exports. The dynamic resolver routes
|
|
650
641
|
// @gjsify/fetch to the same /globals subpath via its runtimes
|
|
651
642
|
// triplet declaration (`node:"native"`), so both entry forms converge.
|
|
652
|
-
|
|
653
|
-
|
|
643
|
+
fetch: '@gjsify/fetch/globals',
|
|
644
|
+
formdata: '@gjsify/formdata/globals',
|
|
654
645
|
'html-image-element': '@gjsify/html-image-element',
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
646
|
+
webcrypto: '@gjsify/webcrypto/globals',
|
|
647
|
+
webgl: '@gjsify/webgl',
|
|
648
|
+
websocket: '@gjsify/websocket/globals',
|
|
649
|
+
webstorage: '@gjsify/webstorage',
|
|
659
650
|
|
|
660
651
|
// /register subpaths — no-op on Node (native globals are already set)
|
|
661
652
|
'abort-controller/register': '@gjsify/empty',
|
|
@@ -718,26 +709,26 @@ export const ALIASES_WEB_FOR_NODE = {
|
|
|
718
709
|
'@gjsify/buffer/register': '@gjsify/empty',
|
|
719
710
|
|
|
720
711
|
// xmlhttprequest + DOMParser — no-op on Node
|
|
721
|
-
|
|
712
|
+
xmlhttprequest: '@gjsify/empty',
|
|
722
713
|
'xmlhttprequest/register': '@gjsify/empty',
|
|
723
714
|
'@gjsify/xmlhttprequest': '@gjsify/empty',
|
|
724
715
|
'@gjsify/xmlhttprequest/register': '@gjsify/empty',
|
|
725
|
-
|
|
716
|
+
domparser: '@gjsify/empty',
|
|
726
717
|
'domparser/register': '@gjsify/empty',
|
|
727
718
|
'@gjsify/domparser/register': '@gjsify/empty',
|
|
728
719
|
|
|
729
720
|
// Web Audio API — no-op on Node (experimental --experimental-web-audio not widely available)
|
|
730
|
-
|
|
721
|
+
webaudio: '@gjsify/empty',
|
|
731
722
|
'webaudio/register': '@gjsify/empty',
|
|
732
723
|
'@gjsify/webaudio/register': '@gjsify/empty',
|
|
733
724
|
|
|
734
725
|
// Gamepad API — no-op on Node
|
|
735
|
-
|
|
726
|
+
gamepad: '@gjsify/empty',
|
|
736
727
|
'gamepad/register': '@gjsify/empty',
|
|
737
728
|
'@gjsify/gamepad/register': '@gjsify/empty',
|
|
738
729
|
|
|
739
730
|
// WebRTC API — no-op on Node (Phase 1 is GStreamer-only, no fallback)
|
|
740
|
-
|
|
731
|
+
webrtc: '@gjsify/empty',
|
|
741
732
|
'webrtc/register': '@gjsify/empty',
|
|
742
733
|
'webrtc/register/peer-connection': '@gjsify/empty',
|
|
743
734
|
'webrtc/register/data-channel': '@gjsify/empty',
|
|
@@ -755,9 +746,9 @@ export const ALIASES_WEB_FOR_NODE = {
|
|
|
755
746
|
// WebAssembly Promise APIs — native on Node (no polyfill needed); the
|
|
756
747
|
// bare `webassembly` specifier maps to /globals so consumers can import
|
|
757
748
|
// typed helpers without dragging the polyfill into the bundle.
|
|
758
|
-
|
|
749
|
+
webassembly: '@gjsify/webassembly/globals',
|
|
759
750
|
'webassembly/register': '@gjsify/empty',
|
|
760
751
|
'webassembly/register/promise': '@gjsify/empty',
|
|
761
752
|
'@gjsify/webassembly/register': '@gjsify/empty',
|
|
762
753
|
'@gjsify/webassembly/register/promise': '@gjsify/empty',
|
|
763
|
-
}
|
|
754
|
+
};
|