173 lines
5.2 KiB
JavaScript
173 lines
5.2 KiB
JavaScript
/**
|
|
* Statically imported host modules for `ctx.bare` under Bare standalone.
|
|
* Dynamic `import(ent.package)` from bare-os-ctx-bare.js does not resolve in the
|
|
* packed app.bundle (no per-referrer resolution entry); these bindings do.
|
|
*/
|
|
import b4a from 'b4a'
|
|
import compactEncoding from 'compact-encoding'
|
|
import safetyCatch from 'safety-catch'
|
|
import hypercoreIdEncoding from 'hypercore-id-encoding'
|
|
import Protomux from 'protomux'
|
|
import holesail from 'holesail'
|
|
import bareUrl from 'bare-url'
|
|
import barePath from 'bare-path'
|
|
import bareFs from 'bare-fs'
|
|
import bareOs from 'bare-os'
|
|
import bareCrypto from 'bare-crypto'
|
|
import bareFetch from 'bare-fetch'
|
|
import bareBuffer from 'bare-buffer'
|
|
import bareTcp from 'bare-tcp'
|
|
import bareTls from 'bare-tls'
|
|
import barePipe from 'bare-pipe'
|
|
import bareDns from 'bare-dns'
|
|
import bareZlib from 'bare-zlib'
|
|
import bareHrtime from 'bare-hrtime'
|
|
import bareSignals from 'bare-signals'
|
|
import bareTty from 'bare-tty'
|
|
import bareStdio from 'bare-stdio'
|
|
import bareNet from 'bare-net'
|
|
import bareSubprocess from 'bare-subprocess'
|
|
import bareWs from 'bare-ws'
|
|
import bareHttps from 'bare-https'
|
|
import bareHttp1 from 'bare-http1'
|
|
import bareDgram from 'bare-dgram'
|
|
import bareInspect from 'bare-inspect'
|
|
import barePerformance from 'bare-performance'
|
|
import bareEvents from 'bare-events'
|
|
import bareEncoding from 'bare-encoding'
|
|
import bareModule from 'bare-module'
|
|
import bareAbort from 'bare-abort'
|
|
import bareAbortController from 'bare-abort-controller'
|
|
import bareWorker from 'bare-worker'
|
|
import bareThread from 'bare-thread'
|
|
import bareChannel from 'bare-channel'
|
|
import bareTimers from 'bare-timers'
|
|
import bareAssert from 'bare-assert'
|
|
import bareLogger from 'bare-logger'
|
|
import bareFormData from 'bare-form-data'
|
|
import bareStructuredClone from 'bare-structured-clone'
|
|
import bareProcess from 'bare-process'
|
|
import bareUtils from 'bare-utils'
|
|
import barePunycode from 'bare-punycode'
|
|
import bareConsole from 'bare-console'
|
|
import bareStream from 'bare-stream'
|
|
import bareReadline from 'bare-readline'
|
|
import bareQuerystring from 'bare-querystring'
|
|
|
|
/** @type {Record<string, unknown>} */
|
|
export const bareOsStandaloneHostModulesByPackage = {
|
|
b4a,
|
|
'compact-encoding': compactEncoding,
|
|
'safety-catch': safetyCatch,
|
|
'hypercore-id-encoding': hypercoreIdEncoding,
|
|
protomux: Protomux,
|
|
holesail,
|
|
'bare-url': bareUrl,
|
|
'bare-path': barePath,
|
|
'bare-fs': bareFs,
|
|
'bare-os': bareOs,
|
|
'bare-crypto': bareCrypto,
|
|
'bare-fetch': bareFetch,
|
|
'bare-buffer': bareBuffer,
|
|
'bare-tcp': bareTcp,
|
|
'bare-tls': bareTls,
|
|
'bare-pipe': barePipe,
|
|
'bare-dns': bareDns,
|
|
'bare-zlib': bareZlib,
|
|
'bare-hrtime': bareHrtime,
|
|
'bare-signals': bareSignals,
|
|
'bare-tty': bareTty,
|
|
'bare-stdio': bareStdio,
|
|
'bare-net': bareNet,
|
|
'bare-subprocess': bareSubprocess,
|
|
'bare-ws': bareWs,
|
|
'bare-https': bareHttps,
|
|
'bare-http1': bareHttp1,
|
|
'bare-dgram': bareDgram,
|
|
'bare-inspect': bareInspect,
|
|
'bare-performance': barePerformance,
|
|
'bare-events': bareEvents,
|
|
'bare-encoding': bareEncoding,
|
|
'bare-module': bareModule,
|
|
'bare-abort': bareAbort,
|
|
'bare-abort-controller': bareAbortController,
|
|
'bare-worker': bareWorker,
|
|
'bare-thread': bareThread,
|
|
'bare-channel': bareChannel,
|
|
'bare-timers': bareTimers,
|
|
'bare-assert': bareAssert,
|
|
'bare-logger': bareLogger,
|
|
'bare-form-data': bareFormData,
|
|
'bare-structured-clone': bareStructuredClone,
|
|
'bare-process': bareProcess,
|
|
'bare-utils': bareUtils,
|
|
'bare-punycode': barePunycode,
|
|
'bare-console': bareConsole,
|
|
'bare-stream': bareStream,
|
|
'bare-readline': bareReadline,
|
|
'bare-querystring': bareQuerystring
|
|
}
|
|
|
|
/**
|
|
* Node builtin → packed module for drive-bundle `require("path")` when
|
|
* `createRequire` cannot see Node builtins under `bare:/app.bundle/`.
|
|
* Mirrors bare-node-runtime/imports for packages we statically pack.
|
|
* @type {Record<string, unknown>}
|
|
*/
|
|
export const bareOsStandaloneNodeBuiltinModules = {
|
|
assert: bareAssert,
|
|
'node:assert': bareAssert,
|
|
buffer: bareBuffer,
|
|
'node:buffer': bareBuffer,
|
|
child_process: bareSubprocess,
|
|
'node:child_process': bareSubprocess,
|
|
console: bareConsole,
|
|
'node:console': bareConsole,
|
|
crypto: bareCrypto,
|
|
'node:crypto': bareCrypto,
|
|
dgram: bareDgram,
|
|
'node:dgram': bareDgram,
|
|
dns: bareDns,
|
|
'node:dns': bareDns,
|
|
events: bareEvents,
|
|
'node:events': bareEvents,
|
|
fs: bareFs,
|
|
'node:fs': bareFs,
|
|
http: bareHttp1,
|
|
'node:http': bareHttp1,
|
|
https: bareHttps,
|
|
'node:https': bareHttps,
|
|
net: bareNet,
|
|
'node:net': bareNet,
|
|
os: bareOs,
|
|
'node:os': bareOs,
|
|
path: barePath,
|
|
'node:path': barePath,
|
|
perf_hooks: barePerformance,
|
|
'node:perf_hooks': barePerformance,
|
|
process: bareProcess,
|
|
'node:process': bareProcess,
|
|
punycode: barePunycode,
|
|
'node:punycode': barePunycode,
|
|
querystring: bareQuerystring,
|
|
'node:querystring': bareQuerystring,
|
|
readline: bareReadline,
|
|
'node:readline': bareReadline,
|
|
stream: bareStream,
|
|
'node:stream': bareStream,
|
|
timers: bareTimers,
|
|
'node:timers': bareTimers,
|
|
tls: bareTls,
|
|
'node:tls': bareTls,
|
|
tty: bareTty,
|
|
'node:tty': bareTty,
|
|
url: bareUrl,
|
|
'node:url': bareUrl,
|
|
util: bareUtils,
|
|
'node:util': bareUtils,
|
|
worker_threads: bareWorker,
|
|
'node:worker_threads': bareWorker,
|
|
zlib: bareZlib,
|
|
'node:zlib': bareZlib
|
|
}
|