feat: init

This commit is contained in:
2026-02-13 22:02:30 +01:00
commit 8f9ff830fb
16711 changed files with 3307340 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
export const assert: any;
export const clear: any;
export const context: any;
export const count: any;
export const countReset: any;
export const createTask: any;
export const debug: any;
export const dir: any;
export const dirxml: any;
export const error: any;
export const group: any;
export const groupCollapsed: any;
export const groupEnd: any;
export const info: any;
export const log: any;
export const profile: any;
export const profileEnd: any;
export const table: any;
export const time: any;
export const timeEnd: any;
export const timeLog: any;
export const timeStamp: any;
export const trace: any;
export const warn: any;
export default consoleModule;
declare const consoleModule: any;

View File

@@ -0,0 +1,69 @@
import workerdConsole from "#workerd/node:console";
import {
Console,
_ignoreErrors,
_stderr,
_stderrErrorHandler,
_stdout,
_stdoutErrorHandler,
_times,
} from "unenv/node/console";
export {
Console,
_ignoreErrors,
_stderr,
_stderrErrorHandler,
_stdout,
_stdoutErrorHandler,
_times,
} from "unenv/node/console";
export const {
assert,
clear,
context,
count,
countReset,
createTask,
debug,
dir,
dirxml,
error,
group,
groupCollapsed,
groupEnd,
info,
log,
profile,
profileEnd,
table,
time,
timeEnd,
timeLog,
timeStamp,
trace,
warn,
} = workerdConsole;
const consolePolyfill = {
Console,
_ignoreErrors,
_stderr,
_stderrErrorHandler,
_stdout,
_stdoutErrorHandler,
_times,
};
const consoleModule = /*@__PURE__*/ new Proxy(workerdConsole, {
get(target, prop) {
if (Reflect.has(target, prop)) {
return Reflect.get(target, prop);
}
return Reflect.get(consolePolyfill, prop);
},
});
export default consoleModule;

View File

@@ -0,0 +1,107 @@
export default mixedProcess;
export const abort: any;
export const addListener: any;
export const allowedNodeEnvironmentFlags: any;
export const hasUncaughtExceptionCaptureCallback: any;
export const setUncaughtExceptionCaptureCallback: any;
export const loadEnvFile: any;
export const sourceMapsEnabled: any;
export const arch: any;
export const argv: any;
export const argv0: any;
export const chdir: any;
export const config: any;
export const connected: any;
export const constrainedMemory: any;
export const availableMemory: any;
export const cpuUsage: any;
export const cwd: any;
export const debugPort: any;
export const dlopen: any;
export const disconnect: any;
export const emit: any;
export const emitWarning: any;
export const env: any;
export const eventNames: any;
export const execArgv: any;
export const execPath: any;
export const exit: any;
export const finalization: any;
export const features: any;
export const getBuiltinModule: any;
export const getActiveResourcesInfo: any;
export const getMaxListeners: any;
export const hrtime: any;
export const kill: any;
export const listeners: any;
export const listenerCount: any;
export const memoryUsage: any;
export const nextTick: any;
export const on: any;
export const off: any;
export const once: any;
export const pid: any;
export const platform: any;
export const ppid: any;
export const prependListener: any;
export const prependOnceListener: any;
export const rawListeners: any;
export const release: any;
export const removeAllListeners: any;
export const removeListener: any;
export const report: any;
export const resourceUsage: any;
export const setMaxListeners: any;
export const setSourceMapsEnabled: any;
export const stderr: any;
export const stdin: any;
export const stdout: any;
export const title: any;
export const umask: any;
export const uptime: any;
export const version: any;
export const versions: any;
export const domain: any;
export const initgroups: any;
export const moduleLoadList: any;
export const reallyExit: any;
export const openStdin: any;
export const assert: any;
export const binding: any;
export const send: any;
export const exitCode: any;
export const channel: any;
export const getegid: any;
export const geteuid: any;
export const getgid: any;
export const getgroups: any;
export const getuid: any;
export const setegid: any;
export const seteuid: any;
export const setgid: any;
export const setgroups: any;
export const setuid: any;
export const permission: any;
export const mainModule: any;
export const _events: any;
export const _eventsCount: any;
export const _exiting: any;
export const _maxListeners: any;
export const _debugEnd: any;
export const _debugProcess: any;
export const _fatalException: any;
export const _getActiveHandles: any;
export const _getActiveRequests: any;
export const _kill: any;
export const _preload_modules: any;
export const _rawDebug: any;
export const _startProfilerIdleNotifier: any;
export const _stopProfilerIdleNotifier: any;
export const _tickCallback: any;
export const _disconnect: any;
export const _handleQueue: any;
export const _pendingMessage: any;
export const _channel: any;
export const _send: any;
export const _linkedBinding: any;
declare const mixedProcess: any;

View File

@@ -0,0 +1,144 @@
// https://github.com/cloudflare/workerd/blob/main/src/node/internal/process.ts
// https://github.com/unjs/unenv/blob/main/src/runtime/node/process.ts
import workerdProcess from "#workerd/node:process";
import { env as WorkerEnv } from "cloudflare:workers";
import { Process as UnenvProcess } from "unenv/node/internal/process/process";
import { env as UnenvEnv } from "unenv/node/internal/process/env";
import { hrtime as UnenvHrTime } from "unenv/node/internal/process/hrtime";
// Polyfill for unenv (without Node.js compatibility)
globalThis.__env__ = WorkerEnv;
const mixedProcess = new UnenvProcess({
env: UnenvEnv,
hrtime: UnenvHrTime,
nextTick: workerdProcess.nextTick,
});
// https://github.com/cloudflare/workerd/blob/main/src/node/internal/process.ts#L94
for (const key of ["exit", "getBuiltinModule", "platform"]) {
if (key in workerdProcess) {
mixedProcess[key] = workerdProcess[key];
}
}
if (workerdProcess.features) {
Object.defineProperty(mixedProcess, "features", {
get() {
return workerdProcess.features;
},
});
}
export default mixedProcess;
export const {
abort,
addListener,
allowedNodeEnvironmentFlags,
hasUncaughtExceptionCaptureCallback,
setUncaughtExceptionCaptureCallback,
loadEnvFile,
sourceMapsEnabled,
arch,
argv,
argv0,
chdir,
config,
connected,
constrainedMemory,
availableMemory,
cpuUsage,
cwd,
debugPort,
dlopen,
disconnect,
emit,
emitWarning,
env,
eventNames,
execArgv,
execPath,
exit,
finalization,
features,
getBuiltinModule,
getActiveResourcesInfo,
getMaxListeners,
hrtime,
kill,
listeners,
listenerCount,
memoryUsage,
nextTick,
on,
off,
once,
pid,
platform,
ppid,
prependListener,
prependOnceListener,
rawListeners,
release,
removeAllListeners,
removeListener,
report,
resourceUsage,
setMaxListeners,
setSourceMapsEnabled,
stderr,
stdin,
stdout,
title,
umask,
uptime,
version,
versions,
domain,
initgroups,
moduleLoadList,
reallyExit,
openStdin,
assert,
binding,
send,
exitCode,
channel,
getegid,
geteuid,
getgid,
getgroups,
getuid,
setegid,
seteuid,
setgid,
setgroups,
setuid,
permission,
mainModule,
_events,
_eventsCount,
_exiting,
_maxListeners,
_debugEnd,
_debugProcess,
_fatalException,
_getActiveHandles,
_getActiveRequests,
_kill,
_preload_modules,
_rawDebug,
_startProfilerIdleNotifier,
_stopProfilerIdleNotifier,
_tickCallback,
_disconnect,
_handleQueue,
_pendingMessage,
_channel,
_send,
_linkedBinding,
} = mixedProcess;