Compare commits

...

4249 Commits

Author SHA1 Message Date
Derrick Farris
78d6743f58 fix(node-test-helpers): make sure to call done with any Errors thrown from wrapped fn 2023-01-11 20:54:40 -06:00
Derrick Farris
f8114d09fd test(child_process): fix assert -> assert.ok 2023-01-11 20:52:15 -06:00
Colin McDonnell
4969f068f6 Types update (#1761)
* Fix type tests

* Add dns types

* Add node:net types

* Make process.exit return never

* Make ArrayBufferView tighter

* Add types for node:dns

* Remove docs

* Use latest

* Fix CI

* Fix CI

* Stop double trigger

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2023-01-11 14:56:41 -08:00
Jarred Sumner
4a1470d26c require.resolve in the runtime should use CommonJS export conditions 2023-01-11 14:22:31 -08:00
Jarred Sumner
5a3b634982 [breaking] Read the "node" export condition in package.json in Bun's runtime 2023-01-11 14:21:45 -08:00
Jarred Sumner
520ecc21ac [node:net] Hopefully fix unix sockets 2023-01-11 13:58:25 -08:00
Jarred Sumner
8911c398d9 Support socketPath 2023-01-10 20:39:11 -08:00
Jarred Sumner
1738588f38 potentially support tls in some cases 2023-01-10 19:39:34 -08:00
Jarred Sumner
5e60a9363f [node:tls] Stub out just enough to make it load 2023-01-10 19:29:27 -08:00
Jarred Sumner
cd20a84f18 Disable reading the browser field when targeting Bun's runtime (#1763)
* Fix flipped order

* Disable reading `"browser"` field when targeting Bun's runtime in the resolver

* Update resolver.zig

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-01-10 19:09:53 -08:00
Jarred Sumner
e07dd6194a make it size_t 2023-01-10 19:06:53 -08:00
Jarred Sumner
bcabf31121 Make Buffer mockable 2023-01-10 18:49:26 -08:00
Jarred Sumner
5cb6890fad Fix flipped order 2023-01-10 18:49:26 -08:00
Malcolm Still
f1e6ea2254 Implement Buffer swap16, swap32, swap64 (#1659)
* Implement Buffer swap16, swap32, swap64

* Initial incorporation of feedback

- Use constexpr
- Clean up the indexing
- Check for detached
- Use suggested text for exception text
2023-01-10 18:43:58 -08:00
Jarred Sumner
56a6cf716e [TCPSocket] Add a log for write() 2023-01-10 17:16:42 -08:00
Jarred Sumner
3517ce8e23 Add two tests for fs/promises 2023-01-10 17:16:16 -08:00
Jarred Sumner
3c525b4962 Fix fs:promises 2023-01-10 17:16:08 -08:00
Jarred Sumner
e945be72b4 Add some missing types 2023-01-10 14:36:00 -08:00
Jarred Sumner
3002a7e14f don't call add_server-name if len is not >0 2023-01-10 11:56:02 -08:00
Jarred Sumner
c18165b30f Allow tls: true in Bun.connect 2023-01-10 11:55:42 -08:00
Jarred Sumner
e18863df1b attempt (unsuccessfully) to improve c++ build time 2023-01-10 10:23:11 -08:00
Jarred Sumner
41f23273b0 [js parser] Do not inline regexp literals 2023-01-10 10:23:11 -08:00
Jarred Sumner
e62a422c14 Fix circular dependency in make headers 2023-01-10 10:23:11 -08:00
Jarred Sumner
91f7e6c66d Changes from upgrading webkit 2023-01-10 10:23:11 -08:00
Jarred Sumner
946424cf86 buffer.toString(undefined) should be UTF-8 2023-01-10 10:23:11 -08:00
Alex Lam S.L
270b07e85e use strings.hasPrefixComptime() (#1755) 2023-01-10 05:35:20 -08:00
Jiaji Zhou
b458abedbb Fix missing c-ares dep in dev build (#1754) 2023-01-10 04:51:01 -08:00
Derrick Farris
4ef60da8a9 refactor(readline/promises): re-export readline.promises from readline (#1748)
* refactor(readline/promises): re-export readline.promises from readline/promises

* fix(readline): don't export Readline from `readline`

* perf(readline): return Promise.reject immediately after failed validation
2023-01-09 16:27:56 -08:00
Jarred Sumner
0e7f69f179 Update child_process-node.test.js 2023-01-09 10:37:02 -08:00
Jarred Sumner
84ee02cb4b Update test_command.zig 2023-01-09 10:33:39 -08:00
Jarred Sumner
7a92bf87c8 Add very simple dns test 2023-01-09 10:12:46 -08:00
Jarred Sumner
55c1311aef fixup 2023-01-09 09:42:09 -08:00
Jarred Sumner
beed35e55e Update test_command.zig 2023-01-09 09:40:54 -08:00
Jarred Sumner
5cd37e5e8a Rename 2023-01-09 09:40:46 -08:00
Jarred Sumner
1761379135 Update test_command.zig 2023-01-09 09:13:23 -08:00
Jarred Sumner
30b10d5fb1 [bun:test] Implement test.root configuration option 2023-01-09 08:28:37 -08:00
Jarred Sumner
ca58556c54 Fix frozen IO stuff 2023-01-09 08:26:20 -08:00
Jarred Sumner
a1b2c23671 [bun:test] Implement test.skip 2023-01-09 08:25:39 -08:00
Jarred Sumner
5d60aae3b3 [dns] Fix UAF 2023-01-09 08:21:05 -08:00
Jarred Sumner
2392e48e9d Fixes https://github.com/oven-sh/bun/issues/1533 2023-01-09 03:41:03 -08:00
Jarred Sumner
3386afc0bc Add test for Bun.listen throwing 2023-01-09 03:26:16 -08:00
Jarred Sumner
1a1014525b Make autotick logic more consistent 2023-01-09 03:25:57 -08:00
Jarred Sumner
c30a110641 Cleanup code in expectToThrow 2023-01-09 03:25:41 -08:00
Jarred Sumner
ced6201cb0 Cleanup error handling in Bun.listen 2023-01-09 03:25:06 -08:00
Jarred Sumner
905a3313b5 check for isEmpty or !isCell 2023-01-09 03:18:41 -08:00
Jarred Sumner
f0475e89c5 Handle 0 in isCell 2023-01-09 02:28:14 -08:00
Jarred Sumner
cb75b4799f Add test for expect().toThrow 2023-01-09 00:22:54 -08:00
Jarred Sumner
5f1150442a Revert "lazily create buffer/string slices (#1735)"
This reverts commit e2ed31b7e7.
2023-01-08 23:53:31 -08:00
alexlamsl
94b6ab02c2 fix string encoding detection 2023-01-09 01:08:24 +02:00
Jarred Sumner
631181a503 Add welcome page when viewed from a browser 2023-01-08 07:37:51 -08:00
Jarred Sumner
83a5c9f3da [internal] Fix checking for Error object 2023-01-08 07:37:51 -08:00
Jarred Sumner
791f8ab0a1 [internal] Regenerate code 2023-01-08 07:37:51 -08:00
Jarred Sumner
da11bb4a82 [internal] Fix type casting in Zig bindings 2023-01-08 07:37:51 -08:00
Derrick Farris
94409770de feat(node:readline): add node:readline and node:readline/promises (#1738)
* feat(readline): WIP: add readline

* test(helpers): add deepStrictEqual helper

* feat(readline): add readline & readline/promises to loader

* fix(node:events): emit newListener on new listener added

* feat(readline): finish readline cb interface, add tests

* fix(stream): fix Transform.end()

* fix(node-test-helpers): correct throws behavior, improve how all asserts work

* feat(readline/promises): add readline/promises

* feat(assert): add assert.match

* test(readline): uncomment more tests

* fix(readline): MaxCeil -> MathCeil 🤦

* fix(readline): export promises from node:readline

* fix(readline): temp fix for circular dependency

* cleanup(readline): remove console.log

* fix(readline): change true -> 0 for CommonJS export

* perf(readline): micro-optimizations with some getters

* perf(readline): lazy load isWritable

* cleanup(readline): rename debug flag env var to BUN_JS_DEBUG
2023-01-08 01:49:49 -08:00
Jarred Sumner
c505f172b8 Add napi to process.versions 2023-01-08 01:11:23 -08:00
Jarred Sumner
9972e553a0 Update process.versions 2023-01-08 00:50:38 -08:00
Jarred Sumner
cdbdc55cbf We don't statically link iconv 2023-01-08 00:12:24 -08:00
Jarred Sumner
3f472bd511 cleanup 2023-01-08 00:10:02 -08:00
Jarred Sumner
4eb3067ef5 Workaround macOS issue 2023-01-07 23:58:25 -08:00
Jarred Sumner
3c8701362b Document connectError 2023-01-07 23:47:08 -08:00
Jarred Sumner
fadd1c0152 [Bun.connect] Fix bug where connect() Promise wouldn't reject on a connection error 2023-01-07 23:45:43 -08:00
Jarred Sumner
1e19d59273 Update uws 2023-01-07 23:45:43 -08:00
Jarred SUmner
cfd42c3999 Linux build 2023-01-07 21:48:31 -08:00
Jarred SUmner
98010efefc Change error 2023-01-07 21:41:07 -08:00
Jarred SUmner
020f49dcd6 Return ENOTFOUND instead of ENOTERROR 2023-01-07 21:05:34 -08:00
Jarred SUmner
1e841a7881 Fix segfault on Linux when getaddrinfo returns an error\nSee https://github.com/ziglang/zig/pull/14242 2023-01-07 21:05:34 -08:00
Jarred Sumner
b0d1cc1df7 Mark more things as only mac 2023-01-07 19:55:51 -08:00
Jarred Sumner
0a835ba963 Don't include this symbol on linux 2023-01-07 19:48:49 -08:00
Jarred Sumner
2b1b897375 very simple node:dns implementation
completely untested
2023-01-07 07:59:36 -08:00
Jarred Sumner
87983464d8 Implement DNS module (#1691)
* Boilerplate for DNS stuff

* Add c-ares

* lookup

* make

* Implement dns.lookup

* Create c-ares

* wip

* normalize

* repro

* Revert "repro"

This reverts commit 8b93e0c295b335b8882a9601da47720348549beb.

* Implement macOS `getaddrinfo_async_start`

* embiggen

* Update string_immutable.zig

* Update Makefile

* alright

* Update .gitignore

* Add types

* more ccache

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update bun.d.ts

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-01-07 07:09:48 -08:00
alexlamsl
d5565ab2cd test BufferList against surrogate pairs 2023-01-07 12:39:32 +02:00
Jarred Sumner
8dc811e4aa Add missing null check
Fixes https://github.com/oven-sh/bun/issues/1739

probably
2023-01-06 16:41:34 -08:00
Ikko Eltociear Ashimine
1e1c817603 fix typo in install.sh (#1737)
infomation -> information
2023-01-06 10:15:32 -08:00
Alex Lam S.L
e2ed31b7e7 lazily create buffer/string slices (#1735) 2023-01-05 19:43:33 -08:00
Jarred Sumner
a7d9f16107 Report unhandled promise rejection on exit and make exit code 1 instead of 0 (#1734)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-01-05 16:23:45 -08:00
Jarred Sumner
bbbb4835b4 always report rejected promises 2023-01-05 15:08:06 -08:00
Jarred Sumner
f191993c8f Clean up some napi code 2023-01-05 14:49:41 -08:00
Jarred Sumner
994e58b5ea napi_boolean -> napi_number 2023-01-05 14:40:45 -08:00
Jarred Sumner
59639ba654 Fixes #1733 2023-01-05 14:06:27 -08:00
Alex Lam S.L
d22e3ebf9a [socket] fix double-free in finalize() (#1731)
- tidy up `.isEmptyOrUndefinedOrNull()` usage
2023-01-05 13:17:15 -08:00
Jarred Sumner
0873a15a63 Bump 2023-01-05 05:09:34 -08:00
Alex Lam S.L
20718b972e fix onConnectError() error propagation (#1730)
* fix `onConnectError()` error propagation
suppress extraneous logging messages

* Update src/bun.js/api/bun/socket.zig

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-01-05 03:31:01 -08:00
Jarred Sumner
a951859c55 Update tcp-echo.bun.ts 2023-01-05 01:38:36 -08:00
Jarred Sumner
3005d9e348 Really fix #1722 2023-01-05 00:24:53 -08:00
Alex Lam S.L
7f96f72d65 improve .toThrow() compatibility with Jest (#1728) 2023-01-05 00:15:04 -08:00
u9g
7550658fab Fix Bun.serve typings (#1714) 2023-01-04 23:54:17 -08:00
Alex Lam S.L
80736043d6 implement expect().toThrow() (#1727)
- fix bugs in `JSBufferList`
- add tests
2023-01-04 22:37:14 -08:00
Jarred Sumner
3b259211df Add SharedBuffer from WebKit to make it easier to import more WebCore stuff 2023-01-04 18:55:16 -08:00
Jarred Sumner
6b777c4b0b Fix default export for stream
cc @alexlamsl
2023-01-04 18:55:16 -08:00
Jarred Sumner
81a6aef771 Fixes #1722 2023-01-04 18:55:16 -08:00
Jarred Sumner
f41bb3fb20 split server/client for tcp echo benchmark to better measure net.Socket perf 2023-01-04 18:55:16 -08:00
Alex Lam S.L
e0557d70e3 buffer list clean-ups (#1721) 2023-01-04 15:32:39 -08:00
Jarred Sumner
e2231f15e8 Support non-classes in node:net (#1712)
* Support non-classes

* Update net.exports.js

* Make it less observable

* Update net.exports.js

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-01-04 04:06:24 -08:00
Jarred Sumner
a19c7b4304 Fixes #1716 2023-01-04 03:46:56 -08:00
Jarred Sumner
4a328609b9 10x faster new Buffer (#1717)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-01-04 03:30:15 -08:00
Jarred Sumner
021331f154 Update README.md 2023-01-03 20:17:22 -08:00
Jarred Sumner
647093ff73 Add sqlite to vendor 2023-01-03 20:15:57 -08:00
Jarred Sumner
7df50add99 Fixes https://github.com/oven-sh/bun/issues/1695 2023-01-03 19:34:58 -08:00
Jarred Sumner
c99059db9f Remove usages of std.x 2023-01-03 18:53:40 -08:00
Alex Lam S.L
237bcdf99f [streams] speed up Readable in some cases (#1708)
If `encoding` is set, no `Buffer`s would be exposed thus `Uint8Array` can be used directly.

- fix data corruption in `BufferList.concat()`
- fix segfaults in `BufferList.join()`
2023-01-03 16:08:28 -08:00
Jarred Sumner
0b395ca1dc Fix crash in BufferList 2023-01-03 13:47:05 -08:00
Jarred Sumner
c1fd06c56d Create readme.md 2023-01-03 13:11:44 -08:00
Jarred Sumner
f79301c620 Implement napi_make_callback 2023-01-03 12:36:56 -08:00
Jarred Sumner
4ae33cbf45 Stub out missing napi functions and include error message 2023-01-03 10:55:13 -08:00
Jarred Sumner
59655d0587 Fix spec issue with napi_get_typedarray_info 2023-01-03 10:32:22 -08:00
Alex Lam S.L
7edaf736a2 [socket] handle connectError (#1705)
assorted clean-ups & fixes
2023-01-02 23:06:45 -08:00
Jarred Sumner
c770db7d52 make it work with homebrew zig 2023-01-02 22:06:52 -08:00
Jarred Sumner
cbc015d8d8 [internal] allow using zig from more directories 2023-01-02 21:26:02 -08:00
Alex Lam S.L
18e143ae7b fix double resolve() in test (#1707)
also clean up `reject()` values
2023-01-02 20:19:44 -08:00
Jarred Sumner
8989a1883e Support any ArrayBufferView in StringDecoder 2023-01-02 15:39:44 -08:00
Alex Lam S.L
983b747020 implement net.Socket (#1701)
- support TCP sockets for now, i.e. no IPC
- extra features like keep-alive, no-delay etc. are absent due to limitations of uSockets
- fix `jest` to treat `done(nullish)` as success
2023-01-02 14:55:01 -08:00
Jarred Sumner
1ba95a65ee Make the error message for unsupported dependency type a little clearer 2023-01-02 14:52:35 -08:00
Jarred Sumner
54b8cbd972 Add buffer creation snippet 2023-01-02 14:52:06 -08:00
Jarred Sumner
4eb9e8bb5a update node echo bench 2023-01-02 13:23:08 -08:00
Jarred Sumner
80c2da73ef Upgrade simdutf
Thanks @lemire
2023-01-02 12:48:44 -08:00
Jarred Sumner
4ba564dbf1 More instructions 2023-01-02 11:50:47 -08:00
Jarred Sumner
5fc8bc8f04 Update macOS instructions 2023-01-02 11:37:50 -08:00
Jarred Sumner
9fd3b5587b Auto-install and link webkit 2023-01-02 11:29:22 -08:00
Alex Lam S.L
04b00229cf fix lingering process by dead sockets (#1700)
`Bun.listen()` and `Bun.connect()` would create sockets that under certain conditions with calls to `.end()` or `.stop`,  prevents the process from exiting gracefully.
2023-01-02 02:24:23 -08:00
Alex Lam S.L
8a29c64302 clean up Promise handling (#1697) 2023-01-01 16:37:45 -08:00
Jarred Sumner
2345e268bc Fix bun --cwd after https://github.com/ziglang/zig/pull/13596 2023-01-01 13:34:50 -08:00
Jarred Sumner
97066d034d Add workaround 2023-01-01 12:37:00 -08:00
Jarred Sumner
5f24c8a4a8 Bump 2023-01-01 12:04:55 -08:00
Jarred Sumner
96438a4d58 test crypto.randomBytes returns a Buffer 2023-01-01 12:04:49 -08:00
Jarred SUmner
5b3cf8bec5 Handle extremely unlikely edgecase 2023-01-01 07:21:08 -08:00
Jarred SUmner
c02b921983 Fix linux build issue 2023-01-01 07:20:35 -08:00
Jarred SUmner
0b0aadfc5f Make asPromise() and asInternalPromise() safer, but slower 2023-01-01 07:20:16 -08:00
Jarred Sumner
905aff3cfc Update bindings.zig 2023-01-01 02:19:34 -08:00
Jarred Sumner
9e6d39bae6 [internal] Add more bindings 2023-01-01 02:19:11 -08:00
Jarred Sumner
f651f74f9d Add a test for empty chunks 2023-01-01 01:33:13 -08:00
Jarred Sumner
01b908ad64 Workaround https://github.com/ziglang/zig/issues/14148 2023-01-01 01:32:40 -08:00
Gabriel Wu
8a2729e75f Update ffi.d.ts (#1694)
* Update ffi.d.ts

Add "usize" and "callback", which are used in `README` but not typed here.

* Update packages/bun-types/ffi.d.ts

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2022-12-31 23:03:45 -08:00
Alex Lam S.L
9b3db96308 [jest] fix and improve hooks (#1689)
- wait for async hooks to complete before running tests
- add support for `done(err)` callbacks in hooks

fixes #1688
2022-12-31 03:14:23 -08:00
Jarred Sumner
b86915c808 [internal] Add flag to build bun for editor error reporting 2022-12-30 22:37:28 -08:00
Jarred Sumner
be706fecb4 Make NamesIterator safer 2022-12-30 21:30:23 -08:00
Jarred Sumner
2e94d1a033 Statically link libatomic 2022-12-30 20:27:01 -08:00
Jarred Sumner
fc6c4bbefb Upgrade WebKit 2022-12-30 06:33:22 -08:00
Jarred Sumner
2fc6913085 More assertions 2022-12-30 04:46:52 -08:00
Jarred Sumner
f444e628ca Don't use zig's memcpy function
It is very slow
2022-12-30 04:46:52 -08:00
Jarred Sumner
42be4e52fe Use ArrayBitSet that passes by reference instead of value 2022-12-30 04:46:52 -08:00
Jarred Sumner
385c81d67b Fix crash with bun install <foo> 2022-12-30 04:46:52 -08:00
Jarred SUmner
8b0a7b9fb8 Set CLOXEC 2022-12-29 21:53:04 -08:00
Jarred SUmner
2c5e1cb7d7 Fix broken hardlink installs 2022-12-29 21:46:32 -08:00
Jarred SUmner
7be1e85c6d Fix OOB when deinit'ing dir walker 2022-12-29 21:46:15 -08:00
Jarred Sumner
4cc9a43089 Update globals.d.ts 2022-12-29 06:18:38 -08:00
Jarred Sumner
01c81a5f57 [node:crypto] 50x faster createHash 2022-12-29 06:05:43 -08:00
Jarred Sumner
85eda20587 Introduce Bun.CryptoHasher 2022-12-29 06:05:43 -08:00
Jarred Sumner
940ecd05a8 [node] Implement process.uptime and process.umask 2022-12-29 06:05:43 -08:00
Jarred Sumner
7c8a196c76 [bun-types] Add missing performance.timeOrigin type 2022-12-29 06:05:43 -08:00
Sam Hughes
79a2f81447 Fix devcontainer (tested) (#1680)
zls changes may be imprecise.
2022-12-28 22:53:07 -08:00
Jarred Sumner
0504bb8984 Expose the rest of RIPEMD160 2022-12-28 22:24:37 -08:00
Jarred Sumner
d726a17aca Implement Bun.RIPEMD160
`RIPEMD160` is used by node:crypto.
2022-12-28 22:20:15 -08:00
Jarred Sumner
33e93e6789 Use BoringSSL with patches from Electron 2022-12-28 22:18:16 -08:00
Jarred Sumner
c8da2618ee ✂️ 2022-12-28 19:28:12 -08:00
Jarred Sumner
8e9af05d6a [WebSocket] Allow http: and https: protocols
See https://github.com/whatwg/websockets/pull/37
2022-12-28 18:41:07 -08:00
Jarred Sumner
ba0b5baee4 [WebSocket] Implement headers support
Fixes https://github.com/oven-sh/bun/issues/1676
2022-12-28 18:39:19 -08:00
Jarred Sumner
384a9cda5e Fix devcontainer (probably) 2022-12-28 18:00:03 -08:00
Jarred Sumner
97ec866f85 Fixes https://github.com/oven-sh/bun/issues/1677 2022-12-28 17:00:04 -08:00
Jarred Sumner
ef3c9b7c6d Workaround https://github.com/ziglang/zig/issues/14099 2022-12-28 06:09:14 -08:00
Jarred Sumner
6260aaac5f Add crypto module from browserify 2022-12-28 05:14:40 -08:00
Jarred Sumner
d3dab09690 Statically link atomic 2022-12-28 05:10:16 -08:00
Jarred Sumner
f8f8353108 Always bundle compiler rt 2022-12-28 05:09:51 -08:00
Jarred Sumner
66234d9d57 Move some code up 2022-12-28 04:24:07 -08:00
Jarred Sumner
3d60b870ee Fix ReadableStream.pipeTo 2022-12-28 03:43:39 -08:00
Jarred Sumner
3ae23091c6 Fix platform setting 2022-12-28 02:16:34 -08:00
Alex Lam S.L
092b86321c log object string correctly (#1674)
use `Symbol.toStringTag` of the object or that of its `.prototype`

fixes #1584
2022-12-28 01:21:21 -08:00
Jarred Sumner
da07811427 Fix build issue on latest zig 2022-12-28 01:05:24 -08:00
Jarred Sumner
c0dd284136 Upgrade to latest Zig (#1610)
* @min and @max

* builtins and some trivial ones

* Most of them

* more

* more!

* More Progress

* wip

* Update tagged_pointer.zig

* Update http_client_async.zig

* Most of the iterable dir changes

* alright

* Remove usages of deprecated formatters

* 📷

* fmt

* Update shimmer.zig

* wip

* wip

* wip

* progress

* more

* Latest

* stuck on error

* latest

* workaround stage2

* wip

* Update string_immutable.zig

* wip

* Migrate `Dirent` and `require("fs')` to use JSC<>Zig bindings

* Fix build errors

* Fixup most of the test failures

* Fix `make headers`

* Fix "outside package path" error

* Fixup aligned alloc

* Add missing file

* linux

* More linux fixes

* use latest peechy

* Fix transpiler test failure

* Forgot about these

* Fixup test failure

* Update node-timers.test.ts

* [node:htt] Fix `undefined is not an object` error

Fixes https://github.com/oven-sh/bun/issues/1618

* Update http.exports.js

* Make this test less flaky

* fix hashes

* Fix hex formatting and zls issues

* Download zig version

* Update Dockerfile

* Update Dockerfile

* Update uws

* Update Dockerfile

* Set llvm version

* Update README.md

* Update uws

* Update Dockerfile

* Update io_linux.zig

* Update bun.zig

* Log output

* workaround strange @cInclude error

* Make ffi tests better

* Don't use cImport

* Update c.zig

* Update c-bindings.cpp

* call setOutputDir

* Update Dockerfile

* Use a longer name

* latest

* Update serve.test.ts

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-12-28 00:51:22 -08:00
Alex Lam S.L
504972fa5d [bundler] fix logging verbosity (#1671)
fixes #1666
2022-12-27 16:36:26 -08:00
Alex Lam S.L
f78f423d0b emit 206 Partial Content only for partial response (#1670)
fixes #1668
2022-12-27 16:34:33 -08:00
Alex Lam S.L
c4ca4c70d1 [install] specify auth-type (#1667) 2022-12-26 15:15:58 -08:00
Alex Lam S.L
d94b96d9f4 [install] use specified base URL as default fallback within scopes (#1665) 2022-12-26 00:25:59 -08:00
Alex Lam S.L
74251fbf5e [install] use default URL when only auth token is specified (#1664)
Previously it would default to `http://localhost/` which was inconsistent with the case sans token.

Use official `npm` registry as fallback in both cases.
2022-12-25 21:20:35 -08:00
Dylan Conway
08a738c6c8 always more packages at new depth 2022-12-23 15:21:03 -08:00
Dylan Conway
cc369ad9d0 fix bun pm ls connectors when node_modules is last 2022-12-23 15:13:09 -08:00
Jarred Sumner
a94bba6399 darken 2022-12-23 01:16:12 -08:00
Jarred Sumner
f6a62c01bf Cherry-pick #1638
Closes #1638
2022-12-23 00:59:41 -08:00
Jarred Sumner
979074de2b Prevent running compinit twice 2022-12-23 00:50:19 -08:00
Jarred Sumner
958504296d Disable optimization 2022-12-23 00:48:24 -08:00
Dylan Conway
75a3c25ff8 add node_modules to bin path 2022-12-23 00:04:51 -08:00
Jarred Sumner
3da9c728d6 Make bun pm ls only show top-level by default 2022-12-22 23:38:56 -08:00
Jarred Sumner
85733abe79 npx -> bunx 2022-12-22 23:37:18 -08:00
Jarred Sumner
89625c0cc8 add rome 2022-12-22 19:49:56 -08:00
Alex Lam S.L
2d881b88f9 [install] fix remaining corner cases with dependency resolution (#1649) 2022-12-22 19:42:06 -08:00
Colin McDonnell
9ef33312b1 Update bench (#1648)
Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2022-12-22 19:02:59 -08:00
Dylan Conway
1d58da3cb3 fix finding package bin after install 2022-12-22 18:54:02 -08:00
Dylan Conway
c0dee9adf1 pass callback to super _construct if possible 2022-12-22 16:10:58 -08:00
Dylan Conway
afd66c62ff fix createReadStream hang
highWaterMark test not working correctly but this prevents createReadStream from hanging
2022-12-22 15:58:17 -08:00
Alex Lam S.L
57da449442 [install] avoid dependency conflicts between siblings (#1647)
- consider `peerDependencies` when hoisting packages
2022-12-22 15:19:21 -08:00
Alex Lam S.L
62d1e46b92 fix bun install dependency resolution (#1643)
- avoid conflicts due to hoisted placement when parent and child depends on different versions of the same package
2022-12-22 03:17:33 -08:00
Jarred Sumner
b988a63429 don't log for ctrl + c 2022-12-22 00:25:31 -08:00
Jarred Sumner
e322dfb589 woops 2022-12-21 22:28:59 -08:00
Jarred Sumner
989ac717fc Update launch.json 2022-12-21 14:57:04 -08:00
Jarred Sumner
3ceb2655d8 Add test for stat() 2022-12-21 14:57:04 -08:00
Jarred Sumner
8c3a2ff6cc Fix throw 2022-12-21 14:57:04 -08:00
Jarred Sumner
b9d143c99d Add section about --bun 2022-12-21 14:57:04 -08:00
Jarred Sumner
f40d6bd94d Bun v0.4.0 2022-12-21 14:57:04 -08:00
Ethan Burrell
4f7d06500c fix jest hooks in bun-test (#1639)
* fix(jest) fix broken jest hooks

* add tests
2022-12-21 14:36:44 -08:00
Jarred Sumner
f6bbfa7e40 [bunx] Install symlink with completions
@colinhacks lmk if you have ideas where else it should attempt to isntall:
1) same dir as `bun`
2) $BUN_INSTALL/bin/bunx
3) $HOME/.bun/bin/bunx
4) $HOME/.local/bin/bunx
2022-12-21 00:58:14 -08:00
Jarred Sumner
435fdbfddc [bunx] Make help a little prettier 2022-12-21 00:56:50 -08:00
Jarred Sumner
83602b6834 Refactor some of bun pm 2022-12-20 23:28:11 -08:00
Jarred Sumner
3b808f5ac5 Update ZigGlobalObject.cpp 2022-12-20 22:11:41 -08:00
Jarred Sumner
aaf1624346 typo 2022-12-20 22:07:04 -08:00
Jarred Sumner
a98e0adc7d [web] Support multiple arguments in setTimeout, setInterval, and setImmediate 2022-12-20 22:05:47 -08:00
Alex Lam S.L
06487ef64f add tests for #1633 (#1635)
- `setImmediate(fn, ...args)`
- `setInterval(fn, delay, ...args)`
- `setTimeout(fn, delay, ...args)`
2022-12-20 21:34:25 -08:00
Jarred Sumner
b2fdcad77b [bunx] Improve reliability by checking the "bin" from package.json if necessary 2022-12-20 21:33:34 -08:00
Jarred Sumner
51f9a91736 Fixes https://github.com/oven-sh/bun/issues/1636 2022-12-20 21:09:46 -08:00
Jarred Sumner
d7b73dd4fc Use endsWith 2022-12-19 23:37:53 -08:00
Jarred Sumner
5931e350cd New subcommand: bunx (#1634)
* Implement `bunx`

* copy cleanup

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-12-19 23:05:12 -08:00
Jarred Sumner
e7a14f857d [Bun.write] Slightly better handling for older linux kernels that lack io_uring support
If io_uring is unsupported, we do the writes synchronously even if they're huge
2022-12-19 12:20:59 -08:00
Jarred Sumner
79abd245e2 Regenerate builtins 2022-12-18 08:52:50 -08:00
Alex Lam S.L
2b622162ef bug compatible with stdin.on("readable") (#1626) 2022-12-17 22:37:45 -08:00
Jarred Sumner
5a3e0836b1 Upgrade WebKit 2022-12-17 17:02:56 -08:00
Jarred Sumner
24c4d92c0b Update globals.d.ts 2022-12-17 16:18:01 -08:00
Jarred Sumner
184c56704b Add warning in import.meta.require 2022-12-17 16:15:58 -08:00
Jarred Sumner
feea8824f1 Delete Oniguruma (#1625)
* Update .gitmodules

* Delete oniguruma

* Delete Oniguruma

* Make this test less flaky

* ✂️

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-12-17 15:41:47 -08:00
Jarred Sumner
028e48ed97 Missing from commit 2022-12-17 14:38:54 -08:00
Jarred Sumner
609222d05e Fixes https://github.com/oven-sh/bun/issues/1624
This was disabled anyway
2022-12-17 14:37:37 -08:00
Jarred Sumner
5d91922c5d Regenerate builtins 2022-12-17 12:31:07 -08:00
Jarred Sumner
d66831c4f3 Update transpiler.test.js 2022-12-17 12:26:19 -08:00
Jarred Sumner
7f1caaaa44 Update WebKit 2022-12-17 12:26:19 -08:00
Jarred Sumner
42fc49d413 Add node:assert bench 2022-12-17 12:26:19 -08:00
Jarred Sumner
72970ecd15 Update Makefile 2022-12-17 12:26:19 -08:00
Jarred Sumner
f9b573aa89 [bun-types] Add optional param to Bun.deepEquals 2022-12-17 12:26:19 -08:00
Jarred Sumner
bbf8a17bf5 Use Bun.deepEqual in assert module 2022-12-17 12:26:19 -08:00
Jarred Sumner
8c8accf968 Use Buffer.isBuffer and node:util/types in util module 2022-12-17 12:26:19 -08:00
Jarred Sumner
24be0f4fc5 Implement node:util/types
Fixes #1617
2022-12-17 12:26:19 -08:00
Jarred Sumner
e59c6f642d Add strict option to Bun.deepEquals 2022-12-17 12:26:19 -08:00
Jarred Sumner
1bdb4b2466 [napi] Fix assertion failure when argv is null 2022-12-17 12:26:19 -08:00
Hossein Pourdavar
ca0ab9508f docs(README.md): specify bun-types new path (#1622) 2022-12-17 10:34:35 -08:00
Alex Lam S.L
68fd43313d add tests for process.stdin (#1621) 2022-12-16 20:40:41 -08:00
Ikko Ashimine
b06ca07eee Fix typo in bun.d.ts (#1619)
occured -> occurred
2022-12-16 10:36:07 -08:00
Jarred Sumner
01ed3045cb [napi] Implement napi_create_bigint_words
warning: not tested
2022-12-16 00:40:08 -08:00
Jarred Sumner
6b3be4d821 [js parser] Workaround symbol collision bug
See https://github.com/oven-sh/bun/issues/1616
Fixes https://github.com/oven-sh/bun/issues/1594
2022-12-15 23:42:08 -08:00
Jarred Sumner
e399bceb3c [js parser] Skip appending empty statements 2022-12-15 23:41:40 -08:00
Jarred Sumner
a8fca7d679 [js parser] Make fnBodyContainsUseStrict faster 2022-12-15 23:41:24 -08:00
Jarred Sumner
b249d1b75b [js parser] Ignore calls to import.meta.require that will never happen 2022-12-15 23:39:59 -08:00
Jarred Sumner
3495b7c1f8 [bun-types] Remove outdated comments 2022-12-15 21:48:50 -08:00
Jarred Sumner
3c20290e49 [js parser] Fix bug where const {resolve} = require throws "require is not defined" 2022-12-15 21:48:38 -08:00
Jarred Sumner
0df3485132 [js printer] Fix missing space when printing import aliases with whitespace minification enabled 2022-12-15 21:40:56 -08:00
Jarred Sumner
3ea983578f [node:process] Implement process.argv0, process.execPath
Fixes https://github.com/oven-sh/bun/issues/1599
2022-12-15 17:31:18 -08:00
Jarred Sumner
000a0c9dca Fix missing error when command not found 2022-12-15 17:03:08 -08:00
Jarred Sumner
c1d7ec9564 [node:process] Implement process.abort() 2022-12-15 16:28:47 -08:00
Jarred Sumner
9e909dcae1 [bun run] Include signal code on error 2022-12-15 16:28:47 -08:00
Jarred Sumner
3c1ad4b568 prettier 2022-12-15 16:28:47 -08:00
Jarred Sumner
743531b4ac [bun run] Introduce --bun flag to run in bun instead of node 2022-12-15 16:28:47 -08:00
Jarred Sumner
d1834b5a92 [process.stdin] Support reading from process.stdin in the same tick 2022-12-15 16:28:47 -08:00
Jarred Sumner
e38a3e5d85 [bun run] Use execve instead of posix_spawn when bun no longer needs to run script/bin
When we launch a script & there's nothing left to do, we should replace the process image with the new process instead of keeping the bun process alive while the other script is running.
2022-12-15 16:28:47 -08:00
Derrick Farris
6a1fc20835 fix(stream): make Readable.read work w/o _construct implemented (#1613)
* fix(stream): put Readable._readableState.constructed default in spec (true, not false)

* cleanup(readable): remove unnecessary _construct methods

* test(stream): add test for Readable w/o _construct method
2022-12-15 00:25:19 -08:00
Dylan Conway
95c747f598 undo bad free 2022-12-14 17:50:14 -08:00
Dylan Conway
65302a1db5 remove incorrect connector character 2022-12-14 14:01:03 -08:00
Dylan Conway
c4557e57a1 add bun pm ls for printing lockfiles (#1612)
* list directory structure from lockfile

* dim connectors and versions
2022-12-13 22:47:46 -08:00
Jarred Sumner
f61d9e340d [bun:jsc] Introduce profile function 2022-12-13 20:47:51 -08:00
Jarred Sumner
47a2548cbf Fix crash in startSamplingProfiler 2022-12-13 20:39:49 -08:00
Jarred Sumner
5516adec57 Avoid creating closure 2022-12-13 19:16:51 -08:00
Alex Lam S.L
4e920d73b7 make process.stdin work under TTY (#1611)
- workarounds for #1607 & #1608

fixes #1604
2022-12-13 19:02:20 -08:00
Jarred Sumner
a92258355d Don't call debug streams getter when not in debug 2022-12-13 19:01:25 -08:00
Jarred Sumner
5bbaa7b400 Fix bug where importing a binary file throws a SyntaxError. Instead, return the public path for that file 2022-12-13 18:17:26 -08:00
Jarred Sumner
de8ace9fbe Add a test for importing unknown file types as file loader 2022-12-13 18:17:26 -08:00
Ashcon Partovi
375f69559f Move bun-landing to another repository 2022-12-13 17:25:46 -08:00
Jarred Sumner
7d15a040fd Add missing if 2022-12-13 15:12:14 -08:00
Dylan Conway
3236a99b2d missing id when over 8 packages 2022-12-13 11:37:50 -08:00
Jarred Sumner
18d4cfd4f2 Update build-id 2022-12-13 11:34:29 -08:00
Jarred Sumner
6255fe6a4b [internal] Add bun-debug build 2022-12-13 00:16:01 -08:00
Jarred Sumner
dd9691289f Don't use zls for formatting 2022-12-13 00:15:50 -08:00
Jarred Sumner
e98aae195c fix UB 2022-12-13 00:15:41 -08:00
Jarred Sumner
5741d4f9b4 [crypto] Implement scryptSync
Fixes https://github.com/oven-sh/bun/issues/1228
2022-12-13 00:15:29 -08:00
Jarred Sumner
1bed749d8c some bugs make you feel like a 🤡 2022-12-12 22:39:15 -08:00
Jarred Sumner
bbe66a4367 Add missing space 2022-12-12 19:29:25 -08:00
Jarred Sumner
f649aae36f [crypto] Implement crypto.timingSafeEqual
This uses BoringSSL's memcmp function

Fixes https://github.com/oven-sh/bun/issues/1308
2022-12-12 19:29:25 -08:00
Derrick Farris
9f9db85a94 fix(stream): Fix Readable.pipe() (#1606)
* fix(stream): fix some debug logs that were breaking .pipe

* fix(stream): another debug fix

* test(stream): add test for .pipe
2022-12-12 18:58:28 -08:00
Dylan Conway
bbc2dacd84 markbinding for utf8 length from utf16le 2022-12-12 13:41:55 -08:00
Dylan Conway
0bb9493e47 fix fallback install method 2022-12-12 13:38:12 -08:00
Jarred Sumner
14efd03b48 📷 2022-12-12 00:40:00 -08:00
Jarred Sumner
d5b11be769 [internal] Add helper to make it easier to print whitespace 2022-12-12 00:28:37 -08:00
Jarred Sumner
007133d060 [Transpiler] Implement minifyWhitespace option 2022-12-11 23:28:53 -08:00
Jarred Sumner
6279358cbc [internal] further cleanup for hoistSymbols 2022-12-11 20:25:20 -08:00
Jarred Sumner
ca34a09a4d fixup 2022-12-11 19:29:27 -08:00
Jarred Sumner
b746579863 [internal] Change HashMap implementation for storing symbols 2022-12-11 18:41:54 -08:00
Jarred Sumner
8549134658 [Bun.Transpiler] Introduce inline flag 2022-12-11 16:38:52 -08:00
Jarred Sumner
27e40b0836 Update WebKit
cc @cirospaciari you will need to re-download the precompiled WebKit build from the releases page https://github.com/oven-sh/WebKit/releases/tag/dec11 because there is one small WebKit API change. LMK if you have any trouble with that
2022-12-11 16:14:53 -08:00
Jarred Sumner
b57f51fda2 Add a test for some scopes 2022-12-11 14:18:09 -08:00
Jarred Sumner
fad1742410 [transpiler] Never trim exports 2022-12-11 13:55:31 -08:00
Jarred Sumner
768f4539e8 [transpiler] Fix unbalanced class_name scope
surprised this was never caught sooner
2022-12-11 13:55:15 -08:00
Jarred Sumner
37b16a9007 Add _read 2022-12-11 13:01:41 -08:00
Jarred Sumner
a2d96f9040 Fix checking the UTF-16 length twice 2022-12-11 13:01:24 -08:00
Jarred Sumner
b5519af7e7 cleanup some tests 2022-12-11 12:58:48 -08:00
Jarred Sumner
9d94f148dc Avoid re-visting AST nodes which create scopes 2022-12-11 11:55:06 -08:00
Jarred Sumner
5cf64b07be Fix segfault in release mode when module list is empty 2022-12-10 22:25:33 -08:00
Jarred Sumner
e301fde96d Include isTTY in types 2022-12-10 22:25:19 -08:00
Jarred Sumner
2a7687fff8 Regenerate builtins 2022-12-10 22:24:34 -08:00
Alex Lam S.L
780f7de843 override process.stdin.on() correctly (#1603)
* override `process.stdin.on()` correctly

fixes #1601

* add tests
2022-12-10 21:51:02 -08:00
Jarred Sumner
660eb46b17 [transpiler] Improve constant propagation 2022-12-10 21:36:14 -08:00
Jarred Sumner
c6f3044654 [transpiler] Fix issue with async macros in bun build 2022-12-10 15:30:09 -08:00
Jarred Sumner
b374c67c16 [transpiler] Fix bug with === on statically-known rope strings 2022-12-10 15:29:53 -08:00
Jarred Sumner
ce960f9506 ♻️ 2022-12-10 00:37:32 -08:00
Jarred Sumner
ab49f95ef2 📷 2022-12-10 00:19:19 -08:00
Jarred Sumner
047754d5dd Implement simple version of inlining single-use expressions and statements 2022-12-10 00:19:19 -08:00
YuX
b400dfb386 fix path string (#1597) 2022-12-09 18:17:12 -08:00
Jarred Sumner
88538b7c2c Deprecate very incomplete Solid.js JSX transform
We don't have time to do a good job of this and Bun.plugin makes it possible to use Solid with Bun
2022-12-09 16:41:38 -08:00
Jarred Sumner
79138c4c7c Add "bun" to list 2022-12-09 16:10:33 -08:00
Colin McDonnell
24fbcb8f52 Exclude other ts declaration file extensions (#1596)
Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2022-12-09 14:26:33 -08:00
Jarred Sumner
51e437e8a0 EventEmitter - return original this value for better chainability 2022-12-08 18:27:16 -08:00
Colin McDonnell
e6c2f48895 Add filename completions on naked bun command (#1593)
Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2022-12-08 17:32:25 -08:00
Ashcon Partovi
cf961336d0 Update install issue template 2022-12-08 09:50:03 -08:00
Ashcon Partovi
b44615a916 Improve bug report issue template 2022-12-08 09:49:19 -08:00
Ashcon Partovi
fd740d41e5 Fix issue template for docs 2022-12-08 09:44:55 -08:00
Ashcon Partovi
46a9b124f5 Remove needs-repro label from issue template 2022-12-08 09:33:59 -08:00
Simon He
7c2180194c chore: add eslintcache (#1586) 2022-12-07 22:03:11 -08:00
Jarred Sumner
3150ff49a7 fix dirname on an empty string 2022-12-07 21:41:30 -08:00
Jarred Sumner
2fe5b4da2f 📷 2022-12-07 21:41:30 -08:00
Dylan Conway
0b94ccdf8c disable assignment on user specified assigns 2022-12-07 21:29:32 -08:00
Dylan Conway
845421c44b fix __require linker collision (#1585) 2022-12-07 20:39:55 -08:00
Jarred Sumner
42ea8b2402 [node:events] EventEmitter#on and EventEmitter#off should return the EventEmitter instance 2022-12-07 14:06:18 -08:00
Jarred Sumner
a13e64c286 Update html_rewriter.zig 2022-12-07 00:37:40 -08:00
Derrick Farris
60d0e6b73f fix(stream): Fix Transform class constructor fn (#1583)
* fix(stream): fix ReadableFromWeb class, fix Transform

* test(stream): add tests for .call on stream constructors
2022-12-07 00:18:10 -08:00
Jarred Sumner
a315ee7e03 try 2022-12-06 22:31:26 -08:00
Jarred Sumner
57672eb266 try 2022-12-06 22:29:21 -08:00
Jarred Sumner
511c0ab386 Fix aarch64 2022-12-06 22:17:55 -08:00
Dylan Conway
d9306c2681 first_non_ascii != offset 2022-12-06 21:46:20 -08:00
Dylan Conway
aa17f97d13 fix failing text decoder test 2022-12-06 21:04:38 -08:00
Jarred Sumner
e547efbf4a Don't call getters in console.log 2022-12-06 20:20:08 -08:00
Jarred Sumner
3d243e5e95 Fix node:stream/consumers 2022-12-06 19:56:36 -08:00
Colin McDonnell
5ea8fe8c90 Update types (#1581)
* Fix TS types, improve child_process types

* Add prettier

* Add ArrayBuffer types

* Add namespace Bun, improve types for SharedArrayBuffer, add toStrictEqual

* Improve types, add test files for types

* Update type tests

* Fix typo

* Add stdio

* Stdio types

* Use latest setup-bun

* Update action

* Update action

* Update action

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2022-12-06 18:48:02 -08:00
Dylan Conway
84b2cc1739 fix child process test 2022-12-06 18:15:20 -08:00
Jarred Sumner
15ce587fa2 Update glibc-versions-hack.cpp 2022-12-06 18:10:17 -08:00
Dylan Conway
20a4b72ff4 add base64url switch case 2022-12-06 17:36:24 -08:00
Jarred Sumner
41d778fbfb dlsym pow 2022-12-06 17:21:07 -08:00
Dylan Conway
5f3a6f2bf3 add server scheduleDeinit, ignore logs in test 2022-12-06 17:10:14 -08:00
Jarred Sumner
58185e139a Add check 2022-12-06 17:08:21 -08:00
Dylan Conway
51d69d8c85 fix event emitter cast 2022-12-06 16:25:39 -08:00
Jarred Sumner
4dd2cb33b7 Ban statx 2022-12-06 15:48:41 -08:00
Jarred Sumner
31f025fa02 Add snippet 2022-12-06 14:18:25 -08:00
Jarred Sumner
81317a52ea Fix glibc symbol version issues preventing bun install from being used in older glibc versions (#1580)
* Prevent integer overflow in connectError

* Add missing deepEquals() type to Bun

* fix missing glibc symbols

* Fix missing symbol issues

* Try this

* Update glibc-versions-hack.cpp

* Update glibc-versions-hack.cpp

* Update glibc-versions-hack.cpp

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-12-06 14:14:27 -08:00
Derrick Farris
7d29782896 cleanup/fix(stdio,child_process): bug fixes, refactoring, etc. (#1574)
* fix(stream): add back call to Error.captureStackTrace, remove stray garbage

* cleanup(streams): remove unnecessary checks on Promise.then

* fix(child_process): WrappedFileSink -> NativeWritable for ChildProcess stdio

* cleanup(child_process): remove debug id

* fix(child_process): fix process.nextTick not working in onExit, fail to flush stdio

* refactor(streams): revert stream impls to functions from classes

* fix(child_process): revert runOnNextTick to process.nextTick
2022-12-06 13:26:39 -08:00
Dylan Conway
1aa4cd2f6a 9 characters 2022-12-05 19:42:49 -08:00
Jarred Sumner
c7f411bd88 Use more simdutf 2022-12-05 17:14:29 -08:00
Dylan Conway
60e6a47bb0 fix for double free and undefined this 2022-12-05 16:41:55 -08:00
Jarred Sumner
d9dc15115c linx build issue 2022-12-05 15:23:45 -08:00
Jarred Sumner
159ee8ddfc indexOfLine type 2022-12-05 14:11:23 -08:00
Jarred Sumner
84634117a9 Missing commit 2022-12-05 14:11:05 -08:00
Jarred Sumner
5ea278e1c6 Update README.md 2022-12-05 12:12:35 -08:00
Jarred Sumner
9e29159f44 More null checking for simdutf 2022-12-05 12:06:24 -08:00
Jarred Sumner
e23832d1ce Fix regression 2022-12-05 12:05:16 -08:00
Jarred Sumner
9665d7d216 Add some more text decoder tests 2022-12-05 11:37:04 -08:00
Jarred Sumner
c114956788 Fix crash when passing unexpected type to .writer() 2022-12-05 11:37:04 -08:00
Jarred Sumner
61bf957b99 Introduce console.write(text, or, arrayBufferLike) 2022-12-05 11:36:28 -08:00
Jarred Sumner
2cbac4bbdd Introduce Bun.indexOfLine 2022-12-05 11:36:04 -08:00
Jarred Sumner
320c23543c Fix alignment edgecase 2022-12-05 11:35:50 -08:00
Jarred Sumner
0ea8de4087 Make console an AsyncIterable 2022-12-05 11:35:34 -08:00
Jarred Sumner
7129303347 Update Process.h 2022-12-05 03:52:40 -08:00
Jarred Sumner
8582bc08ec microbench 2022-12-05 03:52:35 -08:00
Jarred Sumner
eeea1707a1 process.stdin exists but doesn't totally work yet 2022-12-05 03:52:20 -08:00
Jarred Sumner
b7e08cb937 [Bun.stdin] Fix handling tty 2022-12-05 03:43:09 -08:00
Jarred Sumner
054413ba1f [internal] Add some logs for string encoding 2022-12-05 03:38:45 -08:00
Jarred Sumner
04dcf180d5 Fix "is not event emitter" errror 2022-12-05 00:44:34 -08:00
Jarred Sumner
79094e6643 more tests for event emitter weirdness 2022-12-05 00:42:02 -08:00
Jarred Sumner
682af03cdc "Fix" monkey-patching EventEmitter prototype 2022-12-05 00:19:23 -08:00
Jarred Sumner
1564f75d06 Update test-test.test.ts 2022-12-04 23:30:25 -08:00
Jarred Sumner
224f980081 [bun:test] Fix crash when test("foo") is called without passing a function 2022-12-04 23:29:21 -08:00
Jarred Sumner
2369bade48 Clean up more cases 2022-12-04 08:47:22 -08:00
Jarred Sumner
10cd5aaa15 Fix race condition in child_process 2022-12-04 08:32:51 -08:00
Jarred Sumner
f4668e45f8 Update ZigGeneratedClasses.cpp 2022-12-04 08:15:45 -08:00
Jarred Sumner
a1e62e6bf9 Handle exception when creating stdout/stderr 2022-12-04 08:15:39 -08:00
Jarred Sumner
e009be1c5d Update ffi.zig 2022-12-04 08:15:07 -08:00
Jarred Sumner
af0bc28c51 Update child_process 2022-12-04 08:15:02 -08:00
Jarred Sumner
bb5450fad0 [breaking] onExit callback in Bun.spawn sets the first property to be the Subprocess object
Sometimes Bun.spawn calls the onExit callback before the Bun.spawn() callback is called.

Instead of delaying a tick, we set the `Subprocess` to be the first argument to the `onExit` callback now.
2022-12-04 08:11:44 -08:00
Jarred Sumner
5bb8c42bdb [Bun.spawn] Introduce Subprocess.prototype.signalCode 2022-12-04 08:09:23 -08:00
Jarred Sumner
69114ac0a9 Fix console.log sometimes incorrectly reporting undefined
cc @Electroid
2022-12-04 08:05:57 -08:00
Jarred Sumner
8830cbc51e [test] Ensure console.log(globalThis) doesn't crash 2022-12-04 06:55:12 -08:00
Jarred Sumner
23c90a76c2 Rename file 2022-12-04 06:54:56 -08:00
Jarred Sumner
714ce7619d [internal] Make string comparisons faster 2022-12-04 06:53:53 -08:00
Jarred Sumner
34b2e9acc2 Fix running zig tests 2022-12-04 05:02:14 -08:00
Jarred Sumner
4c818b9364 Mildly faster startup time 2022-12-04 03:50:22 -08:00
Jarred Sumner
cee33485d0 ✂️ 2022-12-04 03:22:10 -08:00
Jarred Sumner
f052e66df5 Add some basic tests for process.stdout 2022-12-04 02:53:04 -08:00
Jarred Sumner
46e34a3fa9 Re-add missing global 2022-12-04 02:28:25 -08:00
Jarred Sumner
2bcae716d1 Silence incorrect test failure 2022-12-04 02:28:15 -08:00
Jarred Sumner
4281a68a2b content-range is inclusive 2022-12-04 01:24:52 -08:00
Jarred Sumner
ab020b2275 Update README.md 2022-12-04 01:11:34 -08:00
Jarred Sumner
0617896d70 [Bun.serve] Implement Content-Range support with Bun.file() 2022-12-04 00:55:05 -08:00
Jarred Sumner
1c3cb22d1f [may revert later] Coerce Infinity to max int 64, -Infinity & NaN to min int64 2022-12-04 00:53:52 -08:00
Jarred Sumner
275a635ad7 Update .gitignore 2022-12-03 23:57:50 -08:00
Jarred Sumner
35bf039dfb [test] Add a couple tests for subarray toEqual 2022-12-03 23:57:13 -08:00
Jarred Sumner
de9a2b9fe5 [fetch] Fix bug where .arrayBuffer() on an empty Response body returned a Uint8Array instead of an ArrayBuffer 2022-12-03 23:56:40 -08:00
Jarred Sumner
201cbb20e4 Don't invalidate previous file descriptro to avoid tripping assertion 2022-12-03 08:26:53 -08:00
Jarred Sumner
8c51db0879 misc 2022-12-03 08:26:53 -08:00
Jarred Sumner
10b04fbd26 Add missing type 2022-12-03 08:26:53 -08:00
Jarred Sumner
bdc43c1696 process.stdout and process.stderr 2022-12-03 08:26:53 -08:00
Jarred Sumner
bc028168a8 simdutf ascii validation is about 20% faster on arm64 than our zig simd @Vector version 2022-12-03 08:26:53 -08:00
Reed Jones
00f428b627 typo in readme (#1576)
Succesfully => Successfully
2022-12-03 07:35:50 -08:00
Jarred Sumner
d28a4dbb00 Object.defineProperties snippet 2022-12-03 04:26:33 -08:00
Dylan Conway
0a30bf0212 make sure to not use incomplete characters (#1575) 2022-12-03 02:59:17 -08:00
Jarred Sumner
04658776e4 Push failing tests 2022-12-02 23:17:40 -08:00
Dylan Conway
369e9f3fbd add deps for make test command 2022-12-02 22:36:23 -08:00
Jarred Sumner
1b7b37232e Run promise before callback 2022-12-02 22:30:04 -08:00
Jarred Sumner
fe4f39fd17 Add AbortSignal.timeout 2022-12-02 20:48:57 -08:00
Dylan Conway
9cc03cd71a matchers for less than and greater than (#1573)
* toBeGreaterThan with tests

* toBeGreaterThanOrEqual and tests

* toBeLessThan and toBeLessThanOrEqual with tests

* expect types

* switch expressions
2022-12-02 20:35:13 -08:00
Jarred Sumner
d9f9fc975b Propagate reason in AbortSignal and reuse in ReadableStream.pipeTo
Similar to https://github.com/WebKit/WebKit/pull/7013
2022-12-02 20:15:50 -08:00
Jarred Sumner
bdbc0f23e7 Update TransformStream options getters to check for undefined
This is essentially copied from https://github.com/WebKit/WebKit/pull/7021
2022-12-02 20:00:27 -08:00
Jarred Sumner
ba6908aed7 Remove getSetCookie() from types 2022-12-02 19:35:35 -08:00
Jarred Sumner
4e6b905a98 Update test 2022-12-02 19:35:28 -08:00
Jarred Sumner
43f2a8eb85 Add some code I forgot to commit 2022-12-02 19:35:11 -08:00
Jarred Sumner
c72629d88a Make cloning headers object faster 2022-12-02 19:34:43 -08:00
Jarred Sumner
33cf491fea Add a userland way to hide stack frames 2022-12-02 19:33:59 -08:00
Jarred Sumner
2f917f7030 Make constructing headers from an existing headears faster 2022-12-02 19:33:45 -08:00
Jarred Sumner
207282862e Throw if passing a header not named "set-cookie" to getAll 2022-12-02 19:33:36 -08:00
Jarred Sumner
3c054253e1 Remove getSetCookie 2022-12-02 19:33:22 -08:00
Jarred Sumner
2c0fd28e72 [node:event] Add captureRejectionSymbol 2022-12-02 09:05:11 -08:00
Derrick Farris
b8586b33da feat(process): add process.{stdin, stdout, stderr} support (#1495)
* fix(stream): get Duplex working

* feat(process): add stdin,stdout,stderr in a semi-broken state (pipes??)

* test(NodeTestHelpers): fix test names

* test(NodeTestHelpers): add test for createDoneDotAll done called w error

* test(NodeTestHelpers): remove stray console.log

* fix(stream): fix bug in Duplex, Readable

* test(process.stdio): rename test

* fix(process.stdio): change onData listener to onReadable

* refactor(streams): add file-wide debug fn, destructure opts

* fix(child_process): check isCallable on promise

* fix: get stdio streams mostly working (mostly)

* fix(child_process): wait until stream is drained before calling end?

* fix(child_process): change to result?.then

* debug(child_process,streams): add EE id tracking, add shim for stdio after handle is dead

* test(child_process): fix double pipe test, temp fix for ChildProcess.kill() return val

* fix(child_process): remove immediate emit of exit on kill

* debug(streams): add more debug log

* debug(streams): add more debug logs part 2

* feat(streams,fs): add NativeWritable, adapt fs.WriteStream and fs.ReadStream to native
2022-12-02 08:25:13 -08:00
Jarred Sumner
beaf91590a Tests for set-Cookie 2022-12-02 07:44:57 -08:00
Jarred Sumner
d84f79bcc1 [fetch] Implement Headers#getAll and Headers#getSetCookie()
This matches Deno's behavior (get() combines, iterator preserves the order, set and append combine), but implements both the Cloudflare Workers `getAll()` and the potential standard `getSetCookie` function.  The rationale for choosing both is to better support libraries which check for `getAll` and also because `getSetCookie` seems a little confusing (names are hard)

This also makes `.toJSON` and JSON.stringify return an array for `Set-Cookie`
2022-12-02 07:42:44 -08:00
Dylan Conway
917cbc8d5d incorrect name for matcher 2022-12-02 02:30:35 -08:00
Jarred Sumner
074f236994 make the test run faster 2022-12-02 02:17:12 -08:00
Jarred Sumner
03eb000ad6 delete these fixtures which are no longer relevant 2022-12-02 02:16:59 -08:00
Jarred Sumner
9a184c8279 Fix incorrect StringDecoder export test 2022-12-02 01:56:55 -08:00
Jarred Sumner
b53a332809 Fix running tests in older versions of bun 2022-12-02 01:56:41 -08:00
Jarred Sumner
a09b515a62 Skip flaky test 2022-12-02 01:56:25 -08:00
Jarred Sumner
8eddfc61a8 Add generic way to block on a promise 2022-12-02 01:56:12 -08:00
Jarred Sumner
37525db5cf Faster test 2022-12-02 00:25:38 -08:00
Jarred Sumner
e9eb88355b Close stdin earlier 2022-12-02 00:25:30 -08:00
Jarred Sumner
9f5564b4bc Add file descriptor leak test 2022-12-02 00:25:08 -08:00
Jarred Sumner
931ba9ad49 Add file descriptor leak test 2022-12-02 00:23:29 -08:00
Jarred Sumner
851b8acb76 Fix incorrect panic in spawnSync 2022-12-02 00:05:33 -08:00
Jarred Sumner
7a158e68ae Fix crash when macros return a Promise 2022-12-01 23:46:18 -08:00
Jarred Sumner
cb36b4d1ab Fix double free in .json() and optimize UTF16 -> json slightly 2022-12-01 23:43:49 -08:00
Jarred Sumner
2621fbf206 Remove file blob caching 2022-12-01 23:42:57 -08:00
Jarred Sumner
d7ab2c04ec Faster test 2022-12-01 23:42:13 -08:00
Jarred Sumner
f84f77d1ed [streams] Handle empty state 2022-12-01 23:28:42 -08:00
Jarred Sumner
425f4b0de1 [fetch] Add test that invalid json rejects promise 2022-12-01 23:27:53 -08:00
Jarred Sumner
7b70ed52fa [bun bun] Fix incorrect package.hash 2022-12-01 21:37:25 -08:00
Jarred Sumner
8cf1707cd3 [bun bun] Fix crash in canary 2022-12-01 21:37:09 -08:00
Jarred Sumner
9f4d7690ac [fetch] Treat 302 like 303 2022-12-01 21:15:34 -08:00
Jarred Sumner
5854d39525 [fetch] Implement redirect: "manual" 2022-12-01 21:09:43 -08:00
Jarred Sumner
b4e6ca0462 ComptimeStringMap is faster than ExactSizeMatcher 2022-12-01 20:51:35 -08:00
Jarred Sumner
f408749182 Fix timers keeping process alive unnecessarily 2022-12-01 20:46:54 -08:00
Dylan Conway
92da72beb0 bun test toStrictEqual (#1568)
* toStrictEqual and bug fix in deepEqual

* rebase Remove some dead bindings code

* remove debugging test

* canGetIndexQuickly for array holes

* isStrict template

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-12-01 19:36:47 -08:00
Jarred Sumner
a896d6c46c [bun:sqlite] ~15% perf improvement to all() and get() 2022-12-01 19:34:02 -08:00
Jarred Sumner
4eed310a45 3x faster TextEncoder.prototype.encodeInto
thanks to @Constellation for the tip
2022-12-01 18:51:16 -08:00
Jarred Sumner
1daa61a45f Add test for DOMJIT call version of encodeInto 2022-12-01 18:40:56 -08:00
Jarred Sumner
03490afdb3 Fix crash in test runner with gc mode 2022-12-01 18:40:41 -08:00
Jarred Sumner
e1e5f8c43b Include size of ArrayBuffer and others in GC timer scheduling 2022-12-01 02:36:51 -08:00
Jarred Sumner
b655d09387 Incorrect readme 2022-12-01 02:36:33 -08:00
Jarred Sumner
e0503faec7 Increase sensitivity of GC timers 2022-12-01 02:36:18 -08:00
Jarred Sumner
bddf523ac9 Reduce memory usage in Bun.serve() by up to 3x (#1569)
* Update WebKit

* Use 5x less memory in Bun.serve()

* Update Dockerfile.devcontainer

* Update async-overhead.mjs

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-12-01 02:34:15 -08:00
Dylan Conway
1506a25198 formatting and remove comment 2022-11-30 16:40:54 -08:00
Dylan Conway
1abc89e391 fix slow regex tests 2022-11-30 16:36:03 -08:00
Jarred Sumner
3cb462a3e6 Fix console.log regression with emoji 2022-11-30 07:28:48 -08:00
Jarred Sumner
f8b87e3ee2 Redirect imports to "readable-stream" -> "node:stream" 2022-11-30 07:21:27 -08:00
Jarred Sumner
e6f055e9fb Accidentally deleted prompt as a result of the process.env changes 2022-11-30 06:16:59 -08:00
Jarred Sumner
f999bdca26 ✂️ 2022-11-29 23:56:52 -08:00
Jarred Sumner
e75ce84c37 Remove some dead bindings code 2022-11-29 23:49:11 -08:00
Jarred Sumner
b631ea7d72 import everything from "bun" where possible 2022-11-29 02:42:56 -08:00
Jarred Sumner
7b59d9d97c Make .toInt64 faster 2022-11-28 23:48:04 -08:00
Jarred Sumner
d28247573c Handle when the process already exited immediately 2022-11-28 23:48:04 -08:00
Dylan Conway
56884b5f1d toHaveProperty and tests (#1558)
* toHaveProperty and tests

* emoji tests
2022-11-28 23:15:12 -08:00
Jarred Sumner
887496bcf9 Fix failing spawn() and spawnSync() tests
cc @ThatOneBro
2022-11-28 23:00:22 -08:00
Jarred Sumner
da43761032 Update README.md 2022-11-28 19:18:17 -08:00
Jarred Sumner
4efce63dad Update README.md 2022-11-28 19:14:45 -08:00
Jarred Sumner
2a33bd2cc5 Add small section about profiling bun 2022-11-28 19:11:09 -08:00
Jarred Sumner
b337e36da1 Fix hanging in FIFO streams 2022-11-28 18:31:12 -08:00
Jarred Sumner
77d0828179 [internal] Add debug timer 2022-11-28 18:30:49 -08:00
Jarred Sumner
eccd854dbc Ensure we report errors in controller.close 2022-11-28 18:30:28 -08:00
Jarred Sumner
a64f2f5466 Update JSEnvironmentVariableMap.cpp 2022-11-28 16:57:48 -08:00
Jarred Sumner
d3cd753d4d Allow overriding node:fs 2022-11-28 16:23:41 -08:00
Jarred Sumner
f423791e19 Add test for process 2022-11-28 15:59:58 -08:00
Jarred Sumner
a6cadce6f6 Fix process.env and Bun.env object spread
Fixes https://github.com/oven-sh/bun/issues/1512
2022-11-28 15:55:02 -08:00
Jarred Sumner
51d0c3b79f Fix console.log(process.env) 2022-11-27 23:01:09 -08:00
Jarred Sumner
7672ee95af Add google fixture 2022-11-27 22:41:22 -08:00
Jarred Sumner
512acf072e Add missing v
Fixes https://github.com/oven-sh/bun/issues/1554
2022-11-27 22:41:16 -08:00
Jarred Sumner
4ee11d922c Cleanup some of the encoding code 2022-11-27 22:09:56 -08:00
Jarred Sumner
885049831f Fix handling delete process.env.foo 2022-11-27 22:09:23 -08:00
Jarred Sumner
e5106d320c Don't make toJSON enumerable in process.env 2022-11-27 22:09:07 -08:00
Jarred Sumner
ede2a494bc Fix UTF16 bug in await fetch().text() 2022-11-27 22:08:30 -08:00
Jarred Sumner
48df99c496 ✂️ dead code 2022-11-27 22:06:35 -08:00
Jarred Sumner
ed15259623 Fix Buffer.toString("latin1") and make Buffer.toString("utf16le") faster
Fixes #455
Fixes #1016
2022-11-27 20:21:41 -08:00
Jarred Sumner
4272038743 Fix failing buffer tests 2022-11-27 20:04:57 -08:00
Jarred Sumner
002f4ecc9e Fix crash in console.log 2022-11-27 19:37:14 -08:00
Jarred Sumner
495f25501f Increase the max prototype count 2022-11-27 09:32:40 -08:00
Jarred Sumner
0992c3867d Update bindings.cpp 2022-11-27 08:45:40 -08:00
Jarred Sumner
58a78ef8b7 [console.log] Remove extra indent 2022-11-27 08:41:08 -08:00
Jarred Sumner
740027975b Handle more cases with printing objects 2022-11-27 08:39:10 -08:00
Jarred Sumner
706406af48 remove leak 2022-11-27 07:58:10 -08:00
Jarred Sumner
39493e5d94 Add microbenchmark for console log 2022-11-27 07:40:10 -08:00
Jarred Sumner
a249c79983 Add tests for latin1 supplemental chars 2022-11-27 07:29:59 -08:00
Jarred Sumner
6459288c85 fix hanging test 2022-11-27 07:29:46 -08:00
Jarred Sumner
4726b7e227 don't start NetworkThread unless necessary 2022-11-27 07:29:40 -08:00
Jarred Sumner
358f388a46 Fix make headers 2022-11-27 07:29:07 -08:00
Jarred Sumner
4f35d0537b fix extra indent 2022-11-27 07:28:44 -08:00
Jarred Sumner
1d9c982488 [console.log] Fix printing latin1 supplement characters at runtime
Fixes https://github.com/oven-sh/bun/issues/1031#issuecomment-1236092120
2022-11-27 07:28:30 -08:00
Jarred Sumner
5e6e8ece4e [console.log] Improve Object formatting and error handling 2022-11-27 07:27:21 -08:00
Jarred Sumner
964c4037de [console.log] log Proxy objects 2022-11-27 07:26:16 -08:00
Jarred Sumner
1bc76511ec [console.log] Treat GlobalObject like Object 2022-11-27 07:25:55 -08:00
Jarred Sumner
35509126a6 [console.log] Treat ArrayBuffer like Uint8Array 2022-11-27 07:25:41 -08:00
Jarred Sumner
8765092591 [console.log] Fix logging Symbol values 2022-11-27 07:25:25 -08:00
Jarred Sumner
46678c46ee Now that utf16 is fast we can just count the length instead of re-allocating 2022-11-27 07:24:43 -08:00
Jarred Sumner
e8d948b9d9 Remove extra indent 2022-11-27 06:18:05 -08:00
Jarred Sumner
f891d1df50 Fix strangeness with Bun.env keys 2022-11-27 06:17:59 -08:00
Jarred Sumner
faad250559 Fix crash in Headers.prototype.count 2022-11-27 06:17:32 -08:00
Jarred Sumner
74e87b5a8a Fix crash in OnigurumaRegExp getters 2022-11-27 06:16:52 -08:00
Jarred Sumner
819a63e3ec Fix build issue 2022-11-26 22:14:29 -08:00
Jarred Sumner
c65c320b09 [bun:sqlite] Fix bug with latin1 supplemental characters
Fixes https://github.com/oven-sh/bun/issues/1553
2022-11-26 21:42:32 -08:00
Jarred Sumner
a53ed1bde1 prettier? 2022-11-26 21:29:53 -08:00
Jarred Sumner
d2190ea6f3 Update mimalloc 2022-11-26 21:20:38 -08:00
Jarred Sumner
b7850565f4 Update string_immutable.zig 2022-11-26 21:20:33 -08:00
Jarred Sumner
10996a797a Faster UTF16 -> UTF8 and UTF8 -> UTF16 (#1552)
* Fix freezing test

* Add SIMDUTF

* More micro bench snippets

* Update .gitattributes

* Update .gitattributes

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-11-26 21:04:38 -08:00
Jarred Sumner
949d715a14 Make HTTP status text more consistent with other HTTP servers 2022-11-26 18:03:20 -08:00
Jarred Sumner
90388aa7ea Add a console.log write bench 2022-11-26 06:27:49 -08:00
Jarred Sumner
1671977af7 Fix 0 2022-11-26 05:54:28 -08:00
Jarred Sumner
8aec181f16 Slightly improve when printing lots of numbers 2022-11-26 05:22:12 -08:00
Jarred Sumner
37753e9787 Make console.log prettier 2022-11-26 04:50:55 -08:00
Jarred Sumner
8519ff02e6 Prevent closing stdout / stderr 2022-11-25 22:55:35 -08:00
Jarred SUmner
397cb6600b Update test 2022-11-25 22:53:21 -08:00
Jarred SUmner
bef469ea55 Fix linux build issue 2022-11-25 22:53:07 -08:00
Jarred SUmner
ac7ad4d5c6 Fix double free 2022-11-25 22:52:32 -08:00
Jarred Sumner
0b27a26edb typo 2022-11-25 22:10:42 -08:00
Jarred Sumner
e12dc23c62 Use ccache for dependencies too 2022-11-25 21:14:57 -08:00
Jarred Sumner
7fec8a96ab Update zlib 2022-11-25 21:08:24 -08:00
Jarred Sumner
14b063d802 Simplify 2022-11-25 20:27:59 -08:00
Jarred Sumner
99fa95b954 Add some missing finalizers 2022-11-25 20:26:34 -08:00
Jarred Sumner
f27fdf932b Always watch 2022-11-25 20:26:18 -08:00
Jarred Sumner
d0dbafb32f Fix Subprocess.prototype.killed 2022-11-25 19:39:40 -08:00
Jarred Sumner
b5bd98c0ef Another test for macros 2022-11-25 07:04:08 -08:00
Jarred Sumner
e851e5fddb Fix macros that return a Promise 2022-11-25 06:48:02 -08:00
Jarred Sumner
1aff60d2ba More CCACHE 2022-11-25 06:24:34 -08:00
Jarred Sumner
d5c81b7423 Report Infinity when for non-regular files with a size of 0 2022-11-25 03:36:42 -08:00
Jarred Sumner
ddb6eced34 Update tests for behavior change 2022-11-25 03:04:12 -08:00
Jarred Sumner
5c3c50372b [internal] Log stat calls 2022-11-25 03:03:53 -08:00
Jarred Sumner
af0acaff37 [internal] Remove all usages of suspend and resume 2022-11-25 03:03:42 -08:00
Jarred Sumner
9090f06612 Fix memory leak with .json() 2022-11-25 03:02:56 -08:00
Jarred Sumner
7a193ed243 [behavior change] Bun.file().size now always reports a number 2022-11-25 03:02:45 -08:00
Jarred Sumner
c168c70e60 Improve test coverage for Bun.file 2022-11-25 03:01:37 -08:00
Jarred Sumner
557c2e97d7 Fix crash that sometimes occurred when freeing file data 2022-11-25 02:53:08 -08:00
Jarred Sumner
64871b2bfb Fix spurious assertion 2022-11-25 00:14:01 -08:00
Jarred Sumner
ce2cdb44e1 Use new enum for checking writable 2022-11-25 00:11:02 -08:00
Jarred Sumner
348ad87013 Enable Resizable ArrayBuffer proposal
https://github.com/tc39/proposal-resizablearraybuffer
2022-11-25 00:10:47 -08:00
Jarred Sumner
0e900c8ca9 Upgrade WebKit 2022-11-25 00:10:31 -08:00
Jarred Sumner
61673fa705 Add recv 2022-11-25 00:08:48 -08:00
Jarred Sumner
d1a4f4fd69 Introduce FileSink.ref() and FileSink.unref() 2022-11-25 00:08:36 -08:00
Jarred Sumner
0b915fed03 [streams] Always call start 2022-11-25 00:05:33 -08:00
Jarred Sumner
7b23cb5cd7 Fix reading FIFO files 2022-11-25 00:05:14 -08:00
Jarred Sumner
04328c163b [safety] Add a generation_number to FilePoll on macOS to check for use-after-free 2022-11-25 00:04:12 -08:00
Jarred Sumner
5a95fae533 Improve SIGPIPE handling 2022-11-24 18:57:58 -08:00
Jarred Sumner
47f0e14477 Use is_in_heap_region instead of _check_owned 2022-11-24 18:57:40 -08:00
Jarred Sumner
0ef25c65ec Add missing keys 2022-11-24 04:58:37 -08:00
Jarred Sumner
b0c89baac7 Fix crash when console.log() / console.error() fails to write to stdout/stdin 2022-11-24 04:26:04 -08:00
Jarred Sumner
7bc20c994c Fix missing sigpipe handler 2022-11-24 04:25:27 -08:00
Jarred Sumner
033b8936c9 Update streams.zig 2022-11-24 04:03:04 -08:00
Jarred Sumner
6336d01743 Add extra check 2022-11-24 03:55:04 -08:00
Jarred Sumner
cc062855af Add ccache to more steps 2022-11-24 03:54:54 -08:00
Jarred Sumner
d68f44d604 Don't pre-maturely close the input buffer 2022-11-24 03:54:32 -08:00
Jarred Sumner
ffacc1d02d Workaround strange crash 2022-11-24 03:53:26 -08:00
Jarred Sumner
1be13fa192 Update streams.zig 2022-11-24 02:41:14 -08:00
Jarred Sumner
46094189f4 update 2022-11-24 02:35:52 -08:00
Jarred Sumner
0c8fe888b9 Update streams.zig 2022-11-24 02:34:05 -08:00
Jarred Sumner
57fcd882fc Update streams.zig 2022-11-24 02:26:28 -08:00
Jarred Sumner
b2e48477db Update Dockerfile 2022-11-24 02:17:58 -08:00
Jarred Sumner
e4805d0895 Update bun-linux-build.yml 2022-11-24 02:10:42 -08:00
Jarred Sumner
e9eaab727b Update bun-linux-build.yml 2022-11-24 02:10:11 -08:00
Jarred Sumner
2ded9af4f7 Update bun-linux-build.yml 2022-11-24 02:07:55 -08:00
Jarred Sumner
2aa304a29d bump 2022-11-24 02:03:09 -08:00
Jarred Sumner
3419d3bc02 Update bun-mac-aarch64.yml 2022-11-24 01:57:24 -08:00
Jarred Sumner
a6644eac24 missing WORKDIR 2022-11-24 01:53:59 -08:00
Jarred Sumner
6c23035769 Attempt to make builds faster 2022-11-24 01:47:43 -08:00
Jarred Sumner
4a698ed52c [FileSystemRouter] Start to add types 2022-11-24 00:05:57 -08:00
Jarred Sumner
e1fcc810cb Remove extra newlines 2022-11-23 23:07:06 -08:00
Jarred Sumner
6bfb65b312 Add expect().toEqual() bench 2022-11-23 23:03:40 -08:00
Dylan Conway
dc330701d2 Bun.deepEquals and expect().toEqual() (#1548)
* all of deepEquals

* remove comment, tests, move inline function
2022-11-23 22:50:49 -08:00
Jarred Sumner
d434370500 uncomment 2022-11-23 21:46:56 -08:00
Jarred Sumner
9806c301dd Fix build error 2022-11-23 21:46:46 -08:00
Jarred Sumner
73416ebb62 nohang flag 2022-11-23 21:46:39 -08:00
Jarred Sumner
bddf484c2c Close the streams more 2022-11-23 21:31:38 -08:00
Jarred Sumner
21531f1e80 Linux build issue 2022-11-23 07:42:56 -08:00
Jarred Sumner
ac36ea51cf possibly more reliable Bun.spawn (#1547)
* wip

* wip

* Fix bug with stdin

* zig fmt

* seems to work!

* Update streams.test.js

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-11-23 07:14:33 -08:00
Jarred Sumner
ae3fcb5bd8 [FileSystemRouter] Fix reload() 2022-11-22 21:41:34 -08:00
Jarred Sumner
5767ad3fc5 Remove some dead code 2022-11-22 21:34:37 -08:00
Jarred Sumner
4f41c3fb40 [FileSystemRouter] Fix failing tests 2022-11-22 21:25:26 -08:00
Jarred Sumner
b249ed7257 [FileSystemRouter] Add more tests 2022-11-22 20:55:09 -08:00
Jarred Sumner
2b4dcc8c81 [FileSystemRouter] base_dir, Request, Response 2022-11-22 04:00:55 -08:00
Jarred Sumner
15a5aa1a68 Update filesystem_router.test.ts 2022-11-22 02:25:58 -08:00
Jarred Sumner
3cf229a898 Update launch.json 2022-11-22 02:13:25 -08:00
Jarred Sumner
e94172255d Support no constructor in class generator script 2022-11-22 02:13:19 -08:00
Jarred Sumner
d21aee5143 Introduce Bun.FileSystemRouter API 2022-11-22 02:13:03 -08:00
Jarred Sumner
65a56c2560 clone in putRecord 2022-11-22 02:09:57 -08:00
Jarred Sumner
1bd71f2f44 Handle when package version is missing 2022-11-21 18:34:18 -08:00
Jarred Sumner
fe33073f2e Use const ptr 2022-11-21 18:33:55 -08:00
Jarred Sumner
14d52897ad Update README.md 2022-11-21 17:49:07 -08:00
Jarred Sumner
ca434fba6e make it slightly clearer 2022-11-21 17:37:12 -08:00
Jarred Sumner
55f8029dc2 Add test for wildcard import without an extension 2022-11-21 17:31:42 -08:00
João Paquim
a3dc33c133 Wildcard imports map (#1483)
* Log extra info on missing file extension

* Improve error messages for missing /index.js on import

* Remove unnecessary function parameter path

* Add loadPackageImports function to match esbuild

* Add support for pattern trailer import syntax

* Fix review comments
2022-11-21 17:31:02 -08:00
Jarred Sumner
a274ddba3a [bun:test] Add test for returning MAX_SAFE_INTEGER 2022-11-21 17:02:43 -08:00
Dylan Conway
8e36485a76 fix oniguruma regex character properties (#1528)
* fix for character properties

* cleanup tests

* cleanup comments

* i - 2 >= 0
2022-11-21 16:52:00 -08:00
Dylan Conway
5f2e74bbcc specific error for invalid flag, correct position' (#1537)
'
2022-11-21 16:51:34 -08:00
Jarred Sumner
ce6fc8609b [bun:sqlite] fix truncating to int32 in results (now truncates to int52)
TODO: bigint
2022-11-21 16:46:45 -08:00
Jarred Sumner
a251669fa1 Make it yellow 2022-11-20 17:58:13 -08:00
Jarred Sumner
4f6636b3ca Update jest.zig 2022-11-20 16:48:09 -08:00
Jarred Sumner
28a3093d48 Print a count 2022-11-20 16:48:02 -08:00
Jarred Sumner
fe0506b88e Bump! 2022-11-20 16:31:11 -08:00
Jarred Sumner
e78f891acd [bun:test] Fix bug with returning a non-promise object in a test or it function 2022-11-20 14:35:48 -08:00
Jarred Sumner
948fdfe482 Fix spurious rejected promise handler calls 2022-11-20 14:33:57 -08:00
Jarred Sumner
757d19c2f7 Assert count 2022-11-20 07:12:01 -08:00
Jarred Sumner
a4b67ccbff fix protocol relative urls again 2022-11-20 07:03:50 -08:00
Jarred Sumner
1fca6becd3 Enable previously failing GC tests 2022-11-20 07:03:11 -08:00
Jarred Sumner
6965b5c192 mild clean up 2022-11-20 07:02:53 -08:00
Jarred Sumner
dfa62b660d [internal] Implement visitAdditionalChildren 2022-11-20 07:02:14 -08:00
Jarred Sumner
5ff2cd3418 [streams] Fix memory leak affecting React SSR and more 2022-11-20 06:58:29 -08:00
Jarred Sumner
f56eec6fa3 run clang-format on JSSink 2022-11-20 06:56:05 -08:00
Jarred Sumner
65330a32cc [jsx] Disable jsxs 2022-11-20 04:55:36 -08:00
Jarred Sumner
003237b086 Typo 2022-11-20 01:45:57 -08:00
Jarred Sumner
70f89b1bfc Add another test 2022-11-20 01:44:27 -08:00
Jarred Sumner
4f5f01a748 Fix flaky test 2022-11-20 01:44:18 -08:00
Jarred Sumner
e41d7a0bd5 [fetch] Add optimization for chunked encoding 2022-11-20 01:43:40 -08:00
Jarred Sumner
b745ae2667 [TCP] Make Socket more careful about GC 2022-11-20 00:58:46 -08:00
Jarred Sumner
2f1e9b2eb8 [streams] Fix exception in WritableStream
cc @Electroid
2022-11-19 23:37:52 -08:00
Jarred Sumner
c68b11e8cb [streams] Fix exception in streams with 1 item that sometimes occurred 2022-11-19 23:05:03 -08:00
Jarred Sumner
16d20bde09 Set aggression level in tests 2022-11-19 22:35:26 -08:00
Jarred Sumner
bea44d948e Fix freezing test due to calling GC 36,000 times 2022-11-19 22:35:16 -08:00
Jarred Sumner
b230e7a73a [fetch] Fix sporadic data corruption bug in HTTP client and add fast path
- This removes memory pooling from the HTTP client which sometimes caused invalid memory to be written to the response body.
- This adds a fast path for small HTTP/HTTPS responses that makes it a single memory allocation for the response body, instead of copying & allocating a temporary buffer

cc @Electroid
2022-11-19 22:34:57 -08:00
Jarred Sumner
e024116b77 Add a couple more tests for redirects 2022-11-19 22:23:45 -08:00
Jarred Sumner
79b6d4734a [internal] Add a function for appending without growing extra data 2022-11-19 22:23:20 -08:00
Jarred Sumner
dc26181da4 Add a log 2022-11-19 22:22:04 -08:00
Jarred Sumner
0603991beb Make hidden mimalloc dump report process-wide stats instead of thread 2022-11-19 22:21:58 -08:00
Jarred Sumner
17fa4211ac Introduce Bun.unsafe.gcAggressionLevel API 2022-11-19 22:21:35 -08:00
Jarred Sumner
81a1d8f589 [internal] Add assertion for freeing global strings 2022-11-19 22:15:20 -08:00
Jarred Sumner
055f1e9639 [napi] Fix missing instance data finalizer 2022-11-19 22:14:47 -08:00
Jarred Sumner
cac11ee826 [fetch] Fix bug with redirecting to a protocol-relative URL 2022-11-19 22:14:10 -08:00
Jarred Sumner
f8d9a8be87 [fetch] Fix bug with redirects losing the port number 2022-11-19 22:13:30 -08:00
Jarred Sumner
9c601542d0 Update to Mimalloc v2.0.7 2022-11-19 21:37:31 -08:00
Jarred Sumner
7c7769a7c7 Fix GC crash when handling rejected promises uncovered via BUN_GARBAGE_COLLECTOR_LEVEL 2022-11-19 04:59:38 -08:00
Jarred Sumner
17e8181b4e Fix GC crash in Bun.file(string).text(), Bun.file(string).arrayBuffer(), Bun.file(string).json() uncovered via BUN_GARBAGE_COLLECTOR_LEVEL 2022-11-19 04:59:17 -08:00
Jarred Sumner
ee939f7a6d Fix GC crash in Transpiler found via BUN_GARBAGE_COLLECTOR_LEVEL 2022-11-19 04:58:39 -08:00
Jarred Sumner
6cc89eff2c [internal] Introduce JSPromise.Strong 2022-11-19 04:57:59 -08:00
Jarred Sumner
d6d04cab24 Fix GC crash with WebSocket uncovered thx to BUN_GARBAGE_COLLECTOR_LEVEL 2022-11-19 04:57:32 -08:00
Jarred Sumner
bb95f90a62 Introduce BUN_GARBAGE_COLLECTOR_LEVEL debug environment variable 2022-11-19 04:56:46 -08:00
Jarred Sumner
1806322554 Fix failing test 2022-11-19 04:16:31 -08:00
Jarred Sumner
38b5a85d8a Fix a GC issue with Bun.spawn
The `Subprocess` object stays alive until the process exits, even if it's never referenced
2022-11-19 01:25:15 -08:00
Jarred Sumner
68b55cd855 Implement a singleton version of napi_get_instance_data and napi_set_instance_data
Still need to figure out how to do this without adding a layer of indirection to the global object as exposed to NAPI Addons

This code is not tested
2022-11-19 01:18:58 -08:00
Dylan Conway
43b4e1b67b bun test matchers and tests (#1526)
* ignore webkit for cherry-pick

* toContain and toBeTruthy

* toBe null, undefined, falsy, toHaveProperty, .not

* markBindings

* remove toHaveProperty, undo ignore webkit, more tests

* undo ignore webkit

* remove bad tests

* check if length property exists for toHaveLength()

* fix call signature

* handle argument that is not an integer

* getLengthOfArray returns u64

* switch to truncate

* toHaveLength() edge cases

* add toBooleanSlow()

* infinity, nan, negative
2022-11-18 23:03:39 -08:00
Jarred Sumner
f3fb712051 Fix crash in process.env.FOO = bar that happened sometimes 2022-11-18 03:47:10 -08:00
Jarred Sumner
f6779193c0 console.timeLog() but no extra arguments yet 2022-11-16 05:16:30 -08:00
Jarred Sumner
29f72efac3 Mark some more commonjs modules 2022-11-16 05:15:56 -08:00
Jarred Sumner
4985a44fe2 Remove incorrect assertion 2022-11-16 05:13:17 -08:00
Jarred Sumner
6a9bc6f6c2 Another test 2022-11-16 04:58:51 -08:00
Jarred Sumner
bf6b174233 Make node:http.createServer work better 2022-11-16 04:42:33 -08:00
Jarred Sumner
5de98f23bb Fix another assertion failure 2022-11-15 23:23:36 -08:00
Jarred Sumner
1d02104c51 Fix assertion failure 2022-11-15 23:23:23 -08:00
Jarred Sumner
4f22c39651 Handle trailing slash 2022-11-15 22:10:09 -08:00
Jarred Sumner
6c01a1191f Fixes #1390 2022-11-15 21:58:31 -08:00
Jarred Sumner
b95f7d5bbc Fixes #1403
cc @Electroid this should fix the fly.io api issue too
2022-11-15 21:40:54 -08:00
Jarred Sumner
c32013dbba Never resize on close 2022-11-15 21:37:28 -08:00
Jarred Sumner
6cdb7e77dd Handle blocking initial read 2022-11-15 21:01:08 -08:00
Jarred Sumner
0e7ed4c667 Prevent blocking write() 2022-11-15 20:57:21 -08:00
Jarred Sumner
3b802c9a13 Add non-standard headers API types
cc @colinhacks @Electroid
2022-11-15 18:32:57 -08:00
Jarred Sumner
996e5dd235 Add test for non-standard Headers API additions 2022-11-15 18:31:22 -08:00
Dylan Conway
025749027b add generated getter/setter type with thisValue (#1513) 2022-11-15 17:47:38 -08:00
Jarred Sumner
44babb9ce5 Update ZigGlobalObject.cpp 2022-11-15 00:12:34 -08:00
Jarred Sumner
a63fe2be24 Add a test with decently large headers 2022-11-15 00:12:34 -08:00
Jarred Sumner
bf75f61ddf Update test types a little
cc @colinhacks

`test` is an alias of `it`

`done` accepts an `error` object
2022-11-15 00:12:34 -08:00
Jarred Sumner
1b608fcc8a Add missing type 2022-11-15 00:12:34 -08:00
Dylan Conway
c4cf38601b switch default encoding order (#1510) 2022-11-14 22:00:45 -08:00
Jarred Sumner
25fc19e7c6 Fix spawn macOS issue 2022-11-14 21:52:04 -08:00
Jarred Sumner
9c3b2f7ad6 Fix crash in web crypto. caused by refptr 2022-11-14 19:55:48 -08:00
Jarred Sumner
436b8e1461 Fix crashiness with process.env
This also makes it a lot slower
2022-11-14 17:53:15 -08:00
Jarred Sumner
272e71fec2 Fix string encoding issue in JSC C API usages 2022-11-14 17:53:15 -08:00
Jarred Sumner
4ba97c7687 Prevent double-frees in log msgs 2022-11-14 17:53:15 -08:00
Jarred SUmner
3df5843503 Fix build error 2022-11-14 04:14:23 -08:00
Jarred SUmner
20eff9f6d2 Bugfixes and perf improvements to child_process 2022-11-14 04:08:36 -08:00
Jarred Sumner
69eedb4c92 use write$NOCANCEL, more logging 2022-11-13 21:57:14 -08:00
Jarred Sumner
4a8bbc2216 Add an e2e test 2022-11-13 20:51:27 -08:00
Jarred Sumner
92b766095d Add missing rmdir export 2022-11-13 20:09:37 -08:00
Jarred Sumner
b18e4064a2 Make node streams faster (#1502)
* Make node streams faster

* Fix for macOS, improve performance, handle ref and unref

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-11-13 19:14:44 -08:00
Jarred Sumner
58b67347e6 Fix incorrect exit status message 2022-11-13 02:38:54 -08:00
Jarred Sumner
1a0fb4cf83 Fix syntax error 2022-11-12 23:43:24 -08:00
Jarred SUmner
6393e1e709 Set linker script to Bun 0.2 2022-11-12 20:40:04 -08:00
Jarred SUmner
a78b6f920d Fix infinite write loop on Linux 2022-11-12 20:28:10 -08:00
Jarred SUmner
7da520b22e Add missing type 2022-11-12 20:28:10 -08:00
Tom Birch
45dc75b3be Add linker script to remove unwanted exports (#1499) 2022-11-12 20:22:38 -08:00
Jarred SUmner
1cce9da80a Fix memory leak in gzip pool + add test for gzip'd data 2022-11-12 18:32:53 -08:00
Jarred Sumner
21bf3ddaf2 Redo how we poll pipes (#1496)
* Fix pipe

* Handle unregistered

* Fix failing test
2022-11-12 18:30:12 -08:00
Jarred Sumner
514f2a8edd Add test that fails on linux 2022-11-11 16:02:35 -08:00
Jarred Sumner
5f5d74c534 2 frames 2022-11-11 04:18:15 -08:00
Jarred Sumner
b3b70035a1 Revert "Omit frame pointer"
This reverts commit 4f91f66a37.
2022-11-11 02:10:16 -08:00
Jarred Sumner
666f5c5ea9 Don't rm cached 2022-11-11 01:12:41 -08:00
Jarred Sumner
55488ad77f try this 2022-11-11 00:51:39 -08:00
Jarred Sumner
23fd28afc3 Update bun-linux-build.yml 2022-11-11 00:48:39 -08:00
Jarred Sumner
f6cb20f516 try using git action 2022-11-11 00:48:05 -08:00
Jarred Sumner
096abc638a Remove with git rm 2022-11-11 00:43:55 -08:00
Jarred Sumner
d3fc1ee7d2 Reactivate 2022-11-11 00:43:18 -08:00
Jarred Sumner
cd2bf2591d Re-add 2022-11-11 00:42:58 -08:00
Jarred Sumner
8428bd90a3 Delete .keep 2022-11-11 00:38:20 -08:00
Jarred Sumner
6872af907c Update .gitmodules 2022-11-11 00:38:09 -08:00
Jarred Sumner
dc906ba0c7 Create .keep 2022-11-11 00:37:10 -08:00
Jarred Sumner
36b814de57 Delete libbacktrace 2022-11-11 00:34:44 -08:00
Jarred Sumner
142ad97886 Update main.zig 2022-11-11 00:33:10 -08:00
Jarred Sumner
cbc3daf739 Update .gitmodules 2022-11-11 00:30:05 -08:00
Jarred Sumner
4f91f66a37 Omit frame pointer 2022-11-11 00:28:45 -08:00
Jarred Sumner
1671e3cc7e Remove dead code 2022-11-11 00:20:42 -08:00
Jarred Sumner
24a85f8de6 Improve error message 2022-11-11 00:20:42 -08:00
Jarred Sumner
2432150321 Replace libbacktrace with WTFGetBacktrace 2022-11-11 00:20:42 -08:00
Ashcon Partovi
38141e3aa7 Allow install script to specify debug-info variant with debug symbols (#1484) 2022-11-10 20:14:41 -08:00
Jarred Sumner
5f5ef81f11 [bun install] Support implicit pre tags in dependency versions 2022-11-10 19:52:39 -08:00
Jarred Sumner
a1e786011d [bun run] Fix potential crash when a command terminates abnormally 2022-11-10 19:50:35 -08:00
Jarred Sumner
7b4c8802a1 ✂️ 2022-11-10 15:07:12 -08:00
Jarred Sumner
dddbce8a41 Implement napi_create_external and napi_get_value_external 2022-11-10 15:05:23 -08:00
Dylan Conway
7ce8328d28 add ... switch case (#1482) 2022-11-10 13:08:32 -08:00
Jarred Sumner
b62c45fea3 Increase stackframe count 2022-11-10 00:02:16 -08:00
Jarred Sumner
7deca69820 Update websocket-server.test.ts 2022-11-09 23:57:24 -08:00
Jarred Sumner
8753c483ff Implement Server.publish()
Fixes https://github.com/oven-sh/bun/issues/1417
2022-11-09 23:54:56 -08:00
Jarred Sumner
2149e1f0a0 Update server.zig 2022-11-09 23:42:36 -08:00
Jarred Sumner
c52ebd96ba Fix crash when an exception occurs in open() 2022-11-09 23:42:30 -08:00
Jarred Sumner
904716f56b Clone all the strings 2022-11-09 22:55:10 -08:00
Jarred Sumner
a858261832 Clone the text 2022-11-09 22:45:02 -08:00
Jarred Sumner
9fccbf9364 Remove bun:wrap from stack traces 2022-11-09 22:44:45 -08:00
Jarred Sumner
41a023e21d Add another log 2022-11-09 18:56:17 -08:00
Jarred Sumner
cf378d51fd Fix broken stacktraces 2022-11-09 18:56:17 -08:00
Derrick Farris
7f5022db0c fix(child_process): fix execFileSync options.input (#1479)
* fix(child_process): fix execFileSync options.input

* fix(child_process): debug err, check for Uint8Array too

* fix(child_process): fix ArrayBufferIsView call

* test(child_process): fix missing toString() call on test result

* refactor(child_process): change options.input to input to getter calls
2022-11-09 18:10:29 -08:00
Jarred Sumner
9ea025c543 remove this
wrong approach
2022-11-09 17:23:48 -08:00
Jarred Sumner
477747142a Update bun-types-tests.yml 2022-11-09 17:13:54 -08:00
Jarred Sumner
29b0e3eaf7 Only run this for bun-types 2022-11-09 17:12:44 -08:00
Jarred Sumner
9ab21ceb59 Clarify 2022-11-09 17:11:25 -08:00
Colin McDonnell
f7f1b60444 Add bun-types, add typechecking, add child_process types (#1475)
* Add bun-types to packages

* Improve typing

* Fix types in tests

* Fix dts tests

* Run formatter

* Fix all type errors

* Add strict mode, fix type errors

* Add ffi changes

* Move workflows to root

* Add workflows

* Remove labeler

* Add child_process types

* Fix synthetic defaults issue

* Remove docs

* Move scripts

* Run prettier

* Include examples in typechecking

* captureStackTrace types

* moved captureStackTrace types to globals

* Address reviews

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2022-11-09 15:40:40 -08:00
Jarred Sumner
da257336b0 Fix #1354 2022-11-09 15:11:14 -08:00
Jarred Sumner
565996a087 Support TypeScript satisfies
Credit: @magic-akari, almost identical diff in https://github.com/evanw/esbuild/pull/2509/files#diff-ccc0bde7223236d93490b727b272f15765a2674be12a4c310b83b9555bef8816
2022-11-09 01:30:02 -08:00
Jarred Sumner
fac1c49727 Fixup 2022-11-09 01:15:36 -08:00
Jarred Sumner
3a760ec0ec Update response.zig 2022-11-09 01:12:35 -08:00
Jarred Sumner
d90a638101 Re-enable workaround for 127.0.0.01 2022-11-09 01:12:35 -08:00
Dylan Conway
047a8d3f0d Error.captureStackTrace implementation (#1476)
* capture stack trace formatting, tests

* fix callsite methods, stack formatting or undefined

* isNative, tests for callsite methods

* Update src/bun.js/bindings/ZigGlobalObject.cpp

* Update src/bun.js/bindings/ZigGlobalObject.cpp

* template and macros for visitchildren

* static strings, handle infinity and clamp stacktracelimit

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2022-11-09 00:37:57 -08:00
Jarred Sumner
2c4777f579 [libarchive][bun install] Fix file permissions not always being passed correctly in bun install
Fixes #1092
2022-11-09 00:32:50 -08:00
Jarred Sumner
0642cf31f3 [bun install] Support bin with bun link 2022-11-08 23:51:02 -08:00
Jarred Sumner
b1b3f7af54 Update bindings.cpp 2022-11-08 22:39:45 -08:00
Jarred Sumner
cb41d77d2a Fixes #1426 2022-11-08 22:27:22 -08:00
Jarred Sumner
0fd7d3a8c3 Fix incorrectly reporting URL sizes to GC in some cases 2022-11-08 22:26:58 -08:00
Jarred Sumner
8bc459ba99 Guard against closing the same pid twice 2022-11-08 22:08:49 -08:00
Jarred Sumner
5c312ec0c9 Only perform this check on macOS 2022-11-08 22:07:59 -08:00
Jarred Sumner
bf92c36be1 Fixes #1320
Tests pass now on linux
2022-11-08 22:05:59 -08:00
Jarred Sumner
253cb391b3 Remove base64 library 2022-11-08 21:32:08 -08:00
Jarred Sumner
55c262a321 handle undefined better 2022-11-08 21:31:21 -08:00
Jarred Sumner
af3931371e Fix Buffer.from(text, "base64") and Buffer.toString("base64") 2022-11-08 21:30:54 -08:00
Derrick Farris
9ccc455f8d Fix child_process tests (#1471)
* test(child_process): fix broken tests, add our-assert pkg for testing

* test(child_process): replace console.log with debug()

* test(child_process): rename our-assert -> node-test-helpers, use Bun.peek for subproc.exited
2022-11-08 15:33:47 -08:00
Jarred Sumner
8b0a3c75cb Fix #1473 2022-11-08 15:30:09 -08:00
Jarred Sumner
fac4efb9b9 Add a test for DOMJIT call version of TextDecoder 2022-11-08 15:28:30 -08:00
Jarred Sumner
f17080df7f Add a couple more tests for typeof 2022-11-08 15:27:55 -08:00
Jarred Sumner
2077e563b7 Fix failing transpiler tests 2022-11-08 15:26:29 -08:00
Jarred Sumner
1604666988 20% faster TextDecoder on small inputs 2022-11-08 12:55:45 -08:00
Jarred Sumner
6c6e680d91 Allow read_only packages to check the cache 2022-11-08 03:02:20 -08:00
Jarred Sumner
9f222c5ed2 Default enable optional dependencies for remote packages 2022-11-08 03:01:41 -08:00
Jarred Sumner
3d0b297306 Fix error message 2022-11-08 03:01:30 -08:00
Jarred Sumner
ce5cbb0491 Install optional dependencies for auto-install 2022-11-08 03:01:12 -08:00
Jarred Sumner
9bf03a84c1 Update crypto.js 2022-11-08 00:29:32 -08:00
Jarred Sumner
3e9bb6859b Stack allocate arguments to make it actually threadsafe 2022-11-08 00:28:14 -08:00
Jarred Sumner
86f0b08b8d Add missing exports 2022-11-08 00:14:17 -08:00
Jarred Sumner
38db5f1c83 Fix Buffer.slice and Buffer.subarray 2022-11-08 00:07:25 -08:00
Jarred Sumner
9f10724eda cast 2022-11-07 21:53:31 -08:00
Jarred Sumner
bb8c803bdf Fix newline normalization
credit: @Validark
2022-11-07 21:43:38 -08:00
Jarred Sumner
9d167deb10 Credit: @Validark 2022-11-07 21:43:38 -08:00
Niles Salter
093fe1bae9 Add more tags to be usable with typeof (#1258) 2022-11-07 21:10:19 -08:00
Niles Salter
9dc3fbcfc4 Remove improper coercion of environment variables (#1256) 2022-11-07 21:04:49 -08:00
Jarred Sumner
be9bab5c29 Update ZigGlobalObject.cpp 2022-11-07 20:52:21 -08:00
Jarred Sumner
52eac73726 Fix peek test 2022-11-07 20:49:19 -08:00
Jarred Sumner
f05e23ed20 Return a rejected promise if there was an error 2022-11-07 20:43:53 -08:00
Jarred Sumner
b4abb0f337 Visit all the fields 2022-11-07 20:43:34 -08:00
Jarred Sumner
41c983b386 clean up some reliability issues with automatic install 2022-11-07 19:50:54 -08:00
Jarred Sumner
f84b2ec6d1 Handle threadsafety issue 2022-11-07 19:50:54 -08:00
Ikko Ashimine
e0cb7e4342 Fix typo in Dockerfile (#1468)
specifc -> specific
2022-11-07 18:39:44 -08:00
Jarred Sumner
204f514633 [JS Parser] Do not perform the visit pass if the parse pass had "tolerable" errors 2022-11-07 16:00:14 -08:00
Jarred Sumner
5005188a13 Fix a couple failing tests 2022-11-07 15:20:47 -08:00
Jarred Sumner
8189f78eed Maybe fix bug with onExit callback? 2022-11-07 14:57:47 -08:00
Jarred Sumner
2eb19a96b1 Support unlimited arguments in process.nextTick 2022-11-07 14:14:19 -08:00
Jarred Sumner
fd26d2e9fa Fix missing error in process.nextTick and queueMicrotask 2022-11-07 14:13:55 -08:00
Jarred Sumner
370d9c2931 [bun:test] Rejected promises should cause tests to fail 2022-11-07 05:13:54 -08:00
Jarred Sumner
c00359a521 [bun:test] Implement done callback with support for async functions 2022-11-07 04:49:10 -08:00
Jarred Sumner
71d0e14210 [bun:test] Implement expect in faster Zig bindings 2022-11-07 00:53:24 -08:00
Jarred Sumner
d925367cae [bindings generator] Support cached values that do not correspond to properties and support call() functions 2022-11-07 00:51:36 -08:00
Jarred Sumner
179cd18f70 Handle types which do not support getting an object 2022-11-07 00:50:49 -08:00
Jarred Sumner
072cd5a745 Fix UAF in canary 2022-11-07 00:50:32 -08:00
Jarred Sumner
c52d9fd1b6 Bump 2022-11-06 21:45:45 -08:00
Jarred Sumner
e45f72e8e4 Automatically install npm packages when running a script in Bun's runtime (#1459)
* Update bundler.zig

* WIP

* Update README.md

* Update README.md

* wip

* Support running scripts without package.json

* Add `--no-auto-install` and `--prefer-offline` flags

* WIP

* wip

* Update headers-handwritten.h

* WIP

* Build fixes

* Fix UAF

* Update install.zig

* Must call .allocate()

* Micro-optimization: only call .timestamp() once per tick when installing packages

* Support progress bar

* Extend the timestamp for package staleness checks to 1 day

* Add `--prefer-latest`, `-i` CLI Flags

* Fix crash

* Support line text manually being set on an Error instance

* Add a few more fields for error messages

* Fix bug when counting 8 character strings in string builder

* Implement error handling for automatic package installs!

* Fix crash

* Make it say module when there's a slash

* Update module_loader.zig

* Ban dependency versions in import specifiers when a package.json is present

* Remove unused field

* Update README.md

* Update README.md

* Update README.md

* Update README.md

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-11-06 21:42:05 -08:00
Carter Snook
645cf90335 chore: remove space lookalike (#1465) 2022-11-06 18:03:06 -08:00
Jarred Sumner
e5b2e3c602 Fixes https://github.com/oven-sh/bun/issues/1451 2022-11-06 18:00:01 -08:00
Jarred Sumner
897d7bd564 Add way to explicitly coercion object to int32 2022-11-06 17:59:32 -08:00
Jarred Sumner
07cb04e311 Fix symbol error with make headers
cc @lawrencecchen
2022-11-06 17:45:16 -08:00
Jarred Sumner
b1fcc9e6bf Fix bug when passing ABI Types as integers 2022-11-06 17:45:05 -08:00
Jarred Sumner
1f174b9d95 Fixes https://github.com/oven-sh/bun/issues/1462 2022-11-06 16:14:46 -08:00
Jarred Sumner
c154402c45 Undo 2022-11-06 16:02:10 -08:00
Jarred Sumner
17b8056b31 Update action.yml 2022-11-06 15:45:28 -08:00
Jarred Sumner
40160ec6d6 Prettier 2022-11-06 15:35:35 -08:00
Jarred Sumner
fe92a89b93 Pass tar -C 2022-11-06 15:35:18 -08:00
Jarred Sumner
1cb5a73243 [TypeScript] Fix export = value 2022-11-06 15:26:12 -08:00
Jarred Sumner
70fa1564c2 Fix artifact name, use tarball 2022-11-06 15:02:58 -08:00
Jarred Sumner
fcd8397db2 Try tarball 2022-11-06 14:51:44 -08:00
Jarred Sumner
4688d72945 Try again 2022-11-06 14:33:04 -08:00
Jarred Sumner
c55f59e030 Node12 is deprecated 2022-11-06 14:09:24 -08:00
Derrick Farris
be108c0fea feat(child_process): add node:child_process polyfill (#1424)
* feat(child_process): beginning of child_process, add ChildProcess and spawn base case

* fix(child_process): remove invalid single arg array syntax (thanks Copilot)

* refactor(child_process): unhack Readable.on, move stuff into node:stream

* feat(child_process): add more params for spawn, refactor, add fromWeb() to Readable

* feat(child_process): finish rest of exports (minus fork), refactor, add tests

* cleanup(streams): remove a bunch of unnecessary stuff

* cleanup(child_process): remove dead refs

* fix(child_process): fix stdio

* fix(child_process): change stdio to bunStdio

* test(child_process): uncomment timeout test

* test(child_process): fix hanging tests

* test(child_process): remove stray console.log

* test(child_process): fix cwd test for linux

* refactor(child_process): divide paths for encoded vs raw execFile stdio

* fix(child_process): fix logic for execFile slow path
2022-11-06 13:43:42 -08:00
Derrick Farris
4e3fb8ed5b fix(subprocess): fix typo in spawnSync (#1464) 2022-11-06 03:41:32 -08:00
zhiyuan
9d3f1e0d26 Fix fetch api to accept stringifier object (#1460)
* fetch accept stringifier object

* test: update fetch params tests
2022-11-05 18:51:02 -07:00
Jarred Sumner
88ca7fd738 Fix crash in setTimeout/setInterval 2022-11-03 23:38:23 -07:00
Jarred Sumner
30e1fe1035 Fix incorrect exit code 2022-11-03 23:38:07 -07:00
Jarred Sumner
562595fa02 Fix crash when reading promise value wihtout checking if null 2022-11-03 23:37:54 -07:00
Jarred Sumner
d6520cd761 Fix which not handling absolute paths to a bin
This code has not been tested.
2022-11-03 23:22:51 -07:00
Jarred Sumner
13cfca4814 Fix cmd not found in $PATH printing raw struct 2022-11-03 23:02:49 -07:00
Jarred Sumner
e20461d961 Delete unused file 2022-11-03 23:02:23 -07:00
Colin McDonnell
d04c0d51fe Add minified prod build of react-dom/server.bun (#1458)
Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2022-11-03 18:10:42 -07:00
Hyro
a5b25c5a79 chore: remove unecessary files (#1457)
* Delete labeler.yml

* Delete labels.yml
2022-11-03 12:42:44 -07:00
Jarred Sumner
6142715c06 Introduce import.meta.primordials for builtin JS
the `import.meta` object in Bun now has a `primordials` object which makes a handful of globals safe for access. Inside of bun: or node: modules, it is a special object (ownKeys is not implemented, so Object.keys() wont work on it)

- Array
- String
- `isPromise`
- `isCallable`
- `isConstructable`
- `tryGetById(foo, "bar')` which is like foo?.bar
- `arrayPush` which is like `Array.prototype.push`
- `Bun`
- `isAbortSignal`

cc @ThatOneBro @lawrencecchen
2022-11-03 00:18:26 -07:00
Jarred Sumner
34e130a3e0 Add a misc snippet 2022-11-02 20:46:24 -07:00
Jarred Sumner
09434f1486 Add failing test 2022-11-02 20:44:49 -07:00
Jarred Sumner
1a92b92f8a Add failing wildcard test 2022-11-02 20:44:13 -07:00
Jarred Sumner
fb903bb091 Update headers-handwritten.h 2022-11-02 20:10:12 -07:00
Jarred Sumner
34fce03f0f Add missing headers 2022-11-02 20:09:38 -07:00
Jarred Sumner
bfa40d1d3f Fix 4/4 failing tests 2022-11-02 20:00:44 -07:00
Jarred Sumner
f829bd7190 Fix 5/9 failing tests 2022-11-02 19:55:45 -07:00
Jarred Sumner
ab4e662484 Update ZigGlobalObject.cpp 2022-11-02 19:37:06 -07:00
Jarred Sumner
35ba83584f Fixes #1448 #1450 2022-11-02 19:25:52 -07:00
Jarred Sumner
50cf083668 Fix missing functions 2022-11-02 18:54:42 -07:00
João Paquim
dd9325d8c9 Fix $PATH on dev container (#1439)
* Fix $PATH for bun on devcontainer

* Use cat in dev container postCreateCommand
2022-11-02 17:34:20 -07:00
Jarred Sumner
3b7626aacb Fixup 2022-11-02 17:19:50 -07:00
Jarred Sumner
a9aa3e732c Fix memory leak 2022-11-02 17:15:28 -07:00
Jarred Sumner
ae0ea761ce Update ffi.exports.js 2022-11-02 13:59:39 -07:00
Jarred Sumner
1a3a0adc63 Add way to know if JSCallback is threadsafe 2022-11-02 13:44:37 -07:00
Jarred Sumner
006a2f37dd [bun:ffi] Add threadsafe option to callbacks 2022-11-02 13:35:49 -07:00
Bram Wasti
65b543fba6 Update ffi.zig (#1449) 2022-11-02 11:11:23 -07:00
Jarred Sumner
b459d09030 Update README.md 2022-11-02 01:47:27 -07:00
Jarred Sumner
97fa2702d1 Update README.md 2022-11-02 01:45:42 -07:00
Jarred Sumner
4af4d3eeca Update README.md 2022-11-02 01:43:10 -07:00
Jarred Sumner
1e0155faf2 Flip the callback order 2022-11-02 01:27:54 -07:00
Jarred Sumner
81033c52fb [bun:ffi] Implement JSCallback so C can call into JS 2022-11-02 01:16:13 -07:00
Jarred Sumner
86639fe62a Improve async function handling code in setTimeout and setInterval
Should fix
2022-11-02 00:14:32 -07:00
Dylan Conway
54e7a6f57a typescript decorators round 2 (#1445)
* __decorateClass, __decorateParam, lit test, wiptest test

* decorator factories test

* parameter decorator test

* test for decorators with constructor parameter properties

* Fix issue with `CryptoKey` and `SubtleCrypto` constructors

* Limit concurrency for GitHub Actions due to issues with cache poisoning
If multiple actions are running, sometimes the cache is poisoned from another action. We need to fix this, but this is an interim measure to make actions less flaky

* Make these tests better

* Move this to dependencies so the .a files upload

* Fixup

* temporary fix

* Limit concurrency for MacOS Object actions

* try againn

* againn

* Make `"tls"` an explicit object we pass instead of implicit top-level options

cc @Electroid @colinhacks

* Update server.zig

* Prefer `BUN_PORT` over `PORT`

* Fix typo in homebrew action

* Run homebrew action when release is edited

* Check published_at instead of draft in GitHub action

* Implement `process.release`

* Add missing dependencies to `make devcontainer`

* Allow overriding node polyfills via `BUN_OVERRIDE_MODULE_PATH`

* Add a stub for io_darwin on linux

cc @sno2 hopefully this helps but i'm not sure

* Add missing `break`

* Download more RAM

* feat(core): optimize zig slice (#1408)

* feat(core): optimize zig slice

* address concerns

* Remove webcrypto from vendor-without-check

* Update default tsconfig (#1418)

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>

* Enable `BUN_OVERRIDE_MODULE_PATH` in `bun wiptest`

* Upgrade WebKit

* space

* Support getting cached values and pending activity in the bindings generator

* Remove ✂️ function

* constructor creation, initializers, handle static and computed fields with decorators

* Updating libuwebsockets C API (#1423)

* fix for repeated regex match calls and fix for '^' in character classes (#1419)

* tests and formatting

* fix for ^ in character class

* formatting

* test for repeated match and exec calls

* create oniguruma regex for each exec/test

* check errorCode from creating oniguruma regexp and always return {} on failure

* oops

* call onig_initialize once

* fix incorrect escaping, removed unnecessary oniguruma settings

* tests for "-" and "^" in character classes

* free regex object before returns

* force gc for some tests

* Update React fizz server (#1432)

* Update fizz server

* Use production build

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>

* more decorator tests

* optional setup function for loading elements, simulate clicks in lit test

* fix createWriteStream (#1433)

* fix createWriteStream

* remove comment

* Update build docs and commands for dev containers (#1438)

* Update build documentation for dev containers

* Add devcontainer-rebuild make target

* Add make devcontainer-sh target

* Fix missing .PHONY for vendor-without-check (#1437)

* Fix check for ninja on Debian/Ubuntu (#1436)

Even though the package is named ninja-build, the ninja binary is still
named ninja, so use `which ninja` to check for it

* Fix #1410

woops

* await on DOMContentLoaded for elements instead of setup function

* avoid lowering class if no decorators

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Carter Snook <cartersnook04@gmail.com>
Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
Co-authored-by: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com>
Co-authored-by: João Paquim <jpaquim@users.noreply.github.com>
2022-11-01 21:25:30 -07:00
Ashcon Partovi
32826119fc Delete labeler.yml 2022-11-01 17:07:24 -07:00
Ashcon Partovi
12f586eeb7 Delete label-sync.yml 2022-11-01 17:07:17 -07:00
Jarred Sumner
f9f169bb9e Fix #1410
woops
2022-11-01 14:34:51 -07:00
João Paquim
2fe27fdeea Fix check for ninja on Debian/Ubuntu (#1436)
Even though the package is named ninja-build, the ninja binary is still
named ninja, so use `which ninja` to check for it
2022-11-01 13:30:09 -07:00
João Paquim
19afe95cc6 Fix missing .PHONY for vendor-without-check (#1437) 2022-11-01 13:29:50 -07:00
João Paquim
af410879cd Update build docs and commands for dev containers (#1438)
* Update build documentation for dev containers

* Add devcontainer-rebuild make target

* Add make devcontainer-sh target
2022-11-01 13:29:30 -07:00
Lawrence Chen
26e32ec1cb fix createWriteStream (#1433)
* fix createWriteStream

* remove comment
2022-11-01 02:26:51 -07:00
Colin McDonnell
3a60764f32 Update React fizz server (#1432)
* Update fizz server

* Use production build

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2022-10-31 22:10:28 -07:00
Dylan Conway
5398ed52d8 fix for repeated regex match calls and fix for '^' in character classes (#1419)
* tests and formatting

* fix for ^ in character class

* formatting

* test for repeated match and exec calls

* create oniguruma regex for each exec/test

* check errorCode from creating oniguruma regexp and always return {} on failure

* oops

* call onig_initialize once

* fix incorrect escaping, removed unnecessary oniguruma settings

* tests for "-" and "^" in character classes

* free regex object before returns

* force gc for some tests
2022-10-31 22:00:26 -07:00
Ciro Spaciari
6ede31cb04 Updating libuwebsockets C API (#1423) 2022-10-30 01:03:11 -07:00
Jarred Sumner
88ddb103f2 Remove ✂️ function 2022-10-28 19:01:23 -07:00
Jarred Sumner
525d055d4a Support getting cached values and pending activity in the bindings generator 2022-10-28 19:01:13 -07:00
Jarred Sumner
4c8a08d6ba space 2022-10-28 18:58:05 -07:00
Jarred Sumner
280c45c269 Upgrade WebKit 2022-10-28 18:57:33 -07:00
Jarred Sumner
8bb080fc7c Enable BUN_OVERRIDE_MODULE_PATH in bun wiptest 2022-10-28 18:09:55 -07:00
Colin McDonnell
619d931568 Update default tsconfig (#1418)
Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2022-10-28 17:06:00 -07:00
Jarred Sumner
50a3853eb4 Remove webcrypto from vendor-without-check 2022-10-28 16:18:01 -07:00
Carter Snook
0bfd00e734 feat(core): optimize zig slice (#1408)
* feat(core): optimize zig slice

* address concerns
2022-10-27 21:25:32 -07:00
Jarred Sumner
0b1d4ff81b Download more RAM 2022-10-27 19:04:51 -07:00
Jarred Sumner
792ad30a8c Add missing break 2022-10-27 18:31:45 -07:00
Jarred Sumner
ed5595f792 Add a stub for io_darwin on linux
cc @sno2 hopefully this helps but i'm not sure
2022-10-27 18:26:32 -07:00
Jarred Sumner
5c8cbf9806 Allow overriding node polyfills via BUN_OVERRIDE_MODULE_PATH 2022-10-27 18:25:43 -07:00
Jarred Sumner
57342459dd Add missing dependencies to make devcontainer 2022-10-27 16:22:32 -07:00
Jarred Sumner
901c4f57aa Implement process.release 2022-10-27 15:09:20 -07:00
Ashcon Partovi
1c6da5934d Check published_at instead of draft in GitHub action 2022-10-27 10:38:18 -07:00
Ashcon Partovi
e5344bfcc5 Run homebrew action when release is edited 2022-10-27 10:36:59 -07:00
Ashcon Partovi
46a85358d7 Fix typo in homebrew action 2022-10-27 10:32:00 -07:00
Jarred Sumner
6632135ec0 Prefer BUN_PORT over PORT 2022-10-26 21:06:02 -07:00
Jarred Sumner
7b73dcf906 Update server.zig 2022-10-26 21:05:53 -07:00
Jarred Sumner
75b1ef1ef4 Make "tls" an explicit object we pass instead of implicit top-level options
cc @Electroid @colinhacks
2022-10-26 21:04:12 -07:00
Jarred Sumner
830f83a44d againn 2022-10-26 17:50:35 -07:00
Jarred Sumner
88d6615e4e try againn 2022-10-26 17:07:22 -07:00
Ashcon Partovi
cc1b340cff Limit concurrency for MacOS Object actions 2022-10-26 16:41:29 -07:00
Jarred Sumner
8ccf5a07ca temporary fix 2022-10-26 16:33:08 -07:00
Jarred Sumner
10a8c6acdd Fixup 2022-10-26 16:31:49 -07:00
Jarred Sumner
2cd1d44739 Move this to dependencies so the .a files upload 2022-10-26 16:30:28 -07:00
Jarred Sumner
de536fc953 Make these tests better 2022-10-26 16:29:46 -07:00
Ashcon Partovi
a1456767f7 Limit concurrency for GitHub Actions due to issues with cache poisoning
If multiple actions are running, sometimes the cache is poisoned from another action. We need to fix this, but this is an interim measure to make actions less flaky
2022-10-26 16:21:51 -07:00
Jarred Sumner
e0feff22c9 Fix issue with CryptoKey and SubtleCrypto constructors 2022-10-26 15:28:27 -07:00
João Paquim
44ff09015c Minor fixes to README.md (#1395) 2022-10-26 10:23:51 -07:00
João Paquim
3c45182097 Update Dev Containers extension name (#1393) 2022-10-26 09:23:33 -07:00
Jarred Sumner
c02da2c5a6 Fix failing macOS build 2022-10-25 23:32:04 -07:00
Jarred Sumner
5cd91fa1a3 Update Makefile 2022-10-25 23:11:42 -07:00
Jarred Sumner
d21739af1a Update Makefile 2022-10-25 23:11:42 -07:00
Jarred Sumner
bd372e9cf4 Update Makefile 2022-10-25 23:11:42 -07:00
Ashcon Partovi
afe04aa8bf Add action to deploy to Homebrew 2022-10-25 23:03:20 -07:00
Jarred Sumner
9b2bad8bed Update Makefile 2022-10-25 22:41:26 -07:00
Jarred Sumner
7622f2e339 Fix crash in TCP server 2022-10-25 21:41:20 -07:00
Jarred Sumner
3d05cb017d Update Makefile 2022-10-25 20:53:08 -07:00
Jarred Sumner
1c54deab52 Update README.md 2022-10-25 18:03:07 -07:00
zhiyuan
28d71e2d9f Fix lexer expected token error (#1387)
* fix: lexer expected token error

* fix: handle parse error through logs
2022-10-25 12:34:40 -07:00
Jarred Sumner
02c920f4fd TCP & TLS Socket API (#1374)
* TCP Socket API

* Wip

* Add snippet for StringDecoder

* Rename `close` to `stop`, replace `close` with `end`

* Add a tcp echo server test

* Some docs

* Update README.md

* Fix build

* Update README.md

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-10-25 00:44:25 -07:00
Dylan Conway
1b50ecc52b oniguruma regex lookbehind and multibyte hex fix (#1363)
* handle multibyte hex characters

* non extended strings used for toString() and source

* add hasIndices flags

* more tests for lookbehinds, unicode, and hex characters

* handled case when hex doesnt have enough digit, more tests

* fix adding characters out of bounds

* backslash in character class

* compile() returns object

* escape special characters in oniguruma character class
2022-10-24 19:02:56 -07:00
Jarred Sumner
f8ea534f3b Hopefully fix failing build 2022-10-24 16:38:56 -07:00
Jarred Sumner
9aea2f90a5 Maybe fix a crash 2022-10-24 16:38:32 -07:00
Jarred Sumner
38cc698b4d Update README.md 2022-10-24 04:16:52 -07:00
Jarred Sumner
f13f465024 Update README.md 2022-10-24 04:13:29 -07:00
Jarred Sumner
e8d6ad6d66 Update README.md 2022-10-24 04:13:11 -07:00
Jarred Sumner
434f1bffad Update README.md 2022-10-24 04:12:32 -07:00
Jarred Sumner
0b0db78799 Bun.peek 2022-10-24 04:10:44 -07:00
Jarred Sumner
b3434a8b88 Add fd to SystemError and fix 2 cases with invalid tagged union
cc @sno2
2022-10-23 22:29:23 -07:00
Carter Snook
223ce77eca fix(web): stop segfault on invalid fd error (#1386) 2022-10-23 22:14:37 -07:00
Jarred Sumner
ec9787770e Preserve trailing newline when updating package.json
Fixes https://github.com/oven-sh/bun/issues/1375
2022-10-23 21:53:54 -07:00
Jarred Sumner
360a007f16 Fix ReadableStream.prototype.tee 2022-10-23 21:30:50 -07:00
Jarred Sumner
76652ac3ca Add Web Crypto API (#1384)
* Add Web Crypto API

* Duplicate symbols

* Update c_cpp_properties.json

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-10-23 20:25:18 -07:00
Carter Snook
14cec299f5 fix(fetch): stop new Response(null) from segfaulting (#1383)
* fix(fetch): resolve segfaults with 'Response'

* nit: use shorter check
2022-10-23 18:27:03 -07:00
zhiyuan
55c42f1663 Fix spawn exitcode (#1371) 2022-10-22 09:41:56 -07:00
Jarred Sumner
85808700c8 Add sqlite to include list 2022-10-21 22:54:26 -07:00
Jarred Sumner
73fba0c5f1 Codegen 2022-10-21 22:54:17 -07:00
Jarred Sumner
7060008b83 Treat invalid buffer value as utf8 string 2022-10-21 22:53:32 -07:00
Jarred Sumner
ae4f2d63c8 Add test for fs.createReadStream 2022-10-21 22:50:23 -07:00
Jarred Sumner
9129309f0a Implement fs.createReadStream, begin fs.createWriteStream 2022-10-21 22:50:06 -07:00
Jarred Sumner
c987bdcbf9 Make Node Streams work better in Bun 2022-10-21 22:49:49 -07:00
Jarred Sumner
f6a451256f Fix error handling logic in read() 2022-10-21 22:49:19 -07:00
Jarred Sumner
71b942b581 Fix bugs in mask boolean values 2022-10-21 22:48:55 -07:00
Jarred Sumner
cd2e9e9dcf Emit errors 2022-10-21 22:47:58 -07:00
Jarred Sumner
347309b26f Add test for ResolveError.position being inspectable 2022-10-21 22:35:28 -07:00
Jarred Sumner
8d67870da4 Fix segfault when logging position object from failed nested import 2022-10-21 22:34:47 -07:00
Jarred Sumner
04e0583c31 Implement setMaxListeners and getMaxListeners 2022-10-21 21:13:50 -07:00
Jarred Sumner
c37d0be027 Fix import Foo, {bar} when from hardcoded builtin modules in runtime 2022-10-21 21:13:50 -07:00
Jarred Sumner
4c136cddd7 Fix test failure 2022-10-21 21:13:50 -07:00
Jarred Sumner
b50dc40fb8 Reload node:fs in development 2022-10-21 21:13:50 -07:00
Carter Snook
6160dc3995 chore: remove outdated var usages (#1364) 2022-10-21 09:54:13 -07:00
Jarred Sumner
a1f40400c1 Fix "/" in example 2022-10-21 01:09:37 -07:00
Jarred Sumner
c940f00e2d Fix infinite loop 2022-10-21 01:07:49 -07:00
Jarred Sumner
97ccbc189a micro-optimize 2022-10-21 01:07:49 -07:00
Ashcon Partovi
0a2c101c28 Update install script to use secure flags 2022-10-20 18:44:50 -07:00
Ashcon Partovi
c526a6bce8 Add installation method for Homebrew 2022-10-20 18:26:23 -07:00
Jarred Sumner
da9b2452a7 Fix crash in highWaterMark 2022-10-20 16:34:09 -07:00
zhiyuan
210ae2ffb2 Fix Bun.serve error handler error param (#1359) 2022-10-20 01:40:58 -07:00
Jarred Sumner
9f16906499 Fix calling ws.publish inside close when other clients are connected
This fixes https://github.com/oven-sh/bun/issues/1357
2022-10-19 19:54:20 -07:00
Lucas Garron
605c429770 Cache dir loader: Prefer $BUN_INSTALL and $XDG_CACHE_HOME to $HOME. (#1351)
This partially addresses https://github.com/oven-sh/bun/issues/696 , by using `$XDG_CACHE_HOME` for those of us who already have that env var set.
2022-10-19 16:19:50 -07:00
Ashcon Partovi
b064872d9a Improve issue templates (#1353) 2022-10-19 16:19:35 -07:00
Jarred Sumner
ff36fa8a53 Add websocket hot example 2022-10-19 02:36:22 -07:00
Jarred Sumner
19682b4225 Update README.md 2022-10-19 01:13:13 -07:00
Jarred Sumner
536bd72de9 Prettier 2022-10-19 00:18:15 -07:00
Jarred Sumner
87ca9948ec Allow returning a Response object when upgrading 2022-10-19 00:18:00 -07:00
Jarred Sumner
57e5c35277 latest 2022-10-18 23:05:23 -07:00
Jarred Sumner
8b4c3ec0c7 Add todo 2022-10-18 22:57:06 -07:00
Jarred Sumner
9c7eb75a9a websocker-server 2022-10-18 22:16:51 -07:00
Jarred Sumner
b0fe167910 Fix test 2022-10-18 22:16:51 -07:00
Aapo Alasuutari
6223030360 Use buffer type for Deno FFI binding to align with Bun usage (#1321)
* Use buffer type for Deno FFI binding to align with Bun usage

* Prettier
2022-10-18 21:12:33 -07:00
Dylan Conway
1835e4b9f9 get args fix (#1346)
* fix args.len < capacity check

* tests for args

* file name change

* switch to stdout.writer, use JSON for parsing

* bun-debug or bun

* missing arg
2022-10-18 20:11:17 -07:00
Ikko Ashimine
8ca49f906a Fix typo in datetime.zig (#1310)
containg -> contain
2022-10-18 18:48:53 -07:00
Jarred Sumner
dac6c48b1e woops 2022-10-18 18:21:53 -07:00
Jarred Sumner
2b0694ec8c Update uws 2022-10-18 17:40:34 -07:00
Jarred Sumner
26bfc4f0a3 Update uws 2022-10-18 16:57:25 -07:00
Jarred Sumner
fbec10758b Update uws 2022-10-18 16:41:13 -07:00
Jarred Sumner
30d43b027f Update javascript.zig 2022-10-18 13:48:50 -07:00
Jarred Sumner
693b1c9b23 Implement performance.timeOrigin 2022-10-18 13:36:44 -07:00
Jarred Sumner
ce0efc37cc build faiilures 2022-10-18 03:12:34 -07:00
Jarred Sumner
11c105aa1d Update uws 2022-10-18 02:44:23 -07:00
Jarred Sumner
9167aedcc8 y u no work 2022-10-18 00:32:49 -07:00
Jarred Sumner
fc4c3e3199 Fix build 2022-10-17 23:54:47 -07:00
Jarred Sumner
61a8490c66 Fix empty process.argv 2022-10-17 22:44:42 -07:00
Jarred Sumner
abd6e496ab Add oniguruma to Dockerfile
CC @dylan-conway so you have context in the future how to do this
2022-10-17 22:39:49 -07:00
Dylan Conway
8e1b2ba32e add oniguruma for regex with variable length lookbehinds (#1329)
* added pcre2 submodule

* pcre2 regex boilerplate

* tests for pcre2 regex

* flag validation, getters, construct and compile mostly working

* string escaping for source and toString(), exec, more tests

* flag sorting, match, matchAll, search, split, replace

* remove lib link

* add destructor to PCRE2RegExp

* header include

* removed ternary

* switched to oniguruma for regex library

* revert sql changes

* fix indices flag, add tests

* revert settings

* working error messages

* more tests for lastIndex, fix logic for compile and lastIndex

* move oniguruma lib to deps out dir
2022-10-17 22:37:18 -07:00
Jarred Sumner
c7fc8fdf96 Updates to UWS 2022-10-17 21:55:38 -07:00
Jarred Sumner
7f4bb93782 Slightly mroe careful TextEncoder 2022-10-17 21:49:00 -07:00
Jarred Sumner
a10a8e9c70 Load fewer copies of uWS 2022-10-17 21:48:37 -07:00
Jarred Sumner
b595ddf20d Fix error handler 2022-10-17 15:38:36 -07:00
Jarred Sumner
4bd9b20c8a Workaround crash 2022-10-17 07:25:10 -07:00
Jarred Sumner
9190061ba4 Update websocket-server.test.ts 2022-10-17 07:24:20 -07:00
Jarred Sumner
41f9fd85f6 Handle assertion faillure 2022-10-17 07:24:12 -07:00
Jarred Sumner
cdff2697ef Implement sendText, sendBinary, publishText, publishBinary 2022-10-17 06:53:18 -07:00
Jarred Sumner
ca02695993 Update README.md 2022-10-17 04:36:22 -07:00
Jarred Sumner
9a2f2a94bf Update README.md 2022-10-17 04:17:39 -07:00
Jarred Sumner
e22c245d08 Update README.md 2022-10-17 04:07:55 -07:00
Jarred Sumner
171242680d Update README.md 2022-10-17 03:58:53 -07:00
Jarred Sumner
5995f2ed71 Update README.md 2022-10-17 03:57:43 -07:00
Jarred Sumner
abbde39a02 Clean up some code 2022-10-17 03:33:37 -07:00
Jarred Sumner
e1a17aff4c Fix headers + add test 2022-10-17 03:25:50 -07:00
Jarred Sumner
b8c5646c49 More tests 2022-10-17 03:04:43 -07:00
Jarred Sumner
62b0b601c2 Implement error and binaryType 2022-10-17 03:03:46 -07:00
Jarred Sumner
e43b4815b5 Handle .zero better 2022-10-17 01:38:18 -07:00
Jarred Sumner
923d9c1bbb Redo 2022-10-17 00:41:29 -07:00
Jarred Sumner
e3a6007a76 Redo WebSocket api 2022-10-17 00:41:29 -07:00
Dennis Dudek
00ae8f79e4 Reflecting new home for bun templates (#1317)
* Reflecting new home for bun templates
https://github.com/bun-community/create-templates/

* templates now in root
2022-10-16 20:52:39 -07:00
Jarred Sumner
dc1330aef5 yml 2022-10-16 20:50:15 -07:00
Jarred Sumner
3c1e3792d6 Fix #1335 2022-10-16 20:43:43 -07:00
Jarred Sumner
603164e66a Revert "disable lto for UWS to workaround bug under load"
This reverts commit f356da1b5e.
2022-10-16 20:34:02 -07:00
Jarred Sumner
f19b5ce409 Disable InlineBlob optimization 2022-10-16 19:52:35 -07:00
Jarred Sumner
f356da1b5e disable lto for UWS to workaround bug under load 2022-10-16 19:02:20 -07:00
Jarred Sumner
07a2f80cbc Add a comment 2022-10-16 17:03:17 -07:00
Jarred Sumner
2888f43c8a Make debug logs configurable 2022-10-16 17:03:06 -07:00
Jarred Sumner
697e105ffa Name the thread 2022-10-16 17:02:56 -07:00
Jarred Sumner
5d7174d789 Changed api 2022-10-16 17:02:45 -07:00
Jarred Sumner
ab3b072249 snapshots 2022-10-16 17:02:35 -07:00
Jarred Sumner
690e79445d Update uws 2022-10-16 05:02:01 -07:00
Jarred Sumner
bce68bc898 Set Date header 2022-10-16 04:59:43 -07:00
Jarred Sumner
94091a7522 Make more sure we know what the types we are sending are 2022-10-16 00:14:07 -07:00
Jarred Sumner
2852520d90 Fix WebSocket server sending invalid data at the end 2022-10-16 00:13:51 -07:00
Jarred Sumner
abf3a13433 Fail earlier when there are encoding errors 2022-10-16 00:13:18 -07:00
Jarred Sumner
cebd351e61 Disable some logging 2022-10-15 22:55:48 -07:00
Jarred Sumner
19cff80af8 More careful code generator 2022-10-15 22:49:06 -07:00
Jarred Sumner
9830e50a29 Simplify code that turns a fetch() response into a JSResponse 2022-10-15 22:48:27 -07:00
Jarred Sumner
820e6605f8 Simplify the code that reads HTTP client request bodies 2022-10-15 22:47:18 -07:00
Jarred Sumner
c06bba77d4 Add test for body mixin error 2022-10-15 21:34:05 -07:00
Jarred Sumner
4ba217bc42 Dumber code is better code 2022-10-15 21:06:17 -07:00
Jarred Sumner
a42a9e901c Errors must return 0 instead of undefined 2022-10-15 21:06:08 -07:00
Jarred Sumner
3482d76175 Fix crash when BodyMixin functions throw
Fixes https://github.com/oven-sh/bun/issues/1331#issuecomment-1279844836
2022-10-15 21:05:15 -07:00
Jarred Sumner
63c9315b24 Add a helper for InlineBlob from two arrays 2022-10-15 21:03:40 -07:00
Jarred Sumner
40126bbe60 More logging 2022-10-15 21:02:32 -07:00
Jarred Sumner
70615f4036 Add a simple test for websocket server 2022-10-15 21:01:59 -07:00
Jarred Sumner
1b1b96aff8 add more logging 2022-10-15 21:01:50 -07:00
Jarred Sumner
de1e963ffa More forcefully clone strings 2022-10-15 05:41:57 -07:00
Jarred Sumner
a299b1b8e3 More lenient for response_value data 2022-10-15 05:34:15 -07:00
Jarred Sumner
4cc0eebf4b Rename pendingSockets to pendingWebSockets 2022-10-15 05:34:05 -07:00
Jarred Sumner
b1e97edc59 Fix memory leak in HTTP server 2022-10-15 05:33:48 -07:00
Jarred Sumner
a56dfe486b Remove unnecessary GC protect() call 2022-10-15 05:33:38 -07:00
Jarred Sumner
e9c3529476 Fix crash in WebSocketServer close 2022-10-15 05:32:52 -07:00
Jarred Sumner
c9a4bdf44d Update README.md 2022-10-15 04:48:59 -07:00
Jarred Sumner
c6fe82018a Fix bug where pong would put it in invalid state 2022-10-15 04:14:55 -07:00
Jarred Sumner
3016723198 Add some logging to WebSocket client 2022-10-15 04:14:42 -07:00
Jarred Sumner
e453b949dd Be more careful with some of the string handling code 2022-10-15 03:40:10 -07:00
Jarred Sumner
1236e3f59c Update README.md 2022-10-15 03:35:12 -07:00
Jarred Sumner
c6d314e954 Update README.md 2022-10-15 03:33:45 -07:00
Jarred Sumner
2c548d45f8 Update c_cpp_properties.json 2022-10-15 03:29:25 -07:00
Jarred Sumner
4c741cc8b6 Update README.md 2022-10-15 03:29:14 -07:00
Jarred Sumner
4b5af13ac0 WebSocket Server support 2022-10-15 03:06:41 -07:00
Jarred Sumner
35cbfa63a6 Add a way to update cached values from Zig 2022-10-15 02:57:28 -07:00
Jarred Sumner
dd84681d30 Update README.md 2022-10-15 00:30:19 -07:00
Jarred Sumner
0a1fca5d7d Update 2022-10-13 16:43:44 -07:00
Jarred Sumner
af033c02c5 Fix bench 2022-10-13 15:32:25 -07:00
Jarred Sumner
40506e33e7 Fix bench 2022-10-13 15:26:48 -07:00
zhiyuan
b542921f3d Fix import alias (#1313) 2022-10-13 05:44:08 -07:00
Jarred Sumner
b0a7f8df92 Create http-request-body.ts 2022-10-13 02:27:54 -07:00
Jarred Sumner
32e16bda23 Update react-hello-world.jsx 2022-10-13 02:18:50 -07:00
Jarred Sumner
e32ada318a Update react-hello-world.jsx 2022-10-13 02:18:25 -07:00
Jarred Sumner
b011610bb3 Update README.md 2022-10-13 02:02:48 -07:00
Jarred Sumner
723c7c56dc Add for await 2022-10-13 00:58:37 -07:00
Jarred Sumner
6b7a0c1d3f Fix crash in TextEncoder with rope strings that happens sometimes 2022-10-12 23:59:00 -07:00
Jarred Sumner
22f7981cff Regenerate builtins 2022-10-12 23:50:48 -07:00
Jarred Sumner
ad29d9ffb3 Fix cancel not working in some cases in ReadableStream 2022-10-12 23:48:41 -07:00
Jarred Sumner
8200f43a04 Fix a bug with ReadableStreamDefaultReader and "direct" controller 2022-10-12 23:48:27 -07:00
Jarred Sumner
3fceae8070 Implement ReadableStream.prototype[Symbol.asyncIterator]
cc @fabiancook
2022-10-12 23:46:15 -07:00
Jarred Sumner
8cd8e34719 Update README.md 2022-10-12 19:16:14 -07:00
Jarred Sumner
930981c9d9 Update README.md 2022-10-12 19:15:51 -07:00
Jarred Sumner
f8b22d51a9 Update README.md 2022-10-12 19:15:23 -07:00
Jarred Sumner
2b1b7eb6b3 Update README.md 2022-10-12 19:15:02 -07:00
Jarred Sumner
e241e503b7 Update README.md 2022-10-12 19:14:08 -07:00
Jarred Sumner
39940ec1f5 Update README.md 2022-10-12 19:13:40 -07:00
Jarred Sumner
f725b7e1ab Update README.md 2022-10-12 19:11:47 -07:00
Jarred Sumner
da66bed946 Update README.md 2022-10-12 19:10:01 -07:00
Jarred Sumner
58fe024aea Add --hot to completions 2022-10-12 19:07:11 -07:00
Jarred Sumner
6205cf3fe4 Update README.md 2022-10-12 18:57:28 -07:00
Jarred Sumner
fb6c87da07 Update README.md 2022-10-12 18:57:17 -07:00
Jarred Sumner
d0fb442c59 Update README.md 2022-10-12 18:55:26 -07:00
Jarred Sumner
1c949354c6 Update README.md 2022-10-12 18:17:21 -07:00
Jarred Sumner
3a042cdb48 Add a comment 2022-10-12 18:09:04 -07:00
Jarred Sumner
a97914fff3 Fix require("bun") and import("bun") when statically known 2022-10-12 18:02:18 -07:00
Jarred Sumner
ec00838a03 Update test_scope_debug.ts 2022-10-12 17:47:05 -07:00
Jarred Sumner
860bd53fb3 [bun wiptest] Ignore . folders 2022-10-12 17:10:03 -07:00
Jarred Sumner
477638435c Update README.md 2022-10-12 17:09:37 -07:00
Jarred Sumner
cb384dfa29 Add a bench 2022-10-12 17:00:17 -07:00
Jarred Sumner
dd15a98879 Add hugemem snippet 2022-10-12 16:56:49 -07:00
Jarred Sumner
6b2637468c Add snippet 2022-10-12 16:50:57 -07:00
Jarred Sumner
ab4f4bca6d Add a doc on Bun.spawn 2022-10-12 16:39:26 -07:00
Jarred Sumner
73a611a3b9 Stop keeping the process alive for too long 2022-10-12 16:39:12 -07:00
Jarred Sumner
c5333ab597 support array as first arg in Bun.spawn 2022-10-12 14:43:24 -07:00
Jarred Sumner
75e8c4699c Fix test bug 2022-10-12 01:47:48 -07:00
Jarred Sumner
8fcb0ff0b6 Remove dead code 2022-10-11 23:45:23 -07:00
Jarred Sumner
dbd569d2ab remove config struct 2022-10-11 23:44:35 -07:00
Jarred Sumner
40eca63653 Fix crash when decoding latin1 rope strings and the GC is running 2022-10-11 22:42:19 -07:00
Jarred Sumner
e7eadcde5a Implement Bun.spawnSync 2022-10-11 22:21:06 -07:00
Jarred Sumner
36adee4dc8 Make Bun.spawn work on Linux 2022-10-11 20:25:16 -07:00
Jarred Sumner
9fe1ad93cb Fixup example 2022-10-11 20:00:04 -07:00
Jarred Sumner
8311761c82 Handle eintr in uSockets 2022-10-11 15:39:58 -07:00
Jarred Sumner
8702f965a2 Add test for Bun.file() for stdin and stdout 2022-10-11 14:56:49 -07:00
Jarred Sumner
888a685e26 Maybe fix linux bug? 2022-10-11 13:53:31 -07:00
Jarred Sumner
51c1d18e68 Update server.zig 2022-10-11 01:44:14 -07:00
Jarred Sumner
af6476ca74 Work around Zig C ABI bug on Linux 2022-10-11 01:10:39 -07:00
Jarred Sumner
614d256cb6 Use poll() to check if writable 2022-10-11 00:07:13 -07:00
Jarred Sumner
3867431ed1 Add test that reads & writes stdin/stderr 2022-10-11 00:04:48 -07:00
Jarred Sumner
1f7f5646de Update bun-write.test.js 2022-10-11 00:03:37 -07:00
Jarred Sumner
40623cf967 Implement fs.rm cross-platformly 2022-10-11 00:03:32 -07:00
Jarred Sumner
d07e4f8bd1 Automatically close stdout/stderr on subprocess exit if possible 2022-10-10 22:16:19 -07:00
Jarred Sumner
e4bf189e9d Change behavior of Bun.write 2022-10-10 21:01:06 -07:00
Jarred Sumner
2292ef8d0e Keep the process alive 2022-10-10 21:00:39 -07:00
Jarred Sumner
a114af4eea Use write() and read() since not every file type supports positional 2022-10-10 20:59:34 -07:00
Jarred Sumner
5152aebde1 Handle EAGAIN in Bun.write() for short input 2022-10-10 20:58:58 -07:00
Jarred Sumner
1310a1d99e Ensure we set globalThis in the FileBlob / FileSink 2022-10-10 20:58:43 -07:00
Jarred Sumner
a20d3eaebb Support cache with same name applied to multiple getters 2022-10-10 20:58:19 -07:00
Jarred Sumner
3cc61f8e30 Fix issue with exit callback in Bun.spawn() never firing 2022-10-10 20:57:38 -07:00
Jarred Sumner
ef2c9c330c Process inherits from EventEmitter 2022-10-10 20:27:04 -07:00
Jarred Sumner
5db06105ba Add test for calling assert 2022-10-10 13:51:45 -07:00
Jarred Sumner
24433ceb27 use tweaked CJS transform 2022-10-10 13:51:25 -07:00
Jarred Sumner
ff797f7410 Poll in 2022-10-09 20:38:31 -07:00
Jarred Sumner
cef32c1123 Don't set CLOEXEC 2022-10-09 20:32:10 -07:00
Jarred Sumner
50d4cedd92 Add section about upgrading in the readme 2022-10-09 19:33:07 -07:00
Jarred Sumner
27ad376071 Bump version 2022-10-09 19:04:25 -07:00
Jarred Sumner
eebcd30067 Bun.write - truncate empty files 2022-10-09 18:57:03 -07:00
Jarred Sumner
1afe2f05dc Rename resposne.file.test.js -> bun-write.test.js + add some large file tests 2022-10-09 18:26:00 -07:00
Jarred Sumner
170e3117d7 maybe workaround C ABI issue on linux amd64 2022-10-09 14:30:00 -07:00
Jarred Sumner
fc08e69039 Missing code 2022-10-09 02:20:16 -07:00
Jarred Sumner
25918ddd2a More careful code for FileBlobLoader and FIleSink 2022-10-09 02:02:47 -07:00
Jarred Sumner
edfd2af949 Update WebKit 2022-10-09 02:02:47 -07:00
Jarred Sumner
dffaeaca1e Start to add tests for spawn 2022-10-09 02:02:47 -07:00
Jarred Sumner
88bdae8218 Add a test for server.reload() 2022-10-09 02:02:47 -07:00
Jarred Sumner
fdfe00452b Add a console.debug for the server:port when HMR is enabled 2022-10-09 02:02:47 -07:00
Jarred Sumner
b38d553d60 Update WebKit 2022-10-09 02:02:47 -07:00
Jarred Sumner
0833275f03 Buffer input & output until the user gets the stream 2022-10-09 02:02:47 -07:00
Jarred Sumner
4252d015ca soem helpers 2022-10-09 02:02:47 -07:00
Jarred Sumner
9fd0072740 Don't forget to load SQLite in Database.deserialize
Fixes https://github.com/oven-sh/bun/issues/1304
2022-10-09 02:02:47 -07:00
Jarred Sumner
4dbbdb1671 Clean up how we reload entry point a little 2022-10-09 02:02:47 -07:00
Jarred Sumner
4b5c9acc72 Update bench 2022-10-09 02:02:47 -07:00
Jarred Sumner
b63218206d Add some more bench snippets 2022-10-09 02:02:47 -07:00
Jarred Sumner
349ccf229b Fix navigator.userAgent test 2022-10-09 02:02:47 -07:00
Jarred Sumner
85602b406a Fix SQLite test 2022-10-09 02:02:47 -07:00
Jarred Sumner
cc6077fbf5 Snippet for return await 2022-10-09 02:02:47 -07:00
Jarred Sumner
495534a054 Expose Bun.version and Bun.revision 2022-10-09 02:02:46 -07:00
Jarred Sumner
57513f38d3 Add a test for Bun.version 2022-10-09 02:02:46 -07:00
Jarred Sumner
0b3abf2c78 Add a test for not logging .env 2022-10-09 02:02:46 -07:00
Jarred Sumner
9294ef73b7 Update WebKit 2022-10-09 02:02:46 -07:00
zhiyuan
36ec06493e Fix fetch response redirected (#1303)
* fix: sync codegen

* fix: generate class script

* fix: sync codegen

* fix: add response redirected property
2022-10-08 22:36:33 -07:00
zhiyuan
6068ad15d4 fix: install error when node_modules already in npm package (#1301) 2022-10-08 02:16:16 -07:00
Jarred Sumner
c2c9173eff Fix https://github.com/oven-sh/bun/issues/1263
What happened: when moving to uSockets for the http client, I forgot to call `SSL_set_tlsext_host_name` and uSockets apparently doesn't do that
2022-10-08 01:06:35 -07:00
zhiyuang
99e7856269 Fix nested modules bin executable issue (#1299) 2022-10-07 09:48:37 -07:00
Jarred Sumner
1355d415e9 Fix linux amd64 crash 2022-10-06 22:14:05 -07:00
Jarred SUmner
410059c9f3 Fix unused arg 2022-10-06 16:23:46 -07:00
Jarred SUmner
80096884f6 Add --profile to bun upgrade 2022-10-06 16:23:08 -07:00
Jarred Sumner
d2dd2ae306 Add protocol getter to Bun.serve() 2022-10-06 15:02:56 -07:00
Jarred Sumner
5c3ce875b2 Automatically support hot reloading with export default { fetch() } 2022-10-06 14:21:14 -07:00
Jarred Sumner
6970250b57 Fix Buffer.toJSON() 2022-10-06 14:18:12 -07:00
Jarred Sumner
c880c53199 Fix failing linux build 2022-10-06 03:02:07 -07:00
Jarred Sumner
75371d1462 Add WebSocket bindings for uWS 2022-10-06 00:48:55 -07:00
Jarred Sumner
2c762f47c9 Add simple Hot Module Reloading to bun's runtime 2022-10-06 00:47:03 -07:00
Jarred Sumner
3246efa580 Implement Server.reload() 2022-10-06 00:01:02 -07:00
Jarred Sumner
4060afb7c7 Implement console.count and console.countReset
Fixes https://github.com/oven-sh/bun/issues/1296
2022-10-05 18:59:58 -07:00
Jarred Sumner
e4d3f51161 move Bun.spawn into separate file 2022-10-05 18:07:41 -07:00
Jarred Sumner
1777e9d0b1 Add abstraction for ticking async event loop 2022-10-05 18:07:41 -07:00
Jarred Sumner
707b454bf4 Support buffered input in Bun.spawn 2022-10-05 18:07:41 -07:00
Jarred Sumner
ca4c99b1bf Fix interopRequireDefault issue with path :( 2022-10-05 18:07:41 -07:00
Jarred Sumner
a302549d3e Expose private @require symbol 2022-10-05 18:07:41 -07:00
Jarred Sumner
1a7418e890 Mark these strings as not needing to be GC'd 2022-10-05 18:07:41 -07:00
Jarred Sumner
c1219a3b48 [breaking] process.version lies and reports Node 18
See https://twitter.com/jarredsumner/status/1577189928294789122
2022-10-05 18:07:41 -07:00
Jarred Sumner
632e4ac6ac Improve stack traces in fs functions
This is a hack
2022-10-05 18:07:41 -07:00
Jarred Sumner
18ae17871d Export rm in fs/promises 2022-10-05 18:07:41 -07:00
Jarred Sumner
09ebb217dd Temporary hack so res.socket in node:http doesn't throw 2022-10-05 18:07:41 -07:00
Jarred Sumner
dbccfc2b26 Fix missing path/posix and path/win32 2022-10-05 18:07:41 -07:00
Jarred Sumner
28f7240dd3 Handle more edgecases in fs.rm on macOS 2022-10-05 18:07:41 -07:00
Jarred Sumner
9f10956ce1 We need to explicitly flush now 2022-10-05 18:07:41 -07:00
Jarred Sumner
c9a50b2f2d Add a test for simultaneous requests 2022-10-05 18:07:41 -07:00
Jarred Sumner
d683d7185d handle values from native in streams 2022-10-05 18:07:41 -07:00
Jarred Sumner
fc13938fc6 Fix bug with next dev showing raw html instead of the rendered page 2022-10-05 18:07:41 -07:00
Ryan Russell
f8e8b10e10 docs(thread_pool): comment readability improvements (#1241)
Signed-off-by: Ryan Russell <git@ryanrussell.org>

Signed-off-by: Ryan Russell <git@ryanrussell.org>
2022-10-05 16:49:37 -07:00
zhiyuang
050292229f fix: console.log handle circular correctly (#1293) 2022-10-05 16:49:00 -07:00
Jarred Sumner
906e97223a Fix DotEnv Loader ignoring error log level 2022-10-03 11:07:00 -07:00
Jarred Sumner
dc10b24730 Add readdir snippet 2022-10-03 01:58:57 -07:00
Jarred Sumner
d3ef6c330a node:fs implement rm on macOS
no linux yet
2022-10-03 01:10:38 -07:00
Jarred Sumner
4700762132 Bun.spawn start to implement support for buffered input (ArrayBuffer, Response, Request body) 2022-10-03 01:09:16 -07:00
Jarred Sumner
08d606c3d7 Fix undefined is not a function error in WritableStream 2022-10-03 01:07:54 -07:00
Jarred Sumner
ed82b919a0 Remove extra green 2022-10-02 18:02:54 -07:00
Jarred Sumner
4fa065180b Fix test expectation counter 2022-10-02 16:06:47 -07:00
Jarred Sumner
cd9b47315c Reduce memory usage of HTTP requests by 8 KB 2022-10-02 01:59:59 -07:00
Jarred Sumner
062c3948ba Fix test failures 2022-10-02 01:56:55 -07:00
Jarred Sumner
bff3b902e8 Fix unref'ing websocket 2022-10-01 18:06:01 -07:00
Jarred Sumner
3b4900193b Fix setTimeout(0), improve test coverage slightly, reduce memory usage of timers 2022-10-01 16:02:29 -07:00
Jarred Sumner
bab317edd1 [napi] Implement napi_remove_wrap 2022-10-01 13:23:32 -07:00
Jarred Sumner
1dac9248ad Add missing type check to napi_wrap
Fixes https://github.com/oven-sh/bun/issues/1286
2022-10-01 13:22:16 -07:00
Jarred Sumner
c57b32fa0c [bun:test] When there are lots of tests, print the failures at the bottom so you can see them easier 2022-10-01 01:46:34 -07:00
Jarred Sumner
43c22b4411 Fix release mode value semantics bug 2022-10-01 01:46:02 -07:00
Jarred Sumner
bee72be733 Increase test coverage for request body streaming
There is still one memory issue to address
2022-10-01 01:13:27 -07:00
Jarred Sumner
ea159b6004 Make setTimeout/setInterval more reliable 2022-09-30 22:12:31 -07:00
Jarred Sumner
ac72f28fc8 Fix body mixin 2022-09-30 20:38:25 -07:00
Jarred Sumner
e4e7966d64 Fix failing tests from backpressure 2022-09-30 19:43:03 -07:00
Jarred Sumner
48cb526e0b Eagerly receive incoming request bodies 2022-09-30 18:49:25 -07:00
Jarred Sumner
fd6d28a9fa Fix outdated type 2022-09-30 18:46:58 -07:00
Jarred Sumner
944dc988bf Simplify some of this 2022-09-30 18:46:50 -07:00
Jarred Sumner
2fac218a36 Delete some code 2022-09-30 18:45:02 -07:00
Jarred Sumner
16c184efdf Add a couple assertions 2022-09-30 18:44:48 -07:00
Jarred Sumner
6b5c49c269 Fix incorrect first number in byte stream 2022-09-30 18:38:36 -07:00
Jarred Sumner
af6a43c49b Attempt to address .write() bug 2022-09-30 01:27:35 -07:00
Jarred Sumner
18310cfd7c Fix unnecessary "Buffer is detached" error 2022-09-30 01:08:53 -07:00
Jarred Sumner
9046767da4 Request->url == string, not ZigString now 2022-09-30 01:08:34 -07:00
Jarred Sumner
f70c83345a Improve test coverage for Request body streaming! 2022-09-30 01:07:53 -07:00
Jarred Sumner
52f5f9545a Fix OOB when multiple headers have the same name length
Fixes https://github.com/oven-sh/bun/issues/1279
2022-09-30 01:07:35 -07:00
Jarred Sumner
1434fb66d3 Add a better wrapper function for promises 2022-09-30 01:06:42 -07:00
Jarred Sumner
f325a0016b Use poll_ref in the io tasks 2022-09-30 01:06:28 -07:00
Jarred Sumner
9d7bcac680 Support all ArrayBufferView in all hashing functions and node fs functions 2022-09-30 01:06:04 -07:00
Jarred Sumner
8d11ab3c35 Verbose flag 2022-09-30 01:05:40 -07:00
Jarred Sumner
56e491ad8a Use pollref in FileBlobLoader 2022-09-30 01:05:33 -07:00
Jarred Sumner
9296a369de Fixup Body mixin implementation 2022-09-30 01:05:10 -07:00
Jarred Sumner
9050e6ee87 Use PollRef in napi 2022-09-30 01:04:20 -07:00
Jarred Sumner
84af4f0133 more gc in fs test 2022-09-30 01:04:10 -07:00
Jarred Sumner
6338413696 Remove extraneous calls to .ref() 2022-09-30 00:44:36 -07:00
Jarred Sumner
fbec7bda6a Add hidden verbose flag to fetch (the third argument)
```js
fetch(url, {body: ""}, {verbose: true})
```
2022-09-30 00:29:31 -07:00
Jarred Sumner
0f371a2869 [internal] Use PollRef for fetch() 2022-09-30 00:27:39 -07:00
Jarred Sumner
c30346cf5d Create test_scope_debug.ts 2022-09-30 00:25:28 -07:00
Jarred Sumner
64ef2389dc fix potentially truncated encodeInto 2022-09-30 00:06:46 -07:00
Jarred Sumner
6ec55cbeeb Fixup 2022-09-29 18:20:54 -07:00
Jarred Sumner
3430cdd91b don't need to mark 2022-09-29 18:01:12 -07:00
Jarred Sumner
9702568161 Lazy URL, more explicit close() 2022-09-29 17:58:04 -07:00
Jarred Sumner
016a9d6535 Update base.zig 2022-09-29 10:52:41 -07:00
Jarred Sumner
9f10c1a805 Fix Bun.serve not keeping process alive 2022-09-29 10:26:40 -07:00
Jarred Sumner
7631a47612 Fix console.log(ModuleNamespace) 2022-09-29 00:22:51 -07:00
Jarred Sumner
b8851143f9 Update streams.zig 2022-09-28 23:56:38 -07:00
Jarred Sumner
f3028ff6f3 Use uSockets for setTimeout and setInterval 2022-09-28 23:45:31 -07:00
Jarred Sumner
3d35fae890 Add some tests for request body streaming
Need to fix an off-by-one error with Blob it seems
2022-09-28 23:43:40 -07:00
Jarred Sumner
1636291b03 /s/c_int/i32 2022-09-28 23:39:10 -07:00
Jarred Sumner
e69e8d35b9 Fix unreachable 2022-09-28 23:38:54 -07:00
Jarred Sumner
9438540bf9 Fix a crash with fetch(url, {body: arrayBuffer}) introduced with the Blob changes
cc @bwasti
2022-09-28 23:38:42 -07:00
Jarred Sumner
d34179b9eb Queue tests rather than run immediately 2022-09-28 23:38:04 -07:00
Jarred Sumner
90074ce98c Clean up WebSocket never starting 2022-09-28 23:37:40 -07:00
Jarred Sumner
fd0054a800 Outer event loop tweaks 2022-09-28 23:37:09 -07:00
Jarred Sumner
0fb5f15673 Fix a crash in HTMLRewriter caused by blob changes 2022-09-28 23:34:12 -07:00
Jarred Sumner
16929129f0 Clean up some of the event loop code 2022-09-28 23:34:03 -07:00
Jarred Sumner
524e48a81d make bun:test ~300x faster when using http server, websockets, etc
there was an event loop bug
2022-09-28 23:07:18 -07:00
Jarred Sumner
76b1a3a88d Bench snippet for Array.map 2022-09-28 14:38:15 -07:00
Jarred Sumner
b74351e55f Support a default object in CommonJS wrapper
Fixes https://github.com/oven-sh/bun/issues/1284

Related to https://github.com/oven-sh/bun/issues/1285
2022-09-28 14:37:35 -07:00
Jarred Sumner
a1b4dc42cb Implement reportExtraMemoryVisited and reportExtraMemoryAllocated in bindings 2022-09-28 14:36:44 -07:00
Jarred Sumner
5ae5125919 size estimatoor 2022-09-28 11:10:20 -07:00
Jarred Sumner
82a68cd3da fixup 2022-09-28 00:52:25 -07:00
Jarred Sumner
a41150836a Add missing commit 2022-09-28 00:20:12 -07:00
Jarred Sumner
e637b43117 Add missing commit 2022-09-28 00:18:50 -07:00
Jarred Sumner
443ba0f396 Inline blobs in the HTTP server 2022-09-28 00:12:31 -07:00
Jarred Sumner
71ea4a2c9b Fix several bugs with Request body streaming + store small response bodies without an extra memory allocation 2022-09-28 00:11:15 -07:00
Jarred Sumner
a8ab18bd50 Fix potential crash when TS code has an unexpected ")" 2022-09-27 09:40:29 -07:00
Jarred Sumner
ce91423a19 Update streams.zig 2022-09-26 20:49:44 -07:00
Jarred Sumner
5875d1419b Make Bun.spawn, FileSink and FileBlobLoader a little more reliable 2022-09-26 20:35:26 -07:00
Jarred Sumner
24a9bc23b7 [Web Streams] Add body to Response and Request (#1255)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-09-26 20:04:28 -07:00
Jarred Sumner
97c3688788 Make getting the body for fetch a little more reusable 2022-09-26 20:00:34 -07:00
Jarred Sumner
0b915b1dd2 Add missing ignoreUsage call 2022-09-26 19:59:38 -07:00
Jarred Sumner
5fcbfa780f Bump WebKit 2022-09-26 19:59:09 -07:00
Jarred Sumner
a736010fdd Fix crash when insufficient arguments 2022-09-26 10:30:33 -07:00
Jarred Sumner
b733125085 Fix console.log not printing an empty line
Depends on https://github.com/oven-sh/WebKit/actions/runs/3123884691/jobs/5066828848

Fixes https://github.com/oven-sh/bun/issues/1276
2022-09-25 15:49:35 -07:00
Jarred Sumner
5ef36f1b6f Implement isatty in node:tty 2022-09-25 14:56:22 -07:00
Jarred Sumner
7cc772cd39 😪 2022-09-25 13:14:23 -07:00
Jarred SUmner
7ae73fad68 Make Linux implementation work 2022-09-25 13:14:23 -07:00
Jarred Sumner
96dcfd3cfe Linux implementation 2022-09-25 13:14:23 -07:00
Jarred Sumner
9833841101 wip 2022-09-25 13:14:23 -07:00
Jarred Sumner
1cd67b62e9 Update package.json 2022-09-25 13:14:23 -07:00
Jarred Sumner
ffde9f7842 📷 2022-09-25 13:14:23 -07:00
Albert Putra Purnama
2819509786 test: Promisify basic tests (#1018)
* Promisify basic tests

* Add License header from node

* Add tests to complete existing promisify parity with node

* Update expected error message from nodejs test
2022-09-24 19:05:18 -07:00
Jarred Sumner
5b222996c8 Update bindings.zig 2022-09-23 03:21:38 -07:00
Jarred Sumner
62e22b2995 Implement Bun.which 2022-09-23 03:10:56 -07:00
Jarred Sumner
2346be55fc Fix issue with react-is in bun-framework-next 2022-09-23 00:31:45 -07:00
Jarred Sumner
61d0c4042b Use JSC heap for .arrayBuffer() 2022-09-23 00:26:23 -07:00
Jarred Sumner
de0b373c7c Update streams.zig 2022-09-22 23:53:00 -07:00
Jarred Sumner
2c1926993b Faster Blob + begin to implement FileSink 2022-09-22 23:45:02 -07:00
Jarred SUmner
e14a3af491 Fix linux build 2022-09-22 03:25:29 -07:00
Jarred Sumner
0968fd339f Add epoll to list of syscalls that can fail 2022-09-22 03:06:48 -07:00
Jarred Sumner
2ca1861a54 Remove a mutex when enqueuing concurrent tasks 2022-09-22 02:38:36 -07:00
Jarred Sumner
ce9daa4857 1 event loop per thread. Instead of 3.
uWebSockets and uSockets will need to be upgraded to match the changes.

Previously:
- Bun had a separate kqueue/eventfd just for async wakeups.
- Bun had a separate kqueue/epoll just for reading files non-blocking in the same thread

This commit unifies it into one event loop per thread
2022-09-22 02:25:32 -07:00
Jarred Sumner
e15fb6b9b2 [breaking] Bun.serve().hostname should return the hostname instead of the baseURI
Previously Bun.serve().hostname was returning the baseURI, effectively the `origin`

That was incorrect.

Instead, it should be returning the hostname
2022-09-22 01:57:06 -07:00
Jarred Sumner
f1ffc72a62 Fix bun run foo -- by ignoring -- 2022-09-22 01:56:07 -07:00
Jarred Sumner
37eee4235d Fix preact & other "classic" jsx transforms, most likely 2022-09-21 20:00:12 -07:00
Jarred Sumner
871d530d6a Fix crash with jsxFragment and jsxFactory in tsconfig.json
Fixes https://github.com/oven-sh/bun/issues/1269
2022-09-21 19:55:30 -07:00
Jarred Sumner
16b1e84138 Fix crash when creating an empty array 2022-09-21 18:52:24 -07:00
Jarred Sumner
100ce7b62f Increase macro stack size 2022-09-21 00:00:46 -07:00
Jarred Sumner
c01cba3ab5 Update types.zig 2022-09-20 23:57:45 -07:00
Jarred Sumner
ef1607c088 fixup 2022-09-20 23:57:07 -07:00
Jarred Sumner
123e8c8d2b Update WebKit 2022-09-20 23:56:08 -07:00
Jarred Sumner
9667eec9de Be more careful with process.argv 2022-09-20 23:56:08 -07:00
Hemanth Krishna
26625f3e2a fix: add destination to ADD command in Dockerfile (#1268)
Signed-off-by: Hemanth Krishna <hkpdev008@gmail.com>

Signed-off-by: Hemanth Krishna <hkpdev008@gmail.com>
2022-09-20 23:43:21 -07:00
Jarred Sumner
e94e6d8d95 Allow .env files to define the same key multiple times
Fixes https://github.com/oven-sh/bun/issues/1262
2022-09-20 01:02:15 -07:00
Jarred Sumner
f0bc50eb71 meant to include this in the previous commit 2022-09-20 00:45:19 -07:00
Jarred Sumner
6163fb830e Add navigator.userAgent , navigator.hardwareConcurrency 2022-09-20 00:44:59 -07:00
Jarred Sumner
167948f5c3 Fix incorrect hostname logic
Fixes https://github.com/oven-sh/bun/issues/1261
2022-09-20 00:07:01 -07:00
Jarred Sumner
37d191bc02 Update process.argv to more closely match node 2022-09-19 23:37:26 -07:00
Jarred Sumner
da7b648971 Pass through arguments unmodified after bun run <script> or bun <script>
Fixes https://github.com/oven-sh/bun/issues/231
2022-09-19 23:37:08 -07:00
Jarred Sumner
8b7f43f855 Handle nested files more correctly with "imports" in package.json 2022-09-19 21:02:26 -07:00
Jarred Sumner
21770eb0f3 Implement imports in package.json (#foo imports)
Fixes https://github.com/oven-sh/bun/issues/478
Fixes https://github.com/oven-sh/bun/issues/234
Fixes https://github.com/oven-sh/bun/issues/822
2022-09-19 20:03:02 -07:00
Jarred Sumner
17be8023d9 Fix broken destructors 2022-09-19 17:26:30 -07:00
Jarred Sumner
9754c5b32b Fix larger bodies 2022-09-19 05:50:10 -07:00
Jarred Sumner
a16cb39423 Improve the perf of reading HTTP request body 2022-09-18 18:45:34 -07:00
Jarred Sumner
dfefb05b10 Fix occasional crash with .json() 2022-09-18 18:37:55 -07:00
Jarred Sumner
55bdf2682c Update build-id 2022-09-18 04:09:03 -07:00
Jarred Sumner
3a50ae92ec Fix broken sending http body 2022-09-18 04:00:40 -07:00
Jarred Sumner
fe77f6a2f3 Update http_client_async.zig 2022-09-18 02:34:58 -07:00
Jarred Sumner
cd35218141 Add a way to disable timeout and keepalive 2022-09-18 02:30:52 -07:00
Jarred Sumner
daeef8d5b3 extremely minor perf nit 2022-09-17 22:14:38 -07:00
Kit PANG
184230058a feat: env loader nested values with curly braces (#1246)
* [env loader] Add support for nested value with curly braces

does not support default values for nested values, e.g., ${undefined:default}, ${undefined:-default}, or ${undefined-default}

* fix: minor fix and add more test

* [env loader] Improve nested value parsing performance

remove unnecessary branching

Co-authored-by: Like <like@ekil.sh>
2022-09-17 22:11:16 -07:00
Jarred Sumner
a08b323e61 Fix napi module registration
Fixes https://github.com/oven-sh/bun/issues/1240
2022-09-17 21:56:30 -07:00
Jarred Sumner
745cc5c655 Handle missing 0\r\n chunk in HTTP client 2022-09-17 21:45:03 -07:00
Jarred Sumner
3719c3b736 Update & configure SSL a little 2022-09-17 21:45:03 -07:00
Jarred Sumner
0e424de684 Update WebKit 2022-09-17 21:45:03 -07:00
Jarred Sumner
285ef0ca01 Explicitly enable ShadowRealm 2022-09-17 21:45:03 -07:00
Greg Brimble
ce0df52b7e Update macOS contributing instructions (#1247) 2022-09-17 17:49:46 -07:00
Jarred Sumner
e03204dccf Avoid undefined memory 2022-09-17 17:41:13 -07:00
Jarred Sumner
0dea2d8515 Smaller stack 2022-09-17 17:40:50 -07:00
Jarred Sumner
31469bb05b Prevent returning resolved promises 2022-09-17 04:39:59 -07:00
Jarred Sumner
b4f8e5cdb9 Fix default hostname 2022-09-17 04:31:29 -07:00
Jarred Sumner
cefec77646 Partially implement server.fetch() on Bun.serve 2022-09-17 04:28:32 -07:00
Hyro
7c7adc1361 chore: add napi label (#1245) 2022-09-17 02:54:41 -07:00
Jarred Sumner
af6609b0a3 [bun install] Add a package index via symlinks to ~/.bun/install/cache 2022-09-17 01:12:59 -07:00
Jarred Sumner
3ae950d829 Fix missing reason and code in CloseEvent
cc @paperdave

hardcoded right now but at least tells you why it closed
2022-09-17 00:42:20 -07:00
Jarred Sumner
c2f64d4da1 Fix crash when specifying same package name twice in bun add
Fixes https://github.com/oven-sh/bun/issues/1202
2022-09-17 00:21:10 -07:00
Jarred Sumner
9b941dd800 Update build-id 2022-09-16 22:58:31 -07:00
Jarred Sumner
4b9f6baf79 Make fetch throw a SystemError on reject 2022-09-16 22:50:46 -07:00
Jarred Sumner
a675cbd13b Fix issue with chunked transfer encoding 2022-09-16 22:38:09 -07:00
Jarred Sumner
bd77afb2df Fix issue with server not starting before exiting 2022-09-16 22:36:06 -07:00
Jarred Sumner
681f5a521f [bun install] Remove spinloop 2022-09-16 16:53:17 -07:00
Jarred Sumner
f55b9a8530 Fix origin missing protocol in URL
Fixes https://github.com/oven-sh/bun/issues/1244
2022-09-16 16:45:26 -07:00
Jarred Sumner
da6f954e0d Fix process not exiting 2022-09-16 14:28:07 -07:00
Jarred Sumner
453eaf6871 Fix crash when parsing empty JSON file 2022-09-16 03:20:28 -07:00
Jarred Sumner
0ce709d96a Make new HTTP client more stable 2022-09-16 00:53:03 -07:00
Jarred Sumner
fd808dec52 Use entropy cache for websocket mask 2022-09-14 21:35:12 -07:00
Jarred Sumner
ac949f8181 Fix issue with websockets callback not registering in canary 2022-09-14 21:34:29 -07:00
Jarred Sumner
48c2c8c049 woops that was wrong 2022-09-14 19:29:16 -07:00
Jarred Sumner
2e2e134a1b typo 2022-09-14 19:25:16 -07:00
Jarred Sumner
4e8bd97d9c Update crypto.mjs 2022-09-14 19:24:56 -07:00
Jarred Sumner
a31eb6a80c Add missing getRandomValues to crypto polyfill 2022-09-14 19:15:05 -07:00
Jarred Sumner
b0dd7bee5b Update crypto benchmark 2022-09-14 18:25:06 -07:00
Jarred Sumner
a291c1676f 5x faster crypto.randomValues() 2022-09-14 18:23:22 -07:00
Jarred Sumner
7bfa302b75 Make crypto.getRandomValues() faster + fix > 1 byte/element typed arrays
Fix crypto.getRandomValues() with > 1 byte element typed arrays

Fixes https://github.com/oven-sh/bun/issues/1237
2022-09-14 04:12:32 -07:00
Jarred Sumner
0935ab14d6 Fix Linux 200ms http client delay
https://man7.org/linux/man-pages/man2/send.2.html See the section on MSG_MORE
2022-09-13 17:47:50 -07:00
Jarred Sumner
9797b676b1 Add test 2022-09-11 17:11:23 -07:00
Jarred Sumner
2b02f7eb99 Fix bug with Buffer.from([123], "utf8")
cc @worm-emoji
2022-09-11 17:11:11 -07:00
Jarred Sumner
71e2c26577 Resolve rope strings in dynamic import paths
Fixes https://github.com/oven-sh/bun/issues/1230
2022-09-11 15:30:21 -07:00
Jarred Sumner
b78b36ce33 Fix build issue on Linux? 2022-09-11 15:01:57 -07:00
Jarred Sumner
0130efeedf Hardcode localhost on macOS 2022-09-11 14:59:48 -07:00
Jarred Sumner
35b51fcbb5 typo 2022-09-11 14:46:08 -07:00
Jarred Sumner
9a5aa059f9 New HTTP client (#1231)
* wip

* It mostly works!

* Support `bun install`

* Support `bun create`

* Support chunked transfer encoding

* Handle Keep Alive when redirecting to a different domain

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-09-11 13:37:17 -07:00
Zilin Zhu
8b91360a33 Fix segfault due to GC and some more helper functions (#1221)
* Fix segfault due to GC and some more helper functions

* fix upon reviews

* add visitChildren
2022-09-09 22:48:55 -07:00
Jarred Sumner
85d80d8fb7 Update README.md 2022-09-09 19:49:38 -07:00
Jarred Sumner
695da9ee29 Fix import path issue in ffi bench 2022-09-09 19:45:39 -07:00
Jarred Sumner
d114e9040b Add read to README 2022-09-09 19:45:20 -07:00
Jarred Sumner
c600196b1a [node:fs] Fix readFileSync on non-regular files
Fixes https://github.com/oven-sh/bun/issues/1220
2022-09-09 19:26:02 -07:00
Jarred Sumner
3d8edcb77b Fix potential crash when returning an empty string 2022-09-09 19:20:24 -07:00
Jarred Sumner
f496740c19 [bun:ffi] Add f32, f64, i64, u64 to read` 2022-09-09 18:10:36 -07:00
Jarred Sumner
0c2a207d82 Fix failing tests after ptr change 2022-09-09 17:19:34 -07:00
Jarred Sumner
e9c456ff5c [breaking][bun:ffi] Change the pointer representation to be a 52-bit integer
Storing the pointer this way enables DOMJIT to be used with a new API in `bun:ffi` that lets you efficiently read values from a pointer without creating a new `DataView`

```js
import {read} from 'bun:ffi';
const myPtr = myFunctionThatReturnsAPtr();

// new:
const value = read.u32(myPtr, 0);

// old:
const view = new DataView(toArrayBuffer(myPtr));
const otherValue = view.getUint32(0, true);
```

cc @bwasti this might be a breaking change for that call to `napi_add_finalizer`
2022-09-09 03:12:03 -07:00
Jarred Sumner
bcbe1b410a Last commit was missing some code 2022-09-08 23:37:59 -07:00
Jarred Sumner
206820d27a [bun:ffi] Implement read.{u8,i8,i16,i32,u16,u32,ptr,intptr}
`read` in `bun:ffi` lets you read data from a pointer without creating a new DataView/ArrayBufferView

```
import {read} from 'bun:ffi';

    expect(read.i8(ptr_, i)).toBe(view.getInt8(i, true));
    expect(read.i16(ptr_, i)).toBe(view.getInt16(i, true));
    expect(read.i32(ptr_, i)).toBe(view.getInt32(i, true));
    expect(read.u8(ptr_, i)).toBe(view.getUint8(i, true));
    expect(read.u16(ptr_, i)).toBe(view.getUint16(i, true));
    expect(read.u32(ptr_, i)).toBe(view.getUint32(i, true));
  }
```
2022-09-08 23:29:30 -07:00
Zilin Zhu
8d8b72cf3f Add native helper functions for Readable and convert ReadableState properties to getter/setter (#1218) 2022-09-08 19:52:27 -07:00
Jarred Sumner
a3cc9aaf6f Make some more globals modifiable 2022-09-08 00:00:18 -07:00
Jarred Sumner
812424bf46 Fix crash with file descriptor 2022-09-07 21:21:18 -07:00
Jarred Sumner
8af05c28a3 Add benchmark for small write() performance 2022-09-07 21:20:41 -07:00
Jarred Sumner
970600724d Helper for seeing if a File Blob is seekable 2022-09-07 21:06:00 -07:00
Jarred Sumner
c038f513d3 [Bun.write] clean up some error handling 2022-09-07 20:59:51 -07:00
Jarred Sumner
1e5978ad4f Bun.write - only truncate if its a path string 2022-09-07 19:59:49 -07:00
Jarred Sumner
2dbc991af9 More tests for Bun.write 2022-09-07 19:58:04 -07:00
Jarred Sumner
c4b9c12677 Fix flaky tests 2022-09-07 19:56:23 -07:00
Jarred Sumner
d7759b88ee Handle default better with ESM node 2022-09-07 19:56:11 -07:00
Jarred Sumner
25e4fcf5c8 Fast path for Bun.write with short-ish strings & typed arrays
Helps with https://github.com/oven-sh/bun/issues/646 but does not fully fix
2022-09-07 19:54:51 -07:00
Jarred Sumner
ce382788b0 Mild perf improvement for bindings 2022-09-07 19:53:49 -07:00
Jarred Sumner
c7874ed3fe Fix issue with loading bundled entry points 2022-09-07 00:18:25 -07:00
Jarred Sumner
65affacc50 Fix missing file in SQL-raw test 2022-09-06 21:00:56 -07:00
Jarred Sumner
6e9159a9ad workaround test failure 2022-09-06 20:59:18 -07:00
Jarred Sumner
dda23a6076 Move some things to the stack 2022-09-06 18:32:16 -07:00
Jarred Sumner
8d71a931a3 Add a helper for static strings 2022-09-06 18:31:20 -07:00
Jarred Sumner
0a67d7e951 [Bun.plugin] Fix validating loader 2022-09-06 17:38:08 -07:00
Jarred Sumner
52f3377d9e [Bun.plugin] Throw an error when the loader is invalid 2022-09-06 17:32:00 -07:00
Jarred Sumner
b24a9b29d7 Fix potential crash when resolving package.json "exports"
Have not seen a crash happen here yet
2022-09-06 17:25:22 -07:00
Jarred Sumner
bac93e14ad Fix bug with macros 2022-09-06 17:24:45 -07:00
Jarred Sumner
1454e448e6 [Bun.plugin] Allow slashes in namespaces 2022-09-06 17:24:39 -07:00
Jarred Sumner
9b16e245ba Update README.md 2022-09-06 08:25:08 -07:00
Jarred Sumner
c2f59e72d6 Rename LinkerMap to Aliases to be less confusing 2022-09-06 07:23:05 -07:00
Jarred Sumner
7a5cfc4bae Return a Buffer object for fs.readFile 2022-09-06 07:22:52 -07:00
Jarred Sumner
f5129dbd1a Fix issue with process esm node export 2022-09-06 07:22:25 -07:00
Jarred Sumner
07cbc0193a Set a default Loader based on filename 2022-09-06 07:22:14 -07:00
Jarred Sumner
1c1346dfa9 Add node:assert to list of hardcoded modules to fix ESM compat issue 2022-09-06 07:21:49 -07:00
Jarred Sumner
58af6db3a7 Update README.md 2022-09-06 04:06:06 -07:00
Jarred Sumner
342234eb64 Start to document loader api 2022-09-06 03:48:15 -07:00
Jarred Sumner
93cfc7edbb preserve statements when generating a separate module for bun plugin 2022-09-06 03:37:58 -07:00
Jarred Sumner
5b6a2d9efe Loosen-up the streams polyfill 2022-09-06 03:37:58 -07:00
Jarred Sumner
5ddfd912ef Add @ to acceptable namespace characters 2022-09-06 03:37:58 -07:00
Jarred Sumner
e9cc9ae816 Make the plugins a little more resilient 2022-09-06 03:37:58 -07:00
Jarred Sumner
ba2a7d72e7 Add missing Blob 2022-09-06 03:37:58 -07:00
Jarred Sumner
308affdcf0 Make fs extensible 2022-09-06 03:37:58 -07:00
Jarred Sumner
07e2c898c6 Fix crash in Buffer module 2022-09-06 03:37:58 -07:00
Zilin Zhu
b9fad14f87 Add native ReadableState (#1210)
* use functionSpace for JSStringDecoderConstructor and fix console.log on prototype

* Add native ReadableState

* move kPaused to class property
2022-09-06 00:57:16 -07:00
Jarred Sumner
5a71521021 [Bun.plugin] Clean up exception handling 2022-09-05 23:43:34 -07:00
Jarred Sumner
11aa17a57c Support async onLoad callbacks in Bun.plugin 2022-09-05 23:05:22 -07:00
Jarred Sumner
d2397b60e7 Move generateObjectModuleSourceCode to separate file to fix build error 2022-09-05 05:16:21 -07:00
Jarred Sumner
c31422b308 inline 2022-09-05 05:15:07 -07:00
Jarred Sumner
7ea9909618 Missing #pragma once 2022-09-05 04:43:02 -07:00
Jarred Sumner
62fa5d59cb Rename is_macro_mode -> use_alternate_source_cache 2022-09-04 21:43:53 -07:00
Jarred Sumner
7acf5d3831 Some tests 2022-09-04 00:54:51 -07:00
Jarred Sumner
1112eb75e3 [node:module] Implement _resolveFileName, stub _nodeModulePaths & _cache
Closes https://github.com/oven-sh/bun/issues/1111
2022-09-04 00:54:21 -07:00
Jarred Sumner
ef268c5ee5 @globalPrivate -> @linkTimeConstant
See https://github.com/WebKit/WebKit/pull/2553

I'm not 100% sure @linkTimeConstant is correct. Specifically, I don't know if it's a link time constant or just a global private thing.
2022-09-04 00:52:30 -07:00
Jarred Sumner
15b7f9793f [Node API] Fix napi_module_register 2022-09-03 22:47:00 -07:00
Jarred Sumner
04cc1968db Fix createRequire() in node:module
Fixes https://github.com/oven-sh/bun/issues/831
Fixes https://github.com/oven-sh/bun/issues/453
2022-09-03 21:48:06 -07:00
Jarred Sumner
4891be8d0d Fix C++ intellisense 2022-09-03 21:40:06 -07:00
Jarred Sumner
cc46604bdb Fix build error 2022-09-03 21:03:50 -07:00
Jarred Sumner
bcbd448767 Add a code of conduct
Copied from Rust
2022-09-03 20:54:15 -07:00
tHyt-lab
892c020b00 update example react-is to v18(#1155) (#1172) 2022-09-03 18:52:33 -07:00
Jarred Sumner
8e5b1c44bc Fixes https://github.com/oven-sh/bun/issues/677 2022-09-03 18:49:19 -07:00
Hyro
2340e7e6e5 chore(install-script): automatically add bun to path - bash shell (#1168)
* chore(install-script): automatically add bun to path - bash shell

* add tildify

* chore: make requested changes

* fix: add equals true

Co-authored-by: Wallunen <44848747+Wallunen@users.noreply.github.com>

* fix: $XDG_CONFIG_HOME can be undefined

Co-authored-by: Wallunen <44848747+Wallunen@users.noreply.github.com>

Co-authored-by: Wallunen <44848747+Wallunen@users.noreply.github.com>
2022-09-03 05:01:26 -07:00
PANG, Kit
98ecfc4f76 Fix GitHub CLI installation (#1204)
A workaround for <https://github.com/cli/cli/issues/6175>.
This commit references <https://github.com/devcontainers/features/pull/133>.
2022-09-03 04:10:21 -07:00
Jarred Sumner
0ca42e81f3 Plugin API (#1199)
* Plugin API

* Fix the bugs

* Implement `"object"` loader

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-09-03 03:57:43 -07:00
Dylan Conway
8b2d07e82e fixed is_export and added test cases (#1203) 2022-09-03 01:39:24 -07:00
Jarred Sumner
3e9f7ab3e4 Update devcontainer scripts
Won't work until https://github.com/cli/cli/issues/6175 is fixed
2022-09-02 16:15:23 -07:00
usrtax
89524d55bd allow set proxy for github (#1198)
in  china , github is blocked, we use https://ghproxy.com/ for proxy

for example
use
`wget https://ghproxy.com/https://github.com/stilleshan/ServerStatus/archive/master.zip`
instead of 
`wget https://github.com/stilleshan/ServerStatus/archive/master.zip`
2022-09-01 23:12:33 -07:00
Zilin Zhu
2dc07d7505 Fix failing Buffer tests (#1197) 2022-09-01 23:11:09 -07:00
Jarred Sumner
4e73726bee Delete some dead code 2022-09-01 20:34:41 -07:00
Jarred Sumner
dfc27e3c30 Clean up options 2022-09-01 20:22:54 -07:00
Jarred Sumner
c78f7463a9 Add missing directories to make devcontainer 2022-09-01 16:32:27 -07:00
Jarred Sumner
793a42e7f5 [bun run] Silence .env loaded log
Fixes https://github.com/oven-sh/bun/issues/1192
2022-09-01 15:31:22 -07:00
Zilin Zhu
700c31dd13 Add native StringDecoder (#1188)
* Add native StringDecoder

* fix upon reviews

* add Constructor and use LazyClassStructure
2022-09-01 12:56:41 -07:00
Jarred Sumner
f023b89b73 Fix crash in napi finalizer 2022-09-01 01:58:42 -07:00
Jarred Sumner
5eb431dcd0 Fixes https://github.com/oven-sh/bun/issues/1183 2022-09-01 01:08:59 -07:00
Ikko Ashimine
5d99398850 Fix typo in futex.zig (#1186)
Therefor -> Therefore
2022-09-01 00:14:20 -07:00
Johan Bergström
43fc696d7b readme: remove recurse flag from xattr (#1182)
This shouldn't be necessary since we're only doing it for one file.

Fixes: https://github.com/oven-sh/bun/issues/1180
2022-09-01 00:14:01 -07:00
Bram Wasti
bfe9d594a9 Add profiler support (#1110) 2022-08-30 19:31:58 -07:00
Taher
8651799097 Fixed JSBuffer write issues (#1175) 2022-08-29 13:09:46 -07:00
Jarred Sumner
9d8fb81413 Improve error when FFI fails to dlopen() 2022-08-29 13:02:02 -07:00
Zilin Zhu
34c0f77319 chore: Clean buffer C API (#1174) 2022-08-29 05:09:47 -07:00
Jarred Sumner
7b628ca09c Fixes https://github.com/oven-sh/bun/issues/1127 2022-08-29 03:26:07 -07:00
Jarred Sumner
5dc260d07e Update README.md 2022-08-28 22:02:27 -07:00
Jarred Sumner
86ac5f09bc Update README.md 2022-08-28 22:01:07 -07:00
Jarred Sumner
1c492e2791 Update package.json 2022-08-28 21:51:24 -07:00
Jarred Sumner
d7dbe6f329 Remove code that doesn't work 2022-08-28 21:46:47 -07:00
Jarred Sumner
c1734c6ec5 More reliable macOS event loop (#1166)
* More reliable macOS event loop

* Reduce CPU usage of idling

* Add another implementation

* Add benchmark

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-08-28 21:28:05 -07:00
yepitschunked
b2141a204f feat: hack in support for tsconfig extends (#1147)
* hack in support for extends

* Update src/resolver/resolver.zig

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* wip review fixes

* fix style

Co-authored-by: Victor Lin <victor.lin@airbnb.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Victor Lin <vlin@twitter.com>
2022-08-28 21:21:20 -07:00
Zilin Zhu
ce90e0c372 support pass null as NULL ptr (#1160) 2022-08-28 06:19:53 -07:00
Jarred Sumner
296fb41e92 [bun:ffi] Fix crash with uint64_t 2022-08-28 00:39:08 -07:00
Jarred Sumner
30992a8b05 [bun:ffi] Fix int16 / uin16 max 2022-08-28 00:28:50 -07:00
Jarred Sumner
af5c4dedca Update WebKit (#1165)
* Update WebKit

* Fix `DataView` and non-8 bit sized typed arrays with TextDecoder

* New WebKit

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-08-27 23:46:05 -07:00
Jarred Sumner
8b3afa5831 Fix crash in os module on macOS 2022-08-27 17:30:34 -07:00
Jarred Sumner
574ecfb9c4 Update Makefile 2022-08-27 16:57:43 -07:00
Jarred Sumner
466f9a3eb0 Update Makefile 2022-08-27 16:27:28 -07:00
Zilin Zhu
6644c2fd17 Fix ffi uint64_t parameter (#1158) 2022-08-27 12:32:13 -07:00
Zilin Zhu
49447decdd fix compile error (#1157) 2022-08-27 02:59:07 -07:00
Dylan Conway
4720270763 added shell to STRIP variable definition (#1156) 2022-08-27 00:37:48 -07:00
Jarred Sumner
e49dcfeff7 Update napi.zig 2022-08-26 18:50:22 -07:00
Jarred Sumner
70e778c2a8 Remove pointer to stack buffer in os module and fix build issue
We cannot have pointers to stack memory returned in the same scope because that memory is no longer valid at the end of the scope

cc @xHyroM
2022-08-26 18:50:15 -07:00
Jarred Sumner
975477d0f0 Implement napi_add_finalizer 2022-08-26 18:28:01 -07:00
Jarred Sumner
1580b5fb56 Fix debug build cache 2022-08-26 18:27:52 -07:00
Max Thomson
ebf4ac4e83 fix: Update broken README links (#1148) 2022-08-26 02:51:57 -07:00
Jarred Sumner
64b3d28d41 Update node_fs.zig 2022-08-26 01:59:13 -07:00
Zilin Zhu
07a4b26697 fix mkdtemp (#1151)
* fix mkdtemp

* Update src/bun.js/node/node_fs.zig

* Update src/bun.js/node/node_fs.zig

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2022-08-26 01:22:25 -07:00
Zilin Zhu
cf55a38879 Add native BufferList (#1146)
* add simple methods

* add native BufferList

* use RopeBuilder

* use Deque
2022-08-25 21:12:45 -07:00
Hyro
7a734e0a28 feat: implement native os module (#1115)
* feat: implement os module

* revert(bun-error): package-lock.json

* feat: implement EOL

* feat: implement EOL

* feat: implement arch function

* feat: implement homedir function

* add comptime to homedir if

* feat: add platform function

* feat: implement type function

* feat: add hostname (not sure iff works on all platforms)

* chore: make requested changes

* fix: change toValueGC into toValue in arch function

* add EOL, devNull constant variables

* fix: store only string

* feat: add tests

* feat: add endianness

* ususe toValue for devNull & EOL

* feat: implement endianness & fix release

* revert javascript.zig fix

* feat: implement tmpdir

* feat: implement totalmem, freemem, uptime

* feat: loadavg

* feat: implement version

* feat: add userInfo

* feat: implement totalmem for macos

* feat: add getPriority (not finished, waiting for dc response)

* feat: finish userInfo implementation

* feat: implement cpus, not done

* feat: finish getPriority implementation & stats cpus()

* feat: implement setPriority

* reemove test.c

* feat: implement constants.dlope.xn, constants.priority.x, constants.UV_UDP_REUSEADDR

* feat: implement signals, errno

* updated cpus function, stilldoesnt work

* increase object length

* feat: add t more ests

* feat: add cpus()

* remov some files

* fix: handle empty array

* started working on interface addresses (in C)

ill use C++ after it work

* fix interface_addresses

* Improved getCpuInfo code, decreased ram usage, increased speed

* getCpuTime optimizations

* started working on networkInterfaces

* feat: networkInterfaces implementation

* delete unnecessary files

* add benchs & fix code

* add tests

* add missing benchs

* Increased buffer of getCpuInfo to 2048, it should skip few iterations

* remove hardcoded constants

* feat: implement errno constants

* fix getWindowsErrorConstant

* feat: add signal constants

* feat: implement priority constants

* remove duplications

* fix: change value to ?i16

* fix(__defineConstant): make some parameters comptime, change value to ?i32

* fix: add E to ERRNO constants, add SIG to SIG constants

* feat: add dlopen constants

* change functions to private

* feat: add UV_UDP_REUSEADDR

* fix typo

* simplify functions

* rename functions in bindings

* feat: implement loadavg for darwin

* feat: implement system uptime

* feat: implement get free memory for darwin

* fix system memory bindings

* feat: implement network interfaces for darwin

* code cleanup

* feat: support for macos version & release

* some fixes

* MacOS support for CpuInfo

* Fixed minor mistake in getCpuInfo_B

* Delete test.zig

* Update c_cpp_properties.json

* Update tasks.json

* feat: implement scopeid

* feat: implement cidr 🚀

* remove unnecesarry changes

* remove unnecesarry changes

* chore: requested changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* chore: requested changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* chore: requested changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* chore: requested changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* chore: requested changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* chore: requested changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* chore: requested changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* fix: import string

* fix: change IPV6 to IPv6

* fix some things

* chore: make requested changes

* revert: launch.json

* fix test

* Fixed few memory leaks

* testing

* again

* added len

* another test

* improved parsing

* added small check

* Bonk

* FINISH 🚀🚀🚀🚀🚀🚀

* Update tasks.json

* NetworkInterface test

* FINISH 🚀🚀🚀

Co-authored-by: Fire-The-Fox <gajdos.jan77@gmail.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2022-08-25 19:38:28 -07:00
Jarred Sumner
e0b35b3086 Fix Request and Response in macros 2022-08-25 19:23:49 -07:00
Jarred Sumner
49bec758b7 Faster way to lookup mimetype 2022-08-25 19:23:18 -07:00
Jarred Sumner
950d03a9ea Fix incorrect indexOfNotChar causing sourcemaps bugs 2022-08-25 18:53:20 -07:00
Zilin Zhu
e6a1209c53 Fix clearTimeout and linux timeout (#1138) 2022-08-24 09:12:20 -07:00
Zilin Zhu
f2316a8eda Add pad back to base64 (#1140) 2022-08-24 09:10:49 -07:00
Sam
8f58e07ea1 updated minified url polyfill (#1132) 2022-08-23 11:25:37 -07:00
Zilin Zhu
9943ca916d add SlowBuffer (#1133) 2022-08-23 05:12:58 -07:00
Jarred Sumner
75a76fb836 Remove response pool 2022-08-22 10:59:49 -07:00
Jarred Sumner
2a0ab2aa9b Fix build error 2022-08-22 10:21:54 -07:00
Jarred Sumner
fd5398ce80 woops 2022-08-22 09:52:31 -07:00
Jarred Sumner
633bef7ef1 [node:http] speed up assigning headers 2022-08-22 09:51:33 -07:00
Jarred Sumner
fcd09abec6 reduce usage of protect 2022-08-22 09:36:38 -07:00
Jarred Sumner
38071ce9d5 Update mime_type.zig 2022-08-22 09:14:41 -07:00
Jarred Sumner
8642ac8e86 Improve error message when port is already in use 2022-08-22 09:14:41 -07:00
Jarred Sumner
57d6ef26e9 Update server.zig 2022-08-22 09:14:41 -07:00
Zilin Zhu
6a38441562 Support emit Symbol events in EventEmitter (#1129) 2022-08-22 08:22:40 -07:00
Jarred Sumner
4b8409096d faster way to read content-type 2022-08-22 08:20:05 -07:00
Jarred Sumner
39dc989915 Fix Buffer.isEncoding 2022-08-22 08:19:28 -07:00
Jarred Sumner
5273415ce5 Add some optimizations to FetchHeaders 2022-08-22 07:49:58 -07:00
Jarred Sumner
47a91e7457 Fix import path 2022-08-22 00:04:27 -07:00
Jarred Sumner
f5c6875da5 38% faster node:http
Before:
```fish
❯ oha http://localhost:3000 -z 2s -c 20
Summary:
  Success rate:	1.0000
  Total:	2.0006 secs
  Slowest:	0.0095 secs
  Fastest:	0.0000 secs
  Average:	0.0003 secs
  Requests/sec:	69521.0420
```

After:
```
❯ oha http://localhost:3000 -z 2s -c 20
Summary:
  Success rate:	1.0000
  Total:	2.0005 secs
  Slowest:	0.0063 secs
  Fastest:	0.0000 secs
  Average:	0.0002 secs
  Requests/sec:	109119.8614
```

Code

```
const http = require("http");

const hostname = "127.0.0.1";
const port = 3000;

const server = http.createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader("Content-Type", "text/plain");
  res.end("Hello World!");
});

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});
```
2022-08-22 00:04:27 -07:00
Jarred Sumner
eec11a6651 Don't transpile readable-stream 2022-08-22 00:04:27 -07:00
Jarred Sumner
b95e6602c3 Add a snippet for benchmarking EventEmitter vs EventTarget 2022-08-22 00:04:27 -07:00
Jarred Sumner
6897372258 [misc] Reload internal JS modules in development without compiling 2022-08-22 00:04:27 -07:00
Jarred Sumner
ee1d506d06 Use jsCast because it's slightly faster 2022-08-22 00:04:27 -07:00
Jarred Sumner
d620500757 [node compat] Don't throw TypeError for DOM constructors 2022-08-22 00:04:27 -07:00
Jake Lynch
65dd2214d9 fix bun-tools location in macOSx zig instructions (#1124) 2022-08-21 19:20:33 -07:00
Zilin Zhu
3d8bc140aa Add native EventEmitter (#1123)
* Add native EventEmitter

* add listeners, listenerCount and eventNames

* add global functions

* add Object to EventEmitter conversion

* fix upon review
2022-08-21 05:34:31 -07:00
Jarred Sumner
d8f40e080d [env loader] Don't panic when .env fails to load for unexpected reasons 2022-08-21 01:45:14 -07:00
Jarred Sumner
6ab53fca36 Reduce allocations for ObjectPool 2022-08-21 01:08:40 -07:00
Jarred Sumner
8fafc2f9ed [bun-landing] inline via data uri 2022-08-21 01:01:03 -07:00
Jarred Sumner
c4580ee2ca Rename reactdom-bun -> react-dom-server.bun 2022-08-21 01:00:27 -07:00
Jarred Sumner
a8fa61ed68 Support running scripts in bun's runtime from a shebang 2022-08-21 00:59:50 -07:00
Jarred Sumner
f3779b8e73 [breaking] bun run <missing script> should return a nonzero exit code 2022-08-21 00:58:24 -07:00
Jarred Sumner
ca5b996299 Support loading JavaScript files without extensions 2022-08-21 00:51:57 -07:00
Jarred Sumner
baf218c233 Add a bench snippet for sha512 2022-08-21 00:51:27 -07:00
Jarred Sumner
7880e6e6c8 Remove usage of fnctl64 so we can avoid the libc symbol 2022-08-21 00:50:23 -07:00
Jarred Sumner
97305b7461 Add a binding for creating atomic strings 2022-08-21 00:49:54 -07:00
Jarred Sumner
1fca65fdf6 Slightly optimize escapeHTMLescapeHTML8 & escapeHTML16 2022-08-21 00:48:53 -07:00
Jarred Sumner
aaa019ce37 Update WebKit 2022-08-20 23:03:50 -07:00
Jarred Sumner
32d2be0d08 Export createSyntheticModule 2022-08-20 23:03:50 -07:00
Jarred Sumner
83e4d04ce7 wip support #! 2022-08-20 23:03:50 -07:00
Hyro
8901d23685 fix(ReferenceError): expected type in getCode (#1120) 2022-08-20 16:40:28 -07:00
Jarred Sumner
98a03c192d Fix running zig tests 2022-08-20 04:43:12 -07:00
Jarred Sumner
f4419bd240 Fix crash on invalid JSX 2022-08-20 04:43:12 -07:00
Jarred Sumner
07e1a158e9 Add code to ResolveError 2022-08-20 04:43:12 -07:00
Zilin Zhu
2641884342 Add buffer.indexOf, includes and lastIndexOf (#1112)
* Add buffer.indexOf, includes and lastIndexOf

* use memmem

* use int64_t

* fix upon reviews
2022-08-20 00:17:17 -07:00
Zilin Zhu
b1bc549cf7 fix buffer.slice(0, 0) (#1114) 2022-08-19 23:25:10 -07:00
Zilin Zhu
8cf57eb582 fix buffer.copy (#1113) 2022-08-19 23:13:38 -07:00
Jarred Sumner
aa404ded34 Update build-id 2022-08-19 05:06:11 -07:00
Jarred Sumner
eee5046b82 Make React SSR up to 3x faster 2022-08-19 04:47:55 -07:00
Jarred Sumner
9222a5d376 2x faster Bun.serve with async function handlers 2022-08-19 03:51:01 -07:00
Jarred Sumner
0a0f8ff41c Update bun init test 2022-08-19 00:35:26 -07:00
Jarred Sumner
fe7180bc74 Synchronously dispatch close event 2022-08-18 23:49:14 -07:00
Jarred Sumner
bdf733973c Fix memory leak in WebSocket 2022-08-18 23:41:33 -07:00
Jarred Sumner
0f45386673 Make Request, Response and TextDecoder not read-only 2022-08-18 23:21:52 -07:00
Jarred Sumner
88d2a97670 Update build-id 2022-08-18 21:17:38 -07:00
Jarred Sumner
922c361f6a un-delete some code 2022-08-18 21:14:52 -07:00
Jarred Sumner
0e4db0b28f Add string support to Buffer.fill 2022-08-18 21:09:26 -07:00
Jarred Sumner
d150a2f4dd [node compat] Fix issue with Buffer.compare when called on the constructor 2022-08-18 19:34:28 -07:00
Jarred Sumner
5eeb704f25 Fix console.log printing [native code] for too many things 2022-08-18 19:23:45 -07:00
Jarred Sumner
e3c2a95e5f Faster TextDecoder 2022-08-18 19:06:29 -07:00
Jarred Sumner
e45ddc086f Fix Next.js regression 2022-08-18 19:05:37 -07:00
Jarred Sumner
51ced7d3e3 Fix bun:wrap not loading 2022-08-18 19:05:07 -07:00
Jarred Sumner
036e580045 Fixes https://github.com/oven-sh/bun/issues/1069 2022-08-18 01:13:11 -07:00
Jarred Sumner
9eaed7cec7 Fix missing prototype property on generated classes 2022-08-18 00:56:36 -07:00
Jarred Sumner
eb5b298bc1 Update generate-classes.ts 2022-08-18 00:22:29 -07:00
Jarred Sumner
5de8271181 Handle builds with remote inspector disabled 2022-08-18 00:22:24 -07:00
Jarred Sumner
f4ff5ecbdf Missing parameter after merge 2022-08-17 22:38:07 -07:00
Jarred Sumner
1ebebbc698 Update build-id 2022-08-17 21:55:36 -07:00
Jarred Sumner
b3f5131981 Update build-id 2022-08-17 21:46:28 -07:00
Jarred Sumner
8399d31af2 Update ZigGlobalObject.cpp 2022-08-17 21:44:00 -07:00
Jarred Sumner
1d2b52d15c Move the crypto hashers to the new bindings 2022-08-17 21:38:16 -07:00
Zilin Zhu
4fe8b8e5b7 Add native process module (#1095) 2022-08-17 20:14:31 -07:00
Jarred Sumner
cb1114dba6 uncomment 2022-08-17 19:27:35 -07:00
Jarred Sumner
c720bdc324 Move around some things 2022-08-17 19:26:10 -07:00
Jarred Sumner
bc412e1f6f slightly improve streams perf 2022-08-17 19:25:43 -07:00
Jarred Sumner
ddd151a23b Bump WebKit 2022-08-17 18:53:11 -07:00
Jarred Sumner
ac20150d04 Update http_client_async.zig 2022-08-17 08:18:13 -07:00
Jarred Sumner
9594c82180 Update react-hello-world.jsx 2022-08-17 07:55:19 -07:00
Jarred Sumner
93b663e43d New Zig <> C++ bindings generator. +20% faster HTTP server 2022-08-17 07:37:14 -07:00
Jarred Sumner
65820893c9 Slightly improve header init perf 2022-08-17 07:36:35 -07:00
Jarred Sumner
6a65631cbd [bun:ffi] Improve ptr() performance and implement code generation for DOMJIT 2022-08-17 07:36:35 -07:00
Jarred Sumner
382be2cb46 [bun:sqlite] Add DOMJIT to get() 2022-08-17 07:36:35 -07:00
Zilin Zhu
0aa3a0a5b0 Fix server segfault by making controller not early GC'ed (#1090)
* Fix http server segfault by making controller not get GC'ed

* fix format
2022-08-17 05:22:09 -07:00
Zilin Zhu
77b449856d Fix active_task count for timeout tasks (#1081) 2022-08-15 05:37:37 -07:00
Jonathan Collazo
b59d93b01e updating libarchive (#1078) 2022-08-14 21:23:17 -07:00
Zilin Zhu
afe34df3cc Add synthetic buffer module (#1076)
* Add synthetic buffer module

* rename Buffer.h to BufferModule.h
2022-08-14 18:08:25 -07:00
Jarred Sumner
9af4c0420e Update webKit 2022-08-13 23:29:05 -07:00
Jarred Sumner
952a4ab94a fixups 2022-08-13 23:06:14 -07:00
Jarred Sumner
e210f271bb Fix macOS build 2022-08-13 21:58:31 -07:00
Jarred Sumner
64b20cac88 Merge remote-tracking branch 'origin/jarred/redo-linux-event-loop' 2022-08-13 21:01:31 -07:00
Jarred Sumner
f90c09d715 wip SyntheticModule 2022-08-13 18:18:05 -07:00
Jarred Sumner
5644da1a3e Update WebKit 2022-08-13 18:18:05 -07:00
Jarred Sumner
a2d6e58875 [Bun.serve] Fix crash on req.headers async 2022-08-13 18:18:05 -07:00
Jarred SUmner
0815c83974 Improve event loop reliability on Linux 2022-08-13 06:07:18 -07:00
Ikko Ashimine
65ca0503a7 [bun error] fix typo in markdown.ts (#995)
happend -> happened
2022-08-12 19:22:32 -07:00
Jarred Sumner
5f68c562f9 Make versions consistent 2022-08-12 19:17:26 -07:00
Jarred Sumner
9ba080e829 Update WebKit URLs 2022-08-12 18:31:26 -07:00
Jarred Sumner
4df0385c23 Update WebKit 2022-08-12 18:28:32 -07:00
Jarred Sumner
75cad910db Add missing sqlite3 symbol 2022-08-12 15:16:02 -07:00
Jarred Sumner
262f00df3e Update bun-mac-x64-baseline.yml 2022-08-12 13:26:05 -07:00
Zilin Zhu
1dce0b2af1 remove column name caches in js (#1057) 2022-08-12 03:07:51 -07:00
Ryan Russell
c33f39b39c refactor(src/tagged_pointer): IntPrimtiive -> IntPrimitive (#1046)
Signed-off-by: Ryan Russell <git@ryanrussell.org>

Signed-off-by: Ryan Russell <git@ryanrussell.org>
2022-08-12 03:04:00 -07:00
Zilin Zhu
bcc4580cdc invalidate column name caches when the schema of table may change (#1056) 2022-08-12 02:47:01 -07:00
Jarred Sumner
dba3aaedab Faster performance.now() 2022-08-12 01:18:31 -07:00
Jarred Sumner
c9cd8bd13b Update WebKit 2022-08-12 01:18:31 -07:00
Jarred Sumner
5c1ca0cc47 [bun.js] up to 60% faster TextEncoder.encodeInto and ~3% faster TextEncoder.encode 2022-08-12 01:18:31 -07:00
Jarred Sumner
2ac8c83be0 [Bun.serve] Fix crash on invalid certificate file path for SSL 2022-08-12 01:18:31 -07:00
Zilin Zhu
66869f2239 fix appendFile permission (#1052) 2022-08-11 01:00:06 -07:00
Zilin Zhu
1bc5036d2e fix MD5 length and compile error (#1050) 2022-08-10 23:11:24 -07:00
Jarred Sumner
bcdc68ac94 Add bun link and bun unlink to completions 2022-08-10 23:09:07 -07:00
Jarred Sumner
f8d5c4594f [bun unlink] Partially implement 2022-08-10 23:08:51 -07:00
Jarred Sumner
437dc22862 Include GIT_SHA in linux builds 2022-08-10 21:49:31 -07:00
Jarred Sumner
271178d1a5 Update bun-mac-aarch64.yml 2022-08-10 21:46:41 -07:00
Jarred Sumner
5287b482e6 Update ZigGlobalObject.cpp 2022-08-10 21:46:27 -07:00
Jarred Sumner
4fe24a4f3c Log uncaught exceptions 2022-08-10 21:46:17 -07:00
Jarred Sumner
551cb26afb Add shared property 2022-08-10 21:26:32 -07:00
Jarred Sumner
d9ae284463 Fix console.log with typed arrays 2022-08-10 21:26:20 -07:00
Jarred Sumner
00d5f6699b Add Event JSType 2022-08-10 18:45:30 -07:00
Jarred Sumner
3ca4bab2d5 Faster debug builds 2022-08-10 17:44:18 -07:00
Jarred Sumner
e9c855f837 Fix MessageEvent formatting
Fixes https://github.com/oven-sh/bun/issues/510
2022-08-10 17:44:10 -07:00
Jarred Sumner
f09e7ac630 improve reliability of WebSocket
- Fix GC not keeping WebSocket alive
- Fix ignoring messages sent immediately after upgrade

Fixes https://github.com/oven-sh/bun/issues/521
2022-08-10 17:40:17 -07:00
Jarred Sumner
e511b14b2a Fix spurious unhandled promise rejection error 2022-08-10 15:46:23 -07:00
Jarred Sumner
6ca32d800d [bun upgrade] Add changelog URL
Fixes https://github.com/oven-sh/bun/issues/1019
2022-08-10 15:30:34 -07:00
Jarred Sumner
218ab7f967 Remove trailing newline in git sha 2022-08-10 15:29:53 -07:00
Jarred Sumner
099ad31deb Update js_parser.zig 2022-08-10 15:19:03 -07:00
Jarred Sumner
2644b9d792 [TS] Fix bug with import Foo = require("bar")
Closes https://github.com/oven-sh/bun/issues/1045
2022-08-10 15:08:54 -07:00
Jarred Sumner
67cdf1c9b3 Commit snapshot 2022-08-10 13:41:43 -07:00
Jarred Sumner
1eddf254e1 Fix linux build? 2022-08-09 18:43:42 -07:00
Jarred Sumner
c148c33510 [js] Fix console.log(Infinity) 2022-08-09 16:37:05 -07:00
Jarred Sumner
429abc1278 [bun:ffi] ~30% perf improvement for wrapped functions 2022-08-09 16:35:06 -07:00
Jarred Sumner
3dca3baaec [bun:ffi] Re-enable most of the tests 2022-08-09 16:17:35 -07:00
Jarred Sumner
bbb6e25c68 [bun:ffi] Feature: Expose ptr on the FFI function 2022-08-09 16:17:11 -07:00
Jarred Sumner
b428227895 [bun:ffi] Feature: C deallocator callback function for toBuffer and toArrayBuffer 2022-08-09 16:16:51 -07:00
Jarred Sumner
6c8ba6c5fc Fix linux build 2022-08-09 15:38:47 -07:00
Jarred Sumner
01f567e915 add some comments 2022-08-09 06:05:20 -07:00
Jarred Sumner
f44f98be33 [node compat] Add tests for fs.copyFileSync 2022-08-09 05:48:22 -07:00
Jarred Sumner
16f24086f8 [node compat] Improve fs.copyFileSync performance on macOS 2022-08-09 05:48:20 -07:00
Jarred Sumner
f4ab46a8bd Update Makefile 2022-08-09 05:47:46 -07:00
Jarred Sumner
8ae4c745e1 Improve fs.copyFile performance on Linux (#1035)
* [fs] Improve fs.copyFile performance on Linux

* Add a fs.copyFileSync benchmark

* Fix build error

* Update node.mitata.mjs

* Be more careful with permission

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-08-09 05:44:39 -07:00
Jarred Sumner
b274d22205 Simplify building the debug tools 2022-08-09 02:33:04 -07:00
Jarred Sumner
159a1e4bf2 Fix clean-bindings script 2022-08-09 02:32:46 -07:00
Jarred Sumner
a6596ace70 [misc] Add a way to disable LOLHTML
LOLHTML costs about 1 MB of binary size
2022-08-09 01:41:13 -07:00
Jarred Sumner
28ad93f02f [node compat] Update "module" module's require.resolve implementation 2022-08-09 01:41:13 -07:00
Jarred Sumner
4575df38e6 [misc] Add a global private @Bun 2022-08-09 01:41:13 -07:00
Jarred Sumner
b36b7fee16 [node compat] Implement require.resolve 2022-08-09 01:41:13 -07:00
Jarred Sumner
01847cabd2 Delete server polyfill 2022-08-09 01:41:13 -07:00
Zilin Zhu
9a721adbff Fix static require by setting the state machine manually (#1034) 2022-08-09 01:25:41 -07:00
TiKevin83
ceb78d2bb9 Update example Next app to 12.2 (#1033)
* Update bun-framework-next for version 12.2

* Match on minor version for next peer dependency per compatibility issues

* Update example next app packages per 12.2 integration

* Update next version warning per minor version compatibility changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2022-08-08 15:29:12 -07:00
Zilin Zhu
02644ab65a Raise error on unhandled rejected promises (#1010)
* deal with unhandled rejected promise

* use Vector<Strong<JSPromise>> to store rejected promises
2022-08-08 10:58:00 -07:00
Jarred Sumner
98c2d20ab0 Flip boolean 2022-08-08 03:54:14 -07:00
Jarred Sumner
84e76ce4ad Fix baseline builds once again 2022-08-08 03:39:44 -07:00
Zilin Zhu
05a382172f fix compiling error on linux (#1027) 2022-08-08 02:13:11 -07:00
Jarred Sumner
766ce5ab7b Update JSSQLStatement.cpp 2022-08-08 01:26:21 -07:00
Zilin Zhu
463f2b7dab fix segfault for query().all() with more than 64 properties (#1025)
* fix segfault for query().all() with more than 64 properties

* Update src/bun.js/bindings/sqlite/JSSQLStatement.cpp

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2022-08-08 00:54:13 -07:00
Ryan Russell
a6b089bd17 refactor(src/install): clap readability fixes (#1024)
Signed-off-by: Ryan Russell <git@ryanrussell.org>
2022-08-08 00:20:44 -07:00
Jarred Sumner
05bca1e4e4 bun link fixture 2022-08-07 23:28:10 -07:00
Jarred Sumner
73a18c99e6 [bun install] Increase "slow filesystem detected" notice 2022-08-07 23:24:23 -07:00
Jarred Sumner
c795c6742d [misc] fix typo 2022-08-07 23:23:42 -07:00
Jarred Sumner
cc2c50ad09 [bun install] Implement bun link 2022-08-07 23:23:34 -07:00
Jarred Sumner
f990df97ce [misc] Don't spam protect / unprotect in debug logs 2022-08-07 19:21:37 -07:00
Jarred Sumner
5d7ed5cbce Improve memlock limit error 2022-08-07 16:51:14 -07:00
Jarred Sumner
12dbc1ed7b [bun install] Implement symlink backend
Fixes https://github.com/oven-sh/bun/issues/1017
2022-08-07 15:58:41 -07:00
Jarred Sumner
cf78745271 [misc] Microptimize directory tree walker 2022-08-07 15:58:41 -07:00
Jarred Sumner
52865750da Update bun.lockb 2022-08-07 15:58:41 -07:00
Zilin Zhu
6b45f39322 re-register setInterval to VM after completion (#1014) 2022-08-07 09:23:45 -07:00
Jarred Sumner
31b8ad8230 Update Dockerfile 2022-08-06 10:40:57 -07:00
Jarred Sumner
49c4f29c1f Ensure cache invalidation for building bun 2022-08-06 09:17:23 -07:00
Jarred Sumner
a35730a7b6 Ensure correct directory for linking WebKit 2022-08-06 09:17:23 -07:00
Zilin Zhu
b8993dbd78 [wiptest] fix calling toBe in describe (#1000) 2022-08-06 02:32:32 -07:00
Jarred Sumner
c94091d8b1 Refresh all the bun.lockb 2022-08-05 23:28:19 -07:00
Jarred Sumner
4c01845f32 [BREAKING][bun install] Invalidate all the lockfiles 2022-08-05 23:20:24 -07:00
Jarred Sumner
b17f5b750e [bun install] Support authenticated registries 2022-08-05 22:42:22 -07:00
Jarred Sumner
a16dcbbb5b [bun install] Support private registries & private scopes 2022-08-05 22:41:43 -07:00
Jarred Sumner
c74df4c880 Fix https://github.com/oven-sh/bun/issues/996 2022-08-05 21:49:27 -07:00
Jarred Sumner
e34190fe66 Fix error message in install script 2022-08-05 16:36:25 -07:00
Jarred Sumner
7cbb9add48 Fix baseline detection for macOS x64 2022-08-05 16:30:51 -07:00
Jordan Lees
35a6946b63 Update README for development help (#982)
* Add info on Docker (was undockumented)

I'm actually just assuming Docker is required on all systems. Feel free to correct me lol

* Update README with info on newer devcontainer cli

since `devcontainer open` is no longer supported

* Update README - Troubleshooting steps

* Update README.md

* Update README.md

Fixing Jarred's correction on https://github.com/oven-sh/bun/pull/982, plus some better organization

* Update README.md

Forgot to include remote containers extension; added Troubleshooting (general) link to the table of contents
2022-08-05 12:42:43 -07:00
Hyro
1cb8f0fa73 feat(util): support for util.TextDecoder (#990)
* build:(landing) automated website build

* Revert "build:(landing) automated website build"

This reverts commit ddee8485fd.

* feat(util): support for util.TextDecoder

* tests(util): add TextDecoder

* tests: seperate text-decoder

Co-authored-by: xHyroM <xHyroM@users.noreply.github.com>
2022-08-05 10:42:52 -07:00
Hyro
5bca8a1d47 benchmarks(sqlite): invalid northwind database url (#989)
* build:(landing) automated website build

* Revert "build:(landing) automated website build"

This reverts commit ddee8485fd.

* benchmarks(sqlite): fix invalid northwind database url

Co-authored-by: xHyroM <xHyroM@users.noreply.github.com>
2022-08-05 10:36:32 -07:00
Soney Mathew
7e93c2368e Fix of panic in threads while downloading scoped packages (#992) 2022-08-05 10:34:50 -07:00
Soney Mathew
9fad889f26 Fix for bearer tokens missing from request headers on bun install step (#991) 2022-08-05 03:15:26 -07:00
Lee Robinson
95294d245c Convert landing page to zero-JS Next.js application. (#945) 2022-08-05 00:37:34 -07:00
Jarred Sumner
c5b600ad48 [misc] Add bun init to bun help 2022-08-04 23:24:17 -07:00
Jarred Sumner
9cce277eaf [misc] Make the macOS builds faster 2022-08-04 23:22:09 -07:00
Jarred Sumner
7e3fe03fb0 [bun init] Add a test 2022-08-04 23:21:41 -07:00
Jarred Sumner
1bc8c92e2f [misc] Add bun-types to repo 2022-08-04 22:16:05 -07:00
Jarred Sumner
f0d332e287 [bun:sqlite] Fix crash when > 64 columns
Fixes https://github.com/oven-sh/bun/issues/987
2022-08-04 22:16:05 -07:00
Zilin Zhu
e7ecedf3e9 allow setting status code in Response.redirect (#985) 2022-08-04 21:44:26 -07:00
Jarred Sumner
d034c004f9 Implement bun init subcommand 2022-08-04 21:42:49 -07:00
Jarred Sumner
7ba61bc983 [bun create] Allow custom start commands 2022-08-04 21:41:12 -07:00
Jarred Sumner
2b55f2d00f Allow timer with 0 -> 1 2022-08-04 21:40:48 -07:00
Jarred Sumner
4d19970663 [bun upgrade] Prepare for version strings with a space 2022-08-04 21:40:23 -07:00
Jarred Sumner
5ccb4f10d2 setImmediate is now a global 2022-08-04 21:39:58 -07:00
Jarred Sumner
6375982d19 [node.js compat] make var {isBuffer} = Buffer; work 2022-08-04 21:25:14 -07:00
Jarred Sumner
58882c0555 Fix building debug tools 2022-08-04 12:46:09 -07:00
Jarred Sumner
fd7be10f3a Disable browser field for bun, bun_macro
Closes #979
2022-08-04 10:42:33 -07:00
Jarred Sumner
1c1ba17908 Update README.md 2022-08-04 01:42:59 -07:00
Jarred Sumner
ef25009bcd Update README.md 2022-08-04 01:36:30 -07:00
Jarred Sumner
3c5b68caa7 [node.js compat] Clamp for Buffer functions instead of throwing 2022-08-03 21:31:15 -07:00
Jarred Sumner
37fe03e1ca Fix Dockerfile 2022-08-03 21:17:43 -07:00
Zilin Zhu
36d5d764d8 fix path.normalize on ... (#966) 2022-08-03 21:14:08 -07:00
Jarred Sumner
b310d7c40d [node.js compat] latin1 & ascii encoding for Buffer 2022-08-03 21:11:20 -07:00
Jarred Sumner
290fb7f7e7 [Bun.Transpiler] Fix bug that would cause some bun-specific transforms to run 2022-08-03 20:52:17 -07:00
Jarred Sumner
aa0be51d40 Fix test failures from JSPropertyIterator change 2022-08-03 20:52:17 -07:00
Jarred Sumner
77bab6c782 [misc] Make name more consistent 2022-08-03 20:52:16 -07:00
Jarred Sumner
9d81d24a7a Fix mac builds 2022-08-03 20:51:01 -07:00
Zilin Zhu
de848d4e1c fix(makefile): mkdir DEBUG_OBJ_DIR before compiling bindings (#975) 2022-08-03 20:11:09 -07:00
Jarred Sumner
440eba7c9b [misc] Fix make headers 2022-08-03 19:13:08 -07:00
Jarred Sumner
cf81ee5f41 Update build-id 2022-08-03 18:58:59 -07:00
Jarred Sumner
e29ef5561f [bun install] Include scripts when lockfile doesn't change 2022-08-03 18:44:54 -07:00
Jarred Sumner
6ef45c9e33 [misc] Make debug builds faster 2022-08-03 18:35:53 -07:00
Jarred Sumner
2094667417 [bun install] Support lifecycle hooks for cwd's package.json
`bun install` will now run prepare & install `"scripts"` for the root package.json (not dependencies)

This makes things like `husky` work and possibly `patch-package`
2022-08-03 18:35:53 -07:00
Jarred Sumner
928f6e068b Don't use SIMD in non-SIMD builds 2022-08-03 18:35:53 -07:00
Jarred Sumner
e253ce0948 Add process.revision and expose git sha to builds 2022-08-03 18:35:53 -07:00
Zilin Zhu
58feb81c36 use import.meta.require instead of import (#973) 2022-08-03 18:31:39 -07:00
Carter Snook
f4ac41b5d9 fix: prop iterator cstring variant (#974) 2022-08-03 15:32:39 -07:00
Carter Snook
033eebce29 refactor: create a high-level property iterator (#972)
This also fixes multiple memory leaks double frees.
2022-08-03 14:05:38 -07:00
Jarred Sumner
40a187f0de fix bug in process.hrtime() 2022-08-03 13:26:19 -07:00
Zilin Zhu
a8d499208b Fix Makefile (#957) 2022-08-02 16:45:57 -07:00
Zilin Zhu
a5a1435867 Fix u32 jsNumber cast (#964) 2022-08-02 16:45:18 -07:00
Jarred Sumner
ed9abb0cb0 [node.js compat] Implement process.hrtime() and process.hrtime.bigint() 2022-08-02 16:41:47 -07:00
Jarred Sumner
fcce3ff5ac Basename 2022-08-01 15:17:59 -07:00
Jarred Sumner
85c4c25bc2 Use WebKit LTO builds where appropriate 2022-08-01 15:16:17 -07:00
Jarred Sumner
35bd08f7d7 Mention moduleResolution: node so people copy paste the right thing 2022-08-01 15:06:50 -07:00
Jarred Sumner
cfa7a43ee7 Fix typo 2022-07-31 15:44:25 -07:00
Kid
52c962cb5b chore: migrate deprecated @vscode/dev-container-cli (#912) 2022-07-31 15:43:15 -07:00
Oran Simhony
43c1f17d1f Fix: move bun, Webkit and zig urls from Jarred-Sumner to oven-sh. (#944)
* Fix: move bun, Webkit and zig urls from Jarred-Sumner to oven-sh.

* Fix: changed urls from types.d.ts to base bun-types repo.
2022-07-31 15:41:45 -07:00
Hyro
a04c29aaf1 chore: fix labeler (#899) 2022-07-31 01:11:26 -07:00
Ryan Russell
af5a062424 refactor(bunjs/bindings): code readability fix functionLazyLoadStreamPrototypeMap_getter (#926) 2022-07-31 01:10:49 -07:00
Charles F. Munat
8882e52539 Fix/react accessibility (#932) 2022-07-31 01:10:10 -07:00
dave caruso
ccc22bb968 fix(makefile): devcontainer install (#933) 2022-07-31 01:09:42 -07:00
Jarred Sumner
05953a0680 Fix typo 2022-07-30 23:11:36 -07:00
Jarred Sumner
d132c131eb Fix default value in Dockerfile 2022-07-30 23:09:04 -07:00
Jarred Sumner
1e8af74564 There is no non-LTO build for amd64 webkit, but probably should change that 2022-07-30 23:06:39 -07:00
Jarred Sumner
1ff60e7534 Use webkit without march 2022-07-30 23:02:48 -07:00
Jarred Sumner
7b7b4b46af Fix build 2022-07-29 22:09:01 -07:00
Jarred Sumner
d61ef19ecf Update bun-framework-next for Next 12.2 2022-07-29 22:06:57 -07:00
TiKevin83
b765619ad6 Update bun-framework-next for Compatibility with Next 12.2+ (#920) 2022-07-29 20:48:18 -07:00
Jarred Sumner
e8b848dfcf Fix path 2022-07-29 18:31:39 -07:00
Jarred Sumner
467a106db0 Potentially fix build 2022-07-29 18:27:22 -07:00
Carter Snook
3d6d2651da fix(ffi): double-free segfault with symbols object (#919) 2022-07-29 17:43:18 -07:00
Hyro
a5eaa907e2 docs: fix broken ffi benchmark link (#914)
* build:(landing) automated website build

* Revert "build:(landing) automated website build"

This reverts commit ddee8485fd.

* docs: fix broken ffi benchmark link

Co-authored-by: xHyroM <xHyroM@users.noreply.github.com>
2022-07-29 14:00:03 -07:00
Hyro
50284f38a6 chore(ci): add segfault label (https://github.com/oven-sh/bun/pull/916) 2022-07-29 21:06:46 +02:00
sno2
09c6802891 chore(ci): add segfault label 2022-07-29 14:04:26 -05:00
Jarred Sumner
4bdad99ead Use WebKit baseline build 2022-07-28 18:49:34 -07:00
Jarred Sumner
56885fae4d Bust cache again 2022-07-28 17:37:37 -07:00
Jarred Sumner
d173f777a7 Bust cache 2022-07-28 15:08:45 -07:00
Jarred Sumner
94ea5f28db Bump WebKit 2022-07-28 14:26:46 -07:00
Kevin Ingersoll
b70f6fcb51 landing/docs: make Bun naming consistent (#906)
* landing/docs: make Bun naming consistent

* fix spacing, wrap one more code thing
2022-07-28 13:48:21 -07:00
Jarred Sumner
6fecda6b73 There are ~3 different versions of strip with different flags and it is very confusing 2022-07-28 04:31:45 -07:00
Jarred Sumner
cbae4a31aa Bust cache 2022-07-28 04:09:04 -07:00
Jarred Sumner
13364767fb Bump webkit 2022-07-28 04:05:33 -07:00
Jarred Sumner
3e73ea2e26 Only strip debug symbols 2022-07-28 04:05:02 -07:00
Jarred Sumner
21b8f80a99 [misc] Make debug builds not depend on a specific directory structure 2022-07-28 04:04:53 -07:00
Jarred Sumner
23f1e008a2 Use ADD so that the caching is set 2022-07-28 04:04:29 -07:00
Jarred Sumner
380e7e1cfb Update WebKit 2022-07-28 04:04:10 -07:00
Jarred Sumner
2106afc4d4 Fix process.versions.webkit 2022-07-28 04:04:07 -07:00
Jarred Sumner
97cd944237 [node compat] Fix bug with process.title 2022-07-28 04:03:49 -07:00
Jarred Sumner
5cf39ef6c5 Update build-id 2022-07-28 02:54:28 -07:00
Jarred Sumner
90727f305e Downgrade baseline target to westmere 2022-07-28 00:40:07 -07:00
Jarred Sumner
78dd366272 Update bun-dockerhub.yml 2022-07-28 00:09:23 -07:00
Jarred Sumner
dddc645d4b [misc] Remove irrelevant scripts 2022-07-27 21:21:36 -07:00
Jarred Sumner
bd547ace80 [misc] Replace reference to old repo 2022-07-27 21:20:45 -07:00
Jarred Sumner
194a5c896e [misc] Simplify the commands used to build bun 2022-07-27 21:20:09 -07:00
Jarred Sumner
7c5c4f5694 Clean up some things with the devcontainer 2022-07-27 21:18:58 -07:00
Jarred Sumner
6b25e6935e [bun install] Fix segfault when loading scopes 2022-07-27 21:16:22 -07:00
Jarred Sumner
bebce1ec63 [bun install] Fix missing lockfile data for tarballs 2022-07-27 21:15:57 -07:00
Jarred Sumner
eea925e7e0 Remove disabled workflow 2022-07-27 18:37:43 -07:00
Jarred Sumner
a1e0af20b8 Fix Dockerfile 2022-07-27 18:37:23 -07:00
Rishi Goomar
9e342c17b2 docs(macos): Improve MacOS Development Instructions (#836)
* docs(macos): Improve MacOS Development Instructions

* Update MacOS zig install to be more automated
2022-07-27 18:28:38 -07:00
Jarred Sumner
9bd4a8f7bb [docker] wip 2022-07-27 18:13:30 -07:00
Jarred Sumner
ed56c1350e [docker] wip 2022-07-27 18:11:13 -07:00
Jarred Sumner
0c6512cd33 [docker] wip 2022-07-27 18:09:00 -07:00
Jarred Sumner
75b14341af [docker] wip 2022-07-27 18:06:17 -07:00
Jarred Sumner
fa3404920a Upgrade WebKit in Dockerfile 2022-07-27 18:03:09 -07:00
Jarred Sumner
353f899309 getObject -> asCell because it's a little bit safer 2022-07-27 17:48:25 -07:00
Jarred Sumner
bdbd70ca0f Update WebKit 2022-07-27 17:46:28 -07:00
Jarred Sumner
87746d611b Upgrade WebKit 2022-07-27 17:46:28 -07:00
szatkus
a00eb95e29 #609 Don't truncate ascii buffers to 7-bit (#775) 2022-07-27 11:42:39 -07:00
Jarred Sumner
e468a61811 fixup 2022-07-27 02:06:46 -07:00
Jarred Sumner
4ee298fe20 "SegmentationFault at 1" -> "SegmentationFault at 0x10000000" 2022-07-27 02:04:19 -07:00
Jarred Sumner
999d39ec0b WIP fix workflow run 2022-07-26 22:25:17 -07:00
Jarred Sumner
6772d3a102 Update readme 2022-07-26 22:14:00 -07:00
Jarred Sumner
ba0657410d Remove bun-types from repo 2022-07-26 22:10:01 -07:00
Jarred Sumner
03fde4c3fd WIP fix workflow run 2022-07-26 22:00:13 -07:00
Jarred Sumner
b189b6e947 WIP fix workflow run 2022-07-26 21:19:25 -07:00
Jarred Sumner
3b247daf75 WIP fix workflow run 2022-07-26 20:01:55 -07:00
Jarred Sumner
6b556a186f WIP fix workflow run 2022-07-26 01:05:19 -07:00
Jarred Sumner
03f0431800 WIP fix workflow run 2022-07-26 00:54:21 -07:00
Jarred Sumner
b56979ebe1 WIP fix workflow run 2022-07-26 00:53:39 -07:00
Jarred Sumner
4123ce1a4f WIP fix workflow run 2022-07-26 00:27:18 -07:00
Jarred Sumner
5d52e22aee WIP fix workflow run 2022-07-26 00:24:03 -07:00
Jarred Sumner
ae4595f9e2 WIP fix workflow run 2022-07-25 23:46:29 -07:00
Jarred Sumner
8ccfe2957f WIP fix workflow run 2022-07-25 23:17:57 -07:00
Jarred Sumner
63adad8caf WIP fix workflow run 2022-07-25 23:17:34 -07:00
Jarred Sumner
162c3f2d13 WIP fix workflow run 2022-07-25 23:12:59 -07:00
Jarred Sumner
e03cde7cd5 WIP fix workflow run 2022-07-25 23:11:10 -07:00
Jarred Sumner
27736f1103 WIP fix workflow run 2022-07-25 22:31:44 -07:00
Jarred Sumner
81dc410e50 WIP fix workflow run 2022-07-25 21:49:09 -07:00
Jarred Sumner
731adbc9a0 WIP fix workflow run 2022-07-25 21:47:40 -07:00
Jarred Sumner
dba221ba22 WIP fix workflow run 2022-07-25 21:34:01 -07:00
Jarred Sumner
45249b4a71 WIP fix workflow run 2022-07-25 21:05:47 -07:00
Jarred Sumner
0450615b61 WIP fix workflow run 2022-07-25 20:09:49 -07:00
Jarred Sumner
9f45ec1959 WIP fix workflow run 2022-07-25 19:30:57 -07:00
Jarred Sumner
4bb610c984 WIP fix workflow run 2022-07-25 18:49:23 -07:00
Jarred Sumner
0769f90301 WIP fix workflow run 2022-07-25 18:49:16 -07:00
Jarred Sumner
31db186baf WIP fix workflow run 2022-07-25 18:19:36 -07:00
Jarred Sumner
2501cb0160 WIP fix workflow run 2022-07-25 17:00:01 -07:00
Jarred Sumner
a2ac1d22af WIP fix workflow run 2022-07-25 16:57:49 -07:00
Jarred Sumner
fcf77792bc WIP fix workflow run 2022-07-25 16:55:41 -07:00
Jarred Sumner
b582d64df2 WIP fix workflow run 2022-07-25 16:47:43 -07:00
Jarred Sumner
552e21c6ab Update Makefile 2022-07-25 16:40:23 -07:00
Jarred Sumner
2a0357814a WIP fix workflow run 2022-07-25 16:38:36 -07:00
Jarred Sumner
583135aef7 WIP fix workflow run 2022-07-25 16:38:19 -07:00
Jarred Sumner
80f9ae7789 WIP fix workflow run 2022-07-25 16:35:49 -07:00
Jarred Sumner
959b6a80d0 WIP fix workflow run 2022-07-25 16:21:00 -07:00
Jarred Sumner
3c1a9bcb74 WIP fix workflow run 2022-07-25 16:17:44 -07:00
Jarred Sumner
386ba0abfd WIP fix workflow run 2022-07-25 14:59:39 -07:00
Jarred Sumner
146aafed92 WIP fix workflow run 2022-07-25 14:54:25 -07:00
Jarred Sumner
2f89501a6e WIP fix workflow run 2022-07-25 14:54:03 -07:00
Jarred Sumner
b11069420d update bench number 2022-07-25 13:30:44 -07:00
Jarred Sumner
5a81acce3a [bun install] Fix AccessDenied error when installing some packages
Fixes https://github.com/oven-sh/bun/issues/728
Fixes https://github.com/oven-sh/bun/issues/867
Fixes https://github.com/oven-sh/bun/issues/135

Credit @SheetJSDev
2022-07-25 01:37:58 -07:00
Victory Osikwemhe
8a43083415 Support for completion in Bash (#403)
* Add bash completions for optional flags (long and short options)

* extend bash completion to support options with specific requirements

* fix: remove global variables

* fix: rename cur_file to cur_word

* add c,rm,i aliases

* fix: add --help flag to create alias

* fix: --loader options bug

* fix --backend and linting

* linting

* add support for file completion for `bun run` as well as few changes also

* chore(): use _ as prefix for function names

* fix undefined function

* feat(wip): implement installation for bash bun completion in zig

* fix(): use separate paths instead of slice of paths

* rename _bun.bash to bun.completion.bash for compatability with  oh-my-bash

* change `bun.completion.bash` to filename
2022-07-25 00:47:34 -07:00
Pekka Enberg
6df6dac128 Add 'scripts/nproc' helper script (#623)
* Add 'scripts/nproc' helper script

There's no 'nproc' on macOS by default so add a helper script that uses
sysctl instead. Simplifies build environment setup on macOS.

* Delete nproc

* Update Makefile

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2022-07-25 00:45:57 -07:00
Hyro
d3c4f5c444 fix(types): add missing types for WebSocket (#578)
* fix(types): add missing types for ws

* fix: add missing path

\n

index.d.ts\npaths.txt

* fix: use types from lib.dom.d.ts

* types: update header

* style: new line

* Delete index.js

* fix: remove MessagePort

* fix: remove MessagePort

* fix: set MessageEventSource to undefined
2022-07-25 00:39:26 -07:00
Hyro
e68c4f584b feat(install): use this repository (#582)
https://github.com/oven-sh/bun instead of https://github.com/Jarred-Sumner/bun-releases-for-updater
2022-07-25 00:38:55 -07:00
Soney Mathew
ff5f2c357d Increasing test coverage for node compatibility for util (#854)
* [Bun.js] support for util.TextEncoder

* [Bun.js] test for util.TextEncoder

* [Bun.js] tests ported from node's test-util
2022-07-25 00:38:36 -07:00
mikeswann
285b47ff36 Use 'ADD' instead of running wget to make docker compare checksums on bun's latest file (#864) 2022-07-25 00:36:33 -07:00
Jarred Sumner
0a113d7f0c WIP fix workflow run 2022-07-24 23:30:42 -07:00
Jarred Sumner
dea662c796 WIP fix workflow run 2022-07-24 23:25:07 -07:00
Jarred Sumner
4ec6520927 WIP fix workflow run 2022-07-24 23:24:54 -07:00
Jarred Sumner
b0da58ad89 WIP fix workflow run 2022-07-24 23:15:01 -07:00
Jarred Sumner
43b5105a5e WIP fix workflow run 2022-07-24 23:06:13 -07:00
Jarred Sumner
c93ae8666c WIP fix workflow run 2022-07-24 23:02:47 -07:00
Jarred Sumner
d8052f733d WIP fix workflow run 2022-07-24 23:01:14 -07:00
Jarred Sumner
e7966f37ec WIP fix workflow run 2022-07-24 22:58:32 -07:00
Jarred Sumner
7e6e1cbf96 WIP fix workflow run 2022-07-24 22:53:15 -07:00
Jarred Sumner
2c39345fb4 WIP fix workflow run 2022-07-24 22:51:08 -07:00
Jarred Sumner
43f74ebcfe WIP fix workflow run 2022-07-24 22:44:02 -07:00
Jarred Sumner
aa44ac4b24 WIP fix workflow run 2022-07-24 22:43:12 -07:00
Jarred Sumner
acf177f651 WIP fix workflow run 2022-07-24 22:33:36 -07:00
Jarred Sumner
02a61e5277 WIP fix workflow run 2022-07-24 22:30:02 -07:00
Jarred Sumner
8d138061a9 WIP fix workflow run 2022-07-24 22:28:28 -07:00
Jarred Sumner
dd0dafbeec [docker] Prepare for macOS releases 2022-07-24 22:21:07 -07:00
Jarred Sumner
3ae3cdaa64 Update build.zig 2022-07-24 21:40:07 -07:00
Jarred Sumner
4f2d74edb9 Set explicit skylake 2022-07-24 21:33:54 -07:00
Jarred Sumner
4aa3bc7bee [wip] docker 2022-07-24 21:28:25 -07:00
Jarred Sumner
6c6e8509ad Build macOS object files 2022-07-24 21:21:21 -07:00
Jarred Sumner
5875bb3195 [docker] Move more flags 2022-07-24 18:27:45 -07:00
Jarred Sumner
25de617c92 [docker] WIP 2022-07-24 18:19:32 -07:00
Jarred Sumner
1abe377e20 [docker] wip 2022-07-24 18:17:10 -07:00
darker
88b85752a2 feat: clean/factorize ARGS (#839) 2022-07-24 18:16:47 -07:00
Jarred Sumner
fde64ace31 probably fix avx2 builds 2022-07-24 17:19:05 -07:00
Jarred Sumner
3369881e73 Update bun.yml 2022-07-24 16:25:57 -07:00
Rishi Goomar
f42a0759f8 fix(release): Remove the ${{}} from the if block in GHA (#863)
See - https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif
```
When you use expressions in an if conditional, you may omit the expression syntax (${{ }}) because GitHub automatically evaluates the if conditional as an expression.

```
2022-07-24 15:51:52 -07:00
Jarred Sumner
e19da7bb36 Attempt to fix canary build 2022-07-24 15:02:59 -07:00
Jarred Sumner
306132eda3 Attempt to fix canary build 2022-07-24 14:49:32 -07:00
Jochem Hagenaars
1be0100911 chore(examples/kingworld): Change bun-types to latest (#766)
* Bumped hono version number

* Changed bun-types version

* Bumped bun-types
2022-07-24 22:55:16 +02:00
Yusuke Wada
7896361084 chores(examples/hono): Refine Hono example (#773)
* fixed path

* add favicon

* Correct version: `^2.0.0`

* remove wiptest command
2022-07-24 22:51:41 +02:00
Jarred Sumner
bdf6b3e312 Wire up console.log(new Blob) 2022-07-24 01:22:33 -07:00
Jarred Sumner
af36e99317 Some tests for console.log(new Blob([123])) 2022-07-24 01:22:33 -07:00
Jarred Sumner
8e84f361ac Print < 512 bytes as "N bytes" instead of "0.0" 2022-07-24 01:22:33 -07:00
Jarred Sumner
c921e4a3f1 Improve console.log(new Blob([123])) output 2022-07-24 01:22:33 -07:00
Jarred Sumner
f524c72095 Make errors always print error: unless the name of the error is Error 2022-07-24 01:22:33 -07:00
Jarred Sumner
b09290b9cb [wip] GitHub action fix 2022-07-24 01:22:33 -07:00
Soney Mathew
7de90a82b0 [Bun.js] support for util.TextEncoder (#844)
* [Bun.js] support for util.TextEncoder

* [Bun.js] test for util.TextEncoder
2022-07-23 15:51:27 -07:00
darker
c412d0069e feat: added info, info_bod and success method to wrap type of messages (#845) 2022-07-23 12:39:12 -07:00
Harsh Mishra
277360e656 ci: add docker caching to ci workflows (#846) 2022-07-23 12:38:47 -07:00
darker
a61b959491 feat: add .PHONY on makefile targets (#847) 2022-07-23 12:38:28 -07:00
Michell Brito
09da245aa0 Merge pull request #827 from aaditeynair/main 2022-07-23 10:16:40 -04:00
Michell Brito
872304852e Merge pull request #800 from alexkuz/fix-install-script-colors--645 2022-07-22 20:32:57 -04:00
Michell Brito
75741d7d44 Merge pull request #804 from Sanix-Darker/doc/Makefile 2022-07-22 20:31:58 -04:00
Jarred Sumner
849c743cd2 [bun install] Fix issue with URL path when sending request 2022-07-22 17:12:37 -07:00
Jarred Sumner
52144c0577 Fix missing function bug 2022-07-22 16:17:13 -07:00
Jarred Sumner
1e9706d76d [bun wiptest] This test does not seem to run? 2022-07-22 16:17:13 -07:00
SheetJSDev
db51f285f8 bun install use custom BUN_CONFIG_REGISTRY port (#823) 2022-07-22 15:55:24 -07:00
Jarred Sumner
8392a86300 [docker] wip 2022-07-22 15:41:08 -07:00
Jarred Sumner
6edae78c6f [docker] wip 2022-07-22 14:04:12 -07:00
Jarred Sumner
136c696043 [docker] Use gcr 2022-07-22 14:01:32 -07:00
Jarred Sumner
2e71ea4db9 [bun dev] Add flag to force hmr 2022-07-22 13:52:55 -07:00
Jarred Sumner
7914adff1e Fix link command on macOS 2022-07-22 13:34:28 -07:00
Jarred Sumner
2dcd9e7eb9 [bun upgrade] Fix version display name for canary build 2022-07-22 13:26:31 -07:00
Jarred Sumner
2a6acf3c90 [bun upgrade] Fix name used in temporary dir for canary builds 2022-07-22 13:06:51 -07:00
Jarred Sumner
cd7f6db1d3 WIP fix workflow run 2022-07-22 12:34:35 -07:00
Jarred Sumner
15e8e67017 Clarify 2022-07-22 12:21:24 -07:00
Jarred Sumner
105350b826 Mention WSL version requirement 2022-07-22 12:20:04 -07:00
Jarred Sumner
d003fb4288 Only run canary release on push to main 2022-07-22 12:19:55 -07:00
Jarred Sumner
c2d6ceb0f3 [bun upgrade] Implement --canary and BUN_CANARY=1 2022-07-22 12:19:30 -07:00
Aaditey Nair
7c7cec0416 Fix mistake in Next.js Example README. 2022-07-22 16:50:24 +05:30
Jarred Sumner
ddfd2fd442 Update WebKit 2022-07-22 02:06:30 -07:00
Jarred Sumner
c654a6fceb Workaround submodules issue 2022-07-22 01:58:48 -07:00
Jarred Sumner
bced6fab58 Delete plus100-napi 2022-07-22 01:53:57 -07:00
Jarred Sumner
cd9680c61c Rename linux amd64 -> linux x64 2022-07-22 01:48:40 -07:00
Jarred Sumner
80f797b2e5 Mark as executable 2022-07-22 01:37:42 -07:00
Connor Lurring
2960a5cd72 fix: remove suffix arg for mktemp compatibility (#825) 2022-07-22 01:34:00 -07:00
Jarred Sumner
0d4b4c4942 Canary builds (Linux) (#824)
* wip

* WIP:

* WIP

* WIP

* WIP

* WIP

* WIP

* Update WebKit

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Update WebKit

* WIP

* WIP

* WIP

* WIP

* Workaround missing system calls

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Fix baseline detection

* WIP

* strip debug symbol

* Auto-generate canary build

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-07-22 00:58:45 -07:00
Jarred Sumner
c772256e93 Separate Dockerfile for devcontainer 2022-07-21 16:58:24 -07:00
Jarred Sumner
4b5e7cdab7 Bump 2022-07-21 16:58:24 -07:00
Jarred SUmner
588669ea6a Redo the dockerfile 2022-07-21 16:58:07 -07:00
Sakib Hasan
e6c58ae4f2 docs(templates): Update README.md (#783)
Improvement reactjs example readme file, Added learning resources
2022-07-21 13:07:40 +02:00
Carter Snook
afb1dc1d79 chore(vscode): set tab size and tab format (#810) 2022-07-20 13:37:52 -07:00
Carter Snook
7500f4b2ca feat(node/fs): implement more stat methods (#807) 2022-07-20 10:19:41 -07:00
sanix-darker
8d96b184df doc: added an helper for the huge Makefile 2022-07-20 13:15:28 +02:00
Alexander
5c620959bb fix install script colors 2022-07-20 11:51:21 +04:00
Jarred Sumner
08bff8e090 Allow blank 2022-07-19 23:04:54 -07:00
Carter Snook
8bcf68e5e0 fix(api): stop double-free of prop array (#793) 2022-07-19 21:05:52 -07:00
Wallunen
e5af1ea3bc refactor(installer): renovate install script (#745) 2022-07-19 14:56:28 -04:00
SheetJSDev
6afbf1b166 added mystery-box example macro (#787) 2022-07-18 22:26:56 -07:00
Shahidul Islam Majumder
600929ee6d fix deno console.log benchmark (#771)
* chore(benchmark): fix deno console.log benchmark

* only show benchmark results

Co-authored-by: evanwashere <github@evan.lol>
2022-07-18 19:30:58 -04:00
Jarred Sumner
d2874f6a49 bump examples 2022-07-18 13:12:03 -07:00
Jarred Sumner
a1a0c18478 [js] Set global and self
Fixes https://github.com/oven-sh/bun/issues/768
2022-07-17 22:49:09 -07:00
Jarred Sumner
ba65185bcb [js] Fix invalid unicode codepoint in error 2022-07-17 22:39:57 -07:00
Jarred Sumner
a17221258d Fixes https://github.com/oven-sh/bun/issues/769
Not tested
2022-07-17 22:37:24 -07:00
SheetJSDev
a00380c7c2 url.js use util_isString (#772) 2022-07-17 22:00:23 -07:00
Jarred Sumner
2ef7a12383 Update Dockerfile 2022-07-17 17:16:45 -07:00
Jarred Sumner
d54470ef98 Use Node v16 in Dockerfile due to glibc 2.28 requirement 2022-07-17 16:48:26 -07:00
Jarred Sumner
17bbdf790e Try with 18.04 2022-07-17 16:37:36 -07:00
Jarred Sumner
bcad0d4de7 Downgrade Ubuntu used in Dockerfile to hopefully reduce glibc requirement to 2.27 2022-07-17 16:35:42 -07:00
Jarred Sumner
9ab63dced8 [bun install] Forgot to commit isCI function 2022-07-17 15:54:43 -07:00
Alexander Kuznetsov
e79ed4f738 fix printing message for thrown non-error objects (#764)
* fix printing message for thrown non-error objects

* fine tuning error formatting

* more fine tuning error formatting
2022-07-17 13:24:35 -07:00
Jarred Sumner
b897ad3ec2 [bun install] Implement --no-verify flag to skip verifying integrity of downloaded packages 2022-07-17 10:08:37 -07:00
Jarred Sumner
daed2a79f9 [bun install] Rename skip_verify -> skip_verify_installed_version_number 2022-07-17 10:08:37 -07:00
Jarred Sumner
0a5470e802 [bun install] Implement --no-progress to disable the progress bar 2022-07-17 10:08:37 -07:00
Jarred Sumner
a02b2d1c5b [bun install] Improve performance of integrity hashing
By using optimized BoringSSL implementations
2022-07-17 10:08:37 -07:00
Jochem Hagenaars
0cc88b8669 Bumped hono version number (#746)
* Bumped hono version number

* Changed bun-types version
2022-07-17 09:57:29 -07:00
pathei-kosmos
c4fbcaeb21 fixed some licenses in README (#758)
* fixed some licenses

* typo
2022-07-17 07:58:49 -07:00
Alexander Kuznetsov
a85413c802 fix scoped packages name resolution (#760) 2022-07-17 07:58:28 -07:00
thislooksfun
24a5f9ba29 test(wiptest): add a way to test wiptest (#699)
This adds a really basic test runner that will execute test files using
`bun wiptest` and compare the output to make sure it's correct. It could
definitely be improved, especially in the speed department, but it's at
least functional now, which is better than we had before!
2022-07-16 20:36:46 -07:00
thislooksfun
e9f376825c docs: fix documentation of atob and btoa (#748)
These function are confusingly named. `btoa` converts "Binary" to Ascii
by encoding the input using base64. `atob` reverses that process by
base64 decoding the Ascii input into a "Binary" output.

The names come from the Unix utilities with the same names, which
"converts a binary file to ascii for transmission over a telephone line"
(https://www.unix.com/man-page/minix/1/btoa/)

See:
- https://developer.mozilla.org/en-US/docs/Web/API/atob
- https://developer.mozilla.org/en-US/docs/Web/API/btoa
- https://html.spec.whatwg.org/multipage/webappapis.html#dom-btoa-dev

Note: the actual implementation of `btoa` and `atob` are correct, but
the docs were backwards.
2022-07-16 15:23:18 -07:00
John Daly
3c0f18f704 fix/clean-up-bun-error (#753)
* Fixing TypeScript errors in bun-error package

* Fixing import path

* Removing unused 'isClient' prop from AsyncSourceLines

* PR feedback
2022-07-16 15:14:14 -07:00
Jarred Sumner
f7e9b91701 [parser] Fix symbol collision with require
Fixes https://github.com/oven-sh/bun/issues/674
Fixes https://github.com/oven-sh/bun/issues/382
2022-07-15 23:08:25 -07:00
Jarred Sumner
e7246837a1 Add a TLA test 2022-07-15 21:48:30 -07:00
Jarred Sumner
fd4a210b84 [bun.js] Fix non-ascii latin1 string handling in console.log
Closes https://github.com/oven-sh/bun/issues/738
Closes https://github.com/oven-sh/bun/issues/737
2022-07-15 21:07:41 -07:00
Travis Pulley
9a7874a680 minor edit: Makefile (#672)
* minor edit: Makefile

Fixed a suggested command when ninja isn't found to the correct package name

* Makefile: minor edit

Ninja build has different names in different package managers. This handles both known instances.

* Makefile: ninja package name suggestion

When checking requirements, ninja build has a different name for brew and ubuntu/debian. This handles both.
2022-07-15 16:42:53 -07:00
Finn R. Gärtner
5c2ec9cad2 fix(README): Remove unused troubleshooting link (#736) 2022-07-15 13:20:19 -07:00
Foyzul Karim
5b248962e7 docs: Added readme file for blank template (#727)
* Added  readme file for blank template

* Removed `Special note` section
2022-07-15 22:09:56 +02:00
Hyro
65027bff99 chore(workflows): dont run on forks (#734)
* build:(landing) automated website build

* Revert "build:(landing) automated website build"

This reverts commit ddee8485fd.

* workflows(bun-dockerhub): dont run on forks

* chore(bun-landing): update

dont run on forks
fix commit changes

* workflows(bun): dont run on forks

Co-authored-by: xHyroM <xHyroM@users.noreply.github.com>
2022-07-15 12:41:12 -07:00
Hiroaki Nakamura
f35e13d57e Use Jarred-Sumner/vscode-zig march18 in devcontainer (#266) 2022-07-15 12:13:02 -07:00
Hyro
04572506ba chore(workflows): labeler, label sync (#701)
* chore: labeler.yml

* chore(workflows): labeler

* chore(workflows): label syncer

* chore: labels.yml

* chore(labeler): add benchmarks

* chore(labels): add packages:bun

* chore(labeler): add packages:bun

* chore(labels): add question

* chore(labels): add esm<>cjs

* chore(labels): add chore label
2022-07-15 12:02:28 -07:00
Finn R. Gärtner
ebf78e5ea6 fix(examples/bun-bakery): Create gitignore (#697) 2022-07-15 12:02:03 -07:00
Wulfre
7e695c0086 Create github workflow to publish releases on dockerhub (#716)
* Create github workflow to publish releases on dockerhub

* Improve readability of final dockerhub dockerfile RUN command

Co-authored-by: Wulfre <wulfre@users.noreply.github.com>
2022-07-15 12:00:48 -07:00
SaltyAom
40b7b99c2c fix(types): add missing types from URLSearchParams (#731)
* feat(examples): add kingworld

* fix(examples/kingworld): add .gitignore

* fix(template/kingworld): rename .gitignore to gitignore

* fix(template/kingworld): update to request change

* fix(template/kingworld): update 'getting start' to 'Getting Started'

* template(kingworld/bun): update to requested change

* fix(bun-types): add missing method type of URLSearchParams
2022-07-15 12:00:16 -07:00
SaltyAom
61de6032af template(kingworld): Add kingworld template (#708)
* feat(examples): add kingworld

* fix(examples/kingworld): add .gitignore

* fix(template/kingworld): rename .gitignore to gitignore

* fix(template/kingworld): update to request change

* fix(template/kingworld): update 'getting start' to 'Getting Started'
2022-07-15 13:54:18 +02:00
Jonathan Rubin
b901f55164 chores(template/react): Update to React 18 (#627)
* Updated react example template

* build:(landing) automated website build

* removed bun.lockb and most of changes from react example index.html

Co-authored-by: rubinj30 <rubinj30@users.noreply.github.com>
2022-07-15 12:17:38 +02:00
Hyro
9eac93d176 fix(templates/blank): Update bun types (#704) 2022-07-14 20:43:02 +02:00
YOSHIKI
a4ced701dc fix(templates): Fix hono example template (#633)
* Fix hono example template

* Update package.json
2022-07-14 20:42:18 +02:00
Mustafa Hasan Khan
0d65a1fe10 fix(packages/bun-landing): Fixed punctuation (#280) 2022-07-14 20:20:43 +02:00
0xflotus
de50c709a4 fix small typo in readme (#706) 2022-07-14 13:56:50 -04:00
Robert Soriano
3b5ad05627 docs: remove emulating cpu section (#714) 2022-07-14 13:49:49 -04:00
pnxdxt
1ea4dc13f0 docs: correct typo missing dots (#603) 2022-07-13 23:51:22 +02:00
Fábio Santos
74a600b833 docs: Substitute npm install with bun add (#670) 2022-07-13 23:44:08 +02:00
Ikko Ashimine
4b271ee430 fix(napi): gurantee -> guarantee (#683) 2022-07-13 23:32:46 +02:00
Omer Shahar
6e4e5fa94c fix(README): Add punctuation (#611) 2022-07-13 23:20:54 +02:00
Dennis Dudek
8e9042142c docs: Add bun-bakery template (#649) 2022-07-13 22:40:29 +02:00
Gabriel Nunes
5a2425d585 fix: og:image share url (#678)
* feat: create share image for social media

* fix: group meta tags

* fix: adjust og:image to full url
2022-07-13 10:39:51 -07:00
evan
bf19759188 add node:http Server polyfill (#572)
* node:http polyfill

* remove @ts-ignore

* reuse emitter instance

* requested changes

* cleanup

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2022-07-13 07:08:57 -07:00
Thomas Jaggi
0bcd812bd5 docs: Link esbuild and @evanw in README (#669) 2022-07-13 11:35:00 +02:00
Finn R. Gärtner
2769c74c74 fix(env_loader): Off by one error (#668) 2022-07-13 02:33:32 -07:00
Jarred Sumner
64c93a0569 Types 2022-07-13 01:32:21 -07:00
evanwashere
f01bc3c752 switch from stream-browserify to readable-stream 2022-07-13 04:18:51 -04:00
Jarred Sumner
9bba47129a Add a console.log bench 2022-07-13 01:03:03 -07:00
Jarred Sumner
54b03f6e8a Add newline to symbols (fixes warning) 2022-07-13 01:03:03 -07:00
evanwashere
71930db9b0 fix benchmark not building with old rust version 2022-07-13 03:14:50 -04:00
Jarred Sumner
e4016c1a77 [http] Fix assertion 2022-07-12 22:56:20 -07:00
Jarred Sumner
b37ffde4ed [bun.js] GC more strings 2022-07-12 22:56:09 -07:00
Jarred Sumner
dd7a346ac8 [bun install] Handle case that should really never happen 2022-07-12 22:55:38 -07:00
Jarred Sumner
d3963d6ea2 [bun.js] Fix GC bug with fetch 2022-07-12 22:46:27 -07:00
pnxdxt
0592b1dbed feat(landing): create github action rebuilding the site on changes (#651) 2022-07-12 21:37:39 -07:00
Gabriel Nunes
7b3dbf1108 feat(packages/bun-landing): Create share image for social media (#629)
* feat: create share image for social media

* fix: group meta tags
2022-07-12 22:20:39 +02:00
Aditya Agarwal
60e8cf4746 fix(README): Exchange backticks for <code></code> (#641) 2022-07-12 22:11:43 +02:00
Aditya Agarwal
a396e69384 fix(README): Fix punctuation (#639) 2022-07-12 22:10:05 +02:00
Jarred Sumner
6eebd11a06 .3 not .0 2022-07-12 12:26:58 -07:00
Jarred Sumner
56ac919f54 [landing] Hashing benchmark 2022-07-12 12:21:56 -07:00
evanwashere
cbc1e407c3 use permalinks for landing page 2022-07-12 12:57:28 -04:00
evan
e55d6eed2b fix benchmark urls on landing page (#636) 2022-07-12 18:49:32 +02:00
Giorgio Bellisario
ed18a318b9 docs: Fix "coercion" spelling (#628) 2022-07-12 16:43:08 +02:00
pnxdxt
80969a59a5 chore(landing): build changes (#626) 2022-07-12 16:40:39 +02:00
Finn R. Gärtner
a0f8b8c68a fix(examples/hono): Update package name (#620) 2022-07-12 03:09:15 -07:00
SheetJSDev
5774069cfe fix blank template (#523) 2022-07-12 03:03:17 -07:00
Jarred Sumner
83ad9fa780 [napi] Implement napi_get_property_names 2022-07-12 02:50:47 -07:00
Jesse-Lucas1996
a63a0ccc10 docs: Hono example with typescript (#577)
* hono example with typescript

* changing of name in package json

* adding dom to lib

* removal of git ignore

* removed DOM

* Update examples/hono/src/index.ts

Co-authored-by: Hyro <generalkubo@gmail.com>

* changed port

* added read me

* Update index.ts

* Update package.json

* Update readme.md

Co-authored-by: Hyro <generalkubo@gmail.com>
Co-authored-by: Jesse Lucas <jlucas@corpcloud.com.au>
Co-authored-by: Finn R. Gärtner <65015656+FinnRG@users.noreply.github.com>
2022-07-12 11:46:22 +02:00
Ryan Bargholz
734775e410 Support specifying a JSON response type in bun.d.ts (#563)
Co-authored-by: Ryan Bargholz <ryan@asteria.com>
2022-07-12 01:47:58 -07:00
Ryan Russell
4987067a18 refactor(exports.zig): Fix WebSocketHTTPSClient var name (#598)
Signed-off-by: Ryan Russell <git@ryanrussell.org>
2022-07-12 01:47:36 -07:00
Finn R. Gärtner
a6ab6e2131 fix(env_loader): Ignore spaces before equals sign (#602)
* fix(env_loader): Ignore spaces before equals sign

* fix(env_loader): Change the type of key_end to usize
2022-07-12 01:42:36 -07:00
evan
a9e4ff2029 cleanup benchmarks folder (#587)
* cleanup benchmarks

* run prettier
2022-07-12 01:40:12 -07:00
Jarred Sumner
7eea306b0f Update build-id 2022-07-12 00:21:45 -07:00
Jarred Sumner
7b708255f5 [jsc] Fix segfault with promises 2022-07-12 00:20:46 -07:00
Jarred Sumner
46e8717e6c [bun install] Fix NotSameFileSystem error (for real this time) 2022-07-12 00:20:46 -07:00
Ben Williams
e85f8011d5 docs: Updated logLevel to include debug (#189) 2022-07-12 01:20:10 +02:00
pnxdxt
ae02cad3f5 docs: remove double v of version (#601) 2022-07-12 01:11:32 +02:00
Ryan Russell
f0529ca253 docs(various): .md readability improvements (#597) 2022-07-12 00:41:23 +02:00
Evan Boehs
349eb9481d docs: builtin -> built-in (#585) 2022-07-12 00:38:42 +02:00
deijjji303
889ed66a01 docs: Added note of AVX2 requirement and mentioned Intel SDE workaround in README.md (#346) 2022-07-12 00:36:51 +02:00
josesilveiraa
ede7576899 chore(docs): add comma (#580) 2022-07-12 00:33:03 +02:00
Rudraksh Karpe
299c61896e docs: Fix typo (#599)
Under the Credits section
On line no. 2, it is mentioned as based off of whereas based on would be the correct choice of a word representing it as official documentation of Bun.
I hope this would help to make the Bun Documentation more precise to the users.
2022-07-12 00:28:17 +02:00
Jarred Sumner
fb03027b5b Broken links? 2022-07-11 13:41:48 -07:00
B E C H
d3ec0e204f Fixed broken links on the Bun.serve benchmark (#590)
Fixed the broken links to the Bun.serve benchmark sources.
2022-07-11 13:39:42 -07:00
Jarred Sumner
9bd8e6e604 Update javascript.zig 2022-07-11 11:06:59 -07:00
Jarred Sumner
3086fff66d woops 2022-07-11 08:46:04 -07:00
Jarred Sumner
2b709315e3 [integration test scripts] bun -> bun dev 2022-07-11 08:45:44 -07:00
Jarred Sumner
a7adf3d369 Revert changes to integration test scripts that break macOS tests 2022-07-11 08:39:30 -07:00
Jarred Sumner
59113ea3ae Update build-id 2022-07-11 08:19:07 -07:00
Carter Snook
5fc353797f feat(core): implement web interaction APIs (#528)
* feat(core): implement web interaction APIs

* fix(core): adjust web prompt code and add types
2022-07-11 08:11:02 -07:00
Jarred Sumner
6190130626 [resolver] Stripe file:// from import paths 2022-07-11 08:04:55 -07:00
Jarred Sumner
f6cd941522 Fixes https://github.com/oven-sh/bun/issues/195 2022-07-11 08:04:55 -07:00
Jarred Sumner
a6c216db00 Revert "Fix: NotSameFileSystem at clonefile (#546)" (#581)
This reverts commit 2659febd1b.
2022-07-11 08:04:20 -07:00
Snazzah
4394169405 feat(types): Add types for node modules and various fixing (#470)
* fix(types): add __dirname and __filename as deprecated types

* fix(types): add stream() method to Blob

* fix(types): update getRandomValues in Crypto

* fix(types): add buffer type defs

* fix(types): remove buffer type setting in fs

* fix(types): extend TypedArray in crypto.getRandomValues

Co-authored-by: Carter Snook <cartersnook04@gmail.com>

* fix(types): add notes to some buffer methods

* fix(types): remove since jsdoc comments from buffer

* chore(types): fix bundle script and build types

* fix(types): update bundle script

This really shouldn't do anything differently, but it no longer hangs whenever I bundle types. Not sure if anyone else has this problem but, ehhhh...

* fix(types): remove unused types in buffer

* feat(types): add assert module types

* feat(types): add events module types

* feat(types): add os module types

* feat(types): add domain module types

* fix(types): add process.isBun type

* feat(types): add util module types

* feat(types): add querystring module types

* feat(types): add process module types

* feat(types): add string_decoder module types

* feat(types): add sys module types

* feat(types): add timers module types

* feat(types): add stream module types

* feat(types): add crypto module types

fix(types): fix types for stream, timers and util modules

* feat(types): add constants module types

* feat(types): add url module types

* feat(types): add tty module types

* feat(types): add http module types

* feat(types): add https module types

* feat(types): add punycode module types

* feat(types): add zlib module types

* feat(types): add supports-color module types

Co-authored-by: Carter Snook <cartersnook04@gmail.com>
2022-07-11 05:40:07 -07:00
Carlos Gabriel Vilas Novas Soares
6e5665de4e fix: environment typo (#568) 2022-07-11 05:39:03 -07:00
CharlieS1103
ea6d96f409 Cleanup discord-interactions readme (#451) 2022-07-11 05:34:21 -07:00
Aditya Gupta
2659febd1b Fix: NotSameFileSystem at clonefile (#546)
Fixes issue #531

Before this, using 'bun install' on a directory in different filesystem
such as tmpfs (/tmp) would have caused "Error: NotSameFileSystem".

This commit fixes that by handling this error, and at end of function it
will fall back to use copyfile (same as --backend=copyfile)
2022-07-11 05:31:00 -07:00
rml1997
1405158dfb Updated typo in example (#573)
Changed deocder to decoder
2022-07-11 05:26:45 -07:00
Jarred Sumner
d6d8c0b80d Fixes https://github.com/oven-sh/bun/issues/561 2022-07-11 04:34:38 -07:00
Jarred Sumner
d9491fe022 [js] Include TypedArray type name for empty arrays 2022-07-11 04:24:11 -07:00
Jarred Sumner
3609063d81 [js] When console.log typed arrays, include the type name and limit printed count to 512 2022-07-11 04:20:28 -07:00
Jarred Sumner
7904f49b5d Fixes https://github.com/oven-sh/bun/issues/229 2022-07-11 03:41:03 -07:00
Jarred Sumner
d35ca945c2 Bump zig build 2022-07-11 03:08:07 -07:00
Jarred Sumner
a20a341729 Move symbol 2022-07-11 02:12:23 -07:00
Jarred Sumner
7381c33f76 Run prettier 2022-07-11 02:10:32 -07:00
Jarred Sumner
1091ee2318 Fix broken build 2022-07-11 02:10:23 -07:00
Jarred Sumner
b79dd18ca5 [bun wiptest] Fix copy 2022-07-11 02:03:46 -07:00
evan
3abfc3566b add depd browser polyfill (#517) 2022-07-11 01:53:45 -07:00
thislooksfun
71992634a6 Fix macOS build (#525)
* style: remove some trailing whitespace

* docs: make `identifier-cache` _before_ `jsc`

Running them the other way around results in a failed build.

* docs: `npm i` in both `test/snippets` _and_ `test/scripts`

`test/scripts` has node packages as well. If they aren't installed, then
some of the tests fail to start.

* docs: add `rust` to list of homebrew packages

One of the dependencies tries to run `cargo`, and will fail the build if
it can't. The `cargo` command is provided by the `rust` brew package.

* docs: clean up section on macOS code signing

This requirement applies to _all_ macOS builds, not just those on Apple
Silicon, and also had some slightly confusing wording.

* build: remove leading whitespace from flags

This leading whitespace was making my system treat the argument as a
file with name ` -L$(LLVM_PREFIX)/lib` (leading whitespace included),
instead of as a library path argument.

* build: try llvm@13 first, then fall back on bare llvm

The macOS instructions say to install `llvm@13`, which has a different
path than the bare `llvm` install (`brew --prefix llvm@13` != `brew
--prefix llvm`). This patch takes a slightly smarter approach:

1. If the user defined `LLVM_PREFIX` and it points to a valid path on
   disk, use that.
2. If `LLVM_PREFIX` is NOT a valid path, try setting it to the `llvm@13`
   path.
3. If it's STILL not a valid path, try the plain `llvm` path
4. If it's STILL not valid, set it to a user-friendly error.

There might be a better solution for doing this, I'm not well-versed in
Makefile syntax, but it's at least slightly better than it was before.

* fix(build): update cast signature

`std.math.cast` was changed in 0e6285c8fc31ff866df96847fe34e660da38b4a9.
It used to throw if the cast would overflow, but now it returns `null`
instead.
2022-07-11 01:52:30 -07:00
Michell Brito
90ff529b55 Merge pull request #544 from xHyroM/chore/update-templates 2022-07-10 23:46:30 -04:00
Michell Brito
5a8b3b8ad7 Merge pull request #464 from dkarter/main
fix: remove unnecessary quotes in commit message
2022-07-10 23:42:44 -04:00
Aurora Luna Takemi
418972b423 Update GitHub URL to match new repo URL (#547)
* Update repo URLs

* GitHub URL update

* Revert accidental URL changes
2022-07-10 19:37:30 -07:00
Hyro
c1d4917593 chore(feature-request): change feature request to enhancement 2022-07-10 19:04:33 +02:00
Hyro
65d6e28b4f chore(api-ref-docs): change doc to documentation 2022-07-10 19:03:45 +02:00
Hyro
3c435f7856 chore(bug-report): add label bug, need repro 2022-07-10 19:01:20 +02:00
Hyro
659c3e0e12 chore: disable blank issues, add discord contact link 2022-07-10 19:00:27 +02:00
Giorgio Bellisario
1e9cba9972 Fix "operations" word spelling (#543) 2022-07-10 09:21:50 -07:00
Jacob
c3bf97002d clarify launch step (#534) 2022-07-10 07:23:09 -07:00
r00ster91
16452c16da Remove unnecessary Output.flushs before Global.exit and Global.crash (#535)
* fix: add missing newline

* refactor: std.process.exit -> Global.exit

* fix: std.os.abort -> Global.exit

I'm not sure about this one. Please verify.

* cleanup: remove unnecessary `Output.flush`s
2022-07-10 06:44:57 -07:00
Snazzah
05970fe1fb fix(bun-error): fix line endings 2022-07-10 06:42:09 -07:00
Snazzah
0f20d5913d feat(bun-error): update "powered by" logo to use new bun wordmark 2022-07-10 06:42:09 -07:00
Ryan Russell
0acf8a6618 refactor(websockets): Rename connectedWebSocketContext()
Signed-off-by: Ryan Russell <git@ryanrussell.org>
2022-07-09 18:34:46 -07:00
Hisam Fahri
547ac721fa fix: add grammar fix on templates 2022-07-09 18:34:20 -07:00
Hisam Fahri
8ff70a6224 feat: add bun docs report template 2022-07-09 18:34:20 -07:00
Hisam Fahri
b880c6663c feat: add feature request template 2022-07-09 18:34:20 -07:00
Hisam Fahri
66e52396dc feat: add bug report template 2022-07-09 18:34:20 -07:00
Laurens Lavaert
92225faa82 fix: actuality return result instead of ns time 2022-07-09 18:33:51 -07:00
Laurens Lavaert
36718c45fc bugfix: performance.now function should return MS instead of nano 2022-07-09 18:33:51 -07:00
lucasew
118c134918 update bash references to work in non-fhs compliant distros
Signed-off-by: lucasew <lucas59356@gmail.com>
2022-07-09 18:28:32 -07:00
b0iq
85dbb9cc92 using {process.version} instead of hardcoding 2022-07-09 18:27:56 -07:00
b0iq
e11f1476af Update Bun CLI version typo to v0.1.2 2022-07-09 18:27:56 -07:00
sno2
f5d896542a fix: update build files to latest Zig version 2022-07-09 18:25:25 -07:00
evanwashere
961d0a159a add partial node:net polyfill 2022-07-09 16:29:57 -07:00
JolteonYellow
1597424d17 fix dotenv package example on landing page (#436) 2022-07-09 15:49:37 -04:00
Jordan Lees
465e185a74 fix typo in readme (#449) 2022-07-09 15:39:01 -04:00
Michell Brito
5abee04991 Merge pull request #483 from pvinis/patch-1 2022-07-09 14:29:16 -04:00
Michell Brito
a884ca155e Merge pull request #476 from jakemcf22/main 2022-07-09 14:29:04 -04:00
Finn R. Gärtner
d3f912a79e fix: Append n when printing a BigInt 2022-07-09 20:23:56 +02:00
FinnRG
5d7aabb38a fix: Append n when printing a BigInt 2022-07-09 20:19:35 +02:00
Finn R. Gärtner
adda6f6dd1 fix: Remove unnecessary n while formatting 2022-07-09 20:05:32 +02:00
FinnRG
5191a57037 fix: Remove unnecessary n while formatting 2022-07-09 20:02:21 +02:00
Alexander
7d1c9fa1a4 Migrate to Zig v0.10.0 2022-07-09 05:09:16 -07:00
Ziloka
dd5996379d Update README.md 2022-07-09 04:51:23 -07:00
Pavlos Vinieratos
a0d471eda5 typo 2022-07-09 10:40:17 +01:00
Snazzah
f58501fc62 feat(landing): add favicon.ico 2022-07-09 00:57:52 -07:00
Snazzah
80dc9b97f2 chore(landing): build changes 2022-07-09 00:57:52 -07:00
Snazzah
d018b08082 feat(landing): add og:locale and twitter:site metadata 2022-07-09 00:57:52 -07:00
Snazzah
576ee66f20 feat(landing): add 256x icon 2022-07-09 00:57:52 -07:00
Snazzah
b55b49ac4e feat(landing): remove space between zig and "'s" 2022-07-09 00:57:52 -07:00
Snazzah
712f4a7f5d feat(landing): add SVG logo, manifest, and meta tags 2022-07-09 00:57:52 -07:00
Snazzah
528972ef8b feat: update default favicon to new logo 2022-07-09 00:57:08 -07:00
jakemcf22
8b4c7434c3 Fix grammar erros in README.md 2022-07-08 23:44:51 -07:00
Dorian Karter
b0760bbab5 fix: remove unnecessary quotes in commit message
These quotes are not necessary and appear literally in the commit
2022-07-08 18:46:53 -05:00
Hyro
ac8bcb5edb remove comments 2022-07-08 14:09:14 -07:00
Michell Brito
2b98ffd776 Merge pull request #433 from keidarcy/patch-1 2022-07-08 09:24:25 -04:00
Michell Brito
b373126927 Merge pull request #330 from Tropix126/a11y 2022-07-08 09:13:49 -04:00
Xing Yahao
34bb627a54 Fix react example README typo. 2022-07-08 19:37:06 +09:00
FinnRG
92584630c3 fix(templates/react): Add a SVG type definition 2022-07-08 02:59:52 -07:00
Hyro
6035ef353a use tsconfig from readme 2022-07-08 02:32:55 -07:00
xhyrom
4bd42e1cf0 add tsconfig 2022-07-08 02:32:55 -07:00
Hyro
f95919b5a3 update hello world 2022-07-08 02:32:55 -07:00
xhyrom
43657c4dd8 new template blank 2022-07-08 02:32:55 -07:00
Tropical
e158ee542d Slightly darken pink link color for contrast requirements. 2022-07-08 04:48:58 +00:00
Tropical
6256b88768 Pink chip contrast 2022-07-08 04:46:17 +00:00
Jarred Sumner
57d9c500a8 Update bun-types 2022-07-07 20:22:51 -07:00
Michell Brito
35d1f51d75 Merge pull request #305 from MoritzLoewenstein/main 2022-07-07 21:36:41 -04:00
Jarred Sumner
1ee94d5bd2 Bump examples 2022-07-07 16:02:04 -07:00
Hassan El Mghari
d513a62862 Updating format of Next.js example app README to match the rest 2022-07-07 15:58:05 -07:00
Hassan El Mghari
76ef4fc976 Deleted installing dependencies from Discord README since it's done automatically when cloning 2022-07-07 15:58:05 -07:00
Hassan El Mghari
fe858a9196 Updating README for React example to match Discord 2022-07-07 15:58:05 -07:00
Hassan El Mghari
6770356c5b Clean up README for React example 2022-07-07 15:58:05 -07:00
Hassan El Mghari
ebccbaeee9 Update command to run react app to bun dev 2022-07-07 15:58:05 -07:00
K.J. Valencik
b64c71eece fix: napi_get_version should return the Node-API version and not the bun version 2022-07-07 14:18:44 -07:00
CoffeeMovedCoder
4b4bc8a380 Add troubleshooting for old intel CPUs 2022-07-07 14:15:45 -07:00
Hassan El Mghari
485ef8c4fc Delete second.tsx page as it's not being used 2022-07-07 14:14:57 -07:00
Hassan El Mghari
5b880512fb Removed unused parts of index.tsx 2022-07-07 14:14:57 -07:00
Hassan El Mghari
3b43a192f1 Cleaned up the Next.js example README 2022-07-07 14:14:57 -07:00
Tropical
911f74496d Merge branch 'main' into a11y 2022-07-07 15:29:44 -05:00
michell brito
7118df32bb Fix: long numbers + unused css 2022-07-07 11:52:26 -07:00
Michell Brito
73c0300d63 Merge pull request #370 from PyBaker/patch-1 2022-07-07 12:57:41 -04:00
PyBaker
0cf76f628e Update README.md 2022-07-07 18:38:12 +03:00
Jarred Sumner
ee83e25120 [install] Use an identifier for the accept header value 2022-07-07 05:36:37 -07:00
Jarred Sumner
d6fb068230 Fixes https://github.com/Jarred-Sumner/bun/issues/341 2022-07-07 04:50:37 -07:00
Jarred Sumner
e1e3cee16a Outdated type 2022-07-07 03:44:11 -07:00
Jarred Sumner
fb6d438485 Fix copy 2022-07-07 03:33:05 -07:00
shanehsi
f84f7f8acb fix devcontainer starship installation 2022-07-07 02:49:04 -07:00
Hiroaki Nakamura
8e912b4a20 Use Node.js v18.x from NodeSource to use string.replaceAll method
Node.js in Ubuntu focal does not have string.replaceAll method.
```
root@focal:~# node --version
v10.19.0
root@focal:~# echo "console.log(''.replace)" | node
[Function: replace]
root@focal:~# echo "console.log(''.replaceAll)" | node
undefined
```

And it gives the following error at
f0c283c632/Makefile (L722)

```
/build/bun/misctools/headers-cleaner.js:33
input = input.replaceAll("*WebCore__", "*bindings.");
              ^

TypeError: input.replaceAll is not a function
    at Object.<anonymous>
(/build/bun/misctools/headers-cleaner.js:33:15)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js
(internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
make: *** [Makefile:722: jsc-bindings-headers] Error 1
```
2022-07-07 02:47:57 -07:00
Ikko Ashimine
6c5472a84c [strings] Fix typo in string_immutable.zig
occurences -> occurrences
2022-07-07 02:46:32 -07:00
Jarred Sumner
1f887bb863 Bump build-id 2022-07-07 01:05:39 -07:00
Hassan El Mghari
1739513095 Update list of unsupported bun Next.js features 2022-07-07 00:44:31 -07:00
Jarred Sumner
621fe3f5d2 [next] Fix @types/react error 2022-07-06 23:57:47 -07:00
Jarred Sumner
0196bbee21 [cli] Clarify 2022-07-06 23:40:22 -07:00
Jarred Sumner
e4670b7513 Improve error message for outdated linux kernel 2022-07-06 23:30:19 -07:00
Jarred Sumner
4601531bf0 [tsconfig] Fix crash affecting preact 2022-07-06 23:16:18 -07:00
Jarred Sumner
520f7e78ac [internal] Fix failing build 2022-07-06 23:16:05 -07:00
Jarred Sumner
9962df69d6 [bun install] Fix NotSameFileSystem error 2022-07-06 22:29:30 -07:00
Tropical
47498eb375 properly style inner navigation ulist 2022-07-07 05:26:01 +00:00
Tropical
c78c810294 Refactor InstallBox 2022-07-07 05:19:30 +00:00
Michell Brito
8dc6f839a9 Merge pull request #264 from eyalcohen4/main 2022-07-07 01:03:06 -04:00
Tropical
c8d51cc05a Improve link contrast, refactor tabbar 2022-07-07 04:59:58 +00:00
mrowles
c99a9a6cb7 chore(examples): Updates start doco 2022-07-06 21:18:03 -07:00
Isaac McFadyen
fb95f6b225 Updated CPU in benchmarks 2022-07-06 20:07:13 -07:00
josefaidt
c747a08649 docs: add callout for typedefs with TypeScript 2022-07-06 19:22:53 -07:00
Egor
ee5144924b fix: spawn thread on linux 2022-07-06 19:22:29 -07:00
Moritz Löwenstein
ba9c64dc14 fix: add unzip is required information 2022-07-07 00:25:08 +02:00
Jarred Sumner
57f2208bdf Update Deno number for React SSR after 8c1157be22
This is the best of 3 runs

jarred in jarred-desktop in ~
❯ oha -z 5s http://localhost:8080
Summary:
  Success rate:	1.0000
  Total:	5.0006 secs
  Slowest:	0.0504 secs
  Fastest:	0.0001 secs
  Average:	0.0037 secs
  Requests/sec:	13533.1616

  Total data:	3.94 MiB
  Size/request:	61 B
  Size/sec:	806.17 KiB

Response time histogram:
  0.001 [51666] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.002 [9726]  |■■■■■■
  0.003 [1369]  |
  0.004 [185]   |
  0.005 [34]    |
  0.006 [0]     |
  0.007 [4]     |
  0.008 [1]     |
  0.009 [2]     |
  0.010 [2]     |
  0.011 [4685]  |■■

Latency distribution:
  10% in 0.0001 secs
  25% in 0.0002 secs
  50% in 0.0006 secs
  75% in 0.0010 secs
  90% in 0.0019 secs
  95% in 0.0434 secs
  99% in 0.0473 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0002 secs, 0.0001 secs, 0.0006 secs
  DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0000 secs

Status code distribution:
  [200] 67674 responses

jarred in jarred-desktop in ~ took 5s
❯ oha -z 5s http://localhost:8080
Summary:
  Success rate:	1.0000
  Total:	5.0005 secs
  Slowest:	0.0492 secs
  Fastest:	0.0001 secs
  Average:	0.0032 secs
  Requests/sec:	15328.8994

  Total data:	4.46 MiB
  Size/request:	61 B
  Size/sec:	913.15 KiB

Response time histogram:
  0.001 [63524] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.002 [7172]  |■■■
  0.003 [1155]  |
  0.004 [52]    |
  0.004 [3]     |
  0.005 [9]     |
  0.006 [4]     |
  0.007 [26]    |
  0.008 [2]     |
  0.009 [3]     |
  0.010 [4702]  |■■

Latency distribution:
  10% in 0.0002 secs
  25% in 0.0003 secs
  50% in 0.0005 secs
  75% in 0.0008 secs
  90% in 0.0013 secs
  95% in 0.0434 secs
  99% in 0.0440 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0003 secs, 0.0001 secs, 0.0006 secs
  DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0000 secs

Status code distribution:
  [200] 76652 responses

jarred in jarred-desktop in ~ took 5s
❯ oha -z 5s http://localhost:8080
Summary:
  Success rate:	1.0000
  Total:	5.0006 secs
  Slowest:	0.0518 secs
  Fastest:	0.0001 secs
  Average:	0.0032 secs
  Requests/sec:	15786.6566

  Total data:	4.59 MiB
  Size/request:	61 B
  Size/sec:	940.42 KiB

Response time histogram:
  0.001 [66905] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.002 [6834]  |■■■
  0.003 [409]   |
  0.003 [18]    |
  0.004 [17]    |
  0.005 [17]    |
  0.006 [3]     |
  0.007 [3]     |
  0.008 [2]     |
  0.009 [2]     |
  0.009 [4733]  |■■

Latency distribution:
  10% in 0.0002 secs
  25% in 0.0004 secs
  50% in 0.0005 secs
  75% in 0.0008 secs
  90% in 0.0012 secs
  95% in 0.0434 secs
  99% in 0.0440 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0003 secs, 0.0001 secs, 0.0007 secs
  DNS-lookup:	0.0000 secs, 0.0000 secs, 0.0000 secs

Status code distribution:
  [200] 78943 responses
2022-07-06 14:50:57 -07:00
Hiroaki Nakamura
a2313cede3 Add needed dependencies to Makefile devcontainer target 2022-07-06 14:41:39 -07:00
Alexander
996a7ade9f fix tabpanel a11y 2022-07-06 14:04:35 -07:00
Alexander
024233feeb fix a11y issues on landing 2022-07-06 14:04:35 -07:00
Yongwook Choi
48058fac99 docs: Fix broken toc link 2022-07-06 14:03:20 -07:00
Joe Previte
9a9bb823f6 fixup!: add newline to end of file 2022-07-06 14:00:47 -07:00
Joe Previte
73ab469102 refactor: wrap BigInt tests in describe block
Place BigInt tests inside of describe block to match test structure of
the rest of the codebase.
2022-07-06 14:00:47 -07:00
Eyal Cohen
c6967634c9 Add a space in page.tsx 2022-07-06 16:34:07 +03:00
Daniel Tolentino
f0c283c632 Add Bun logo 2022-07-06 04:12:45 -07:00
ManiTheDev
4654de7ee5 adding a template .gitignore 2022-07-06 04:11:31 -07:00
Andrea Giammarchi
b59908d291 Fix #253 - Explicitly exported randomUUID from global crypto 2022-07-06 04:08:53 -07:00
Feng Yu
a22b333f2a Fix Safari's implementation broken link 2022-07-06 04:06:51 -07:00
Kayla Washburn
636e71d54e Allow setting MIN_MACOS_VERSION as an environment variable 2022-07-06 01:17:31 -07:00
Kayla Washburn
6ea9332c87 Allow setting LLVM_PREFIX as an environment variable 2022-07-06 01:17:31 -07:00
Nishan
72184748d8 fix: home page links 2022-07-06 01:17:09 -07:00
Jay Baker
797d52beb5 fix: typo in the word enormous. fixes #214 2022-07-06 01:16:18 -07:00
Jarred Sumner
d875c9988a [bench] Add comparison for react-dom builds 2022-07-06 00:07:59 -07:00
Luca Casonato
8c1157be22 Disable response body auto compression in Deno
Allows for a more apples to apples comparison between runtimes
2022-07-05 17:13:52 -07:00
Steven
f32153754c fix: missing space in docs on homepage 2022-07-05 15:50:04 -07:00
addy
44ee4caf6f Change fish path addition command 2022-07-05 14:39:04 -07:00
Jarred Sumner
e4fb842757 Update build-id 2022-07-05 13:03:02 -07:00
Jarred Sumner
780b919e26 delete this 2022-07-05 13:03:02 -07:00
Jarred Sumner
f7c32745e0 update 2022-07-05 13:03:02 -07:00
evanwashere
bd8c7915b9 add invite url guide 2022-07-05 11:45:28 -07:00
evanwashere
91cff94739 add creating discord bots to readme 2022-07-05 11:45:28 -07:00
Kirk Scheibelhut
0c9fb7e063 nitpick README
- modify wording of example which implies there are two blobs beings passed when only one is
- styling Bun.js -> bun.js for consistency
- correct 63 bits -> 53 bits
2022-07-05 11:40:27 -07:00
Jarred Sumner
70e2bda971 Fix tests 2022-07-05 11:04:59 -07:00
Jarred Sumner
0d54275314 [create] Don't print timestamp because it formats weird 2022-07-05 10:29:03 -07:00
Jarred Sumner
b64bfc0153 mitigate HMR bug 2022-07-05 10:28:34 -07:00
Jarred Sumner
9afed496a8 Bump discord-interactions template 2022-07-05 10:28:14 -07:00
Jarred Sumner
3bf467375b latest 2022-07-05 09:40:37 -07:00
evanwashere
aaffcb410f nitpicks 2022-07-05 09:26:58 -07:00
evanwashere
d3e0955ddc more examples 2022-07-05 09:26:58 -07:00
evanwashere
5d4fbf7f02 TLA & typescript 2022-07-05 09:26:58 -07:00
evanwashere
4a927e09b7 discord interactions template 2022-07-05 09:26:58 -07:00
Jarred Sumner
a577e3507f latest 2022-07-05 08:55:20 -07:00
Jarred Sumner
cb67add26a Fix copy button 2022-07-05 02:53:25 -07:00
Jarred Sumner
2470c0d090 Current landing 2022-07-05 02:25:33 -07:00
Jarred Sumner
2d8dfeff49 [breaking] bun now prints the help menu instead of the dev server 2022-07-05 00:56:39 -07:00
Jarred Sumner
18290dee8b [jsc] More careful code in dynamic require 2022-07-05 00:55:43 -07:00
Jarred Sumner
9137862bc7 Fix crash in dynamic import? 2022-07-05 00:55:24 -07:00
Jarred Sumner
288178e94c Fix bug in ffi 2022-07-05 00:55:07 -07:00
Jarred Sumner
ebb4f85feb [bun-framework-next] Bump 2022-07-05 00:54:56 -07:00
Jarred Sumner
f5527c976e Clean up some benchmarks 2022-07-05 00:54:42 -07:00
Jarred Sumner
ab7f57239d [bench] react hello world 2022-07-04 18:06:30 -07:00
Jarred Sumner
a822135603 Update Dockerfile 2022-07-04 17:36:20 -07:00
Jarred Sumner
6190dc5da5 [internal] Don't need to run jsc-bindings-headers in CI 2022-07-04 17:32:19 -07:00
Jarred Sumner
090a913660 once more 2022-07-04 17:26:46 -07:00
Jarred Sumner
db2f101971 [internal] Fix build script on old node 2022-07-04 17:23:43 -07:00
Jarred Sumner
41f4302d39 Handle global require("string") 2022-07-04 17:17:29 -07:00
Jarred Sumner
91cada219b Fix case in dynamic require() 2022-07-04 17:17:11 -07:00
Jarred Sumner
7d3459f53d [internal] Fix duplicate symbol issue 2022-07-04 16:47:34 -07:00
Jarred Sumner
cf4c9912c3 Fix npm peer dep issue 2022-07-04 16:46:17 -07:00
Jarred Sumner
b685cd49a6 [bench] Add a react ssr hello world 2022-07-04 16:41:16 -07:00
Jarred Sumner
9c960fcafd Update bun.lockb 2022-07-04 16:39:55 -07:00
Jarred Sumner
4acc0351cf Update README.md 2022-07-04 16:39:48 -07:00
Jarred Sumner
2f212d1386 [resolver] Add a test for self-referencing package.json exports 2022-07-04 16:39:33 -07:00
Jarred Sumner
1e54e94cc2 Bump docker build of webkit 2022-07-04 16:39:05 -07:00
Jarred Sumner
48f64bc6e5 [itnernal] Cleanup some of the streams code 2022-07-04 16:38:45 -07:00
Jarred Sumner
667303fc86 [internal] Add a note explaining what to do if this fails 2022-07-04 16:36:51 -07:00
Jarred Sumner
6768db9a6e [jsc] Handle promise ownership (might revert this) 2022-07-04 16:36:28 -07:00
Jarred Sumner
d516e3523b [jsc] Run JSC's deferredWorkTimer sometimes 2022-07-04 16:35:11 -07:00
Jarred Sumner
a6d4283986 [jsc] Attempt to make detecting ArrayBuffer/Uint8Array faster 2022-07-04 16:34:42 -07:00
Jarred Sumner
abd9d8bcab [server] Clean up some of the logic for freeing ReadableStream 2022-07-04 16:34:08 -07:00
Jarred Sumner
430532feec Update __global.zig 2022-07-04 16:33:39 -07:00
Jarred Sumner
cf5939c425 [jsc] Make JSC own the memory for source code strings 2022-07-04 08:42:29 -07:00
Jarred Sumner
bbcc08dbb4 Merge branch 'jarred/landing' 2022-07-04 08:41:03 -07:00
Jarred Sumner
77b5999b73 [bench] Add a performance.now bench 2022-07-04 08:39:27 -07:00
Jarred Sumner
2f553df8be [bench] Add an async overhead bench 2022-07-04 08:39:18 -07:00
Jarred Sumner
17045601e7 [bench] Add an ffi data overhead bench 2022-07-04 08:39:07 -07:00
Jarred Sumner
0f987a5601 [strings] Minor performance optimizations to SourceMaps 2022-07-04 08:05:21 -07:00
Jarred Sumner
fb48557154 Export Bun__readOriginTimer 2022-07-04 08:04:54 -07:00
Jarred Sumner
14846710c5 Make log_protection dev_only 2022-07-04 08:04:31 -07:00
Jarred Sumner
2ba3a6fbbc Improve the performance of performance 2022-07-04 08:04:21 -07:00
Jarred Sumner
027d64c78f 0.1 2022-07-04 08:03:34 -07:00
Jarred Sumner
d653341e03 0! 2022-07-04 08:03:24 -07:00
Jarred Sumner
fd09b30538 [sourcemaps] Add an assertion 2022-07-04 06:03:31 -07:00
Jarred Sumner
eea02d9500 [misc] Make that test work 2022-07-04 06:03:19 -07:00
Jarred Sumner
c7e0ed8e21 Update page.tsx 2022-07-04 02:02:43 -07:00
Jarred Sumner
c34e9ced81 Add a getting started section 2022-07-04 01:26:09 -07:00
Jarred Sumner
344998a873 Fix WebAssembly.instantiate 2022-07-04 01:25:41 -07:00
Jarred Sumner
6f7af725ff Export fs.promises 2022-07-04 00:16:29 -07:00
Jarred Sumner
e553e82acc wip 2022-07-03 23:55:11 -07:00
Jarred Sumner
78d5a0f201 Update README.md 2022-07-03 23:54:44 -07:00
Jarred Sumner
53a8ab5715 Re-enable buffer pooling 2022-07-03 23:17:27 -07:00
Jarred Sumner
544ab558dc wip 2022-07-02 23:33:24 -07:00
Jarred Sumner
edd550a5ee wip 2022-07-02 23:33:20 -07:00
Jarred Sumner
c3ea15f4bc Backport https://github.com/WebKit/WebKit/pull/2024 2022-07-02 04:05:21 -07:00
Jarred Sumner
efdc60372f [bun:jsc] Add generateHeapSnapshotForDebugging 2022-07-02 04:05:04 -07:00
Jarred Sumner
6f3a092564 [bun:jsc] Add protectedObjectTypeCounts, disallow gc 2022-07-02 02:35:43 -07:00
Jarred Sumner
d1ad1089bc Update README.md 2022-07-02 01:37:13 -07:00
Jarred Sumner
29af6560d3 [internal] Add react-dom as a dev dependency for the tests 2022-07-02 01:36:04 -07:00
Jarred Sumner
ef742f2fa8 [internal] Clean up launch.json 2022-07-02 01:36:04 -07:00
Jarred Sumner
2c70badad6 Update WebKit 2022-07-02 01:36:04 -07:00
Jarred Sumner
0d9ebb1fd2 [internal] Make make jsc-bindings-headers more reliable 2022-07-02 01:36:04 -07:00
Jarred Sumner
ba2c24e77c [bindings] Mark more stuff as unreachable 2022-07-02 01:36:04 -07:00
Jarred Sumner
d1cc2b85cb Update reactdom-bun.js 2022-07-02 01:36:04 -07:00
Jarred Sumner
7c996fe2e6 [bun:jsc] Add a test for getProtectedObjects 2022-07-02 01:36:04 -07:00
Jarred Sumner
f9f573ebb4 [strings] Optimize TextEncoder a little more 2022-07-02 01:36:04 -07:00
Jarred Sumner
476b3c7404 [bun http] Attempt to fix a crash 2022-07-02 01:36:04 -07:00
Jarred Sumner
500e5ed949 [streams] Rename drain() -> flush() 2022-07-02 01:36:04 -07:00
Jarred Sumner
b995e7797d [bun:jsc] Add export for getProtectedObjects 2022-07-02 01:36:04 -07:00
Jarred Sumner
69b32a01c4 Update html_rewriter.zig 2022-07-02 01:36:04 -07:00
Jarred Sumner
d3ba6f0f12 Rename defaultErrorHandler to runErrorHandler 2022-07-02 01:36:04 -07:00
Jarred Sumner
f6002b799b Delete BunStream 2022-07-02 01:36:04 -07:00
Jarred Sumner
874344eead [bun:jsc] expose getProtectedObjects gc hook 2022-07-02 01:36:04 -07:00
Jarred Sumner
6567224125 wip 2022-07-02 01:36:04 -07:00
Koka Easwarendra
7907de58be update cli comment to match the create next app instructions 2022-07-01 19:12:01 -07:00
Jarred Sumner
b686003710 [stremas] Regenerate JSSInk 2022-07-01 04:03:32 -07:00
Jarred Sumner
cd7dd0f007 [streams] Add an integer tag identifying what the stream type is 2022-07-01 04:02:09 -07:00
Jarred Sumner
6ecf7ec138 [Bun.serve] Add explicit function for clearing the abort callback 2022-07-01 04:01:27 -07:00
Jarred Sumner
0ab0d35542 [Bun.serve] Clean up lifetimes & error handling somewhat 2022-07-01 04:01:00 -07:00
Jarred Sumner
460ee12906 [Bun.serve] Don't run error recursively 2022-07-01 03:27:27 -07:00
Jarred Sumner
13e2ac08bd Add some tests for error handling 2022-07-01 03:25:17 -07:00
Jarred Sumner
589993192a Improve test coverage for streams 2022-07-01 03:24:58 -07:00
Jarred Sumner
4812fb8faf Fix failing tests for ReadableStream -> {text, arrayBuffer, blob} 2022-07-01 03:24:16 -07:00
Jarred Sumner
e105cfcca8 Zig::ImportMeta 2022-07-01 03:22:23 -07:00
Jarred Sumner
f2569c8c6e Move ImportMeta into it's own object 2022-07-01 03:21:55 -07:00
Jarred Sumner
4aec5151e5 [TextEncoder] Use JSC heap for small buffers 2022-06-30 20:40:05 -07:00
Jarred Sumner
ac8dd5e59b Create process object lazily 2022-06-30 19:27:30 -07:00
Jarred Sumner
c9f1d146c2 Fix incorrect type 2022-06-30 19:25:56 -07:00
Jarred Sumner
180068e46c Improve test coverage for react ssr 2022-06-30 19:25:46 -07:00
Jarred Sumner
6e59b996ba Fix memory leak 2022-06-30 19:24:15 -07:00
Jarred Sumner
39d111fa63 Document failed experiment 2022-06-30 19:23:36 -07:00
Jarred Sumner
4821b9c10b Fix promise memory leak 2022-06-30 19:23:27 -07:00
Jarred Sumner
457a13e238 [strings] Faster latin1 -> UTF8 length count 2022-06-29 20:53:50 -07:00
Jarred Sumner
6bc0bc2f63 [misc] Helper functions to ObjectPool 2022-06-29 20:52:58 -07:00
Jarred Sumner
856589bd98 [misc] Add generate-sink 2022-06-29 07:12:13 -07:00
Jarred Sumner
2fa51493c5 [http server] Fix a segfault when aborting 2022-06-29 07:10:30 -07:00
Jarred Sumner
4d3698e842 Correctly handle latin1 rope strings with non-ascii characters 2022-06-29 07:09:55 -07:00
Jarred Sumner
647110d513 [React SSR] Avoid getById slow path
thanks @Constellation
2022-06-29 07:09:25 -07:00
Jarred Sumner
425846f868 Regenerate builtins 2022-06-29 07:08:44 -07:00
Jarred Sumner
013dfb0498 [web streams] Handle direct streams in readableStreamToArray 2022-06-29 07:08:37 -07:00
Jarred Sumner
7168a40328 Make HTTP web streams faster 2022-06-29 07:07:52 -07:00
Jarred Sumner
66a297888f Remove incorrect assertion 2022-06-29 04:29:42 -07:00
Jarred Sumner
a02f42f84c Fix bug with printer 2022-06-29 04:29:32 -07:00
Jarred Sumner
7d5464adbe [encoder] Fix non-ascii latin1 characters 2022-06-29 04:29:01 -07:00
Jarred Sumner
95c1785271 begin adding react-ssr tests 2022-06-27 06:44:39 -07:00
Jarred Sumner
292f60a8a8 [http server] couple more tests 2022-06-27 05:46:26 -07:00
Jarred Sumner
cfcd8a1531 [uws] Add helper for corking 2022-06-27 05:33:44 -07:00
Jarred Sumner
cf4ec2b109 Handle when there are no headers to send 2022-06-27 05:33:27 -07:00
Jarred Sumner
628cbc8eb3 Cork streams when possible 2022-06-27 05:32:46 -07:00
Jarred Sumner
f66c277e54 Fix memory issue with error messages 2022-06-27 05:32:07 -07:00
Jarred Sumner
6544b2b57e Faster web streams 2022-06-27 05:31:58 -07:00
Jarred Sumner
3943ce5ac5 [web streams] Add more tests 2022-06-27 05:30:45 -07:00
Jarred Sumner
e93bdc79c7 Use less undefined 2022-06-27 05:30:16 -07:00
Jarred Sumner
3059d0fbb3 Add scoped logger functions for debug builds 2022-06-27 05:30:07 -07:00
Jarred Sumner
dc3a1170d4 use less undefined 2022-06-27 05:29:53 -07:00
Jarred Sumner
07050901a6 [fetch] Fix data corruption bug 2022-06-27 05:29:25 -07:00
Jarred Sumner
f70784a6d1 Fix data corruption bug in HTTP server 2022-06-27 05:28:45 -07:00
Jarred Sumner
77a0f335cb wip ReadableStream for HTTP(s) Server 2022-06-26 06:01:22 -07:00
Jarred Sumner
31cfcf2c9f Better node:url polyfill 2022-06-25 04:59:49 -07:00
Jarred Sumner
5bd5678ba3 Implement Bun.pathToFileURL & Bun.pathToFileURL 2022-06-25 04:42:56 -07:00
Jarred Sumner
1c04073e5e Update transpiler.zig 2022-06-25 04:42:11 -07:00
Jarred Sumner
8fbd92e37d Cleanup some of the require code 2022-06-25 04:41:20 -07:00
Jarred Sumner
7bb75f5553 Add dynamic require support 2022-06-24 06:59:47 -07:00
Jarred Sumner
6d6a89780b Update Makefile 2022-06-23 14:26:37 -07:00
Jarred Sumner
3decfcc442 Update Makefile 2022-06-23 14:25:35 -07:00
Jarred Sumner
32185fe791 Update Makefile 2022-06-23 14:24:37 -07:00
Jarred Sumner
3739816ce2 Update Makefile 2022-06-23 14:21:30 -07:00
Jarred Sumner
874692c9c9 Update Dockerfile 2022-06-23 14:17:57 -07:00
Jarred Sumner
a589153d89 Update Makefile 2022-06-23 02:49:46 -07:00
Jarred Sumner
252f8a0eec give up on emit-llvm for sqlite3 2022-06-23 01:52:28 -07:00
Jarred Sumner
86173f355a maybe that fixes it? 2022-06-23 01:41:06 -07:00
Jarred Sumner
b15d862275 Fix buffer test which was failing for correct reasons 2022-06-23 01:35:48 -07:00
Jarred Sumner
729e55a357 Update Makefile 2022-06-23 01:35:32 -07:00
Jarred Sumner
da616966a8 Update Makefile 2022-06-23 01:31:13 -07:00
Jarred Sumner
92c6837460 Delete some files 2022-06-22 23:39:07 -07:00
Jarred Sumner
d8a3c0f841 Update libbacktrace 2022-06-22 23:38:57 -07:00
Jarred Sumner
729d445b68 change the directory structure 2022-06-22 23:21:48 -07:00
Jarred Sumner
25f820c6bf maybe improve CPP build time 2022-06-22 22:52:24 -07:00
Jarred Sumner
a77825799e Move builtins to src/javascript/jsc/builtins 2022-06-22 22:52:03 -07:00
Jarred Sumner
7db88ca6b5 Tweak test runner output 2022-06-22 21:25:20 -07:00
Jarred Sumner
9843a9de53 Cleanup some tests 2022-06-22 21:25:07 -07:00
Jarred Sumner
aa97c1da2f Update Dockerfile.base 2022-06-22 21:25:01 -07:00
Jarred Sumner
dce542a623 Update WebKit 2022-06-22 21:11:34 -07:00
Jarred Sumner
e4e915d2ec cleanup websocket test 2022-06-22 21:11:28 -07:00
Jarred Sumner
f05428e4f3 Fix WebSocket when HTTP server is not running 2022-06-22 21:11:10 -07:00
Jarred Sumner
20249b9f80 Update build-id 2022-06-22 16:49:51 -07:00
Jarred Sumner
41575b982c cleanup 2022-06-22 16:48:03 -07:00
Jarred Sumner
b4feb33df9 Update index.d.ts 2022-06-22 06:56:47 -07:00
Jarred Sumner
d8dfddffe2 types for bun:jsc 2022-06-22 06:56:47 -07:00
Jarred Sumner
8c81fd5fc0 Slightly customize the events polyfill so it uses ESM 2022-06-22 06:56:47 -07:00
Jarred Sumner
0aa0eefd4e Fix memory bugs in escapeHTML & arrayBufferToString 2022-06-22 06:56:47 -07:00
Jarred Sumner
fa2d6a0d40 Add a simple test for EventEmitter 2022-06-22 06:56:47 -07:00
Jarred Sumner
d1ae1771eb Add a simple test for websockets 2022-06-22 06:56:47 -07:00
Jarred Sumner
08314c328e Handle integer overflow in logs better 2022-06-22 06:56:47 -07:00
Jarred Sumner
d450c4cdee [JS Printer] Fix bug with printing re-exported functions that are from an object binding 2022-06-22 06:56:47 -07:00
Jarred Sumner
659d4497d0 Fix bug with browser disabled modules 2022-06-22 06:56:47 -07:00
Jarred Sumner
772350a309 Disable modules in the linker 2022-06-22 06:56:47 -07:00
Jarred Sumner
cf0ee82926 this assertion isn't good enough 2022-06-22 06:56:47 -07:00
Jarred Sumner
150f33c6fa Disable modules constently for bun inbun bun 2022-06-22 06:56:47 -07:00
Jarred Sumner
56aec17b9b Fix bug with exceptions inside EventTarget 2022-06-22 06:56:47 -07:00
Jarred Sumner
92aeb0af55 Add a way to schedule microtasks from C++ 2022-06-22 06:56:47 -07:00
Jarred Sumner
759bfadb93 Update javascript.zig 2022-06-22 06:56:47 -07:00
Jarred Sumner
93d03e5147 Clean up perf hooks a little 2022-06-22 06:56:47 -07:00
Jarred Sumner
e3a00268eb use JSValue for bun test 2022-06-22 06:56:47 -07:00
Jarred Sumner
527eb40a2c ws polyfil 2022-06-22 06:56:47 -07:00
Jarred Sumner
2cdbd2de83 Polyfills for undici, streams/web, streams/consumer timers timers/promises, fs/promises, ws 2022-06-22 06:56:47 -07:00
Jarred Sumner
d9f6a3f2d2 Fix close 2022-06-22 06:56:47 -07:00
Jarred Sumner
6db9e10ff1 Explicitly tag memory ownership for escapeHTML 2022-06-22 06:56:47 -07:00
Jarred Sumner
1947c62539 Fix assertion that checks globally allocated memory pointers 2022-06-22 06:56:47 -07:00
Jarred Sumner
0843e383b2 Fix error messages sometimes printing undefined memory 2022-06-22 06:56:47 -07:00
Jarred Sumner
624bebd20f Add a way to assert memory is not undefined in debug builds 2022-06-22 06:56:47 -07:00
Jarred Sumner
41b03b5c4c Cleanup tests 2022-06-22 06:56:47 -07:00
Jarred Sumner
bfa5b29555 Add checks in debug mode that strings being built via counting were actually counted 2022-06-22 06:56:47 -07:00
Jarred Sumner
13693b7b63 [JS Parser] Improve memory safety of error messages & logs 2022-06-22 06:56:47 -07:00
Jarred Sumner
1bc3747042 [JS Parser] Fix undefined memory bug when printing an "cannot be used in strict mode" error message 2022-06-22 06:56:47 -07:00
Jarred Sumner
689666f17c [bun wiptest] Implement beforeEach, afterEach, beforeAll, afterAll 2022-06-22 06:56:47 -07:00
Jarred Sumner
0c12f1684f [websockets] Support receiving data of length 128 - 65354, bigger not supported yet 2022-06-22 06:56:47 -07:00
Jarred Sumner
07c010a377 Better error for undefined memory here 2022-06-22 06:56:47 -07:00
Jarred Sumner
9e4c11e280 Preallocate some event loop tasks 2022-06-22 06:56:47 -07:00
Jarred Sumner
7f836f2d73 Fix bugs with fifo tweaks 2022-06-22 06:56:47 -07:00
Jarred Sumner
abd042ea4a Update test_command.zig 2022-06-22 06:56:47 -07:00
Jarred Sumner
f004115dae bun wiptest improve test runner output 2022-06-22 06:56:47 -07:00
Jarred Sumner
d057b89a33 Sending works 2022-06-22 06:56:47 -07:00
Jarred Sumner
dda85d92c9 implement a custom websocket client 2022-06-22 06:56:47 -07:00
Jarred Sumner
ab888d2ebe It connects! but the frames are corrupt 2022-06-22 06:56:47 -07:00
Jarred Sumner
be9efacf1b WebSocket is a global 2022-06-22 06:56:47 -07:00
Jarred Sumner
71025c8bcc Fix most of the errors 2022-06-22 06:56:47 -07:00
Jarred Sumner
89f08aae27 more code 2022-06-22 06:56:47 -07:00
Jarred Sumner
38cc869104 WIP WebSocket 2022-06-22 06:56:47 -07:00
Alexander Kuznetsov
5d8a99e1d4 Group zsh completion options by type (#194) 2022-06-20 06:30:32 -07:00
Jarred Sumner
5eaf6d713e Import most of MessageEvent from WebKit 2022-06-17 04:10:21 -07:00
Jarred Sumner
b4049016ca some more tests 2022-06-15 22:12:04 -07:00
Jarred Sumner
9eaa427ec9 Update WebKit 2022-06-15 22:11:09 -07:00
Jarred Sumner
5b1eaa7719 [web standards] Add CloseEvent from WebKit 2022-06-15 22:10:57 -07:00
Jarred Sumner
e6fbbd48db Fix lazy loading internal streams 2022-06-15 22:10:12 -07:00
Jarred Sumner
56e88fb4dd direct streams mostly work 2022-06-15 07:17:42 -07:00
Jarred Sumner
d93f093313 wip direct streams 2022-06-15 02:00:45 -07:00
Jarred Sumner
dbde52504d ArrayBufferSink works and it's good. 2022-06-12 21:40:45 -07:00
Jarred Sumner
6d88a3d9c0 Fix build issue 2022-06-12 03:26:03 -07:00
Jarred Sumner
fddf8f8163 Delete broken submodule 2022-06-12 03:16:50 -07:00
Jarred Sumner
f4e578b598 Update Dockerfile.base 2022-06-10 19:54:22 -07:00
Jarred Sumner
a5d0706c78 Update WebKit 2022-06-10 19:12:37 -07:00
Jarred Sumner
0740cecbfb Update event_loop.zig 2022-06-10 18:59:09 -07:00
Jarred Sumner
b86ca5f67b Missing errno on linux 2022-06-10 18:58:15 -07:00
Jarred Sumner
cc4a164f20 Update js_parser.zig 2022-06-10 18:55:16 -07:00
Jarred Sumner
40184a9511 Update Makefile 2022-06-10 18:53:20 -07:00
Jarred Sumner
8859815d7b wip fix linux build 2022-06-10 18:52:31 -07:00
Jarred Sumner
60a0b10174 Don't show generic crash info when given invalid bunfig.toml 2022-06-10 02:28:36 -07:00
Jarred Sumner
9d54e2ca92 Update logger.zig 2022-06-10 02:27:37 -07:00
Jarred Sumner
89c182e9c5 Show tracing 2022-06-10 02:27:13 -07:00
Jarred Sumner
e441360ca7 Update bunfig.zig 2022-06-10 02:27:03 -07:00
Jarred Sumner
fc26e92b3e Update jest.zig 2022-06-10 02:26:45 -07:00
Jarred Sumner
3e70df3fb3 Update bun.d.ts 2022-06-09 21:40:13 -07:00
Jarred Sumner
7cda36c601 Add types 2022-06-09 21:36:43 -07:00
Jarred Sumner
5ccf606107 new Response(stream).arrayBuffer() + 3 more
- `new Response(stream).arrayBuffer()`
- `new Response(stream).json()`
- `new Response(stream).text()`
- `new Response(stream).blob()`
2022-06-09 21:29:57 -07:00
Jarred Sumner
b8eea5cc4a fix some memory leaks with strings 2022-06-09 05:09:48 -07:00
Jarred Sumner
c88dd2c52c Support console.log(myBigInt) 2022-06-09 05:09:22 -07:00
Jarred Sumner
78bf1150ff Fix defaultProps with JSX optimization 2022-06-09 05:09:00 -07:00
Jarred Sumner
7a20836a1b small perf improvements to encoding 2022-06-09 05:02:46 -07:00
Jarred Sumner
1467ec137a Update event_loop.zig 2022-06-07 22:47:28 -07:00
Jarred Sumner
552e93bfba Add fixture used in benchmark snippet 2022-06-07 22:46:05 -07:00
Jarred Sumner
e617dee621 Update bundler.zig 2022-06-07 22:42:50 -07:00
Jarred Sumner
609edc368f wip ReadableStream <> zig 2022-06-07 22:42:47 -07:00
Jarred Sumner
5b4dcb8d16 log esm import order 2022-06-07 22:42:12 -07:00
Jarred Sumner
cdd1a2bdc0 Implement hashCode 2022-06-07 22:41:27 -07:00
Jarred Sumner
43de33afc7 Web Streams API (#176)
* [bun.js] `WritableStream`, `ReadableStream`, `TransformStream`, `WritableStreamDefaultController`, `ReadableStreamDefaultController` & more

* Implement `Blob.stream()`

* Update streams.test.js

* Fix sourcemaps crash

* [TextEncoder] 3x faster in hot loops

* reading almost works

* start to implement native streams

* Implement `Blob.stream()`

* Implement `Bun.file(pathOrFd).stream()`

* Add an extra function

* [fs.readFile] Improve performance

* make jsc bindings a little easier to work with

* fix segfault

* faster async/await + readablestream optimizations

* WebKit updates

* More WebKit updates

* Add releaseWEakrefs binding

* `bun:jsc`

* More streams

* Update streams.test.js

* Update Makefile

* Update mimalloc

* Update WebKit

* Create bun-jsc.test.js

* Faster ReadableStream

* Fix off by one & exceptions

* Handle empty files/blobs

* Update streams.test.js

* Move streams to it's own file

* temp

* impl #1

* take two

* good enough for now

* Implement `readableStreamToArray`, `readableStreamToArrayBuffer`, `concatArrayBuffers`

* jsxOptimizationInlining

* Fix crash

* Add `jsxOptimizationInline` to Bun.Transpiler

* Update Transpiler types

* Update js_ast.zig

* Automatically choose production mode when NODE_ENV="production"

* Update cli.zig

* [jsx] Handle defaultProps when inlining

* Update transpiler.test.js

* uncomment some tests

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-06-07 22:32:46 -07:00
Jarred Sumner
958fc3d4f5 Update .gitignore 2022-05-30 03:50:35 -07:00
Jarred Sumner
aecc849692 Improve error messages when you mistype commands/files/scripts 2022-05-30 03:50:24 -07:00
Jarred Sumner
882559f0b9 Load bunfig.toml by default if bun or bun {file}\.[cjt]sx?
Fixes https://github.com/Jarred-Sumner/bun/issues/183
2022-05-30 03:50:24 -07:00
Alexander Kuznetsov
ca21c00f86 Remove generated files from git index (#182) 2022-05-30 01:13:12 -07:00
M Javad
960cb1a8d5 docs: fix typo in readme (#179) 2022-05-20 12:26:15 -07:00
Jarred Sumner
8a3a5c3b74 Update string_mutable.zig 2022-05-20 00:59:50 -07:00
Jarred Sumner
99d61877d6 [solid] more progress, no fragments, but still not right 2022-05-20 00:45:51 -07:00
Jarred Sumner
224cfa91fb [TSConfig] Propagate runtime from tsconfig.json 2022-05-19 21:10:11 -07:00
Jarred Sumner
1af67dbe15 woops 2022-05-19 19:44:19 -07:00
Jarred Sumner
55bfa6cd02 Update cache.zig 2022-05-19 19:27:25 -07:00
Jarred Sumner
1d0124093c [solid] Move the post-process JSX step 2022-05-19 19:27:23 -07:00
Jarred Sumner
70078f48c0 [bun de] Fix crash when printing source maps 2022-05-19 19:26:45 -07:00
Jarred Sumner
44d1b217ac move js_parser to src/ 2022-05-19 17:52:40 -07:00
Jarred Sumner
3672bb85eb [solid] wip make nested components work 2022-05-19 17:52:07 -07:00
Jarred Sumner
6f741e8c10 Symbols 2022-05-19 05:37:30 -07:00
Jarred Sumner
d4767ca763 [wip] Solid.js support for Bun! 2022-05-19 05:37:18 -07:00
Jarred Sumner
07e695da03 add a test 2022-05-16 23:05:21 -07:00
Jarred Sumner
4f72021007 Update README.md 2022-05-16 21:14:34 -07:00
Jarred Sumner
bc73d21917 Update types.d.ts 2022-05-16 20:54:01 -07:00
Jarred Sumner
7ca297a5cc Update download-northwind.sh 2022-05-16 19:51:30 -07:00
Jarred Sumner
e114fca5ee Still not correct! 2022-05-16 19:33:19 -07:00
Jarred Sumner
d0ca9f2499 Update README.md 2022-05-16 19:28:29 -07:00
Jarred Sumner
95daafee0f Update serve.test.ts 2022-05-16 19:26:57 -07:00
Jarred Sumner
37e4848c6f work around test failure 2022-05-16 19:25:49 -07:00
Jarred Sumner
78cd9e89f3 Update sqlite3.c 2022-05-16 19:15:10 -07:00
Jarred Sumner
15c40f5ea3 Fix build error on linux 2022-05-16 19:12:22 -07:00
Jarred Sumner
5f3256d939 Update Makefile 2022-05-16 19:06:01 -07:00
Jarred Sumner
a2b22c339e Update sqlite.d.ts 2022-05-16 19:03:30 -07:00
Jarred Sumner
aed5e39f4d remove bad examples 2022-05-16 19:02:38 -07:00
Jarred Sumner
bd1e64b9b1 Fix type errors 2022-05-16 18:58:11 -07:00
Jarred Sumner
31f3050356 Bump 2022-05-16 18:53:33 -07:00
Jarred Sumner
ba36f5db7e prepare for release 2022-05-16 18:45:46 -07:00
Jarred Sumner
a372a0dd6d Update JSSQLStatement.cpp 2022-05-16 18:24:55 -07:00
Jarred Sumner
aba032e176 Copy strings when binding to sqlite 2022-05-16 18:19:08 -07:00
Jarred Sumner
e31f44c3d1 Update README.md 2022-05-16 17:40:33 -07:00
Jarred Sumner
0d12a1f9ee reset on stmt on error 2022-05-16 17:18:50 -07:00
Jarred Sumner
036eb2a9ed Update README.md 2022-05-16 16:34:05 -07:00
Jarred Sumner
2eb889be89 Update README.md 2022-05-16 16:33:13 -07:00
Jarred Sumner
dd07717b80 Update README.md 2022-05-16 16:28:48 -07:00
Jarred Sumner
36a82cfb93 Update README.md 2022-05-16 16:26:32 -07:00
Jarred Sumner
6fce02bd85 Update sqlite.d.ts 2022-05-16 16:25:54 -07:00
Jarred Sumner
93767bf78f Update .gitattributes 2022-05-16 16:24:42 -07:00
Jarred Sumner
a779fc180f Update README.md 2022-05-16 16:07:59 -07:00
Jarred Sumner
223ce6b22d Update README.md 2022-05-16 16:00:30 -07:00
Jarred Sumner
5d4673742e Update README.md 2022-05-16 15:59:57 -07:00
Jarred Sumner
05eb1e5684 Update README.md 2022-05-16 15:57:45 -07:00
Jarred Sumner
b4ac7697ac Update README.md 2022-05-16 15:55:35 -07:00
Jarred Sumner
2cfc1d42a3 Update README.md 2022-05-16 15:52:05 -07:00
Jarred Sumner
be1f469ec5 Update README.md 2022-05-16 15:48:56 -07:00
Jarred Sumner
a37f86e89d bun:sqlite (#167)
* ✂️

* Add the slow version

* draw the rest of the owl

* Fix crash when allocating lots of memory

* [Bun.Transipiler] Support passing objects

* [JS Parser] Support passing objects to macros via Bun.Transpiler

* Update JSSQLStatement.cpp

* Embed SQLite

* Add SQLite to Dockerfile

* [sqlite] Add quick one-off queries without creating a whole object

* [sqlite] Add `columnsCount`, rename raw() to `values()`, remove `rebind`

* Implement `bun:sqlite`

* return null

* Fix updating query

* Update bun.d.ts

* more tests

* Support variadic arguments, write tests and add types

* Update sqlite.d.ts

* Update sqlite.d.ts

* latest

* Implement `Database.loadExtension` and `Database.setCustomSQLite`

* Support `require.resolve`

* [napi] Improve string performance

* [bun.js] Support some of `node:module`

* another test

* [sqlite] Support serialize & deserialize

* [`bun:ffi`] Implement `CFunction` and `linkSymbols`

* [bun.js] Fix crash in `Buffer.from`

* Update sqlite.test.js

* Document linkSymbols

* docs

* Update README.md
2022-05-16 15:46:20 -07:00
Divy Srivastava
2bd0dcfdfa Add go and esbuild to build instructions (#169) 2022-05-16 13:55:14 -07:00
Hugo Romano
e75535d14c wrangler 2 released (#166) 2022-05-12 14:43:44 -07:00
Jarred Sumner
1d6923bead Update README.md 2022-05-11 19:12:00 -07:00
Jarred Sumner
732124e3dd Update README.md 2022-05-11 19:11:17 -07:00
Jarred Sumner
a15e66cc7b Add section about napi 2022-05-11 19:08:46 -07:00
Jarred Sumner
3eacfe2314 Update README.md 2022-05-11 18:29:05 -07:00
Jarred Sumner
89c0d9dd56 Update build-id 2022-05-11 17:57:55 -07:00
Jarred Sumner
b21d0f0b22 Fix several bugs in napi
Closes https://github.com/Jarred-Sumner/bun/issues/163
Closes https://github.com/Jarred-Sumner/bun/issues/162
Closes https://github.com/Jarred-Sumner/bun/issues/161
2022-05-11 17:49:18 -07:00
Jarred Sumner
61b2821472 Make the napi mjs file runnable in both bun & node 2022-05-11 15:12:17 -07:00
Jarred Sumner
1f86e0c87e Update build-id 2022-05-11 04:47:34 -07:00
Jarred Sumner
d1ea51e9f2 disable the new target allowed error 2022-05-11 04:45:47 -07:00
Jarred Sumner
5de2e2c71e Update Makefile 2022-05-11 04:05:08 -07:00
Jarred Sumner
2c1051f539 Update Makefile 2022-05-11 03:46:00 -07:00
Jarred Sumner
247f4810c5 Fix export symbols on Linux 2022-05-11 03:45:00 -07:00
Jarred Sumner
47b6dc9eea Add test for import.meta.require 2022-05-11 03:19:29 -07:00
Jarred Sumner
aea3b4e280 [napi] Add a couple more symbols 2022-05-11 02:59:46 -07:00
Jarred Sumner
12e0496a79 [napi] Fix panic inside napi_fatal_error 2022-05-11 02:59:38 -07:00
Jarred Sumner
aa87d40f4b [napi] Stub a couple more 2022-05-11 02:59:22 -07:00
Jarred Sumner
7d1eced8c6 [bun.js] eagerly convert to import.meta.require 2022-05-11 02:57:51 -07:00
Jarred Sumner
123267685f [json] Fix bug with negative integers in json parser 2022-05-11 02:56:46 -07:00
Jarred Sumner
0bec7001ba [bun.js] Implement a polyfill for the detect-libc npm package 2022-05-11 00:57:06 -07:00
Jarred Sumner
3c87fbfd37 [bun.js] Implement import.meta.require
This allows synchronous dynamic loading of `.node`, `.json`, and `.toml` files.

It is not a CommonJS require, but it can be used that way so long as the content is not JavaScript.
2022-05-11 00:56:35 -07:00
Jarred Sumner
fd00950852 [bun.js] Implement import.meta.resolveSync 2022-05-11 00:54:42 -07:00
Jarred Sumner
eb2a6aee4d Include napi in plus100 2022-05-10 20:50:38 -07:00
Jarred Sumner
84e8d08ec6 Add test for Buffer.byteLength 2022-05-10 20:47:51 -07:00
Jarred Sumner
92e8eaf581 [napi] Error on import .node 2022-05-10 20:47:38 -07:00
Jarred Sumner
e8e58a511f Update napi.cpp 2022-05-10 20:44:25 -07:00
Jarred Sumner
08e40efe11 [napi] Fix string bug 2022-05-10 20:24:07 -07:00
Jarred Sumner
01a0aee1e8 [napi] transpile require(*.node) into process.dlopen 2022-05-10 19:12:15 -07:00
Jarred Sumner
8def37c14e [bun.js] Implement Buffer.byteLength 2022-05-10 19:09:28 -07:00
Jarred Sumner
b3760cd723 Fix extra quote in bundled require errors 2022-05-09 23:01:05 -07:00
Jarred Sumner
1cb870be16 few more napi functions 2022-05-09 22:39:22 -07:00
Jarred Sumner
35232fa422 Update Makefile 2022-05-09 22:07:47 -07:00
Jarred Sumner
77342a2268 Update Dockerfile.base 2022-05-09 22:01:56 -07:00
Jarred Sumner
b834e21192 [napi] getters & setters work 2022-05-09 21:58:41 -07:00
Jarred Sumner
f4188b3ddc Add test for __dirname 2022-05-09 21:54:08 -07:00
Jarred Sumner
963c08d472 Update symbols.txt 2022-05-09 21:54:00 -07:00
Jarred Sumner
29b9ced11a Update bindings.cpp 2022-05-09 21:53:44 -07:00
Jarred Sumner
8ac108ba06 [napi] Move some code to C++ for perf 2022-05-09 04:11:48 -07:00
Jarred Sumner
8014a0b8d8 [napi] Support import and require of .node modules 2022-05-09 00:24:25 -07:00
Jarred Sumner
3bd83eb134 [napi] Fix strings 2022-05-09 00:23:51 -07:00
Jarred Sumner
a5ebcefeeb fixup 2022-05-09 00:23:35 -07:00
Jarred Sumner
c806e778d6 [JS Parser] Support __dirname and __filename 2022-05-09 00:00:01 -07:00
Jarred Sumner
3850fc5b0b Make a lot more stuff work 2022-05-08 17:37:58 -07:00
Jarred Sumner
6bac11f066 Create change-array-by-copy.js 2022-05-08 17:37:36 -07:00
Jarred Sumner
bc2ca8afbd Update WebKit 2022-05-08 01:34:53 -07:00
Jarred Sumner
e403b6111f more napi 2022-05-08 01:32:20 -07:00
Jarred Sumner
d613ba5fcd Update serve.test.ts 2022-05-08 01:14:21 -07:00
Jarred Sumner
4dee9be3eb Update http-file.ts 2022-05-08 01:13:03 -07:00
Jarred Sumner
61afb8955c Update build-id 2022-05-08 01:12:56 -07:00
Jarred Sumner
61d548c7bf [bun.js] Fix bug with headers not being sent in fetch 2022-05-08 01:12:46 -07:00
Jarred Sumner
c1efeefb8a Ugprade webkit 2022-05-08 01:12:27 -07:00
Jarred Sumner
3b6c3d8196 Update wtf-bindings.cpp 2022-05-08 01:12:20 -07:00
Jarred Sumner
97cceb47b9 Upgrade WebKit 2022-05-08 01:12:13 -07:00
Jarred Sumner
94637711b9 Update zlib.test.js 2022-05-07 13:27:23 -07:00
Jarred Sumner
bdf28e42f6 [bun.js] Support gzipSync, gunzipSync, inflateSync, deflateSync 2022-05-07 01:38:26 -07:00
Jarred Sumner
1687455a3f [napi] Fix function arguments 2022-05-06 06:43:49 -07:00
Jarred Sumner
84e40a4f74 symbols list 2022-05-06 00:37:23 -07:00
Jarred Sumner
bce60a5a86 more napi 2022-05-06 00:05:31 -07:00
Jarred Sumner
a7b0bc8790 it can call functions 2022-05-05 21:35:08 -07:00
Jarred Sumner
30ca112260 napi_threadsafe_function 2022-05-05 21:35:08 -07:00
Jarred Sumner
b487eb7e13 Update napi.zig 2022-05-05 21:35:08 -07:00
Jarred Sumner
5d24f45ac1 Update napi.zig 2022-05-05 21:35:08 -07:00
Jarred Sumner
c1f65ef975 napi_get_dataview_info? 2022-05-05 21:35:08 -07:00
Jarred Sumner
d6ce585ef3 cleanup hook 2022-05-05 21:35:08 -07:00
Jarred Sumner
c80e048ab3 implement napi_async_work 2022-05-05 21:35:08 -07:00
Jarred Sumner
b6a8675658 typeof 2022-05-05 21:35:08 -07:00
Jarred Sumner
2c0c91e2d0 more 2022-05-05 21:35:08 -07:00
Jarred Sumner
6b97680224 Update napi.zig 2022-05-05 21:35:08 -07:00
Jarred Sumner
c76bebca0b more 2022-05-05 21:35:08 -07:00
Jarred Sumner
b534c4d661 More 2022-05-05 21:35:08 -07:00
Jarred Sumner
170d09b6bd More 2022-05-05 21:35:08 -07:00
Jarred Sumner
b4fc584d18 Even More NAPI 2022-05-05 21:35:08 -07:00
Jarred Sumner
5b2d9f8128 Begin napi 2022-05-05 21:35:08 -07:00
Jarred Sumner
d629cfafd6 E.String gets a Rope 2022-05-05 21:32:19 -07:00
Jarred Sumner
7b125c9731 Update README.md 2022-05-04 09:02:25 -07:00
Jarred Sumner
0e3df25526 specifically check utf8 2022-05-04 07:03:55 -07:00
Jarred Sumner
66e8d7346f make our http test run more 2022-05-04 07:03:46 -07:00
Jarred Sumner
d29dcf3680 Document FFIType.i64_fast 2022-05-04 07:03:38 -07:00
Jarred Sumner
164483c137 Update buffer.js 2022-05-04 07:03:22 -07:00
Jarred Sumner
6ab5ae8a7a Fix type errors 2022-05-04 00:33:42 -07:00
Jarred Sumner
5b760fe7c4 Safer i64/u64 2022-05-04 00:16:36 -07:00
Jarred Sumner
162e8911db Fix x64 build 2022-05-03 22:36:44 -07:00
Jarred Sumner
bea2cc9cbc Update Makefile 2022-05-03 21:36:22 -07:00
Jarred Sumner
ce2261dffa don't automatically run clang-format because it ignores the disable flag 2022-05-03 21:34:45 -07:00
Jarred Sumner
fa562fa56d Handle missing x64 symbols 2022-05-03 21:30:29 -07:00
Jarred Sumner
5bfd241167 Update tinycc 2022-05-03 20:49:57 -07:00
Jarred Sumner
5a85cc4386 [bun:ffi] fix panic in lib.close() 2022-05-03 20:19:33 -07:00
Jarred Sumner
ed4a021f85 Bump WebKit 2022-05-03 19:50:05 -07:00
Jarred Sumner
83c1d7c9ef Update add.rs 2022-05-03 08:03:06 -07:00
Jarred Sumner
de6aed65fb Forgot about base64 2022-05-03 04:42:17 -07:00
Jarred Sumner
57ce49654c wrong dir 2022-05-03 04:35:49 -07:00
Jarred Sumner
00bc2638ce Fix tinycc build on linux 2022-05-03 04:10:06 -07:00
Jarred Sumner
4605aff04a Fix webkit linux build 2022-05-03 04:09:23 -07:00
Jarred Sumner
d104c286c8 Update README.md 2022-05-03 03:41:43 -07:00
Jarred Sumner
16d5325874 Add tinycc dependency 2022-05-03 03:38:59 -07:00
Jarred Sumner
e3362a0fda clarify 2022-05-03 02:35:05 -07:00
Jarred Sumner
f0fdda5678 Update README.md 2022-05-03 02:28:26 -07:00
Jarred Sumner
bb2d67e361 Update README.md 2022-05-03 02:21:45 -07:00
Jarred Sumner
91e96a8da8 ffi overhead bench 2022-05-03 02:11:59 -07:00
Jarred Sumner
8b1924f6c2 Add docs for FFI 2022-05-03 01:25:46 -07:00
Jarred Sumner
c6d732eee2 [bun:ffi] Improve uint64_t and int64_t performance 2022-05-02 20:26:18 -07:00
Jarred Sumner
21ab47d9fe [bun:ffi] Support i64 and u64 2022-05-02 06:26:03 -07:00
Jarred Sumner
d70e92e79f [bun:ffi] Support double and float 2022-05-02 04:37:24 -07:00
Jarred Sumner
15466865e0 add a comment 2022-05-02 03:46:57 -07:00
Jarred Sumner
125a4c747b [bun:ffi] cleanup 2022-05-02 03:40:14 -07:00
Jarred Sumner
69668d49e5 [bun.js] Add Bun.nanoseconds() to report time in nanos 2022-05-02 03:36:26 -07:00
Jarred Sumner
5cee316d8c [bun:ffi] ~20% faster FFI bindings for functions with arguments 2022-05-02 03:23:42 -07:00
Jarred Sumner
98393ca849 Automatic CString support 2022-05-02 03:11:43 -07:00
Jarred Sumner
012564d738 [bun:ffi] Add wrapper for type coercion 2022-05-01 07:41:51 -07:00
Jarred Sumner
3403621fc2 wip Buffer.fill 2022-05-01 07:41:26 -07:00
Jarred Sumner
de23f2f8aa Buffer.compare & Buffer.equal 2022-05-01 04:36:17 -07:00
Jarred Sumner
b6aa988716 [bun.js] Improve Buffer creation perf a little 2022-05-01 03:43:52 -07:00
Jarred Sumner
a3b48b3229 [bun.js] Implement Buffer.concat 2022-05-01 02:22:13 -07:00
Jarred Sumner
d7ef268e18 Bump WebKit 2022-04-30 23:58:56 -07:00
Jarred Sumner
ba999c9ac3 cleanup 2022-04-30 23:58:46 -07:00
Jarred Sumner
92b27b338d [bun.js] Implement Buffer.from and Buffer.copy 2022-04-30 23:58:27 -07:00
Jarred Sumner
eb129d9f90 [bun ffi] Fix missing "void" 2022-04-30 23:56:41 -07:00
Jarred Sumner
5e270f9d77 [bun ffi] Remove dependency on libtcc1.a and improve error messages 2022-04-30 23:56:31 -07:00
Jarred Sumner
7e13d6cbfe wip 2022-04-30 08:35:48 -07:00
Jarred Sumner
7e6fe52c46 Update ffi-test.c 2022-04-30 05:57:25 -07:00
Jarred Sumner
893d245dca a 2022-04-30 05:56:46 -07:00
Jarred Sumner
516b54578d [bun:ffi] it works 2022-04-29 23:21:14 -07:00
Jarred Sumner
d49ba50289 [bun.js] Implement unsafe.{arrayBufferToPtr, arrayBufferFromPtr, bufferFromPtr} 2022-04-29 07:49:48 -07:00
Jarred Sumner
22f74756b4 [bun ffi] Support pointers 2022-04-29 06:08:36 -07:00
Jarred Sumner
f07463bdfd [bun ffi] support i32, i8, u8, u16, i16, u32, bool 2022-04-29 05:02:01 -07:00
Jarred Sumner
75374fdc32 more tests for buffer 2022-04-29 00:47:26 -07:00
Jarred Sumner
0332d47424 add more to buffer implementation 2022-04-29 00:47:26 -07:00
Jarred Sumner
d531d0851f ffi test code 2022-04-29 00:47:26 -07:00
Jarred Sumner
e26f96b748 wip 2022-04-29 00:47:26 -07:00
Jarred Sumner
8fa1c5ebf1 commit more 2022-04-29 00:47:26 -07:00
Jarred Sumner
ef18443b6e some tests but need more 2022-04-29 00:47:26 -07:00
Jarred Sumner
d066c7de30 Add JIT FFI 2022-04-29 00:47:26 -07:00
Jarred Sumner
fd56d0f116 more work on buffer 2022-04-28 06:56:28 -07:00
Jarred Sumner
77fbfb3fbb Most of Buffer.toString 2022-04-26 01:12:28 -07:00
Jarred Sumner
6590d1f8bf 2x - 10x faster TextEncoder & TextDecoder 2022-04-25 19:58:57 -07:00
Jarred Sumner
2d39e44520 Update .gitignore 2022-04-25 16:47:33 -07:00
Jarred Sumner
2c6e5c3fc4 some of buffer 2022-04-25 07:09:18 -07:00
Jarred Sumner
4b4df5095e Update Makefile 2022-04-23 04:12:39 -07:00
Jarred Sumner
1c11dc6630 Update Dockerfile.base 2022-04-23 03:33:21 -07:00
Jarred Sumner
2eb3319351 Bump build 2022-04-23 03:15:35 -07:00
Jarred Sumner
683b171c3f 📷 2022-04-23 03:15:27 -07:00
Jarred Sumner
ea241fcec7 [JS Parser] Fix overly-eager CJS -> ESM transform 2022-04-23 03:15:13 -07:00
Lawrence Chen
ab1d83fe8d Add bun run ${script-name} clarification (#151) 2022-04-21 00:55:15 -07:00
Jarred Sumner
5e739acfbb [misc] Fix broken build on macOS 2022-04-20 23:46:11 -07:00
Jarred Sumner
a4b8fccfa7 [misc] explain why wasm isn't released yet 2022-04-18 21:56:20 -07:00
Jarred Sumner
9822ea96b8 [misc] Recommend VSCode extensions 2022-04-18 21:44:31 -07:00
Jarred Sumner
94db83040e [misc] Set editor.formatOnSave 2022-04-18 21:44:31 -07:00
wangao
12f97f1364 [node] Remove constants definition in (#146)
... fs.exports.js

Bug: #130
2022-04-18 21:26:06 -07:00
wangao
0aacddb971 [timer] Remove timer.zig and use system_timer.zig (#149) 2022-04-18 21:25:53 -07:00
wangao
7e866bb441 [build] Fix Dockerfile COPY slash (#147) 2022-04-18 21:19:03 -07:00
Jarred Sumner
c2cf1d6493 not sure yet 2022-04-18 21:18:37 -07:00
Jarred Sumner
612fad706f fix wasm build take 2 (one more thing is broken) 2022-04-18 20:51:10 -07:00
Jarred Sumner
6728551dc4 Fix wasm build 2022-04-18 17:41:58 -07:00
wangao
64a2dda02f [node] Add more fs constants (#144)
Move fs constants to node_fs_constants.zig,
and we static append the constants definition
to fs.export.js.

Issue: #130
2022-04-18 06:14:21 -07:00
Jarred Sumner
8d28e72e8a Move some code around + delete dead code 2022-04-16 17:33:16 -07:00
Jarred Sumner
0137e5cf94 [JS Parser] Support explicit removing 2022-04-16 09:29:10 -07:00
Jarred Sumner
89ca887ea0 Workaround C ABI bug 2022-04-16 05:32:57 -07:00
Jarred Sumner
42414d5667 [JS Parser] API for removing & replacing exports 2022-04-16 04:36:00 -07:00
Jarred Sumner
8bb283e616 Update README.md 2022-04-15 16:54:58 -07:00
Jarred Sumner
32e2345e53 Document how tests work 2022-04-15 16:50:38 -07:00
Jarred Sumner
9e31602a20 Update css_scanner.zig 2022-04-14 00:39:55 -07:00
Jarred Sumner
5d0be616b7 add some more assertions 2022-04-13 21:58:28 -07:00
Jarred Sumner
e7251c0d55 [css] Fix crash on empty files in some cases 2022-04-13 21:55:42 -07:00
Jarred Sumner
1871bbc6a4 Add sha hashing example 2022-04-13 21:46:02 -07:00
Jarred Sumner
add1c91425 Warn about moduleSuffixes 2022-04-13 21:46:02 -07:00
Jarred Sumner
1788503892 [bun dev] Fix CSS HMR bug 2022-04-13 21:46:02 -07:00
evan
95aa76b9fa expose mmap size and offset option (#141)
* expose mmap size and offset option

* fix panics
2022-04-13 19:08:56 -07:00
Jarred Sumner
95101870e4 better to fix it there 2022-04-13 18:53:53 -07:00
Jarred Sumner
f2c21b7733 [bun.js] Fix bug with readdirSync on folders with less than 32 files
Closes https://github.com/Jarred-Sumner/bun/issues/143
2022-04-13 18:48:09 -07:00
Jarred Sumner
d273948f16 Update bun.d.ts 2022-04-13 05:07:33 -07:00
Jarred Sumner
bb79687f8e Even More Comments 2022-04-13 04:44:05 -07:00
Jarred Sumner
3db3057d42 Support digest("base64" | "hex") in the hashings 2022-04-13 04:20:05 -07:00
Jarred Sumner
f6d73cb06e [bun.js] Implement Bun.sha1, Bun.sha256, Bun.sha384, Bun.sha512, Bun.sha512_384 2022-04-12 22:59:52 -07:00
evan
b3522b2feb add depth limit to .gitmodules (#142)
fixes situations where git client automatically downloads all submodules without depth limit
2022-04-12 18:30:03 -07:00
Jarred Sumner
710edd34d2 maybe this fixes it? 2022-04-12 04:53:47 -07:00
Jarred Sumner
743ad44c0a Make sendfile more reliable 2022-04-12 03:46:21 -07:00
Jarred Sumner
9db701ab41 wip fixes to sendfile() blocking 2022-04-12 00:43:23 -07:00
Jarred Sumner
a0f9a6ed60 Add a very simple http server test 2022-04-11 19:10:06 -07:00
Jarred Sumner
1d79703d24 slight perf improvement to concurrently queueing tasks 2022-04-11 19:09:14 -07:00
Jarred Sumner
f357377de9 always tick the event loop 2022-04-11 19:08:51 -07:00
Jarred Sumner
87adeb61c5 isize is a little faster normally 2022-04-11 19:05:09 -07:00
Jarred Sumner
e6a5cab1d2 Fix readme link 2022-04-11 16:53:30 -07:00
Jarred Sumner
9884a5fe14 Update http-stop.ts 2022-04-11 05:59:39 -07:00
Jarred Sumner
55ff561429 Add example for stopping HTTP server 2022-04-11 05:20:44 -07:00
Jarred Sumner
4708dd26ca work around fetch("localhost") bug 2022-04-11 05:17:02 -07:00
Jarred Sumner
3e969244ac [bun.js] Add a Server.stop function 2022-04-11 04:58:29 -07:00
Jarred Sumner
ac3835227e Update comptime_string_map.zig 2022-04-11 01:44:25 -07:00
Jarred Sumner
c6393bcd27 ✂️ dead code 2022-04-11 01:44:22 -07:00
Jarred Sumner
7d164ad8c7 Update globals.d.ts 2022-04-10 19:48:44 -07:00
Jarred Sumner
3abb72037b [bun-types] Document JavaScriptCore's ES Module loader 2022-04-10 19:46:05 -07:00
Jarred Sumner
34c478a4c4 make checking for bun modules a compile time step 2022-04-10 19:45:43 -07:00
Jarred Sumner
98592fb85d [TOML] Fix toml parsing with multiple keys in object literal
Fixes https://github.com/Jarred-Sumner/bun/issues/140
2022-04-10 17:41:48 -07:00
Jarred Sumner
6edf0289ed Fix type errors 2022-04-10 05:23:02 -07:00
Jarred Sumner
faedbf0a61 Update bun.d.ts 2022-04-10 05:16:06 -07:00
Jarred Sumner
b08d3b2cd6 Update linker.zig 2022-04-10 05:02:14 -07:00
Jarred Sumner
1e810d229e Fix tests 2022-04-10 04:57:51 -07:00
Jarred Sumner
a82c486878 fix linux build 2022-04-10 04:35:40 -07:00
Jarred Sumner
d42ae4824b Update Makefile 2022-04-10 04:34:06 -07:00
Jarred Sumner
b1ebe54456 [bun.js] Support a "bun" import 2022-04-10 04:30:31 -07:00
Jarred Sumner
ac76e3b004 Move some types around 2022-04-10 04:30:09 -07:00
Jarred Sumner
43b18663fd [bun] fix bun bun --platform=bun 2022-04-10 04:24:53 -07:00
Jarred Sumner
45e1fc946d [bun-types] Make it bundle the types 2022-04-10 04:24:24 -07:00
Jarred Sumner
65eb232028 Bump 2022-04-09 22:18:32 -07:00
Jarred Sumner
7cd3d13011 [fs] Add missing isFile and isDirectory functions to stat() 2022-04-09 21:45:46 -07:00
Jarred Sumner
764fb63617 Update transpiler.test.js 2022-04-09 20:26:02 -07:00
Jarred Sumner
4de7978b27 [JS Parser] Fix code simplification bug with ! and unary expressions 2022-04-09 20:23:36 -07:00
Jarred Sumner
696bb3b026 stricter boolean check 2022-04-09 20:06:58 -07:00
Jarred Sumner
fb82e2bf86 Update build-id 2022-04-08 23:47:10 -07:00
Jarred Sumner
403a916bd5 [bun-framework-next] Fix missing scripts 2022-04-08 23:43:41 -07:00
Jarred Sumner
20cdb197e2 Fix Next.js stylesheet bug 2022-04-08 23:16:13 -07:00
Jarred Sumner
1f68b8ada0 remove some code bloat 2022-04-08 16:55:58 -07:00
Jarred Sumner
fdfbf16940 Update watcher.zig 2022-04-08 16:54:20 -07:00
Jarred Sumner
12c2659765 [bun dev] Fix race condition in file watcher 2022-04-08 16:45:24 -07:00
Jarred Sumner
8561dcdee4 Immediately inject fast refresh once 2022-04-08 16:44:08 -07:00
Jarred Sumner
ded2bcfda5 Update README.md 2022-04-08 06:32:34 -07:00
Jarred Sumner
d5173f71d4 Update README.md 2022-04-08 06:32:29 -07:00
Jarred Sumner
61ca99cfd9 Update README.md 2022-04-08 06:32:24 -07:00
Jarred Sumner
862155fa5e I think fix hmr regression? 2022-04-08 06:32:12 -07:00
Jarred Sumner
74309a1f9e Fix hardlink fallback 2022-04-08 06:32:03 -07:00
Jarred Sumner
8cdb55d94f partial fix for the sendfile() bug 2022-04-08 06:31:14 -07:00
Jarred Sumner
489299cdcc Update README.md 2022-04-08 04:36:51 -07:00
Jarred Sumner
b744634141 Update README.md 2022-04-08 04:35:20 -07:00
Jarred Sumner
a8789fc858 Update README.md 2022-04-08 04:25:52 -07:00
Jarred Sumner
14def643f7 Outdated 2022-04-07 22:39:46 -07:00
Jarred Sumner
a3398650b5 Update README.md 2022-04-07 22:14:15 -07:00
Jarred Sumner
65daaf332d Update README.md 2022-04-07 22:09:17 -07:00
Jarred Sumner
63995da2c2 example 2022-04-07 22:07:24 -07:00
Jarred Sumner
f3b118d0ad Update README.md 2022-04-07 21:48:00 -07:00
Jarred Sumner
f01a2a3360 Fix some mime types to match expectations 2022-04-07 21:47:27 -07:00
Jarred Sumner
a0566f0fbe Update README.md 2022-04-07 21:44:40 -07:00
Jarred Sumner
4b8425938a Update README.md 2022-04-07 21:37:44 -07:00
Jarred Sumner
8fa3536aba Update README.md 2022-04-07 21:34:02 -07:00
Jarred Sumner
10712a790a Update README.md 2022-04-07 21:18:26 -07:00
Jarred Sumner
9cd148de7d Update README.md 2022-04-07 20:35:05 -07:00
Jarred Sumner
9b1d4e1a45 Update README.md 2022-04-07 20:34:35 -07:00
Jarred Sumner
b089f1adae Update README.md 2022-04-07 20:32:44 -07:00
Jarred Sumner
76d54c572a Update README.md 2022-04-07 20:25:57 -07:00
Jarred Sumner
7d25dae75e Update package.json 2022-04-07 20:24:05 -07:00
Jarred Sumner
282eaef435 Update README.md 2022-04-07 20:24:02 -07:00
Jarred Sumner
80dcd30b48 Update README.md 2022-04-07 20:04:35 -07:00
Jarred Sumner
76e04ad82b Update README.md 2022-04-07 20:04:20 -07:00
Jarred Sumner
afa0d4f3a3 Update README.md 2022-04-07 20:00:51 -07:00
Jarred Sumner
e21a65fd05 Update README.md 2022-04-07 19:31:59 -07:00
Jarred Sumner
295249cf08 📷 2022-04-07 19:29:18 -07:00
Jarred Sumner
91fb170c4a Update html-rewriter.ts 2022-04-07 19:29:01 -07:00
Jarred Sumner
0878659513 Update runtime.version 2022-04-07 06:27:50 -07:00
Jarred Sumner
69cebbfca2 Update http-file.ts 2022-04-07 06:26:28 -07:00
Jarred Sumner
3c4510573e Update build-id 2022-04-07 06:26:15 -07:00
Jarred Sumner
4285d8ec0b Update ZigGlobalObject.cpp 2022-04-07 06:25:58 -07:00
Jarred Sumner
c2a8c10834 Update mimalloc 2022-04-07 06:22:51 -07:00
Jarred Sumner
4e05fd0541 [bun.js] Add baseURI support to HTTP server 2022-04-07 06:22:42 -07:00
Jarred Sumner
b97e81b27f More types 2022-04-07 06:08:48 -07:00
Jarred Sumner
e08cc968cb add GC output constraints
I don't fully understand what this does

but it sounds good!
2022-04-07 01:57:45 -07:00
Jarred Sumner
9bee40813f Update Makefile 2022-04-06 23:38:41 -07:00
Jarred Sumner
5ac6920591 7 hrs 2022-04-06 23:38:37 -07:00
Jarred Sumner
70b1beb18b Update hmr.ts 2022-04-06 23:38:32 -07:00
Jarred Sumner
964aa40612 Update runtime.zig 2022-04-06 23:36:30 -07:00
Jarred Sumner
7e58c7e89a Make Bun.activate run earlier so we catch errors sooner 2022-04-06 23:36:26 -07:00
Jarred Sumner
3db549fdb5 Update build-id 2022-04-06 06:17:24 -07:00
Jarred Sumner
87401392ba Update client.development.tsx 2022-04-06 06:15:21 -07:00
Jarred Sumner
795c172d9e Support newer next 2022-04-06 06:15:18 -07:00
Jarred Sumner
cfe60996c2 [bun.js] Support React Refresh 0.12.0 2022-04-06 06:14:49 -07:00
Jarred Sumner
da3f131185 Update javascript.zig 2022-04-06 06:14:36 -07:00
Jarred Sumner
ac06ce2160 [bun.js][breaking] import.meta.url is now a file:// url 2022-04-06 06:14:29 -07:00
Jarred Sumner
69653729f0 tweak examples 2022-04-06 06:14:04 -07:00
Jarred SUmner
81eb47de0e [bun.js] Add stdout, stderr, stdin to Bun and support sendfile() + splice() 2022-04-06 01:53:05 -07:00
Jarred Sumner
57cf035a73 Fix ssl example 2022-04-05 19:32:52 -07:00
Jarred Sumner
ddaab5a836 fix example 2022-04-05 19:15:58 -07:00
Jarred Sumner
f97e6d04a7 wip 2022-04-05 06:51:45 -07:00
Jarred Sumner
daeede28db [bun dev] Fix segfaults 2022-04-05 06:38:36 -07:00
Jarred Sumner
70f9294e15 [bun:error] Fix exception 2022-04-05 06:36:19 -07:00
Jarred Sumner
2c0e8e0a99 Add update message 2022-04-05 03:51:24 -07:00
Jarred Sumner
7f4b1a5797 cmake does not like emit-llvm 2022-04-05 03:39:52 -07:00
Jarred Sumner
138ee2803d Update Makefile 2022-04-05 03:37:38 -07:00
Jarred Sumner
c9fee3bd04 tweak some flags 2022-04-05 03:35:59 -07:00
Jarred Sumner
db5951337e Fix stat() on x64 2022-04-05 01:52:48 -07:00
Jarred Sumner
d652e87473 fix binary size regression on linux 2022-04-05 00:40:49 -07:00
Zakiego
57eac42a91 docs: fix wrong #bun-create reference in readme (#136) 2022-04-05 00:24:14 -07:00
Jarred Sumner
d61f877a94 Update response.zig 2022-04-05 00:20:43 -07:00
Jarred Sumner
7eb575d7f8 Update response.zig 2022-04-05 00:19:54 -07:00
Jarred Sumner
8e5eda79de Update Makefile 2022-04-05 00:18:58 -07:00
Jarred Sumner
82051a5f22 Update http-file.ts 2022-04-05 00:17:57 -07:00
Jarred SUmner
17b9167e52 Fix linking bug? 2022-04-05 00:01:54 -07:00
Jarred SUmner
30542225c6 fix bug with io sometimes sleeping permanetly 2022-04-04 23:25:54 -07:00
Jarred Sumner
759b6c18fd Update Makefile 2022-04-04 08:45:49 -07:00
Jarred Sumner
0e1941ce21 ughh 2022-04-04 08:44:44 -07:00
Jarred Sumner
039fb0732c Update syscall.zig 2022-04-04 08:31:02 -07:00
Jarred Sumner
6c91aa6e51 Update syscall.zig 2022-04-04 08:22:51 -07:00
Jarred Sumner
2eed081b50 hm 2022-04-04 08:14:52 -07:00
Jarred Sumner
7551041fa1 Update Dockerfile.base 2022-04-04 07:57:58 -07:00
Jarred Sumner
41a97c5bf9 fixup 2022-04-04 07:39:39 -07:00
Jarred Sumner
20ed1c32d3 Update Makefile 2022-04-04 07:33:38 -07:00
Jarred Sumner
969cf9fd48 Update Makefile 2022-04-04 07:28:49 -07:00
Jarred Sumner
d29930db3a Update Makefile 2022-04-04 07:24:20 -07:00
Jarred Sumner
015333de8c Update Makefile 2022-04-04 07:22:29 -07:00
Jarred Sumner
89b9d167d1 Update Makefile 2022-04-04 07:17:40 -07:00
Jarred Sumner
2693a3beff Remove unused function 2022-04-04 07:15:03 -07:00
Jarred Sumner
feb315cf9c Update Dockerfile 2022-04-04 07:10:39 -07:00
Jarred Sumner
779e5ccc16 Add zlib for uws 2022-04-04 07:07:39 -07:00
Jarred Sumner
7b19de97d4 Update Dockerfile 2022-04-04 07:05:33 -07:00
Jarred Sumner
5d71d0a0b4 Update Makefile 2022-04-04 07:02:43 -07:00
Jarred Sumner
42b47fe4d9 Update Dockerfile 2022-04-04 07:01:26 -07:00
Jarred Sumner
5a9e381d84 Fix missing 2022-04-04 06:59:34 -07:00
Jarred Sumner
f4e118e40a Update response.zig 2022-04-04 06:54:10 -07:00
Jarred Sumner
071d4c155b Update Dockerfile 2022-04-04 06:51:53 -07:00
Jarred Sumner
044f23739c Update tsconfig.json 2022-04-04 06:38:12 -07:00
Jarred Sumner
05a4991a5f Update launch.json 2022-04-04 06:38:09 -07:00
Jarred Sumner
078ceb7168 Update http-file.ts 2022-04-04 06:37:46 -07:00
Jarred Sumner
9554dd1c33 fix https 2022-04-04 06:37:39 -07:00
Jarred Sumner
7fd12ca3ae Update bun.d.ts 2022-04-04 06:29:46 -07:00
Jarred Sumner
e84494b0e0 Fix error in bun:error 2022-04-04 06:22:48 -07:00
Jarred Sumner
afc7da33c9 Add a couple more tests 2022-04-04 01:07:38 -07:00
Jarred Sumner
d820a9890f Make Bun.file() -> HTMLRewriter -> HTTP response work 2022-04-04 01:04:14 -07:00
Jarred Sumner
a9f0d334bb [bun] Don't allow Transfer-Encoding header 2022-04-04 00:58:26 -07:00
Jarred Sumner
cee3783e58 [bun.js] Improve error message for HTTP server 2022-04-04 00:58:12 -07:00
Jarred Sumner
fceb88005d [bun.js] Support truncating file length up to u52 2022-04-04 00:34:57 -07:00
Jarred Sumner
e3c888a7cc Add HTMLRewriter proxy example 2022-04-03 22:24:59 -07:00
Jarred Sumner
25267397f6 pico headers are now mutable 2022-04-03 22:24:09 -07:00
Jarred Sumner
931e461c87 deref after null 2022-04-03 22:24:02 -07:00
Jarred Sumner
409758dd11 [bun.js] If no Content-Type is available and the content is all ascii text, assume it is text/plain 2022-04-03 22:23:22 -07:00
Jarred Sumner
cd28c3ca83 Omit the Content-Encoding header when it was auto decompressed 2022-04-03 22:22:22 -07:00
Jarred Sumner
25533b9e08 Don't track gzip timing unless verbose mode 2022-04-03 22:21:34 -07:00
Jarred Sumner
be70e08671 [bun error] Handle error messages with missing name/message better 2022-04-03 21:28:45 -07:00
Jarred Sumner
480d4b98c7 Update server.zig 2022-04-03 21:26:07 -07:00
Jarred Sumner
3b7e421eaf Support HTMLRewriter in http server 2022-04-03 21:25:16 -07:00
Jarred Sumner
b069ff253e Handle when unable to use sendfile() with Bun.file 2022-04-03 21:23:10 -07:00
Jarred Sumner
abc15f4d30 Add ShadowRealm and Bun.hash 2022-04-03 17:40:24 -07:00
Jarred Sumner
70bb8bda23 Fix the types 2022-04-03 17:24:26 -07:00
Jarred Sumner
665acdb170 Update runtime.version 2022-04-03 16:35:12 -07:00
Jarred Sumner
27ad502119 cleanup a few things 2022-04-03 16:35:09 -07:00
Jarred Sumner
e8b2af1eae doesn't fix the bug but helps a little 2022-04-03 16:34:38 -07:00
Jarred Sumner
4d718931be More types 2022-04-02 21:56:21 -07:00
Jarred Sumner
290166adb0 Add more typings 2022-04-02 18:54:31 -07:00
Jarred Sumner
c2ed8d0240 Add more tests for Node FS 2022-04-02 05:14:13 -07:00
Jarred Sumner
51e5d3ea70 [bun.js] fs.readSync & fs.writeSync should return just the number 2022-04-02 05:13:42 -07:00
Jarred Sumner
c73fcb0731 [bun.js] Support mode and flags as integer args in fs.openSync (instead of only object) 2022-04-02 05:12:43 -07:00
Jarred Sumner
e6b70c3e01 Update base.zig 2022-04-02 05:12:01 -07:00
Jarred Sumner
614f64ba82 Fix GC bug when reading TypedArray from user input 2022-04-02 05:11:57 -07:00
Jarred Sumner
b8263d0975 s/Buffer/TypedArray 2022-04-02 05:11:16 -07:00
Jarred Sumner
95d68b26a6 Fix mmap on macOS x64 2022-04-02 02:17:22 -07:00
Jarred Sumner
db39c8e109 Create gc.js 2022-04-02 00:49:27 -07:00
Jarred Sumner
449c248f08 Fix test failures 2022-04-02 00:29:48 -07:00
Jarred Sumner
66c5a941b3 More aggressive GC 2022-04-02 00:29:26 -07:00
Jarred Sumner
4592b1ccb5 [bun.js] Bring back file resolution 2022-04-01 23:39:05 -07:00
Jarred Sumner
9bfd1801aa [bun.js] slightly more careful write() 2022-04-01 23:38:35 -07:00
Jarred Sumner
b099e7232f Decrement task counter 2022-04-01 23:36:48 -07:00
Jarred Sumner
c657c7b846 Add helper for checking if value is an exception 2022-04-01 23:36:14 -07:00
Jarred Sumner
eaf09310cd deinit 2022-04-01 23:35:57 -07:00
Jarred Sumner
fffb69ce61 [bun.js] Fix double free in Blob 2022-04-01 22:54:22 -07:00
Jarred Sumner
5c989c957a Add abstraction for protecting values we're iterating on 2022-04-01 19:54:02 -07:00
Jarred Sumner
8af0764b3b Update response.zig 2022-04-01 19:53:41 -07:00
Jarred Sumner
c7727b136b [bun.js] Fix use-after-free in Bun.write 2022-04-01 19:53:37 -07:00
Jarred Sumner
7a6b6639bc Test written length 2022-04-01 19:53:17 -07:00
Jarred Sumner
08bf4694ca http file example 2022-04-01 19:53:02 -07:00
Jarred Sumner
60cc51379d Fix sendfile() after changes to blob 2022-04-01 19:52:53 -07:00
Jarred Sumner
e035084e49 Fix mimetype value 2022-04-01 19:50:38 -07:00
Jarred Sumner
bed878f290 Make FetchHeaders work 2022-04-01 17:08:15 -07:00
Jarred Sumner
0066d162cb [bun.js] Expose ErrorEvent 2022-04-01 04:04:14 -07:00
Jarred Sumner
e0011fd6ba [bun.js] Use Headers from WebKit instead of custom 2022-04-01 01:17:36 -07:00
Jarred Sumner
8e0ee052eb Update WebKit 2022-03-31 05:20:30 -07:00
Jarred Sumner
3207ae5570 Delete unused 2022-03-31 05:10:05 -07:00
Jarred Sumner
996c1468fa Allow a little leeway when HMR 2022-03-31 05:08:40 -07:00
Jarred Sumner
fe973a5ab0 Fix more infinite loops 2022-03-31 05:08:21 -07:00
Jarred Sumner
4f13208547 Bugfixes to how we build WebCore code 2022-03-31 05:07:18 -07:00
Jarred Sumner
5fa5df02f5 [bun dev] Re-create the shared buffer for each websocket 2022-03-31 04:57:03 -07:00
Jarred Sumner
89cd35f07f [bun dev] Improve HMR reliability when filesystem is slow or reading large files 2022-03-31 04:55:47 -07:00
Jarred Sumner
7b2ab994e5 Fix possible infinite loops 2022-03-31 04:29:40 -07:00
Jarred Sumner
1f77f2102e Update bindings.cpp 2022-03-30 20:50:19 -07:00
Jarred Sumner
ab7183217a [bun.js] Support file:// URLs in node fs 2022-03-30 20:50:12 -07:00
Jarred Sumner
47a9a452d8 Bump target next version to 12.1.3 2022-03-30 18:58:07 -07:00
Jarred Sumner
b3fa316c5e Add test for Bun.hash that runs it with a Uint8Array 2022-03-30 18:57:34 -07:00
Jarred Sumner
b09a22aaf5 Add bun.hash example 2022-03-30 18:57:08 -07:00
Jarred Sumner
ba3a7c2bcf don't append null bytes 2022-03-30 18:56:30 -07:00
Jarred Sumner
7539e5b72c remove empty files 2022-03-30 18:56:18 -07:00
Jarred Sumner
4dedb51a23 [bun.js] Fix import.meta.resolve when the path points to a bundled file 2022-03-30 18:56:07 -07:00
Jarred Sumner
3e8d669398 [Bun.js] fixup Bun.hash 2022-03-30 18:55:49 -07:00
Jarred Sumner
c4c94731e1 [bun-framework-next] Support Next 12.1.3 & React 18 2022-03-30 18:54:52 -07:00
Jarred Sumner
e2f5a742ca [bun-framework-next] Remove unnecessary polyfills 2022-03-30 18:54:24 -07:00
Jarred Sumner
c5538cfe10 Don't need to import react here 2022-03-30 15:46:12 -07:00
Jarred Sumner
d96dcfc398 Delete url.zig 2022-03-28 20:43:58 -07:00
Jarred Sumner
88ea61cfca [bun.js] Add Bun.hash 2022-03-28 20:43:53 -07:00
Jarred Sumner
2e4b5f3037 CustomEvent 2022-03-28 07:19:34 -07:00
Jarred Sumner
e577e753a5 ScriptExecutionContext 2022-03-28 06:35:28 -07:00
Jarred Sumner
04b5e87f42 [bun.js] Add Event, EventTarget, AbortController, AbortSignal
`AbortController` is not yet aware of `fetch`
2022-03-28 06:35:14 -07:00
Jarred Sumner
7a97f62c72 Safer error handling 2022-03-27 23:48:22 -07:00
Jarred Sumner
8bbcb5006e [Bun.js] Add DOMException 2022-03-27 23:44:21 -07:00
Jarred Sumner
4f4c446bc4 No to FormData for now 2022-03-27 23:44:10 -07:00
Jarred Sumner
b5bf409384 Update WebKit 2022-03-27 22:38:08 -07:00
Jarred Sumner
3fb96b9039 Update base.zig 2022-03-27 22:38:06 -07:00
Jarred Sumner
e3866b77fe Update .clang-format 2022-03-27 22:38:01 -07:00
Jarred Sumner
c321ddfa9b Update Makefile 2022-03-27 22:37:59 -07:00
Jarred Sumner
ed4f4ae4e2 Begin adding WebCore classes to bun 2022-03-27 22:37:55 -07:00
Jarred Sumner
4bf5dc1df9 Add Bun.mmap example 2022-03-27 16:21:59 -07:00
Jarred Sumner
b6a3a655ae Create tsconfig.json 2022-03-27 02:45:30 -07:00
Jarred Sumner
4df62a67e7 Create url.test.ts 2022-03-27 02:45:30 -07:00
Jarred Sumner
3cfafb6dc4 Update segfault.js 2022-03-27 02:45:30 -07:00
Jarred Sumner
0651f195dd Fix broken debugger in C++ code 2022-03-27 02:45:30 -07:00
Jarred Sumner
309350e74c [bun.js] begin the webkit-ing 2022-03-27 02:45:30 -07:00
evan
0132b7164e Bun.mmap() (#134)
* Bun.mmap()

* nitpicks
2022-03-27 02:38:39 -07:00
Jarred Sumner
2fc881540b Add a function for moving slices from a type 2022-03-26 20:35:56 -07:00
Jarred Sumner
29a759a655 improve performance of accessing Bun.Transpiler and Bun.unsafe 2022-03-26 20:35:37 -07:00
Jarred Sumner
b54a51adb9 fix instanceof checks for classes 2022-03-26 15:12:10 -07:00
Jarred Sumner
0b222c2bb0 Update syscall.zig 2022-03-26 15:11:15 -07:00
Jarred Sumner
c49d46b6af clarify 2022-03-26 14:14:10 -07:00
Jarred Sumner
ceefcfcbb7 Update uws 2022-03-26 14:05:58 -07:00
Jarred Sumner
75138577cd Create htttp.ts 2022-03-26 03:49:44 -07:00
Jarred Sumner
889ce65974 Fix the entry point for Bun.serve 2022-03-26 03:40:54 -07:00
Jarred Sumner
42bda98db7 slightly optimize how we create the process object 2022-03-26 03:40:17 -07:00
Jarred Sumner
5f482b4565 Auto-set content-type 2022-03-26 03:39:32 -07:00
Jarred Sumner
89af1474d8 Fix clonefile() so it actually does run 2022-03-26 03:39:25 -07:00
Jarred Sumner
690d22c8b6 Remove imports of <WTF/FileSystem.h> 2022-03-26 03:39:04 -07:00
Jarred Sumner
dc4cc070fc Move .d.ts into a better folder 2022-03-26 03:38:51 -07:00
Jarred Sumner
7d84dca254 Update response.file.test.js 2022-03-25 07:27:15 -07:00
Jarred Sumner
322780f649 fix error hanlding 2022-03-25 07:27:12 -07:00
Jarred Sumner
e3fb88b06a [bun.js] configuration and error handling for HTTP server 2022-03-25 07:12:02 -07:00
Jarred Sumner
be5789fe01 Auto-detect MimeType based on file extension 2022-03-24 22:29:05 -07:00
Jarred Sumner
120b2670da Bun.openInEditor 2022-03-24 21:10:53 -07:00
Jarred Sumner
a5027d46ae Update Makefile 2022-03-24 19:08:22 -07:00
Jarred Sumner
3434b9ecf3 Implement error page for HTTP server 2022-03-24 19:08:20 -07:00
Jarred Sumner
92a46c292f clang-format 2022-03-24 19:06:27 -07:00
Jarred Sumner
142cce2f29 Update response.zig 2022-03-24 18:23:01 -07:00
Jarred Sumner
d83aa176a3 [bun.js] Enable SharedArrayBuffer and expose internal Loader 2022-03-24 18:22:52 -07:00
Jarred Sumner
f105a2fea7 handle bodies of 0 length better 2022-03-23 22:53:22 -07:00
Jarred Sumner
6d230fc93e Update server.zig 2022-03-23 21:55:24 -07:00
Jarred Sumner
b5cc5ca669 Implement Request body support! 2022-03-23 21:53:29 -07:00
Jarred Sumner
dead6e3afc Support Request.headers and Request.url in http server 2022-03-23 19:54:13 -07:00
Jarred Sumner
dc3d0c41fe Update Makefile 2022-03-23 17:22:37 -07:00
Jarred Sumner
30bdaf80ef ✂️ test 2022-03-23 04:26:56 -07:00
Jarred Sumner
07d77c1e00 [bun.js] Bun.write for macOS 2022-03-23 04:26:49 -07:00
Jarred SUmner
5e5f0bd293 [bun.js] Implement Bun.write() 2022-03-23 01:46:47 -07:00
Jarred SUmner
9974142eef Handle integer sizes greater than i32 2022-03-22 04:44:39 -07:00
Jarred SUmner
6e9be9f1cc Linux-specific tweaks 2022-03-22 02:55:28 -07:00
Jarred Sumner
b1389f1b02 Response.file -> Bun.file 2022-03-22 00:24:34 -07:00
Jarred Sumner
b3bd413c3b sendfile works 2022-03-21 21:31:47 -07:00
Jarred Sumner
7cd93e6670 [bun.js] 2/? Implement Response.file, sendfile edition 2022-03-21 06:32:14 -07:00
Jarred Sumner
fa343fa8ad [bun.js] 1/? Implement Response.file 2022-03-21 02:21:51 -07:00
Jarred Sumner
1f93de264f Create uws 2022-03-20 06:36:26 -07:00
Jarred Sumner
735f4b5c38 Update fetch.test.js 2022-03-20 06:34:13 -07:00
Jarred Sumner
2509613bbe microptimize 2022-03-20 06:34:05 -07:00
Jarred Sumner
0b5a8057f2 add new module 2022-03-20 04:38:41 -07:00
Jarred Sumner
b0a397280e it's status, not statusCode 2022-03-20 04:38:18 -07:00
Jarred Sumner
bc85dd2330 the events, they loop 2022-03-20 04:38:04 -07:00
Jarred Sumner
a6b128590d 📷 2022-03-20 04:31:35 -07:00
Jarred Sumner
8313f19eb8 Bun.allocUnsafe 2022-03-19 07:47:30 -07:00
Jarred Sumner
be99967d67 no lazy 2022-03-19 00:49:14 -07:00
Jarred Sumner
f787976bca [bun.js] Improve support for bundling for node.js 2022-03-19 00:49:01 -07:00
Jarred Sumner
af327cc4f1 [bun bun] Fix race condition 2022-03-19 00:48:37 -07:00
Jarred Sumner
ce742f665a generate separate interop code for bun 2022-03-19 00:46:24 -07:00
Jarred Sumner
521ccba387 recommend bun install 2022-03-19 00:45:40 -07:00
Jarred Sumner
b8c50936a6 [JS Printer] Fix bug with printing imports for bundled code 2022-03-19 00:45:17 -07:00
Jarred Sumner
c1e8f3b593 [bun bun] don't load the bundle when bundling 2022-03-19 00:44:53 -07:00
Jarred Sumner
0134c14ebf Remove relative_nodejs import path format 2022-03-19 00:12:55 -07:00
Jarred Sumner
d87ea9c88a Fix JSON parsing failure 2022-03-18 20:54:09 -07:00
Jarred Sumner
7dc76bf709 Set charset=utf-8 for better consistentcy 2022-03-18 20:18:58 -07:00
Jarred Sumner
20ec3d9bbd Update bindings.zig 2022-03-18 20:06:25 -07:00
Jarred Sumner
0ed0fd2db0 add an extra gcTrace 2022-03-18 20:06:14 -07:00
Jarred Sumner
f4eecd3782 Add tests for Response.json, Response.error, and Response.redirect 2022-03-18 20:05:56 -07:00
Jarred Sumner
2e920aaac3 [bun.js] Implement Response.error 2022-03-18 20:05:38 -07:00
Jarred Sumner
216300f2b5 [bun.js] Implement Response.redirect 2022-03-18 20:05:31 -07:00
Jarred Sumner
394ec8dcbc [bun.js] Implement Response.json 2022-03-18 20:05:21 -07:00
Jarred Sumner
dcb437b1ad [bun.js] Response.prototype.type 2022-03-18 20:04:57 -07:00
Jarred Sumner
1be9e3cf2d handle ShadowRealm 2022-03-18 20:04:33 -07:00
Jarred Sumner
6b82b67065 var -> const 2022-03-18 20:04:24 -07:00
Jarred Sumner
d21cfe6202 [bun install] Do not set an $npm_config_prefix 2022-03-18 16:04:23 -07:00
Jarred Sumner
88698bc998 Be consistent about reported node version 2022-03-18 15:56:18 -07:00
Jarred Sumner
475304c3f5 [bun run] fix missing space 2022-03-18 15:55:33 -07:00
Jarred Sumner
5d39d3a3b2 [resolver] Fix edgecase where remapping a tsx -> js import path produced an invalid file path 2022-03-18 04:38:49 -07:00
Jarred Sumner
07379ecb4e [bun.js] Fix missing .prototype on builtins 2022-03-18 04:37:46 -07:00
Aiello
257f3f997a fix(readme): Fix hash link in README.md (#128) 2022-03-18 01:26:49 -07:00
Jarred Sumner
d1aea89c7d celanup 2022-03-17 20:52:31 -07:00
Jarred Sumner
6b33912f42 Fix crash when printing errors that are an unexpected type 2022-03-17 20:52:10 -07:00
Jarred Sumner
e4f67a7fc9 [bun.js] Return empty array instead of null when no router is defined 2022-03-17 20:42:40 -07:00
Jarred Sumner
9737c01058 [bun.js] Implement self.reportError 2022-03-17 20:42:28 -07:00
Jarred Sumner
2a3438186a Fix missing sentinel in mkdir 2022-03-17 19:18:15 -07:00
Jarred Sumner
881a3b28a7 [bun.js] Implement import.meta.resolve 2022-03-17 19:18:08 -07:00
Jarred Sumner
b3f4f8db24 [bun.js] Add some of the fs constants 2022-03-17 18:29:31 -07:00
Jarred Sumner
7175422a2b Ensure we handle unicode correctly when returning strings for node fs 2022-03-17 18:29:23 -07:00
Jarred Sumner
8fad34a29b [JS Transpiler] Always print escape unicode identifiers, for now 2022-03-17 18:29:02 -07:00
Jarred Sumner
8526f77c70 Update lockfile.zig 2022-03-17 18:28:40 -07:00
Jarred Sumner
86a4ab704d Move Bun to JSC.API 2022-03-17 18:28:24 -07:00
Jarred Sumner
d5613308f9 lil helper method 2022-03-17 18:27:44 -07:00
Jarred Sumner
3d1259ea36 Update build-id 2022-03-17 18:27:21 -07:00
Jarred Sumner
a82eac2195 only check once 2022-03-17 02:40:32 -07:00
Jarred Sumner
312ea407a2 Add test coverage for emoji in blobs 2022-03-17 01:47:33 -07:00
Jarred Sumner
695162e9fa Prevent segfault 2022-03-17 01:29:17 -07:00
Jarred Sumner
7a978f9381 move some code around 2022-03-17 01:28:56 -07:00
Jarred Sumner
c78556048c Update build-id 2022-03-17 01:28:45 -07:00
Jarred Sumner
3e68ead0fa optimize blob.text() 2022-03-17 01:28:36 -07:00
Jarred Sumner
74f4c8bcab query_string_map -> url 2022-03-17 01:27:35 -07:00
Jarred Sumner
89fb624c5b Fix crash from checking if something is an object when it is undefined 2022-03-16 08:49:16 -07:00
Jarred SUmner
6bcaa33751 Fix setTimeout on Linux 2022-03-16 08:02:15 -07:00
Jarred SUmner
8b73afad95 Increase from 4ms -> 40ms for timeout 2022-03-16 08:02:15 -07:00
Jarred Sumner
f63ddac287 Update README.md 2022-03-16 06:39:14 -07:00
Jarred Sumner
21ac71f740 llvm-stirp not working 2022-03-16 06:35:23 -07:00
Jarred Sumner
7df84b38b7 Update Makefile 2022-03-16 06:24:40 -07:00
Jarred Sumner
8ce7c83779 Update Dockerfile.base 2022-03-16 06:03:05 -07:00
Jarred Sumner
5de13e0038 Update Makefile 2022-03-16 05:51:19 -07:00
Jarred Sumner
09a7b01ee7 cleanup error printing 2022-03-16 05:50:52 -07:00
Jarred Sumner
fe89fc8a64 Revert "Unlimited arguments in process.nextTick"
This reverts commit aff9d232b1.
2022-03-16 05:24:06 -07:00
Jarred Sumner
1a7b546055 bun.lockb 2022-03-16 05:06:42 -07:00
Jarred Sumner
e92c832697 Update feature_flags.zig 2022-03-16 05:06:22 -07:00
Jarred Sumner
b633573ad0 [bun.js] Bun.unsafe test should check the gc 2022-03-16 05:05:37 -07:00
Jarred Sumner
c97ca4830e Update work_pool.zig 2022-03-16 05:04:45 -07:00
Jarred Sumner
3b78cfe71a Add a way to run serial tasks on a different thread 2022-03-16 05:04:23 -07:00
Jarred Sumner
422bdf692a fix crash when SyntaxError is thrown and we did not receive an ErrorInstance? 2022-03-16 05:03:29 -07:00
Jarred Sumner
fa1d4c2d7f [bun.js] Fix release-mode test failures in Headers 2022-03-16 05:02:08 -07:00
Jarred Sumner
942c70c795 Update ref_count.zig 2022-03-16 05:00:47 -07:00
Jarred Sumner
75fa87482d file is too big 2022-03-15 20:17:53 -07:00
Jarred Sumner
1fc9b93ed6 Update Dockerfile.base 2022-03-15 06:36:46 -07:00
Jarred Sumner
38430fbf0e Add rust and lolhtml to dockerfile 2022-03-15 06:21:57 -07:00
Jarred Sumner
64466e3259 bump webkit 2022-03-15 06:03:29 -07:00
Jarred Sumner
6918e20f22 Update WebKit 2022-03-15 06:02:50 -07:00
Jarred Sumner
6b903de12c 📷 2022-03-15 05:48:04 -07:00
Jarred Sumner
f1f3501628 Fix test failure 2022-03-15 05:47:53 -07:00
Jarred Sumner
e866fa1203 [bun:error] handle errors without a name or message 2022-03-15 05:19:54 -07:00
Jarred Sumner
90940ec240 Update pool.zig 2022-03-15 05:19:18 -07:00
Jarred Sumner
79caba9506 Load .env by default 2022-03-15 05:19:15 -07:00
Jarred Sumner
7083ef47bb mimalloc interpose is buggy 2022-03-15 05:00:22 -07:00
Jarred Sumner
234dd04c86 higher max http requests for bun.js 2022-03-15 05:00:06 -07:00
Jarred Sumner
6f095a6394 zero copy 2022-03-15 04:59:53 -07:00
Jarred Sumner
8a52e09e8b Update javascript.zig 2022-03-15 04:49:52 -07:00
Jarred Sumner
2ea7970a82 [bun.js] utf8 console.{time, count, timeEnd, profile, profileEnd, count, countReset} 2022-03-15 04:49:48 -07:00
Jarred Sumner
069fce0033 Create unsafe.test.js 2022-03-15 00:48:28 -07:00
Jarred Sumner
57e42cc538 Fix crash when Headers.delete 2022-03-15 00:38:28 -07:00
Jarred Sumner
2498784d14 more tests 2022-03-15 00:38:12 -07:00
Jarred Sumner
ec14a2ef5d Add a fast path to TextDecoder UTF-16 for when you pass a Uint16Array 2022-03-14 23:47:01 -07:00
Jarred Sumner
8f93cc37d2 handle min ascii 16 2022-03-14 23:44:24 -07:00
Jarred Sumner
9a43eb903d cleanup some code 2022-03-14 23:44:07 -07:00
Jarred Sumner
5a6010deda FetchEvent's request will be disconnected from the real request after the request is sent 2022-03-14 23:43:59 -07:00
Jarred Sumner
a168c51395 Fix a couple memory leaks in bun dev 2022-03-14 23:43:20 -07:00
Jarred Sumner
5aae8726ef Switch to std.HashMap for DirEntry store 2022-03-14 23:40:17 -07:00
Jarred Sumner
aff9d232b1 Unlimited arguments in process.nextTick 2022-03-14 23:37:56 -07:00
Jarred Sumner
d0a9b404c3 [bun.js] Fix a memory leak with microtasks 2022-03-14 23:37:43 -07:00
Jarred Sumner
e3b3631634 Handle segfault when console.log'ing stuff that should never make it to console.log in the first place 2022-03-14 23:37:08 -07:00
Jarred Sumner
7b8113c7c7 Fix bug causing GC to sometimes never run 2022-03-14 23:36:45 -07:00
Jarred Sumner
2d1538e698 fix crash in bun create 2022-03-14 21:10:25 -07:00
Jarred Sumner
1316dd1a4f Fix crash when HTTP thread goes to sleep 2022-03-14 05:39:45 -07:00
Jarred Sumner
13f1cdca7b add another assertion 2022-03-14 05:39:22 -07:00
Jarred Sumner
00977c75ba fix crash when upgrade checker ends 2022-03-14 05:39:09 -07:00
Jarred Sumner
0e9056eca5 [bun.js] Implement console.trace() 2022-03-14 01:32:13 -07:00
Jarred Sumner
4ab4ae77ac Reference-counting for Blob and Headers 2022-03-14 01:31:56 -07:00
Jarred Sumner
4638871050 [bun dev] Fix crash on macOS 2022-03-14 01:26:39 -07:00
Jarred Sumner
13cd18e614 make headers a ptr 2022-03-13 16:16:27 -07:00
Jarred Sumner
0a8976c1e0 Update .gitmodules 2022-03-13 16:03:12 -07:00
Jarred Sumner
19515ca63a Add finalizers 2022-03-13 06:08:38 -07:00
Jarred Sumner
f4504292cf [bun.js] Implement Blob 2022-03-13 06:08:10 -07:00
Jarred Sumner
6d71749c70 Update string-handling.zig 2022-03-12 05:56:11 -08:00
Jarred Sumner
777e5f47be [Bun.js] Support async HTMLRewriter 2022-03-12 05:55:53 -08:00
Jarred Sumner
e97934a225 Expose Response.prototype.headers and Response.prototype.clone 2022-03-12 05:55:23 -08:00
Jarred Sumner
e65c82a032 Headers.clone 2022-03-12 05:54:56 -08:00
Jarred Sumner
6f39b8f576 Response.clone() 2022-03-12 05:54:34 -08:00
Jarred Sumner
7b93123133 Implement iterator 2022-03-12 02:59:10 -08:00
Jarred Sumner
d6831cf801 [Bun.js] Implement HTMLRewriter
https://developers.cloudflare.com/workers/runtime-apis/html-rewriter
2022-03-12 01:14:45 -08:00
Jarred Sumner
64f1af0aa6 skeleton 2022-03-11 04:49:25 -08:00
Jarred Sumner
313ad01e42 fix bug with freeing typed arrays 2022-03-11 03:09:57 -08:00
Jarred Sumner
44b0c8153a Source Maps for client-side errors & columns 2022-03-11 00:03:09 -08:00
Jarred Sumner
c8f6337f1f twiddle with formatting 2022-03-10 06:55:43 -08:00
Jarred Sumner
7998a43b04 [bun.js] Map the sources when handling the error 2022-03-10 05:41:52 -08:00
Jarred Sumner
17c1f403c1 Update comptime_string_map.zig 2022-03-10 05:40:51 -08:00
Jarred Sumner
1422055304 [bun.js] Support sourcemaps! 2022-03-10 05:39:46 -08:00
Jarred Sumner
3ca113059d Update js_printer.zig 2022-03-10 00:46:00 -08:00
Jarred Sumner
f4f07f8993 WIP sourcemap parsing 2022-03-10 00:44:27 -08:00
Jarred Sumner
187fd9f61f woops 2022-03-10 00:44:13 -08:00
Jarred Sumner
69eeff1f76 console.log(<JSX>) support 2022-03-10 00:44:01 -08:00
Jarred Sumner
4204baabe6 Update linker.zig 2022-03-09 04:00:36 -08:00
Jarred Sumner
01b1fee284 69% perf improvement for long string literals 2022-03-09 04:00:19 -08:00
Jarred Sumner
bdb5e4aa56 Update options.zig 2022-03-09 03:58:35 -08:00
Jarred Sumner
026657d83b make the map slightly smaller 2022-03-09 03:58:32 -08:00
Jarred Sumner
e35895888e [JS Printer] Add function for printing a string as JSON 2022-03-09 02:37:42 -08:00
Jarred Sumner
90ead2d992 10% perf improvement to JSX entity code parsing in microbenchmark 2022-03-09 02:36:55 -08:00
Jarred Sumner
43622a8eb7 fix bug with UTF-16 template literal escape codes 2022-03-09 02:36:20 -08:00
Jarred Sumner
eeff004ec2 Fix quoting console.log 2022-03-08 23:37:54 -08:00
Jarred Sumner
1bf898828b print size of headers 2022-03-08 19:33:45 -08:00
Jarred Sumner
0a742506ff sourcemappings 2022-03-08 18:56:12 -08:00
Jarred Sumner
701d6ec45d rename _global -> bun 2022-03-08 18:54:54 -08:00
Jarred Sumner
787769ac39 [bun.js] Support logging Headers, Response, and Request 2022-03-08 18:15:21 -08:00
Jarred Sumner
33950c0ae7 Fix https://github.com/Jarred-Sumner/bun/issues/122 2022-03-08 18:14:26 -08:00
Jarred Sumner
99ebef0b2f Update sourcemap.zig 2022-03-08 04:55:25 -08:00
Jarred Sumner
880f6a17b8 [bun.js] WIP sourcemap support 2022-03-08 04:46:25 -08:00
Jarred Sumner
0456845256 Add VLQ bench, improve decodeVLQ perf 2022-03-07 21:02:29 -08:00
Jarred Sumner
ce081f15e9 Optimize sourcemaps 2022-03-07 19:11:12 -08:00
Jarred Sumner
da9a19037f Update options.zig 2022-03-07 00:34:07 -08:00
Jarred Sumner
d43a645535 source maps optimizations 2022-03-07 00:33:49 -08:00
Jarred Sumner
50d5b872f9 [JS] Don't make this inline 2022-03-07 00:32:04 -08:00
Jarred Sumner
ccf57c7f3e [JS] Slight optimization for newlines 2022-03-07 00:31:48 -08:00
Jarred Sumner
2cc265361d [JS Parser] Fix bug with decoding escape sequences 2022-03-07 00:31:10 -08:00
Jarred Sumner
5ee063f6b2 [JS/JSON] Optimize parsing long strings 2022-03-07 00:30:51 -08:00
Jarred Sumner
50c8747c97 [JS Parser] Add optimization for JSX spread 2022-03-07 00:29:50 -08:00
Jarred Sumner
3598f0ed8a 1.7x faster sourcemap printing 2022-03-06 17:54:12 -08:00
Jarred Sumner
7c5c6cd519 source maps work for app code in bun dev! 2022-03-06 07:35:16 -08:00
Jarred Sumner
093807391a [JS Parser] dot property shorthand for JSX
This is a non-standard backwards-compatible feature that I suspect other tooling will soon adopt (and expect to help other tooling adopt it)

```jsx
var hello = {hi: 'yo'};
export const Foo = () => <Bar {hello.hi} />
```

Desugars into:
```jsx
var hello = {hi: 'yo'};
export const Foo = () => <Bar hi={hello.hi} />
```

This works with defines and macros too.

```jsx
export const Foo = () => <Bar {process.env.NODE_ENV} />
```

```jsx
export const Foo = () => <Bar NODE_ENV="development" />
```
2022-03-05 19:33:25 -08:00
Jarred Sumner
18c923596a Update README.md 2022-03-05 03:15:05 -08:00
Jarred Sumner
d3de5ff017 Update README.md 2022-03-05 03:14:25 -08:00
Jarred Sumner
f8f2ec8f35 Update README.md 2022-03-05 03:00:13 -08:00
Jarred Sumner
af6c18ccc5 Begin implementing sourcemaps 2022-03-05 02:56:29 -08:00
Jarred Sumner
4f5aa438d6 [JS Parser] Support JSX prop punning 2022-03-04 17:51:22 -08:00
Jarred Sumner
bd2f818500 Delete peechy.js 2022-03-04 05:03:33 -08:00
Jarred Sumner
29f240ac79 [bun.js] Add atob and btoa 2022-03-04 03:30:29 -08:00
Jarred Sumner
c53dc308be Update release.sh 2022-03-04 00:27:22 -08:00
Jarred Sumner
cb8e5d2cd9 Bump zig in docker 2022-03-04 00:26:21 -08:00
Jarred Sumner
d8d5b1a071 more tests 2022-03-04 00:26:13 -08:00
Jarred Sumner
bb64920cf0 add datetime package 2022-03-04 00:21:08 -08:00
Jarred Sumner
427c39b858 Update analytics_thread.zig 2022-03-04 00:20:59 -08:00
Jarred Sumner
b0d5903aba reduce number of global symbols 2022-03-04 00:20:54 -08:00
Jarred Sumner
dbc28a24ac more 2022-03-04 00:20:39 -08:00
Jarred Sumner
51fbbea1d3 upgrade zig 2022-03-04 00:20:22 -08:00
Jarred Sumner
696710fd7a mark more things as unreachable 2022-03-02 22:17:20 -08:00
Jarred Sumner
5ace39e4cb Add context ptr to forEach in iterable 2022-03-02 22:16:04 -08:00
Jarred Sumner
b878f9054c [bun.js] Add Bun.inspect – like util.inspect() 2022-03-02 22:14:35 -08:00
Jarred Sumner
871780fd28 Make http requests a little faster 2022-03-02 21:17:50 -08:00
Jarred Sumner
4c5eb4b4db [bun dev] Improve HMR performance by pooling websocket threads
Previously, bun would create a new thread for each websocket connection. Now, it re-uses them

Eventually, this should use evented i/o but other changes need to be made to support that
2022-03-02 21:17:38 -08:00
Jarred Sumner
117ca5355d Send Date header in bun dev 2022-03-02 21:15:55 -08:00
Jarred Sumner
1a02782539 [internal] log memory allocations in mimalloc arenas 2022-03-02 21:13:34 -08:00
Jarred Sumner
c7941bfab0 Reduce stack size usage by about 120 KB 2022-03-02 21:12:31 -08:00
Jarred Sumner
88b60e6f10 add is_bindgen stub 2022-03-02 21:12:02 -08:00
Jarred Sumner
c5a2172c7b reduce number of global constants 2022-03-02 21:11:37 -08:00
Jarred Sumner
b2d847a273 reduce number of global variables 2022-03-02 21:11:19 -08:00
Jarred Sumner
4fb5e068bc Update bindings.zig 2022-03-02 17:50:29 -08:00
Jarred Sumner
4be4540acf Remove function from bindings 2022-03-02 17:50:25 -08:00
Jarred Sumner
a9d99dc0e5 DELETE header 2022-03-02 17:49:55 -08:00
Jarred Sumner
d1922d4742 [bun.js] fix unicode handling in Router 2022-03-02 17:49:23 -08:00
Jarred Sumner
d85c59208c [bun.js] Fix crash due to incorrectly creating string 2022-03-02 17:49:09 -08:00
Jarred Sumner
17d625a735 remove a threadlocal 2022-03-02 15:34:26 -08:00
Jarred Sumner
42f61ebf8a cleanup error printing 2022-03-02 03:07:28 -08:00
Jarred Sumner
5e55c02bc6 Update global.zig 2022-03-02 03:07:08 -08:00
Jarred Sumner
ea7d38cea7 Update fs.zig 2022-03-02 03:07:04 -08:00
Jarred Sumner
4b36efd50a [bun run] Set more environment variables 2022-03-02 03:06:59 -08:00
Jarred Sumner
c3b96c90d3 clean up error message when CLI flag is invalid 2022-03-02 03:06:30 -08:00
Jarred Sumner
c0584c5102 add bun pm cache and bun pm cache rm commands 2022-03-02 03:06:11 -08:00
Jarred Sumner
87c71207e3 [bun.js] ResolveError.prototype.toString() BuildError.prototype.toString() 2022-03-01 22:21:39 -08:00
Jarred Sumner
149bbc12b5 add allowBunRuntime and autoImportJSX flags to Bun.Transpiler 2022-03-01 22:21:03 -08:00
Jarred Sumner
78cae049d2 cleanup code that checks if it should send an HTTP body 2022-03-01 22:19:15 -08:00
Jarred Sumner
7b4f239d33 [JS Parser] Fix bug with super from adding class static blocks 2022-03-01 22:18:16 -08:00
Jarred Sumner
80d4faa8ab Update bundler.zig 2022-03-01 22:17:43 -08:00
Jarred Sumner
4bb3f207ed Remove unused bool 2022-03-01 22:16:17 -08:00
Jarred Sumner
2ccb063d20 [bun.js] Allow disabling runtime imports so bun can build for node 2022-03-01 22:16:09 -08:00
Jarred Sumner
710303be7a [JS Parser] Make auto importing JSX a flag so the API is easier 2022-03-01 22:14:04 -08:00
Jarred Sumner
f337082c82 cleanup 2022-03-01 22:12:51 -08:00
Jarred Sumner
a306d4ae40 Update javascript.zig 2022-03-01 03:57:18 -08:00
Jarred Sumner
ea80cd1cd8 [bun.js] shim async fs 2022-03-01 00:50:30 -08:00
Jarred Sumner
114c0e8ed2 [bun.js] Implement setTimeout, setInterval, clearTimeout, clearInterval 2022-03-01 00:47:31 -08:00
Jarred Sumner
9ccb520e9e Update transpiler.test.js 2022-02-27 23:20:46 -08:00
Jarred Sumner
fb3a262f4b [TS] Make export {type foo} output consistent with TS parser 2022-02-27 23:20:38 -08:00
Jarred Sumner
50560e169c WASM 2022-02-27 23:20:10 -08:00
Jarred Sumner
36c249e9c1 begin writing types 2022-02-27 04:56:12 -08:00
Jarred Sumner
608b906bd5 [JSON] Use UTF-8 JSON parser when it's not for JavaScript 2022-02-27 04:55:20 -08:00
Jarred Sumner
09146d1c11 Update json_parser.zig 2022-02-27 04:54:48 -08:00
Jarred Sumner
3f9c5edbf5 📷 2022-02-27 04:54:41 -08:00
Jarred Sumner
1ed74ab59b mark as comptime 2022-02-27 04:26:45 -08:00
Jarred Sumner
0d4a2539a8 Fix typo
Thanks @danielweck
2022-02-27 04:26:21 -08:00
Jarred Sumner
4cedceaae2 Update build.zig 2022-02-27 04:15:42 -08:00
Jarred Sumner
7eeacfe672 Bump 2022-02-27 04:15:39 -08:00
Jarred Sumner
0a86a4ea80 Fix https://github.com/Jarred-Sumner/bun/issues/115 2022-02-27 04:14:55 -08:00
Jarred Sumner
d91e897413 [TS Parser] Implement constructor(private foo)
Input:
```
class Foo {
  constructor(public bar: string = "baz") {}
  bar: number;
}
```

Output:
```
class Foo {
  bar;
  constructor(bar = "baz") {
    this.bar = bar;
  }
  baz;
}
```
2022-02-27 03:37:31 -08:00
Jarred Sumner
953ddef482 Update README.md 2022-02-27 02:03:13 -08:00
Jarred Sumner
effcad912d Update README.md 2022-02-27 01:57:06 -08:00
Jarred Sumner
26a9c1c47b Update README.md 2022-02-27 01:56:59 -08:00
Jarred Sumner
e9b4e5a374 [JS Parser] Improve test coverage 2022-02-27 01:53:51 -08:00
Jarred Sumner
7576caa54a typegenerator 2022-02-27 01:53:34 -08:00
Jarred Sumner
a6901fdac1 Update jsc.zig 2022-02-27 01:53:01 -08:00
Jarred Sumner
8c271e5640 [JS Printer] Fix edgecase with optional chaining, class static block initialization and private identifiers 2022-02-27 01:52:56 -08:00
Jarred Sumner
7600e94ddc [JS Parser] AST changes for class static block & private identifiers 2022-02-27 01:50:13 -08:00
Jarred Sumner
c5804cd6ff [JS Parser] Fix bug with unicode identifiers 2022-02-27 01:49:56 -08:00
Jarred Sumner
5e4b50dc6c [JS Parser] #privateIdentifiers 2022-02-27 01:49:30 -08:00
Jarred Sumner
152f63b019 [JS Parser] Class Static Initialization Blocks
https://github.com/tc39/proposal-class-static-block
2022-02-27 01:48:10 -08:00
Jarred Sumner
1958f7adb5 [TS Parser] Support export {type Foo} 2022-02-27 01:46:51 -08:00
Jarred Sumner
789b17d333 be more careful 2022-02-25 04:59:41 -08:00
Jarred Sumner
d08aa46381 Update cli.zig 2022-02-25 02:18:10 -08:00
Jarred Sumner
f90ea81d58 bump target nextjs version 2022-02-25 02:18:07 -08:00
Jarred Sumner
7e96e82cad [bun pm] add help menu 2022-02-25 02:04:08 -08:00
Jarred Sumner
64b0087e84 Fix alignment bug with bun --help 2022-02-25 02:03:54 -08:00
Jarred Sumner
fe5ef864f1 hopefully no more unnecessary git status 2022-02-25 00:54:59 -08:00
Jarred Sumner
0d56e91e00 Update bun-install-lockfile-status.sh 2022-02-25 00:48:36 -08:00
Jarred Sumner
293a9bc811 [bun install] Add metadata hash 2022-02-25 00:48:36 -08:00
Evan Boehs
b8c6865ce0 Update README.md (#119) 2022-02-25 00:24:22 -08:00
Jarred Sumner
1795b6570c [bun install] Skip saving the lockfile if there are no changes 2022-02-24 22:01:37 -08:00
Jarred Sumner
152e3cb7bf Update Makefile 2022-02-24 21:08:21 -08:00
Jarred Sumner
2bc873d8b6 Update Makefile 2022-02-24 21:08:15 -08:00
Jarred Sumner
2e817195d2 Update WebKit 2022-02-24 21:01:48 -08:00
Jarred Sumner
12dbc5dfa4 Update generated versions 2022-02-24 21:00:42 -08:00
Jarred Sumner
026e75c46b Update Makefile 2022-02-24 20:47:31 -08:00
Jarred Sumner
f6ea59dbd9 misc 2022-02-24 20:43:13 -08:00
Jarred Sumner
986895f8c1 [bun dev] Don't log errors twice 2022-02-24 20:34:23 -08:00
Jarred Sumner
0694bbce00 Add a simple HMR test 2022-02-24 20:34:09 -08:00
Jarred Sumner
3bd12180de Make alignment more consitent 2022-02-24 20:33:45 -08:00
Jarred Sumner
208885e3d2 [bun dev] Fix bug with not transpiling files at the root 2022-02-24 20:32:57 -08:00
Jarred Sumner
896195f5e3 slightly clean up react example 2022-02-24 19:25:03 -08:00
Jarred Sumner
23596b48ca [bun-framework-next] Support Next.js 12.1 2022-02-24 19:24:48 -08:00
Jarred Sumner
0b7897f26c [bun.js] Implement process.exit (no callbacks yet) 2022-02-24 19:17:21 -08:00
Jarred Sumner
08c4f8b103 [bun install] Print correct bin name 2022-02-24 19:16:58 -08:00
Jarred Sumner
a9b32275f1 [bun install] Add integration test for bin links 2022-02-24 19:16:48 -08:00
Jarred Sumner
d1eba784b9 Add WASM modules but disable it for now 2022-02-24 19:09:55 -08:00
Jarred Sumner
ead77e074d bump build id 2022-02-24 01:46:27 -08:00
Jarred Sumner
a3ee0bb291 fix test failure in path.resolve 2022-02-24 01:46:18 -08:00
Jarred Sumner
a71c1288a6 Ensure we run the process test 2022-02-24 01:46:02 -08:00
Jarred Sumner
3182c5d304 Update javascript.zig 2022-02-24 00:59:27 -08:00
Jarred Sumner
8effa39410 [bun.js] Add ShadowRealm 2022-02-24 00:59:19 -08:00
Jarred Sumner
5f50de2b39 [bun-framework-next] Remove TextEncoder & TextDecoder polyfills 2022-02-24 00:16:45 -08:00
Jarred Sumner
b37cb73802 Use a JSFinalobject for Path 2022-02-24 00:15:44 -08:00
Jarred Sumner
806e406b67 Expose TextEncoder & TextDecoder globally 2022-02-24 00:15:17 -08:00
Jarred Sumner
3ad7c23221 [Web Platform] Implement TextEncoder & TextDecoder 2022-02-24 00:14:38 -08:00
Jarred Sumner
5b9d5d55e8 move GCDeferralContext 2022-02-24 00:13:29 -08:00
Jarred Sumner
5c9859e7f2 [JS Parser] ensure assertions are never run at runtime 2022-02-24 00:13:04 -08:00
Jarred Sumner
2e1e50486f misc cleanup 2022-02-24 00:12:40 -08:00
Jarred Sumner
27be64cf12 Make format consistent with WebKit 2022-02-22 15:51:41 -08:00
Jarred Sumner
4dd6472908 import assertion test 2022-02-22 15:47:26 -08:00
Jarred Sumner
dfa3e19cbf snaspshots 2022-02-22 15:47:11 -08:00
Jarred Sumner
fbac824975 tests for text-encoder 2022-02-22 15:45:08 -08:00
Jarred Sumner
e77a8db546 Fix assertion in JSPrinter 2022-02-22 15:27:09 -08:00
Jarred Sumner
77a3d791b1 Use clang-format from webkit so it's consistent 2022-02-22 15:26:50 -08:00
Jarred Sumner
bb8626e120 Move lockfile into separate file 2022-02-21 16:28:13 -08:00
Jarred Sumner
931670b7cb Wrap some usages of assert in a conditional
See https://github.com/ziglang/zig/issues/10942
2022-02-21 16:27:44 -08:00
Jarred Sumner
427de61702 Bump webkit in base image 2022-02-21 15:38:38 -08:00
Jarred Sumner
1d58a7aadd Update javascript.zig 2022-02-21 15:10:26 -08:00
Jarred Sumner
f49c3416d5 upgrade to latest JSC 2022-02-21 05:00:14 -08:00
Jarred Sumner
4f2fc299a9 upgrade JSC 2022-02-21 04:13:37 -08:00
Jarred Sumner
efb4baacdf [bun dev] Implement copy as markdown 2022-02-20 23:12:15 -08:00
Jarred Sumner
59109a309f add version to Framework struct 2022-02-20 16:24:36 -08:00
Jarred Sumner
8f1b2b2350 [JSON] Implement a way to convert any Zig type to a JSON object 2022-02-20 16:24:11 -08:00
Jarred Sumner
1ecd66e55d Update mime_type.zig 2022-02-20 16:23:41 -08:00
Jarred Sumner
06ac065d4d [bun dev] Implement /bun:info endpoint
This returns metadata for bun
2022-02-20 16:23:19 -08:00
Jarred Sumner
946404a365 [bun dev] Implement open in editor for transpiled files 2022-02-20 16:21:45 -08:00
Jarred Sumner
ab871d771a Mention behavior 2022-02-18 20:50:03 -08:00
Jarred Sumner
e11f44e039 Add a way to specify an editor in bunfig.toml 2022-02-18 20:47:10 -08:00
Jarred Sumner
c27577147c Update base.zig 2022-02-18 20:46:57 -08:00
Jarred Sumner
79974e4d81 [bun dev] Errors with file names can be opened in editor now 2022-02-18 20:46:55 -08:00
Jarred Sumner
eeab75998d Update javascript.zig 2022-02-18 20:33:18 -08:00
Jarred Sumner
3a0577ba96 Use an enum for Ref instead of a buggy packed struct
Fixes a printing bug with `Symbol`
2022-02-18 20:33:04 -08:00
Jarred Sumner
37aafb61be Update bundler.zig 2022-02-18 15:25:09 -08:00
Jarred Sumner
ad9ced2cc7 Create entitlements.debug.plist 2022-02-18 15:24:19 -08:00
Jarred Sumner
a0717e6fa7 Simple dead code elimination 2022-02-18 15:24:09 -08:00
Jarred Sumner
9cecbf42a6 Update javascript.zig 2022-02-18 14:43:12 -08:00
Jarred Sumner
cafa9cc3e4 [bun.js] Fix bug with getPublicPath when encountering URLs above the root 2022-02-18 14:42:56 -08:00
Jarred Sumner
a7181cb222 Update onThreadStart 2022-02-18 14:42:32 -08:00
Jarred Sumner
aa8080f441 more mimalloc 2022-02-18 14:42:28 -08:00
Jarred Sumner
65aae0ddad [bun.js] Make typeof window return "undefined" by default 2022-02-18 02:49:10 -08:00
Jarred Sumner
90f1f326ca [bun dev] Fix bug with importing node: namespace 2022-02-18 02:48:20 -08:00
Jarred Sumner
8383544bb5 onSpawn handler for thread 2022-02-18 02:47:59 -08:00
Jarred Sumner
65f1733d6f [Bundler] Fix race condition, 5% faster bundling
cc @hanford
2022-02-18 02:45:30 -08:00
Jarred Sumner
37e63eff22 [JS Parser] fix bugs found from tests 2022-02-18 02:43:45 -08:00
Jarred Sumner
24dd80e69a [JS Parser] Strip import assertions
Closes #4
2022-02-18 02:42:20 -08:00
Jarred Sumner
7b8de76267 [Bun.js] Implement crypto.randomBytes() and crypto.randomUUID() 2022-02-18 02:37:18 -08:00
Jarred Sumner
17ab2c18eb [Bun.js] Add a stub for setTimeout, setInterval, clearTImeout, clearInterval 2022-02-18 02:33:49 -08:00
Jarred Sumner
3db3413929 [JS Printer] fix edgecase with printing empty export 2022-02-18 02:32:57 -08:00
Jarred Sumner
32eb20702e improve test coverage 2022-02-17 03:49:28 -08:00
Jarred Sumner
17a7e2b241 constant folding and some cleanup 2022-02-17 03:46:57 -08:00
Jarred Sumner
83c0ad11ac [JS Printer] Print {\n} instead of ; for empty blocks 2022-02-17 03:46:04 -08:00
Jarred Sumner
6db46c6d00 Update js_printer.zig 2022-02-16 20:34:00 -08:00
Jarred Sumner
4ba0e7b7d8 [JS Printer] Fix missing space at end of object bindings
See also https://github.com/evanw/esbuild/pull/2025
2022-02-16 20:15:35 -08:00
Jarred Sumner
7637cfb0a6 [JS Parser] Fix several bugs with bindings and improve some errors 2022-02-16 17:02:39 -08:00
Jarred Sumner
f5c7c81780 Update js_parser.zig 2022-02-16 04:05:44 -08:00
Jarred Sumner
44bad4b8e6 [js parser] pool allocated names (perf) 2022-02-16 04:05:30 -08:00
Jarred Sumner
906a4bd75a [JS Transpiler] Begin porting esbuild parser tests to bun 2022-02-16 04:04:11 -08:00
Jarred Sumner
f8b48ebec6 Save LLVM IR in debug build 2022-02-16 04:03:35 -08:00
Jarred Sumner
a7bfc48bcc mimalloc flag 2022-02-16 04:02:48 -08:00
Jarred Sumner
6f1891462d [bun.js] Handle UTF-16 strings in Bun.Transpiler 2022-02-16 04:02:36 -08:00
Jarred Sumner
d00fe1f8af [bun.js] Handle UTF-16 strings in StringOrBuffer 2022-02-16 04:01:42 -08:00
Jarred Sumner
5a80a2e216 [bun.js] Fix segfault when running many bun.js instances 2022-02-16 04:01:13 -08:00
Jarred Sumner
3ab56cee8a symbol pool remnants 2022-02-16 03:45:48 -08:00
Jarred Sumner
6f78decf44 Handle empty array when joining expr 2022-02-16 03:41:57 -08:00
Jarred Sumner
68e5b0d842 [js printer] slightly optimize indent / unindent 2022-02-16 03:41:35 -08:00
Jarred Sumner
fa6bb0fc7c [js printer] Remove symbol pool 2022-02-16 03:41:11 -08:00
Jarred Sumner
103a527128 bump mimalloc 2022-02-16 03:18:38 -08:00
Jarred Sumner
054d873936 [bun test] Implement it.only 2022-02-16 00:40:38 -08:00
Jarred Sumner
9f2f33e4e6 Update mimalloc_arena.zig 2022-02-16 00:36:16 -08:00
Jarred Sumner
acb7439232 Add assert 2022-02-16 00:36:12 -08:00
Jarred Sumner
635d553b64 [JS Lexer] Fix incorrect assertion 2022-02-16 00:32:44 -08:00
Jarred Sumner
fe55720c6c [JS Parser] Add error when RegExp has duplicate flag 2022-02-16 00:32:29 -08:00
Jarred Sumner
08e8eabc6f Revert "Remove usage of packed struct in Ref because packed is buggy in zig"
This reverts commit 2578f426b6.
2022-02-15 20:08:35 -08:00
Jarred Sumner
665a359413 [internal] workaround https://github.com/ziglang/zig/issues/10903 2022-02-15 20:07:28 -08:00
Jarred Sumner
022e399bff Update test_command.zig 2022-02-15 13:47:23 -08:00
Jarred Sumner
2578f426b6 Remove usage of packed struct in Ref because packed is buggy in zig 2022-02-15 13:47:18 -08:00
Jarred Sumner
37bc3c8872 [bun test] Auto rewrite @jest/globals and vitest to bun:test 2022-02-15 13:44:34 -08:00
Jarred Sumner
55825c0e33 assert we aren't freeing statically allocated memory 2022-02-15 13:44:15 -08:00
Jarred Sumner
6e735b710a move import processing into a separate function 2022-02-14 20:21:01 -08:00
Jarred Sumner
8ec958ec01 Update bindings.zig 2022-02-14 20:20:38 -08:00
Jarred Sumner
e5a71462b8 remove a clone 2022-02-14 20:20:28 -08:00
Jarred Sumner
423d208790 [bun.js] Handle recursive macros and handle stack overflow 2022-02-14 19:03:25 -08:00
Jarred Sumner
83659b898d Path.join 2022-02-14 05:43:11 -08:00
Jarred Sumner
7653a2338e [bun.js] formatter 2022-02-14 04:28:25 -08:00
Jarred Sumner
8325db48ab MimeType from string 2022-02-14 04:28:13 -08:00
Jarred Sumner
eadca53e7b cleanup 2022-02-14 04:27:53 -08:00
Jarred Sumner
8cb9391534 [bun test] Slightly better test output 2022-02-14 04:27:39 -08:00
Jarred Sumner
106979876e [bun.js] Auto type coerction for macros! 2022-02-14 04:27:27 -08:00
Jarred Sumner
b9d82ee402 [JS parser] Slightly better dead code elimination & optimize AST string comparison 2022-02-13 20:44:55 -08:00
Jarred Sumner
776909a72d [js parser] Fix test failure with import {type foo} 2022-02-13 20:43:23 -08:00
Jarred Sumner
91026d4d1d Update install.zig 2022-02-13 16:09:27 -08:00
Jarred Sumner
4749df7c51 [bun install] Resolve nested folder: dependencies and tweak lockfile format for better determinism 2022-02-13 16:08:54 -08:00
Jarred Sumner
6bf3ae5a18 [bun test] Ensure throw doesn't get hidden 2022-02-13 16:05:47 -08:00
Jarred Sumner
a6de6d630a Tweak how strings are created 2022-02-12 22:11:36 -08:00
Jarred Sumner
b1e7d38f72 Add a memory allocator that always zeroes 2022-02-12 21:55:55 -08:00
Jarred Sumner
cf566ab785 [bun install] Move unnecessary data out of the lockfile 2022-02-12 21:55:26 -08:00
Jarred Sumner
9c54b0605d [bun install] Reduce noise in printed yarn.lock 2022-02-12 17:54:41 -08:00
Jarred Sumner
ff38312b7d [bun install] When --production, fail the build if symlinking fails 2022-02-12 16:46:48 -08:00
Jarred Sumner
b06e520ae4 [bun install] Handle multiple files in directory bins to link 2022-02-12 16:32:49 -08:00
Jarred Sumner
f33d23c0b4 [bun install] When both directories and bin is specified, prefer bin
This is for performance.
2022-02-12 16:05:57 -08:00
Jarred Sumner
b9567eb193 [bun install] Fix directory bin link bug 2022-02-12 16:02:54 -08:00
Jarred Sumner
7139316ef5 Implement multiple bin links for bun install -g 2022-02-12 15:43:04 -08:00
Jarred Sumner
6b215dcbbf Update README.md 2022-02-12 05:42:09 -08:00
Jarred Sumner
d7c75937a1 Update README.md 2022-02-12 05:41:45 -08:00
Jarred Sumner
272f1dea33 Update README.md 2022-02-12 05:41:35 -08:00
Jarred Sumner
b4c50d1d28 Update README.md 2022-02-12 05:40:12 -08:00
Jarred Sumner
4244e74d96 Update README.md 2022-02-12 05:39:02 -08:00
Jarred Sumner
f71c4bb8a4 Update README.md 2022-02-12 05:37:07 -08:00
Jarred Sumner
3141b928f8 Update README.md 2022-02-12 05:28:52 -08:00
Jarred Sumner
614d810ef4 Make bun install fast by default on linux 2022-02-12 05:00:58 -08:00
Jarred Sumner
ac91f98528 fix linux build error 2022-02-12 04:31:41 -08:00
Jarred Sumner
1252b6b7df Update README.md 2022-02-12 03:28:11 -08:00
Jarred Sumner
7842da78bc hm 2022-02-12 03:27:27 -08:00
Jarred Sumner
dad8b16878 hm 2022-02-12 03:26:51 -08:00
Jarred Sumner
3881b7a69c hm 2022-02-12 03:26:40 -08:00
Jarred Sumner
0471fae54a Update README.md 2022-02-12 03:26:20 -08:00
Jarred Sumner
a3d0b45cc0 readme 2022-02-12 03:21:52 -08:00
Jarred Sumner
e72264608b Fix crash that wasn't a crash 2022-02-12 02:42:39 -08:00
Jarred Sumner
eb93ae0d26 Trim leading double slashes in URL pathnames 2022-02-12 02:32:15 -08:00
Jarred Sumner
73836e19b7 Load config 2022-02-12 02:32:01 -08:00
Jarred Sumner
4257373654 Update install.zig 2022-02-12 02:00:14 -08:00
Jarred Sumner
297ddfd972 [bun install] Improve error handling when package is not found 2022-02-12 01:59:32 -08:00
Jarred Sumner
969fcd2213 Update package_manager_command.zig 2022-02-12 01:25:47 -08:00
Jarred Sumner
18b1a36d84 [bun install] Make global bin dir configurable 2022-02-12 01:23:32 -08:00
Jarred Sumner
89c99700f6 [bun install] Print linked bin names and improve output 2022-02-12 01:23:19 -08:00
Jarred Sumner
7c6386d81e [bun install] bun pm bin prints the bin directory 2022-02-12 01:22:07 -08:00
Jarred Sumner
757a1686f0 Add bun r as an alias for bun remove 2022-02-12 01:21:53 -08:00
Jarred Sumner
611cdd69b1 Add bun -g to completions 2022-02-12 01:21:44 -08:00
Jarred Sumner
90c573cd42 [bun install] Implement global installs 2022-02-11 21:15:20 -08:00
Jarred Sumner
71ca909008 another assertion 2022-02-11 19:04:05 -08:00
Jarred Sumner
8570b4a9d7 [bun install] Implement private registry support & scoped packages
Fixes https://github.com/Jarred-Sumner/bun/issues/112
2022-02-11 19:02:03 -08:00
Jarred Sumner
d67c95d8eb [bun install] Implement bunfig.toml config 2022-02-11 19:01:00 -08:00
Jarred Sumner
bfd7f3398c Update report.zig 2022-02-11 14:59:15 -08:00
Jarred Sumner
fce94e29a0 [bun install] Fix bun add multiple packages writing malformed package.json 2022-02-11 14:59:10 -08:00
Jarred Sumner
5d51b4c397 [bun install] Fix lockfile corruption 2022-02-11 14:58:46 -08:00
Jarred Sumner
5ec5b657be use platform-independent file preallocation 2022-02-11 14:57:11 -08:00
Jarred Sumner
3d057950b9 std.os.exit -> Global.exit so stderr is always flushed 2022-02-11 14:56:28 -08:00
Jarred Sumner
29f0159eae Update install.zig 2022-02-10 18:12:43 -08:00
Jarred Sumner
95c0f28dee [bun install] Continue linking bins if one fails 2022-02-10 17:07:01 -08:00
Jarred Sumner
185f74dfae [bun install] More reliably set permissions on bin links 2022-02-10 17:04:42 -08:00
Jarred Sumner
9369663317 [bun run] Fix exit code when running a bin 2022-02-10 16:46:14 -08:00
Jarred Sumner
e7626b6e04 Update linux_c.zig 2022-02-10 16:43:35 -08:00
Jarred Sumner
29a718e25d [bun run] Fix exit code when script fails 2022-02-10 16:43:28 -08:00
Jarred Sumner
8fca3f2487 [bun install] Improve reliability of extracting files 2022-02-10 16:43:07 -08:00
Jarred Sumner
ce442aa3e1 [bun install] Fix bug when linking bins from scoped packages (e.g. @babel/parser) 2022-02-10 16:42:16 -08:00
Jarred Sumner
6470f26be2 [bun install] Print more descriptive errors 2022-02-10 16:41:48 -08:00
Jarred Sumner
9018986600 [bun install] Fix bug when packages with long names 2022-02-10 16:41:33 -08:00
Jarred Sumner
25f15688f0 [bun dev] Add test for checking that js files are transpiled at the root when there is no static folder 2022-02-10 03:30:30 -08:00
Jarred Sumner
078a7c4c55 Cleanup test output 2022-02-10 03:21:26 -08:00
Jarred Sumner
cc1e19ade0 [bun dev] Use a Mimalloc Arena to attempt to resolve a crash when bun dev has been running for awhile 2022-02-10 01:46:49 -08:00
Jarred Sumner
27501a0576 [bun dev][css] Fix loading external assets 2022-02-10 01:40:36 -08:00
Jarred Sumner
2e2521c638 [bun dev] Implement hash: namespace for file loader to improve browser cache invalidation
This appends a hash to URLs and import paths

In `bun dev`, this means:
  `/foo.woff2` => `/hash:/foo.woff2`

`bun dev` simply ignores this.
2022-02-10 01:37:23 -08:00
Jarred Sumner
bcdd2cf220 [tree shaking] Trim unused values in var when possible 2022-02-10 01:28:41 -08:00
Jarred Sumner
e8394905d4 [tree shaking] Fix bug with removing unused const / let 2022-02-10 01:28:29 -08:00
Jarred Sumner
afe42bc327 Update readme for bun-macro-relay, bump 2022-02-09 13:50:33 -08:00
Jarred Sumner
86f6e30cca Update runtime.version 2022-02-08 01:37:30 -08:00
Jarred Sumner
4a24240d9f Possibly fix #98 2022-02-08 01:24:05 -08:00
Jarred Sumner
347b348865 📷 2022-02-08 01:05:13 -08:00
Jarred Sumner
d4afa5477d Move __exportDefault transform to parser 2022-02-08 01:00:46 -08:00
Jarred Sumner
7792ef1bde Update build-id 2022-02-07 23:51:19 -08:00
Jarred Sumner
5dce6f63d0 Add test for #117 2022-02-07 23:50:40 -08:00
Jarred Sumner
d43f7aa6aa Fix #117 2022-02-07 23:34:19 -08:00
Jarred Sumner
705325d6c5 Fix #117 2022-02-07 23:34:07 -08:00
Jarred Sumner
1430cb5e34 Don't import __FastRefreshRuntime if it's a CJS transform 2022-02-07 23:32:48 -08:00
Jarred Sumner
71fcb7b86c Reduce debug build memory usage 2022-02-07 23:10:55 -08:00
Jarred Sumner
3a48954586 [JS Parser] Fix bug with export default Foo when Foo was a bundled import 2022-02-07 23:10:42 -08:00
Jarred Sumner
49aee10cfa Update transpiler.test.js 2022-02-07 22:03:50 -08:00
Jarred Sumner
a571c56b4c [TS] Implement import {type foo} from 'bar'; (type inside clause) 2022-02-07 22:02:54 -08:00
Jarred Sumner
7b5bf62ad5 [bun-macro-relay] resolve the artifact directory 2022-02-07 21:31:36 -08:00
Jarred Sumner
869eea4bb2 Update README.md 2022-02-06 16:41:07 -08:00
Jarred Sumner
ffc900e1b3 Update README.md 2022-02-06 16:40:36 -08:00
Jarred Sumner
dded255306 Little doc 2022-02-06 15:05:10 -08:00
Jarred Sumner
9c5dead232 Update README.md 2022-02-06 00:52:24 -08:00
Jarred Sumner
0191cabe6e Update README.md 2022-02-06 00:47:15 -08:00
Jarred Sumner
e1747c0dd7 Update README.md 2022-02-06 00:45:30 -08:00
Jarred Sumner
e50ccc25db Update README.md 2022-02-06 00:44:31 -08:00
Jarred Sumner
3a788fa035 Update README.md 2022-02-06 00:43:56 -08:00
Jarred Sumner
9715c9223a Add unit test for toml imports 2022-02-05 21:26:55 -08:00
Jarred Sumner
ca6cdb4e98 [TOML] Fix bug with [[arrays]] 2022-02-05 21:26:47 -08:00
Jarred Sumner
e431dbe5bd Handle promise rejections in tests 2022-02-05 21:26:31 -08:00
Jarred Sumner
3063df9b78 Update resolve_path.zig 2022-02-05 21:26:14 -08:00
Jarred Sumner
d8f174e54c Always try to load bunfig.toml for install, dev, bun, test 2022-02-05 19:02:13 -08:00
Jarred Sumner
51abe58a1a () 2022-02-05 18:56:15 -08:00
Jarred Sumner
7f1415c7ae One less memcpy 2022-02-05 18:54:46 -08:00
Jarred Sumner
6cf3a08780 Further reliability improvements to http client 2022-02-05 00:30:28 -08:00
Jarred Sumner
2b45c8dffe Implement keep-alive but disable it 2022-02-05 00:30:28 -08:00
Jarred SUmner
860d7e93c0 Make bun-install slower but more reliable on Linux Kernel 5.5 and lower 2022-02-05 00:26:58 -08:00
Jarred SUmner
dabcac2e96 Several reliability improvements to HTTP 2022-02-04 20:50:21 -08:00
Jarred Sumner
c03b7a6f19 reminder 2022-02-04 02:43:49 -08:00
Jarred Sumner
909e6a6bab path.resolve() passes tests 2022-02-04 02:05:41 -08:00
Jarred Sumner
a2f91b167d Update multiple-var.js 2022-02-04 01:02:59 -08:00
Jarred Sumner
b2b8c7f0b7 📷 2022-02-04 01:02:55 -08:00
Jarred Sumner
29554f4de3 Update snippets.json 2022-02-04 00:58:20 -08:00
Jarred Sumner
735dc8f1d6 Add integration test for reading .json files that have UTF-8 string literals
Related: https://github.com/Jarred-Sumner/bun/issues/115
2022-02-04 00:58:12 -08:00
Jarred Sumner
a9577c9ba8 [http] fix segfault 2022-02-04 00:57:30 -08:00
Jarred Sumner
a89726b30c [bun dev] Fix bug with serving static files on next.js apps introduced in af69b47c22 2022-02-04 00:57:12 -08:00
Jarred Sumner
3225a4e7e8 Update types.zig 2022-02-04 00:31:29 -08:00
Jarred Sumner
432e823f7e Update test_command.zig 2022-02-04 00:31:24 -08:00
Jarred Sumner
62541f1ac8 path.normalize() tests pass 2022-02-04 00:31:20 -08:00
Jarred Sumner
faf137b9be Fix test failures in path.join 2022-02-03 21:03:39 -08:00
Jarred Sumner
3c9e30ffcd Update mimalloc_arena.zig 2022-02-03 21:03:08 -08:00
Jarred Sumner
b22a3f5973 [bun test] Support multiple files 2022-02-03 21:03:01 -08:00
Jarred Sumner
4232000020 Update js_ast.zig 2022-02-03 21:02:30 -08:00
Jarred Sumner
475aab6cc3 Support loading multiple entry points by changing what bun:main points to 2022-02-03 21:02:15 -08:00
Jarred Sumner
dddd9c23e4 [bun install] Configurable max http retry count 2022-02-03 21:01:45 -08:00
Jarred Sumner
1064b9dada Missing newline in errors in bun install 2022-02-03 21:01:32 -08:00
Jarred Sumner
baffe26dd1 Fix bug with http client 2022-02-03 21:01:14 -08:00
Jarred Sumner
1993f9f9a5 Move detectFastRefresh to later so HTTP request handler starts faster 2022-02-03 20:59:34 -08:00
Jarred Sumner
7f00482cfe Fix bug with macro remaps in Bun.Transpiler api 2022-02-03 01:56:02 -08:00
Jarred Sumner
b2a69a35b8 Slight improvement to non-ascii file path handling 2022-02-03 01:01:27 -08:00
Jarred Sumner
a52a948a70 path.relative passes Node's tests (which also fixed bugs) 2022-02-02 23:33:37 -08:00
Jarred Sumner
94cbfa4579 Begin porting path-browserify tests 2022-02-02 18:12:30 -08:00
Jarred Sumner
1a4ccd3f5c [http] Fixes to chunked transfer encoding reader 2022-02-02 18:07:05 -08:00
Jarred Sumner
68cb6130d3 "path" module from Node.js implementation 2022-02-02 18:02:06 -08:00
Jarred Sumner
64b74ede87 Cleanup HTTP thread on idle 2022-02-01 20:47:48 -08:00
Jarred Sumner
213960a04a Limit the number of pooled objects 2022-02-01 20:47:35 -08:00
Jarred Sumner
170e58a99d Fix biggest issue with HTTPS client! 2022-02-01 18:51:25 -08:00
Jarred Sumner
f3c4bfcbae wpi 2022-02-01 18:12:24 -08:00
Jarred Sumner
fa971895a8 partial read 2022-02-01 17:19:29 -08:00
Jarred Sumner
a5a9f8e821 Compile error 2022-02-01 16:23:20 -08:00
Jarred Sumner
0a547304a7 Set thread name 2022-02-01 16:23:13 -08:00
Jarred Sumner
45e7bb0027 IO.Completion.slice() 2022-02-01 16:23:02 -08:00
Jarred Sumner
5d7c34093f new boringSSL integration almost works with TLS 1.3 2022-02-01 14:45:47 -08:00
Jarred Sumner
9322cec8f2 WIP 2022-02-01 14:45:47 -08:00
Jarred Sumner
047501999d [linker] Fix bug with multiple JSX runtimes introduced in 5922ba29ac 2022-02-01 14:43:45 -08:00
Jarred Sumner
30f5e0d37c [path] Fix bug that occasionally caused relative paths to be missing the leading character 2022-02-01 14:42:42 -08:00
Jarred Sumner
205a6d45b5 [http] Fix assertion in favicon 2022-02-01 14:41:50 -08:00
Jarred Sumner
d47e0de175 [JS Printer] Fix printing edgecase with nested vars that use object destructuring 2022-02-01 14:41:36 -08:00
Jarred Sumner
8c470194ce "" 2022-01-30 16:11:48 -08:00
Jarred Sumner
410a6bd32d [bun dev] Add error favicon 2022-01-30 15:12:34 -08:00
Jarred Sumner
af69b47c22 [bun dev] Support HTML files in either project root or public folder (static) 2022-01-30 02:04:56 -08:00
Jarred Sumner
fb2c7e5f38 Update bun-flavored-toml.md 2022-01-29 23:52:30 -08:00
Jarred Sumner
4a1c195b24 Update Makefile 2022-01-29 23:52:26 -08:00
Jarred Sumner
1489e48950 Slight tweaks to TOML parser 2022-01-29 23:52:19 -08:00
Jarred Sumner
5922ba29ac Bundle embedded fast refresh if using react and no fast refresh is found 2022-01-29 23:51:37 -08:00
Jarred Sumner
1de275325e Embed a favicon when none exists 2022-01-29 23:51:01 -08:00
Jarred Sumner
14301284af cleanup 2022-01-29 23:50:38 -08:00
Jarred Sumner
adeb880d7f Enable Fast Refresh when not bundling 2022-01-29 23:49:41 -08:00
Jarred Sumner
857e9bee00 Embed React Fast Refresh in Bun
Fixes https://github.com/Jarred-Sumner/bun/issues/62

If the project has it's own copy of react fast refresh and is bundling, it will use that instead.
2022-01-29 23:48:39 -08:00
Jarred Sumner
711e0cef78 Handle null/undefined module.exports better 2022-01-29 23:43:28 -08:00
Jarred Sumner
73449bf433 [JS Printer] Fix CJS <> ESM interop edgecase
For code like this:

```js
module.exports = require("foo")
```

If `"foo"` is bundled, we should access it as the namespace reference from the bundle. Previously, we assumed it would be a property access.
2022-01-29 23:43:10 -08:00
Jarred Sumner
4aabccfc79 Fix bug introduced in 97d17904 2022-01-29 20:01:34 -08:00
Jarred Sumner
1e2a61c6a0 Slice once 2022-01-29 19:52:12 -08:00
Jarred Sumner
844fae826f Tag imports 2022-01-29 19:51:47 -08:00
Jarred Sumner
ef8d1a95a4 Update toml_lexer.zig 2022-01-28 23:57:29 -08:00
Jarred Sumner
bf4943eec1 Implement TOML parser
No Date/DateTime/Time/Local Time yet
2022-01-28 23:56:45 -08:00
Jarred Sumner
97d17904d3 Update AST layout to store capacity for items
We want to be able to push to the list
2022-01-28 19:26:03 -08:00
Jarred Sumner
98af486b89 Update README.md 2022-01-28 04:42:50 -08:00
Jarred Sumner
8f27b27a0e Update README.md 2022-01-28 04:39:20 -08:00
Jarred Sumner
aced5882d1 Update README.md 2022-01-28 04:38:01 -08:00
Jarred Sumner
839fd03472 Update README.md 2022-01-28 04:36:15 -08:00
Jarred Sumner
fb5a90cb1b Update README.md 2022-01-28 04:34:47 -08:00
Jarred Sumner
64a83f1427 Update README.md 2022-01-28 04:31:49 -08:00
Jarred Sumner
f684a16051 Update README.md 2022-01-28 04:30:48 -08:00
Jarred Sumner
2666b45f2a Add Bun.Transpiler doc to the readme 2022-01-28 04:26:40 -08:00
Alexander Kuznetsov
aad33c2611 Automate clang version checking / code signing (#113) 2022-01-27 19:09:40 -08:00
Jarred Sumner
ff2335a910 Stop reading "bun" from package.json
cc @hanford
2022-01-27 01:25:39 -08:00
Jarred Sumner
32733210dc [bunfig] Implement config file format 2022-01-27 01:25:09 -08:00
Jarred Sumner
9f5a1705a5 Don't look like a crash when CLI args are missing 2022-01-27 01:20:42 -08:00
Jarred Sumner
b4c1cea735 [cli] Add support for commands which optionally have one argument 2022-01-27 01:20:01 -08:00
Jarred Sumner
2572636004 Update Makefile 2022-01-26 18:14:10 -08:00
Jarred Sumner
3a962f3bad print file name on panic 2022-01-26 14:36:48 -08:00
Jarred Sumner
bfa2bc6736 merge 2022-01-25 20:04:24 -08:00
Jarred Sumner
354ed2880c Slightly safer 2022-01-25 20:00:23 -08:00
Jarred Sumner
9db4d195a7 Split http into files 2022-01-25 20:00:23 -08:00
Jarred Sumner
0808f29375 Update Dockerfile 2022-01-25 19:59:50 -08:00
Jarred Sumner
7dbfb3ef41 Fix up dev container 2022-01-25 19:59:50 -08:00
Jarred SUmner
333bccee5d On successful connect, switch to non-blocking sockets until we're about to close 2022-01-25 00:17:14 -08:00
Jarred SUmner
25c35e59b4 Fix getsockopt() 2022-01-25 00:00:16 -08:00
Jarred SUmner
ff7785e023 Automatically retry on would block 2022-01-24 23:42:16 -08:00
Jarred SUmner
0e138bcc8f Fallback to readev / writev 2022-01-24 23:30:23 -08:00
Jarred SUmner
ecea12d206 No io_uring for Ubuntu 20.04 2022-01-24 19:12:58 -08:00
Jarred Sumner
61d1c7b6b2 Update io_linux.zig 2022-01-23 23:11:41 -08:00
Jarred Sumner
b5cec4b704 [linux][http] return errno instead of unexpected 2022-01-23 23:11:06 -08:00
Jarred Sumner
e895605e5f [http] Remove usages of unreachable in syscall error handling 2022-01-23 23:06:44 -08:00
Jarred Sumner
f5a79ea6d2 Update io_linux.zig 2022-01-23 23:03:04 -08:00
Jarred Sumner
de0cf42111 Use non-cancellable syscalls for HTTP & use errno for errors 2022-01-23 23:00:15 -08:00
Jarred Sumner
ec9e4eb97e Improve error message when bun upgrade fails 2022-01-23 21:25:48 -08:00
Jarred Sumner
47b6a82920 Nice 2022-01-23 21:15:17 -08:00
Jarred Sumner
28f77b9823 Update analytics_thread.zig 2022-01-23 21:14:38 -08:00
Jarred Sumner
4ac8c1bd84 Add copyfile snippet 2022-01-23 21:14:34 -08:00
Jarred Sumner
962b7fa8d9 Add a callback when a thread spawns 2022-01-23 21:14:20 -08:00
Jarred Sumner
d6ebb478e3 Fix release build with debugging 2022-01-23 21:14:08 -08:00
Jarred Sumner
2b8893da53 Use a separate heap for HTTP 2022-01-23 21:12:59 -08:00
Jarred Sumner
744f52fb27 fake segfault test 2022-01-23 20:13:35 -08:00
Jarred Sumner
43b9f9462f Add kernel version to crash report 2022-01-23 20:11:17 -08:00
Jarred Sumner
d89aa9a9e6 Update main.zig 2022-01-23 20:10:55 -08:00
Jarred Sumner
084d78be29 Add C++ exception handler 2022-01-23 20:10:51 -08:00
Jarred Sumner
9c627e884d Create cat.mjs 2022-01-22 21:40:57 -08:00
Jarred Sumner
da83583cdf Create realpath.mjs 2022-01-22 21:19:18 -08:00
Jarred Sumner
4d9ae0df06 📷 2022-01-22 20:46:28 -08:00
Jarred Sumner
4d95e44317 Update helpers.h 2022-01-22 20:06:53 -08:00
Jarred Sumner
4b7235ac5f Update helpers.h 2022-01-22 20:06:18 -08:00
Jarred Sumner
4152c1b177 Update linker.zig 2022-01-22 19:41:01 -08:00
Jarred Sumner
dc5745080d Ensure we fully copy strings 2022-01-22 19:39:23 -08:00
Jarred Sumner
3dfac788fa Update http.zig 2022-01-22 19:17:07 -08:00
Jarred Sumner
c56ff7efb4 Rename bun:runtime -> bun:wrap so it fits 8 chars 2022-01-22 19:17:03 -08:00
Jarred Sumner
114c560912 Don't do isolated copy when we don't need to 2022-01-22 18:32:06 -08:00
Jarred Sumner
1576d183c9 Instead of 4 loops, we can do one switch statement 2022-01-22 18:31:45 -08:00
Jarred Sumner
0e0bfe91d0 [Bun.js] Resolve dynamic imports lazily 2022-01-22 18:31:28 -08:00
Jarred Sumner
d3559d1cca Update Makefile 2022-01-22 17:14:17 -08:00
Jarred Sumner
222a1cc9e8 Update Makefile 2022-01-22 17:09:24 -08:00
Jarred Sumner
03103925bd Skip dsym copy on linux 2022-01-22 17:07:20 -08:00
Jarred Sumner
9e470cb48e remove tempfiles 2022-01-22 16:52:19 -08:00
Jarred Sumner
376602a65c 📷 2022-01-22 16:46:23 -08:00
Jarred Sumner
8493cfe983 Clarify "Windows Subsystem for Linux" instead of "WSL"
thanks @MajesticString
2022-01-22 16:36:32 -08:00
Jarred Sumner
d11ac34dcb Add a release-safe option to Makefile 2022-01-22 16:25:33 -08:00
Jarred Sumner
08bc06dfe0 No more leading ./ necessary to pass a script to bun to execute 2022-01-22 16:25:21 -08:00
Jarred Sumner
f4fbf84294 Make Ref more safe 2022-01-22 16:23:14 -08:00
Jarred Sumner
56ae4bcb55 Ensure we allocate the correct number of argv 2022-01-22 16:21:45 -08:00
Jarred Sumner
ec61dc0665 [Resolver] Improve how we detect ESM 2022-01-22 16:21:08 -08:00
Jarred Sumner
b21b0ea849 Update report.zig 2022-01-22 16:20:55 -08:00
Jarred Sumner
318c423e14 [Resolver] Improve how we detect ESM 2022-01-22 16:20:35 -08:00
Jarred Sumner
834ff71157 Use newer hash table 2022-01-22 15:10:21 -08:00
Jarred Sumner
39a187d32e Update js_parser.zig 2022-01-22 15:09:37 -08:00
Jarred Sumner
146d2cc231 Sort imports 2022-01-22 15:09:28 -08:00
Jarred Sumner
87c95d45f7 Reset imported_module_ids 2022-01-22 15:00:25 -08:00
Jarred Sumner
f7f2f6e6b8 more tests 2022-01-21 21:03:06 -08:00
Jarred Sumner
3e803b3a58 Add test coverage for macro import behavior 2022-01-21 18:12:46 -08:00
Jarred Sumner
22c01ca14c FIx macros remap in Transpiler 2022-01-21 18:10:38 -08:00
Jarred Sumner
111f0921f5 [macros] Always remove imports to macros 2022-01-21 18:09:43 -08:00
Jarred Sumner
8c515c7077 Update exports.zig 2022-01-21 18:09:13 -08:00
Jarred Sumner
04579909ff [Bun.js] Fix error printing 2022-01-21 18:08:56 -08:00
Jarred Sumner
40ff3e4618 memory 2022-01-21 16:28:46 -08:00
Jarred SUmner
c0a446df02 Tags on pointers need to be cleared on Linux 2022-01-21 15:19:50 -08:00
Jarred Sumner
8f7cf6bf47 little 2022-01-21 05:09:58 -08:00
Jarred Sumner
4a7b5892af Add a little benchmark for transpiling from inside JS 2022-01-21 04:58:28 -08:00
Jarred Sumner
9a5aa95893 [Bun.js] Bun.Transpiler.transform & Bun.Transpiler.transformSync APIs 2022-01-21 03:39:27 -08:00
Jarred Sumner
8d623e21b6 [Bun.js] Add a threadpool for doing CPU-bound work 2022-01-21 03:37:05 -08:00
Jarred Sumner
7a87e41ab8 Update js_printer.zig 2022-01-21 03:36:27 -08:00
Jarred Sumner
f62f184241 Update logger.zig 2022-01-21 03:36:17 -08:00
Jarred Sumner
8ea69cb5d1 Improve reliabiltiy of multithreaded code by using threadlocal mimalloc heaps 2022-01-21 03:36:13 -08:00
Jarred Sumner
97f0cef391 [Bun.js] Fix TypedArray/ArrayBuffer <> Zig interop 2022-01-20 16:19:07 -08:00
Jarred Sumner
85084c6db9 Fix segfault 2022-01-20 01:42:23 -08:00
Jarred Sumner
a09b995651 Bun.Transpiler – API for scanning imports/exports of JSX/TSX/TS/JS files 2022-01-19 23:07:03 -08:00
Jarred Sumner
4098484ff5 Update Makefile 2022-01-19 13:48:57 -08:00
Jarred Sumner
91b24c6032 Update Makefile 2022-01-19 13:46:38 -08:00
Jarred Sumner
38d0f0bbd0 Update Dockerfile 2022-01-19 13:35:00 -08:00
Jarred Sumner
d3e39632bf Update Makefile 2022-01-19 13:34:15 -08:00
Jarred Sumner
43ae61e095 Update libbacktrace 2022-01-19 13:34:10 -08:00
Jarred Sumner
bd31c88814 Update Dockerfile.base 2022-01-19 13:26:45 -08:00
Jarred Sumner
02c59df1b3 Update release.sh 2022-01-19 13:26:26 -08:00
Jarred Sumner
f6c05ef7a1 small bugfix 2022-01-19 13:26:24 -08:00
Jarred Sumner
505e4b80fd Update fs.test.js 2022-01-19 02:39:25 -08:00
Jarred Sumner
cd8d88716f O3 2022-01-19 02:31:23 -08:00
Jarred Sumner
d3a93d5273 fs.*Sync(), bun wiptest, and More ™ (#106)
* very very wip

* almost ready to fix the errors

* Update identity_context.zig

* Update base.zig

* [bun test] It runs successfully

* Remove unnecessary call

* [Bun.js] Improve JS <> Zig unicode string interop

This fixes longstanding unicode bugs with `console.log` & `fetch`.

I believe @evanwashere reported this first awhile ago

* [Bun.js] Implement `Object.is()` binding and a way to set a timeout for script execution

* Update PLCrashReport.zig

* [Bun.js] Make `console.log` more closely match Node.js and Deno

* [Bun.js] Implement formatting specifier for console.*

* Implement `console.clear()`

* bug fix

* Support console.clear()

* Buffer stderr

* [bun test] Begin implementing Node.js `fs`

* Update darwin_c.zig

* Implement more of `fs`

* `mkdir`, `mkdir` recursive, `mkdtemp`

* `open`, `read` (and pread)

* Move some things into more files

* Implement readdir

* `readFile`, `readLink`, and `realpath`

* `writeFile`, `symlink`, `chown`, `rename`, `stat`, `unlink`, `truncate`

* `lutimes`

* Implement `SystemError` and begin wiring up the `fs` module

* `"fs"` - Most of the arguments / validation

* `fs` - Rest of the arguments / validations

* Begin wiring up the `fs` module

* Fix all the build errors

* support printing typed arrays in console.log

* It...works?

* Support `require("fs")`, `import fs from 'fs';`, `import * as fs from 'fs'`

* Fix a couple bugs

* get rid of the crash reporter for now

* Update fs.exports.js

* [bun.js] slight improvement to startup time

* [bun.js] Improve error message printing

* [Bun.js] Add `Bun.gc()` to run the garbage collector manually and report heap size

* [Bun.js] Add Bun.generateHeapSnapshot to return what JS types are using memory

* [Bun.js] Add `Bun.shrink()` to tell JSC to shrink the VM size

* Improve encoding reader

* [bun.js] Improve callback & microtask performance

* Update node_fs.zig

* Implement `console.assert`

* simple test

* [Bun.js] Prepare for multiple globals/realms to support testing

* Create callbacks-overhead.mjs

* Update http.zig

* [Bun.js] Implement `queueMicrotask`

* Add test for queueMicrotask

* 😪

* [Bun.js] Implement `process.versions`, `process.pid`, `process.ppid`, `process.nextTick`, `process.versions`,

* Implement `process.env.toJSON()`

* [Bun.js] Improve performance of `fs.existsSync`

* 💅

* [Bun.js] Implement `process.chdir(str)` and `process.cwd()`, support up to 4 args in `process.nextTick`

* Make creating Zig::Process lazy

* Split processi nto separte file

* [Bun.js] Node.js Streams - Part 1/?

* [Bun.js] Node.js streams 2/?

* WIP streams

* fix crash

* Reduce allocations in many places

* swap

* Make `bun` start 2ms faster

* Always use an apiLock()

* libBacktrace doesn't really work yet

* Fix crash in the upgrade checker

* Clean up code for importing the runtime when not bundling

* 📷

* Update linker.zig

* 68!

* backtrace

* no, really backtrace

* Fix

* Linux fixes

* Fixes on Linux

* Update mimalloc

* [bun test] Automatically scan for {.test,_test,.spec,_spec}.{jsx,tsx,js,cts,mts,ts,cjs}
2022-01-19 02:29:07 -08:00
Jarred Sumner
ed9637de50 Fix bug preventing multiple framework overrides 2022-01-05 17:27:46 -08:00
Jarred Sumner
4e744c057b Reduce memory usage 2022-01-05 16:42:08 -08:00
Jarred Sumner
4b717fe554 Fix crash that sometimes happens after 30 seconds 2022-01-05 16:41:58 -08:00
Jarred Sumner
236a0fde35 [bun bun][bun dev] Fix crash affecting large projects
ArrayList cannot be used here
2022-01-05 16:41:25 -08:00
Jarred Sumner
306d309209 move some code around 2022-01-05 15:04:50 -08:00
Jarred Sumner
a8f4cd271e we want the opposite of this 2022-01-05 13:21:45 -08:00
Jarred Sumner
3cd129544e [JS Parser] Reduce memory usage by ~8% 2022-01-05 13:12:11 -08:00
Jarred Sumner
1004e924ff minimal integration tests for macros 2022-01-05 13:12:11 -08:00
Jarred Sumner
c013ede227 Update resolver.zig 2022-01-05 13:12:11 -08:00
Jarred Sumner
914b363a37 Update options.zig 2022-01-05 13:12:11 -08:00
Jarred Sumner
8ad349dcf0 Update http.zig 2022-01-05 13:12:11 -08:00
Mateusz Burzyński
7146bfc04a Add module condition to the node platform (#104) 2022-01-05 02:45:15 -08:00
Mateusz Burzyński
e852bc0980 Drop redundant comments (#103) 2022-01-05 02:37:25 -08:00
Mateusz Burzyński
8a9b1416ed Tweak default main fields for the bun platform to match other popular bundlers (#102) 2022-01-05 02:35:01 -08:00
Jarred Sumner
9da7a1ff0a 💀 dead code 2022-01-04 22:20:01 -08:00
Jarred Sumner
219aa57fbd [bun dev] Print error in status line text 2022-01-04 22:19:50 -08:00
Jarred Sumner
5930ac09b7 noramlize some errors 2022-01-04 22:19:31 -08:00
Jarred Sumner
8837c3c10b [Bun.js][bun dev] Support macros inside of Bun.js
Closes #36
2022-01-04 22:12:37 -08:00
Jarred Sumner
0d0dd65a6a [bun bun] Fix error when regenerating node_modules.bun after moving it
I think @alii reported this awhile ago
2022-01-04 20:15:05 -08:00
Jarred Sumner
0ac9c4276f Improve how we detect if terminal colors are supported 2022-01-04 19:57:14 -08:00
Jarred Sumner
0edf6fd1e4 Improve error handling when out of file handles 2022-01-04 18:29:21 -08:00
Jarred Sumner
c9d6c25f71 Update build-id 2022-01-04 16:27:27 -08:00
Jarred Sumner
73fed6c093 Downgrade mimalloc due to crashes 2022-01-04 16:27:02 -08:00
Jarred Sumner
75f238fcb3 Upload compressed .dSYM for every release 2022-01-04 16:26:52 -08:00
Jarred Sumner
8706f77eb7 Update .gitignore 2022-01-04 16:26:12 -08:00
Jarred Sumner
3cf0689d46 [bun install] Fix more cases where bytes are printed instead of strings 2022-01-04 04:00:26 -08:00
Jarred Sumner
623f77e097 minor perf optimization: remove this loop on macOS 2022-01-04 04:00:06 -08:00
Jarred Sumner
61d6f8f18f Update crash_reporter_linux.zig 2022-01-03 22:46:21 -08:00
Jarred Sumner
6480193c65 😕 2022-01-03 22:39:08 -08:00
Jarred Sumner
23a31b3771 💅 2022-01-03 22:35:01 -08:00
Jarred Sumner
112b352b03 Update crash_reporter_linux.zig 2022-01-03 22:33:19 -08:00
Jarred Sumner
a48c20d470 Update PLCrashReport.m 2022-01-03 22:30:50 -08:00
Jarred Sumner
5fd47bc613 Update PLCrashReport.m 2022-01-03 22:30:20 -08:00
Jarred Sumner
6966d94d90 🔒 2022-01-03 22:26:37 -08:00
Jarred Sumner
5311219de7 dead code 2022-01-03 22:26:24 -08:00
Jarred Sumner
4119f60010 Create crash_reporter_linux.zig 2022-01-03 22:17:41 -08:00
Jarred Sumner
0960f3d6d1 Implement a crash reporter and improve some error handling in bun install 2022-01-03 22:17:34 -08:00
Jarred Sumner
64b49ddd95 fix deinit() 2022-01-03 22:15:45 -08:00
Jarred Sumner
2c27526a34 Update release.sh 2022-01-03 02:20:03 -08:00
Jarred SUmner
fe6b340382 Woops 2022-01-03 02:18:45 -08:00
Jarred SUmner
8148b8824f Improve debugging symbols on Linux 2022-01-03 01:46:11 -08:00
Jarred SUmner
be0c4b5451 [bun install] Reduce number of context switches 2022-01-03 01:42:40 -08:00
Jarred SUmner
168c6138d8 [bun upgrade] Free memory after checking for updates finishes 2022-01-03 01:41:47 -08:00
Jarred SUmner
b9555a5775 [bun install] Significant perf improvement to installing new packages and fixes 'bun install --production'. Closes #97 2022-01-03 01:40:30 -08:00
Jarred Sumner
b78fff9386 Update Dockerfile.base 2022-01-02 17:48:27 -08:00
Jarred Sumner
963c89cab2 LLVM 13 for WebKit 2022-01-02 17:33:21 -08:00
Jarred Sumner
d7ef6efd04 Update WebKit 2022-01-02 17:30:53 -08:00
Jarred Sumner
35fef33868 Update upgrade_command.zig 2022-01-02 16:31:19 -08:00
Jarred Sumner
8a9e81d514 Be a little smarter about sleeping the netwrok thread 2022-01-02 16:29:04 -08:00
Jarred Sumner
b17df61043 [bun dev] Upgrade-Insecure-Requests does not work for detecting HTTPS 2022-01-02 15:32:47 -08:00
Jarred Sumner
4e0cdf34b6 Bump because that CPU bug was bad 2022-01-02 15:29:25 -08:00
Jarred Sumner
a97dec5c30 [bun install] Fix bug that caused lockfile to appear as dirty in git when there were no real changes 2022-01-02 15:28:59 -08:00
Jarred Sumner
ad0834bedb Fix bug where bun uses ~15% of CPU idly 2022-01-02 15:28:20 -08:00
Jarred Sumner
b53c63910d sat 2022-01-02 03:57:50 -08:00
Jarred Sumner
5c0908ee52 Update bundler.zig 2022-01-02 03:57:50 -08:00
luke miles
7f33846005 copy: replace Bun with bun (#99)
Most CLI tools have the style convention of referring to themselves in
lowercase. It is, after all, the name that users type in when using
the tool. This PR maintains that convention in bun.

"Drop the uppercase B, it's cleaner"
2022-01-02 03:09:51 -08:00
Jarred Sumner
4afda10b82 [css] Only warn for tailwind once 2022-01-02 03:04:35 -08:00
Jarred Sumner
cc0e581bc3 [bun upgrade] Add fallback message if there's an error 2022-01-02 02:41:11 -08:00
Jarred Sumner
df1aa76cc5 Update settings.json 2022-01-02 00:22:59 -08:00
Jarred Sumner
a3a2fb1e4f Update http.zig 2022-01-02 00:22:52 -08:00
Jarred Sumner
915dadd9d7 prettier 2022-01-02 00:07:26 -08:00
Jarred Sumner
d899e0ac6f [bun dev] Detect HTTPS via Upgrade-Insecure-Requests 2022-01-02 00:07:17 -08:00
Jarred Sumner
3915e01cfb [bun install] Fix RenameAcrossMountPoints error 2022-01-02 00:06:45 -08:00
Jarred Sumner
2fc6da125f [libarchive] Allow passing a Dir fd instead of always creating a new dir 2022-01-02 00:04:03 -08:00
Jarred Sumner
ba4013816d Update bun.lockb 2022-01-01 20:27:14 -08:00
Jarred Sumner
b64113b7d9 Update bun.lockb 2022-01-01 20:04:09 -08:00
Jarred Sumner
a9483dd8dc Add bun install integration test 2022-01-01 19:48:25 -08:00
Jarred Sumner
5f2fb86a76 install 2022-01-01 19:47:48 -08:00
Jarred Sumner
386ba990bf Fix missing posix_memalign symbol 2022-01-01 19:43:42 -08:00
Jarred Sumner
7f1b5c09de 💅 2022-01-01 19:35:05 -08:00
Jarred Sumner
fcfdd71c06 [bun install] FIx crash when removing only dependency in package.json 2022-01-01 19:31:05 -08:00
Jarred Sumner
73336bbc00 🔒 2022-01-01 19:30:48 -08:00
Jarred Sumner
e7fa50635f Bump versions 2022-01-01 19:30:20 -08:00
Jarred Sumner
fddec80755 [bun-framework-next] Omit the absolute URLs 2022-01-01 18:54:17 -08:00
Jarred Sumner
dac3389b27 Update Dockerfile.base 2022-01-01 18:53:28 -08:00
Jarred Sumner
c952eb7dea Bump zig 2022-01-01 18:47:13 -08:00
Jarred Sumner
6a28cfd2ba [bun dev] Automatically set origin - improve support for proxying Bun
Previously, when running Bun behind a reverse proxy, you had to pass an explicit `--origin` arg and it could only run behind one proxy at a time.

Now, Bun automatically determines the origin from the request if possible. It reads `Forwarded`, `X-Forwarded-Proto`, `X-Forwarded-Host`, `Origin`, and lastly `Host`. If none are available, it falls back to the `--origin` CLI arg.

This change is important for usecases like Replit which shows multiple iframes in different origins.
2022-01-01 18:12:57 -08:00
Jarred SUmner
e4693b8aaf Clear the fd 2022-01-01 03:40:15 -08:00
Jarred SUmner
87e78e2a48 Handle more edgecases 2022-01-01 03:11:36 -08:00
Jarred SUmner
6ac9b5fa9d Bump 2022-01-01 02:37:55 -08:00
Jarred SUmner
71449c8638 Detect fast refresh from .bun if possible 2022-01-01 02:37:08 -08:00
Jarred SUmner
a17088363f [bun dev] Improve filesystem watcher & HMR reliability (Linux + a little macOS)
Text editors like Replit save through atomic file updates. In an inotify filesystem watcher (Linux), that appears to be a delete followed by moving the file to the directory. Now when known files are moved into a directory, the watcher sends the file change notification to the browser(s). From there, the browser looks at it's files to determine whether or not

Additionally, if an existing HMR connection does not know about a file ID passed to it, it asks the browser to reply with the file path and then starts watching that file. This improves HMR reliabiality if Bun had been restarted but the page hadn't been restarted.
2022-01-01 01:53:50 -08:00
Jarred Sumner
83004f0a0a Update build.zig 2021-12-31 18:24:28 -08:00
Jarred Sumner
c42fbbd10e Set to an explicit glibc 2021-12-31 18:23:59 -08:00
Jarred Sumner
d068d80ab9 Attempt to fix watcher issue with repl.it 2021-12-31 17:52:38 -08:00
Jarred Sumner
eb142a6be5 little test 2021-12-31 15:30:57 -08:00
Jarred Sumner
9fde2b28e1 bump 2021-12-31 15:15:09 -08:00
Jarred Sumner
195723180b [devserver] Log more errors when a websocket connection fails 2021-12-31 15:08:58 -08:00
Jarred Sumner
2e051cebaa Update http.zig 2021-12-31 15:08:19 -08:00
Jarred Sumner
795d0b056c [devserver] Case-insensitive request header comparison, which fixes issues with proxying Bun 2021-12-31 15:08:13 -08:00
Jarred Sumner
d7c69d3b78 Add unrolled case insensitive string comparison 2021-12-31 15:07:14 -08:00
Jarred Sumner
059aa425b7 Fix an edgecase that causes a crash in HTTP server 2021-12-31 15:06:06 -08:00
Jarred Sumner
aaf5c28c5b [bun install] Slightly more reliable HTTP 2021-12-31 00:14:24 -08:00
Jarred Sumner
3083bbadc1 Bump peechy again 2021-12-31 00:01:17 -08:00
Jarred Sumner
150ca5d686 woops 2021-12-30 23:57:06 -08:00
Jarred Sumner
58d1e2e1be 12 -> 13 2021-12-30 23:48:23 -08:00
Jarred Sumner
090bae9a94 Update zig version in Dockerfile 2021-12-30 23:36:15 -08:00
Jarred Sumner
113f0427ab Update settings.json 2021-12-30 23:21:10 -08:00
Jarred Sumner
36520d6ec1 [JavaScriptCore] Fix crash due to not requesting JIT permission by patching 2021-12-30 23:21:06 -08:00
Jarred Sumner
2a7d8df4c5 Fix issue with headers 2021-12-30 23:20:19 -08:00
Jarred Sumner
ac6a2bf2e5 fix occasional HTTP bug 2021-12-30 23:20:07 -08:00
Jarred Sumner
3c1cb806d4 Update c.zig 2021-12-30 22:32:41 -08:00
Jarred Sumner
e5587c2b31 Update global.zig 2021-12-30 22:31:41 -08:00
Jarred Sumner
8128c79e81 linux 2021-12-30 22:28:22 -08:00
Jarred Sumner
ae5e2f5af2 Update io_linux.zig 2021-12-30 22:09:51 -08:00
Jarred Sumner
a8b7b2a6b9 Update io_linux.zig 2021-12-30 22:08:14 -08:00
Jarred Sumner
111bef7f06 _ => . 2021-12-30 22:06:45 -08:00
Jarred Sumner
6f1c6fbc1a - => . 2021-12-30 22:05:44 -08:00
Jarred Sumner
31cd05191d Update bun.lockb 2021-12-30 22:04:41 -08:00
Jarred Sumner
efb8c4e36b Remove network_thread 2021-12-30 22:04:35 -08:00
Jarred Sumner
ed71379aa1 linux 2021-12-30 22:04:26 -08:00
Jarred Sumner
b1c3fce49b [internal] Move network_thread into http package 2021-12-30 21:27:27 -08:00
Jarred Sumner
e75c711c68 Upgrade to latest Zig, remove dependency on patched version of Zig (#96)
* Prepare to upgrade zig

* zig fmt

* AllocGate

* Update data_url.zig

* wip

* few files

* just headers now?

* I think everything works?

* Update mimalloc

* Update hash_map.zig

* Perf improvements to compensate for Allocgate

* Bump

* 📷

* Update bun.lockb

* Less branching

* [js parser] Slightly reduce memory usage

* Update js_parser.zig

* WIP remove unused

* [JS parser] WIP support for `with` keyword

* Remove more dead code

* Fix all the build errors!

* cleanup

* Move `network_thread` up

* Bump peechy

* Update README.md
2021-12-30 21:12:32 -08:00
Jarred Sumner
8d031f13c0 zig fmt 2021-12-29 02:49:25 -08:00
Jarred Sumner
42a73f91fe Update Makefile 2021-12-29 02:48:22 -08:00
Jarred Sumner
c508fd9b13 [bun install] Integration test 2021-12-29 02:48:16 -08:00
Jarred Sumner
c62949b98e Update http_bench.zig 2021-12-29 02:34:11 -08:00
Jarred Sumner
0b640c785f Update http_client_async.zig 2021-12-29 02:33:39 -08:00
Jarred Sumner
fe17d51b03 FIx bug in http client 2021-12-29 02:32:57 -08:00
Jarred Sumner
565cf23d92 More defensively search for shells to use if one is not found in the path 2021-12-28 04:04:29 -08:00
Jarred Sumner
020e2e00c3 Update build-id 2021-12-28 03:44:09 -08:00
Jarred Sumner
f4870050e0 Update cli.zig 2021-12-28 03:43:19 -08:00
Jarred Sumner
f31e67b13d woops 2021-12-28 03:42:44 -08:00
Jarred Sumner
6f4d48cc6c [bun run] revert change 2021-12-28 03:35:03 -08:00
Jarred Sumner
fb34ebc674 Update create_command.zig 2021-12-28 03:16:29 -08:00
Jarred Sumner
6c867c34d7 Fix edgecase in bun create tasks 2021-12-28 03:15:53 -08:00
Jarred Sumner
70a56028b6 use c-like functions 2021-12-28 03:04:30 -08:00
Jarred Sumner
08327e2748 Bump 2021-12-28 03:00:17 -08:00
Jarred Sumner
6d6b7f93f3 [bun run] Fix breaking bug 2021-12-28 02:59:50 -08:00
Jarred Sumner
0d95cf8f5b [Bun.js] If you pass a js-like file path to bun with no subcommand, attempt to run it with Bun.js 2021-12-28 02:47:35 -08:00
Jarred Sumner
471f9aec19 [bun run] Fix bug with absolute paths to js-like files 2021-12-28 02:46:50 -08:00
Jarred Sumner
b5beb20e08 dead code 2021-12-28 02:44:32 -08:00
Jarred Sumner
c8b6e2d5cd [bun install] Fix error message for no compatible binaries 2021-12-28 02:44:26 -08:00
Jarred Sumner
8ccb833421 [Bun.js] Add Bun.argv api, so you can get the arguments that started a script 2021-12-28 01:09:46 -08:00
Jarred Sumner
93ec969005 Add zig tests to ci (pr so it runs) (#93)
* WIP

* Create build-base-images.sh

* Update bun.yml

* Update bun.yml

* Update bun.yml

* copy

* Update Dockerfile

* Update Makefile

* Update Makefile

* Update Makefile

* noo

* Update Makefile
2021-12-28 00:05:46 -08:00
Jarred Sumner
5a42b59e91 Update add_completions.zig 2021-12-27 22:29:36 -08:00
Jarred Sumner
266870fee8 add oom workaround 2021-12-27 22:19:47 -08:00
Jarred Sumner
ca5245bb9b 📷 2021-12-27 20:44:37 -08:00
Jarred Sumner
84b3c952d9 backwards 2021-12-27 20:37:15 -08:00
Jarred Sumner
6ef71a800f Update pull.sh 2021-12-27 20:33:49 -08:00
Jarred Sumner
77778aeadf Update build-base.sh 2021-12-27 20:32:50 -08:00
Jarred Sumner
e8275b767e ypo 2021-12-27 20:32:24 -08:00
Jarred Sumner
efdf7fb93e Update build-base.sh 2021-12-27 20:32:00 -08:00
Jarred Sumner
1fd2d26185 use buildx 2021-12-27 20:27:34 -08:00
Jarred Sumner
cac19d9e8b Set platform when pulling 2021-12-27 20:09:22 -08:00
Jarred Sumner
1d03df7d33 Use mimalloc archive file on macOS to work around https://github.com/microsoft/mimalloc/issues/512 2021-12-27 20:03:03 -08:00
Jarred Sumner
90ae5cd897 Update Dockerfile 2021-12-27 19:14:44 -08:00
Jarred Sumner
bb346c8d2b Update build-id 2021-12-27 19:07:47 -08:00
Jarred Sumner
317932204e Add clone-submodules to devcontainer makefile 2021-12-27 19:07:12 -08:00
Jarred Sumner
a48c7e1d83 Update devcontainer 2021-12-27 18:54:38 -08:00
Jarred Sumner
336a4b6ac2 Prepare to run unit tests & remove some dead code (#92)
* Remove some dead code

* 💀 code

* Fix the zig tests

* [JS Printer] Print integers faster & less scientific notation on decimals

* 💀 dead code

* skip

* Run all the unit tests
2021-12-27 18:06:31 -08:00
Jarred Sumner
c9c7521f4f Fix edgecase in bun run where it would choose a directory instead of a file 2021-12-27 04:27:15 -08:00
Jarred Sumner
b455bc467d Fixes #90 2021-12-26 17:04:26 -08:00
Jarred Sumner
d1df057d08 Fix bug with bun add @scoped/package 2021-12-26 16:48:29 -08:00
Jarred Sumner
062aebeba0 Fix zig tests 2021-12-26 16:48:11 -08:00
Jarred Sumner
cff83a3fec Add dead code in build.zig for linking object files 2021-12-26 16:47:59 -08:00
Jarred Sumner
b08d5267cb Update bun-framework-next.yml 2021-12-26 03:21:17 -08:00
Jarred Sumner
1ce37acde6 Update bun.yml 2021-12-26 03:17:39 -08:00
Jarred Sumner
b7cd0c63e5 Update bun.yml 2021-12-26 03:16:40 -08:00
Jarred Sumner
a866da84d9 Update README.md 2021-12-26 03:14:15 -08:00
Jarred Sumner
6908f44aa2 Include docker 2021-12-26 03:13:50 -08:00
Jarred Sumner
181b8a2744 Update bun.yml 2021-12-26 02:48:24 -08:00
Jarred Sumner
5a7bebc8b5 Update Dockerfile 2021-12-26 02:02:14 -08:00
Jarred Sumner
536d6ab302 github actions (#91)
* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update Dockerfile

* switch

* 😯

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* wip

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* cache is broken

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* Update bun.yml

* bust it

* Update Dockerfile

* jm

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update Dockerfile

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* wip

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* Update Makefile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* pass executablePath

* alright

* Update Makefile

* Update Dockerfile

* Update Dockerfile

* Update Makefile

* Update Makefile

* Update Dockerfile

* lets try that

* Update Dockerfile

* Update bun.yml

* hm

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* not interactive

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* simplify this

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* missing

* Update Dockerfile

* Update Dockerfile

* wrong dir

* Update Dockerfile

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* Update bun.yml

* ordering

* Update Dockerfile

* Update bun.yml

* run-test file

* pass github workspace

* hm

* Update bun.yml

* copy the file

* Update run-test.sh

* Update bun.yml

* Update bun.yml

* Update bun.yml

* try this way

* Update bun.yml

* maybe?

* Update bun.yml

* maybe taht's it?

* maybe this

* cache

* up

* Update bun.yml

* Update bun.yml

* try this one i guess

* okay that might do it

* Update Dockerfile

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update chrome.json

* Update chrome.json

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* hm

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* fix caching I think

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* maybe

* Update bun.yml

* fixup

* Update bun.yml

* Update bun.yml

* Update bun.yml

* maybe this time

* Update bun.yml

* Update Dockerfile

* random name

* ok

* explicit runner

* Update bun.yml

* Update bun.yml

* try deleting the files so the layer caching doesn't happen

* 🏃

* Update bun.yml

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Dockerfile.base

* node.js

* Update bun.yml

* Update Dockerfile

* Update Dockerfile.base

* cleanup
2021-12-26 01:40:37 -08:00
Jarred Sumner
99446ffa8a zig 2021-12-24 20:44:36 -08:00
Jarred Sumner
143973e031 Fix rare crash when new thread is created, possibly only on musl 2021-12-24 20:44:25 -08:00
Jarred Sumner
bb5ad6e1ad Cleanup build issues 2021-12-24 20:43:53 -08:00
Jarred Sumner
6ae433249d musl 2021-12-24 03:53:16 -08:00
Jarred Sumner
5f5b824ade prepare to push dockerfile 2021-12-23 22:43:13 -08:00
Jarred Sumner
34abc8116c Typo 2021-12-24 06:34:33 +00:00
Jarred Sumner
1efaaefd63 Update Dockerfile 2021-12-23 22:18:51 -08:00
Jarred Sumner
cfd635786a Clarify 2021-12-24 06:17:14 +00:00
Jarred Sumner
11e3faa8da [bun bun] Improve error mesage when resolving entry point fails 2021-12-24 06:15:44 +00:00
Jarred Sumner
1002990619 Make integration tests more Docker-friendly 2021-12-24 06:15:44 +00:00
Jarred Sumner
a94bbd8f3c [bun create] Run with bun run 2021-12-24 06:15:44 +00:00
Jarred Sumner
46354da728 Add linux aarch64 target to installer 2021-12-24 06:15:44 +00:00
Jarred Sumner
2c7c2b3fa6 Update README.md 2021-12-23 21:13:30 -08:00
Jarred Sumner
938d866c1b 💅 2021-12-23 21:12:19 -08:00
Jarred Sumner
42ff5415ba Merge branch 'main' of github.com:/Jarred-Sumner/bun into main 2021-12-24 04:56:42 +00:00
Jarred Sumner
0e52be8427 Don't send os.MSG_NOSIGNAL 2021-12-24 04:50:27 +00:00
Jarred Sumner
5105614b83 Improve devcontainer environment errors 2021-12-24 04:49:57 +00:00
Jarred Sumner
77fc310a70 Update README.md 2021-12-23 19:59:26 -08:00
Jarred Sumner
3541177d50 typo 2021-12-23 19:58:49 -08:00
Jarred Sumner
3c3ab57cf6 💅 2021-12-23 19:57:47 -08:00
Jarred Sumner
b73e7a9732 Add VSCode devcontainer environment for easy contributing 2021-12-23 18:40:03 -08:00
Jarred Sumner
2047140dda Workaround miscompilation so JavaScriptCore runs on Linux AARCH64 2021-12-23 23:47:12 +00:00
Jarred Sumner
b7e2f6c71a Don't print out bytes in error 2021-12-23 02:02:31 -08:00
Jarred Sumner
e1505d88b1 Prevent crash due to SIGPIPE 2021-12-23 00:43:34 -08:00
Jarred Sumner
d04e5ea0ba [bun-framework-next] Handle edgecase where for some reason the document returned was empty 2021-12-22 22:46:34 -08:00
Jarred Sumner
3ebcd9bbe7 [bun-framework-next] Bump 2021-12-22 22:36:26 -08:00
Jarred Sumner
ab9ccc985a Bump 2021-12-22 22:34:54 -08:00
Jarred Sumner
2188be219e [bun-framework-next] fix ts errors 2021-12-22 22:31:25 -08:00
Jarred Sumner
a34792ce16 [Bun.js] Fix SSR when using fetch 2021-12-22 21:39:05 -08:00
Jarred Sumner
9160c9ae31 Fix spawning child bun processes 2021-12-22 21:37:33 -08:00
Jarred Sumner
8e05fbf43f Fix URL() in bun-framework-next 2021-12-22 21:35:08 -08:00
Jarred Sumner
c59ff7416a Move install above table of contents 2021-12-22 19:24:18 -08:00
Jarred Sumner
c943072193 Merge pull request #87 from alexkuz/patch-2
Add table of contents and tidy up README a bit
2021-12-22 19:23:31 -08:00
Jarred Sumner
d39cc1fb5f Keep it at 1024, but should be okay since we now reduce it 2021-12-22 19:16:47 -08:00
Jarred Sumner
005a0ec931 Update io_darwin.zig 2021-12-22 19:10:41 -08:00
Jarred Sumner
2cfdf29364 Fix error from requesting too much from io_uring 2021-12-22 19:05:39 -08:00
Alexander Kuznetsov
7254c71683 Add table of contents and tidy up README a bit 2021-12-23 01:10:14 +03:00
Jarred Sumner
328534605f ✂️ 💀 code 2021-12-22 02:41:31 -08:00
Jarred Sumner
5eb7383613 Update build-id 2021-12-22 02:41:14 -08:00
Jarred Sumner
75c2f4f394 fix test 2021-12-22 02:40:36 -08:00
Jarred Sumner
6cbe506915 [bun install] Fix bug with >= ranges (and improve test coverage) 2021-12-22 02:38:44 -08:00
Jarred Sumner
3d6ac8face Stack limit detection doesn't really work 2021-12-21 22:58:26 -08:00
Jarred Sumner
14fe014fdf Update Makefile 2021-12-21 22:41:41 -08:00
Jarred Sumner
8f16eeb82a copy-bun-release-dir 2021-12-21 22:31:50 -08:00
Jarred SUmner
84e5072741 WIP dockerfile fix 2021-12-21 22:01:22 -08:00
Jarred Sumner
3f72da9d0b Use Node 14 compatible syntax 2021-12-21 21:56:49 -08:00
Jarred Sumner
873e12c7c6 Add script for building zig 2021-12-21 21:56:01 -08:00
Jarred SUmner
fecfb784ee Run tests 2021-12-21 20:33:36 -08:00
Jarred SUmner
5a7014a418 Slightly safer 2021-12-21 19:44:59 -08:00
Jarred SUmner
ceae7ef672 Slightly less pointer chasing 2021-12-21 19:44:09 -08:00
Jarred SUmner
67b09911c1 Fix crash when TSConfigJSON has an error and multiple TSConfigJSON files were parsed \nThis was caused by reusing the filename buffer inappropriately. For unclear reasons, this only impacted Linux. 2021-12-21 19:43:43 -08:00
Jarred SUmner
3043bb70e1 Update Dockerfile 2021-12-21 19:41:26 -08:00
Jarred Sumner
ff99155f7d --dump-limits flag to inspect what the max file descriptor & stack size is 2021-12-21 18:48:52 -08:00
Jarred Sumner
dc2dae5d87 Update build-id 2021-12-21 18:02:50 -08:00
Jarred Sumner
76eeb5df42 Respect close_handles when extracting a tarball 2021-12-21 17:49:36 -08:00
Jarred Sumner
185a985a85 Update README.md 2021-12-21 17:37:19 -08:00
Jarred Sumner
834e8359ee Don't print bytes in error messages 2021-12-21 17:37:13 -08:00
Jarred Sumner
503f70bba4 Update README.md 2021-12-21 16:57:55 -08:00
Jarred Sumner
c3e45b662a Update README.md 2021-12-21 16:38:20 -08:00
Jarred Sumner
4f16f87b4d Write some docs 2021-12-21 16:35:52 -08:00
Jarred Sumner
9db1a5786d Merge pull request #86 from afonsoduarte/patch-1
Fixes typo in README
2021-12-21 15:59:04 -08:00
Afonso
b9b150f147 Fixes typo in README 2021-12-21 23:53:45 +00:00
Jarred Sumner
0eecec75e2 Update Makefile 2021-12-21 15:22:10 -08:00
Jarred Sumner
581f3540b6 Mention bun install in readme (still writing) 2021-12-21 15:08:11 -08:00
Jarred Sumner
68dabd4d25 Update README.md 2021-12-21 14:13:18 -08:00
Jarred Sumner
59b171db04 Building for Linux AMD64 via Dockerfile works now 2021-12-21 03:03:41 -08:00
Jarred Sumner
e97ebfb036 Update Dockerfile 2021-12-21 02:30:20 -08:00
Jarred Sumner
7380d03e00 Update Dockerfile 2021-12-21 02:15:27 -08:00
Jarred Sumner
5be558ef15 Update Dockerfile 2021-12-21 02:11:32 -08:00
Jarred Sumner
a7116cf353 switch to build arch 2021-12-21 02:06:57 -08:00
Jarred Sumner
3147f69435 Update Dockerfile 2021-12-21 02:04:38 -08:00
Jarred Sumner
0ef9b00dc7 Update .dockerignore 2021-12-21 01:54:54 -08:00
Jarred Sumner
bc05793cbe Delete Dockerfile-zig 2021-12-21 01:54:48 -08:00
Jarred Sumner
fd349f3020 Update Makefile 2021-12-21 01:54:45 -08:00
Jarred Sumner
df5a3c4da4 Add Dockerfile for building Bun 2021-12-21 01:54:42 -08:00
Jarred Sumner
fe415a30c5 Copy-pastable 2021-12-21 01:47:04 -08:00
Jarred Sumner
382208e59c Handle aarch64 vs arm64 2021-12-21 00:13:57 -08:00
Jarred Sumner
ed02a24e0e Update build.zig 2021-12-21 00:12:03 -08:00
Jarred Sumner
e712d3458c Update build.zig 2021-12-21 00:05:47 -08:00
Jarred Sumner
685681dedc system libiconv 2021-12-21 00:03:15 -08:00
Jarred Sumner
b412da6b8a System libiconv 2021-12-21 00:03:04 -08:00
Jarred Sumner
03dc674c2d Prevent linking to glibc 2.3x in release builds 2021-12-20 19:47:33 -08:00
Jarred Sumner
d0bcd3c6fb -static doesn't work 2021-12-20 18:13:39 -08:00
Jarred Sumner
6649218e17 Update dependency.zig 2021-12-20 17:56:22 -08:00
Jarred Sumner
453fae4a5c [bun install] Strip leading v in versions 2021-12-20 17:52:50 -08:00
Jarred Sumner
3f32222360 Update makefile to better support building JavaScriptCore on Linux 2021-12-20 17:18:05 -08:00
Jarred Sumner
479705e8ce Fix error 2021-12-20 01:49:39 -08:00
Jarred Sumner
e8fc9d5c9b Set macOS min flags 2021-12-20 00:59:21 -08:00
Jarred Sumner
38d3b200b5 Update cli.zig 2021-12-20 00:00:04 -08:00
Jarred Sumner
a0551a9b8b Autocomplete popular package names (thanks @evanwashere) 2021-12-19 23:30:25 -08:00
Jarred Sumner
be03fc273a Move folder_resolver to a separate file 2021-12-19 17:31:29 -08:00
Jarred Sumner
ab496e9e34 Remove duplicate code 2021-12-19 17:31:10 -08:00
Jarred Sumner
81e7576150 Fix error and fix ../ 2021-12-19 17:09:19 -08:00
Jarred Sumner
2e69f15c20 Relative paths outside project 2021-12-19 14:48:12 -08:00
Jarred Sumner
0c7b35d0ab [bun install] Support file: protocol for installing folders as packages 2021-12-19 14:38:32 -08:00
Jarred Sumner
e12f10ae0e [bun install] More git protocols are valid 2021-12-19 14:37:43 -08:00
Jarred Sumner
961b704a8e Update install.zig 2021-12-18 23:40:48 -08:00
Jarred Sumner
4ee8055f17 Show help text when no options 2021-12-18 23:29:39 -08:00
Jarred Sumner
394335fa91 Update bun.fish 2021-12-18 23:06:07 -08:00
Jarred Sumner
8125c05be0 Update fish completions 2021-12-18 23:04:31 -08:00
Jarred Sumner
059f01d23a Add new zsh completions 2021-12-18 21:44:17 -08:00
Jarred Sumner
5f80f9c814 cross-promotion 2021-12-18 21:36:12 -08:00
Jarred Sumner
0cee57f1d9 Merge pull request #80 from Jarred-Sumner/jarred/npm-install
bun install
2021-12-18 21:07:07 -08:00
Jarred Sumner
eab99b3bae Remove references to s2n 2021-12-18 21:06:15 -08:00
Jarred Sumner
a1e1509358 Create .gitattributes 2021-12-18 21:03:31 -08:00
Jarred Sumner
39d8b0c8c1 cleanup 2021-12-18 21:03:26 -08:00
Jarred Sumner
1356029bea [bun install] Ignore peer dependencies for root packages 2021-12-18 20:39:53 -08:00
Jarred Sumner
b8af8a1af0 Update Makefile 2021-12-18 20:33:47 -08:00
Jarred Sumner
06c79cffae 💅 2021-12-18 20:25:02 -08:00
Jarred Sumner
430fe09d6d Delete synchronous HTTP client! 2021-12-18 20:23:10 -08:00
Jarred Sumner
5455c71f93 fix build issue on macOS 2021-12-18 20:03:09 -08:00
Jarred Sumner
e2d6c692c4 Use new http in bun upgrade 2021-12-18 20:03:00 -08:00
Jarred Sumner
501fab0bef 2x - 5x faster bun create 2021-12-18 20:02:33 -08:00
Jarred Sumner
1f1c337eb6 no more hop 2021-12-18 17:54:07 -08:00
Jarred Sumner
1c9131a5d7 Not using hop! 2021-12-18 17:50:35 -08:00
Jarred Sumner
fb758a32e1 Update Makefile 2021-12-17 23:07:01 -08:00
Jarred Sumner
d4c55557c3 Implement hop archive format 2021-12-17 23:06:56 -08:00
Jarred Sumner
0e39174c48 Update the misctools bins 2021-12-17 16:59:49 -08:00
Jarred Sumner
40401a6ed2 Update build-id 2021-12-17 16:12:33 -08:00
Jarred SUmner
74ea36ac1c WIP hop 2021-12-17 15:47:24 -08:00
Jarred Sumner
2d48674c5b bindings 2021-12-17 02:44:55 -08:00
Jarred Sumner
42c7d887d3 👶event loop 2021-12-17 02:44:35 -08:00
Jarred Sumner
8dcaaa9e09 packaging 2021-12-17 02:43:43 -08:00
Jarred Sumner
267e926a38 [internal] Use more packages 2021-12-17 02:42:55 -08:00
Jarred Sumner
11e6ffaae9 Update launch.json 2021-12-16 19:18:51 -08:00
Jarred Sumner
6a5dd6ed58 Update build.zig 2021-12-16 19:18:51 -08:00
Jarred Sumner
bcd68b937d wip 2021-12-16 19:18:51 -08:00
Jarred Sumner
9fab7ca06c Add some timestamps 2021-12-16 19:18:51 -08:00
Jarred Sumner
4082a34599 Update install.zig 2021-12-16 19:18:51 -08:00
Jarred Sumner
f9debc72fa Print specifically installed packages 2021-12-16 19:18:51 -08:00
Jarred Sumner
b363402f45 [bun install] Support linking binaries & native binaries 2021-12-16 19:18:51 -08:00
Jarred Sumner
b0942fbc37 [bun install] Fix edgecase with optional peer deps 2021-12-16 19:18:51 -08:00
Jarred Sumner
e3a12ea1a9 [bun install] Fix bun add so it writes the resolved version to package.json 2021-12-16 19:18:51 -08:00
Jarred Sumner
5dd6fb8547 [bun install] Add clonefile_each_dir and hardlink backend for copying files 2021-12-16 19:18:51 -08:00
Jarred Sumner
8586d2e41c [bun install] Support dependencies prefixed with "npm:" 2021-12-16 19:18:51 -08:00
Jarred Sumner
ba1e95fd43 [bun install] Hoisting works! 2021-12-16 19:18:51 -08:00
Jarred Sumner
e7538d7b26 document failed Link tag experiment in script src 2021-12-16 19:18:51 -08:00
Jarred Sumner
2b7ebaceb2 wip slow hoister 2021-12-16 19:18:51 -08:00
Jarred Sumner
3de3c3c143 [bun install] Allow skipping peer, optional, and dev dependency installs. Hoisting 2021-12-16 19:18:51 -08:00
Jarred Sumner
0e0e325e5b [bun install] optionalDependencies override dependencies if both specified 2021-12-16 19:18:51 -08:00
Jarred Sumner
e97106c770 [bun install] order() and fmt() 2021-12-16 19:18:51 -08:00
Jarred Sumner
50f8e0daa8 [bun install] Improve test coverage for tilda version ranges 2021-12-16 19:18:51 -08:00
Jarred Sumner
efcf846b2c [bun install] Fix bug with ~Tilda 2021-12-16 19:18:51 -08:00
Jarred Sumner
afe3e13345 [bun install] Fix bug with optional peer deps 2021-12-16 19:18:51 -08:00
Jarred Sumner
461c769ac4 Track peer dependencies but don't install them 2021-12-16 19:18:51 -08:00
Jarred Sumner
0dc0d6c31c Update npm.zig 2021-12-16 19:18:51 -08:00
Jarred Sumner
49d8ea4886 [bun install] Fix case when lockfile exists 2021-12-16 19:18:51 -08:00
Jarred Sumner
e66776a79f Slightly better progress bar 2021-12-16 19:18:51 -08:00
Jarred Sumner
3036cbe552 bun add and bun remove sorta works now. but not fast enough! 2021-12-16 19:18:51 -08:00
Jarred Sumner
393aa076bc [bun install] Most of bun add, bun remove 2021-12-16 19:18:51 -08:00
Jarred Sumner
0ef6f81843 Add some progress feedback 2021-12-16 19:18:51 -08:00
Jarred Sumner
339fe00dfe CLI flags 2021-12-16 19:18:51 -08:00
Jarred Sumner
6382bb5333 [bun install] Start add/remove command 2021-12-16 19:18:51 -08:00
Jarred Sumner
41c60fb848 [bun install] move around some code 2021-12-16 19:18:51 -08:00
Jarred Sumner
8df49bc823 Update install.zig 2021-12-16 19:18:51 -08:00
Jarred Sumner
ab4129061e [bun install] Deduplicate packages by default 2021-12-16 19:18:51 -08:00
Jarred Sumner
021a670d86 Fix bug with ~tilda ranges 2021-12-16 19:18:51 -08:00
Jarred Sumner
fa27551428 [bun install] Install top-level node_modules 2021-12-16 19:18:51 -08:00
Jarred Sumner
538243dc3b [bun install] Deterministic lockfile and simple installs 2021-12-16 19:18:51 -08:00
Jarred Sumner
d83c610002 [bun install] Support printing yarn.lock 2021-12-16 19:18:51 -08:00
Jarred Sumner
196f7eb101 Update launch.json 2021-12-16 19:18:51 -08:00
Jarred Sumner
a1167d80b2 Update .gitignore 2021-12-16 19:18:51 -08:00
Jarred Sumner
a765b13f52 [bun install] Add some config flags 2021-12-16 19:18:51 -08:00
Jarred Sumner
45b3e9d03c [bun install] Shrink binary format size by 2.5x 2021-12-16 19:18:51 -08:00
Jarred Sumner
5844166047 [bun install] Load lockfile. Generate diffs 2021-12-16 19:18:51 -08:00
Jarred Sumner
c6dcc1cd9e [bun install] Lockfile saves. Starting to implement diffing 2021-12-16 19:18:51 -08:00
Jarred Sumner
118ed4d2ab [bun install] Generate a lockfile 2021-12-16 19:18:51 -08:00
Jarred Sumner
9fcd2c53c8 [JSON parser] const has better codegen (unlike in JavaScript!) 2021-12-16 19:18:51 -08:00
Jarred Sumner
da80830bc5 Mimalloc cleanup 2021-12-16 19:18:51 -08:00
Jarred Sumner
b060056480 Update memory_allocator.zig 2021-12-16 19:18:51 -08:00
Jarred Sumner
b71df3a3d4 Bump mimalloc 2021-12-16 19:18:51 -08:00
Jarred Sumner
128e9861f9 [bun install] Most of the Lockfile format (not done yet) 2021-12-16 19:18:51 -08:00
Jarred Sumner
5d2cb27562 Start to restructure code 2021-12-16 19:18:51 -08:00
Jarred Sumner
75e340bfbf Resolve peer dependencies & optional dependencies too 2021-12-16 19:18:51 -08:00
Jarred Sumner
b5744e5da4 save and load manifest 2021-12-16 19:18:51 -08:00
Jarred Sumner
7bad5770a1 Channel seems faster or maybe the same? 2021-12-16 19:18:51 -08:00
Jarred Sumner
809c1e46d8 [npm install] starting to look good! 2021-12-16 19:18:51 -08:00
Jarred Sumner
c056093125 WIP 2021-12-16 19:18:51 -08:00
Jarred Sumner
88ea1de80f 📻 2021-12-16 19:18:51 -08:00
Jarred Sumner
7c8a835fa0 fix build 2021-12-16 19:18:51 -08:00
Jarred Sumner
c6317888da Fix redirects 2021-12-16 19:18:51 -08:00
Jarred Sumner
9f1946ce70 [npm install] Use BoringSSL for https:// requests 2021-12-16 19:18:51 -08:00
Jarred Sumner
32be2866f6 Replace S2N with BoringSSL (wip) 2021-12-16 19:18:51 -08:00
Jarred Sumner
448d60ebbf Update Makefile 2021-12-16 19:18:51 -08:00
Jarred Sumner
c536370ab8 [internal] readlink 2021-12-16 19:18:51 -08:00
Jarred Sumner
dccc6bf1af [http_debug] Pretty print 2021-12-16 19:18:51 -08:00
Jarred SUmner
e331ebbf7d [bun install] Linux async http 2021-12-16 19:18:51 -08:00
Jarred Sumner
b1660fa468 [bun install] async http request works I think? 2021-12-16 19:18:51 -08:00
Jarred Sumner
4af743766d [bun install] Begin to add io_uring (via tigerbeetle/@kprotty's interface) 2021-12-16 19:18:51 -08:00
Jarred Sumner
8f35f16c7e [libarchive] Fix occasional segfault 2021-12-16 19:18:51 -08:00
Jarred Sumner
e08710e373 [bun install] Resolve more packages 2021-12-16 19:18:51 -08:00
Jarred Sumner
48b9af1298 [bun install] Track build/pre tags with a bitset 2021-12-16 19:18:51 -08:00
Jarred Sumner
cec59bc580 don't need sleep since not a universal binary anymore 2021-12-16 19:18:51 -08:00
Jarred Sumner
dff23f5a7b wip 2021-12-16 19:18:51 -08:00
Jarred Sumner
bcdff7f6f0 [bun install] Support dist-tags 2021-12-16 19:18:51 -08:00
Jarred Sumner
49dbf79e81 WIP 2021-12-16 19:18:51 -08:00
Jarred Sumner
1610ff33ea [bun install] some things install 2021-12-16 19:18:51 -08:00
Jarred Sumner
b5fd121f26 [bun install] WIP 2021-12-16 19:18:51 -08:00
Jarred Sumner
c292ea7b94 [bun install] WIP 2021-12-16 19:18:51 -08:00
Jarred Sumner
de56f3a562 [bun install] WIP 2021-12-16 19:18:51 -08:00
Jarred Sumner
94e469c803 [bun install] WIP 2021-12-16 19:18:51 -08:00
Jarred Sumner
0d369baf9d [bun install] implement serialization/deserialization of package versions in an efficient binary format
This is most of the code but does not compile yet
2021-12-16 19:18:51 -08:00
Jarred Sumner
0ab00df154 [bun install] Make Semver serializable 2021-12-16 19:18:51 -08:00
Jarred Sumner
6167d95167 Update string_immutable.zig 2021-12-16 19:18:51 -08:00
Jarred Sumner
d582e42d4d wip 2021-12-16 19:18:51 -08:00
Jarred Sumner
6da14ae310 wip 2021-12-16 19:18:51 -08:00
Jarred Sumner
442f85e89e [bun install] support hyphen ranges in node-semver 2021-12-16 19:18:51 -08:00
Jarred Sumner
8cf8bf441e [bun install] node-semver works excluding hyphen ranges 2021-12-16 19:18:51 -08:00
Jarred Sumner
2cc25f64f2 [bun install] Add tests for parsing Semver versions 2021-12-16 19:18:51 -08:00
Jarred Sumner
035008cd9d [bun install] node-semver implementation (doesn't run yet) 2021-12-16 19:18:51 -08:00
Jarred Sumner
e7f1ff14d6 [bun install] Begin to port my golang node-semver to Zig 2021-12-16 19:18:51 -08:00
Jarred Sumner
c092d2ba70 Update snippets.json 2021-12-16 19:18:30 -08:00
Jarred Sumner
d1783babd9 📷 2021-12-16 18:32:48 -08:00
Jarred Sumner
7519f364e5 Update README.md 2021-12-16 18:26:40 -08:00
Jarred Sumner
7f9ab7dfce ICU should be in deps 2021-12-16 18:25:59 -08:00
Jarred Sumner
f9d87f28f6 Update build-id 2021-12-16 18:16:28 -08:00
Jarred Sumner
dd7225fb2a Add regression test for try / catch with import & require 2021-12-16 18:14:41 -08:00
Jarred Sumner
134748a238 [transpiler] Partially support top-level await in HMR 2021-12-16 18:14:06 -08:00
Jarred Sumner
b57d890cbd Update bundler.zig 2021-12-16 18:01:07 -08:00
Jarred Sumner
50163e1385 Disable imports which are not found 2021-12-16 17:57:44 -08:00
Jarred Sumner
fde4cd4d17 Enable top-level await in browsers 2021-12-16 17:57:13 -08:00
Jarred Sumner
b6e164355b [JS parser] Track import records that were converted to star imports due to require 2021-12-16 17:57:03 -08:00
Jarred Sumner
2e9af40bca [transpiler] Don't insert import statements for disabled require() 2021-12-16 17:56:32 -08:00
Jarred Sumner
2f45c3d2cd Update Makefile 2021-12-16 15:37:38 -08:00
Jarred Sumner
d763c0ab4e Bump again I guess 2021-12-16 15:37:32 -08:00
Jarred Sumner
baa93d4b37 📷 2021-12-16 03:42:28 -08:00
Jarred Sumner
dd7659c643 Print errors below warnings 2021-12-16 02:42:09 -08:00
Jarred Sumner
aed6f89772 [bun bun] Fix a race condition introduced in #55ff681976f7bae5a428c409061991c07fa492e7 2021-12-16 02:41:47 -08:00
Jarred Sumner
39af1ccc7c Update js_printer.zig 2021-12-16 01:48:50 -08:00
Jarred Sumner
52f4ba767a [http] Fix bug with Link header 2021-12-16 01:48:31 -08:00
Jarred Sumner
0f853a2fee Update js_printer.zig 2021-12-16 01:33:07 -08:00
Jarred Sumner
ca807afba2 📷 2021-12-16 01:31:09 -08:00
Jarred Sumner
e349e54cb8 bump build id 2021-12-16 01:31:01 -08:00
Jarred Sumner
39218ec0f7 [macros] Do not automatically load node_modules.bun in macros 2021-12-16 01:30:54 -08:00
Jarred Sumner
908d9d86b3 [macros] Slightly improve error message if macros fail to load 2021-12-16 01:30:23 -08:00
Jarred Sumner
92f3efeac2 [bundler][JS transpiler] Improve reliability of ESM <> CommonJS interop
This fixes a number of issues caused by not using live bindings when referencing bundled code. This also fixes an issue with libraries looping over `Object.keys(moduleNamespace)`
2021-12-16 01:29:45 -08:00
Jarred Sumner
a772b56cb6 [http] Ensure errors from macros can see source code 2021-12-16 00:47:24 -08:00
Jarred Sumner
bd6b9a58d3 [internal] disable debug workaround 2021-12-16 00:44:39 -08:00
Jarred Sumner
873cacc15a [bundler] Fix edgecase where certain modules would load unbundled versions
Some packages have many `package.json` files with no `name` in them, often to indicate `sideEffects` or change `exports`.

When bundling node_modules, we need a name to map a package back to the list of bundled packages.
2021-12-16 00:43:39 -08:00
Jarred Sumner
55ff681976 [resolver] Change extension order based on import kind 2021-12-16 00:41:23 -08:00
Jarred Sumner
618ecdb76c [resolver] When importing from an ES Module, prefer .{m,c}{t,j}s 2021-12-16 00:39:49 -08:00
Jarred Sumner
8af6ad7278 wip fix live bindings 2021-12-15 17:08:04 -08:00
Jarred Sumner
c07de8c4d3 [JS transpiler] Simplify CommonJS interop callback 2021-12-15 17:08:04 -08:00
Jarred Sumner
e10fe8aaad [JS transpiler] Ensure reserved words don't end up in nonUniqueIdentifier() 2021-12-15 17:08:04 -08:00
Jarred Sumner
feb45edf6d [JS Parser] Add regression test 2021-12-15 16:58:41 -08:00
Jarred Sumner
0a916543b3 [JS Parser] Fix bug with template literals that create new scopes in the tag and the template literal value 2021-12-15 16:52:38 -08:00
Jarred Sumner
2c53ff2980 Add a resource hint for preloading node_modules.bun and route asset in the fallback rendering 2021-12-11 15:58:16 -08:00
Jarred Sumner
b2fcc027a9 [resolver] Do not throw on require()/import errors when they're caught (and import is an await target) 2021-12-04 03:26:14 -08:00
Jarred Sumner
1dc78ba4b7 Bump 2021-11-26 00:13:00 -08:00
Jarred Sumner
04e0910dea Fix occasional segfault when parsing JSON in http server 2021-11-25 17:17:17 -08:00
Jarred Sumner
d19a6199ea Revert "Merge pull request #70 from Jarred-Sumner/lithdew/picohttp-mimalloc"
This reverts commit e8925e47b0, reversing
changes made to f82aa92c38.
2021-11-25 17:08:22 -08:00
Jarred Sumner
e8925e47b0 Merge pull request #70 from Jarred-Sumner/lithdew/picohttp-mimalloc 2021-11-24 13:16:26 -08:00
Kenta Iwasaki
cc712668f0 mimalloc: patch malloc/free 2021-11-24 21:05:15 +00:00
Kenta Iwasaki
f7dbf5ac38 deps: add missing mimalloc dep to jsc bindings header generator 2021-11-24 17:26:02 +00:00
Kenta Iwasaki
283a01493c deps: build picohttp and mimalloc using zig
Reduce the amount of dependencies which need to be externally built
before Bun can be built.

Remove clause to enforce that Bash syntax is used in Makefile, as the
clause only works on a few Linux distros which assume bash is located at
/bin/bash.
2021-11-24 17:09:54 +00:00
Jarred Sumner
f82aa92c38 Merge pull request #65 from Jarred-Sumner/bun-framework-next-actions
Begin working on CI tasks for bun-framework-next
2021-11-23 16:35:45 -08:00
Jack Hanford
7660f72745 update Next version on global 2021-11-23 16:55:26 -05:00
Jarred Sumner
4e4f2058c2 Update build-id 2021-11-23 13:54:41 -08:00
Jack Hanford
ca25e32c0f fix shallow routing 2021-11-23 16:23:31 -05:00
Jack Hanford
5a1f60c729 remove comment 2021-11-23 11:05:05 -05:00
Jack Hanford
ac242f94ca add react-dom as devDep 2021-11-23 10:53:44 -05:00
Jack Hanford
9ab9b01a64 stop installing textencoder 2021-11-23 10:51:08 -05:00
Jack Hanford
cdeb39bd7f begin addressing more feedback 2021-11-23 10:42:04 -05:00
Jack Hanford
1d01ffeb9e remove .then 2021-11-22 22:19:53 -05:00
Jack Hanford
25a49005cc another try 2021-11-22 21:58:35 -05:00
Jack Hanford
875b60dfe5 add type fns 2021-11-22 21:55:57 -05:00
Jack Hanford
c071037485 try adding lib.ts 2021-11-22 21:52:28 -05:00
Jack Hanford
4edfa171f0 update copy 2021-11-22 21:28:23 -05:00
Jack Hanford
0eb3cdc43c add typechecking to action 2021-11-22 21:27:51 -05:00
Jack Hanford
f747fd9dfa ts-expect-error the remaining ts-errors 2021-11-22 21:25:57 -05:00
Jack Hanford
c06e34c687 misc 2021-11-22 10:23:14 -08:00
Jack Hanford
7f62169b5e add prettier to root 2021-11-22 10:21:29 -08:00
Jack Hanford
5b2c7ad1f3 another try 2021-11-22 10:21:29 -08:00
Jack Hanford
c535cd7613 remove filter from action 2021-11-22 10:21:29 -08:00
Jack Hanford
6e21c9927c remove workspace caching 2021-11-22 10:21:29 -08:00
Jack Hanford
c3d9804e85 reset file 2021-11-22 10:21:29 -08:00
Jack Hanford
30c79875a3 remove pnpm-workspace 2021-11-22 10:21:29 -08:00
Jack Hanford
a79153f6e0 remove unused proxy shim 2021-11-22 10:21:29 -08:00
Jack Hanford
87319ba73d remove export from empty 2021-11-22 10:21:29 -08:00
Jack Hanford
cb18bf7e5d begin working on renderDocument 2021-11-22 10:21:29 -08:00
Jack Hanford
304a36b814 fix lockfile 2021-11-22 10:21:29 -08:00
Jack Hanford
6ee673095c continue fixing typescript errors 2021-11-22 10:21:28 -08:00
Jack Hanford
cf4964c8f4 add empty.js 2021-11-22 10:21:28 -08:00
Jack Hanford
a1b88e85fd mv empty.tsx -> empty.js 2021-11-22 10:21:27 -08:00
Jack Hanford
46a8215092 consolidate empty files / references to one empty.tsx 2021-11-22 10:21:14 -08:00
Jack Hanford
62694f0ee9 add typescript checking 2021-11-22 10:20:47 -08:00
Jack Hanford
e8bdf1c7db move into workflows folder 2021-11-22 10:20:47 -08:00
Jack Hanford
2af4192756 begin working on CI tasks for bun-framework-next 2021-11-22 10:20:47 -08:00
Jarred Sumner
fd80d0a22d Fix loading CSS benchmark 2021-11-21 17:30:50 -08:00
Jarred Sumner
86743ab361 Bump bun-framework-next 2021-11-21 17:04:18 -08:00
Jarred Sumner
cca8081f2e add env var for disabling bun.js SSR 2021-11-21 17:02:21 -08:00
Jarred Sumner
5c5b246cc3 [bun-framework-next] Fix React 18 in fallback mode 2021-11-21 16:58:50 -08:00
Jarred Sumner
469a36e3b6 [HMR] Large perf improvement for JS hot reloads at runtime
From benchmarking, I noticed that a lot of time was spent running
`HMRModule.update()`.

We don't need to call that function if updates for the same module ID have not changed any exports
2021-11-21 03:52:14 -08:00
Jarred Sumner
f9d333bec2 Merge pull request #68 from mfeckie/docs/dev
Docs/dev
2021-11-19 17:54:01 -08:00
Martin Feckie
38879cd3d9 Add information about code signing 2021-11-20 09:44:41 +08:00
Martin Feckie
eb3123adb8 Add information about node modules 2021-11-20 08:54:31 +08:00
Jarred Sumner
2b4f20b94c Update build-id 2021-11-16 21:28:00 -08:00
Jarred Sumner
19949c0743 Update fixtures.zig 2021-11-16 21:26:41 -08:00
Jarred Sumner
8d03e0cf02 [router] Improve test coverage & handle case-sensitive static routes better 2021-11-16 21:26:37 -08:00
Jarred Sumner
265b1035f4 [router] Fix case sensitivity bug with route params 2021-11-16 16:57:02 -08:00
Jarred Sumner
8e0230b756 [router] Tweak sorting order & update routing tests 2021-11-16 16:33:33 -08:00
Jarred Sumner
478273e044 [router] Update router tests 2021-11-16 15:34:22 -08:00
Jarred Sumner
d0c2f5495c [internal] Fix issue with tests 2021-11-16 15:34:09 -08:00
Jarred Sumner
4a09ad51f0 [router] Fix bug with dynamic route params for route segments in the middle 2021-11-16 15:32:50 -08:00
Jarred Sumner
5bef1b46d3 [router] small cleanup 2021-11-16 15:31:47 -08:00
Jarred Sumner
3bec430192 [router] Fix edgecase with trailing slashes in directory path 2021-11-16 15:29:52 -08:00
Jarred Sumner
18f0093b18 📷 Snapshots 2021-11-15 15:59:13 -08:00
Jarred Sumner
adfaa21d03 [examples] React 18 is now beta 2021-11-15 15:59:03 -08:00
Jarred Sumner
01d1f1d258 Fix #66
embarassing!
2021-11-15 15:51:39 -08:00
Jarred Sumner
4e775d275c [bun dev] When --disable-bun.js flag is passed, don't send 500s for rendering the fallback 2021-11-15 15:47:28 -08:00
Jarred Sumner
035f6fe5e1 Bump 2021-11-15 15:40:12 -08:00
Jarred Sumner
bba74499e5 [JS Printer] Don't escape slashes 2021-11-15 15:39:21 -08:00
Jarred Sumner
b61cbb1df8 [internal] const is faster than var (in Zig! not javascript) 2021-11-15 15:39:13 -08:00
Jarred Sumner
1a60d7df98 [JS Printer] Fix bug with template literals 2021-11-15 15:38:49 -08:00
Jarred Sumner
89a7e3bf2f slightly reduce reallocations 2021-11-11 15:52:50 -08:00
Jarred Sumner
fe1a6cee10 [JSON Parser] Improve perf by 2%-4%
We warn when a JSON object has duplicate keys, but detecting duplicate keys has a cost. Now the hash table used for deduping keys is pooled instead of reallocated each time

This also removes a call to potentially resize object properties and arrays to their smallest possible size. Resizing an array can be expensive
2021-11-11 15:33:39 -08:00
Jack Hanford
6a66d9f7fb Merge pull request #64 from Jarred-Sumner/unused-vars 2021-11-10 16:08:24 -08:00
Jarred Sumner
fadbcca99c Update README.md 2021-11-10 15:48:02 -08:00
Jack Hanford
0b48e7272d remove a bunch of dead code / unused variables 2021-11-10 14:53:48 -08:00
Jarred Sumner
23bdc6f792 fixup 2021-11-09 15:50:10 -08:00
Jarred Sumner
de7274fcff fix linux build 2021-11-09 15:39:16 -08:00
Jarred Sumner
b126392a8e Fix missing symbol error for pre-macOS 11 2021-11-09 14:13:58 -08:00
Jarred Sumner
d2a9e31fd3 Bump 2021-11-09 13:05:19 -08:00
Jarred Sumner
6d61bcc4e1 Merge pull request #63 from KishanBagaria/kb/fix-catalina
clang: add -mmacosx-version-min flag
2021-11-09 13:04:12 -08:00
Kishan Bagaria
d8e3ca4a88 clang flags: add -mmacosx-version-min flag
fixes #55
2021-11-09 21:47:36 +05:30
Jarred Sumner
351184991a 📷 2021-11-08 17:42:18 -08:00
Jarred Sumner
14b51ef57c Disable Object.freeze 2021-11-08 15:53:37 -08:00
Jarred Sumner
7a836382b3 [bun-framework-next] Use WeakSet for slightly better perf 2021-11-08 15:49:28 -08:00
Jarred Sumner
360dec4fb9 Merge pull request #61 from Jarred-Sumner/tweak-bun-framework-next
Rename polyfills, polyfill Object.feeze
2021-11-08 15:47:58 -08:00
Jack Hanford
83cf1be2b9 tweak 2021-11-08 15:42:30 -08:00
Jarred Sumner
241525947c [JS Printer] Fix bug with optional chain 2021-11-08 15:37:31 -08:00
Jack Hanford
76a99eaa18 use new name 2021-11-08 13:59:53 -08:00
Jack Hanford
4bceb57ad1 rename polyfills, polyfill Object.feeze 2021-11-08 13:58:25 -08:00
Jarred Sumner
c7705a6325 Merge branch 'main' of github.com:Jarred-Sumner/bun 2021-11-07 17:00:03 -08:00
Jarred Sumner
4f78e2c47c Update Makefile 2021-11-07 17:00:00 -08:00
Jarred Sumner
6789aed119 Merge pull request #60 from Jarred-Sumner/remove-empty-file
Remove another empty file
2021-11-07 16:00:22 -08:00
Jack Hanford
291f26cba0 remove another empty file 2021-11-07 15:58:29 -08:00
Jarred Sumner
a3458ce6e3 Update package.json 2021-11-07 15:55:04 -08:00
Jarred Sumner
a7eb5397a4 Add main/module to bun-framework-next 2021-11-07 15:54:20 -08:00
Jarred Sumner
fc03ed2969 Merge pull request #59 from Jarred-Sumner/react-refresh
add react-refresh as a devDep for bun-framework-next
2021-11-07 15:47:57 -08:00
Jack Hanford
12f1991771 add react-refresh as a devDep for bun-framework-next 2021-11-07 15:44:30 -08:00
Jarred Sumner
57946e114c Merge branch 'main' of github.com:Jarred-Sumner/bun 2021-11-07 14:45:08 -08:00
Jarred Sumner
8b3463e73f [bun run] Remove unnecessary code 2021-11-07 14:45:06 -08:00
Jarred Sumner
3cb7dbe921 [resolver] Fix race condition that can cause the elapsed counter to integer overflow 2021-11-07 14:44:55 -08:00
Jarred Sumner
d11102d858 Merge pull request #58 from Jarred-Sumner/next-cleanup
misc cleanup for bun-framework-next
2021-11-07 13:18:30 -08:00
Jack Hanford
183911514a misc cleanup for bun-framework-next 2021-11-07 11:46:22 -08:00
Jarred Sumner
bc3c17ffc8 Improve ZSH completions 2021-11-07 02:41:26 -08:00
Jarred Sumner
3379289024 [bun run] Filter out builtin commands from showing up at the top 2021-11-07 02:39:31 -08:00
Jarred Sumner
562a8df46b [bun run] Filter out js files that start with . from completions 2021-11-07 02:39:01 -08:00
Jarred Sumner
68e2869d64 [bun run] Filter out post* and pre* from the completions 2021-11-07 02:38:38 -08:00
Jarred Sumner
c6818cc55c [zsh] Better zsh completions install dir guessing 2021-11-07 02:38:09 -08:00
Jarred Sumner
08b3bab2ec [internal] Generated files 2021-11-06 19:25:12 -07:00
Jarred Sumner
34771aad22 [build] Improve error messages for build failures 2021-11-06 19:24:04 -07:00
Jarred Sumner
109d53d461 [macOS] Fix minimum OS target
Closes https://github.com/Jarred-Sumner/bun/issues/55
2021-11-06 19:23:15 -07:00
Jarred Sumner
958520f557 Debug snapshots 2021-11-06 19:22:13 -07:00
Jarred Sumner
12c311da3f [internal] Fix make release on macOS arm64 2021-11-06 18:43:08 -07:00
Jarred Sumner
d7d9df726b [internal] Use a better timer for measuring parsing & resolving timings 2021-11-06 18:42:42 -07:00
Jarred Sumner
a368182769 Update Makefile 2021-11-05 17:32:00 -07:00
Jarred Sumner
2a9fd30d36 [internal] Fix the CLI flag for building with JIT permissions 2021-11-05 17:30:57 -07:00
Jarred Sumner
082a944e0b Update README.md 2021-11-05 16:11:37 -07:00
Jarred Sumner
e1b68665db Update build-id 2021-11-05 04:11:34 -07:00
Jarred Sumner
c64ef1e2f4 [resolver] Fix bug with package.json "exports" resolution with a suffix after the wildcard 2021-11-05 04:10:43 -07:00
Jarred Sumner
3063c2e64d [resolver] Add test for "exports" field with a pattern foo/*.js 2021-11-05 04:10:15 -07:00
Jarred Sumner
38f46169d9 📷 Snapshots 2021-11-05 04:09:41 -07:00
Jarred Sumner
c1aa0323dc [bun run] Fix issue with \\" \\" in scripts 2021-11-05 04:09:27 -07:00
Jarred Sumner
673b755987 Update README.md 2021-11-05 02:52:16 -07:00
Jarred Sumner
3d6fab6e49 📷 Snapshots 2021-11-05 01:33:09 -07:00
Jarred Sumner
d0823beef5 Update run_command.zig 2021-11-05 01:23:07 -07:00
Jarred Sumner
b0e98892e5 [bun run] Exclude .config.* files from showing up as runnable with Bun.js 2021-11-05 01:22:48 -07:00
Jarred Sumner
0006d28cbb 📷 Snapshots 2021-11-05 01:16:19 -07:00
Jarred Sumner
42dcc4e217 Bump 2021-11-05 01:15:43 -07:00
Jarred Sumner
13582981e4 Update bun.fish 2021-11-05 01:15:35 -07:00
Jarred Sumner
d4c1bf6c67 [bun run] Fix bug with yarn getting replaced for - commands 2021-11-05 01:15:24 -07:00
Jarred Sumner
3ef55d10ae [bun run] Improve fish completions by adding a description 2021-11-05 01:15:09 -07:00
Jarred Sumner
5ce171d92c [bun run][bun create] Do not follow symlinks when exec'ing a child process 2021-11-04 21:37:10 -07:00
Jarred Sumner
e409148941 [bun run] Fix bug with quotes and spaces
Fixes #53
2021-11-04 21:00:44 -07:00
Jarred Sumner
d44abd8e4d Update string_immutable.zig 2021-11-04 18:41:40 -07:00
Jarred Sumner
5c38b6c355 [internal] fmt 2021-11-04 18:33:14 -07:00
Jarred Sumner
04ecfdd794 [JS Parser] Print � for invalid WTF-8 input 2021-11-04 18:33:00 -07:00
Jarred Sumner
fc59a32b63 [JS Parser] Decode JavaScript-like input as WTF-8 instead of UTF-8 2021-11-04 18:30:43 -07:00
Jarred Sumner
fd57e2d9a6 [JSX] Match esbuild behavior for multiline JSX string literals 2021-11-04 15:27:29 -07:00
Jarred Sumner
303a5ea898 [JSX] Fix regression with JSX entities 2021-11-03 19:29:07 -07:00
Jarred Sumner
d502d0bcd6 Update install.sh 2021-11-03 15:26:06 -07:00
Jarred Sumner
2018f5020a [installer] Detect rosetta in install.sh 2021-11-03 15:25:38 -07:00
Jarred Sumner
92a7849e98 [Bun.js] Rename Bun.sleep -> Bun.sleepSync 2021-11-03 02:04:21 -07:00
Jarred Sumner
59bdb62966 Fix next version warning 2021-11-03 01:20:08 -07:00
Jarred Sumner
eab1938012 [bun create] Auto-set to Next.js v12.0.2 2021-11-03 00:27:13 -07:00
Jarred Sumner
d97bd79c86 Bump once again (bun create requires git-public versions) 2021-11-03 00:23:49 -07:00
Jarred Sumner
35c05f61e5 Bump next version 2021-11-03 00:22:37 -07:00
Jarred Sumner
a5181c8ed1 [examples] Display Next.js version in example 2021-11-02 23:43:20 -07:00
Jarred Sumner
aa545ac0dc Update README.md 2021-11-02 23:37:57 -07:00
Jarred Sumner
ac9bd094f3 [test] Make sure we curl a jsx file in react integration test 2021-11-02 23:25:31 -07:00
Jarred Sumner
becf55febc Bump examples 2021-11-02 23:25:08 -07:00
Jarred Sumner
c41cc80700 [internal] Undo workspace commits, turns out it's not necessary for now 2021-11-02 23:17:25 -07:00
Jarred Sumner
20b1a27d05 [bun-macro-relay] Temporary fix until .d.ts is handled more correctly 2021-11-02 23:16:52 -07:00
Jarred Sumner
a027e9b6bc v0.1.1 2021-11-02 23:16:33 -07:00
Jarred Sumner
3fe676e9c9 Bump versions 2021-11-02 23:13:18 -07:00
Jarred Sumner
bffe8e918b Merge branch 'jarred/package-mapper' of github.com:Jarred-Sumner/bun into jarred/package-mapper 2021-11-02 23:10:43 -07:00
Jarred Sumner
92e5fe9fd5 Next.js 12 support 2021-11-02 23:10:40 -07:00
Jarred Sumner
b107ac1659 [internal] Inline empty function 2021-11-02 22:53:53 -07:00
Jarred Sumner
5537c03569 Fixes https://github.com/Jarred-Sumner/bun/issues/28 2021-11-02 22:53:26 -07:00
Jarred Sumner
4ab7c82405 Revert "[bundler] Start detecting workspace roots"
This reverts commit e71cb5c8c9.
2021-11-02 22:53:06 -07:00
Jarred Sumner
6e8cd2e3e5 [bun bun] alwaysBundled packages should use their real paths 2021-11-02 22:52:38 -07:00
Jarred Sumner
c0c7527497 [parser] Fix undefined behavior when invalid an unicode codepoint is part of an error message 2021-11-02 22:48:48 -07:00
Jarred Sumner
e71cb5c8c9 [bundler] Start detecting workspace roots 2021-11-02 18:09:54 -07:00
Jarred Sumner
cdbb4cf68a [interla] Comment 2021-11-02 18:08:55 -07:00
Jarred Sumner
204d468ad2 [internal] Global.configureAllocator() 2021-11-02 18:07:11 -07:00
Jarred Sumner
1844212f34 [bundler] Start detecting workspace roots 2021-11-02 17:20:45 -07:00
Jarred Sumner
fbb0342511 [CLI] Fix completions auto-installer for zsh 2021-11-01 21:23:47 -07:00
Jarred Sumner
92b174b315 Add Bun.js integration tests, but don't run them yet. 2021-11-01 20:05:38 -07:00
Jarred Sumner
0ba9784be2 [cli] Hardcode some paths to install for zsh 2021-11-01 06:10:13 -07:00
Jarred Sumner
2c50cf7284 Update Makefile 2021-11-01 04:57:50 -07:00
Jarred Sumner
bea0dca55d Update Makefile 2021-11-01 04:56:30 -07:00
Jarred Sumner
1676af9de9 [cli] Slightly improve zsh completions 2021-11-01 04:41:46 -07:00
Jarred Sumner
3d48bdaad1 Delete node_modules.jsbundle 2021-11-01 04:30:59 -07:00
Jarred Sumner
1b474d4f97 [CLI] Spacing 2021-11-01 04:30:31 -07:00
Jarred Sumner
4467167f99 [cli] just open the directory, access is dumb 2021-11-01 04:27:44 -07:00
Jarred Sumner
36ec8bb99b [test] Add integration test for null byte \\0 2021-11-01 04:04:48 -07:00
Jarred Sumner
bc5f99dc43 [internal] Tiny changes that will eventually make it easier to update zig 2021-11-01 04:04:18 -07:00
Jarred Sumner
4d4966592e [upgrade] Reinstall completions on bun upgrade 2021-11-01 04:03:43 -07:00
Jarred Sumner
f1fff3af7e Bump 2021-11-01 03:59:48 -07:00
Jarred Sumner
83e553d6a9 [install] Auto-set PATH if possible 2021-11-01 03:59:36 -07:00
Jarred Sumner
173724b402 [CLI] Add zsh completions and auto-install completions 2021-11-01 03:43:27 -07:00
Jarred Sumner
64d3927879 [CLI] Add completions for Fish 2021-10-31 21:02:15 -07:00
Jarred Sumner
49ad70b11c [CLI] Print newline after --version 2021-10-31 16:19:28 -07:00
Jarred Sumner
0d0b769bcc Add -v shorthand for version 2021-10-31 16:19:15 -07:00
Jarred Sumner
fb2aa186b7 [Bun.js] Bun.sleep() lets you synchronously sleep. Thanks @evanwashere 2021-10-31 00:39:37 -07:00
Jarred Sumner
ef94826f95 [CLI] Fix spacing (thanks @KishanBagaria) 2021-10-31 00:22:03 -07:00
Jarred Sumner
d79f34e960 Update cli.zig 2021-10-30 23:15:55 -07:00
Jarred Sumner
4ce6e4a9cb [Bun.js] Ensure we print in Latin1 mode 2021-10-30 23:15:47 -07:00
Jarred Sumner
9cf2771549 Update javascript.zig 2021-10-30 23:14:58 -07:00
Jarred Sumner
daf583e4cb [Bun.js] Lazily add FORCE_COLOR environment variable for better compatibility with Node.js modules that detect whether the terminal supports colors 2021-10-30 23:14:48 -07:00
Jarred Sumner
51e55f4b6e [Bun.js] Partially fix loading Node.js fallback modules 2021-10-30 23:14:14 -07:00
Jarred Sumner
f30527b6d9 [Bun.js] Add API for detecting if ANSI colors are enabled 2021-10-30 23:13:17 -07:00
Jarred Sumner
17b186933d [Bun.js] Implement supports-color polyfill (so that chalk works) 2021-10-30 23:12:11 -07:00
Jarred Sumner
fd57edceff [Bun.js] fix node fetch polyfills 2021-10-30 23:11:43 -07:00
Jarred Sumner
1876c0e11a Fixes #34 2021-10-30 21:44:31 -07:00
Jarred Sumner
cd5c740368 [internal] Fix loading runtime code in debug builds 2021-10-30 20:53:08 -07:00
Jarred Sumner
e2eef2bb25 [internal] Makefile 2021-10-30 19:24:42 -07:00
Jarred Sumner
ad3c19a160 Linking instructions in Makefile 2021-10-30 18:20:53 -07:00
Jarred Sumner
07bb25f7b1 Update Makefile 2021-10-30 18:16:15 -07:00
Jarred Sumner
edd0223377 Update README.md 2021-10-30 18:15:31 -07:00
Jarred Sumner
34a8a623f4 Update README.md 2021-10-30 18:12:31 -07:00
Jarred Sumner
f854539ea9 Update README.md 2021-10-30 18:09:50 -07:00
Jarred Sumner
cd1b8ccde7 Update Makefile 2021-10-30 18:05:35 -07:00
Jarred Sumner
cf3f8d2bb0 Update Makefile 2021-10-30 18:04:11 -07:00
Jarred Sumner
f1a0e718b3 Update Makefile 2021-10-30 17:55:14 -07:00
Jarred Sumner
08e0a51036 Add prettier to makefile & package.json 2021-10-30 17:48:04 -07:00
Jarred Sumner
8e0f21cc91 [internal] Make zig and npm client possibly environment variables 2021-10-30 17:45:22 -07:00
Jarred Sumner
ae7843f244 Fix make require 2021-10-30 17:37:03 -07:00
Jarred Sumner
b5b47e6525 Update README.md 2021-10-30 17:24:53 -07:00
Jarred Sumner
e7a4f9f507 [internal] generate .zip for release in Linux was missing filepath 2021-10-30 16:21:37 -07:00
Jarred Sumner
658926189f Update README.md 2021-10-30 16:21:08 -07:00
Jarred Sumner
154c8372e3 [Bun.js] Call JSCInitialize() before starting 2021-10-30 05:01:47 -07:00
Jarred Sumner
a68b5eef86 [Bun.js] Enable SharedArrayBuffer 2021-10-30 04:52:15 -07:00
Jarred Sumner
65ea1e4647 [Bun.js] Fix entry point to only call default if it was a CommonJS transformed function 2021-10-30 03:11:58 -07:00
Jarred Sumner
f8f85430c0 [internal] gitignore blobs for identifier cache 2021-10-30 01:49:19 -07:00
Jarred Sumner
d8a2eb81e3 [internal] Add identifier-cache to makefile so we don't forget to run it 2021-10-30 01:48:58 -07:00
Jarred Sumner
9a9c0df6b0 [lexer] Fix crash on legacy octal literals 2021-10-30 01:28:27 -07:00
Jarred Sumner
0a86beccc7 Bump build id 2021-10-30 01:27:50 -07:00
Jarred Sumner
2fe9791127 Update CHANGELOG.md 2021-10-30 01:23:21 -07:00
Jarred Sumner
b856d50c3f Update CHANGELOG.md 2021-10-30 01:19:41 -07:00
Jarred Sumner
dde2b80e1d Update CHANGELOG.md 2021-10-30 01:19:15 -07:00
Jarred Sumner
49b954462d [Bun.js] Add performance.now() 2021-10-30 01:19:10 -07:00
Jarred Sumner
c51dac1282 [internal] Fix build issue with the JavaScriptCore bindings on macOS. GNU sed != BSD sed 2021-10-29 23:41:43 -07:00
Jarred Sumner
0d002c7057 [bun run] Support running JavaScript, TypeScript, JSX, and TSX files using Bun.js 2021-10-29 23:41:06 -07:00
Jarred Sumner
1d03e90b5c [internal] This is no longer a feature flag in JSC 2021-10-29 23:37:29 -07:00
Jarred Sumner
25ac773cf3 [Bun.js] Add support for Top Level Await! 2021-10-29 23:36:55 -07:00
Jarred Sumner
ecb069ac85 [internal] Normalize import filepaths 2021-10-29 23:36:00 -07:00
Jarred Sumner
a6cf6c4069 [Bun.js] Fix silly oversight with fetch implementation 2021-10-29 23:35:06 -07:00
Jarred Sumner
6854d83842 [internal] Fix missing symbol errors when building JavaScriptCore bindings without already having the object files 2021-10-29 23:34:19 -07:00
Jarred Sumner
4aab78f619 [internal] Improve Bun's debug build times 2021-10-29 23:32:30 -07:00
Jarred Sumner
95d2860930 Add integration test that verifies bash exported functions work in bun run 2021-10-29 19:17:44 -07:00
Jarred Sumner
70db76a798 Pass through environment variables from the process verbatim
Fixes https://github.com/Jarred-Sumner/bun/issues/40
2021-10-29 18:35:42 -07:00
Jarred Sumner
07bf3eb1e9 Merge pull request #41 from mikeroelens/mikeroelens/fix-shell-install-command 2021-10-29 15:39:36 -07:00
Mike Roelens
237e672e70 fix: add missing quotation in sample zsh config 2021-10-29 15:14:02 -04:00
Jarred Sumner
61d436c29d https:// for the URL 2021-10-29 08:21:30 -07:00
Jarred Sumner
22ea3e76f9 Update README.md 2021-10-28 21:40:25 -07:00
Jarred Sumner
0089d04459 Update README.md 2021-10-28 21:18:48 -07:00
Jarred Sumner
26ee46ad5b Bump 2021-10-28 19:05:27 -07:00
Jarred Sumner
417c4e0faa - Fix consistentcy issue with runtime hash
- Fix edgecases in strings.eqlComptime by simplifying the implementation
2021-10-28 19:03:49 -07:00
Jarred Sumner
b6675dd0ab Explicitly check content type 2021-10-28 17:33:40 -07:00
Jarred Sumner
dff40c5220 FIx webkit commit 2021-10-28 17:08:28 -07:00
Jarred Sumner
1fd426432e Fix spacing, add check that the version matches before we push 2021-10-28 17:06:42 -07:00
Jarred Sumner
97c43ef787 Don't run bun upgrade in the makefile 2021-10-28 17:02:27 -07:00
Jarred Sumner
a546e56669 Update Makefile 2021-10-28 16:55:22 -07:00
Jarred Sumner
4b52192974 Update upgrade_command.zig 2021-10-28 16:52:57 -07:00
Jarred Sumner
fb10e0c4cb Upgrade checker + polish for bun upgrade 2021-10-28 16:39:26 -07:00
Jarred Sumner
a44cb9708f New subcommand: bun upgrade. It upgrades bun to the latest version. 2021-10-28 05:34:38 -07:00
Jarred Sumner
c7fc08056a part 1 of try to fix the npm install process 2021-10-27 17:38:05 -07:00
Jarred Sumner
12ba37e43a Update build-id 2021-10-27 15:27:03 -07:00
Jarred Sumner
928346b842 Verify package installs successfully for each platform 2021-10-27 15:26:04 -07:00
Jarred SUmner
b81c895e1d Add test that verifies installing bun with yarn & npm works before publishing 2021-10-27 04:26:38 -07:00
Jarred Sumner
d434e5aeac Make the installation more careful 2021-10-27 04:12:13 -07:00
Jarred Sumner
2250db41b4 Add universal macOS build so that Bun works on rosetta builds of Node.js 2021-10-27 02:41:45 -07:00
Jarred Sumner
826db9021e Before publishing the binary to npm, verify it installs successfully and it's the expected version 2021-10-27 01:42:50 -07:00
Jarred Sumner
ad61279621 Fix aarch64 build errors 2021-10-27 01:22:02 -07:00
Jarred Sumner
5ce1b36130 Choose different clang for macOS and Linux 2021-10-26 22:57:49 -07:00
Jarred SUmner
a1f17f70eb Suggest running tests in build instructions 2021-10-26 22:38:36 -07:00
Jarred SUmner
a0f086ba85 Fix Linux x64 build 2021-10-26 22:37:03 -07:00
Jarred Sumner
8d095a235f Add test that checks JIT is enabled for JavaScriptCore and crashes if it isn't 2021-10-26 19:07:37 -07:00
Jarred Sumner
ff1417421b Simple integration test for bun run 2021-10-26 19:06:45 -07:00
Jarred Sumner
00fb04f309 Update Makefile 2021-10-26 18:47:43 -07:00
Jarred Sumner
a3cc17fbe6 Add a very simple integration test for bun create next & bun create react 2021-10-26 18:46:53 -07:00
Jarred Sumner
fd27d403d7 Aligning text in terminals is tedious 2021-10-26 17:48:33 -07:00
Jarred Sumner
6d29e314a0 Switch to using optionalDependencies for installing the packages instead of a postinstall script.
Sorry yarn v1 users :(
2021-10-26 17:37:44 -07:00
Jarred Sumner
902e438e6c Update README.md 2021-10-26 17:26:45 -07:00
Jarred Sumner
096d668d83 Bun is now a task runner as well 2021-10-26 17:24:09 -07:00
Jarred Sumner
49c5c32714 More spacing 2021-10-26 17:19:45 -07:00
Jarred Sumner
9a70d8daa2 Update README.md 2021-10-26 17:15:35 -07:00
Jarred Sumner
79eb8d9d78 Update README.md 2021-10-26 17:12:22 -07:00
Jarred Sumner
221b280856 spacing 2021-10-26 17:09:38 -07:00
Jarred Sumner
933378ab80 Update README.md 2021-10-26 16:58:57 -07:00
Jarred Sumner
bd51d194cf Add .cjs, .mts, and .cts to the list of file extensions to check for imports 2021-10-26 16:58:51 -07:00
Jarred Sumner
1e27c7d8ce [bun run] Add to README 2021-10-26 16:49:48 -07:00
Jarred Sumner
7d554ed175 [bun run] Fix passthrough behavior 2021-10-26 16:49:34 -07:00
Jarred Sumner
e72d765961 Spacing 2021-10-26 16:18:57 -07:00
Jarred Sumner
9ce38b86ab Fix edgecase with options loading attempting to create an output directory when it shouldn't 2021-10-26 16:18:51 -07:00
Jarred Sumner
05bdda7b07 Update clap.zig 2021-10-26 15:47:14 -07:00
Jarred Sumner
d68f18c77a [bun run] Add node_modules/.bin in reverse order, print failure on exit code 2021-10-26 15:47:08 -07:00
Jarred Sumner
ae6349e573 [.env loader] Fix bug with PATH values sometimes getting cut off at the end by one character 2021-10-26 15:30:26 -07:00
Jarred Sumner
0541cff2ad New subcommand: bun run run scripts in package.json really fast 2021-10-26 05:18:21 -07:00
Jarred Sumner
e69f8c36d2 [router] Don't log the route names since that's not necessary anymore 2021-10-25 17:06:38 -07:00
Jarred Sumner
e7f191c08b [HTTP] Fix error handling modal from showing when there are no errors 2021-10-25 17:06:20 -07:00
Jarred Sumner
6a2372b0b2 Fix rendering with Next.js after latest changes to route api 2021-10-25 17:05:59 -07:00
Jarred Sumner
0592515639 [HTTP Server] Add flag for disabling Bun.js 2021-10-25 17:05:10 -07:00
Jarred Sumner
a6c4bba6c2 [JSON loader] Fix importing JSON in ESM modules 2021-10-25 17:04:52 -07:00
Jarred Sumner
5691bf385b [.env loader] Add CLI flag to dump loaded environment variables as JSON 2021-10-25 17:04:32 -07:00
Jarred Sumner
a149f0abb9 Update build-id 2021-10-25 06:17:20 -07:00
Jarred Sumner
eae7051111 Add snapshots for latin1 regexp, add more codepoints to string escapes 2021-10-25 06:17:16 -07:00
Jarred Sumner
adb6be05d1 Use PNPM in Makefile 2021-10-25 06:16:31 -07:00
Jarred Sumner
4e889c7b47 Fix JSX unicode handling, slightly improve perf 2021-10-25 05:42:01 -07:00
Jarred Sumner
2ed6605cc3 [Bun.js] When Body is UTF-16 encoded, convert it to UTF-8. 2021-10-25 04:46:01 -07:00
Jarred Sumner
42c264bf7b Fix all known string encoding bugs 2021-10-25 00:52:07 -07:00
Jarred Sumner
fe6564b533 finish Expr.alloc -> Expr.init 2021-10-24 17:12:30 -07:00
Jarred Sumner
f6923f21b1 [internal] only set source for test once 2021-10-24 17:00:51 -07:00
Jarred Sumner
edfc61889c Mark all exported symbols as weak, always zig fmt the headers file to reduce diff churn 2021-10-24 17:00:21 -07:00
Jarred Sumner
08c8ca18a7 [internal] Get source URLs in C++ 2021-10-24 16:54:37 -07:00
Jarred Sumner
9e4f16ac8b ^ 2021-10-24 16:52:16 -07:00
Jarred Sumner
03ece0568d Expr.alloc -> Expr.init 2021-10-24 16:51:39 -07:00
Jarred Sumner
2dcb465d50 Upgrade to latest peechy 2021-10-24 16:48:47 -07:00
Jarred Sumner
c93655c717 Fix build error 2021-10-24 16:11:06 -07:00
Jarred Sumner
6f6510169e [JSON] Use a special lexer variant only for JSON 2021-10-24 16:09:15 -07:00
Jarred Sumner
cfe159f636 [internal] Remove more unused code and move the is_ascii_only boolean to only update for JSON parsing 2021-10-24 16:07:47 -07:00
Jarred Sumner
213f361551 [internal] Handle allocation failure 2021-10-24 15:55:27 -07:00
Jarred Sumner
3582941791 [internal] Use isPresent() instead of checking slice len 2021-10-24 15:53:27 -07:00
Jarred Sumner
a3cd9347e6 ✂️ Dead code 2021-10-24 15:53:02 -07:00
Jarred Sumner
449c8b5f36 [internal] Tweak build system to better support unit tests in Zig 2021-10-24 06:18:42 -07:00
Jarred Sumner
1f7af3754d [picohttp] failing test 2021-10-24 06:11:06 -07:00
Jarred Sumner
72df6b9be2 [.env loader] Environment variables are strings. 2021-10-24 06:10:53 -07:00
Jarred Sumner
044c0cfdc3 [internal] more inlining 2021-10-24 06:08:32 -07:00
Jarred Sumner
3c43f65234 [internal] ✂️ dead code 2021-10-24 06:08:08 -07:00
Jarred Sumner
bd2d284c53 [internal] some inlining 2021-10-24 06:07:39 -07:00
Jarred Sumner
ffea9c010b [internal] :snowflake: 2021-10-24 06:05:36 -07:00
Jarred Sumner
44351b57f7 [.env loader] Tests pass 2021-10-24 06:04:42 -07:00
Jarred Sumner
4bbb938de8 Comment out WASM test since WASM is currently unsupported 2021-10-23 22:57:01 -07:00
Jarred Sumner
437270e0af Remove very outdated tests 2021-10-23 22:56:35 -07:00
Jarred Sumner
09b7f4c95d Remove unused feature flag parallel_bun 2021-10-23 22:56:20 -07:00
Jarred Sumner
38f83c50c4 Add flag for dumping the environment variables 2021-10-23 22:55:47 -07:00
Jarred Sumner
2f06dc5755 [internal] Add easier commands for running unit tests 2021-10-23 22:55:26 -07:00
Jarred Sumner
d6b66e2155 Handle edgecase when returning errors 2021-10-23 22:54:56 -07:00
Jarred Sumner
309298fa42 Fix bug with MutableString.ensureValidIdentifier 2021-10-23 22:54:39 -07:00
Jarred Sumner
a0a2fa964b [internal] Remove more dead code, add script to find .zig files that aren't imported by other .zig files 2021-10-23 16:48:12 -07:00
Jarred Sumner
0c769d0f61 No more iguanaTLS 2021-10-23 16:15:44 -07:00
Jarred Sumner
1b90619890 [internal] ✂️ dead code 2021-10-23 16:15:36 -07:00
Jarred Sumner
0ea34216de Load environment variables into defines when possible 2021-10-23 05:04:08 -07:00
Jarred Sumner
53374ac54a [Bundler] When modules fail to resolve, continue building so that you can see many errors without re-running Bun 2021-10-23 05:03:26 -07:00
Jarred Sumner
6355ac219e [JS Parser] Parser errors should _always_ report an error location 2021-10-23 05:02:26 -07:00
Jarred Sumner
384ad96637 Support string-only defines 2021-10-23 05:00:31 -07:00
Jarred Sumner
0361b0df70 [.env loader] Parse values as JavaScript string literals instead of JSON 2021-10-23 05:00:14 -07:00
Jarred Sumner
a1b8c20c3f Add "process.env" to global object 2021-10-23 04:59:03 -07:00
Jarred Sumner
de01d581c1 Rewrite the CodepointIterator to fix some bugs 2021-10-23 04:58:20 -07:00
Jarred Sumner
f1bda194e0 [Lexer] Improve lexing performance by 2% via a bitfield for checking identifiers, inlining functions, and moving some branches to comptime 2021-10-23 04:57:34 -07:00
Jarred Sumner
a84b62452c [Bun.js] Escape unicode identifiers. This is necessary because we load source code into JavaScriptCore as latin1 to conserve memory. Loading as UTF-16 means your code uses 2x as much memory. 2021-10-23 04:56:09 -07:00
Jarred Sumner
e039ba5130 [Bun.js] Add Bun.env and support process.env for non-transpiled environment variables 2021-10-23 04:54:17 -07:00
Jarred Sumner
e67dd8947b [lexer] 0x200C and 0x200D are valid ID_Continue characters 2021-10-21 04:31:30 -07:00
Jarred Sumner
2d6a4a4956 Split tests into separate .json file 2021-10-21 04:30:50 -07:00
Jarred Sumner
f394581ed8 Add test for non-ascii latin1 characters in strings 2021-10-21 04:30:44 -07:00
Jarred Sumner
33b0c89e7c [Bun.js] Fix SyntaxError not showing source file or line number 2021-10-21 04:27:36 -07:00
Jarred Sumner
4e3aa3c289 Fix index + static route 2021-10-20 05:12:01 -07:00
Jarred Sumner
58b196c583 rewrote most of the router 2021-10-20 04:18:29 -07:00
Jarred Sumner
3dc53c3d13 Starting to rewrite the router to fix some bugs and support catch-all + optional routes 2021-10-18 23:55:17 -07:00
Jarred Sumner
4f2c1cfe85 Update README.md 2021-10-17 18:40:54 -07:00
Jarred Sumner
6e16b3cf84 Bump to latest 2021-10-17 15:36:52 -07:00
Jarred Sumner
9f0ab479b0 [bun-framework-next] Fix when the project does not define a _app page 2021-10-17 15:36:28 -07:00
Jarred Sumner
884b5e13ee Add --open flag to bun create 2021-10-17 03:42:03 -07:00
Jarred Sumner
7d4aab4cf1 Slight cleanup 2021-10-17 03:41:31 -07:00
Jarred Sumner
6bb0c03d8d Update README.md 2021-10-16 23:56:50 -07:00
Jarred Sumner
797c94b0e9 Update README.md 2021-10-16 23:52:57 -07:00
Jarred Sumner
e63fbcefe9 bump! 2021-10-16 23:49:39 -07:00
Jarred Sumner
dcc29d3db6 Improve support for Create React App 2021-10-16 23:24:23 -07:00
Jarred Sumner
be66c01829 Update js_ast.zig 2021-10-16 21:33:09 -07:00
Jarred Sumner
21b9884606 Support GitHub repositories, transform package.json to better fit Bun's usage 2021-10-16 21:33:05 -07:00
Jarred Sumner
fd6d93292c more strings 2021-10-16 20:23:37 -07:00
Jarred Sumner
9000165718 Ensure self is always defined 2021-10-16 20:23:25 -07:00
Jarred Sumner
54b313cc5a Fix edgecase in Transfer-Encoding chunked 2021-10-16 20:23:06 -07:00
Jarred Sumner
2461c11536 Cleanup 2021-10-15 23:36:30 -07:00
Jarred Sumner
f17345ffe4 Bump the version 2021-10-15 23:05:58 -07:00
Jarred Sumner
4908a63f61 Latest 2021-10-15 23:03:31 -07:00
Jarred Sumner
da7de899e1 📷 2021-10-15 23:02:40 -07:00
Jarred Sumner
44108d6a26 Fix static libarchive build 2021-10-15 22:52:24 -07:00
Jarred Sumner
c7fb978b7b Merge branch 'main' of github.com:Jarred-Sumner/bun 2021-10-15 22:37:29 -07:00
Jarred Sumner
0db94d94d6 Bump s2n-tls 2021-10-15 22:36:28 -07:00
Jarred SUmner
92e489760d Linux build fixes 2021-10-15 22:33:36 -07:00
Jarred Sumner
decee7616f Update Makefile 2021-10-15 20:33:35 -07:00
Jarred Sumner
deafd3d0d4 Cleanup makefile to get libiconv setup for linux 2021-10-15 20:25:23 -07:00
Jarred Sumner
b9bbd819be Update Makefile 2021-10-15 20:14:55 -07:00
Jarred Sumner
b956ea5a5e Update Makefile 2021-10-15 20:13:18 -07:00
Jarred Sumner
cf2e81b036 Merge branch 'jarred/gen' 2021-10-15 20:08:40 -07:00
Jarred Sumner
bf2732599c update makefile 2021-10-15 20:08:21 -07:00
Jarred Sumner
10696680ff Polish 2021-10-15 19:44:53 -07:00
Jarred Sumner
7e159cb5cd ❇️ 2021-10-14 22:10:08 -07:00
Jarred Sumner
74cda61c88 Update README.md 2021-10-14 19:17:44 -07:00
Jarred Sumner
9dfe57a3f7 Update README.md 2021-10-14 19:17:20 -07:00
Jarred Sumner
f10dcd780c Update README.md 2021-10-14 19:08:55 -07:00
Jarred Sumner
bee7efb5d9 Update README.md 2021-10-14 19:07:40 -07:00
Jarred Sumner
0039b53d21 Update README.md 2021-10-14 19:01:51 -07:00
Jarred Sumner
9f86acbe58 Update README.md 2021-10-14 18:58:50 -07:00
Jarred Sumner
bbc1bcbed1 Support local templates 2021-10-14 18:55:41 -07:00
Jarred Sumner
3ed824fe0f Update router.zig 2021-10-14 16:15:04 -07:00
Jarred Sumner
fe24b96d61 Support passing an absolute path 2021-10-14 16:14:48 -07:00
Jarred Sumner
4b6d8a152f Update bun-create.md 2021-10-14 14:51:51 -07:00
Jarred Sumner
e21b9afdf2 Update bun-create.md 2021-10-14 14:50:34 -07:00
Jarred Sumner
901d7d8759 Add doc explaining bun-create 2021-10-14 14:49:48 -07:00
Jarred Sumner
4b618f9ad1 bun create react app is almost done 2021-10-14 05:22:47 -07:00
Jarred Sumner
0f7bc76f39 v0.0.0 2021-10-13 23:13:58 -07:00
Jarred Sumner
6d997ab201 [fetch] Slight perf improvement 2021-10-13 14:29:03 -07:00
Jarred Sumner
8f7f4ae72f --turbo mode for fetch cli, which disables sending TLS shutdown 2021-10-13 14:17:23 -07:00
Jarred Sumner
c85b5f6a87 [fetch] Support Transfer-Encoding: chunked 2021-10-13 14:06:51 -07:00
Jarred Sumner
ba5f9887fb Update build.zig 2021-10-13 00:28:31 -07:00
Jarred Sumner
9e3e9a2d6d Clean up examples a little 2021-10-13 00:28:20 -07:00
Jarred Sumner
88a5e2d34d Add TLS 1.3 support, improve fetch() HTTPS performance 2021-10-13 00:27:35 -07:00
Jarred Sumner
afc346d6f1 s2n.zig 2021-10-12 16:27:32 -07:00
Jarred Sumner
4dd398ca7a ignore = dirty 2021-10-12 16:27:15 -07:00
Jarred Sumner
756bfc9077 Add fetch CLI test app 2021-10-12 16:26:57 -07:00
Jarred Sumner
f646250a91 Add s2n, remove openssl 2021-10-12 16:26:24 -07:00
Jarred Sumner
24c567086f Add OpenSSL 😢 2021-10-11 20:15:15 -07:00
Jarred Sumner
05b1696df7 Add libarchive bindings 2021-10-11 18:31:24 -07:00
Jarred Sumner
0baa3b511e Update README.md 2021-10-11 02:34:54 -07:00
Jarred Sumner
d793088575 Update README.md 2021-10-11 02:34:41 -07:00
Jarred Sumner
9aa7f9ed18 link to fork 2021-10-11 02:33:35 -07:00
Jarred Sumner
e7f6cf12a5 Update .gitmodules 2021-10-10 23:41:49 -07:00
Jarred Sumner
e2ba468924 Update .gitmodules 2021-10-10 23:41:40 -07:00
Jarred Sumner
85760c0a4c Missing fixture 2021-10-10 23:41:27 -07:00
Jarred Sumner
0db7af6166 [fetch] Add support for gzip & deflate to the http client
Powered by Cloudflare's zlib fork
2021-10-10 23:41:18 -07:00
Jarred Sumner
5e3d1dd4b5 Merge pull request #30 from alexkuz/patch-1 2021-10-09 03:47:24 -07:00
Alexander Kuznetsov
6eb9a36a22 Fetch WebKit submodule via https instead of ssh
Fetching submodule via ssh leads to auth error if SSH key is not provided in GitHub settings; all submodules left uninitialized as a result
2021-10-09 11:50:14 +03:00
Jarred Sumner
e88e9401f1 Fix bug where occasionally unary expressions would simplify incorrectly due to an undefined memory issue 2021-10-08 17:24:03 -07:00
Jarred Sumner
829b4287dd Yet Another Packed Struct Bug 2021-10-08 15:48:58 -07:00
Jarred Sumner
2bf7b5a7ab Update readme.md 2021-10-07 22:31:36 -07:00
Jarred Sumner
1c83f3091c Update README.md 2021-10-07 21:31:52 -07:00
Jarred Sumner
dfd08e7c55 Fix potential symbol collision in bun-macro-relay 2021-10-07 21:31:11 -07:00
Jarred Sumner
3b28af17db Fix edgecase when bundling JavaScript that references ESM exported functions before they're defined 2021-10-07 21:30:28 -07:00
Jarred Sumner
5a03dfb9a4 Schema 2021-10-07 21:29:16 -07:00
Jarred Sumner
fa1aa301e8 Add --port CLI flag for setting a port instead of --origin. --port has higher precedence than --origin so that proxies can work 2021-10-07 21:29:07 -07:00
Jarred Sumner
ae7b91efe2 Add CSS HMR benchmark 2021-10-07 21:27:47 -07:00
Jarred Sumner
6d9ccd9b8e Fix package.json file 2021-10-06 20:02:58 -07:00
Jarred Sumner
0d79435ce2 Snapshots 2021-10-06 20:02:40 -07:00
Jarred Sumner
4ee2fdf1c6 uname 2021-10-06 19:32:32 -07:00
Jarred Sumner
cd273daa1b Missing @TypeOf 2021-10-06 19:31:19 -07:00
Jarred Sumner
c2e9d49f69 oops 2021-10-06 19:29:50 -07:00
Jarred Sumner
38a9c92eec Bump it 2021-10-06 19:28:44 -07:00
Jarred Sumner
1d0f442718 📷 2021-10-06 19:26:43 -07:00
Jarred Sumner
1e8babe185 HTTP paths must resolve from ./$PROJECT_ROOT unless explicitly marked absolute.
This fixes the issue with deeply nested PNPM workspace packages. Happened when using @emotion/react inside a PNPM workspace when @emotion/react was hoisted to the workspace root but react was in a child node_modules folder. It would fail to resolve `"react/jsx-dev-runtime"` because it didn't exist in any node_modules folder relative to `@emotion/react`'s real path.
2021-10-06 19:26:28 -07:00
Jarred Sumner
69d3b5ca60 Update browser.js 2021-10-06 19:21:34 -07:00
Jarred Sumner
a493c18193 Fix JSX transform edgecase with static children 2021-10-06 19:21:26 -07:00
Jarred Sumner
5370ea71c0 Add support for reading JSX config from tsconfig.json 2021-10-06 16:49:26 -07:00
Jarred Sumner
0afec7739b Update README.md 2021-10-05 23:09:57 -07:00
Jarred Sumner
a7173d54ce Update README.md 2021-10-05 23:08:11 -07:00
Jarred Sumner
3b10cfae80 analytics is good enough for now 2021-10-05 23:08:06 -07:00
Jarred Sumner
bd14ad9e6e Async analytics works now
Requests are ~60 bytes and the thread mostly sleeps, so it should be pretty low overhead overall.
2021-10-05 17:50:05 -07:00
Jarred Sumner
9507cd8ed6 [fetch] Fix bug with HTTP request bodies 2021-10-05 17:45:32 -07:00
Jarred Sumner
dfe74cb5c4 Add BUN_DISABLE_ANALYTICS flag to disable analytics and automatically disable analytics when running inside hyperfine 2021-10-05 03:11:35 -07:00
Jarred Sumner
00e7b7c3d5 Simple analytics 2021-10-05 02:27:49 -07:00
Jarred SUmner
d2be50bf4d Merge branch 'main' of github.com:Jarred-Sumner/bun into main 2021-10-04 20:42:17 -07:00
Jarred SUmner
f0f3d6d4eb Statically link libicu on Linux so it doesn't require installing icu separately.
this doubles the binary size :(
2021-10-04 20:41:27 -07:00
Jarred SUmner
21d918921a memfd experiment did not yield perf gains on Linux
I suspect the reason why is because we were already using tmpfs. So it was already writing to an in-memory file. O_TMPFILE doesn't seem to do anything for us either here.
2021-10-04 20:01:05 -07:00
Jarred Sumner
55095edee6 Don't pass O_EXCL 2021-10-04 19:07:19 -07:00
Jarred Sumner
6a7deab74d O_TMPFILE 2021-10-04 19:00:18 -07:00
Jarred Sumner
7db27f11d0 memfd_create does not actually make it faster 2021-10-04 18:58:31 -07:00
Jarred Sumner
3ebb4feb98 Attempt to optimize bun bun on Linux by using memfd_create and copying the resulting file via sendfile() 2021-10-04 18:37:51 -07:00
Jarred Sumner
e8dab9bfcf Fix moving files across mount points 2021-10-04 15:35:08 -07:00
Jarred Sumner
dc3eee44a9 Bump 2021-10-04 04:54:23 -07:00
Jarred Sumner
9e8463af33 Bump 2021-10-04 04:31:43 -07:00
Jarred Sumner
dd2bdd09db Bump 2021-10-04 03:33:54 -07:00
Jarred Sumner
0eb3c1d393 Improve Bun's performance by 5%
By making E.Identifier not a pointer, we improve performance by 5%. Heap allocations are bad
2021-10-04 03:28:55 -07:00
Jarred SUmner
cb6a1b7225 Use covid19 example 2021-10-03 23:53:57 -07:00
Jarred SUmner
38c73788e1 Bump 2021-10-03 21:55:50 -07:00
Jarred Sumner
2c89122ce9 Update Makefile 2021-10-03 21:53:21 -07:00
Jarred Sumner
2eae013ebf Update Makefile 2021-10-03 21:50:27 -07:00
Jarred Sumner
1247a9c93d Update Makefile 2021-10-03 21:49:26 -07:00
Jarred Sumner
5c6dd19826 Update Makefile 2021-10-03 21:49:11 -07:00
Jarred Sumner
9d0ee5c5cd Update Makefile 2021-10-03 21:47:34 -07:00
Jarred Sumner
3affc2a2d8 Update Makefile 2021-10-03 21:46:13 -07:00
Jarred Sumner
02bdaa6d10 Fix tmpdir on linux 2021-10-03 21:43:10 -07:00
Jarred Sumner
aee263d050 Update linux build instructions 2021-10-03 21:21:54 -07:00
Jarred Sumner
7ac4abf8a0 Create separate profile binary and strip debug symbols 2021-10-03 20:40:04 -07:00
Jarred Sumner
139622e0b8 llvm-strip 2021-10-03 20:36:59 -07:00
Jarred Sumner
aaa4aaf53f Fix makefile issue 2021-10-03 20:33:47 -07:00
Jarred Sumner
73c27a9a25 Fix various macOS-specific compile errors and run zig fmt 2021-10-03 20:26:54 -07:00
2159 changed files with 833392 additions and 98841 deletions

28
.devcontainer/README.md Normal file
View File

@@ -0,0 +1,28 @@
# Bun's Dev Container
To get started, login to GitHub and clone bun's GitHub repo into `/build/bun`
# First time setup
```bash
gh auth login # if it fails to open a browser, use Personal Access Token instead
gh repo clone oven-sh/bun . -- --depth=1 --progress -j8
```
# Compile bun dependencies (zig is already compiled)
```bash
make devcontainer
```
# Build bun for development
```bash
make dev
```
# Run bun
```bash
bun-debug help
```

View File

@@ -0,0 +1,70 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/docker-existing-dockerfile
{
"name": "bun (Ubuntu)",
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
"hostRequirements": { "memory": "16gb" },
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "../Dockerfile.devcontainer",
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/zsh",
"zigLanguageClient.path": "/home/ubuntu/zls/zig-out/bin/zls",
"zig.zigPath": "/build/zig/zig",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"AugusteRame.zls-vscode",
"ms-vscode.cpptools",
"/home/ubuntu/vscode-zig.vsix",
"vadimcn.vscode-lldb",
"esbenp.prettier-vscode",
"xaver.clang-format"
],
"postCreateCommand": "cd /build/bun; bash /build/getting-started.sh; cat /build/README.md",
"build": {
"target": "bun.devcontainer",
"cacheFrom": ["ghcr.io/oven-sh/bun.devcontainer:latest"],
"args": {
"BUILDARCH": "${localEnv:DOCKER_BUILDARCH:amd64}",
"--platform": "linux/${localEnv:DOCKER_BUILDARCH:amd64}",
"--tag": "ghcr.io/oven-sh/bun.devcontainer:latest"
}
},
"runArgs": [
"--ulimit",
"memlock=-1:-1",
"--ulimit",
"nofile=65536:65536",
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
"workspaceMount": "source=bun,target=/build/bun,type=volume",
"workspaceFolder": "/build/bun",
"mounts": [
"source=bun-install,target=/home/ubuntu/.bun,type=volume",
"source=bun-config,target=/home/ubuntu/.config,type=volume"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000, 8081, 8080]
// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}

61
.devcontainer/limits.conf Normal file
View File

@@ -0,0 +1,61 @@
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain> <type> <item> <value>
#
#Where:
#<domain> can be:
# - a user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
# - NOTE: group and wildcard limits are not applied to root.
# To apply a limit to the root user, <domain> must be
# the literal username root.
#
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#
#<item> can be one of the following:
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open file descriptors
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit (KB)
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to values: [-20, 19]
# - rtprio - max realtime priority
# - chroot - change root to directory (Debian-specific)
#
#<domain> <type> <item> <value>
#
* soft memlock 33554432
* hard memlock 33554432
* soft nofile 33554432
* hard nofile 33554432
#* soft core 0
#root hard core 100000
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#ftp - chroot /ftp
#@student - maxlogins 4
# End of file

View File

@@ -0,0 +1,454 @@
#!/usr/bin/env bash
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
#
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/common.md
# Maintainer: The VS Code and Codespaces Teams
#
# Syntax: ./common-debian.sh [install zsh flag] [username] [user UID] [user GID] [upgrade packages flag] [install Oh My Zsh! flag] [Add non-free packages]
set -e
INSTALL_ZSH=${1:-"true"}
USERNAME=${2:-"automatic"}
USER_UID=${3:-"automatic"}
USER_GID=${4:-"automatic"}
UPGRADE_PACKAGES=${5:-"true"}
INSTALL_OH_MYS=${6:-"true"}
ADD_NON_FREE_PACKAGES=${7:-"false"}
SCRIPT_DIR="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)"
MARKER_FILE="/usr/local/etc/vscode-dev-containers/common"
if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
fi
# Ensure that login shells get the correct path if the user updated the PATH using ENV.
rm -f /etc/profile.d/00-restore-env.sh
echo "export PATH=${PATH//$(sh -lc 'echo $PATH')/\$PATH}" > /etc/profile.d/00-restore-env.sh
chmod +x /etc/profile.d/00-restore-env.sh
# If in automatic mode, determine if a user already exists, if not use vscode
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
USERNAME=""
POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
for CURRENT_USER in ${POSSIBLE_USERS[@]}; do
if id -u ${CURRENT_USER} > /dev/null 2>&1; then
USERNAME=${CURRENT_USER}
break
fi
done
if [ "${USERNAME}" = "" ]; then
USERNAME=vscode
fi
elif [ "${USERNAME}" = "none" ]; then
USERNAME=root
USER_UID=0
USER_GID=0
fi
# Load markers to see which steps have already run
if [ -f "${MARKER_FILE}" ]; then
echo "Marker file found:"
cat "${MARKER_FILE}"
source "${MARKER_FILE}"
fi
# Ensure apt is in non-interactive to avoid prompts
export DEBIAN_FRONTEND=noninteractive
# Function to call apt-get if needed
apt_get_update_if_needed()
{
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
echo "Running apt-get update..."
apt-get update
else
echo "Skipping apt-get update."
fi
}
# Run install apt-utils to avoid debconf warning then verify presence of other common developer tools and dependencies
if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
package_list="apt-utils \
openssh-client \
gnupg2 \
dirmngr \
iproute2 \
procps \
lsof \
htop \
net-tools \
psmisc \
curl \
wget \
rsync \
ca-certificates \
unzip \
zip \
nano \
vim-tiny \
less \
jq \
lsb-release \
apt-transport-https \
dialog \
libc6 \
libgcc1 \
libkrb5-3 \
libgssapi-krb5-2 \
libicu[0-9][0-9] \
liblttng-ust[0-9] \
libstdc++6 \
zlib1g \
locales \
sudo \
ncdu \
man-db \
strace \
manpages \
manpages-dev \
init-system-helpers"
# Needed for adding manpages-posix and manpages-posix-dev which are non-free packages in Debian
if [ "${ADD_NON_FREE_PACKAGES}" = "true" ]; then
# Bring in variables from /etc/os-release like VERSION_CODENAME
. /etc/os-release
sed -i -E "s/deb http:\/\/(deb|httpredir)\.debian\.org\/debian ${VERSION_CODENAME} main/deb http:\/\/\1\.debian\.org\/debian ${VERSION_CODENAME} main contrib non-free/" /etc/apt/sources.list
sed -i -E "s/deb-src http:\/\/(deb|httredir)\.debian\.org\/debian ${VERSION_CODENAME} main/deb http:\/\/\1\.debian\.org\/debian ${VERSION_CODENAME} main contrib non-free/" /etc/apt/sources.list
sed -i -E "s/deb http:\/\/(deb|httpredir)\.debian\.org\/debian ${VERSION_CODENAME}-updates main/deb http:\/\/\1\.debian\.org\/debian ${VERSION_CODENAME}-updates main contrib non-free/" /etc/apt/sources.list
sed -i -E "s/deb-src http:\/\/(deb|httpredir)\.debian\.org\/debian ${VERSION_CODENAME}-updates main/deb http:\/\/\1\.debian\.org\/debian ${VERSION_CODENAME}-updates main contrib non-free/" /etc/apt/sources.list
sed -i "s/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}\/updates main/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}\/updates main contrib non-free/" /etc/apt/sources.list
sed -i "s/deb-src http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}\/updates main/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}\/updates main contrib non-free/" /etc/apt/sources.list
sed -i "s/deb http:\/\/deb\.debian\.org\/debian ${VERSION_CODENAME}-backports main/deb http:\/\/deb\.debian\.org\/debian ${VERSION_CODENAME}-backports main contrib non-free/" /etc/apt/sources.list
sed -i "s/deb-src http:\/\/deb\.debian\.org\/debian ${VERSION_CODENAME}-backports main/deb http:\/\/deb\.debian\.org\/debian ${VERSION_CODENAME}-backports main contrib non-free/" /etc/apt/sources.list
# Handle bullseye location for security https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.en.html
sed -i "s/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}-security main/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}-security main contrib non-free/" /etc/apt/sources.list
sed -i "s/deb-src http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}-security main/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}-security main contrib non-free/" /etc/apt/sources.list
echo "Running apt-get update..."
apt-get update
package_list="${package_list} manpages-posix manpages-posix-dev"
else
apt_get_update_if_needed
fi
# Install libssl1.1 if available
if [[ ! -z $(apt-cache --names-only search ^libssl1.1$) ]]; then
package_list="${package_list} libssl1.1"
fi
# Install appropriate version of libssl1.0.x if available
libssl_package=$(dpkg-query -f '${db:Status-Abbrev}\t${binary:Package}\n' -W 'libssl1\.0\.?' 2>&1 || echo '')
if [ "$(echo "$LIlibssl_packageBSSL" | grep -o 'libssl1\.0\.[0-9]:' | uniq | sort | wc -l)" -eq 0 ]; then
if [[ ! -z $(apt-cache --names-only search ^libssl1.0.2$) ]]; then
# Debian 9
package_list="${package_list} libssl1.0.2"
elif [[ ! -z $(apt-cache --names-only search ^libssl1.0.0$) ]]; then
# Ubuntu 18.04, 16.04, earlier
package_list="${package_list} libssl1.0.0"
fi
fi
echo "Packages to verify are installed: ${package_list}"
apt-get -y install --no-install-recommends ${package_list} 2> >( grep -v 'debconf: delaying package configuration, since apt-utils is not installed' >&2 )
# Install git if not already installed (may be more recent than distro version)
if ! type git > /dev/null 2>&1; then
apt-get -y install --no-install-recommends git
fi
PACKAGES_ALREADY_INSTALLED="true"
fi
# Get to latest versions of all packages
if [ "${UPGRADE_PACKAGES}" = "true" ]; then
apt_get_update_if_needed
apt-get -y upgrade --no-install-recommends
apt-get autoremove -y
fi
# Ensure at least the en_US.UTF-8 UTF-8 locale is available.
# Common need for both applications and things like the agnoster ZSH theme.
if [ "${LOCALE_ALREADY_SET}" != "true" ] && ! grep -o -E '^\s*en_US.UTF-8\s+UTF-8' /etc/locale.gen > /dev/null; then
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
LOCALE_ALREADY_SET="true"
fi
# Create or update a non-root user to match UID/GID.
group_name="${USERNAME}"
if id -u ${USERNAME} > /dev/null 2>&1; then
# User exists, update if needed
if [ "${USER_GID}" != "automatic" ] && [ "$USER_GID" != "$(id -g $USERNAME)" ]; then
group_name="$(id -gn $USERNAME)"
groupmod --gid $USER_GID ${group_name}
usermod --gid $USER_GID $USERNAME
fi
if [ "${USER_UID}" != "automatic" ] && [ "$USER_UID" != "$(id -u $USERNAME)" ]; then
usermod --uid $USER_UID $USERNAME
fi
else
# Create user
if [ "${USER_GID}" = "automatic" ]; then
groupadd $USERNAME
else
groupadd --gid $USER_GID $USERNAME
fi
if [ "${USER_UID}" = "automatic" ]; then
useradd -s /bin/bash --gid $USERNAME -m $USERNAME
else
useradd -s /bin/bash --uid $USER_UID --gid $USERNAME -m $USERNAME
fi
fi
# Add sudo support for non-root user
if [ "${USERNAME}" != "root" ] && [ "${EXISTING_NON_ROOT_USER}" != "${USERNAME}" ]; then
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME
chmod 0440 /etc/sudoers.d/$USERNAME
EXISTING_NON_ROOT_USER="${USERNAME}"
fi
# ** Shell customization section **
if [ "${USERNAME}" = "root" ]; then
user_rc_path="/root"
else
user_rc_path="/home/${USERNAME}"
fi
# Restore user .bashrc defaults from skeleton file if it doesn't exist or is empty
if [ ! -f "${user_rc_path}/.bashrc" ] || [ ! -s "${user_rc_path}/.bashrc" ] ; then
cp /etc/skel/.bashrc "${user_rc_path}/.bashrc"
fi
# Restore user .profile defaults from skeleton file if it doesn't exist or is empty
if [ ! -f "${user_rc_path}/.profile" ] || [ ! -s "${user_rc_path}/.profile" ] ; then
cp /etc/skel/.profile "${user_rc_path}/.profile"
fi
# .bashrc/.zshrc snippet
rc_snippet="$(cat << 'EOF'
if [ -z "${USER}" ]; then export USER=$(whoami); fi
if [[ "${PATH}" != *"$HOME/.local/bin"* ]]; then export PATH="${PATH}:$HOME/.local/bin"; fi
# Display optional first run image specific notice if configured and terminal is interactive
if [ -t 1 ] && [[ "${TERM_PROGRAM}" = "vscode" || "${TERM_PROGRAM}" = "codespaces" ]] && [ ! -f "$HOME/.config/vscode-dev-containers/first-run-notice-already-displayed" ]; then
if [ -f "/usr/local/etc/vscode-dev-containers/first-run-notice.txt" ]; then
cat "/usr/local/etc/vscode-dev-containers/first-run-notice.txt"
elif [ -f "/workspaces/.codespaces/shared/first-run-notice.txt" ]; then
cat "/workspaces/.codespaces/shared/first-run-notice.txt"
fi
mkdir -p "$HOME/.config/vscode-dev-containers"
# Mark first run notice as displayed after 10s to avoid problems with fast terminal refreshes hiding it
((sleep 10s; touch "$HOME/.config/vscode-dev-containers/first-run-notice-already-displayed") &)
fi
# Set the default git editor if not already set
if [ -z "$(git config --get core.editor)" ] && [ -z "${GIT_EDITOR}" ]; then
if [ "${TERM_PROGRAM}" = "vscode" ]; then
if [[ -n $(command -v code-insiders) && -z $(command -v code) ]]; then
export GIT_EDITOR="code-insiders --wait"
else
export GIT_EDITOR="code --wait"
fi
fi
fi
EOF
)"
# code shim, it fallbacks to code-insiders if code is not available
cat << 'EOF' > /usr/local/bin/code
#!/bin/sh
get_in_path_except_current() {
which -a "$1" | grep -A1 "$0" | grep -v "$0"
}
code="$(get_in_path_except_current code)"
if [ -n "$code" ]; then
exec "$code" "$@"
elif [ "$(command -v code-insiders)" ]; then
exec code-insiders "$@"
else
echo "code or code-insiders is not installed" >&2
exit 127
fi
EOF
chmod +x /usr/local/bin/code
# systemctl shim - tells people to use 'service' if systemd is not running
cat << 'EOF' > /usr/local/bin/systemctl
#!/bin/sh
set -e
if [ -d "/run/systemd/system" ]; then
exec /bin/systemctl "$@"
else
echo '\n"systemd" is not running in this container due to its overhead.\nUse the "service" command to start services instead. e.g.: \n\nservice --status-all'
fi
EOF
chmod +x /usr/local/bin/systemctl
# Codespaces bash and OMZ themes - partly inspired by https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/robbyrussell.zsh-theme
codespaces_bash="$(cat \
<<'EOF'
# Codespaces bash prompt theme
__bash_prompt() {
local userpart='`export XIT=$? \
&& [ ! -z "${GITHUB_USER}" ] && echo -n "\[\033[0;32m\]@${GITHUB_USER} " || echo -n "\[\033[0;32m\]\u " \
&& [ "$XIT" -ne "0" ] && echo -n "\[\033[1;31m\]➜" || echo -n "\[\033[0m\]➜"`'
local gitbranch='`\
if [ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ]; then \
export BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD 2>/dev/null); \
if [ "${BRANCH}" != "" ]; then \
echo -n "\[\033[0;36m\](\[\033[1;31m\]${BRANCH}" \
&& if git ls-files --error-unmatch -m --directory --no-empty-directory -o --exclude-standard ":/*" > /dev/null 2>&1; then \
echo -n " \[\033[1;33m\]✗"; \
fi \
&& echo -n "\[\033[0;36m\]) "; \
fi; \
fi`'
local lightblue='\[\033[1;34m\]'
local removecolor='\[\033[0m\]'
PS1="${userpart} ${lightblue}\w ${gitbranch}${removecolor}\$ "
unset -f __bash_prompt
}
__bash_prompt
EOF
)"
codespaces_zsh="$(cat \
<<'EOF'
# Codespaces zsh prompt theme
__zsh_prompt() {
local prompt_username
if [ ! -z "${GITHUB_USER}" ]; then
prompt_username="@${GITHUB_USER}"
else
prompt_username="%n"
fi
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
PROMPT+='$([ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ] && git_prompt_info)' # Git status
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
unset -f __zsh_prompt
}
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}(%{$fg_bold[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg_bold[yellow]%}✗%{$fg_bold[cyan]%})"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[cyan]%})"
__zsh_prompt
EOF
)"
# Add RC snippet and custom bash prompt
if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
echo "${rc_snippet}" >> /etc/bash.bashrc
echo "${codespaces_bash}" >> "${user_rc_path}/.bashrc"
echo 'export PROMPT_DIRTRIM=4' >> "${user_rc_path}/.bashrc"
if [ "${USERNAME}" != "root" ]; then
echo "${codespaces_bash}" >> "/root/.bashrc"
echo 'export PROMPT_DIRTRIM=4' >> "/root/.bashrc"
fi
chown ${USERNAME}:${group_name} "${user_rc_path}/.bashrc"
RC_SNIPPET_ALREADY_ADDED="true"
fi
# Optionally install and configure zsh and Oh My Zsh!
if [ "${INSTALL_ZSH}" = "true" ]; then
if ! type zsh > /dev/null 2>&1; then
apt_get_update_if_needed
apt-get install -y zsh
fi
if [ "${ZSH_ALREADY_INSTALLED}" != "true" ]; then
echo "${rc_snippet}" >> /etc/zsh/zshrc
ZSH_ALREADY_INSTALLED="true"
fi
# Adapted, simplified inline Oh My Zsh! install steps that adds, defaults to a codespaces theme.
# See https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh for official script.
oh_my_install_dir="${user_rc_path}/.oh-my-zsh"
if [ ! -d "${oh_my_install_dir}" ] && [ "${INSTALL_OH_MYS}" = "true" ]; then
template_path="${oh_my_install_dir}/templates/zshrc.zsh-template"
user_rc_file="${user_rc_path}/.zshrc"
umask g-w,o-w
mkdir -p ${oh_my_install_dir}
git clone --depth=1 \
-c core.eol=lf \
-c core.autocrlf=false \
-c fsck.zeroPaddedFilemode=ignore \
-c fetch.fsck.zeroPaddedFilemode=ignore \
-c receive.fsck.zeroPaddedFilemode=ignore \
"https://github.com/ohmyzsh/ohmyzsh" "${oh_my_install_dir}" 2>&1
echo -e "$(cat "${template_path}")\nDISABLE_AUTO_UPDATE=true\nDISABLE_UPDATE_PROMPT=true" > ${user_rc_file}
sed -i -e 's/ZSH_THEME=.*/ZSH_THEME="codespaces"/g' ${user_rc_file}
mkdir -p ${oh_my_install_dir}/custom/themes
echo "${codespaces_zsh}" > "${oh_my_install_dir}/custom/themes/codespaces.zsh-theme"
# Shrink git while still enabling updates
cd "${oh_my_install_dir}"
git repack -a -d -f --depth=1 --window=1
# Copy to non-root user if one is specified
if [ "${USERNAME}" != "root" ]; then
cp -rf "${user_rc_file}" "${oh_my_install_dir}" /root
chown -R ${USERNAME}:${group_name} "${user_rc_path}"
fi
fi
fi
# Persist image metadata info, script if meta.env found in same directory
meta_info_script="$(cat << 'EOF'
#!/bin/sh
. /usr/local/etc/vscode-dev-containers/meta.env
# Minimal output
if [ "$1" = "version" ] || [ "$1" = "image-version" ]; then
echo "${VERSION}"
exit 0
elif [ "$1" = "release" ]; then
echo "${GIT_REPOSITORY_RELEASE}"
exit 0
elif [ "$1" = "content" ] || [ "$1" = "content-url" ] || [ "$1" = "contents" ] || [ "$1" = "contents-url" ]; then
echo "${CONTENTS_URL}"
exit 0
fi
#Full output
echo
echo "Development container image information"
echo
if [ ! -z "${VERSION}" ]; then echo "- Image version: ${VERSION}"; fi
if [ ! -z "${DEFINITION_ID}" ]; then echo "- Definition ID: ${DEFINITION_ID}"; fi
if [ ! -z "${VARIANT}" ]; then echo "- Variant: ${VARIANT}"; fi
if [ ! -z "${GIT_REPOSITORY}" ]; then echo "- Source code repository: ${GIT_REPOSITORY}"; fi
if [ ! -z "${GIT_REPOSITORY_RELEASE}" ]; then echo "- Source code release/branch: ${GIT_REPOSITORY_RELEASE}"; fi
if [ ! -z "${BUILD_TIMESTAMP}" ]; then echo "- Timestamp: ${BUILD_TIMESTAMP}"; fi
if [ ! -z "${CONTENTS_URL}" ]; then echo && echo "More info: ${CONTENTS_URL}"; fi
echo
EOF
)"
if [ -f "${SCRIPT_DIR}/meta.env" ]; then
mkdir -p /usr/local/etc/vscode-dev-containers/
cp -f "${SCRIPT_DIR}/meta.env" /usr/local/etc/vscode-dev-containers/meta.env
echo "${meta_info_script}" > /usr/local/bin/devcontainer-info
chmod +x /usr/local/bin/devcontainer-info
fi
# Write marker file
mkdir -p "$(dirname "${MARKER_FILE}")"
echo -e "\
PACKAGES_ALREADY_INSTALLED=${PACKAGES_ALREADY_INSTALLED}\n\
LOCALE_ALREADY_SET=${LOCALE_ALREADY_SET}\n\
EXISTING_NON_ROOT_USER=${EXISTING_NON_ROOT_USER}\n\
RC_SNIPPET_ALREADY_ADDED=${RC_SNIPPET_ALREADY_ADDED}\n\
ZSH_ALREADY_INSTALLED=${ZSH_ALREADY_INSTALLED}" > "${MARKER_FILE}"
echo "Done!"

View File

@@ -0,0 +1,16 @@
#!/bin/bash
echo "To get started, login to GitHub and clone bun's GitHub repo into /build/bun"
echo "If it fails to open a browser, login with a Personal Access Token instead"
echo "# First time setup"
echo "gh auth login"
echo "gh repo clone oven-sh/bun . -- --depth=1 --progress -j8"
echo ""
echo "# Compile bun dependencies (zig is already compiled)"
echo "make devcontainer"
echo ""
echo "# Build bun for development"
echo "make dev"
echo ""
echo "# Run bun"
echo "bun-debug"

View File

@@ -0,0 +1,207 @@
#!/usr/bin/env bash
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
#
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/github.md
# Maintainer: The VS Code and Codespaces Teams
#
# Syntax: ./github-debian.sh [version]
CLI_VERSION=${1:-"latest"}
GITHUB_CLI_ARCHIVE_GPG_KEY=C99B11DEB97541F0
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com:80
keyserver hkps://keys.openpgp.org
keyserver hkp://keyserver.pgp.com"
set -e
if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
fi
# Get central common setting
get_common_setting() {
if [ "${common_settings_file_loaded}" != "true" ]; then
curl -sfL "https://aka.ms/vscode-dev-containers/script-library/settings.env" -o /tmp/vsdc-settings.env 2>/dev/null || echo "Could not download settings file. Skipping."
common_settings_file_loaded=true
fi
if [ -f "/tmp/vsdc-settings.env" ]; then
local multi_line=""
if [ "$2" = "true" ]; then multi_line="-z"; fi
local result="$(grep ${multi_line} -oP "$1=\"?\K[^\"]+" /tmp/vsdc-settings.env | tr -d '\0')"
if [ ! -z "${result}" ]; then declare -g $1="${result}"; fi
fi
echo "$1=${!1}"
}
# Import the specified key in a variable name passed in as
receive_gpg_keys() {
get_common_setting $1
local keys=${!1}
get_common_setting GPG_KEY_SERVERS true
# Use a temporary locaiton for gpg keys to avoid polluting image
export GNUPGHOME="/tmp/tmp-gnupg"
mkdir -p ${GNUPGHOME}
chmod 700 ${GNUPGHOME}
echo -e "disable-ipv6\n${GPG_KEY_SERVERS}" >${GNUPGHOME}/dirmngr.conf
# GPG key download sometimes fails for some reason and retrying fixes it.
local retry_count=0
local gpg_ok="false"
set +e
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ]; do
echo "(*) Downloading GPG key..."
(echo "${keys}" | xargs -n 1 gpg --recv-keys) 2>&1 && gpg_ok="true"
if [ "${gpg_ok}" != "true" ]; then
echo "(*) Failed getting key, retring in 10s..."
((retry_count++))
sleep 10s
fi
done
set -e
if [ "${gpg_ok}" = "false" ]; then
echo "(!) Failed to get gpg key."
exit 1
fi
}
# Figure out correct version of a three part version number is not passed
find_version_from_git_tags() {
local variable_name=$1
local requested_version=${!variable_name}
if [ "${requested_version}" = "none" ]; then return; fi
local repository=$2
local prefix=${3:-"tags/v"}
local separator=${4:-"."}
local last_part_optional=${5:-"false"}
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
local escaped_separator=${separator//./\\.}
local last_part
if [ "${last_part_optional}" = "true" ]; then
last_part="(${escaped_separator}[0-9]+)?"
else
last_part="${escaped_separator}[0-9]+"
fi
local regex="${prefix}\\K[0-9]+${escaped_separator}[0-9]+${last_part}$"
local version_list="$(git ls-remote --tags ${repository} | grep -oP "${regex}" | tr -d ' ' | tr "${separator}" "." | sort -rV)"
if [ "${requested_version}" = "latest" ] || [ "${requested_version}" = "current" ] || [ "${requested_version}" = "lts" ]; then
declare -g ${variable_name}="$(echo "${version_list}" | head -n 1)"
else
set +e
declare -g ${variable_name}="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")"
set -e
fi
fi
if [ -z "${!variable_name}" ] || ! echo "${version_list}" | grep "^${!variable_name//./\\.}$" >/dev/null 2>&1; then
echo -e "Invalid ${variable_name} value: ${requested_version}\nValid values:\n${version_list}" >&2
exit 1
fi
echo "${variable_name}=${!variable_name}"
}
# Import the specified key in a variable name passed in as
receive_gpg_keys() {
get_common_setting $1
local keys=${!1}
get_common_setting GPG_KEY_SERVERS true
local keyring_args=""
if [ ! -z "$2" ]; then
keyring_args="--no-default-keyring --keyring $2"
fi
# Use a temporary locaiton for gpg keys to avoid polluting image
export GNUPGHOME="/tmp/tmp-gnupg"
mkdir -p ${GNUPGHOME}
chmod 700 ${GNUPGHOME}
echo -e "disable-ipv6\n${GPG_KEY_SERVERS}" >${GNUPGHOME}/dirmngr.conf
# GPG key download sometimes fails for some reason and retrying fixes it.
local retry_count=0
local gpg_ok="false"
set +e
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ]; do
echo "(*) Downloading GPG key..."
(echo "${keys}" | xargs -n 1 gpg -q ${keyring_args} --recv-keys) 2>&1 && gpg_ok="true"
if [ "${gpg_ok}" != "true" ]; then
echo "(*) Failed getting key, retring in 10s..."
((retry_count++))
sleep 10s
fi
done
set -e
if [ "${gpg_ok}" = "false" ]; then
echo "(!) Failed to get gpg key."
exit 1
fi
}
# Function to run apt-get if needed
apt_get_update_if_needed() {
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
echo "Running apt-get update..."
apt-get update
else
echo "Skipping apt-get update."
fi
}
# Checks if packages are installed and installs them if not
check_packages() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
apt_get_update_if_needed
apt-get -y install --no-install-recommends "$@"
fi
}
# Fall back on direct download if no apt package exists
# Fetches .deb file to be installed with dpkg
install_deb_using_github() {
check_packages wget
arch=$(dpkg --print-architecture)
find_version_from_git_tags CLI_VERSION https://github.com/cli/cli
cli_filename="gh_${CLI_VERSION}_linux_${arch}.deb"
mkdir -p /tmp/ghcli
pushd /tmp/ghcli
wget https://github.com/cli/cli/releases/download/v${CLI_VERSION}/${cli_filename}
dpkg -i /tmp/ghcli/${cli_filename}
popd
rm -rf /tmp/ghcli
}
export DEBIAN_FRONTEND=noninteractive
# Install curl, apt-transport-https, curl, gpg, or dirmngr, git if missing
check_packages curl ca-certificates apt-transport-https dirmngr gnupg2
if ! type git >/dev/null 2>&1; then
apt_get_update_if_needed
apt-get -y install --no-install-recommends git
fi
# Soft version matching
if [ "${CLI_VERSION}" != "latest" ] && [ "${CLI_VERSION}" != "lts" ] && [ "${CLI_VERSION}" != "stable" ]; then
find_version_from_git_tags CLI_VERSION "https://github.com/cli/cli"
version_suffix="=${CLI_VERSION}"
else
version_suffix=""
fi
# Install the GitHub CLI
echo "Downloading github CLI..."
install_deb_using_github
# Method below does not work until cli/cli#6175 is fixed
# # Import key safely (new method rather than deprecated apt-key approach) and install
# . /etc/os-release
# receive_gpg_keys GITHUB_CLI_ARCHIVE_GPG_KEY /usr/share/keyrings/githubcli-archive-keyring.gpg
# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" >/etc/apt/sources.list.d/github-cli.list
# apt-get update
# apt-get -y install "gh${version_suffix}"
# rm -rf "/tmp/gh/gnupg"
echo "Done!"

View File

@@ -0,0 +1,7 @@
#!/bin/bash
chsh -s $(which zsh)
sh -c "$(curl -fsSL https://starship.rs/install.sh) -- --platform linux_musl" -- --yes
echo "eval \"$(starship init zsh)\"" >>~/.zshrc
curl https://github.com/Jarred-Sumner/vscode-zig/releases/download/march18/zig-0.2.5.vsix >/home/ubuntu/vscode-zig.vsix

View File

@@ -0,0 +1,8 @@
#!/bin/bash
curl -L https://github.com/zigtools/zls-vscode/releases/download/1.1.6/zls-vscode-1.1.6.vsix >/home/ubuntu/vscode-zig.vsix
git clone https://github.com/zigtools/zls /home/ubuntu/zls
cd /home/ubuntu/zls
git checkout aabdb0c6ecb3c9a47feff2c2bfb9be4e95adf723
git submodule update --init --recursive --progress --depth=1
zig build -Drelease-fast

View File

@@ -0,0 +1,9 @@
{
"folders": [
{
// Source code
"name": "bun",
"path": "bun"
},
]
}

9
.devcontainer/zls.json Normal file
View File

@@ -0,0 +1,9 @@
{
"zig_exe_path": "/build/zig/zig",
"enable_snippets": true,
"warn_style": false,
"enable_semantic_tokens": true,
"operator_completions": true,
"include_at_in_builtins": false,
"max_detail_length": 1048576
}

1539
.docker/chrome.json Normal file

File diff suppressed because it is too large Load Diff

14
.docker/chromium.pref Normal file
View File

@@ -0,0 +1,14 @@
# Note: 2 blank lines are required between entries
Package: *
Pin: release a=eoan
Pin-Priority: 500
Package: *
Pin: origin "ftp.debian.org"
Pin-Priority: 300
# Pattern includes 'chromium', 'chromium-browser' and similarly
# named dependencies:
Package: chromium*
Pin: origin "ftp.debian.org"
Pin-Priority: 700

View File

@@ -0,0 +1,8 @@
#!/bin/bash
set -euxo pipefail
name=$(openssl rand -hex 12)
id=$(docker create --name=bun-binary-$name $CONTAINER_TAG)
docker container cp bun-binary-$name:$BUN_RELEASE_DIR bun-binary
echo -e "bun-binary-$name"

3
.docker/debian.list Normal file
View File

@@ -0,0 +1,3 @@
deb http://deb.debian.org/debian buster main
deb http://deb.debian.org/debian buster-updates main
deb http://deb.debian.org/debian-security buster/updates main

View File

@@ -0,0 +1,34 @@
export DOCKER_BUILDKIT=1
export BUILDKIT_ARCH=$(uname -m)
export ARCH=${BUILDKIT_ARCH}
if [ "$BUILDKIT_ARCH" == "amd64" ]; then
export BUILDKIT_ARCH="amd64"
export ARCH=x64
fi
if [ "$BUILDKIT_ARCH" == "x86_64" ]; then
export BUILDKIT_ARCH="amd64"
export ARCH=x64
fi
if [ "$BUILDKIT_ARCH" == "arm64" ]; then
export BUILDKIT_ARCH="arm64"
export ARCH=aarch64
fi
if [ "$BUILDKIT_ARCH" == "aarch64" ]; then
export BUILDKIT_ARCH="arm64"
export ARCH=aarch64
fi
if [ "$BUILDKIT_ARCH" == "armv7l" ]; then
echo "Unsupported platform: $BUILDKIT_ARCH"
exit 1
fi
export BUILD_ID=$(cat build-id)
export CONTAINER_NAME=bun-linux-$ARCH
export DEBUG_CONTAINER_NAME=debug-bun-linux-$ARCH
export TEMP=/tmp/bun-0.0.$BUILD_ID

11
.docker/pull.sh Normal file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -euxo pipefail
docker pull bunbunbunbun/bun-test-base:latest --platform=linux/amd64
docker pull bunbunbunbun/bun-base:latest --platform=linux/amd64
docker pull bunbunbunbun/bun-base-with-zig-and-webkit:latest --platform=linux/amd64
docker tag bunbunbunbun/bun-test-base:latest bun-base:latest
docker tag bunbunbunbun/bun-base:latest bun-base:latest
docker tag bunbunbunbun/bun-base-with-zig-and-webkit:latest bun-base-with-zig-and-webkit:latest

47
.docker/run-dockerfile.sh Normal file
View File

@@ -0,0 +1,47 @@
#!/bin/bash
source "dockerfile-common.sh"
export $CONTAINER_NAME=$CONTAINER_NAME-local
rm -rf $TEMP
mkdir -p $TEMP
docker build . --target release --progress=plain -t $CONTAINER_NAME:latest --build-arg BUILDKIT_INLINE_CACHE=1 --platform=linux/$BUILDKIT_ARCH --cache-from $CONTAINER_NAME:latest
if (($?)); then
echo "Failed to build container"
exit 1
fi
id=$(docker create $CONTAINER_NAME:latest)
docker cp $id:/home/ubuntu/bun-release $TEMP/$CONTAINER_NAME
if (($?)); then
echo "Failed to cp container"
exit 1
fi
cd $TEMP
mkdir -p $TEMP/$CONTAINER_NAME $TEMP/$DEBUG_CONTAINER_NAME
mv $CONTAINER_NAME/bun-profile $DEBUG_CONTAINER_NAME/bun
zip -r $CONTAINER_NAME.zip $CONTAINER_NAME
zip -r $DEBUG_CONTAINER_NAME.zip $DEBUG_CONTAINER_NAME
docker rm -v $id
abs=$(realpath $TEMP/$CONTAINER_NAME.zip)
debug_abs=$(realpath $TEMP/$DEBUG_CONTAINER_NAME.zip)
case $(uname -s) in
"Linux") target="linux" ;;
*) target="other" ;;
esac
if [ "$target" = "linux" ]; then
if command -v bun --version >/dev/null; then
cp $TEMP/$CONTAINER_NAME/bun $(which bun)
cp $TEMP/$DEBUG_CONTAINER_NAME/bun $(which bun-profile)
fi
fi
echo "Saved to:"
echo $debug_abs
echo $abs

9
.docker/run-test.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
set -euxo pipefail
bun install
bun install --cwd ./test/snippets
bun install --cwd ./test/scripts
make $BUN_TEST_NAME

5
.docker/runner.sh Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
set -euxo pipefail
docker container run --security-opt seccomp=.docker/chrome.json --env GITHUB_WORKSPACE=$GITHUB_WORKSPACE --env BUN_TEST_NAME=$BUN_TEST_NAME --ulimit memlock=-1:-1 --init --rm bun-test:latest

5
.docker/unit-tests.sh Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
set -euxo pipefail
docker container run --security-opt seccomp=.docker/chrome.json --env GITHUB_WORKSPACE=$GITHUB_WORKSPACE --ulimit memlock=-1:-1 --init --rm bun-unit-tests:latest

View File

@@ -1,6 +1,6 @@
node_modules
**/node_modules
src/javascript/jsc/WebKit/LayoutTests
src/bun.js/WebKit/LayoutTests
zig-out
zig-build
**/*.o
@@ -10,5 +10,8 @@ examples
**/.next
.git
src/javascript/jsc/WebKit/WebKitBuild
**/CMakeCache.txt
src/bun.js/WebKit
**/CMakeCache.txt
packages/**/bun
packages/**/bun-profile
zig-cache

10
.gitattributes vendored Normal file
View File

@@ -0,0 +1,10 @@
.vscode/launch.json linguist-generated
src/api/schema.d.ts linguist-generated
fixture.*.c linguist-generated
src/api/schema.js linguist-generated
src/bun.js/bindings/sqlite/sqlite3.c linguist-vendored
src/bun.js/bindings/sqlite/sqlite3_local.h linguist-vendored
*.lockb binary diff=lockb
*.zig text eol=lf
src/bun.js/bindings/simdutf.cpp linguist-vendored
src/bun.js/bindings/simdutf.h linguist-vendored

View File

@@ -0,0 +1,35 @@
name: 📥 Install Problem
description: Report an issue during install or upgrade
labels: [bug, install]
body:
- type: markdown
attributes:
value: |
Thank you for submitting a bug report. It helps make Bun better.
If you need help or support using Bun, and are not reporting an issue, please
join our [Discord](https://discord.gg/CXdq2DP29u) server, where you can ask questions in the [`#help`](https://discord.gg/32EtH6p7HN) forum.
Please try to include as much information as possible.
- type: input
attributes:
label: What platform is your computer?
description: |
For MacOS and Linux: copy the output of `uname -mprs`
For Windows: copy the output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in the PowerShell console
- type: textarea
attributes:
label: How did you attempt to install or upgrade?
description: Please provide the commands you ran to install or upgrade.
validations:
required: true
- type: textarea
attributes:
label: What do you see instead?
description: If possible, please provide text instead of a screenshot.
validations:
required: true
- type: textarea
attributes:
label: Additional information
description: Is there anything else you think we should know?

41
.github/ISSUE_TEMPLATE/2-bug-report.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: 🐛 Bug Report
description: Report an issue that should be fixed
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thank you for submitting a bug report. It helps make Bun better.
If you need help or support using Bun, and are not reporting a bug, please
join our [Discord](https://discord.gg/CXdq2DP29u) server, where you can ask questions in the [`#help`](https://discord.gg/32EtH6p7HN) forum.
Please try to include as much information as possible.
- type: input
attributes:
label: What version of Bun is running?
description: Copy the output of `bun -v`
- type: input
attributes:
label: What platform is your computer?
description: |
For MacOS and Linux: copy the output of `uname -mprs`
For Windows: copy the output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in the PowerShell console
- type: textarea
attributes:
label: What steps can reproduce the bug?
description: Explain the bug and provide a code snippet that can reproduce it.
validations:
required: true
- type: textarea
attributes:
label: What is the expected behavior?
description: If possible, please provide text instead of a screenshot.
- type: textarea
attributes:
label: What do you see instead?
description: If possible, please provide text instead of a screenshot.
- type: textarea
attributes:
label: Additional information
description: Is there anything else you think we should know?

View File

@@ -0,0 +1,24 @@
name: 🚀 Feature Request
description: Suggest an idea, feature, or enhancement
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Thank you for submitting an idea. It helps make Bun better.
If you want to discuss Bun, or learn how others are using Bun, please
join our [Discord](https://discord.gg/CXdq2DP29u) server, where you can share in the [`#feedback-ideas`](https://discord.gg/unwUnHBNqy) channel.
- type: textarea
attributes:
label: What is the problem this feature would solve?
validations:
required: true
- type: textarea
attributes:
label: What is the feature you are proposing to solve the problem?
validations:
required: true
- type: textarea
attributes:
label: What alternatives have you considered?

View File

@@ -0,0 +1,29 @@
name: 📗 Documentation Request
description: Tell us if there is missing or incorrect documentation
labels: [documentation]
body:
- type: markdown
attributes:
value: |
Thank you for submitting a documentation request. It helps make Bun better.
We are working on moving documentation from the [README](https://github.com/oven-sh/bun#table-of-contents) to a documentation website. Please report as many issues or missing content requests as you can so we can incoperate that in the new documentation.
- type: dropdown
attributes:
label: What is the type of issue?
multiple: true
options:
- Documentation is missing
- Documentation is incorrect
- Documentation is confusing
- Example code is not working
- Something else
- type: textarea
attributes:
label: What is the issue?
validations:
required: true
- type: textarea
attributes:
label: Where did you find it?
description: If possible, please provide the URL(s) where you found this issue.

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: 💬 Ask a Question
url: https://discord.com/invite/CXdq2DP29u
about: Join our Discord server for questions, support requests, or just to chat.

47
.github/workflows/bun-dockerhub.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
name: bun-dockerhub
on:
push:
paths:
- dockerhub/Dockerfile
branches:
- main
pull_request:
paths:
- dockerhub/Dockerfile
branches:
- main
release:
types:
- published
jobs:
docker:
runs-on: ubuntu-latest
if: github.repository_owner == 'oven-sh'
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Collect metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ secrets.DOCKERHUB_USERNAME }}/bun
tags: |
type=match,pattern=bun-v(\d.\d.\d),group=1
type=match,pattern=bun-v(\d.\d),group=1
type=match,pattern=bun-v(\d),group=1
type=ref,event=branch
type=ref,event=pr
- name: Login to DockerHub
if: github.event_name == 'release'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@v3
with:
context: ./dockerhub
push: ${{ github.event_name == 'release' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -0,0 +1,41 @@
name: bun-framework-next
on:
push:
paths:
- packages/bun-framework-next/**/*
branches: [main, bun-framework-next-actions]
pull_request:
paths:
- packages/bun-framework-next/**/*
branches: [main]
jobs:
build:
name: lint, test and build on Node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ["14.x"]
os: [macOS-latest]
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install PNPM
uses: pnpm/action-setup@v2.0.1
with:
version: 6.21.0
- name: Install dependencies
run: cd packages/bun-framework-next && pnpm install
- name: Type check bun-framework-next
run: cd packages/bun-framework-next && pnpm check

30
.github/workflows/bun-homebrew.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: bun-homebrew
on:
release:
types:
- published
- edited
jobs:
homebrew:
runs-on: ubuntu-latest
if: github.repository_owner == 'oven-sh' && github.event.release.published_at != null
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v3
with:
repository: oven-sh/homebrew-bun
token: ${{ env.HOMEBREW_TOKEN }}
- id: setup-ruby
name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
- id: update-tap
name: Update Tap
run: ruby scripts/release.rb "${{ github.event.release.tag_name }}"
- id: commit-tap
name: Commit Tap
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Release ${{ github.event.release.tag_name }}

153
.github/workflows/bun-linux-build.yml vendored Normal file
View File

@@ -0,0 +1,153 @@
name: bun-linux
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TEST_TAG: bun-test'
on:
push:
branches:
- main
paths:
- "src/**/*"
- "test/**/*"
- "build.zig"
- "Makefile"
- "Dockerfile"
pull_request:
branches:
- main
paths:
- "src/**/*"
- "test/**/*"
- "build.zig"
- "Makefile"
- "Dockerfile"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
linux:
name: ${{matrix.tag}}
runs-on: ${{matrix.runner}}
timeout-minutes: 90
strategy:
matrix:
include:
- cpu: haswell
tag: linux-x64
arch: x86_64
build_arch: amd64
runner: linux-amd64
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-linux-amd64-lto.tar.gz"
webkit_basename: "bun-webkit-linux-amd64-lto"
build_machine_arch: x86_64
- cpu: westmere
tag: linux-x64-baseline
arch: x86_64
build_arch: amd64
runner: linux-amd64
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-linux-amd64-lto.tar.gz"
webkit_basename: "bun-webkit-linux-amd64-lto"
build_machine_arch: x86_64
- cpu: native
tag: linux-aarch64
arch: aarch64
build_arch: arm64
runner: linux-arm64
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-linux-arm64-lto.tar.gz"
webkit_basename: "bun-webkit-linux-arm64-lto"
build_machine_arch: aarch64
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Run
run: |
rm -rf ${{runner.temp}}/release
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: |
mkdir -p /tmp/.buildx-cache-${{matrix.tag}}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: false
cache-from: type=local,src=/tmp/.buildx-cache-${{matrix.tag}}
cache-to: type=local,dest=/tmp/.buildx-cache-${{matrix.tag}}
build-args: |
ARCH=${{matrix.arch}}
BUILDARCH=${{matrix.build_arch}}
BUILD_MACHINE_ARCH=${{matrix.build_machine_arch}}
CPU_TARGET=${{matrix.cpu}}
WEBKIT_URL=${{matrix.webkit_url}}
GIT_SHA=${{github.sha}}
WEBKIT_BASENAME=${{matrix.webkit_basename}}
platforms: linux/${{matrix.build_arch}}
target: artifact
outputs: type=local,dest=${{runner.temp}}/release
- name: Zip
run: |
# if zip is not found
if [ ! -x "$(command -v zip)" ]; then
sudo apt-get update && sudo apt-get install -y zip --no-install-recommends
fi
if [ ! -x "$(command -v strip)" ]; then
sudo apt-get update && sudo apt-get install -y binutils --no-install-recommends
fi
cd ${{runner.temp}}/release
chmod +x bun-profile bun
mkdir bun-${{matrix.tag}}-profile
mkdir bun-${{matrix.tag}}
strip bun
mv bun-profile bun-${{matrix.tag}}-profile/bun-profile
mv bun bun-${{matrix.tag}}/bun
zip -r bun-${{matrix.tag}}-profile.zip bun-${{matrix.tag}}-profile
zip -r bun-${{matrix.tag}}.zip bun-${{matrix.tag}}
- uses: actions/upload-artifact@v3
with:
name: bun-${{matrix.tag}}-profile
path: ${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip
- uses: actions/upload-artifact@v3
with:
name: bun-${{matrix.tag}}
path: ${{runner.temp}}/release/bun-${{matrix.tag}}.zip
- name: Release
id: release
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/main'
with:
prerelease: true
body: "This canary release of Bun corresponds to the commit [${{ github.sha }}]"
allowUpdates: true
replacesArtifacts: true
generateReleaseNotes: true
artifactErrorsFailBuild: true
token: ${{ secrets.GITHUB_TOKEN }}
name: "Canary (${{github.sha}})"
tag: "canary"
artifacts: "${{runner.temp}}/release/bun-${{matrix.tag}}.zip,${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip"
- uses: actions/upload-artifact@v3
with:
name: bun-obj-${{matrix.tag}}
path: ${{runner.temp}}/release/bun-obj
- uses: actions/upload-artifact@v3
with:
name: ${{matrix.tag}}-dependencies
path: ${{runner.temp}}/release/bun-dependencies

384
.github/workflows/bun-mac-aarch64.yml vendored Normal file
View File

@@ -0,0 +1,384 @@
name: bun-macOS-aarch64
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TEST_TAG: bun-test'
on:
push:
branches: [main]
paths:
- "src/**/*"
- "test/**/*"
- "build.zig"
- "Makefile"
- "Dockerfile"
pull_request:
branches: [main]
paths:
- "src/**/*"
- "test/**/*"
- "build.zig"
- "Makefile"
- "Dockerfile"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
macos-object-files:
name: macOS Object
runs-on: zig-object
strategy:
matrix:
include:
# - cpu: westmere
# arch: x86_64
# tag: bun-obj-darwin-x64-baseline
# - cpu: haswell
# arch: x86_64
# tag: bun-obj-darwin-x64
- cpu: native
arch: aarch64
tag: bun-obj-darwin-aarch64
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Run
run: |
rm -rf ${{runner.temp}}/release
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
if: runner.arch == 'X64'
with:
context: .
push: false
cache-from: type=gha
cache-to: type=gha,mode=min
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=amd64
BUILD_MACHINE_ARCH=x86_64
CPU_TARGET=${{ matrix.cpu }}
TRIPLET=${{matrix.arch}}-macos-none
GIT_SHA=${{github.sha}}
platforms: linux/amd64
target: build_release_obj
outputs: type=local,dest=${{runner.temp}}/release
- name: Build and push
uses: docker/build-push-action@v3
if: runner.arch == 'ARM64'
with:
context: .
push: false
cache-from: type=gha
cache-to: type=gha,mode=min
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=arm64
BUILD_MACHINE_ARCH=aarch64
CPU_TARGET=${{ matrix.cpu }}
TRIPLET=${{matrix.arch}}-macos-none
GIT_SHA=${{github.sha}}
platforms: linux/arm64
target: build_release_obj
outputs: type=local,dest=${{runner.temp}}/release
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.tag }}
path: ${{runner.temp}}/release/bun.o
macOS-cpp:
name: macOS C++
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
strategy:
matrix:
include:
# - cpu: westmere
# arch: x86_64
# tag: bun-darwin-x64-baseline
# obj: bun-obj-darwin-x64-baseline
# runner: macos-11
# artifact: bun-obj-darwin-x64-baseline
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: true
# compile_obj: false
# - cpu: haswell
# arch: x86_64
# tag: bun-darwin-x64
# obj: bun-obj-darwin-x64
# runner: macos-11
# artifact: bun-obj-darwin-x64
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: true
# compile_obj: false
# - cpu: westmere
# arch: x86_64
# tag: bun-darwin-x64-baseline
# obj: bun-obj-darwin-x64-baseline
# runner: macos-11
# artifact: bun-obj-darwin-x64-baseline
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: false
# compile_obj: true
# - cpu: haswell
# arch: x86_64
# tag: bun-darwin-x64
# obj: bun-obj-darwin-x64
# runner: macos-11
# artifact: bun-obj-darwin-x64
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: false
# compile_obj: true
- cpu: native
arch: aarch64
tag: bun-darwin-aarch64
obj: bun-obj-darwin-aarch64
artifact: bun-obj-darwin-aarch64
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-arm64-lto.tar.gz"
runner: macos-arm64
dependencies: true
compile_obj: true
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu)
- name: Install dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix ccache)/bin:\$PATH" >> $GITHUB_ENV
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
brew link --overwrite llvm@15
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-ccache-${{ matrix.tag }}
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}
- name: Download WebKit
if: matrix.compile_obj
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
rm -rf $JSC_BASE_DIR
mkdir -p $JSC_BASE_DIR
curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1
- name: Compile dependencies
if: matrix.dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
mkdir -p $BUN_DEPS_OUT_DIR
make vendor-without-check
- name: Compile C++
if: matrix.compile_obj
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
mkdir -p $OBJ_DIR $BUN_DEPS_OUT_DIR
make clean-bindings
make -j $(sysctl -n hw.ncpu) release-bindings
- name: Upload C++
if: matrix.compile_obj
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.tag }}-cpp
path: ${{ runner.temp }}/bun-cpp-obj
- name: Upload Dependencies
if: matrix.dependencies
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.tag }}-deps
path: ${{runner.temp}}/bun-deps
macOS:
name: macOS Link
runs-on: ${{ matrix.runner }}
needs: [macOS-cpp, macos-object-files]
timeout-minutes: 90
strategy:
matrix:
include:
# - cpu: westmere
# arch: x86_64
# tag: bun-darwin-x64-baseline
# obj: bun-obj-darwin-x64-baseline
# package: bun-darwin-x64
# runner: macos-11
# artifact: bun-obj-darwin-x64-baseline
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
# - cpu: haswell
# arch: x86_64
# tag: bun-darwin-x64
# obj: bun-obj-darwin-x64
# package: bun-darwin-x64
# runner: macos-11
# artifact: bun-obj-darwin-x64
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
- cpu: native
arch: aarch64
tag: bun-darwin-aarch64
obj: bun-obj-darwin-aarch64
package: bun-darwin-aarch64
artifact: bun-obj-darwin-aarch64
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-arm64-lto.tar.gz"
runner: macos-arm64
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu)
- name: Install dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
brew link --overwrite llvm@15
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-ccache-${{ matrix.tag }}-link
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}-link
- name: Download WebKit
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
rm -rf $JSC_BASE_DIR
mkdir -p $JSC_BASE_DIR
curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1
- name: Download C++
uses: actions/download-artifact@v3
with:
name: ${{ matrix.tag }}-cpp
path: ${{ runner.temp }}/bun-cpp-obj
- name: Download Dependencies
uses: actions/download-artifact@v3
with:
name: ${{ matrix.tag }}-deps
path: ${{ runner.temp }}/bun-deps
- name: Download Object
uses: actions/download-artifact@v3
with:
name: ${{ matrix.obj }}
path: ${{ runner.temp }}/release
- name: Link
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
rm -rf packages/${{ matrix.package }}
mkdir -p packages/${{ matrix.package }}
mv ${{ runner.temp }}/release/* packages/${{ matrix.package }}/
make webcrypto bun-link-lld-release copy-to-bun-release-dir-bin
- name: Zip
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
cd ${{runner.temp}}/release
chmod +x bun-profile bun
mkdir ${{matrix.tag}}-profile
mkdir ${{matrix.tag}}
/usr/bin/strip -S bun
mv bun-profile ${{matrix.tag}}-profile/bun-profile
mv bun ${{matrix.tag}}/bun
zip -r ${{matrix.tag}}-profile.zip ${{matrix.tag}}-profile
zip -r ${{matrix.tag}}.zip ${{matrix.tag}}
- uses: actions/upload-artifact@v3
with:
name: ${{matrix.tag}}-profile
path: ${{runner.temp}}/release/${{matrix.tag}}-profile.zip
- uses: actions/upload-artifact@v3
with:
name: ${{matrix.tag}}
path: ${{runner.temp}}/release/${{matrix.tag}}.zip
- name: Release
id: release
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/main'
with:
prerelease: true
body: "This canary release of Bun corresponds to the commit [${{ github.sha }}]"
allowUpdates: true
replacesArtifacts: true
generateReleaseNotes: true
artifactErrorsFailBuild: true
token: ${{ secrets.GITHUB_TOKEN }}
name: "Canary (${{github.sha}})"
tag: "canary"
artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip"

View File

@@ -0,0 +1,388 @@
name: bun-macOS-x64-baseline
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TEST_TAG: bun-test'
on:
push:
branches: [main]
paths:
- "src/**/*"
- "test/**/*"
- "build.zig"
- "Makefile"
- "Dockerfile"
pull_request:
branches: [main]
paths:
- "src/**/*"
- "test/**/*"
- "build.zig"
- "Makefile"
- "Dockerfile"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
macos-object-files:
name: macOS Object
runs-on: zig-object
strategy:
matrix:
include:
- cpu: westmere
arch: x86_64
tag: bun-obj-darwin-x64-baseline
# - cpu: haswell
# arch: x86_64
# tag: bun-obj-darwin-x64
# - cpu: native
# arch: aarch64
# tag: bun-obj-darwin-aarch64
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Run
run: |
rm -rf ${{runner.temp}}/release
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
if: runner.arch == 'X64'
with:
context: .
push: false
cache-from: type=gha
cache-to: type=gha,mode=min
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=amd64
BUILD_MACHINE_ARCH=x86_64
CPU_TARGET=${{ matrix.cpu }}
TRIPLET=${{matrix.arch}}-macos-none
GIT_SHA=${{github.sha}}
platforms: linux/amd64
target: build_release_obj
outputs: type=local,dest=${{runner.temp}}/release
- name: Build and push
uses: docker/build-push-action@v3
if: runner.arch == 'ARM64'
with:
context: .
push: false
cache-from: type=gha
cache-to: type=gha,mode=min
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=arm64
BUILD_MACHINE_ARCH=aarch64
CPU_TARGET=${{ matrix.cpu }}
TRIPLET=${{matrix.arch}}-macos-none
GIT_SHA=${{github.sha}}
platforms: linux/arm64
target: build_release_obj
outputs: type=local,dest=${{runner.temp}}/release
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.tag }}
path: ${{runner.temp}}/release/bun.o
macOS-cpp:
name: macOS C++
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
strategy:
matrix:
include:
- cpu: westmere
arch: x86_64
tag: bun-darwin-x64-baseline
obj: bun-obj-darwin-x64-baseline
runner: macos-11
artifact: bun-obj-darwin-x64-baseline
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
dependencies: true
compile_obj: false
# - cpu: haswell
# arch: x86_64
# tag: bun-darwin-x64
# obj: bun-obj-darwin-x64
# runner: macos-11
# artifact: bun-obj-darwin-x64
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: true
# compile_obj: false
- cpu: westmere
arch: x86_64
tag: bun-darwin-x64-baseline
obj: bun-obj-darwin-x64-baseline
runner: macos-11
artifact: bun-obj-darwin-x64-baseline
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
dependencies: false
compile_obj: true
# - cpu: haswell
# arch: x86_64
# tag: bun-darwin-x64
# obj: bun-obj-darwin-x64
# runner: macos-11
# artifact: bun-obj-darwin-x64
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: false
# compile_obj: true
# - cpu: native
# arch: aarch64
# tag: bun-darwin-aarch64
# obj: bun-obj-darwin-aarch64
# artifact: bun-obj-darwin-aarch64
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
# runner: macos-arm64
# dependencies: true
# compile_obj: true
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu)
- name: Install dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix ccache)/bin:\$PATH" >> $GITHUB_ENV
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
brew link --overwrite llvm@15
- name: ccache (dependencies)
uses: hendrikmuhs/ccache-action@v1.2
if: matrix.dependencies
with:
key: ${{ runner.os }}-ccache-${{ matrix.tag }}-dependencies
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}-dependencies
- name: ccache (c++)
uses: hendrikmuhs/ccache-action@v1.2
if: matrix.compile_obj
with:
key: ${{ runner.os }}-ccache-${{ matrix.tag }}-obj
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}-obj
- name: Download WebKit
if: matrix.compile_obj
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
rm -rf $JSC_BASE_DIR
mkdir -p $JSC_BASE_DIR
curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1
- name: Compile dependencies
if: matrix.dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
mkdir -p $OBJ_DIR $BUN_DEPS_OUT_DIR
make vendor-without-check
- name: Compile C++
if: matrix.compile_obj
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
mkdir -p $OBJ_DIR $BUN_DEPS_OUT_DIR
make -j $(sysctl -n hw.ncpu) release-bindings
- name: Upload C++
if: matrix.compile_obj
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.tag }}-cpp
path: ${{ runner.temp }}/bun-cpp-obj
- name: Upload Dependencies
if: matrix.dependencies
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.tag }}-deps
path: ${{runner.temp}}/bun-deps
macOS:
name: macOS Link
runs-on: ${{ matrix.runner }}
needs: [macOS-cpp, macos-object-files]
timeout-minutes: 90
strategy:
matrix:
include:
- cpu: westmere
arch: x86_64
tag: bun-darwin-x64-baseline
obj: bun-obj-darwin-x64-baseline
package: bun-darwin-x64
runner: macos-11
artifact: bun-obj-darwin-x64-baseline
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
# - cpu: haswell
# arch: x86_64
# tag: bun-darwin-x64
# obj: bun-obj-darwin-x64
# package: bun-darwin-x64
# runner: macos-11
# artifact: bun-obj-darwin-x64
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
# - cpu: native
# arch: aarch64
# tag: bun-darwin-aarch64
# obj: bun-obj-darwin-aarch64
# package: bun-darwin-aarch64
# artifact: bun-obj-darwin-aarch64
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
# runner: macos-arm64
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu)
- name: Install dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
brew link --overwrite llvm@15
- name: ccache (link)
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-ccache-${{ matrix.tag }}-link
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}-link
- name: Download WebKit
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
rm -rf $JSC_BASE_DIR
mkdir -p $JSC_BASE_DIR
curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1
- name: Download C++
uses: actions/download-artifact@v3
with:
name: ${{ matrix.tag }}-cpp
path: ${{ runner.temp }}/bun-cpp-obj
- name: Download Dependencies
uses: actions/download-artifact@v3
with:
name: ${{ matrix.tag }}-deps
path: ${{ runner.temp }}/bun-deps
- name: Download Object
uses: actions/download-artifact@v3
with:
name: ${{ matrix.obj }}
path: ${{ runner.temp }}/release
- name: Link
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
rm -rf packages/${{ matrix.package }}
mkdir -p packages/${{ matrix.package }}
mv ${{ runner.temp }}/release/* packages/${{ matrix.package }}/
make webcrypto bun-link-lld-release copy-to-bun-release-dir-bin
- name: Zip
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
cd ${{runner.temp}}/release
chmod +x bun-profile bun
mkdir ${{matrix.tag}}-profile
mkdir ${{matrix.tag}}
/usr/bin/strip -S bun
mv bun-profile ${{matrix.tag}}-profile/bun-profile
mv bun ${{matrix.tag}}/bun
zip -r ${{matrix.tag}}-profile.zip ${{matrix.tag}}-profile
zip -r ${{matrix.tag}}.zip ${{matrix.tag}}
- uses: actions/upload-artifact@v3
with:
name: ${{matrix.tag}}-profile
path: ${{runner.temp}}/release/${{matrix.tag}}-profile.zip
- uses: actions/upload-artifact@v3
with:
name: ${{matrix.tag}}
path: ${{runner.temp}}/release/${{matrix.tag}}.zip
- name: Release
id: release
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/main'
with:
prerelease: true
body: "This canary release of Bun corresponds to the commit [${{ github.sha }}]"
allowUpdates: true
replacesArtifacts: true
generateReleaseNotes: true
artifactErrorsFailBuild: true
token: ${{ secrets.GITHUB_TOKEN }}
name: "Canary (${{github.sha}})"
tag: "canary"
artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip"

390
.github/workflows/bun-mac-x64.yml vendored Normal file
View File

@@ -0,0 +1,390 @@
name: bun-macOS-x64
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TEST_TAG: bun-test'
on:
push:
branches: [main]
paths:
- "src/**/*"
- "test/**/*"
- "build.zig"
- "Makefile"
- "Dockerfile"
pull_request:
branches: [main]
paths:
- "src/**/*"
- "test/**/*"
- "build.zig"
- "Makefile"
- "Dockerfile"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
macos-object-files:
name: macOS Object
runs-on: zig-object
strategy:
matrix:
include:
# - cpu: westmere
# arch: x86_64
# tag: bun-obj-darwin-x64-baseline
- cpu: haswell
arch: x86_64
tag: bun-obj-darwin-x64
# - cpu: native
# arch: aarch64
# tag: bun-obj-darwin-aarch64
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Run
run: |
rm -rf ${{runner.temp}}/release
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
if: runner.arch == 'X64'
with:
context: .
push: false
cache-from: type=gha
cache-to: type=gha,mode=min
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=amd64
BUILD_MACHINE_ARCH=x86_64
CPU_TARGET=${{ matrix.cpu }}
TRIPLET=${{matrix.arch}}-macos-none
GIT_SHA=${{github.sha}}
platforms: linux/amd64
target: build_release_obj
outputs: type=local,dest=${{runner.temp}}/release
- name: Build and push
uses: docker/build-push-action@v3
if: runner.arch == 'ARM64'
with:
context: .
push: false
cache-from: type=gha
cache-to: type=gha,mode=min
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=arm64
BUILD_MACHINE_ARCH=aarch64
CPU_TARGET=${{ matrix.cpu }}
TRIPLET=${{matrix.arch}}-macos-none
GIT_SHA=${{github.sha}}
platforms: linux/arm64
target: build_release_obj
outputs: type=local,dest=${{runner.temp}}/release
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.tag }}
path: ${{runner.temp}}/release/bun.o
macOS-cpp:
name: macOS C++
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
strategy:
matrix:
include:
# - cpu: westmere
# arch: x86_64
# tag: bun-darwin-x64-baseline
# obj: bun-obj-darwin-x64-baseline
# runner: macos-11
# artifact: bun-obj-darwin-x64-baseline
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: true
# compile_obj: false
- cpu: haswell
arch: x86_64
tag: bun-darwin-x64
obj: bun-obj-darwin-x64
runner: macos-11
artifact: bun-obj-darwin-x64
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
dependencies: true
compile_obj: false
# - cpu: westmere
# arch: x86_64
# tag: bun-darwin-x64-baseline
# obj: bun-obj-darwin-x64-baseline
# runner: macos-11
# artifact: bun-obj-darwin-x64-baseline
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
# dependencies: false
# compile_obj: true
- cpu: haswell
arch: x86_64
tag: bun-darwin-x64
obj: bun-obj-darwin-x64
runner: macos-11
artifact: bun-obj-darwin-x64
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
dependencies: false
compile_obj: true
# - cpu: native
# arch: aarch64
# tag: bun-darwin-aarch64
# obj: bun-obj-darwin-aarch64
# artifact: bun-obj-darwin-aarch64
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-arm64-lto.tar.gz"
# runner: macos-arm64
# dependencies: true
# compile_obj: true
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu)
- name: Install dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
brew link --overwrite llvm@15
- name: Download WebKit
if: matrix.compile_obj
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
rm -rf $JSC_BASE_DIR
mkdir -p $JSC_BASE_DIR
curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1
- name: ccache (dependencies)
uses: hendrikmuhs/ccache-action@v1.2
if: matrix.dependencies
with:
key: ${{ runner.os }}-ccache-${{ matrix.tag }}-dependencies
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}-dependencies
- name: ccache (c++)
uses: hendrikmuhs/ccache-action@v1.2
if: matrix.compile_obj
with:
key: ${{ runner.os }}-ccache-${{ matrix.tag }}-obj
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}-obj
- name: Compile dependencies
if: matrix.dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
mkdir -p $OBJ_DIR $BUN_DEPS_OUT_DIR
make vendor-without-check
- name: Compile C++
if: matrix.compile_obj
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
mkdir -p $OBJ_DIR $BUN_DEPS_OUT_DIR
make -j $(sysctl -n hw.ncpu) release-bindings
- name: Upload C++
if: matrix.compile_obj
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.tag }}-cpp
path: ${{ runner.temp }}/bun-cpp-obj
- name: Upload Dependencies
if: matrix.dependencies
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.tag }}-deps
path: ${{runner.temp}}/bun-deps
macOS:
name: macOS Link
runs-on: ${{ matrix.runner }}
needs: [macOS-cpp, macos-object-files]
timeout-minutes: 90
strategy:
matrix:
include:
# - cpu: westmere
# arch: x86_64
# tag: bun-darwin-x64-baseline
# obj: bun-obj-darwin-x64-baseline
# package: bun-darwin-x64
# runner: macos-11
# artifact: bun-obj-darwin-x64-baseline
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
- cpu: haswell
arch: x86_64
tag: bun-darwin-x64
obj: bun-obj-darwin-x64
package: bun-darwin-x64
runner: macos-11
artifact: bun-obj-darwin-x64
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
# - cpu: native
# arch: aarch64
# tag: bun-darwin-aarch64
# obj: bun-obj-darwin-aarch64
# package: bun-darwin-aarch64
# artifact: bun-obj-darwin-aarch64
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-arm64-lto.tar.gz"
# runner: macos-arm64
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu)
- name: Install dependencies
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
run: |
brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
brew link --overwrite llvm@15
- name: Download WebKit
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
rm -rf $JSC_BASE_DIR
mkdir -p $JSC_BASE_DIR
curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1
- name: Download C++
uses: actions/download-artifact@v3
with:
name: ${{ matrix.tag }}-cpp
path: ${{ runner.temp }}/bun-cpp-obj
- name: Download Dependencies
uses: actions/download-artifact@v3
with:
name: ${{ matrix.tag }}-deps
path: ${{ runner.temp }}/bun-deps
- name: Download Object
uses: actions/download-artifact@v3
with:
name: ${{ matrix.obj }}
path: ${{ runner.temp }}/release
- name: ccache (link)
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-ccache-${{ matrix.tag }}-link
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}-link
- name: Link
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
rm -rf packages/${{ matrix.package }}
mkdir -p packages/${{ matrix.package }}
mv ${{ runner.temp }}/release/* packages/${{ matrix.package }}/
make webcrypto bun-link-lld-release copy-to-bun-release-dir-bin
- name: Zip
env:
CPU_TARGET: ${{ matrix.cpu }}
JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit
JSC_LIB: ${{ runner.temp }}/bun-webkit/lib
BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
BUN_RELEASE_DIR: ${{ runner.temp }}/release
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
run: |
cd ${{runner.temp}}/release
chmod +x bun-profile bun
mkdir ${{matrix.tag}}-profile
mkdir ${{matrix.tag}}
/usr/bin/strip -S bun
mv bun-profile ${{matrix.tag}}-profile/bun-profile
mv bun ${{matrix.tag}}/bun
zip -r ${{matrix.tag}}-profile.zip ${{matrix.tag}}-profile
zip -r ${{matrix.tag}}.zip ${{matrix.tag}}
- uses: actions/upload-artifact@v3
with:
name: ${{matrix.tag}}-profile
path: ${{runner.temp}}/release/${{matrix.tag}}-profile.zip
- uses: actions/upload-artifact@v3
with:
name: ${{matrix.tag}}
path: ${{runner.temp}}/release/${{matrix.tag}}.zip
- name: Release
id: release
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/main'
with:
prerelease: true
body: "This canary release of Bun corresponds to the commit [${{ github.sha }}]"
allowUpdates: true
replacesArtifacts: true
generateReleaseNotes: true
artifactErrorsFailBuild: true
token: ${{ secrets.GITHUB_TOKEN }}
name: "Canary (${{github.sha}})"
tag: "canary"
artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip"

137
.github/workflows/bun-types-release.yml vendored Normal file
View File

@@ -0,0 +1,137 @@
name: Release
on:
workflow_dispatch:
jobs:
test-build:
name: Test & Build
runs-on: ubuntu-latest
if: github.repository_owner == 'oven-sh'
defaults:
run:
working-directory: packages/bun-types
steps:
- uses: actions/checkout@v3
- name: Install bun
uses: xhyrom/setup-bun@v0.1.8
with:
bun-version: canary
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install node
uses: actions/setup-node@v3
with:
node-version: latest
- name: Install dependencies
run: bun install
- name: ESLint
run: bun run lint
- name: Build package
run: bun run build
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: bun-types
path: packages/bun-types/dist/*
if-no-files-found: error
publish-npm:
name: Publish on NPM
runs-on: ubuntu-latest
needs: [test-build]
if: github.repository_owner == 'oven-sh'
defaults:
run:
working-directory: packages/bun-types
steps:
- uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v3
with:
node-version: latest
registry-url: 'https://registry.npmjs.org'
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
name: bun-types
path: packages/bun-types/dist
- name: Publish on NPM
run: cd packages/bun-types/dist/ && npm publish --access public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-gpr:
name: Publish on GPR
runs-on: ubuntu-latest
needs: [test-build]
if: github.repository_owner == 'oven-sh'
defaults:
run:
working-directory: packages/bun-types
steps:
- uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v3
with:
node-version: latest
registry-url: 'https://npm.pkg.github.com/'
scope: '@oven-sh'
- name: Install bun
uses: xhyrom/setup-bun@v0.1.8
with:
bun-version: canary
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
name: bun-types
path: dist
- name: Add scope to name
run: bun scripts/gpr.ts
- name: Publish on GPR
run: cd dist/ && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# no need for separate releases now
# create-release:
# name: Create Release
# runs-on: ubuntu-latest
# needs: [test-build]
# defaults:
# run:
# working-directory: packages/bun-types
# if: github.repository_owner == 'oven-sh'
# steps:
# - name: Download all artifacts
# uses: actions/download-artifact@v3
# with:
# name: bun-types
# path: packages/bun-types/dist
# - name: Set version
# run: echo "version=$(jq --raw-output '.version' dist/package.json)" >> $GITHUB_ENV
# - name: Create Release
# uses: softprops/action-gh-release@v0.1.14
# with:
# tag_name: "v${{ env.version }}"
# body: "This is the release of bun-types that corresponds to the commit [${{ github.sha }}]"
# token: ${{ secrets.GITHUB_TOKEN }}
# files: |
# dist/*

44
.github/workflows/bun-types-tests.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: TypeScript Types
on:
push:
paths:
- packages/bun-types/**/*
branches: [main]
pull_request:
paths:
- packages/bun-types/**/*
jobs:
tests:
name: Build and Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/bun-types
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install bun
uses: xhyrom/setup-bun@v0.1.8
with:
bun-version: latest
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install node
uses: actions/setup-node@v3
with:
node-version: latest
- name: Install dependencies
run: bun install
- name: Generate package
run: bun run build
- name: ESLint
run: bun run lint
- name: Tests
run: bun run test

48
.gitignore vendored
View File

@@ -10,8 +10,10 @@ node_modules
.swcrc
yarn.lock
dist
*.tmp
*.log
*.out.js
*.out.refresh.js
/package-lock.json
build
*.wat
@@ -30,7 +32,6 @@ cover
coverage
coverv
*.trace
bench
github
out.*
out
@@ -65,6 +66,47 @@ release/
sign.*.json
packages/debug-*
packages/bun-cli/postinstall.js
packages/bun-*/bin/*
packages/bun-*/bun
packages/bun-*/bun-profile
packages/bun-*/debug-bun
packages/bun-*/*.o
packages/bun-cli/postinstall.js
packages/bun-cli/bin/*
packages/bun-cli/bin/*
bun-test-scratch
misctools/fetch
src/deps/libiconv
src/deps/openssl
src/tests.zig
*.blob
src/deps/s2n-tls
.npm
.npm.gz
bun-binary
src/deps/PLCrashReporter/
*.dSYM
*.crash
misctools/sha
packages/bun-wasm/*.mjs
packages/bun-wasm/*.cjs
packages/bun-wasm/*.map
packages/bun-wasm/*.js
packages/bun-wasm/*.d.ts
*.bc
src/fallback.version
src/runtime.version
*.sqlite
*.database
*.db
misctools/machbench
*.big
.eslintcache
bun-webkit
src/deps/c-ares/build

76
.gitmodules vendored
View File

@@ -1,15 +1,67 @@
# [submodule "src/deps/zig-clap"]
# path = src/deps/zig-clap
# url = https://github.com/Hejsil/zig-clap
[submodule "src/deps/picohttpparser"]
path = src/deps/picohttpparser
url = https://github.com/h2o/picohttpparser.git
ignore = dirty
path = src/deps/picohttpparser
url = https://github.com/h2o/picohttpparser.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/javascript/jsc/WebKit"]
path = src/javascript/jsc/WebKit
url = git@github.com:/Jarred-Sumner/WebKit
ignore = dirty
path = src/bun.js/WebKit
url = https://github.com/oven-sh/WebKit.git
ignore = dirty
depth = 1
update = none
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/mimalloc"]
path = src/deps/mimalloc
url = https://github.com/microsoft/mimalloc.git
ignore = dirty
path = src/deps/mimalloc
url = https://github.com/Jarred-Sumner/mimalloc.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/zlib"]
path = src/deps/zlib
url = https://github.com/cloudflare/zlib.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/libarchive"]
path = src/deps/libarchive
url = https://github.com/libarchive/libarchive.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/boringssl"]
path = src/deps/boringssl
url = https://github.com/oven-sh/boringssl.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/lol-html"]
path = src/deps/lol-html
url = https://github.com/cloudflare/lol-html
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/uws"]
path = src/deps/uws
url = https://github.com/Jarred-Sumner/uWebSockets
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = true
[submodule "src/deps/tinycc"]
path = src/deps/tinycc
url = https://github.com/Jarred-Sumner/tinycc.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/c-ares"]
path = src/deps/c-ares
url = https://github.com/c-ares/c-ares.git

8
.prettierignore Normal file
View File

@@ -0,0 +1,8 @@
src/fallback.html
# src/test
test/bun.js/solid-dom-fixtures
test/bun.js/bundled
#src/bun.js/builtins
# src/api/demo
test/snapshots
test/snapshots-no-hmr

7
.prettierrc Normal file
View File

@@ -0,0 +1,7 @@
{
"tabWidth": 2,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": true,
"trailingComma": "all"
}

9
.scripts/postinstall.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
set -euxo pipefail
# if bun-webkit node_modules directory exists
if [ -d ./node_modules/bun-webkit ]; then
rm -f bun-webkit
# get the first matching bun-webkit-* directory name
ln -s ./node_modules/$(ls ./node_modules | grep bun-webkit- | head -n 1) ./bun-webkit
fi

View File

@@ -0,0 +1,32 @@
#!/bin/bash
set -euxo pipefail
WEBKIT_VERSION=$(git rev-parse HEAD:./src/bun.js/WebKit)
MIMALLOC_VERSION=$(git rev-parse HEAD:./src/deps/mimalloc)
LIBARCHIVE_VERSION=$(git rev-parse HEAD:./src/deps/libarchive)
PICOHTTPPARSER_VERSION=$(git rev-parse HEAD:./src/deps/picohttpparser)
BORINGSSL_VERSION=$(git rev-parse HEAD:./src/deps/boringssl)
ZLIB_VERSION=$(git rev-parse HEAD:./src/deps/zlib)
UWS_VERSION=$(git rev-parse HEAD:./src/deps/uws)
LOLHTML=$(git rev-parse HEAD:./src/deps/lol-html)
TINYCC=$(git rev-parse HEAD:./src/deps/tinycc)
C_ARES=$(git rev-parse HEAD:./src/deps/c-ares)
USOCKETS=$(cd src/deps/uws/uSockets && git rev-parse HEAD)
rm -rf src/generated_versions_list.zig
echo "// AUTO-GENERATED FILE. Created via .scripts/write-versions.sh" >src/generated_versions_list.zig
echo "" >>src/generated_versions_list.zig
echo "pub const boringssl = \"$BORINGSSL_VERSION\";" >>src/generated_versions_list.zig
echo "pub const libarchive = \"$LIBARCHIVE_VERSION\";" >>src/generated_versions_list.zig
echo "pub const mimalloc = \"$MIMALLOC_VERSION\";" >>src/generated_versions_list.zig
echo "pub const picohttpparser = \"$PICOHTTPPARSER_VERSION\";" >>src/generated_versions_list.zig
echo "pub const uws = \"$UWS_VERSION\";" >>src/generated_versions_list.zig
echo "pub const webkit = \"$WEBKIT_VERSION\";" >>src/generated_versions_list.zig
echo "pub const zig = @import(\"std\").fmt.comptimePrint(\"{}\", .{@import(\"builtin\").zig_version});" >>src/generated_versions_list.zig
echo "pub const zlib = \"$ZLIB_VERSION\";" >>src/generated_versions_list.zig
echo "pub const tinycc = \"$TINYCC\";" >>src/generated_versions_list.zig
echo "pub const lolhtml = \"$LOLHTML\";" >>src/generated_versions_list.zig
echo "pub const c_ares = \"$C_ARES\";" >>src/generated_versions_list.zig
echo "" >>src/generated_versions_list.zig
zig fmt src/generated_versions_list.zig

View File

@@ -2,26 +2,45 @@
"configurations": [
{
"name": "Mac",
"forcedInclude": [
"${workspaceFolder}/src/javascript/jsc/bindings/root.h"
],
"forcedInclude": ["${workspaceFolder}/src/bun.js/bindings/root.h"],
"includePath": [
"${workspaceFolder}/src/JavaScript/jsc/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/",
"${workspaceFolder}/src/JavaScript/jsc/WebKit/WebKitBuild/Release/WTF/Headers",
"${workspaceFolder}/src/JavaScript/jsc/WebKit/WebKitBuild/Release/*",
"${workspaceFolder}/src/JavaScript/jsc/bindings/",
"${workspaceFolder}/src/JavaScript/jsc/WebKit/Source/bmalloc/",
"${workspaceFolder}/src/javascript/jsc/WebKit/WebKitBuild/Release/ICU/Headers/"
"${workspaceFolder}/../webkit-build/include/",
"${workspaceFolder}/bun-webkit/include/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/ICU/Headers/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/WTF/Headers",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/bmalloc/Headers/",
"${workspaceFolder}/src/bun.js/bindings/",
"${workspaceFolder}/src/bun.js/bindings/WebCore/",
"${workspaceFolder}/src/bun.js/bindings/sqlite/",
"${workspaceFolder}/src/bun.js/bindings/webcrypto/",
"${workspaceFolder}/src/bun.js/builtins/",
"${workspaceFolder}/src/bun.js/builtins/cpp",
"${workspaceFolder}/src/deps/boringssl/include/",
"${workspaceFolder}/src/deps",
"${workspaceFolder}/src/deps/uws/uSockets/src"
],
"browse": {
"path": [
"${workspaceFolder}/src/javascript/jsc/bindings/*",
"${workspaceFolder}/src/JavaScript/jsc/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/",
"${workspaceFolder}/src/JavaScript/jsc/WebKit/WebKitBuild/Release/WTF/Headers/**",
"${workspaceFolder}/src/JavaScript/jsc/WebKit/WebKitBuild/Release/*",
"${workspaceFolder}/src/JavaScript/jsc/bindings/**",
"${workspaceFolder}/src/JavaScript/jsc/WebKit/Source/bmalloc/**",
"${workspaceFolder}/src/javascript/jsc/WebKit/WebKitBuild/Release/ICU/Headers/"
"${workspaceFolder}/../webkit-build/include/",
"${workspaceFolder}/bun-webkit/include/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/ICU/Headers/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/**",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/WTF/Headers/**",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/bmalloc/Headers/**",
"${workspaceFolder}/src/bun.js/bindings/*",
"${workspaceFolder}/src/bun.js/bindings/**",
"${workspaceFolder}/src/bun.js/bindings/sqlite/",
"${workspaceFolder}/src/bun.js/bindings/webcrypto/",
"${workspaceFolder}/src/bun.js/builtins/**",
"${workspaceFolder}/src/bun.js/builtins/cpp/**",
"${workspaceFolder}/src/bun.js/modules/**",
"${workspaceFolder}/src/deps",
"${workspaceFolder}/src/deps/boringssl/include/",
"${workspaceFolder}/src/deps/uws/uSockets/src"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ".vscode/cppdb"
@@ -38,10 +57,9 @@
"DU_DISABLE_RENAMING=1"
],
"macFrameworkPath": [],
"compilerPath": "/usr/local/opt/llvm/bin/clang",
"compilerPath": "/opt/homebrew/opt/llvm/bin/clang++",
"cStandard": "c17",
"cppStandard": "c++11",
"intelliSenseMode": "macos-clang-x64"
"cppStandard": "c++20"
}
],
"version": 4

8
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,8 @@
{
"recommendations": [
"AugusteRame.zls-vscode",
"esbenp.prettier-vscode",
"xaver.clang-format",
"vadimcn.vscode-lldb"
]
}

651
.vscode/launch.json generated vendored
View File

@@ -4,539 +4,174 @@
{
"type": "lldb",
"request": "launch",
"name": "Transpile small",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [
// "/Users/jarred/Desktop/webpack4.js"
// "/Users/jarred/Code/bun/examples/css-stress-test/nexty/node_modules/next/dist/build/utils.js"
"./dotenv-load-check.ts"
],
"cwd": "${workspaceFolder}/examples/css-stress-test",
"name": "bun test",
"program": "bun-debug",
"args": ["wiptest", "${file}"],
"cwd": "${workspaceFolder}/test/bun.js",
"env": {
"FORCE_COLOR": "1"
},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Eval Error",
"program": "${workspaceFolder}/build/debug/macos-x86_64/spjs",
"args": [
"error.js",
"--resolve=dev",
"--outdir=outcss"
// "--origin=https://localhost:9000/"
],
"name": "bun test (all)",
"program": "bun-debug",
"args": ["wiptest"],
"cwd": "${workspaceFolder}/test",
"env": {
"FORCE_COLOR": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2"
},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun run current file",
"program": "bun-debug",
"args": ["${file}"],
"cwd": "${file}/../../",
"env": {
"FORCE_COLOR": "1"
},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun run (hot)",
"program": "bun-debug",
"args": ["--hot", "${file}"],
"cwd": "${file}/../../",
"env": {
"FORCE_COLOR": "1"
},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun run",
"program": "bun-debug",
"args": ["check.tsx", "-c"],
"cwd": "${env:HOME}/Build/react-ssr",
"env": {
"FORCE_COLOR": "1"
},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun http example",
"program": "bun-debug",
"args": ["run", "examples/http.ts"],
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1"
},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun http file example",
"program": "bun-debug",
"args": ["run", "examples/bun/http-file.ts"],
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1"
},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun html-rewriter example",
"program": "bun-debug",
"args": ["run", "examples/bun/html-rewriter.ts"],
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1"
},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "HTTP bench",
"program": "${workspaceFolder}/misctools/http_bench",
"args": ["https://twitter.com", "--count=100"],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": ".bun",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [
"./examples/hello-next/node_modules.server.bun"
// "--origin=https://localhost:9000/"
],
"name": "bun build debug",
"program": "bun-debug",
"args": ["build", "--platform=bun", "--outdir=/tmp/testout", "${file}"],
"cwd": "${file}/../../",
"console": "internalConsole",
"env": {
"BUN_CONFIG_MINIFY_WHITESPACE": "1"
}
},
{
"type": "lldb",
"request": "launch",
"name": "bunx debug",
"program": "bun-debug",
"args": ["--bun", "x", "tsc", "--help"],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"env": {
"BUN_DEBUG_QUIET_LOGS": "1"
}
},
{
"type": "lldb",
"request": "launch",
"name": "bun install",
"program": "bun-debug",
"args": ["install"],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"env": {
"BUN_DEBUG_QUIET_LOGS": "1"
}
},
{
"type": "lldb",
"request": "launch",
"name": "fetch debug",
"program": "${workspaceFolder}/misctools/fetch",
"args": ["https://example.com", "--verbose"],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Discord",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [
"discord"
// "--origin=https://localhost:9000/"
],
"name": "Build zig unit test",
"program": "make",
"args": ["build-unit", "${file}"],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Eval",
"program": "${workspaceFolder}/build/debug/macos-x86_64/spjs",
"args": [
"./src/index.tsx"
// "--origin=https://localhost:9000/"
],
"cwd": "${workspaceFolder}/examples/css-stress-test",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Dev Launch",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [
"./simple.css",
"--resolve=dev",
"--outdir=outcss",
"--origin=https://localhost:9000/"
],
"cwd": "${workspaceFolder}/src/test/fixtures",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Linux Launch",
"program": "${workspaceFolder}/packages/debug-bun-cli-linux-x64/bin/bun-debug",
"args": ["--origin=http://jarred-desktop.local:3000/"],
"cwd": "${workspaceFolder}/examples/hello-next",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Release Serve",
"program": "${workspaceFolder}/build/macos-x86_64/bun",
// "args": ["--serve", "--origin=http://localhost:3000"],
"args": ["dev", "--origin=http://localhost:3000"],
"cwd": "${workspaceFolder}/examples/hello-next",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Demo Serve",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
// "args": ["--serve", "--origin=http://localhost:3000"],
"args": ["dev", "--origin=http://localhost:3000"],
"cwd": "${workspaceFolder}/examples/hello-next",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Demo Serve aarch64",
"program": "${workspaceFolder}/build/macos-aarch64/bun",
// "args": ["--serve", "--origin=http://localhost:3000"],
"args": ["dev", "--origin=http://ci.local:3000"],
"cwd": "${workspaceFolder}/examples/hello-next",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Demo Lazy Build",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [
"./src/index.tsx",
"--resolve=lazy",
"--origin=http://localhost:9000/"
],
"cwd": "${workspaceFolder}/examples/simple-react",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Demo Build",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [
"./src/index.tsx",
"--resolve=dev",
"--outdir=outcss",
"--platform=browser",
"--origin=http://localhost:9000/"
],
"cwd": "${workspaceFolder}/examples/css-stress-test",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Fixture serve",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [],
"cwd": "${workspaceFolder}/src/test/fixtures",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Demo .bun",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": ["bun", "--use=bun-framework-next"],
"cwd": "${workspaceFolder}/examples/hello-next",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "PNPM .bun",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": ["bun", "./pages/index.js"],
"cwd": "/Users/jarred/Build/pnpm-bun/packages/app",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "PNPM serve",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [],
"cwd": "/Users/jarred/Build/pnpm-bun/packages/app",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Mixed case resolve",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [
"build",
"./index.js",
"--origin=http://localhost:9000/",
// "--use=./bun-framework-next",
"--platform=browser"
],
"cwd": "${workspaceFolder}/examples/lotta-modules/",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Build .bun lotta-modules",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": ["bun", "./index.js", "--platform=browser"],
"cwd": "${workspaceFolder}/examples/lotta-modules/",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Dev CRA",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": ["dev", "--platform=browser"],
"cwd": "${workspaceFolder}/examples/hello-create-react-app/",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Fragment",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [],
"cwd": "${workspaceFolder}/src/test/fixtures",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Context Bun Bug",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": ["bun", "./code.js"],
"cwd": "/Users/jarred/Build/context/www",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Context Bun",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": ["bun", "--use=next"],
"cwd": "/Users/jarred/Build/context/www",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Bun-hello",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [],
"cwd": "${workspaceFolder}/packages/bun-hello",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Integration Test Dev",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [],
"cwd": "${workspaceFolder}/integration/snippets",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Integration Test Dev (no hmr)",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": ["--disable-hmr"],
"cwd": "${workspaceFolder}/integration/snippets",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Fixtures Dev",
"program": "a",
"args": ["dev"],
"cwd": "${workspaceFolder}/src/test/fixtures",
"console": "internalConsole"
},
{
"type": "cppvsdbg",
"request": "launch",
"name": "Fixtures Rel",
"program": "${workspaceFolder}/build/macos-x86_64/bun",
"args": ["dev"],
"cwd": "${workspaceFolder}/src/test/fixtures",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Context Dev",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [],
"cwd": "/Users/jarred/Build/context/www",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Context Rel",
"program": "${workspaceFolder}/build/macos-x86_64/bun",
"args": [],
"cwd": "/Users/jarred/Build/context/www",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug Dev",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": ["dev"],
"cwd": "${workspaceFolder}/examples/hello-next",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Type-only import",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [
"bun",
"./src/test/fixtures/type-only-import.ts",
"--external=react"
],
"name": "Run zig unit test",
"program": "${workspaceFolder}/zig-out/bin/test",
"args": ["abc"],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Dev lotta-modules",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": ["dev", "./index.js", "--platform=browser"],
"cwd": "${workspaceFolder}/examples/lotta-modules/",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Demo Build .bun",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": [
"bun",
// "./index.js",
"--origin=http://localhost:9000/",
"--use=./bun-framework-next",
"--platform=browser"
],
"cwd": "${workspaceFolder}/examples/hello-next/",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "PNPM Resolve symlink",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": ["--resolve=dev", "test-pnpm.js", "--platform=browser"],
"cwd": "${workspaceFolder}/examples/css-stress-test",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Demo Print .bun",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"args": ["./node_modules.bun"],
"cwd": "${workspaceFolder}/examples/simple-react",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "DAev Launch",
"program": "${workspaceFolder}/build/macos-x86_64/bun",
"args": ["./simple.jsx", "--resolve=disable"],
"cwd": "${workspaceFolder}/src/test/fixtures",
"console": "internalConsole"
},
{
"name": "esbuild",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "/Users/jarred/Code/esbuild/cmd/esbuild",
"cwd": "/Users/jarred/Code/bun/src/test/fixtures",
"args": ["--bundle", "--outfile=out.esbuild.js", "await.ts"]
},
// {
// "type": "lldb",
// "request": "launch",
// "name": "Dev Launch (other)",
// "program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
// "args": ["./simple.jsx", "--resolve=disable"],
// "cwd": "${workspaceFolder}/src/test/fixtures",
// "console": "internalConsole"
// },
// {
// "type": "lldb",
// "request": "launch",
// "name": "Dev Launch",
// "program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
// "preLaunchTask": "build",
// "args": [
// "--resolve=disable",
// "--cwd",
// "/Users/jarredsumner/Code/bun/src/test/fixtures",
// "escape-chars.js"
// ],
// "cwd": "${workspaceFolder}",
// "console": "internalConsole"
// }
// {
// "type": "lldb",
// "request": "launch",
// "name": "Dev Launch",
// "program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
// "preLaunchTask": "build",
// "args": [
// "--resolve=dev",
// "--cwd",
// "/Users/jarredsumner/Builds/esbuild/bench/three/src/",
// "./entry.js",
// "-o",
// "out"
// ],
// "cwd": "/Users/jarredsumner/Builds/esbuild/bench/three/src",
// "console": "internalConsole"
// }
// {
// "type": "lldb",
// "request": "launch",
// "name": "Dev Launch",
// "program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
// "preLaunchTask": "build",
// "args": [
// "--resolve=dev",
// "--cwd",
// "/Users/jarredsumner/Builds/esbuild/bench/three/src/",
// "./entry.js",
// "-o",
// "out"
// ],
// "cwd": "${workspaceFolder}",
// "console": "internalConsole"
// }
// {
// "type": "lldb",
// "request": "launch",
// "name": "Dev Launch",
// "program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
// // "preLaunchTask": "build",
// "args": [
// "--resolve=dev",
// "--cwd",
// "./src/api/demo",
// "pages/index.jsx",
// "-o",
// "out",
// "--origin=https://hello.com/",
// "--serve"
// ],
// "cwd": "${workspaceFolder}",
// "console": "internalConsole"
// }
{
"type": "lldb",
"request": "launch",
"name": "Rome",
// "program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"program": "${workspaceFolder}/build/macos-x86_64/bun",
// "preLaunchTask": "build",
"args": [
"--resolve=dev",
// "--resolve=lazy",
"--cwd",
"${workspaceFolder}/bench/rome/src",
"entry",
"--platform=node",
// "@romejs/js-analysis/evaluators/modules/ImportCall.ts",
"--outdir=${workspaceFolder}/bench/rome/src/out",
// "@romejs/cli-diagnostics/banners/success.json",
"--origin=https://hello.com/"
],
"cwd": "${workspaceFolder}/bench/rome/src",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Rome Dev",
// "program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
"program": "${workspaceFolder}/packages/debug-bun-cli-darwin-x64/bin/bun-debug",
// "preLaunchTask": "build",
"args": [
"--resolve=dev",
// "--resolve=lazy",
"--cwd",
"${workspaceFolder}/bench/rome/src",
"entry",
"--platform=node",
// "@romejs/js-analysis/evaluators/modules/ImportCall.ts",
"--outdir=${workspaceFolder}/bench/rome/src/out",
// "@romejs/cli-diagnostics/banners/success.json",
"--origin=https://hello.com/"
],
"cwd": "${workspaceFolder}/bench/rome/src",
"console": "internalConsole"
}
// {
// "type": "lldb",
// "request": "launch",
// "name": "Dev Launch",
// "program": "${workspaceFolder}/build/bin/debug/bun",
// "preLaunchTask": "build",
// "args": [
// "--resolve=dev",
// "--cwd",
// "/",
// "/Users/jarredsumner/Code/bun/src/test/fixtures/img-bug.js",
// "-o",
// "out"
// ],
// "cwd": "${workspaceFolder}",
// "console": "internalConsole",
// "presentation": {
// "hidden": false,
// "group": "",
// "order": 1
// }
// }
]
}

104
.vscode/settings.json vendored
View File

@@ -3,15 +3,38 @@
"search.quickOpen.includeSymbols": false,
"search.seedWithNearestWord": true,
"search.smartCase": true,
"search.exclude": {
"src/javascript/jsc/WebKit/**/*": true
},
"search.exclude": {},
"search.followSymlinks": false,
"search.useIgnoreFiles": true,
"zig.buildOnSave": false,
"zig.buildArgs": ["obj", "-Dfor-editor"],
"zig.buildOption": "build",
"zig.buildFilePath": "${workspaceFolder}/build.zig",
"[zig]": {
"editor.defaultFormatter": "tiehuis.zig"
"editor.tabSize": 4,
"editor.useTabStops": false,
"editor.defaultFormatter": "tiehuis.zig",
"editor.formatOnSave": true
},
"[ts]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[js]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[jsx]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[tsx]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"zig.beforeDebugCmd": "make build-unit ${file} ${filter} ${bin}",
"zig.testCmd": "make test ${file} ${filter} ${bin}",
"lldb.verboseLogging": false,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
@@ -19,26 +42,42 @@
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"integration/snapshots": true,
"integration/snapshots-no-hmr": true
"**/*.xcworkspacedata": true,
"**/*.xcscheme": true,
"**/*.pem": true,
"**/*.xcodeproj": true,
"test/snapshots": true,
"test/snapshots-no-hmr": true,
"src/bun.js/WebKit": true,
"src/deps/libarchive": true,
"src/deps/mimalloc": true,
"src/deps/s2n-tls": true,
"src/deps/boringssl": true,
"src/deps/openssl": true,
"src/deps/uws": true,
"src/deps/zlib": true,
"src/deps/lol-html": true,
"src/deps/c-ares": true,
"src/deps/tinycc": true,
"test/snippets/package-json-exports/_node_modules_copy": true
},
"C_Cpp.files.exclude": {
"**/.vscode": true,
"src/javascript/jsc/WebKit/JSTests": true,
"src/javascript/jsc/WebKit/Tools": true,
"src/javascript/jsc/WebKit/WebDriverTests": true,
"src/javascript/jsc/WebKit/WebKit.xcworkspace": true,
"src/javascript/jsc/WebKit/WebKitLibraries": true,
"src/javascript/jsc/WebKit/Websites": true,
"src/javascript/jsc/WebKit/resources": true,
"src/javascript/jsc/WebKit/LayoutTests": true,
"src/javascript/jsc/WebKit/ManualTests": true,
"src/javascript/jsc/WebKit/PerformanceTests": true,
"src/javascript/jsc/WebKit/WebKitLegacy": true,
"src/javascript/jsc/WebKit/WebCore": true,
"src/javascript/jsc/WebKit/WebDriver": true,
"src/javascript/jsc/WebKit/WebKitBuild": true,
"src/javascript/jsc/WebKit/WebInspectorUI": true
"src/bun.js/WebKit/JSTests": true,
"src/bun.js/WebKit/Tools": true,
"src/bun.js/WebKit/WebDriverTests": true,
"src/bun.js/WebKit/WebKit.xcworkspace": true,
"src/bun.js/WebKit/WebKitLibraries": true,
"src/bun.js/WebKit/Websites": true,
"src/bun.js/WebKit/resources": true,
"src/bun.js/WebKit/LayoutTests": true,
"src/bun.js/WebKit/ManualTests": true,
"src/bun.js/WebKit/PerformanceTests": true,
"src/bun.js/WebKit/WebKitLegacy": true,
"src/bun.js/WebKit/WebCore": true,
"src/bun.js/WebKit/WebDriver": true,
"src/bun.js/WebKit/WebKitBuild": true,
"src/bun.js/WebKit/WebInspectorUI": true
},
"[cpp]": {
"editor.defaultFormatter": "xaver.clang-format"
@@ -50,6 +89,7 @@
"editor.defaultFormatter": "xaver.clang-format"
},
"files.associations": {
"*.lock": "yarnlock",
"*.idl": "cpp",
"memory": "cpp",
"iostream": "cpp",
@@ -127,8 +167,24 @@
"numeric": "cpp",
"set": "cpp",
"__memory": "cpp",
"memory_resource": "cpp"
"memory_resource": "cpp",
"resource.h": "c",
"sysinfo.h": "c",
"*.tcc": "cpp",
"list": "cpp",
"shared_mutex": "cpp",
"cinttypes": "cpp",
"variant": "cpp",
"sysctl.h": "c",
"interface_adresses.h": "c",
"interface_addresses.h": "c",
"ctype.h": "c",
"ethernet.h": "c",
"inet.h": "c",
"packet.h": "c",
"queue": "cpp"
},
"go.logging.level": "off",
"cmake.configureOnOpen": false
"cmake.configureOnOpen": false,
"C_Cpp.errorSquiggles": "Enabled",
"eslint.workingDirectories": ["packages/bun-types"]
}

25
.vscode/tasks.json vendored
View File

@@ -29,31 +29,6 @@
"showReuseMessage": false,
"clear": true
}
},
{
"label": "test",
"type": "shell",
"command": "zig",
"args": [
"test",
"${file}",
"--main-pkg-path",
"${workspaceFolder}",
"-femit-bin=${workspaceFolder}/zig-out/bin/test",
";",
"true"
],
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"showReuseMessage": false,
"clear": true,
"panel": "new",
"reveal": "always"
}
}
]
}

12
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,12 @@
## Code of conduct
- We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic.
- Please avoid using overtly sexual aliases or other nicknames that might detract from a friendly, safe and welcoming environment for all.
- Please be kind and courteous. Theres no need to be mean or rude.
- Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
- Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
- We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term “harassment” as including the definition in the [Citizen Code of Conduct](https://github.com/stumpsyn/policies/blob/master/citizen_code_of_conduct.md); if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we dont tolerate behavior that excludes people in socially marginalized groups.
- Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or an employee of Oven immediately. Whether youre a regular contributor or a newcomer, we care about making this community a safe place for you and weve got your back.
- Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome.
This code of conduct is adapted from the [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct).

View File

@@ -1,8 +1,628 @@
FROM bun-zig:latest
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
ARG CPU_TARGET=native
ARG ARCH=x86_64
ARG BUILD_MACHINE_ARCH=x86_64
ARG TRIPLET=${ARCH}-linux-gnu
ARG BUILDARCH=amd64
ARG WEBKIT_TAG=jul27-2
ARG ZIG_TAG=jul1
ARG ZIG_VERSION="0.11.0-dev.947+cf822c6dd"
ARG WEBKIT_BASENAME="bun-webkit-linux-$BUILDARCH"
COPY . /home/ubuntu/bun
WORKDIR /home/ubuntu/bun
ARG ZIG_FOLDERNAME=zig-linux-${BUILD_MACHINE_ARCH}-${ZIG_VERSION}
ARG ZIG_FILENAME=${ZIG_FOLDERNAME}.tar.xz
ARG WEBKIT_URL="https://github.com/oven-sh/WebKit/releases/download/$WEBKIT_TAG/${WEBKIT_BASENAME}.tar.gz"
ARG ZIG_URL="https://ziglang.org/builds/${ZIG_FILENAME}"
ARG GIT_SHA=""
ARG BUN_BASE_VERSION=0.4
RUN make vendor-without-check
FROM bitnami/minideb:bullseye as bun-base
RUN install_packages ca-certificates curl wget lsb-release software-properties-common gnupg gnupg1 gnupg2
RUN wget https://apt.llvm.org/llvm.sh && \
chmod +x llvm.sh && \
./llvm.sh 15
RUN install_packages \
cmake \
curl \
file \
git \
gnupg \
libc-dev \
libxml2 \
libxml2-dev \
make \
ninja-build \
perl \
python3 \
rsync \
ruby \
unzip \
xz-utils \
bash tar gzip ccache
ENV CXX=clang++-15
ENV CC=clang-15
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
install_packages nodejs && \
npm install -g esbuild
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG BUILDARCH
ARG ZIG_PATH
ARG WEBKIT_URL
ARG ZIG_URL
ARG ZIG_FOLDERNAME
ARG ZIG_FILENAME
ENV WEBKIT_OUT_DIR=${WEBKIT_DIR}
ENV BUILDARCH=${BUILDARCH}
ENV AR=/usr/bin/llvm-ar-15
ENV ZIG "${ZIG_PATH}/zig"
ENV PATH="$ZIG/bin:$PATH"
ENV LD=lld-15
RUN mkdir -p $BUN_DIR $BUN_DEPS_OUT_DIR
FROM bun-base as bun-base-with-zig-and-webkit
WORKDIR $GITHUB_WORKSPACE
ADD $ZIG_URL .
RUN tar xf ${ZIG_FILENAME} && \
rm ${ZIG_FILENAME} && mv ${ZIG_FOLDERNAME} zig;
WORKDIR $GITHUB_WORKSPACE
ARG GITHUB_WORKSPACE
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG BUILDARCH
ARG ZIG_PATH
ARG WEBKIT_URL
ARG ZIG_URL
ARG WEBKIT_BASENAME
ADD ${WEBKIT_URL} .
RUN mkdir -p ${WEBKIT_DIR} && cd ${GITHUB_WORKSPACE} && \
gunzip ${WEBKIT_BASENAME}.tar.gz && tar -xf ${WEBKIT_BASENAME}.tar && \
cat ${WEBKIT_DIR}/include/cmakeconfig.h > /dev/null
LABEL org.opencontainers.image.title="bun base image with zig & webkit ${BUILDARCH} (glibc)"
LABEL org.opencontainers.image.source=https://github.com/oven-sh/bun
FROM bun-base as c-ares
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
ENV CCACHE_DIR=/ccache
ENV JSC_BASE_DIR=${WEBKIT_DIR}
ENV LIB_ICU_PATH=${WEBKIT_DIR}/lib
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/c-ares ${BUN_DIR}/src/deps/c-ares
WORKDIR $BUN_DIR
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && make c-ares && rm -rf ${BUN_DIR}/src/deps/c-ares ${BUN_DIR}/Makefile
FROM bun-base as lolhtml
RUN install_packages build-essential && curl https://sh.rustup.rs -sSf | sh -s -- -y
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/lol-html ${BUN_DIR}/src/deps/lol-html
ENV CCACHE_DIR=/ccache
RUN --mount=type=cache,target=/ccache export PATH=$PATH:$HOME/.cargo/bin && export CC=$(which clang-15) && cd ${BUN_DIR} && \
make lolhtml && rm -rf src/deps/lol-html Makefile
FROM bun-base as mimalloc
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/mimalloc ${BUN_DIR}/src/deps/mimalloc
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
ENV CCACHE_DIR=/ccache
RUN --mount=type=cache,target=/ccache cd ${BUN_DIR} && \
make mimalloc && rm -rf src/deps/mimalloc Makefile
FROM bun-base as zlib
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/zlib ${BUN_DIR}/src/deps/zlib
WORKDIR $BUN_DIR
ENV CCACHE_DIR=/ccache
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && \
make zlib && rm -rf src/deps/zlib Makefile
FROM bun-base as libarchive
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
RUN install_packages autoconf automake libtool pkg-config
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/libarchive ${BUN_DIR}/src/deps/libarchive
ENV CCACHE_DIR=/ccache
WORKDIR $BUN_DIR
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && \
make libarchive && rm -rf src/deps/libarchive Makefile
FROM bun-base as tinycc
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
RUN install_packages libtcc-dev && cp /usr/lib/$(uname -m)-linux-gnu/libtcc.a ${BUN_DEPS_OUT_DIR}
FROM bun-base as boringssl
RUN install_packages golang
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/boringssl ${BUN_DIR}/src/deps/boringssl
WORKDIR $BUN_DIR
ENV CCACHE_DIR=/ccache
RUN --mount=type=cache,target=/ccache cd ${BUN_DIR} && make boringssl && rm -rf src/deps/boringssl Makefile
FROM bun-base as uws
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/uws ${BUN_DIR}/src/deps/uws
COPY src/deps/zlib ${BUN_DIR}/src/deps/zlib
COPY src/deps/boringssl/include ${BUN_DIR}/src/deps/boringssl/include
COPY src/deps/libuwsockets.cpp ${BUN_DIR}/src/deps/libuwsockets.cpp
COPY src/deps/_libusockets.h ${BUN_DIR}/src/deps/_libusockets.h
WORKDIR $BUN_DIR
RUN cd $BUN_DIR && \
make uws && rm -rf src/deps/uws Makefile
FROM bun-base as picohttp
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/picohttpparser ${BUN_DIR}/src/deps/picohttpparser
COPY src/deps/*.c ${BUN_DIR}/src/deps/
COPY src/deps/*.h ${BUN_DIR}/src/deps/
WORKDIR $BUN_DIR
RUN cd $BUN_DIR && \
make picohttp
FROM bun-base-with-zig-and-webkit as identifier_cache
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
WORKDIR $BUN_DIR
COPY Makefile ${BUN_DIR}/Makefile
COPY src/js_lexer/identifier_data.zig ${BUN_DIR}/src/js_lexer/identifier_data.zig
COPY src/js_lexer/identifier_cache.zig ${BUN_DIR}/src/js_lexer/identifier_cache.zig
RUN cd $BUN_DIR && \
make identifier-cache && rm -rf zig-cache Makefile
FROM bun-base-with-zig-and-webkit as node_fallbacks
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
WORKDIR $BUN_DIR
COPY Makefile ${BUN_DIR}/Makefile
COPY src/node-fallbacks ${BUN_DIR}/src/node-fallbacks
RUN cd $BUN_DIR && \
make node-fallbacks && rm -rf src/node-fallbacks/node_modules Makefile
FROM bun-base-with-zig-and-webkit as prepare_release
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
WORKDIR $BUN_DIR
COPY ./root.zig ${BUN_DIR}/root.zig
COPY ./src ${BUN_DIR}/src
COPY ./build.zig ${BUN_DIR}/build.zig
COPY ./completions ${BUN_DIR}/completions
COPY ./packages ${BUN_DIR}/packages
COPY ./src/build-id ${BUN_DIR}/src/build-id
COPY ./package.json ${BUN_DIR}/package.json
COPY ./misctools ${BUN_DIR}/misctools
COPY Makefile ${BUN_DIR}/Makefile
FROM prepare_release as compile_release_obj
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
WORKDIR $BUN_DIR
ENV JSC_BASE_DIR=${WEBKIT_DIR}
ENV LIB_ICU_PATH=${WEBKIT_DIR}/lib
ARG ARCH
ARG TRIPLET
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
ARG GIT_SHA
ARG BUN_BASE_VERSION
ENV BUN_BASE_VERSION=${BUN_BASE_VERSION}
ENV GIT_SHA=${GIT_SHA}
COPY --from=identifier_cache ${BUN_DIR}/src/js_lexer/*.blob ${BUN_DIR}/src/js_lexer/
COPY --from=node_fallbacks ${BUN_DIR}/src/node-fallbacks/out ${BUN_DIR}/src/node-fallbacks/out
COPY ./src/build-id ${BUN_DIR}/src/build-id
ENV CCACHE_DIR=/ccache
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && mkdir -p src/bun.js/bindings-obj && rm -rf $HOME/.cache zig-cache && make prerelease && \
mkdir -p $BUN_RELEASE_DIR && \
OUTPUT_DIR=/tmp/bun-${TRIPLET}-${GIT_SHA} $ZIG_PATH/zig build obj -Doutput-dir=/tmp/bun-${TRIPLET}-${GIT_SHA} -Drelease-fast -Dtarget="${TRIPLET}" -Dcpu="${CPU_TARGET}" && \
cp /tmp/bun-${TRIPLET}-${GIT_SHA}/bun.o /tmp/bun-${TRIPLET}-${GIT_SHA}/bun-${BUN_BASE_VERSION}.$(cat ${BUN_DIR}/src/build-id).o && cd / && rm -rf $BUN_DIR
FROM scratch as build_release_obj
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG GIT_SHA
ARG TRIPLET
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY --from=compile_release_obj /tmp/bun-${TRIPLET}-${GIT_SHA}/*.o /
FROM prepare_release as compile_cpp
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
WORKDIR $BUN_DIR
ENV JSC_BASE_DIR=${WEBKIT_DIR}
ENV LIB_ICU_PATH=${WEBKIT_DIR}/lib
# Required for `make webcrypto`
COPY src/deps/boringssl/include ${BUN_DIR}/src/deps/boringssl/include
ENV CCACHE_DIR=/ccache
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && mkdir -p src/bun.js/bindings-obj && rm -rf $HOME/.cache zig-cache && mkdir -p $BUN_RELEASE_DIR && make webcrypto && \
make release-bindings -j10 && mv ${BUN_DEPS_OUT_DIR}/libwebcrypto.a /tmp && mv src/bun.js/bindings-obj/* /tmp
FROM bun-base as sqlite
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ENV CCACHE_DIR=/ccache
COPY Makefile ${BUN_DIR}/Makefile
COPY src/bun.js/bindings/sqlite ${BUN_DIR}/src/bun.js/bindings/sqlite
WORKDIR $BUN_DIR
ENV JSC_BASE_DIR=${WEBKIT_DIR}
ENV LIB_ICU_PATH=${WEBKIT_DIR}/lib
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && make sqlite
FROM scratch as build_release_cpp
COPY --from=compile_cpp /tmp/*.o /
COPY --from=compile_cpp /tmp/libwebcrypto.a /
FROM prepare_release as build_release
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
WORKDIR $BUN_DIR
ENV JSC_BASE_DIR=${WEBKIT_DIR}
ENV LIB_ICU_PATH=${WEBKIT_DIR}/lib
COPY --from=zlib ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=libarchive ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=boringssl ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=lolhtml ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=mimalloc ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/
COPY --from=picohttp ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/
COPY --from=sqlite ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/
COPY --from=tinycc ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=uws ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=uws ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/
COPY --from=c-ares ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=build_release_obj /*.o /tmp
COPY --from=build_release_cpp /*.o ${BUN_DIR}/src/bun.js/bindings-obj/
COPY --from=build_release_cpp /*.a ${BUN_DEPS_OUT_DIR}/
RUN cd $BUN_DIR && mkdir -p ${BUN_RELEASE_DIR} && make bun-relink copy-to-bun-release-dir && \
rm -rf $HOME/.cache zig-cache misctools package.json build-id completions build.zig $(BUN_DIR)/packages
FROM scratch as artifact
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
COPY --from=build_release ${BUN_RELEASE_DIR}/bun /bun
COPY --from=build_release ${BUN_RELEASE_DIR}/bun-profile /bun-profile
COPY --from=build_release ${BUN_DEPS_OUT_DIR}/* /bun-dependencies
COPY --from=build_release_obj /*.o /bun-obj
FROM prepare_release as build_unit
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
WORKDIR $BUN_DIR
ENV PATH "$ZIG_PATH:$PATH"
ENV LIB_ICU_PATH "${WEBKIT_DIR}/lib"
CMD make headers \
api \
analytics \
bun_error \
fallback_decoder \
bindings -j10 && \
make \
run-all-unit-tests
# FROM bun-test-base as test_base
# ARG DEBIAN_FRONTEND=noninteractive
# ARG GITHUB_WORKSPACE=/build
# ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
# # Directory extracts to "bun-webkit"
# ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
# ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
# ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
# ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
# ARG BUILDARCH=amd64
# RUN groupadd -r chromium && useradd -d ${BUN_DIR} -M -r -g chromium -G audio,video chromium \
# && mkdir -p /home/chromium/Downloads && chown -R chromium:chromium /home/chromium
# USER chromium
# WORKDIR $BUN_DIR
# ENV NPM_CLIENT bun
# ENV PATH "${BUN_DIR}/packages/bun-linux-x64:${BUN_DIR}/packages/bun-linux-aarch64:$PATH"
# ENV CI 1
# ENV BROWSER_EXECUTABLE /usr/bin/chromium
# COPY ./test ${BUN_DIR}/test
# COPY Makefile ${BUN_DIR}/Makefile
# COPY package.json ${BUN_DIR}/package.json
# COPY .docker/run-test.sh ${BUN_DIR}/run-test.sh
# COPY ./bun.lockb ${BUN_DIR}/bun.lockb
# # # We don't want to worry about architecture differences in this image
# COPY --from=release /opt/bun/bin/bun ${BUN_DIR}/packages/bun-linux-aarch64/bun
# COPY --from=release /opt/bun/bin/bun ${BUN_DIR}/packages/bun-linux-x64/bun
# USER root
# RUN chgrp -R chromium ${BUN_DIR} && chmod g+rwx ${BUN_DIR} && chown -R chromium:chromium ${BUN_DIR}
# USER chromium
# CMD [ "bash", "run-test.sh" ]
# FROM release

126
Dockerfile.devcontainer Normal file
View File

@@ -0,0 +1,126 @@
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG BUILDARCH=amd64
ARG ARCH=x86_64
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
ARG BUN_PACKAGES_DIR=${BUN_DIR}/packages
ARG ZIG_VERSION="0.11.0-dev.947+cf822c6dd"
ARG ZIG_FOLDERNAME=zig-linux-${ARCH}-${ZIG_VERSION}
ARG ZIG_FILENAME=${ZIG_FOLDERNAME}.tar.xz
ARG ZIG_URL="https://ziglang.org/builds/${ZIG_FILENAME}"
FROM --platform=linux/${BUILDARCH} ubuntu:22.04 as bun.devcontainer
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG BUILDARCH
ARG ZIG_PATH
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG BUN_PACKAGES_DIR
ENV WEBKIT_OUT_DIR ${WEBKIT_DIR}
ENV PATH "$ZIG_PATH:$PATH"
ENV JSC_BASE_DIR $WEBKIT_OUT_DIR
ENV LIB_ICU_PATH ${WEBKIT_OUT_DIR}/lib
ENV BUN_RELEASE_DIR ${BUN_RELEASE_DIR}
ENV PATH "${BUN_PACKAGES_DIR}/bun-linux-x64:${BUN_PACKAGES_DIR}/bun-linux-aarch64:${BUN_PACKAGES_DIR}/debug-bun-linux-x64:${BUN_PACKAGES_DIR}/debug-bun-linux-aarch64:$PATH"
ENV PATH "/home/ubuntu/zls/zig-out/bin:$PATH"
ENV BUN_INSTALL /home/ubuntu/.bun
ENV XDG_CONFIG_HOME /home/ubuntu/.config
WORKDIR ${GITHUB_WORKSPACE}
RUN apt-get update && \
apt-get install --no-install-recommends -y wget gnupg2 curl lsb-release wget software-properties-common && \
add-apt-repository ppa:longsleep/golang-backports && \
wget https://apt.llvm.org/llvm.sh --no-check-certificate && \
chmod +x llvm.sh && \
./llvm.sh 15 && \
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get update && \
apt-get install --no-install-recommends -y \
ca-certificates \
curl \
gnupg2 \
software-properties-common \
cmake \
build-essential \
git \
libssl-dev \
ruby \
liblld-15-dev \
libclang-15-dev \
nodejs \
gcc \
g++ \
clang-15 \
clang-format-15 \
libc++-15-dev \
libc++abi-15-dev \
lld-15 \
libicu-dev \
wget \
rustc \
cargo \
unzip \
tar \
golang-go ninja-build pkg-config automake autoconf libtool curl && \
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-15 90 && \
update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-15 90 && \
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-15 90 && \
npm install -g esbuild
ENV CC=clang-15
ENV CXX=clang++-15
ENV ZIG "${ZIG_PATH}/zig"
WORKDIR $GITHUB_WORKSPACE
RUN cd / && mkdir -p $BUN_RELEASE_DIR $BUN_DEPS_OUT_DIR ${BUN_DIR} ${BUN_DEPS_OUT_DIR}
WORKDIR $GITHUB_WORKSPACE
ARG ZIG_FOLDERNAME
ARG ZIG_FILENAME
ARG ZIG_URL
ADD $ZIG_URL .
RUN tar -xf ${ZIG_FILENAME} && \
rm ${ZIG_FILENAME} && \
mv ${ZIG_FOLDERNAME} ${ZIG_PATH};
RUN cd $GITHUB_WORKSPACE && \
curl -o bun-webkit-linux-$BUILDARCH.tar.gz -L https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-linux-$BUILDARCH.tar.gz && \
tar -xzf bun-webkit-linux-$BUILDARCH.tar.gz && \
rm bun-webkit-linux-$BUILDARCH.tar.gz && \
cat $WEBKIT_OUT_DIR/include/cmakeconfig.h > /dev/null
RUN apt-get -y update && update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-15 90
COPY .devcontainer/workspace.code-workspace $GITHUB_WORKSPACE/workspace.code-workspace
COPY .devcontainer/zls.json $GITHUB_WORKSPACE/workspace.code-workspace
COPY .devcontainer/limits.conf /etc/security/limits.conf
COPY ".devcontainer/scripts/" /scripts/
COPY ".devcontainer/scripts/getting-started.sh" $GITHUB_WORKSPACE/getting-started.sh
COPY ".devcontainer/README.md" $GITHUB_WORKSPACE/README.md
ENV JSC_BASE_DIR=$WEBKIT_DIR
ENV WEBKIT_RELEASE_DIR=$WEBKIT_DIR
ENV WEBKIT_DEBUG_DIR=$WEBKIT_DIR
ENV WEBKIT_RELEASE_DIR_LTO=$WEBKIT_DIR
RUN mkdir -p /home/ubuntu/.bun /home/ubuntu/.config $GITHUB_WORKSPACE/bun && \
bash /scripts/common-debian.sh && \
bash /scripts/github.sh && \
bash /scripts/nice.sh && \
bash /scripts/zig-env.sh
COPY .devcontainer/zls.json /home/ubuntu/.config/zls.json

View File

@@ -1,52 +0,0 @@
FROM ubuntu:latest
RUN apt-get update && apt-get install --no-install-recommends -y wget gnupg2 curl lsb-release wget software-properties-common
RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
RUN wget https://apt.llvm.org/llvm.sh --no-check-certificate
RUN chmod +x llvm.sh
RUN ./llvm.sh 12
RUN apt-get update && apt-get install --no-install-recommends -y \
ca-certificates \
curl \
gnupg2 \
software-properties-common \
cmake \
build-essential \
git \
libssl-dev \
ruby \
liblld-12-dev \
libclang-12-dev \
nodejs \
gcc \
g++ \
npm \
clang-12 \
clang-format-12 \
libc++-12-dev \
libc++abi-12-dev \
lld-12 \
libicu-dev
RUN update-alternatives --install /usr/bin/ld ld /usr/bin/lld-12 90 && \
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-12 90 && \
update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-12 90 && \
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-12 90
ENV CC=clang-12
ENV CXX=clang++-12
# Compile zig
RUN mkdir -p /home/ubuntu/zig; cd /home/ubuntu; git clone https://github.com/jarred-sumner/zig.git; cd /home/ubuntu/zig && git checkout jarred/zig-sloppy-with-small-structs && cmake . -DCMAKE_BUILD_TYPE=Release && make -j$(nproc)
ENV PATH="/home/ubuntu/zig:$PATH"
RUN npm install -g esbuild

2086
Makefile

File diff suppressed because it is too large Load Diff

4912
README.md

File diff suppressed because it is too large Load Diff

3
bench/.env Normal file
View File

@@ -0,0 +1,3 @@
BUN=bun
DENO=deno
NODE=node

2
bench/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
ffi/src/target
ffi/src/*.node

13
bench/README.md Normal file
View File

@@ -0,0 +1,13 @@
```bash
npm install
bun run ffi
bun run log
bun run gzip
bun run async
bun run sqlite
# to use custom version of bun/deno/node binary
BUN=path/to/bun bun run ffi
# or edit .env file
```

3
bench/async/.env Normal file
View File

@@ -0,0 +1,3 @@
BUN=bun
DENO=deno
NODE=node

7
bench/async/bun.js Normal file
View File

@@ -0,0 +1,7 @@
import { run, bench } from "mitata";
bench("sync", () => {});
bench("async", async () => {});
bench("await 1", async () => await 1);
await run();

7
bench/async/deno.js Normal file
View File

@@ -0,0 +1,7 @@
import { run, bench } from "../node_modules/mitata/src/cli.mjs";
bench("sync", () => {});
bench("async", async () => {});
bench("await 1", async () => await 1);
await run();

7
bench/async/node.mjs Normal file
View File

@@ -0,0 +1,7 @@
import { run, bench } from "mitata";
bench("sync", () => {});
bench("async", async () => {});
bench("await 1", async () => await 1);
await run();

11
bench/async/package.json Normal file
View File

@@ -0,0 +1,11 @@
{
"name": "bench",
"scripts": {
"deps": "exit 0",
"build": "exit 0",
"bench:bun": "$BUN bun.js",
"bench:node": "$NODE node.mjs",
"bench:deno": "$DENO run -A --unstable deno.js",
"bench": "bun run bench:bun && bun run bench:node && bun run bench:deno"
}
}

BIN
bench/bun.lockb Executable file

Binary file not shown.

5
bench/cat/bun.js Normal file
View File

@@ -0,0 +1,5 @@
import { resolve } from "path";
const { write, stdout, file } = Bun;
const input = resolve(process.argv[process.argv.length - 1]);
await write(stdout, file(input));

12
bench/cat/cat.mjs Normal file
View File

@@ -0,0 +1,12 @@
// works in both bun & node
import { readFileSync } from "node:fs";
const count = parseInt(process.env.ITERATIONS || "1", 10) || 1;
const arg = process.argv.slice(1);
// TODO: remove Buffer.from() when readFileSync() returns Buffer
for (let i = 0; i < count; i++)
console.log(
arg.map((file) => Buffer.from(readFileSync(file, "utf8"))).join("")
);

6
bench/cat/node.js Normal file
View File

@@ -0,0 +1,6 @@
const fs = require("fs");
const path = require("path");
const input = path.resolve(process.argv[process.argv.length - 1]);
fs.createReadStream(input).pipe(process.stdout);

5
bench/copyfile/bun.js Normal file
View File

@@ -0,0 +1,5 @@
import path from "path";
const input = path.resolve(process.argv[process.argv.length - 2]);
const output = path.resolve(process.argv[process.argv.length - 1]);
await Bun.write(Bun.file(output), Bun.file(input));

View File

@@ -0,0 +1,4 @@
import { createReadStream, createWriteStream } from "node:fs";
const arg = process.argv.slice(2);
createReadStream(arg[0]).pipe(createWriteStream(arg[1]));

View File

@@ -0,0 +1,40 @@
import { copyFileSync, writeFileSync, readFileSync, statSync } from "node:fs";
import { bench, run } from "mitata";
function runner(ready) {
for (let size of [1, 10, 100, 1000, 10000, 100000, 1000000, 10000000]) {
const rand = new Int32Array(size);
for (let i = 0; i < size; i++) {
rand[i] = (Math.random() * 1024 * 1024) | 0;
}
const dest = `/tmp/fs-test-copy-file-${(
(Math.random() * 10000000 + 100) |
0
).toString(32)}`;
const src = `/tmp/fs-test-copy-file-${(
(Math.random() * 10000000 + 100) |
0
).toString(32)}`;
writeFileSync(src, Buffer.from(rand.buffer), { encoding: "buffer" });
const { size: fileSize } = statSync(src);
if (fileSize !== rand.byteLength) {
throw new Error("size mismatch");
}
ready(src, dest, new Uint8Array(rand.buffer));
}
}
runner((src, dest, rand) =>
bench(`copyFileSync(${rand.buffer.byteLength} bytes)`, () => {
copyFileSync(src, dest);
// const output = readFileSync(dest).buffer;
// for (let i = 0; i < output.length; i++) {
// if (output[i] !== rand[i]) {
// throw new Error(
// "Files are not equal" + " " + output[i] + " " + rand[i] + " " + i
// );
// }
// }
})
);
await run();

5
bench/copyfile/node.mjs Normal file
View File

@@ -0,0 +1,5 @@
import { copyFileSync } from "node:fs";
const arg = process.argv.slice(2);
copyFileSync(arg[0], arg[1]);

169
bench/expect-to-equal/.gitignore vendored Normal file
View File

@@ -0,0 +1,169 @@
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
# Logs
logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
# Runtime data
pids
_.pid
_.seed
\*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
\*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
\*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
\*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
.cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.\*

View File

@@ -0,0 +1,43 @@
# expect-to-equal
To install dependencies:
```bash
bun install
```
To run in Bun:
```bash
# so it doesn't run the vitest one
bun wiptest expect-to-equal.test.js
```
To run in Jest:
```bash
# If you remove the import the performance doesn't change much
NODE_OPTIONS="--experimental-vm-modules" ./node_modules/.bin/jest expect-to-equal.test.js
```
To run in Vitest:
```bash
./node_modules/.bin/vitest --run expect-to-equal.vitest.test.js
```
Output on my machine (M1):
bun:test (bun v0.3.0):
> [36.40ms] expect().toEqual() x 10000
jest (node v18.11.0)
> expect().toEqual() x 10000: 5053 ms
vitest (node v18.11.0)
> expect().toEqual() x 10000: 401.08ms
This project was created using `bun init` in bun v0.3.0. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.

BIN
bench/expect-to-equal/bun.lockb Executable file

Binary file not shown.

View File

@@ -0,0 +1,42 @@
// bun:test automatically rewrites this import to bun:test when run in bun
import { test, expect } from "@jest/globals";
const N = parseInt(process.env.RUN_COUNT || "10000", 10);
if (!Number.isSafeInteger(N)) {
throw new Error("Invalid RUN_COUNT");
}
const label = "expect().toEqual() x " + N;
test(label, () => {
console.time(label);
for (let runsLeft = N; runsLeft > 0; runsLeft--) {
expect("hello").toEqual("hello");
expect(123).toEqual(123);
expect({ a: 1, b: 2 }).toEqual({ b: 2, a: 1 });
expect([1, 2, 3]).toEqual([1, 2, 3]);
expect({ a: 1, b: 2 }).not.toEqual({ b: 2, a: 1, c: 3 });
expect([1, 2, 3]).not.toEqual([1, 2, 3, 4]);
expect({ a: 1, b: 2, c: 3 }).not.toEqual({ a: 1, b: 2 });
expect([1, 2, 3, 4]).not.toEqual([1, 2, 3]);
let a = [{ a: 1 }, { b: 2, c: 3, d: 4 }, { e: 5, f: 6 }];
let b = [{ a: 1 }, { b: 2, c: 3, d: 4 }, { e: 5, f: 6 }];
expect(a).toEqual(b);
expect(b).toEqual(a);
a[0].a = 2;
expect(a).not.toEqual(b);
expect(b).not.toEqual(a);
let c = { [Symbol("test")]: 1 };
let d = { [Symbol("test")]: 1 };
expect(c).not.toEqual(d);
expect(d).not.toEqual(c);
a = { a: 1, b: 2, c: 3 };
b = { a: 1, b: 2 };
expect(a).not.toEqual(b);
}
console.timeEnd(label);
});

View File

@@ -0,0 +1,41 @@
import { test, expect } from "vitest";
const N = parseInt(process.env.RUN_COUNT || "10000", 10);
if (!Number.isSafeInteger(N)) {
throw new Error("Invalid RUN_COUNT");
}
const label = "expect().toEqual() x " + N;
test(label, () => {
console.time(label);
for (let runsLeft = N; runsLeft > 0; runsLeft--) {
expect("hello").toEqual("hello");
expect(123).toEqual(123);
expect({ a: 1, b: 2 }).toEqual({ b: 2, a: 1 });
expect([1, 2, 3]).toEqual([1, 2, 3]);
expect({ a: 1, b: 2 }).not.toEqual({ b: 2, a: 1, c: 3 });
expect([1, 2, 3]).not.toEqual([1, 2, 3, 4]);
expect({ a: 1, b: 2, c: 3 }).not.toEqual({ a: 1, b: 2 });
expect([1, 2, 3, 4]).not.toEqual([1, 2, 3]);
let a = [{ a: 1 }, { b: 2, c: 3, d: 4 }, { e: 5, f: 6 }];
let b = [{ a: 1 }, { b: 2, c: 3, d: 4 }, { e: 5, f: 6 }];
expect(a).toEqual(b);
expect(b).toEqual(a);
a[0].a = 2;
expect(a).not.toEqual(b);
expect(b).not.toEqual(a);
let c = { [Symbol("test")]: 1 };
let d = { [Symbol("test")]: 1 };
expect(c).not.toEqual(d);
expect(d).not.toEqual(c);
a = { a: 1, b: 2, c: 3 };
b = { a: 1, b: 2 };
expect(a).not.toEqual(b);
}
console.timeEnd(label);
});

View File

@@ -0,0 +1 @@
console.log("Hello via Bun!");

View File

@@ -0,0 +1,9 @@
{
"name": "expect-to-equal",
"module": "index.ts",
"type": "module",
"devDependencies": {
"jest": "^29.3.1",
"vitest": "^0.25.3"
}
}

View File

@@ -0,0 +1,20 @@
{
"compilerOptions": {
"lib": [
"ESNext"
],
"module": "esnext",
"target": "esnext",
"moduleResolution": "nodenext",
"strict": true,
"downlevelIteration": true,
"skipLibCheck": true,
"jsx": "preserve",
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"allowJs": true,
"types": [
"bun-types" // add Bun global
]
}
}

17
bench/fetch/bun.js Normal file
View File

@@ -0,0 +1,17 @@
import { bench, run } from "mitata";
const count = 100;
bench(`fetch(https://example.com) x ${count}`, async () => {
const requests = new Array(count);
for (let i = 0; i < requests.length; i++) {
requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then((r) =>
r.text(),
);
}
await Promise.all(requests);
});
await run();

17
bench/fetch/deno.js Normal file
View File

@@ -0,0 +1,17 @@
import { bench, run } from "https://esm.run/mitata";
const count = 100;
bench(`fetch(https://example.com) x ${count}`, async () => {
const requests = new Array(count);
for (let i = 0; i < requests.length; i++) {
requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then((r) =>
r.text(),
);
}
await Promise.all(requests);
});
await run();

17
bench/fetch/node.mjs Normal file
View File

@@ -0,0 +1,17 @@
import { bench, run } from "mitata";
const count = 100;
bench(`fetch(https://example.com) x ${count}`, async () => {
const requests = new Array(count);
for (let i = 0; i < requests.length; i++) {
requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then((r) =>
r.text()
);
}
await Promise.all(requests);
});
await run();

3
bench/ffi/.env Normal file
View File

@@ -0,0 +1,3 @@
BUN=bun
DENO=deno
NODE=node

36
bench/ffi/bun.js Normal file
View File

@@ -0,0 +1,36 @@
import { ptr, dlopen, CString, toBuffer } from "bun:ffi";
import { run, bench, group } from "mitata";
const { napiNoop, napiHash, napiString } = require(import.meta.dir +
"/src/ffi_napi_bench.node");
const {
symbols: {
ffi_noop: { native: ffi_noop },
ffi_hash: { native: ffi_hash },
ffi_string: { native: ffi_string },
},
} = dlopen(import.meta.dir + "/src/ffi_napi_bench.node", {
ffi_noop: { args: [], returns: "void" },
ffi_string: { args: [], returns: "ptr" },
ffi_hash: { args: ["ptr", "u32"], returns: "u32" },
});
const bytes = new Uint8Array(64);
group("bun:ffi", () => {
bench("noop", () => ffi_noop());
bench("hash", () => ffi_hash(ptr(bytes), bytes.byteLength));
bench("c string", () => new CString(ffi_string()));
});
if (process.env.SHOW_NAPI)
group("bun:napi", () => {
bench("noop", () => napiNoop());
bench("hash", () => napiHash(bytes));
bench("string", () => napiString());
});
await run();

25
bench/ffi/deno.js Normal file
View File

@@ -0,0 +1,25 @@
import { run, bench, group } from "../node_modules/mitata/src/cli.mjs";
const extension = "darwin" !== Deno.build.os ? "so" : "dylib";
const path = new URL(
"src/target/release/libffi_napi_bench." + extension,
import.meta.url,
).pathname;
const {
symbols: { ffi_noop, ffi_hash, ffi_string },
} = Deno.dlopen(path, {
ffi_noop: { parameters: [], result: "void" },
ffi_string: { parameters: [], result: "pointer" },
ffi_hash: { parameters: ["buffer", "u32"], result: "u32" },
});
const bytes = new Uint8Array(64);
group("deno:ffi", () => {
bench("noop", () => ffi_noop());
bench("hash", () => ffi_hash(bytes, bytes.byteLength));
bench("c string", () => Deno.UnsafePointerView.getCString(ffi_string()));
});
await run();

16
bench/ffi/node.mjs Normal file
View File

@@ -0,0 +1,16 @@
import { run, bench, group } from "mitata";
import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
const { napiNoop, napiHash, napiString } = require("./src/ffi_napi_bench.node");
const bytes = new Uint8Array(64);
group("napi", () => {
bench("noop", () => napiNoop());
bench("hash", () => napiHash(bytes));
bench("string", () => napiString());
});
await run();

11
bench/ffi/package.json Normal file
View File

@@ -0,0 +1,11 @@
{
"name": "bench",
"scripts": {
"bench:bun": "$BUN bun.js",
"bench:node": "$NODE node.mjs",
"deps": "cd src && bun run deps",
"build": "cd src && bun run build",
"bench:deno": "$DENO run -A --unstable deno.js",
"bench": "bun run bench:bun && bun run bench:node && bun run bench:deno"
}
}

202
bench/ffi/src/Cargo.lock generated Normal file
View File

@@ -0,0 +1,202 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "aho-corasick"
version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
dependencies = [
"memchr",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "convert_case"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8"
[[package]]
name = "ctor"
version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c"
dependencies = [
"quote",
"syn",
]
[[package]]
name = "ffi_napi_bench"
version = "0.1.0"
dependencies = [
"napi",
"napi-build",
"napi-derive",
]
[[package]]
name = "libloading"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd"
dependencies = [
"cfg-if",
"winapi",
]
[[package]]
name = "memchr"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]]
name = "napi"
version = "2.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3517d4a4af99e0a9960e26332ee1e1bcb9e0298657f58e7e97157a8532dfcd4b"
dependencies = [
"ctor",
"napi-sys",
"once_cell",
"thread_local",
]
[[package]]
name = "napi-build"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "882a73d9ef23e8dc2ebbffb6a6ae2ef467c0f18ac10711e4cc59c5485d41df0e"
[[package]]
name = "napi-derive"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3aaa8a11b0ae982306d311627cafd997ef556abdf1d79a01e6e75bc1ac5cfced"
dependencies = [
"convert_case",
"napi-derive-backend",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "napi-derive-backend"
version = "1.0.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cdb9be87524eccc14f988825b26eaa3752e07a81cb04c34436057823d91e421"
dependencies = [
"convert_case",
"once_cell",
"proc-macro2",
"quote",
"regex",
"syn",
]
[[package]]
name = "napi-sys"
version = "2.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "529671ebfae679f2ce9630b62dd53c72c56b3eb8b2c852e7e2fa91704ff93d67"
dependencies = [
"libloading",
]
[[package]]
name = "once_cell"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
[[package]]
name = "proc-macro2"
version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804"
dependencies = [
"proc-macro2",
]
[[package]]
name = "regex"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.6.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
[[package]]
name = "syn"
version = "1.0.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "thread_local"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180"
dependencies = [
"once_cell",
]
[[package]]
name = "unicode-ident"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c"
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"

18
bench/ffi/src/Cargo.toml Normal file
View File

@@ -0,0 +1,18 @@
[package]
edition = "2021"
version = "0.1.0"
name = "ffi_napi_bench"
[lib]
crate-type = ["cdylib"]
[features]
default = []
enable-napi = []
[dependencies]
napi = "2"
napi-derive = "2"
[build-dependencies]
napi-build = "2.0.1"

5
bench/ffi/src/build.rs Normal file
View File

@@ -0,0 +1,5 @@
#[cfg(feature="enable-napi")] extern crate napi_build;
fn main() {
#[cfg(feature="enable-napi")] napi_build::setup();
}

BIN
bench/ffi/src/bun.lockb Executable file

Binary file not shown.

View File

@@ -0,0 +1,17 @@
{
"name": "bench",
"napi": {
"name": "napi"
},
"dependencies": {
"@napi-rs/cli": "^2.10.1",
"@node-rs/helper": "^1.3.3"
},
"scripts": {
"deps": "bun install",
"build:ffi": "cargo build --release",
"build": "bun run build:napi && bun run build:ffi",
"cleanup": "rm -f index.js index.d.ts && mv napi.*.node ffi_napi_bench.node",
"build:napi": "napi build --release --platform --no-dts-header --features enable-napi && bun run cleanup"
}
}

49
bench/ffi/src/src/lib.rs Normal file
View File

@@ -0,0 +1,49 @@
// double src o.O
#[cfg(feature="enable-napi")] use napi_derive::napi;
#[cfg(feature="enable-napi")] use napi::bindgen_prelude::*;
static STRING: &'static str = "Hello, world!\0";
fn hash(buf: &[u8]) -> u32 {
let mut hash: u32 = 0;
for byte in buf {
hash = hash.wrapping_mul(0x10001000).wrapping_add(*byte as u32);
}
return hash;
}
#[cfg(feature="enable-napi")]
#[napi] pub fn napi_noop() {
// do nothing
}
#[no_mangle] unsafe extern "C" fn ffi_noop() {
// do nothing
}
#[cfg(feature="enable-napi")]
#[napi] pub fn napi_string() -> &'static str {
return &STRING[0..(STRING.len() - 1)];
}
#[no_mangle] unsafe extern "C" fn ffi_string() -> *const u8 {
return STRING.as_ptr();
}
#[cfg(feature="enable-napi")]
#[napi] pub fn napi_hash(buffer: Buffer) -> u32 {
return hash(&buffer);
}
#[no_mangle] unsafe extern "C" fn ffi_hash(ptr: *const u8, length: u32) -> u32 {
return hash(std::slice::from_raw_parts(ptr, length as usize));
}

3
bench/gzip/.env Normal file
View File

@@ -0,0 +1,3 @@
BUN=bun
DENO=deno
NODE=node

20
bench/gzip/bun.js Normal file
View File

@@ -0,0 +1,20 @@
import { run, bench } from "mitata";
import { gzipSync, gunzipSync } from "bun";
const data = new TextEncoder().encode("Hello World!".repeat(9999));
const compressed = gzipSync(data);
bench(`roundtrip - "Hello World!".repeat(9999))`, () => {
gunzipSync(gzipSync(data));
});
bench(`gzipSync("Hello World!".repeat(9999)))`, () => {
gzipSync(data);
});
bench(`gunzipSync("Hello World!".repeat(9999)))`, () => {
gunzipSync(compressed);
});
await run();

85
bench/gzip/deno.js Normal file
View File

@@ -0,0 +1,85 @@
import { run, bench } from "../node_modules/mitata/src/cli.mjs";
const data = new TextEncoder().encode("Hello World!".repeat(9999));
const compressed = await compress(data);
bench(`roundtrip - "Hello World!".repeat(9999))`, async () => {
await decompress(await compress(data));
});
bench(`gzip("Hello World!".repeat(9999)))`, async () => {
await compress(data);
});
bench(`gunzip("Hello World!".repeat(9999)))`, async () => {
await decompress(compressed);
});
await run();
async function compress(buffer) {
const cs = new CompressionStream("gzip");
const writer = cs.writable.getWriter();
writer.write(buffer);
writer.close();
const chunks = [];
const reader = cs.readable.getReader();
let length = 0;
while (true) {
const { done, value } = await reader.read();
if (done) break;
chunks.push(value);
length += value.length;
}
const u8 = new Uint8Array(length);
let offset = 0;
for (const chunk of chunks) {
u8.set(chunk, offset);
offset += chunk.length;
}
return u8;
}
async function decompress(buffer) {
const ds = new DecompressionStream("gzip");
const writer = ds.writable.getWriter();
writer.write(buffer);
writer.close();
const chunks = [];
const reader = ds.readable.getReader();
let length = 0;
while (true) {
const { done, value } = await reader.read();
if (done) break;
chunks.push(value);
length += value.length;
}
const u8 = new Uint8Array(length);
let offset = 0;
for (const chunk of chunks) {
u8.set(chunk, offset);
offset += chunk.length;
}
return u8;
}

20
bench/gzip/node.mjs Normal file
View File

@@ -0,0 +1,20 @@
import { run, bench } from "mitata";
import { gzipSync, gunzipSync } from "zlib";
const data = new TextEncoder().encode("Hello World!".repeat(9999));
const compressed = gzipSync(data);
bench(`roundtrip - "Hello World!".repeat(9999))`, () => {
gunzipSync(gzipSync(data));
});
bench(`gzipSync("Hello World!".repeat(9999)))`, () => {
gzipSync(data);
});
bench(`gunzipSync("Hello World!".repeat(9999)))`, () => {
gunzipSync(compressed);
});
await run();

11
bench/gzip/package.json Normal file
View File

@@ -0,0 +1,11 @@
{
"name": "bench",
"scripts": {
"deps": "exit 0",
"build": "exit 0",
"bench:bun": "$BUN bun.js",
"bench:node": "$NODE node.mjs",
"bench:deno": "$DENO run -A --unstable deno.js",
"bench": "bun run bench:bun && bun run bench:node && bun run bench:deno"
}
}

View File

@@ -0,0 +1,5 @@
bun
next
src/*.mov
src/*.blob

View File

@@ -0,0 +1,77 @@
SLEEP_INTERVAL ?= 32
SCREEN_WIDTH ?= $(shell system_profiler -json SPDisplaysDataType 2>/dev/null | jq -r '.. | objects | select(.spdisplays_main) | ._spdisplays_pixels | split(" ")[0]')
SCREEN_HEIGHT ?= $(shell system_profiler -json SPDisplaysDataType 2>/dev/null | jq -r '.. | objects | select(.spdisplays_main) | ._spdisplays_pixels | split(" ")[2]')
PROJECT ?= bun
PACKAGE_NAME ?= bun-cli
RUN_COUNT ?= 128
ENDPOINT ?= /
ifeq ($(PROJECT),bun)
PACKAGE_NAME := bun-cli
endif
ifeq ($(PROJECT),next)
PACKAGE_NAME := next
endif
generate:
@killall -9 bun next node || echo ""
PROJECT=$(PROJECT) SCREEN_WIDTH=$(SCREEN_WIDTH) SCREEN_HEIGHT=$(SCREEN_HEIGHT) ENDPOINT=$(ENDPOINT) node browser.js
generate-css-in-js:
@killall -9 bun next node || echo ""
PROJECT=$(PROJECT) SCREEN_WIDTH=$(SCREEN_WIDTH) SCREEN_HEIGHT=$(SCREEN_HEIGHT) ENDPOINT=/css-in-js node browser.js
loop:
cp src/colors.css.0 src/colors.css
sleep 3
osascript -e 'tell application "System Events" to tell process "Chromium"' \
-e 'set frontmost to true' \
-e 'if windows is not {} then perform action "AXRaise" of item 1 of windows' \
-e 'end tell'
sleep 0.5
cd src; zig run -Drelease-fast ../color-looper.zig -- ./colors.css:0 $(SLEEP_INTERVAL)
cp src/colors.css.blob $(PROJECT)/colors.css.blob
loop-emotion:
cp src/css-in-js-styles.0 src/css-in-js-styles.tsx
sleep 3
osascript -e 'tell application "System Events" to tell process "Chromium"' \
-e 'set frontmost to true' \
-e 'if windows is not {} then perform action "AXRaise" of item 1 of windows' \
-e 'end tell'
sleep 0.5
cd src; zig run -Drelease-fast ../color-looper.emotion.zig -- ./css-in-js-styles.tsx:0 $(SLEEP_INTERVAL)
cp src/css-in-js-styles.tsx.blob $(PROJECT)/css-in-js-styles.blob
process_video:
rm -rf $(FRAMES_DIR); mkdir -p $(FRAMES_DIR); ffmpeg -i src/colors.css.mov -vf fps=120,format=gray $(FRAMES_DIR)/%d.tif
FRAMES_DIR ?= $(shell mkdir -p ./$(PROJECT)/frames; realpath ./$(PROJECT)/frames)
TIF_FILES := $(wildcard $(FRAMES_DIR)/*.tif)
TXT_FILES := $(wildcard $(FRAMES_DIR)/*.txt)
OBJ_FILES := $(patsubst $(SRC_DIR)/%.tif,$(OBJ_DIR)/%.txt,$(TIF_FILES))
TRIM_FILES := $(patsubst $(SRC_DIR)/%.txt,$(OBJ_DIR)/%.trim,$(TXT_FILES))
frames: $(OBJ_FILES)
$(FRAMES_DIR)/%.txt: $(FRAMES_DIR)/%.tif
tesseract -l eng $< $@
trim: $(TRIM_FILES) cleanup print
$(FRAMES_DIR)/%.trim: $(FRAMES_DIR)/%.txt
(grep "Ran:" $< || echo "\n") >> $(PROJECT)/frames.all
cleanup:
sed 's/^Ran: *//' $(PROJECT)/frames.all | tr -d ' ' | sort | uniq > $(PROJECT)/frames.all.clean
print:
PACKAGE_NAME=$(PACKAGE_NAME) SLEEP_INTERVAL=$(SLEEP_INTERVAL) PROJECT=$(PROJECT) OUTFILE=timings/$(PACKAGE_NAME) node read-frames.js
print-emotion:
PACKAGE_NAME=$(PACKAGE_NAME) SLEEP_INTERVAL=$(SLEEP_INTERVAL) PROJECT=$(PROJECT) OUTFILE=timings/emotion_$(PACKAGE_NAME) node read-frames.js

View File

@@ -0,0 +1,62 @@
# CSS Stress Test
This benchmarks bundler performance for CSS hot reloading.
## Results
bun is 14x faster than Next.js at hot reloading CSS.
```
bun v0.0.34
Saving every 16ms
Frame time:
50th percentile: 22.2ms
75th percentile: 23.9ms
90th percentile: 25.3ms
95th percentile: 43.6ms
99th percentile: 49.1ms
Rendered frames: 922 / 1024 (90%)
```
```
Next.js v11.1.2
Saving every 16ms
Frame time:
50th percentile: 312ms
75th percentile: 337.6ms
90th percentile: 387.7ms
95th percentile: 446.9ms
99th percentile: 591.7ms
Rendered frames: 64 / 1024 (6%)
```
## How it works
It times pixels instead of builds. `color-looper.zig` writes color updates and the timestamp to a css file, while simultaneously screen recording a non-headless Chromium instance. After it finishes, it OCRs the video frames and verifies the scanned timestamps against the actual data. This data measures (1) how long each update took from saving to disk up to the pixels visible on the screen and (2) what % of frames were rendered.
The intent is to be as accurate as possible. Measuring times reported client-side is simpler, but lower accuracy since those times may not correspond to pixels on the screen and do not start from when the data was written to disk (at best, they measure when the filesystem watcher detected the update, but often not that either). `color-looper.zig` must run separately from `browser.js` or the results will be inaccurate.
It works like this:
1. `browser.js` loads either bun or Next.js and a Chromium instance opened to the correct webpage
2. `color-looper.zig` updates [`./src/colors.css`](./src/colors.css) in a loop up to `1024` times (1024 is arbitrary), sleeping every `16`ms or `32`ms (a CLI arg you can pass it). The `var(--timestamp)` CSS variable contains the UTC timestamp with precision of milliseconds and one extra decimal point
3. `color-looper.zig` automatically records the screen via `screencapture` (builtin on macOS) and saves it, along with a `BigUint64Array` containing all the expected timestamps. When it's done, it writes to a designated file on disk which `browser.js` picks up as the signal to close the browser.
4. `ffmpeg` converts each frame into a black and white `.tif` file, which `tesseract` then OCRs
5. Various cleanup scripts extract the timestamp from each of those OCR'd frames into a single file
6. Using the OCR'd data, `./read-frames.js` calculates the 50th, 75th, 90th, 95th, and 99th percentile frame time, along with how many frames were skipped. Frame time is the metric here that matters here because that's how much time elapsed between each update. It includes the artificial sleep interval, so it will not be faster than the sleep interval.
The script `run.sh` runs all the commands necessary to do this work unattended. It takes awhile though. The slow part is OCR'ing all the frames.
To run this, you need:
- `zig`
- `bun-cli`
- `node`
- `tesseract`
- `screencapture` (macOS builtin)
- `ffmpeg`
- `puppeteer` (from the package.json)
You will need to run `bun bun --use next` first, with `next@11.1.2`. It will only run on macOS due to the dependencies on `screencapture`, how it detects screen resolution (so that Chromium is maximized), and how it auto-focuses Chromium (apple script)

View File

@@ -0,0 +1,118 @@
const puppeteer = require("puppeteer");
const http = require("http");
const path = require("path");
const url = require("url");
const fs = require("fs");
const child_process = require("child_process");
const serverURL = process.env.TEST_SERVER_URL || "http://localhost:8080";
if (process.env.PROJECT === "bun") {
const bunFlags = [`--origin=${serverURL}`].filter(Boolean);
const bunExec = process.env.BUN_BIN || "bun";
const bunProcess = child_process.spawn(bunExec, bunFlags, {
cwd: process.cwd(),
stdio: "ignore",
env: {
...process.env,
DISABLE_BUN_ANALYTICS: "1",
},
shell: false,
});
console.log("$", bunExec, bunFlags.join(" "));
const isDebug = bunExec.endsWith("-debug");
// bunProcess.stderr.pipe(process.stderr);
// bunProcess.stdout.pipe(process.stdout);
bunProcess.once("error", (err) => {
console.error("❌ bun error", err);
process.exit(1);
});
process.on("beforeExit", () => {
bunProcess?.kill(0);
});
} else if (process.env.PROJECT === "next") {
const bunProcess = child_process.spawn(
"./node_modules/.bin/next",
["--port", "8080"],
{
cwd: process.cwd(),
stdio: "ignore",
env: {
...process.env,
},
shell: false,
},
);
}
const delay = new Promise((resolve, reject) => {
const watcher = fs.watch(path.resolve(process.cwd(), "src/colors.css.blob"));
watcher.once("change", () => {
setTimeout(() => {
resolve();
}, 1000);
});
});
async function main() {
const browser = await puppeteer.launch({
headless: false,
waitForInitialPage: true,
args: [
`--window-size=${parseInt(process.env.SCREEN_WIDTH || "1024", 10) / 2},${
parseInt(process.env.SCREEN_HEIGHT || "1024", 10) / 2
}`,
],
defaultViewport: {
width: parseInt(process.env.SCREEN_WIDTH || "1024", 10) / 2,
height: parseInt(process.env.SCREEN_HEIGHT || "1024", 10) / 2,
},
});
const promises = [];
let allTestsPassed = true;
async function runPage(key) {
var page;
try {
console.log("Opening page");
page = await browser.newPage();
console.log(`Navigating to "http://localhost:8080/"`);
while (true) {
try {
await page.goto("http://localhost:8080/", { waitUntil: "load" });
break;
} catch (exception) {
if (!exception.toString().includes("ERR_CONNECTION_REFUSED")) break;
}
}
await page.bringToFront();
await delay;
// runner.stdout.pipe(process.stdout);
// runner.stderr.pipe(process.stderr);
var didResolve = false;
console.log(`Completed. Done.`);
} catch (error) {
console.error(error);
} finally {
await page.close();
await browser.close();
}
}
return runPage();
}
main().catch((error) =>
setTimeout(() => {
throw error;
}),
);

Some files were not shown because too many files have changed in this diff Show More