@volter/tabnode 0.2.14-volter.88
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/LICENSE +22 -0
- package/README.md +78 -0
- package/THIRD-PARTY-NOTICES.md +12 -0
- package/dist/__sw__.js +526 -0
- package/dist/assets/runtime-worker-4MKaHFVb.js +75221 -0
- package/dist/assets/runtime-worker-4MKaHFVb.js.map +1 -0
- package/dist/code-transforms.d.ts +21 -0
- package/dist/code-transforms.d.ts.map +1 -0
- package/dist/config/cdn.d.ts +12 -0
- package/dist/config/cdn.d.ts.map +1 -0
- package/dist/create-runtime.d.ts +22 -0
- package/dist/create-runtime.d.ts.map +1 -0
- package/dist/host-globals.d.ts +62 -0
- package/dist/host-globals.d.ts.map +1 -0
- package/dist/index.cjs +36021 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +127 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +36020 -0
- package/dist/index.mjs.map +1 -0
- package/dist/node-internals.d.ts +68 -0
- package/dist/node-internals.d.ts.map +1 -0
- package/dist/node-lib/binding/blob.d.ts +12 -0
- package/dist/node-lib/binding/blob.d.ts.map +1 -0
- package/dist/node-lib/binding/buffer.d.ts +144 -0
- package/dist/node-lib/binding/buffer.d.ts.map +1 -0
- package/dist/node-lib/binding/cares_wrap.d.ts +14 -0
- package/dist/node-lib/binding/cares_wrap.d.ts.map +1 -0
- package/dist/node-lib/binding/fds.d.ts +30 -0
- package/dist/node-lib/binding/fds.d.ts.map +1 -0
- package/dist/node-lib/binding/fs.d.ts +157 -0
- package/dist/node-lib/binding/fs.d.ts.map +1 -0
- package/dist/node-lib/binding/handles.d.ts +81 -0
- package/dist/node-lib/binding/handles.d.ts.map +1 -0
- package/dist/node-lib/binding/http_parser.d.ts +122 -0
- package/dist/node-lib/binding/http_parser.d.ts.map +1 -0
- package/dist/node-lib/binding/index.d.ts +3 -0
- package/dist/node-lib/binding/index.d.ts.map +1 -0
- package/dist/node-lib/binding/llhttp-wasm.d.ts +22 -0
- package/dist/node-lib/binding/llhttp-wasm.d.ts.map +1 -0
- package/dist/node-lib/binding/misc.d.ts +123 -0
- package/dist/node-lib/binding/misc.d.ts.map +1 -0
- package/dist/node-lib/binding/pipe_wrap.d.ts +84 -0
- package/dist/node-lib/binding/pipe_wrap.d.ts.map +1 -0
- package/dist/node-lib/binding/process_wrap.d.ts +173 -0
- package/dist/node-lib/binding/process_wrap.d.ts.map +1 -0
- package/dist/node-lib/binding/spawn_sync.d.ts +30 -0
- package/dist/node-lib/binding/spawn_sync.d.ts.map +1 -0
- package/dist/node-lib/binding/stream_wrap.d.ts +191 -0
- package/dist/node-lib/binding/stream_wrap.d.ts.map +1 -0
- package/dist/node-lib/binding/stubs.d.ts +23 -0
- package/dist/node-lib/binding/stubs.d.ts.map +1 -0
- package/dist/node-lib/binding/tcp_wrap.d.ts +98 -0
- package/dist/node-lib/binding/tcp_wrap.d.ts.map +1 -0
- package/dist/node-lib/binding/tty_wrap.d.ts +36 -0
- package/dist/node-lib/binding/tty_wrap.d.ts.map +1 -0
- package/dist/node-lib/binding/util.d.ts +126 -0
- package/dist/node-lib/binding/util.d.ts.map +1 -0
- package/dist/node-lib/binding/uv.d.ts +32 -0
- package/dist/node-lib/binding/uv.d.ts.map +1 -0
- package/dist/node-lib/binding/zlib-pako.d.ts +22 -0
- package/dist/node-lib/binding/zlib-pako.d.ts.map +1 -0
- package/dist/node-lib/binding/zlib.d.ts +38 -0
- package/dist/node-lib/binding/zlib.d.ts.map +1 -0
- package/dist/node-lib/buffer-module.d.ts +51 -0
- package/dist/node-lib/buffer-module.d.ts.map +1 -0
- package/dist/node-lib/child-process-module.d.ts +26 -0
- package/dist/node-lib/child-process-module.d.ts.map +1 -0
- package/dist/node-lib/events-module.d.ts +58 -0
- package/dist/node-lib/events-module.d.ts.map +1 -0
- package/dist/node-lib/fs-module.d.ts +5 -0
- package/dist/node-lib/fs-module.d.ts.map +1 -0
- package/dist/node-lib/http-bridge.d.ts +43 -0
- package/dist/node-lib/http-bridge.d.ts.map +1 -0
- package/dist/node-lib/http-module.d.ts +35 -0
- package/dist/node-lib/http-module.d.ts.map +1 -0
- package/dist/node-lib/internals/addresses.d.ts +40 -0
- package/dist/node-lib/internals/addresses.d.ts.map +1 -0
- package/dist/node-lib/internals/buffer-and-streams.d.ts +96 -0
- package/dist/node-lib/internals/buffer-and-streams.d.ts.map +1 -0
- package/dist/node-lib/internals/child-process.d.ts +27 -0
- package/dist/node-lib/internals/child-process.d.ts.map +1 -0
- package/dist/node-lib/internals/events-util.d.ts +83 -0
- package/dist/node-lib/internals/events-util.d.ts.map +1 -0
- package/dist/node-lib/internals/index.d.ts +2 -0
- package/dist/node-lib/internals/index.d.ts.map +1 -0
- package/dist/node-lib/internals/modules.d.ts +67 -0
- package/dist/node-lib/internals/modules.d.ts.map +1 -0
- package/dist/node-lib/internals/readline-access.d.ts +2 -0
- package/dist/node-lib/internals/readline-access.d.ts.map +1 -0
- package/dist/node-lib/internals/runtime.d.ts +150 -0
- package/dist/node-lib/internals/runtime.d.ts.map +1 -0
- package/dist/node-lib/internals/util.d.ts +33 -0
- package/dist/node-lib/internals/util.d.ts.map +1 -0
- package/dist/node-lib/lazy.d.ts +31 -0
- package/dist/node-lib/lazy.d.ts.map +1 -0
- package/dist/node-lib/load.d.ts +27 -0
- package/dist/node-lib/load.d.ts.map +1 -0
- package/dist/node-lib/module-hooks.d.ts +89 -0
- package/dist/node-lib/module-hooks.d.ts.map +1 -0
- package/dist/node-lib/net-module.d.ts +181 -0
- package/dist/node-lib/net-module.d.ts.map +1 -0
- package/dist/node-lib/node-versions.d.ts +27 -0
- package/dist/node-lib/node-versions.d.ts.map +1 -0
- package/dist/node-lib/public-modules.d.ts +2 -0
- package/dist/node-lib/public-modules.d.ts.map +1 -0
- package/dist/node-lib/require-hook.d.ts +15 -0
- package/dist/node-lib/require-hook.d.ts.map +1 -0
- package/dist/node-lib/small-modules.d.ts +16 -0
- package/dist/node-lib/small-modules.d.ts.map +1 -0
- package/dist/node-lib/sources.d.ts +4 -0
- package/dist/node-lib/sources.d.ts.map +1 -0
- package/dist/node-lib/stream-module.d.ts +77 -0
- package/dist/node-lib/stream-module.d.ts.map +1 -0
- package/dist/node-lib/timers.d.ts +19 -0
- package/dist/node-lib/timers.d.ts.map +1 -0
- package/dist/node-lib/util-module.d.ts +76 -0
- package/dist/node-lib/util-module.d.ts.map +1 -0
- package/dist/node-resolution.d.ts +50 -0
- package/dist/node-resolution.d.ts.map +1 -0
- package/dist/node-resolver.d.ts +7 -0
- package/dist/node-resolver.d.ts.map +1 -0
- package/dist/npm/index.d.ts +73 -0
- package/dist/npm/index.d.ts.map +1 -0
- package/dist/npm/registry.d.ts +111 -0
- package/dist/npm/registry.d.ts.map +1 -0
- package/dist/npm/resolver.d.ts +79 -0
- package/dist/npm/resolver.d.ts.map +1 -0
- package/dist/npm/tarball.d.ts +28 -0
- package/dist/npm/tarball.d.ts.map +1 -0
- package/dist/process-tokens.d.ts +77 -0
- package/dist/process-tokens.d.ts.map +1 -0
- package/dist/punycode-source.d.ts +3 -0
- package/dist/punycode-source.d.ts.map +1 -0
- package/dist/runtime-interface.d.ts +74 -0
- package/dist/runtime-interface.d.ts.map +1 -0
- package/dist/runtime.d.ts +144 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/server-bridge.d.ts +147 -0
- package/dist/server-bridge.d.ts.map +1 -0
- package/dist/shims/async_hooks.d.ts +50 -0
- package/dist/shims/async_hooks.d.ts.map +1 -0
- package/dist/shims/child_process.d.ts +104 -0
- package/dist/shims/child_process.d.ts.map +1 -0
- package/dist/shims/cluster.d.ts +52 -0
- package/dist/shims/cluster.d.ts.map +1 -0
- package/dist/shims/command-line.d.ts +43 -0
- package/dist/shims/command-line.d.ts.map +1 -0
- package/dist/shims/constants.d.ts +222 -0
- package/dist/shims/constants.d.ts.map +1 -0
- package/dist/shims/crypto-constants.d.ts +12 -0
- package/dist/shims/crypto-constants.d.ts.map +1 -0
- package/dist/shims/crypto.d.ts +144 -0
- package/dist/shims/crypto.d.ts.map +1 -0
- package/dist/shims/dgram.d.ts +34 -0
- package/dist/shims/dgram.d.ts.map +1 -0
- package/dist/shims/dns.d.ts +91 -0
- package/dist/shims/dns.d.ts.map +1 -0
- package/dist/shims/domain.d.ts +25 -0
- package/dist/shims/domain.d.ts.map +1 -0
- package/dist/shims/esbuild.d.ts +205 -0
- package/dist/shims/esbuild.d.ts.map +1 -0
- package/dist/shims/fs.d.ts +25 -0
- package/dist/shims/fs.d.ts.map +1 -0
- package/dist/shims/http2.d.ts +81 -0
- package/dist/shims/http2.d.ts.map +1 -0
- package/dist/shims/inspector.d.ts +25 -0
- package/dist/shims/inspector.d.ts.map +1 -0
- package/dist/shims/module.d.ts +22 -0
- package/dist/shims/module.d.ts.map +1 -0
- package/dist/shims/os.d.ts +159 -0
- package/dist/shims/os.d.ts.map +1 -0
- package/dist/shims/path.d.ts +52 -0
- package/dist/shims/path.d.ts.map +1 -0
- package/dist/shims/perf_hooks.d.ts +50 -0
- package/dist/shims/perf_hooks.d.ts.map +1 -0
- package/dist/shims/process.d.ts +226 -0
- package/dist/shims/process.d.ts.map +1 -0
- package/dist/shims/rollup.d.ts +71 -0
- package/dist/shims/rollup.d.ts.map +1 -0
- package/dist/shims/string_decoder.d.ts +41 -0
- package/dist/shims/string_decoder.d.ts.map +1 -0
- package/dist/shims/sync-child.d.ts +64 -0
- package/dist/shims/sync-child.d.ts.map +1 -0
- package/dist/shims/tls.d.ts +53 -0
- package/dist/shims/tls.d.ts.map +1 -0
- package/dist/shims/url.d.ts +84 -0
- package/dist/shims/url.d.ts.map +1 -0
- package/dist/shims/v8.d.ts +73 -0
- package/dist/shims/v8.d.ts.map +1 -0
- package/dist/shims/vfs-adapter.d.ts +126 -0
- package/dist/shims/vfs-adapter.d.ts.map +1 -0
- package/dist/shims/vm.d.ts +52 -0
- package/dist/shims/vm.d.ts.map +1 -0
- package/dist/shims/wasi.d.ts +78 -0
- package/dist/shims/wasi.d.ts.map +1 -0
- package/dist/shims/worker_threads.d.ts +66 -0
- package/dist/shims/worker_threads.d.ts.map +1 -0
- package/dist/shims/zlib-constants.d.ts +66 -0
- package/dist/shims/zlib-constants.d.ts.map +1 -0
- package/dist/shims/zlib.d.ts +102 -0
- package/dist/shims/zlib.d.ts.map +1 -0
- package/dist/transform.d.ts +24 -0
- package/dist/transform.d.ts.map +1 -0
- package/dist/types/package-json.d.ts +18 -0
- package/dist/types/package-json.d.ts.map +1 -0
- package/dist/utils/binary-encoding.d.ts +13 -0
- package/dist/utils/binary-encoding.d.ts.map +1 -0
- package/dist/utils/glob.d.ts +19 -0
- package/dist/utils/glob.d.ts.map +1 -0
- package/dist/utils/hash.d.ts +6 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/virtual-fs.d.ts +259 -0
- package/dist/virtual-fs.d.ts.map +1 -0
- package/dist/vite-plugin.cjs +50 -0
- package/dist/vite-plugin.cjs.map +1 -0
- package/dist/vite-plugin.d.ts +36 -0
- package/dist/vite-plugin.d.ts.map +1 -0
- package/dist/vite-plugin.mjs +31 -0
- package/dist/vite-plugin.mjs.map +1 -0
- package/dist/worker/runtime-worker.d.ts +8 -0
- package/dist/worker/runtime-worker.d.ts.map +1 -0
- package/dist/worker-runtime.d.ts +50 -0
- package/dist/worker-runtime.d.ts.map +1 -0
- package/package.json +88 -0
- package/src/code-transforms.ts +560 -0
- package/src/config/cdn.ts +13 -0
- package/src/create-runtime.ts +89 -0
- package/src/host-globals.ts +121 -0
- package/src/index.ts +235 -0
- package/src/node-internals.ts +283 -0
- package/src/node-lib/LICENSE +47 -0
- package/src/node-lib/_http_agent.js +547 -0
- package/src/node-lib/_http_client.js +996 -0
- package/src/node-lib/_http_common.js +269 -0
- package/src/node-lib/_http_incoming.js +453 -0
- package/src/node-lib/_http_outgoing.js +1262 -0
- package/src/node-lib/_http_server.js +1230 -0
- package/src/node-lib/assert/strict.js +3 -0
- package/src/node-lib/assert.js +844 -0
- package/src/node-lib/binding/blob.ts +35 -0
- package/src/node-lib/binding/buffer.ts +465 -0
- package/src/node-lib/binding/cares_wrap.ts +57 -0
- package/src/node-lib/binding/fds.ts +80 -0
- package/src/node-lib/binding/fs.ts +857 -0
- package/src/node-lib/binding/handles.ts +187 -0
- package/src/node-lib/binding/http_parser.ts +536 -0
- package/src/node-lib/binding/index.ts +77 -0
- package/src/node-lib/binding/llhttp-wasm.ts +670 -0
- package/src/node-lib/binding/misc.ts +252 -0
- package/src/node-lib/binding/pipe_wrap.ts +166 -0
- package/src/node-lib/binding/process_wrap.ts +371 -0
- package/src/node-lib/binding/spawn_sync.ts +141 -0
- package/src/node-lib/binding/stream_wrap.ts +413 -0
- package/src/node-lib/binding/stubs.ts +19 -0
- package/src/node-lib/binding/tcp_wrap.ts +254 -0
- package/src/node-lib/binding/tty_wrap.ts +56 -0
- package/src/node-lib/binding/util.ts +274 -0
- package/src/node-lib/binding/uv.ts +102 -0
- package/src/node-lib/binding/zlib-pako.ts +50 -0
- package/src/node-lib/binding/zlib.ts +259 -0
- package/src/node-lib/buffer-module.ts +70 -0
- package/src/node-lib/buffer.js +1373 -0
- package/src/node-lib/child-process-module.ts +58 -0
- package/src/node-lib/child_process.js +1046 -0
- package/src/node-lib/constants.js +41 -0
- package/src/node-lib/diagnostics_channel.js +438 -0
- package/src/node-lib/events-module.ts +80 -0
- package/src/node-lib/events.js +1223 -0
- package/src/node-lib/fs-module.ts +43 -0
- package/src/node-lib/fs.js +3377 -0
- package/src/node-lib/http-bridge.ts +299 -0
- package/src/node-lib/http-module.ts +53 -0
- package/src/node-lib/http.js +198 -0
- package/src/node-lib/https.js +429 -0
- package/src/node-lib/internal/assert/assertion_error.js +417 -0
- package/src/node-lib/internal/assert/calltracker.js +153 -0
- package/src/node-lib/internal/assert/myers_diff.js +177 -0
- package/src/node-lib/internal/assert/utils.js +278 -0
- package/src/node-lib/internal/buffer.js +1120 -0
- package/src/node-lib/internal/child_process/serialization.js +169 -0
- package/src/node-lib/internal/child_process.js +1135 -0
- package/src/node-lib/internal/constants.js +56 -0
- package/src/node-lib/internal/deps/minimatch/index.js +1628 -0
- package/src/node-lib/internal/errors.js +1912 -0
- package/src/node-lib/internal/events/abort_listener.js +54 -0
- package/src/node-lib/internal/events/symbols.js +11 -0
- package/src/node-lib/internal/fixed_queue.js +119 -0
- package/src/node-lib/internal/freelist.js +30 -0
- package/src/node-lib/internal/fs/cp/cp-sync.js +242 -0
- package/src/node-lib/internal/fs/cp/cp.js +382 -0
- package/src/node-lib/internal/fs/dir.js +369 -0
- package/src/node-lib/internal/fs/glob.js +763 -0
- package/src/node-lib/internal/fs/promises.js +1312 -0
- package/src/node-lib/internal/fs/read/context.js +129 -0
- package/src/node-lib/internal/fs/recursive_watch.js +275 -0
- package/src/node-lib/internal/fs/rimraf.js +311 -0
- package/src/node-lib/internal/fs/streams.js +571 -0
- package/src/node-lib/internal/fs/sync_write_stream.js +49 -0
- package/src/node-lib/internal/fs/utils.js +987 -0
- package/src/node-lib/internal/fs/watchers.js +418 -0
- package/src/node-lib/internal/http.js +62 -0
- package/src/node-lib/internal/mime.js +389 -0
- package/src/node-lib/internal/modules/customization_hooks.js +406 -0
- package/src/node-lib/internal/net.js +95 -0
- package/src/node-lib/internal/querystring.js +119 -0
- package/src/node-lib/internal/readline/callbacks.js +132 -0
- package/src/node-lib/internal/readline/emitKeypressEvents.js +99 -0
- package/src/node-lib/internal/readline/interface.js +1418 -0
- package/src/node-lib/internal/readline/promises.js +144 -0
- package/src/node-lib/internal/readline/utils.js +405 -0
- package/src/node-lib/internal/socket_list.js +108 -0
- package/src/node-lib/internal/stream_base_commons.js +280 -0
- package/src/node-lib/internal/streams/add-abort-signal.js +60 -0
- package/src/node-lib/internal/streams/compose.js +257 -0
- package/src/node-lib/internal/streams/destroy.js +361 -0
- package/src/node-lib/internal/streams/duplex.js +203 -0
- package/src/node-lib/internal/streams/duplexify.js +379 -0
- package/src/node-lib/internal/streams/duplexpair.js +62 -0
- package/src/node-lib/internal/streams/end-of-stream.js +331 -0
- package/src/node-lib/internal/streams/from.js +208 -0
- package/src/node-lib/internal/streams/lazy_transform.js +57 -0
- package/src/node-lib/internal/streams/legacy.js +125 -0
- package/src/node-lib/internal/streams/operators.js +436 -0
- package/src/node-lib/internal/streams/passthrough.js +47 -0
- package/src/node-lib/internal/streams/pipeline.js +465 -0
- package/src/node-lib/internal/streams/readable.js +1762 -0
- package/src/node-lib/internal/streams/state.js +51 -0
- package/src/node-lib/internal/streams/transform.js +204 -0
- package/src/node-lib/internal/streams/utils.js +363 -0
- package/src/node-lib/internal/streams/writable.js +1163 -0
- package/src/node-lib/internal/tty.js +260 -0
- package/src/node-lib/internal/util/colors.js +40 -0
- package/src/node-lib/internal/util/comparisons.js +1028 -0
- package/src/node-lib/internal/util/debuglog.js +524 -0
- package/src/node-lib/internal/util/inspect.js +2535 -0
- package/src/node-lib/internal/util/parse_args/parse_args.js +412 -0
- package/src/node-lib/internal/util/parse_args/utils.js +197 -0
- package/src/node-lib/internal/util.js +1003 -0
- package/src/node-lib/internal/validators.js +654 -0
- package/src/node-lib/internals/addresses.ts +159 -0
- package/src/node-lib/internals/buffer-and-streams.ts +224 -0
- package/src/node-lib/internals/child-process.ts +64 -0
- package/src/node-lib/internals/events-util.ts +105 -0
- package/src/node-lib/internals/index.ts +66 -0
- package/src/node-lib/internals/modules.ts +117 -0
- package/src/node-lib/internals/readline-access.ts +16 -0
- package/src/node-lib/internals/runtime.ts +277 -0
- package/src/node-lib/internals/util.ts +98 -0
- package/src/node-lib/lazy.ts +158 -0
- package/src/node-lib/load.ts +390 -0
- package/src/node-lib/module-hooks.ts +281 -0
- package/src/node-lib/net-module.ts +248 -0
- package/src/node-lib/net.js +2540 -0
- package/src/node-lib/node-versions.ts +34 -0
- package/src/node-lib/os.js +356 -0
- package/src/node-lib/path.js +1694 -0
- package/src/node-lib/primordials.js +743 -0
- package/src/node-lib/public-modules.ts +109 -0
- package/src/node-lib/punycode.js +455 -0
- package/src/node-lib/querystring.js +484 -0
- package/src/node-lib/readline/promises.js +73 -0
- package/src/node-lib/readline.js +523 -0
- package/src/node-lib/require-hook.ts +27 -0
- package/src/node-lib/small-modules.ts +35 -0
- package/src/node-lib/sources.ts +200 -0
- package/src/node-lib/stream/promises.js +44 -0
- package/src/node-lib/stream-module.ts +101 -0
- package/src/node-lib/stream.js +152 -0
- package/src/node-lib/timers.ts +33 -0
- package/src/node-lib/tty.js +168 -0
- package/src/node-lib/util-module.ts +104 -0
- package/src/node-lib/util.js +689 -0
- package/src/node-lib/wasi.js +179 -0
- package/src/node-lib/zlib.js +1036 -0
- package/src/node-resolution.ts +241 -0
- package/src/node-resolver.ts +33 -0
- package/src/npm/index.ts +425 -0
- package/src/npm/registry.ts +235 -0
- package/src/npm/resolver.ts +589 -0
- package/src/npm/tarball.ts +246 -0
- package/src/process-tokens.ts +156 -0
- package/src/punycode-source.ts +6 -0
- package/src/runtime-interface.ts +85 -0
- package/src/runtime.ts +3073 -0
- package/src/server-bridge.ts +971 -0
- package/src/shims/async_hooks.ts +181 -0
- package/src/shims/child_process.ts +1591 -0
- package/src/shims/cluster.ts +79 -0
- package/src/shims/command-line.ts +79 -0
- package/src/shims/constants.ts +68 -0
- package/src/shims/crypto-constants.ts +11 -0
- package/src/shims/crypto.ts +1061 -0
- package/src/shims/dgram.ts +47 -0
- package/src/shims/dns.ts +185 -0
- package/src/shims/domain.ts +58 -0
- package/src/shims/esbuild.ts +1638 -0
- package/src/shims/fs.ts +82 -0
- package/src/shims/http2.ts +96 -0
- package/src/shims/inspector.ts +30 -0
- package/src/shims/module.ts +86 -0
- package/src/shims/os.ts +195 -0
- package/src/shims/path.ts +246 -0
- package/src/shims/perf_hooks.ts +92 -0
- package/src/shims/process.ts +804 -0
- package/src/shims/rollup.ts +149 -0
- package/src/shims/string_decoder.ts +396 -0
- package/src/shims/sync-child.ts +469 -0
- package/src/shims/tls.ts +94 -0
- package/src/shims/url.ts +217 -0
- package/src/shims/v8.ts +113 -0
- package/src/shims/vfs-adapter.ts +408 -0
- package/src/shims/vm.ts +132 -0
- package/src/shims/wasi.ts +1440 -0
- package/src/shims/worker_threads.ts +114 -0
- package/src/shims/zlib-constants.ts +65 -0
- package/src/shims/zlib.ts +228 -0
- package/src/transform.ts +324 -0
- package/src/types/external.d.ts +55 -0
- package/src/types/package-json.ts +17 -0
- package/src/types/pako-zlib.d.ts +30 -0
- package/src/types/sha.js.d.ts +14 -0
- package/src/utils/binary-encoding.ts +43 -0
- package/src/utils/glob.ts +54 -0
- package/src/utils/hash.ts +12 -0
- package/src/virtual-fs.ts +1048 -0
- package/src/vite-plugin.ts +76 -0
- package/src/worker/runtime-worker.ts +128 -0
- package/src/worker-runtime.ts +145 -0
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
// Ported from https://github.com/mafintosh/pump with
|
|
2
|
+
// permission from the author, Mathias Buus (@mafintosh).
|
|
3
|
+
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
const {
|
|
7
|
+
ArrayIsArray,
|
|
8
|
+
Promise,
|
|
9
|
+
SymbolAsyncIterator,
|
|
10
|
+
} = primordials;
|
|
11
|
+
|
|
12
|
+
const eos = require('internal/streams/end-of-stream');
|
|
13
|
+
const { SymbolDispose, once } = require('internal/util');
|
|
14
|
+
const destroyImpl = require('internal/streams/destroy');
|
|
15
|
+
const Duplex = require('internal/streams/duplex');
|
|
16
|
+
const {
|
|
17
|
+
AbortError,
|
|
18
|
+
aggregateTwoErrors,
|
|
19
|
+
codes: {
|
|
20
|
+
ERR_INVALID_ARG_TYPE,
|
|
21
|
+
ERR_INVALID_RETURN_VALUE,
|
|
22
|
+
ERR_MISSING_ARGS,
|
|
23
|
+
ERR_STREAM_DESTROYED,
|
|
24
|
+
ERR_STREAM_PREMATURE_CLOSE,
|
|
25
|
+
},
|
|
26
|
+
} = require('internal/errors');
|
|
27
|
+
|
|
28
|
+
const {
|
|
29
|
+
validateFunction,
|
|
30
|
+
validateAbortSignal,
|
|
31
|
+
} = require('internal/validators');
|
|
32
|
+
|
|
33
|
+
const {
|
|
34
|
+
isIterable,
|
|
35
|
+
isReadable,
|
|
36
|
+
isReadableNodeStream,
|
|
37
|
+
isNodeStream,
|
|
38
|
+
isTransformStream,
|
|
39
|
+
isWebStream,
|
|
40
|
+
isReadableStream,
|
|
41
|
+
isReadableFinished,
|
|
42
|
+
} = require('internal/streams/utils');
|
|
43
|
+
const { AbortController } = require('internal/abort_controller');
|
|
44
|
+
|
|
45
|
+
let PassThrough;
|
|
46
|
+
let Readable;
|
|
47
|
+
let addAbortListener;
|
|
48
|
+
|
|
49
|
+
function destroyer(stream, reading, writing) {
|
|
50
|
+
let finished = false;
|
|
51
|
+
stream.on('close', () => {
|
|
52
|
+
finished = true;
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const cleanup = eos(stream, { readable: reading, writable: writing }, (err) => {
|
|
56
|
+
finished = !err;
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
destroy: (err) => {
|
|
61
|
+
if (finished) return;
|
|
62
|
+
finished = true;
|
|
63
|
+
destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED('pipe'));
|
|
64
|
+
},
|
|
65
|
+
cleanup,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function popCallback(streams) {
|
|
70
|
+
// Streams should never be an empty array. It should always contain at least
|
|
71
|
+
// a single stream. Therefore optimize for the average case instead of
|
|
72
|
+
// checking for length === 0 as well.
|
|
73
|
+
validateFunction(streams[streams.length - 1], 'streams[stream.length - 1]');
|
|
74
|
+
return streams.pop();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function makeAsyncIterable(val) {
|
|
78
|
+
if (isIterable(val)) {
|
|
79
|
+
return val;
|
|
80
|
+
} else if (isReadableNodeStream(val)) {
|
|
81
|
+
// Legacy streams are not Iterable.
|
|
82
|
+
return fromReadable(val);
|
|
83
|
+
}
|
|
84
|
+
throw new ERR_INVALID_ARG_TYPE(
|
|
85
|
+
'val', ['Readable', 'Iterable', 'AsyncIterable'], val);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async function* fromReadable(val) {
|
|
89
|
+
Readable ??= require('internal/streams/readable');
|
|
90
|
+
yield* Readable.prototype[SymbolAsyncIterator].call(val);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async function pumpToNode(iterable, writable, finish, { end }) {
|
|
94
|
+
let error;
|
|
95
|
+
let onresolve = null;
|
|
96
|
+
|
|
97
|
+
const resume = (err) => {
|
|
98
|
+
if (err) {
|
|
99
|
+
error = err;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (onresolve) {
|
|
103
|
+
const callback = onresolve;
|
|
104
|
+
onresolve = null;
|
|
105
|
+
callback();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const wait = () => new Promise((resolve, reject) => {
|
|
110
|
+
if (error) {
|
|
111
|
+
reject(error);
|
|
112
|
+
} else {
|
|
113
|
+
onresolve = () => {
|
|
114
|
+
if (error) {
|
|
115
|
+
reject(error);
|
|
116
|
+
} else {
|
|
117
|
+
resolve();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
writable.on('drain', resume);
|
|
124
|
+
const cleanup = eos(writable, { readable: false }, resume);
|
|
125
|
+
|
|
126
|
+
try {
|
|
127
|
+
if (writable.writableNeedDrain) {
|
|
128
|
+
await wait();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
for await (const chunk of iterable) {
|
|
132
|
+
if (!writable.write(chunk)) {
|
|
133
|
+
await wait();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (end) {
|
|
138
|
+
writable.end();
|
|
139
|
+
await wait();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
finish();
|
|
143
|
+
} catch (err) {
|
|
144
|
+
finish(error !== err ? aggregateTwoErrors(error, err) : err);
|
|
145
|
+
} finally {
|
|
146
|
+
cleanup();
|
|
147
|
+
writable.off('drain', resume);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
async function pumpToWeb(readable, writable, finish, { end }) {
|
|
152
|
+
if (isTransformStream(writable)) {
|
|
153
|
+
writable = writable.writable;
|
|
154
|
+
}
|
|
155
|
+
// https://streams.spec.whatwg.org/#example-manual-write-with-backpressure
|
|
156
|
+
const writer = writable.getWriter();
|
|
157
|
+
try {
|
|
158
|
+
for await (const chunk of readable) {
|
|
159
|
+
await writer.ready;
|
|
160
|
+
writer.write(chunk).catch(() => {});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
await writer.ready;
|
|
164
|
+
|
|
165
|
+
if (end) {
|
|
166
|
+
await writer.close();
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
finish();
|
|
170
|
+
} catch (err) {
|
|
171
|
+
try {
|
|
172
|
+
await writer.abort(err);
|
|
173
|
+
finish(err);
|
|
174
|
+
} catch (err) {
|
|
175
|
+
finish(err);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function pipeline(...streams) {
|
|
181
|
+
return pipelineImpl(streams, once(popCallback(streams)));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function pipelineImpl(streams, callback, opts) {
|
|
185
|
+
if (streams.length === 1 && ArrayIsArray(streams[0])) {
|
|
186
|
+
streams = streams[0];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (streams.length < 2) {
|
|
190
|
+
throw new ERR_MISSING_ARGS('streams');
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const ac = new AbortController();
|
|
194
|
+
const signal = ac.signal;
|
|
195
|
+
const outerSignal = opts?.signal;
|
|
196
|
+
|
|
197
|
+
// Need to cleanup event listeners if last stream is readable
|
|
198
|
+
// https://github.com/nodejs/node/issues/35452
|
|
199
|
+
const lastStreamCleanup = [];
|
|
200
|
+
|
|
201
|
+
validateAbortSignal(outerSignal, 'options.signal');
|
|
202
|
+
|
|
203
|
+
function abort() {
|
|
204
|
+
finishImpl(new AbortError(undefined, { cause: outerSignal?.reason }));
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
addAbortListener ??= require('internal/events/abort_listener').addAbortListener;
|
|
208
|
+
let disposable;
|
|
209
|
+
if (outerSignal) {
|
|
210
|
+
disposable = addAbortListener(outerSignal, abort);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
let error;
|
|
214
|
+
let value;
|
|
215
|
+
const destroys = [];
|
|
216
|
+
|
|
217
|
+
let finishCount = 0;
|
|
218
|
+
|
|
219
|
+
function finish(err) {
|
|
220
|
+
finishImpl(err, --finishCount === 0);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function finishOnlyHandleError(err) {
|
|
224
|
+
finishImpl(err, false);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function finishImpl(err, final) {
|
|
228
|
+
if (err && (!error || error.code === 'ERR_STREAM_PREMATURE_CLOSE')) {
|
|
229
|
+
error = err;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (!error && !final) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
while (destroys.length) {
|
|
237
|
+
destroys.shift()(error);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
disposable?.[SymbolDispose]();
|
|
241
|
+
ac.abort();
|
|
242
|
+
|
|
243
|
+
if (final) {
|
|
244
|
+
if (!error) {
|
|
245
|
+
lastStreamCleanup.forEach((fn) => fn());
|
|
246
|
+
}
|
|
247
|
+
process.nextTick(callback, error, value);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
let ret;
|
|
252
|
+
for (let i = 0; i < streams.length; i++) {
|
|
253
|
+
const stream = streams[i];
|
|
254
|
+
const reading = i < streams.length - 1;
|
|
255
|
+
const writing = i > 0;
|
|
256
|
+
const end = reading || opts?.end !== false;
|
|
257
|
+
const isLastStream = i === streams.length - 1;
|
|
258
|
+
|
|
259
|
+
if (isNodeStream(stream)) {
|
|
260
|
+
if (end) {
|
|
261
|
+
const { destroy, cleanup } = destroyer(stream, reading, writing);
|
|
262
|
+
destroys.push(destroy);
|
|
263
|
+
|
|
264
|
+
if (isReadable(stream) && isLastStream) {
|
|
265
|
+
lastStreamCleanup.push(cleanup);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Catch stream errors that occur after pipe/pump has completed.
|
|
270
|
+
function onError(err) {
|
|
271
|
+
if (
|
|
272
|
+
err &&
|
|
273
|
+
err.name !== 'AbortError' &&
|
|
274
|
+
err.code !== 'ERR_STREAM_PREMATURE_CLOSE'
|
|
275
|
+
) {
|
|
276
|
+
finishOnlyHandleError(err);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
stream.on('error', onError);
|
|
280
|
+
if (isReadable(stream) && isLastStream) {
|
|
281
|
+
lastStreamCleanup.push(() => {
|
|
282
|
+
stream.removeListener('error', onError);
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (i === 0) {
|
|
288
|
+
if (typeof stream === 'function') {
|
|
289
|
+
ret = stream({ signal });
|
|
290
|
+
if (!isIterable(ret)) {
|
|
291
|
+
throw new ERR_INVALID_RETURN_VALUE(
|
|
292
|
+
'Iterable, AsyncIterable or Stream', 'source', ret);
|
|
293
|
+
}
|
|
294
|
+
} else if (isIterable(stream) || isReadableNodeStream(stream) || isTransformStream(stream)) {
|
|
295
|
+
ret = stream;
|
|
296
|
+
} else {
|
|
297
|
+
ret = Duplex.from(stream);
|
|
298
|
+
}
|
|
299
|
+
} else if (typeof stream === 'function') {
|
|
300
|
+
if (isTransformStream(ret)) {
|
|
301
|
+
ret = makeAsyncIterable(ret?.readable);
|
|
302
|
+
} else {
|
|
303
|
+
ret = makeAsyncIterable(ret);
|
|
304
|
+
}
|
|
305
|
+
ret = stream(ret, { signal });
|
|
306
|
+
|
|
307
|
+
if (reading) {
|
|
308
|
+
if (!isIterable(ret, true)) {
|
|
309
|
+
throw new ERR_INVALID_RETURN_VALUE(
|
|
310
|
+
'AsyncIterable', `transform[${i - 1}]`, ret);
|
|
311
|
+
}
|
|
312
|
+
} else {
|
|
313
|
+
PassThrough ??= require('internal/streams/passthrough');
|
|
314
|
+
|
|
315
|
+
// If the last argument to pipeline is not a stream
|
|
316
|
+
// we must create a proxy stream so that pipeline(...)
|
|
317
|
+
// always returns a stream which can be further
|
|
318
|
+
// composed through `.pipe(stream)`.
|
|
319
|
+
|
|
320
|
+
const pt = new PassThrough({
|
|
321
|
+
objectMode: true,
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
// Handle Promises/A+ spec, `then` could be a getter that throws on
|
|
325
|
+
// second use.
|
|
326
|
+
const then = ret?.then;
|
|
327
|
+
if (typeof then === 'function') {
|
|
328
|
+
finishCount++;
|
|
329
|
+
then.call(ret,
|
|
330
|
+
(val) => {
|
|
331
|
+
value = val;
|
|
332
|
+
if (val != null) {
|
|
333
|
+
pt.write(val);
|
|
334
|
+
}
|
|
335
|
+
if (end) {
|
|
336
|
+
pt.end();
|
|
337
|
+
}
|
|
338
|
+
process.nextTick(finish);
|
|
339
|
+
}, (err) => {
|
|
340
|
+
pt.destroy(err);
|
|
341
|
+
process.nextTick(finish, err);
|
|
342
|
+
},
|
|
343
|
+
);
|
|
344
|
+
} else if (isIterable(ret, true)) {
|
|
345
|
+
finishCount++;
|
|
346
|
+
pumpToNode(ret, pt, finish, { end });
|
|
347
|
+
} else if (isReadableStream(ret) || isTransformStream(ret)) {
|
|
348
|
+
const toRead = ret.readable || ret;
|
|
349
|
+
finishCount++;
|
|
350
|
+
pumpToNode(toRead, pt, finish, { end });
|
|
351
|
+
} else {
|
|
352
|
+
throw new ERR_INVALID_RETURN_VALUE(
|
|
353
|
+
'AsyncIterable or Promise', 'destination', ret);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
ret = pt;
|
|
357
|
+
|
|
358
|
+
const { destroy, cleanup } = destroyer(ret, false, true);
|
|
359
|
+
destroys.push(destroy);
|
|
360
|
+
if (isLastStream) {
|
|
361
|
+
lastStreamCleanup.push(cleanup);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
} else if (isNodeStream(stream)) {
|
|
365
|
+
if (isReadableNodeStream(ret)) {
|
|
366
|
+
finishCount += 2;
|
|
367
|
+
const cleanup = pipe(ret, stream, finish, finishOnlyHandleError, { end });
|
|
368
|
+
if (isReadable(stream) && isLastStream) {
|
|
369
|
+
lastStreamCleanup.push(cleanup);
|
|
370
|
+
}
|
|
371
|
+
} else if (isTransformStream(ret) || isReadableStream(ret)) {
|
|
372
|
+
const toRead = ret.readable || ret;
|
|
373
|
+
finishCount++;
|
|
374
|
+
pumpToNode(toRead, stream, finish, { end });
|
|
375
|
+
} else if (isIterable(ret)) {
|
|
376
|
+
finishCount++;
|
|
377
|
+
pumpToNode(ret, stream, finish, { end });
|
|
378
|
+
} else {
|
|
379
|
+
throw new ERR_INVALID_ARG_TYPE(
|
|
380
|
+
'val', ['Readable', 'Iterable', 'AsyncIterable', 'ReadableStream', 'TransformStream'], ret);
|
|
381
|
+
}
|
|
382
|
+
ret = stream;
|
|
383
|
+
} else if (isWebStream(stream)) {
|
|
384
|
+
if (isReadableNodeStream(ret)) {
|
|
385
|
+
finishCount++;
|
|
386
|
+
pumpToWeb(makeAsyncIterable(ret), stream, finish, { end });
|
|
387
|
+
} else if (isReadableStream(ret) || isIterable(ret)) {
|
|
388
|
+
finishCount++;
|
|
389
|
+
pumpToWeb(ret, stream, finish, { end });
|
|
390
|
+
} else if (isTransformStream(ret)) {
|
|
391
|
+
finishCount++;
|
|
392
|
+
pumpToWeb(ret.readable, stream, finish, { end });
|
|
393
|
+
} else {
|
|
394
|
+
throw new ERR_INVALID_ARG_TYPE(
|
|
395
|
+
'val', ['Readable', 'Iterable', 'AsyncIterable', 'ReadableStream', 'TransformStream'], ret);
|
|
396
|
+
}
|
|
397
|
+
ret = stream;
|
|
398
|
+
} else {
|
|
399
|
+
ret = Duplex.from(stream);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
if (signal?.aborted || outerSignal?.aborted) {
|
|
404
|
+
process.nextTick(abort);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
return ret;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function pipe(src, dst, finish, finishOnlyHandleError, { end }) {
|
|
411
|
+
let ended = false;
|
|
412
|
+
dst.on('close', () => {
|
|
413
|
+
if (!ended) {
|
|
414
|
+
// Finish if the destination closes before the source has completed.
|
|
415
|
+
finishOnlyHandleError(new ERR_STREAM_PREMATURE_CLOSE());
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
src.pipe(dst, { end: false }); // If end is true we already will have a listener to end dst.
|
|
420
|
+
|
|
421
|
+
if (end) {
|
|
422
|
+
// Compat. Before node v10.12.0 stdio used to throw an error so
|
|
423
|
+
// pipe() did/does not end() stdio destinations.
|
|
424
|
+
// Now they allow it but "secretly" don't close the underlying fd.
|
|
425
|
+
|
|
426
|
+
function endFn() {
|
|
427
|
+
ended = true;
|
|
428
|
+
dst.end();
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
if (isReadableFinished(src)) { // End the destination if the source has already ended.
|
|
432
|
+
process.nextTick(endFn);
|
|
433
|
+
} else {
|
|
434
|
+
src.once('end', endFn);
|
|
435
|
+
}
|
|
436
|
+
} else {
|
|
437
|
+
finish();
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
eos(src, { readable: true, writable: false }, (err) => {
|
|
441
|
+
const rState = src._readableState;
|
|
442
|
+
if (
|
|
443
|
+
err &&
|
|
444
|
+
err.code === 'ERR_STREAM_PREMATURE_CLOSE' &&
|
|
445
|
+
(rState?.ended && !rState.errored && !rState.errorEmitted)
|
|
446
|
+
) {
|
|
447
|
+
// Some readable streams will emit 'close' before 'end'. However, since
|
|
448
|
+
// this is on the readable side 'end' should still be emitted if the
|
|
449
|
+
// stream has been ended and no error emitted. This should be allowed in
|
|
450
|
+
// favor of backwards compatibility. Since the stream is piped to a
|
|
451
|
+
// destination this should not result in any observable difference.
|
|
452
|
+
// We don't need to check if this is a writable premature close since
|
|
453
|
+
// eos will only fail with premature close on the reading side for
|
|
454
|
+
// duplex streams.
|
|
455
|
+
src
|
|
456
|
+
.once('end', finish)
|
|
457
|
+
.once('error', finish);
|
|
458
|
+
} else {
|
|
459
|
+
finish(err);
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
return eos(dst, { readable: false, writable: true }, finish);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
module.exports = { pipelineImpl, pipeline };
|