@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,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `path`, as Node's own `lib/path.js`.
|
|
3
|
+
*
|
|
4
|
+
* What died: the engine's `path` was hand-written and POSIX-only. `path.win32`
|
|
5
|
+
* was a stub whose members were the POSIX ones under Windows' `sep`, so
|
|
6
|
+
* `path.win32.join('C:\\a', 'b')` answered a POSIX join; `normalize` collapsed
|
|
7
|
+
* `./` and dropped trailing slashes, so `join('foo/', 'bar/')` came back
|
|
8
|
+
* `foo/bar` where Node gives `foo/bar/`; `basename` normalised first, so
|
|
9
|
+
* `basename('a//b/')` differed; `parse` and `format` were approximations;
|
|
10
|
+
* `toNamespacedPath` and `matchesGlob` were bolted on by the module table.
|
|
11
|
+
* Node's own test/parallel/test-path-*.js: 1 of 16 passed.
|
|
12
|
+
*
|
|
13
|
+
* What this is: Node's `lib/path.js` v22.18.0, vendored unmodified in
|
|
14
|
+
* `../node-lib/path.js`, evaluated once here on a binding that supplies the
|
|
15
|
+
* four things the Node runtime would have given it — `primordials`,
|
|
16
|
+
* `require` of the three internals it names, `module`, and a `process` whose
|
|
17
|
+
* `cwd()` and `platform` are the engine's. Both flavours are Node's: the
|
|
18
|
+
* default export is `posix` (the engine's filesystem is POSIX and its process
|
|
19
|
+
* never reports win32), and `win32` is Node's real Windows implementation,
|
|
20
|
+
* which packages ask for and which Node's tests exercise on every platform.
|
|
21
|
+
*
|
|
22
|
+
* The rule for this file: it binds, it does not implement. A path bug is
|
|
23
|
+
* fixed by moving the vendored file to a newer Node, never by editing either.
|
|
24
|
+
*/
|
|
25
|
+
import { globToRegExp } from '../utils/glob';
|
|
26
|
+
|
|
27
|
+
import NODE_PATH_SOURCE from '../node-lib/path.js?raw';
|
|
28
|
+
// internal/errors and internal/validators, shared with every Node file the
|
|
29
|
+
// engine runs on a binding (see src/node-internals.ts).
|
|
30
|
+
import { ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, validateObject, validateString } from '../node-internals';
|
|
31
|
+
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
// primordials — the fourteen names path.js destructures, written literally
|
|
34
|
+
// over the built-ins. Node's primordials are the built-ins captured before a
|
|
35
|
+
// program can monkey-patch them; captured here at module load for the same
|
|
36
|
+
// reason.
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
|
|
39
|
+
const uncurry = <A extends unknown[], R>(fn: (...args: A) => R) =>
|
|
40
|
+
Function.prototype.call.bind(fn) as unknown as (self: unknown, ...args: A) => R;
|
|
41
|
+
|
|
42
|
+
const primordials = {
|
|
43
|
+
ArrayPrototypeIncludes: uncurry(Array.prototype.includes),
|
|
44
|
+
ArrayPrototypeJoin: uncurry(Array.prototype.join),
|
|
45
|
+
ArrayPrototypeSlice: uncurry(Array.prototype.slice),
|
|
46
|
+
FunctionPrototypeBind: uncurry(Function.prototype.bind),
|
|
47
|
+
StringPrototypeCharCodeAt: uncurry(String.prototype.charCodeAt),
|
|
48
|
+
StringPrototypeIncludes: uncurry(String.prototype.includes),
|
|
49
|
+
StringPrototypeIndexOf: uncurry(String.prototype.indexOf),
|
|
50
|
+
StringPrototypeLastIndexOf: uncurry(String.prototype.lastIndexOf),
|
|
51
|
+
StringPrototypeRepeat: uncurry(String.prototype.repeat),
|
|
52
|
+
StringPrototypeReplace: uncurry(String.prototype.replace),
|
|
53
|
+
StringPrototypeSlice: uncurry(String.prototype.slice),
|
|
54
|
+
StringPrototypeSplit: uncurry(String.prototype.split),
|
|
55
|
+
StringPrototypeToLowerCase: uncurry(String.prototype.toLowerCase),
|
|
56
|
+
StringPrototypeToUpperCase: uncurry(String.prototype.toUpperCase),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
// internal/constants — the CHAR_* codes path.js names.
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
|
|
63
|
+
const constants = {
|
|
64
|
+
CHAR_UPPERCASE_A: 65, /* A */
|
|
65
|
+
CHAR_LOWERCASE_A: 97, /* a */
|
|
66
|
+
CHAR_UPPERCASE_Z: 90, /* Z */
|
|
67
|
+
CHAR_LOWERCASE_Z: 122, /* z */
|
|
68
|
+
CHAR_DOT: 46, /* . */
|
|
69
|
+
CHAR_FORWARD_SLASH: 47, /* / */
|
|
70
|
+
CHAR_BACKWARD_SLASH: 92, /* \ */
|
|
71
|
+
CHAR_COLON: 58, /* : */
|
|
72
|
+
CHAR_QUESTION_MARK: 63, /* ? */
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
// process — the engine's, read at call time. A runtime's cwd changes under a
|
|
77
|
+
// guest (and the engine's own tests move it), so `cwd()` delegates on every
|
|
78
|
+
// call rather than closing over a value; path.js captures this object once,
|
|
79
|
+
// as it captures Node's.
|
|
80
|
+
// ---------------------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
const engineProcess = (): Record<string, unknown> | undefined =>
|
|
83
|
+
(globalThis as unknown as { process?: Record<string, unknown> }).process;
|
|
84
|
+
|
|
85
|
+
const platformOf = (): string => {
|
|
86
|
+
const platform = engineProcess()?.platform;
|
|
87
|
+
return typeof platform === 'string' ? platform : 'linux';
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const processBinding = {
|
|
91
|
+
get platform(): string {
|
|
92
|
+
return platformOf();
|
|
93
|
+
},
|
|
94
|
+
cwd(): string {
|
|
95
|
+
const cwd = engineProcess()?.cwd;
|
|
96
|
+
return typeof cwd === 'function' ? (cwd as () => string)() : '/';
|
|
97
|
+
},
|
|
98
|
+
get env(): Record<string, string | undefined> {
|
|
99
|
+
const env = engineProcess()?.env;
|
|
100
|
+
return (env as Record<string, string | undefined>) ?? {};
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
// internal/util — the three names path.js takes from it.
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
|
|
108
|
+
// The engine's platform, not the host's: a guest runs on the engine's
|
|
109
|
+
// 'linux' whether the build is measured on a Mac, a Windows host, or a
|
|
110
|
+
// browser, so `path` is posix and matchesGlob is case-sensitive everywhere.
|
|
111
|
+
const isWindows = false;
|
|
112
|
+
const isMacOS = false;
|
|
113
|
+
|
|
114
|
+
function getLazy<T>(fn: () => T): () => T {
|
|
115
|
+
let value: T;
|
|
116
|
+
let loaded = false;
|
|
117
|
+
return () => {
|
|
118
|
+
if (!loaded) {
|
|
119
|
+
value = fn();
|
|
120
|
+
loaded = true;
|
|
121
|
+
}
|
|
122
|
+
return value;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
// internal/deps/minimatch/index — `path.matchesGlob` is the only caller, and
|
|
128
|
+
// it asks minimatch for one boolean under fixed options. Node's minimatch is
|
|
129
|
+
// 4k lines of a matcher the engine does not otherwise need; the engine's one
|
|
130
|
+
// glob-to-RegExp translation (`src/utils/glob.ts`, the same one fs's glob
|
|
131
|
+
// uses) answers it, under the two options that reach it: `platform`, which
|
|
132
|
+
// decides whether a backslash is a separator, and `nocase`.
|
|
133
|
+
// ---------------------------------------------------------------------------
|
|
134
|
+
|
|
135
|
+
interface MinimatchOptions {
|
|
136
|
+
nocase?: boolean;
|
|
137
|
+
platform?: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const minimatchStandIn = {
|
|
141
|
+
minimatch(target: string, pattern: string, options?: MinimatchOptions): boolean {
|
|
142
|
+
// path.matchesGlob passes windowsPathsNoEscape, so on the win32 flavour a
|
|
143
|
+
// backslash is a separator in both the path and the pattern, never an
|
|
144
|
+
// escape; folding both to '/' is what that option means.
|
|
145
|
+
const windows = options?.platform === 'win32';
|
|
146
|
+
const subject = windows ? target.replace(/\\/g, '/') : target;
|
|
147
|
+
const glob = windows ? pattern.replace(/\\/g, '/') : pattern;
|
|
148
|
+
return globToRegExp(glob, options?.nocase === true).test(subject);
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// ---------------------------------------------------------------------------
|
|
153
|
+
// The binding's `require`, and the one evaluation of Node's file.
|
|
154
|
+
// ---------------------------------------------------------------------------
|
|
155
|
+
|
|
156
|
+
function nodeInternalRequire(specifier: string): unknown {
|
|
157
|
+
switch (specifier) {
|
|
158
|
+
case 'internal/constants':
|
|
159
|
+
return constants;
|
|
160
|
+
case 'internal/validators':
|
|
161
|
+
return { validateObject, validateString };
|
|
162
|
+
case 'internal/util':
|
|
163
|
+
return { getLazy, isWindows, isMacOS };
|
|
164
|
+
case 'internal/deps/minimatch/index':
|
|
165
|
+
return minimatchStandIn;
|
|
166
|
+
case 'internal/errors':
|
|
167
|
+
return { codes: { ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE } };
|
|
168
|
+
default:
|
|
169
|
+
throw new Error(`node-lib/path.js asked for an internal the binding does not provide: ${specifier}`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface ParsedPath {
|
|
174
|
+
root: string;
|
|
175
|
+
dir: string;
|
|
176
|
+
base: string;
|
|
177
|
+
ext: string;
|
|
178
|
+
name: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface FormatInputPathObject {
|
|
182
|
+
root?: string | undefined;
|
|
183
|
+
dir?: string | undefined;
|
|
184
|
+
base?: string | undefined;
|
|
185
|
+
ext?: string | undefined;
|
|
186
|
+
name?: string | undefined;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface PlatformPath {
|
|
190
|
+
normalize(path: string): string;
|
|
191
|
+
join(...paths: string[]): string;
|
|
192
|
+
resolve(...paths: string[]): string;
|
|
193
|
+
isAbsolute(path: string): boolean;
|
|
194
|
+
relative(from: string, to: string): string;
|
|
195
|
+
dirname(path: string): string;
|
|
196
|
+
basename(path: string, suffix?: string): string;
|
|
197
|
+
extname(path: string): string;
|
|
198
|
+
parse(path: string): ParsedPath;
|
|
199
|
+
format(pathObject: FormatInputPathObject): string;
|
|
200
|
+
toNamespacedPath<T>(path: T): T;
|
|
201
|
+
matchesGlob(path: string, pattern: string): boolean;
|
|
202
|
+
_makeLong<T>(path: T): T;
|
|
203
|
+
readonly sep: string;
|
|
204
|
+
readonly delimiter: string;
|
|
205
|
+
readonly posix: PlatformPath;
|
|
206
|
+
readonly win32: PlatformPath;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// The vendored file is a CommonJS module of the Node runtime: it is handed the
|
|
210
|
+
// scope Node would have handed it and run once. The engine already loads its
|
|
211
|
+
// vendored punycode this way (src/punycode-source.ts).
|
|
212
|
+
const nodePath: PlatformPath = (() => {
|
|
213
|
+
const module: { exports: unknown } = { exports: {} };
|
|
214
|
+
// eslint-disable-next-line no-new-func
|
|
215
|
+
new Function('primordials', 'require', 'module', 'exports', 'process', NODE_PATH_SOURCE)(
|
|
216
|
+
primordials,
|
|
217
|
+
nodeInternalRequire,
|
|
218
|
+
module,
|
|
219
|
+
module.exports,
|
|
220
|
+
processBinding,
|
|
221
|
+
);
|
|
222
|
+
return module.exports as PlatformPath;
|
|
223
|
+
})();
|
|
224
|
+
|
|
225
|
+
export const posix: PlatformPath = nodePath.posix;
|
|
226
|
+
export const win32: PlatformPath = nodePath.win32;
|
|
227
|
+
|
|
228
|
+
// The engine's flavour is the one Node picks for this platform — posix, since
|
|
229
|
+
// the engine's process never reports win32. The named exports are its own
|
|
230
|
+
// members, so `path.join === join` as in Node.
|
|
231
|
+
export const sep = nodePath.sep;
|
|
232
|
+
export const delimiter = nodePath.delimiter;
|
|
233
|
+
export const normalize = nodePath.normalize;
|
|
234
|
+
export const join = nodePath.join;
|
|
235
|
+
export const resolve = nodePath.resolve;
|
|
236
|
+
export const isAbsolute = nodePath.isAbsolute;
|
|
237
|
+
export const relative = nodePath.relative;
|
|
238
|
+
export const dirname = nodePath.dirname;
|
|
239
|
+
export const basename = nodePath.basename;
|
|
240
|
+
export const extname = nodePath.extname;
|
|
241
|
+
export const parse = nodePath.parse;
|
|
242
|
+
export const format = nodePath.format;
|
|
243
|
+
export const toNamespacedPath = nodePath.toNamespacedPath;
|
|
244
|
+
export const matchesGlob = nodePath.matchesGlob;
|
|
245
|
+
|
|
246
|
+
export default nodePath;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* perf_hooks shim - Performance measurement APIs
|
|
3
|
+
* Wraps browser Performance API
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const performance = globalThis.performance || {
|
|
7
|
+
now: () => Date.now(),
|
|
8
|
+
timeOrigin: Date.now(),
|
|
9
|
+
mark: () => {},
|
|
10
|
+
measure: () => {},
|
|
11
|
+
getEntries: () => [],
|
|
12
|
+
getEntriesByName: () => [],
|
|
13
|
+
getEntriesByType: () => [],
|
|
14
|
+
clearMarks: () => {},
|
|
15
|
+
clearMeasures: () => {},
|
|
16
|
+
clearResourceTimings: () => {},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export class PerformanceObserver {
|
|
20
|
+
private callback: (list: PerformanceObserverEntryList) => void;
|
|
21
|
+
private entryTypes: string[] = [];
|
|
22
|
+
|
|
23
|
+
constructor(callback: (list: PerformanceObserverEntryList) => void) {
|
|
24
|
+
this.callback = callback;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
observe(options: { entryTypes?: string[]; type?: string }): void {
|
|
28
|
+
this.entryTypes = options.entryTypes || (options.type ? [options.type] : []);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
disconnect(): void {
|
|
32
|
+
this.entryTypes = [];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
takeRecords(): PerformanceEntry[] {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static supportedEntryTypes = ['mark', 'measure', 'resource', 'navigation'];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface PerformanceObserverEntryList {
|
|
43
|
+
getEntries(): PerformanceEntry[];
|
|
44
|
+
getEntriesByName(name: string, type?: string): PerformanceEntry[];
|
|
45
|
+
getEntriesByType(type: string): PerformanceEntry[];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface PerformanceEntry {
|
|
49
|
+
name: string;
|
|
50
|
+
entryType: string;
|
|
51
|
+
startTime: number;
|
|
52
|
+
duration: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Histogram stub
|
|
56
|
+
export class Histogram {
|
|
57
|
+
min = 0;
|
|
58
|
+
max = 0;
|
|
59
|
+
mean = 0;
|
|
60
|
+
stddev = 0;
|
|
61
|
+
percentiles = new Map<number, number>();
|
|
62
|
+
exceeds = 0;
|
|
63
|
+
|
|
64
|
+
reset(): void {
|
|
65
|
+
this.min = 0;
|
|
66
|
+
this.max = 0;
|
|
67
|
+
this.mean = 0;
|
|
68
|
+
this.stddev = 0;
|
|
69
|
+
this.percentiles.clear();
|
|
70
|
+
this.exceeds = 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
percentile(percentile: number): number {
|
|
74
|
+
return this.percentiles.get(percentile) || 0;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function createHistogram(): Histogram {
|
|
79
|
+
return new Histogram();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function monitorEventLoopDelay(options?: { resolution?: number }): Histogram {
|
|
83
|
+
const histogram = new Histogram();
|
|
84
|
+
return histogram;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export default {
|
|
88
|
+
performance,
|
|
89
|
+
PerformanceObserver,
|
|
90
|
+
createHistogram,
|
|
91
|
+
monitorEventLoopDelay,
|
|
92
|
+
};
|