Commit Graph

5967 Commits

Author SHA1 Message Date
Zack Radisic
ee6f2c8a75 HOLY FUCK big refactor 2024-02-27 14:44:13 -08:00
Zack Radisic
468b21f31b Merge branch 'jarred/process-change' of github.com:oven-sh/bun into jarred/process-change 2024-02-23 16:43:02 -08:00
Zack Radisic
23e9eef8a9 Support redirects 2024-02-23 16:42:50 -08:00
Zack Radisic
008a3c626a Remove @panic("TODO") on shell event loop tasks and Redirect open flags got lost in merge 2024-02-23 14:13:39 -08:00
Zack Radisic
2a8bfbe4ea shell: Fix array buffer 2024-02-23 13:45:58 -08:00
cirospaciari
dcbb8d97f4 fix renderMissing 2024-02-23 16:07:24 -03:00
cirospaciari
85b6320009 fix context deinit 2024-02-23 15:36:44 -03:00
cirospaciari
6d22838d37 oops 2024-02-23 15:23:29 -03:00
cirospaciari
4c3598f36e wip 2024-02-23 15:22:48 -03:00
Ciro Spaciari
bcf7b16616 more stable streams (#9053)
fix stream ref counting
2024-02-23 19:10:49 -03:00
Zack Radisic
c367ce1620 Fix some stuff shell 2024-02-22 20:57:13 -08:00
Zack Radisic
d0ee302e37 Actually buffer subproc output 2024-02-22 17:45:28 -08:00
Zack Radisic
a687eb11a0 Fix for #8982 got lost in the merge 2024-02-22 17:18:11 -08:00
Zack Radisic
d8646a0e64 Fix buffered writer + shell/subproc.zig and windows build 2024-02-22 16:58:16 -08:00
Zack Radisic
f56c625924 Fix buffered writer for shell 2024-02-22 14:12:49 -08:00
Zack Radisic
e2ef561338 Merge branch 'jarred/process-change' of github.com:oven-sh/bun into jarred/process-change 2024-02-22 13:16:17 -08:00
Zack Radisic
86946686f5 revert onDone thing 2024-02-22 13:14:16 -08:00
cirospaciari
a70d0df7c9 revert stuff until the fix is actually ready 2024-02-22 13:02:37 -03:00
cirospaciari
fe01d9b783 make windows compile again 2024-02-22 09:02:47 -03:00
cirospaciari
0a42ac0ded more stable stream and now Content-Range pass 2024-02-22 08:57:53 -03:00
Jarred Sumner
dfab13e6de Fix compiler errors 2024-02-21 21:42:50 -08:00
Jarred Sumner
2d71bce242 Merge branch 'main' into jarred/process-change 2024-02-21 21:02:49 -08:00
Zack Radisic
2605722891 shell: Allow duplicating output fds (e.g. 2>&1) (#9004)
* Open with proper perms when redirecting file to stdin

* Add test for redirecting file to stdin

* Extract redirect flags -> bun.Mode logic to function

* Remove dead code

* Support duplicating output file descriptors

* Clean up

* fix merge fuck up

* Add comment documenting weird hack to get around ordering of posix spawn actions

* Update docs

* Delete dead code

* Update docs
2024-02-21 18:45:44 -08:00
argosphil
53739f8a53 fix: modify bcrypt to be able to verify passwords directly (#9010)
Fixes #9009.

This would make the "bcrypt" algorithm (actually a variation of it)
easier to use.
2024-02-21 18:34:18 -08:00
dave caruso
44f7ddd2ff fix: ConsoleObject handles proxy better (#9042)
* fix: ConsoleObject handles proxy better

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-21 18:33:54 -08:00
Zack Radisic
048ae7c7b8 shell: Fix latin-1 template literal strings (#9040)
* Fix latin-1

* Move utf8 check above 8bit check
2024-02-21 18:32:42 -08:00
Jarred Sumner
2c6cd24393 Implement expect().toBeOneOf(), fix small memory leaks in expect matchers (#9043)
* Add .toBeOneOf

* Fix memory leaks in .toContain(), .toInclude(), toContainKeys(), toBeTypeOf(), toEqualIgnoringWhitespace

* Handle exception

* Ignore non-bool

* Propagate errors when the message callback throws

* fixups

* Update preload.ts

* Update jest-extended.test.js

* Update expect.zig

* comments

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-21 18:31:14 -08:00
Zack Radisic
afbc997b51 Okay now the shell compiles, but segfaults 2024-02-21 16:44:39 -08:00
Zack Radisic
b166e8a4af Holy cleansing of @panic("TODO SHELL")
at least it compiles now
2024-02-21 16:20:40 -08:00
Zack Radisic
436621ecf5 Eliminate @panic("TODO SHELL") for BufferedWriter 2024-02-21 16:11:50 -08:00
Zack Radisic
2092e99d6e Slowly remove some @panic("TODO SHELL") 2024-02-21 15:24:43 -08:00
Dylan Conway
9ee39cac8b fix(install): semver prerelease bugfix (#9026)
* make sure prereleases match correctly

* add the file

* few more tests

* make sure pre is in query, not group
2024-02-21 14:47:43 -08:00
Zack Radisic
893d2f0253 Merge branch 'jarred/process-change' of github.com:oven-sh/bun into jarred/process-change 2024-02-21 14:45:19 -08:00
Zack Radisic
3ee74c47e2 Make shell compile again 2024-02-21 14:41:22 -08:00
Kenta Iwasaki
20275aa040 fix(ws/client): handle short reads on payload frame length (#9027)
* fix(ws/client): handle short reads on payload frame length

In the WebSocket specification, control frames may not be fragmented.
However, the frame parser should handle fragmented control frames
nonetheless. Whether or not the frame parser is given a set of
fragmented bytes to parse is subject to the strategy in which the client
buffers received bytes.

All stages of the frame parser currently supports parsing frames
fragmented across multiple TCP segments except for the payload frame
length parsing stage.

This commit implements buffering the bytes of a frame's payload length
into a client instance so that the websocket client is able to properly
parse payload frame lengths despite there being a short read over
incoming TCP data.

A test is added to
test/js/web/websocket/websocket-client-short-read.test.ts which creates
a make-shift WebSocket server that performs short writes over a single
WebSocket frame. The test passes with this commit.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-21 14:31:57 -08:00
Cameron Haley
bdb70d5bc2 Account for initial_thread_count in napi threadsafe_function logic (#9035) 2024-02-21 14:19:43 -08:00
Jarred Sumner
6184542682 Add BUN_DEBUG flag to control where debug logs go (#9019)
* Add `BUN_DEBUG` flag to control where debug logs go

* Update all the actions

* Configure temp

* use spawn instead of rm

* Use CLOSE_RANGE_CLOEXEC

* Make some tests more reproducible

* Update hot.test.ts

* Detect file descriptor leaks and wait for stdout

* Update runner.node.mjs

* Update preload.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-21 14:13:43 -08:00
cirospaciari
411c7874f8 more tests passing 2024-02-21 17:59:54 -03:00
cirospaciari
a3293756c5 make windows compile again 2024-02-21 17:18:44 -03:00
cirospaciari
30951d788d actually use the ref count in this places 2024-02-21 17:04:57 -03:00
cirospaciari
e44fc06f7e fix some compile errors 2024-02-21 14:17:48 -03:00
Zack Radisic
dc098038cb Merge branch 'jarred/process-change' of github.com:oven-sh/bun into jarred/process-change 2024-02-20 20:28:33 -08:00
Zack Radisic
7cd9af1091 Some shell changes
at least it compiles
2024-02-20 20:28:00 -08:00
Jarred Sumner
a0be3cb2ff Slightly reduce code duplication in expect (#9018)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-20 18:58:33 -08:00
dave caruso
5c6b9ea9b6 change how bunx caches things (#8921)
* some things

* yeah

* ok

* fix compilation error

* fix on windows

* ok

* username
2024-02-20 18:58:12 -08:00
cirospaciari
5d26789a08 remove old todos 2024-02-20 20:09:18 -03:00
cirospaciari
0aeb5004df fix closing on PipeWriter and PipeReader 2024-02-20 20:07:06 -03:00
cirospaciari
e28d3791ca WIP sync close (shows ref count bug in stream) 2024-02-20 19:16:39 -03:00
cirospaciari
32c933d1e0 WIP needs to find where we need to uv_close 2024-02-20 18:40:52 -03:00
cirospaciari
b02336cc3d WIP needs to find where we need to uv_close 2024-02-20 18:40:39 -03:00