unjs / unenv

🕊️ Convert javaScript code to be runtime agnostic
MIT License
348 stars 18 forks source link

feat: experimental deno preset #155

Closed pi0 closed 7 months ago

pi0 commented 7 months ago

This PR adds a new deno preset suitable to extend nodeless with supported modules.

Note: For ⚠️ partial supported modules, using this preset means disabling unenv support for them!

Support status for Node v20.10.0 vs Deno v1.38.5 (local pnpm run test:deno)

Feature Status Details
node:inspector/promises ℹ️ unenv Using unenv
node:readline/promises ℹ️ unenv Using unenv
node:stream/consumers ✅ full -
node:stream/promises ✅ full -
node:timers/promises ⚠️ partial Missing: scheduler
node:assert/strict ⚠️ partial Missing: CallTracker
node:dns/promises ⚠️ partial Missing: lookupService, getDefaultResultOrder
node:fs/promises ⚠️ partial Missing: cp, statfs, lchmod, lchown, lutimes, constants
node:path/posix ⚠️ partial Missing: win32, posix, _makeLong
node:path/win32 ⚠️ partial Missing: win32, posix, _makeLong
node:stream/web ⚠️ partial Missing: CompressionStream, DecompressionStream
node:util/types ⚠️ partial Missing: isExternal
node:_stream_passthrough ℹ️ unenv Using unenv
node:diagnostics_channel ⚠️ partial Missing: tracingChannel
node:_stream_transform ℹ️ unenv Using unenv
node:_stream_readable ℹ️ unenv Using unenv
node:_stream_writable ℹ️ unenv Using unenv
node:_http_incoming ℹ️ unenv Using unenv
node:_http_outgoing ℹ️ unenv Using unenv
node:_stream_duplex ℹ️ unenv Using unenv
node:string_decoder ✅ full -
node:worker_threads ✅ full -
node:child_process ⚠️ partial Missing: _forkChild
node:_http_client ℹ️ unenv Using unenv
node:_http_common ℹ️ unenv Using unenv
node:_http_server ℹ️ unenv Using unenv
node:_stream_wrap ℹ️ unenv Using unenv
node:trace_events ℹ️ unenv Using unenv
node:_http_agent ℹ️ unenv Using unenv
node:_tls_common ℹ️ unenv Using unenv
node:async_hooks ⚠️ partial Missing: triggerAsyncId, executionAsyncResource, asyncWrapProviders
node:querystring ✅ full -
node:perf_hooks ⚠️ partial Missing: Performance, PerformanceMark, PerformanceMeasure, PerformanceObserverEntryList, PerformanceResourceTiming, createHistogram
node:_tls_wrap ℹ️ unenv Using unenv
node:constants ⚠️ partial Missing: 81 exports!!
node:inspector ℹ️ unenv Using unenv
node:punycode ⚠️ partial Missing: version
node:readline ✅ full -
node:cluster ⚠️ partial Missing: _events, _eventsCount, _maxListeners, SCHED_NONE, SCHED_RR, disconnect
node:console ⚠️ partial Missing: context, createTask
node:process ⚠️ partial Missing: 56 exports!!
node:assert ⚠️ partial Missing: CallTracker
node:buffer ⚠️ partial Missing: transcode, isUtf8, isAscii, INSPECT_MAX_BYTES, resolveObjectURL, File
node:crypto ⚠️ partial Missing: Cipher, Decipher, subtle, getRandomValues
node:domain ⚠️ partial Missing: _stack, createDomain, active
node:events ⚠️ partial Missing: addAbortListener, getMaxListeners, usingDomains, captureRejections, EventEmitterAsyncResource, init
node:module ⚠️ partial Missing: _debug, isBuiltin, syncBuiltinESMExports, runMain, findSourceMap, register, SourceMap
node:stream ⚠️ partial Missing: isDestroyed, isDisturbed, isErrored, isReadable, isWritable, destroy, compose, setDefaultHighWaterMark, getDefaultHighWaterMark, promises
node:timers ⚠️ partial Missing: _unrefActive, active, unenroll, enroll
node:dgram ⚠️ partial Missing: _createSocketHandle
node:http2 ✅ full -
node:https ✅ full -
node:http ⚠️ partial Missing: _connectionListener, validateHeaderName, validateHeaderValue, setMaxIdleHTTPParsers, maxHeaderSize
node:path ⚠️ partial Missing: _makeLong
node:repl ℹ️ unenv Using unenv
node:util ⚠️ partial Missing: _errnoException, _exceptionWithHostPort, debug, getSystemErrorMap, transferableAbortSignal, transferableAbortController, aborted, parseArgs, MIMEType, MIMEParams
node:wasi ℹ️ unenv Using unenv
node:zlib ✅ full -
node:dns ⚠️ partial Missing: lookupService, getDefaultResultOrder
node:net ⚠️ partial Missing: _setSimultaneousAccepts, BlockList, SocketAddress, getDefaultAutoSelectFamily, setDefaultAutoSelectFamily, getDefaultAutoSelectFamilyAttemptTimeout, setDefaultAutoSelectFamilyAttemptTimeout
node:sys ⚠️ partial Missing: _errnoException, _exceptionWithHostPort, debug, getSystemErrorMap, transferableAbortSignal, transferableAbortController, aborted, parseArgs, MIMEType, MIMEParams
node:tls ⚠️ partial Missing: CLIENT_RENEG_LIMIT, CLIENT_RENEG_WINDOW, convertALPNProtocols, SecureContext
node:tty ✅ full -
node:url ✅ full -
node:fs ⚠️ partial Missing: 20 exports!!
node:os ⚠️ partial Missing: machine
node:v8 ⚠️ partial M
pi0 commented 7 months ago

(need to iterate and try)