aboutsummaryrefslogtreecommitdiff
path: root/src/js/node (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-09-29fix(runtime): followup for `server.requestIP` (#6185)Gravatar dave caruso 1-1/+1
* fix(runtime): followup for `server.requestIP` * oops * yeah * sure * Update src/deps/libuwsockets.cpp * Update Dockerfile * lol --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-29add Socket.prototype; lol (#5945)Gravatar dave caruso 2-21/+16
2023-09-29feat(runtime): implement `server.requestIp` + node:http `socket.address()` ↵Gravatar dave caruso 1-16/+33
(#6165) * [server] requestIp and AnyRequestContext Changed Request.uws_request to the new AnyRequestContext. This allows grabbing the IP from a Request. Unfinished. * [server] basic `requestIp` implementation Currently using uws's requestIpAsText, which always returns a ipv6 string. We should return a `SocketAddress` object to the user instead, which will contain the formatted address string and what type it is. We'll have to use requestIpAsBinary and parse that ourselves. * TypeScript docs, use `bun.String`, return `undefined` instead of `null` if we can't get the ip. * binary address formatting * uws getRemoteAddress binding * remove dead code * working * final touches:sparkles: * I will abide by the results of this poll. --------- Co-authored-by: Parzival-3141 <29632054+Parzival-3141@users.noreply.github.com>
2023-09-28Get Next.js Pages Router to work (#6095)Gravatar dave caruso 2-21/+112
* hell * make it so bun-debug-src * teag * wild * yippee * fas * fix async hooks assertions * yap * yeah that's wild * aa * a * increase time allowed * so trivial
2023-09-27Complete rework of the majority of `node:util`, primarily `util.inspect` (#4493)Gravatar jhmaster 2-334/+15
* 1st revision of new util.inspect impl. (not done) * fix util.types.isArrayBuffer * fix some utl tests and bugs * fix node:tty missing primordials * fix utl stackoverflow handling & some tests * narrow down diff. context test * util.inspect indirect circulars optimization * temp workaround for buggy is...Function checks * impl. Map/Set/Iterator entries inspection * fix bigint & symbol objects inspection * error inspection fixes * misc util tests stuff * inline getExternalValue stub * leftovers * util.inspect promise internals * run bun fmt * commit make js changes * cut out unnecessary utl files * reorganize utl folder structure * remove browserify buffer check * Try to revert git messing up uws somehow This reverts commit 2c27e16e7d361657b9c3a7dc7892117cf31e15ee. * commit src/js/out files again * redo this edit too * refresh js/out files * Removed uws submodule * tidy up * unused primordials * run fmt --------- Co-authored-by: dave caruso <me@paperdave.net>
2023-09-27fix(node:fs): fix `fs.exists` callback parameters (#6097)Gravatar Ai Hoshino 1-4/+17
Close: #6073
2023-09-21disable child_process execArgv + fix crash in cli parsing (#5843)Gravatar dave caruso 1-12/+12
* stuff * stuff --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-21fix: correctly pass the encrypted(bool) property on "Socket" for express.js ↵Gravatar Liz 1-1/+1
(#5878) * fix: correctly pass the encrypted property on "Socket" for express.js Express relies on this for setting the requests protocol. Since this is on a dummy object, a property is simply set with the actual value. Which seams okay as a workaround. * chore: add generated files * chore: add test * refactor: set property directly rather then through a getter
2023-09-20fix(run): interpret extensionless files as typescript (#5711)Gravatar dave caruso 1-1/+1
* test * gadsgsagdsa * add better err msg * r * oops * ok
2023-09-20feat(node:dns): implement `dns.lookupService` (#5613)Gravatar Ai Hoshino 1-2/+9
* feat(node:dns): implement dns.lookupService Close: #4347 * fix flags * add `getSockaddr` * fix sockaddr size * flaky test
2023-09-18feat(runtime): Implement `console.Console` (#5448)Gravatar dave caruso 1-1/+1
* prototype * asdfg * It works! * okay its done now fr * self review * ok * fix * fix test --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-18Fix HTTP listen behavior being non-compliant with node (#5689)Gravatar dave caruso 1-1/+1
* Fix HTTP listen behavior being non-compliant with node * Add error code for address in use * use SystemError --------- Co-authored-by: SuperAuguste <19855629+SuperAuguste@users.noreply.github.com>
2023-09-15Fixes #5465 (#5468)Gravatar Jarred Sumner 1-7/+5
* Fixes #5465 Fixes #5465 * Update tty.js * Update InternalModuleRegistryConstants.h --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-14fix http set cookie headers (#5428)Gravatar Dylan Conway 1-12/+6
* allow multiple set-cookie values * make it work for `getHeader` * move `getHeader` to cpp * remove set-cookie check * move `setHeader` to cpp --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-14async-ify all node:fs functions (#5360)Gravatar Jarred Sumner 2-101/+80
* 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-14fix(runtime): emit `node:net` connect error event vs throw (#5336)Gravatar dave caruso 1-53/+67
* fix(runtime): emit `node:net` connect error event vs throw * oops * finally * ok * we are good
2023-09-13feat(nodejs): implement `os.availableParallelism` (#5109)Gravatar WingLim 1-0/+3
* feat(nodejs): implement `os.availableParallelism` * chore: do not throw error as same as node * refactor: use `navigator.hardwareConcurrency`
2023-09-12js/node/stream.js: call write() callback when encoding is not provided (#4841)Gravatar cfal 1-0/+4
* js/node/stream.js: call write() callback when encoding is not provided * js/out/InternalModuleRegistryConstants.h: update
2023-09-08Fix listen() using unix socket if argument is a valid port (#4620)Gravatar Ashcon Partovi 1-1/+1
* Fix listen() using unix socket if argument is a valid port Fixes #4582 * Add test
2023-09-07Bump version to Bun 1.0.0 (#4543)Gravatar dave caruso 2-343/+332
* hi * Update Version to 1.0.0 * 2 --------- Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2023-09-07revert (#4539)Gravatar dave caruso 1-395/+32
* Revert "remove native events from streams" This reverts commit e063a47a53744a2bf5b1c2dd433698c9e37b75d6. * finish revert * remove accidental submodule * dfghj
2023-09-07Progress for Next.js (#4468)Gravatar dave caruso 7-73/+508
* 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-06feat(fetch) rejectUnauthorized and checkServerIdentity (#4514)Gravatar Ciro Spaciari 1-1/+1
* enable root certs on fetch * rebase * fix lookup * some fixes and improvements * fmt * more fixes * more fixes * check detached onHandshake * fix promise case * fix cert non-Native * add fetch tls tests * more one test
2023-09-06fix(runtime): fix `events.once` not working (#4520)Gravatar dave caruso 1-2/+3
2023-09-05feat(runtime): Implement `fs.watchFile` (#4467)Gravatar dave caruso 1-1/+89
* 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(node:net): emit close event on connection error (#4336)Gravatar dave caruso 1-5/+3
* emit close event on connection error * re-review * add test
2023-08-30feat(node:fs): add `cp`/`cpSync`/`promises.cp` + async `copyFile` (#4340)Gravatar dave caruso 2-11/+82
* 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-30fix(http/https) disable decompress on http/https client (#4399)Gravatar Ciro Spaciari 1-0/+3
* disable decompress on http/https module * make js again
2023-08-30reset signal handlers in Bun.spawn (#4405)Gravatar Jarred Sumner 1-3/+8
* see if this fixes it * We don't need this * Remove extra flag --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-29fix(node-fetch): use stream.Readable instead of web streams (#4394)Gravatar dave caruso 1-1/+1
* fix blobFrom * fix(node-fetch): use stream.Readable instead of web streams * uncomment * comment why
2023-08-29parse unix socket path param in `http.server` (#4390)Gravatar Ai Hoshino 1-0/+5
2023-08-29emit open and call close callback (#4384)Gravatar Dylan Conway 2-4/+23
2023-08-28feat(node:dns): implement `dns.reverse`. (#4332)Gravatar Ai Hoshino 1-3/+32
* feat(node:dns): implement `dns.reverse`. Close: #4299 * fix dns reverse for ipv6 --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-08-28use `options.fd` if provided for `fs.Read/WriteStream` (#4378)Gravatar Dylan Conway 2-34/+38
* use `options.fd` over path * tests * fix `@clack/prompts` * == null
2023-08-24Fix(node:http): fix URL formatting when using a proxy. (#4297)Gravatar Ai Hoshino 1-14/+20
Close: #4295
2023-08-23Bunch of streams fixes (#4251)Gravatar Jarred Sumner 1-2/+5
* Update WebKit * Don't do async hooks things when async hooks are not enabled * Smarter scheduling of event loop tasks with the http server * less exciting approach * Bump WebKit * Another approach * Fix body-stream tests * Fixes #1886 * Fix UAF in fetch body streaming * Missing from commit * Fix leak * Fix the other leak * Fix test * Fix crash * missing duperef * Make this code clearer * Ignore empty chunks * Fixes #3969 * Delete flaky test * Update bun-linux-build.yml * Fix memory issue * fix result body, and .done status before the last callback, dont touch headers after sent once * refactor HTTPClientResult * less flasky corrupted test * oops * fix mutex invalid state * fix onProgressUpdate deinit/unlock * fix onProgressUpdate deinit/unlock * oops * remove verbose * fix posible null use * avoid http null * metadata can still be used onReject after toResponse * dont leak task.http * fix flask tests * less flask close tests --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
2023-08-21fix fsevents and stub for qwikcity (#4247)Gravatar dave caruso 3-4/+7
* fix test * ok * cm * EE * remove the hack we didnt need
2023-08-21fix stdin stream unref and resuming (#4250)Gravatar Dylan Conway 1-3/+4
* fix stream unref and resuming stream * fix `child-process-stdio` test
2023-08-21Fix inquirer (#4245)Gravatar dave caruso 1-0/+3
2023-08-21Fix crypto.EC constructor (#4242)Gravatar dave caruso 1-0/+1
* Fix EC constructor * make js
2023-08-19tty `ReadStream`, `WriteStream`, and readline rawmode (#4179)Gravatar Dylan Conway 3-9/+298
* tty `WriteStream`, `ReadStream`, and rawmode * tests * refactor prototypes * fix failing test * fix test and library usage * more merge * fix child_process test * create pseudo terminal for tty tests * match node logic * handle invalid tty * close descriptors * move tests to another process * fix test again * fix test on linux
2023-08-17Add `util.inspect.custom` support to `util.inspect/Bun.inspect/console.log` ↵Gravatar dave caruso 1-18/+35
(#4194) * start work on util.inspect.custom * asdf * finish util inspect custom inspect * inspect * fix tests * revert * tidy * revert * oops * test * fix issues
2023-08-17Support Nitro (#4098)Gravatar dave caruso 2-0/+62
* Add formatWithOptions * tests and tweaks * adjust * changes * hi * add mark/measure stubs * stuff * allow unix absolute paths here * typo * rebase * fix stats
2023-08-17Allow IncomingRequest.req to be overwritten. (#4154)Gravatar dave caruso 1-5/+1
* Allow IncomingRequest.req to be overwritten. * add test * fix test * yoo
2023-08-17Fix(node:fs): add buffer parameter in fs.read callback. (#4191)Gravatar Ai Hoshino 1-2/+32
Close: #4178
2023-08-15res.thenGravatar Dylan Conway 1-1/+1
2023-08-12Fix worker event loop ref/unref + leak (#4114)Gravatar dave caruso 1-5/+8
* 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-2/+8
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-10add util.formatWithOptions (#4090)Gravatar dave caruso 1-6/+17
* Add formatWithOptions * tests and tweaks * adjust --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-08-08worker tests (#4058)Gravatar dave caruso 1-8/+23
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>