aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/node (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-10-09fix(AbortSignal/fetch) fix AbortSignal.timeout, fetch lock behavior and ↵Gravatar Ciro Spaciari 1-1/+1
fetch errors (#6390) * fix abort signal and fetch error * fix fetch error and lock behavior
2023-10-07feat(KeyObject) (#5940)Gravatar Ciro Spaciari 1-1/+1
* oops * createSecretKey but weird error * use the right prototype, do not add a function called export lol * HMAC JWT export + base64 fix * Fix Equals, Fix Get KeySize, add complete export RSA * fix RSA export * add EC exports * X25519 and ED25519 export + fixes * fix default exports * better asymmetricKeyType * fix private exports * fix symmetricKeySize * createPublicKey validations + refactor * jwt + der fixes * oopsies * add PEM into createPublicKey * cleanup * WIP * bunch of fixes * public from private + private OKP * encrypted keys fixes * oops * fix clear tls error, add some support to jwk and other formats on publicEncrypt/publicDecrypt * more fixes and tests working * more fixes more tests * more clear hmac errors * more tests and fixes * add generateKeyPair * more tests passing, some skips * fix EC key from private * fix OKP JWK * nodejs ignores ext and key_ops on KeyObject.exports * add EC sign verify test * some fixes * add crypto.generateKeyPairSync(type, options) * more fixes and more tests * fix hmac tests * jsonwebtoken tests * oops * oops2 * generated files * revert package.json * vm tests * todos instead of failues * toBunString -> toString * undo simdutf * improvements * unlikely * cleanup * cleanup 2 * oops * move _generateKeyPairSync checks to native
2023-10-04fix os test failureGravatar Dylan Conway 1-0/+3
2023-09-24Do not use removefileat() (#6001)Gravatar Jarred Sumner 1-91/+9
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-21ref and deinit (#5883)Gravatar Dylan Conway 2-2/+33
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-21Don't use arena in node:fs (#5863)Gravatar Jarred Sumner 3-8/+8
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-21fix(node:fs): use the right copyFile constants (#5874)Gravatar dave caruso 1-4/+3
2023-09-19Fixes #5769 (#5775)Gravatar Jarred Sumner 1-3/+14
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-16fix: node compatibility with empty path string (#4693)Gravatar MrPalixir 1-10/+2
Co-authored-by: MrPalixir <73360179+MrPalixir@users.noreply.github.com>
2023-09-15fix(node/fs.watch): Check first char before trimming event filenames (#5505)Gravatar David Hewitt 1-11/+2
* Add failing test * fix(node/fs.watch): Don't lose first char in event * run prettier
2023-09-14async-ify all node:fs functions (#5360)Gravatar Jarred Sumner 3-1338/+1026
* async all node:fs functions * draw the rest of the owl * LLVM & Clang 16 --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-13fix(runtime): make most globals configurable/deletable, allow resuming the ↵Gravatar dave caruso 1-62/+2
console iterator (#5216) * Fix #5177 * Fix #5175 * make most globals deletable/overridable * not done * cool * a * done * fix test * oops * yippee
2023-09-12fix(node/path): Prevent memory corruption in parse (#5083)Gravatar David Hewitt 1-15/+7
* Add failing test for issue #4954 * fix(node/path): Return results with toValueGC
2023-09-07Fix a couple important bugs (#4560)bun-v1.0.0Gravatar Jarred Sumner 1-4/+7
2023-09-07Progress for Next.js (#4468)Gravatar dave caruso 2-5/+8
* L * ipc * asdfghjkl * dfghjk * it works! * types * patches for next.js * sdfghj * wsdfgn,./ * this * yolo * okay loser * asdfghjk * add some more APIs * MESS * sdfghjkl * remove native events from streams * stuff * remove lazy(primordials) test * debugging * okay * less fake extensions object * fix `Buffer.toString()` args logic * fix deserialize * make tests work * add test for `Buffer.toString` args * Update server.zig * remove test * update test * Update spawn-streaming-stdin.test.ts * fix linux build * Update fs.test.ts * cli message improvements * dfshaj * Fix fs.watch bug maybe? * remove --------- Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-09-06allocate task for `ThreadSafeFunction` (#4513)Gravatar Dylan Conway 1-0/+12
* create thread safe function task * Update napi.zig * Update napi.zig
2023-09-05feat(runtime): Implement `fs.watchFile` (#4467)Gravatar dave caruso 4-6/+553
* really lame prototype * uses threads but badly * it works i guess * unwatchFile but lame * it works * test * a * aomitcs * fix unwatching race condition * use hasPendingActivity and GC stuff better * test * revert this
2023-09-05fix checkout/build failure due to `src/deps/uws` (#4505)Gravatar Alex Lam S.L 1-2/+2
2023-09-05fix dup syscall on Windows (#4496)Gravatar Jason 1-3/+3
2023-09-02workaround a zig bug (#4440)Gravatar dave caruso 1-3/+4
2023-08-31fix(runtime): `fs.cp` edge cases (#4439)Gravatar dave caruso 1-5/+8
* yippee * enable cpSync tests * much better * that doesnt actually do anything * lose
2023-08-30feat(node:fs): add `cp`/`cpSync`/`promises.cp` + async `copyFile` (#4340)Gravatar dave caruso 3-168/+1056
* half working disaster code * this * async copyFile * . * its failing symlink tests * asdfg * asdf * hmm * okay i think ti works * small edits * fix test on linux * i hate atomics / atomics hate me back <3 * add a message in the builtins bundler that 0.8 is needed. it breaks on older versions lol. * fixed * rebase
2023-08-28More renamingGravatar Jarred Sumner 2-4/+4
2023-08-28mv src/bun.js/node/syscall.zig -> src/sys.zigGravatar Jarred Sumner 1-6/+6
2023-08-28just kernel32 things (#4354)Gravatar Jarred Sumner 6-119/+714
* just kernel32 things * more * Update linux_c.zig * Update windows_c.zig * Add workaround Workaround https://github.com/ziglang/zig/issues/16980 * Rename http.zig to bun_dev_http_server.zig * Rename usages * more * more * more * thanks tigerbeetle * Rename `JSC.Node.Syscall` -> `bun.sys` * more * woops * more! * hmm * it says there are only 37 errors, but that's not true * populate argv * it says 32 errors! * 24 errors * fix regular build * 12 left! * Still 12 left! * more * 2 errors left... * 1 more error * Add link to Tigerbeetle * Fix the remainign error * Fix test timeout * Update syscall.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-26More improvements to debugger support (#4345)Gravatar Ashcon Partovi 1-0/+15
* More fixes for dap * More changes * More changes 2 * More fixes * Fix debugger.ts * Bun Terminal
2023-08-24fix buildGravatar Dylan Conway 1-1/+1
2023-08-24update zig to 0.11.0 (#4233)Gravatar Jason 2-3/+3
* WIP * backup * more change * json related error sovled * number related issue solved * revert WriterType changed before * destroy -> free * jsonStringify related issues solved * fix mem.free expected []T or *[_]T, passed [*]const u8 * fix expected []T or *[_]T, passed [*:0]const u8 * fix build script * fix build script, for real * replace 0.11.0-dev.4006+bf827d0b5 to 0.12.0-dev.161+6a5463951 * fix build on macOS, COPYFILE.DATA -> COPYFILE_DATA * fix the last destroy on [*]ptr issue --------- Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2023-08-21Fix BigIntStats generated classGravatar Jarred Sumner 1-1/+1
cc @paperdave, code generator script misses a constructor decl when this isn't true
2023-08-20Fixes #1675 (#4230)Gravatar Jarred Sumner 1-66/+88
* Fixes https://github.com/oven-sh/bun/issues/1675 * Add fallback for Bun.write * Update blob.zig * Fix test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-19misc non-posix fixesGravatar Jarred Sumner 1-1/+1
2023-08-18Implement BigIntStats (#4208)Gravatar dave caruso 4-218/+398
* Implement BigIntStats * changes * rename test * comment * test changes?
2023-08-18Remove most C API usages, add debugger pretty printers for `Headers`, ↵Gravatar Jarred Sumner 1-5/+8
`URLSearchParams`, `FormData`, `Worker`, `EventTarget` (#4187) * Add pretty printers for `Headers`, `URLSearchParams`, and `FormData` * [untested] Add way to code generate getInternalProperties * bump * Bump Webkit * Ref the event loop while loaded * wip * checkpoint * another checkpoint * The code has been written * Fixup exports * Fix all the errors * Fix bug * [console.log] Fix bug when printing non-reified types missing values * Fix loading hash table * fix plugin * Fix ref & unref * auto-unref * various fixes * Update bun.zig * Set toStringTag * Delete code for macro JSX * Delete code for `bun dev` HTTP JS * Move Bun.serve to C++ API * Delete JSC C API code * :scissors: :skull: code * Use JSC C++ for `confirm`, `Crypto`, `prompt`, `alert` * more dead code * Update exports.zig * Use JSC C++ API for FFI * Remove remaining usages * Remove remaining usages * Update ffi.ts * Update InternalModuleRegistryConstants.h * draw the rest of the owl * Update webcore.zig * bind it * Fix performance regression in crypto.randomUIUD() * Update js_parser.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-17Support Nitro (#4098)Gravatar dave caruso 1-7/+39
* Add formatWithOptions * tests and tweaks * adjust * changes * hi * add mark/measure stubs * stuff * allow unix absolute paths here * typo * rebase * fix stats
2023-08-16`bun --inspect` (#4158)Gravatar Jarred Sumner 1-3/+30
* Let the debugger to pause/resume the event loop * Add initial support for Debug Adapter Protocol * Add progress * Update Worker.cpp * Fix require("console") #3820 (#4073) * Fix #3820 * Add Module (#4074) * Set exports to {} in user-constructed CommonJSModuleRecords (#4076) * feat(bun/test): Implement "toSatisfy" & "toIncludeRepeated" (fwup) (#3651) * Fix merge issues * oop * make codegen * Fix build issues --------- Co-authored-by: dave caruso <me@paperdave.net> * worker tests (#4058) Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> * feat(bun:test) add support for test.each() and describe.each() (#4047) * rename callback to func * update testscope to handle function arguments * works * big cleanup * works in debug, not release * fix memory issue & update tests * catch & str test * write types for each() & switch tests to ts * rm & typo * move some code around & support describe * review changes * Fix one of the astro segfaults, also fix bun init version (#4079) * 4->16 * add assertions * fix version stuff * Remove unintentional logs from #4043 * Run prettier * Update main-worker-file.js * Update SIMDUTF (#4078) * Fix constructing buffer from a UTF16 string with the Latin1 encoding. (#4086) Close: #3914 * Add support for `bun --revision` (#4027) Co-authored-by: Yash Sharma <yashsharma@Yashs-MacBook-Air.local> * Updates * Update __global.zig * remove non-node node-fallbacks (#4082) * remove non-node node-fallbacks. * organize the imports * Fix test * Sync bun-polyfills branch (#4081) * bun-polyfills: initial impl. & baseline refactor * move @types/ws dep from root to /test/ * bun-types: remove ReadableStream.forEach method (this does not exist, probably added by mistake) * bun-polyfills: remove extraneous stream utils * bun-polyfills: add types syncing file * bun-polyfills: re-arrange global polyfills * bun-polyfills: fix FileBlob streams types again * bun-polyfills: sync all of @types/node * bun-polyfills: typeguard all current polyfills * bun-polyfills: fix import paths * bun-polyfills: switch to wasm impl. of farmhash * bun-polyfills: support default import of bun obj * bun-polyfills: transpiler placeholder file * bun-polyfills: loaderless import.meta polyfill * bun-polyfills: refactor import.meta polyfill * bun-polyfills: repl entrypoint & todo list index * bun-types: Add null to return type of Bun.which * bun-types: match Bun.sha with Bun.hash.SHA512_256 * bun-polyfills: new "repl" package.json script * bun-polyfills: full refactor of toplevel hashes * bun-polyfills: these are fixed * bun-types: NODE_ENV is optional * bun-polyfills: fix Bun.env types * bun-types+polyfills: fix HeapSnapshot.version type * bun-polyfills: fix some web streams type conflicts * bun-polyfills: update internal FileBlob.slice * bun-polyfills: fix subproc stdin conversions * bun-polyfills: better internal fileblob types * bun-polyfills: try to sync global performance type * bun-polyfills: working zig wasm polyfills setup * bun-polyfills: update scripts * bun-polyfills: fix wasm file location resolution * bun-polyfills: goodbye farmhash (replaced by zig) * bun-polyfills: move all Bun.hash polyfills to zig * bun-polyfills: reimpl. seeding of seeded hashes * bun-polyfills: impl. undocumented murmur32v2 * bun-polyfills: switch zighash from jsdoc to .d.ts * bun-types: partial fix of Hash types * bun-polyfills: documented Hash.murmur32v2 * bun-polyfills: misc updates * bun-polyfills: enable sourcemaps * bun-polyfills: handle empty inputs to hash funcs * bun-types: narrow down hash func types * bun-polyfills: remove unnecessary bigint casts * bun-polyfills: impl. Bun.isMainThread * bun-polyfills: impl. Bun.sleep and fix sleepSync * bun-polyfills: impl. indexOfLine * bun-polyfills: impl. Bun.peek.status * bun-types: fix hashing test --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> * Add remix guide * Fix title * add util.formatWithOptions (#4090) * Add formatWithOptions * tests and tweaks * adjust --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> * bun test: format description of test.each (#4092) * bun test: format description * add tests for tests * only --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> * Fixes #4062 (#4106) * Fixes #4062 * Update encoding.zig * Use faster C++ impl * Update wtf-bindings.cpp * undo * Fixup --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> * zig fmt * Update remix guide * fs.zig: create temp files with 0o700, not 0o007 (#4107) * Handle thundering herd of setInterval (#4109) Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> * Fix memory leak in base64url (#4111) Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> * run files without extensions (#4113) * run script without extension * process stdio write fix * don't check for trailing slash, var stream * More lazily initialize these static strings * Remove assertion * wip * Add --inspect flag * Deprecate loading `node_modules.bun` * realpath * regenerate schema * More * more * Update cli.zig * Debugger JS loads * have fun * Most of the code * Its starting to work. * more progress * win some, lose some * Update dap.ts * Async Context Tracking * untested websocket * Emit Console messages * Error handling * errors * Make profiling work better * [clap] CLI arguments with optional values ignore positional params In `bun --inspect foo.js`, `foo.js` should not be the value of `--inspect`. It is a positional parameter. `--inspect=foo` * Support multiple simultaneous clients, automatically unpause on disconnect * regenerate * Update Makefile * Update WebKit * Update cli.zig * Update InternalModuleRegistry+createInternalModuleById.h * BaseURL * Update WebKit * Add web-inspector-bun * Update build.ts * formatting, mostly * Update debugger.ts * Update InternalModuleRegistryConstants.h * wrap * Update test * Update test --------- Co-authored-by: Ashcon Partovi <ashcon@partovi.net> Co-authored-by: Dylan Conway <dylan.conway567@gmail.com> Co-authored-by: dave caruso <me@paperdave.net> Co-authored-by: Tiramify (A.K. Daniel) <94789999+TiranexDev@users.noreply.github.com> Co-authored-by: Jacques <25390037+jecquas@users.noreply.github.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Ai Hoshino <ambiguous404@gmail.com> Co-authored-by: Yash Sharma <yashosharma@gmail.com> Co-authored-by: Yash Sharma <yashsharma@Yashs-MacBook-Air.local> Co-authored-by: Colin McDonnell <colinmcd94@gmail.com> Co-authored-by: jhmaster <32803471+jhmaster2000@users.noreply.github.com> Co-authored-by: Adhityaa Chandrasekar <github@adtac.in> Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2023-08-16Fix prisma linux generation (#4150)Gravatar Ciro Spaciari 1-1/+1
* check * fmt + fix * fmt * ops * add more targets * more targets * oops * update bun lock and prisma * manually add openssl * targets on sqlite
2023-08-12Fix worker event loop ref/unref + leak (#4114)Gravatar dave caruso 1-1/+1
* make more tests pass * worker changes * fix some bugs * remove this * progress * uh * okay * remove console log * a * comment assert for later * mergable state * remove test * remove test
2023-08-10async realpath (#4117)Gravatar Jarred Sumner 2-49/+139
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-081. Check if the argument is an empty string in `path.format`. (#4064)Gravatar Ai Hoshino 1-4/+17
2. Avoid duplicating '/' at the beginning of the path. Close: #4005
2023-08-07Fix `path.normalize` edge case. (#4042)Gravatar Ai Hoshino 1-1/+1
Close: #4041
2023-08-03Fix thread safety issue in async fs functions file paths (#3964)Gravatar Jarred Sumner 2-3/+18
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-03Fix the string encoding in `path.extname`. (#3949)Gravatar Ai Hoshino 1-1/+1
Close: #3948
2023-08-02Rewrite built-in modules to use CommonJS over ESM (#3814)Gravatar dave caruso 2-4/+2
* stfdsafsd sadffdsa stuff finish commonjs stuff asdf not done but work not done but work not done yet but this is how far i am remove files lol update built files uncomment everything in events lol export default stuff * afdsafsd * its not perfect but almost done * okay * cool * remove temp file * finish rebase * revert settings.json * a * ch-ch-ch-ch-changes * okay * remove this check in release for now * sxdcfghnjm, * lkjhgf * fmt * filename can be null * Update NodeModuleModule.h * weee * fmt --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-02Fix path_watcher (#3920)Gravatar Ciro Spaciari 1-106/+174
* fix callback and onError * fix main watcher error return * fixup * rename to be more clear
2023-07-28Fixes #3868Gravatar Jarred Sumner 1-2/+3
Fixes #3868 Fixes #849
2023-07-27Resolve watch directories outside main thread + async iterator and symlink ↵Gravatar Ciro Spaciari 3-176/+350
fixes (#3846) * linux working pending tests with FSEvents * add more tests, fix async iterator * remove unnecessary check * fix macos symlink on directories * remove indirection layer * todos * fixes and some permission test * fix opsie and make prisma test more reliable * rebase with main * add comptime check for macOS * oops * oops2 * fix symlinks cascade on FSEvents * use JSC.WorkPool * use withResolver, createFIFO and fix close event on async iterator * remove unused events --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-07-27Make readFile() async (#3850)Gravatar Jarred Sumner 3-170/+297
* less leaky * async readfile * Update types.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27Make readdir() async, fix crash in large directory trees (#3838)Gravatar Jarred Sumner 3-133/+296
* Fix unsafe GC behavior on large arrays returned by fs * Fix crash in large arrays of strings * async readdir * Add tests for large number of files returned by readdir * Move this down * Fix encoding edgecase in path.join * Async stat & lstat * add test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27Remove lstat call in fs.watch (#3836)Gravatar Jarred Sumner 1-23/+19
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-26Start time performance improvements to build tools (#3797)Gravatar Jarred Sumner 5-321/+681
* Make os.cpus() faster on Linux * Fix crash See https://github.com/ziglang/zig/issues/16540 * Handle watcher_count == 0 * Add assertion * Clean up lifetimes of fs watcher a little * :scissors: * Use `errdefer` * Make the error better * Make os.cpus() more lazy * Please don't translate-c on the entire C standard library * immediately closing works correctly is still bug * ops * fmt+fixeup * add back verbose * free instead of destroy * remove destroy option for watcher tasks * flush verbose and add debug log * fixup files * use log for debug --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>