Compare commits

..

1479 Commits

Author SHA1 Message Date
Dylan Conway
374bc3a83b avoid calling toSlice() 2022-11-02 18:53:24 -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
1693 changed files with 167457 additions and 45614 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

@@ -5,9 +5,10 @@
// 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",
"dockerFile": "../Dockerfile.devcontainer",
// Set *default* container specific settings.json values on container create.
"settings": {
@@ -26,12 +27,16 @@
"esbenp.prettier-vscode",
"xaver.clang-format"
],
"postCreateCommand": "cd /build/bun; bash /build/getting-started.sh; zsh",
"postCreateCommand": "cd /build/bun; bash /build/getting-started.sh; cat /build/README.md",
"build": {
"target": "bun.devcontainer",
"cacheFrom": ["bun.devcontainer:latest"],
"args": {}
"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",

View File

@@ -28,7 +28,7 @@ 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
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
@@ -36,7 +36,7 @@ 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
if id -u ${CURRENT_USER} > /dev/null 2>&1; then
USERNAME=${CURRENT_USER}
break
fi
@@ -61,7 +61,8 @@ fi
export DEBIAN_FRONTEND=noninteractive
# Function to call apt-get if needed
apt_get_update_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
@@ -101,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
libkrb5-3 \
libgssapi-krb5-2 \
libicu[0-9][0-9] \
liblttng-ust0 \
liblttng-ust[0-9] \
libstdc++6 \
zlib1g \
locales \
@@ -112,7 +113,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
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
@@ -123,7 +124,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
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 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
@@ -139,7 +140,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
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
@@ -153,10 +154,10 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
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)
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
if ! type git > /dev/null 2>&1; then
apt-get -y install --no-install-recommends git
fi
@@ -172,22 +173,22 @@ 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
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
if id -u ${USERNAME} > /dev/null 2>&1; then
# User exists, update if needed
if [ "${USER_GID}" != "automatic" ] && [ "$USER_GID" != "$(id -g $USERNAME)" ]; then
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
if [ "${USER_UID}" != "automatic" ] && [ "$USER_UID" != "$(id -u $USERNAME)" ]; then
usermod --uid $USER_UID $USERNAME
fi
else
@@ -197,42 +198,43 @@ else
else
groupadd --gid $USER_GID $USERNAME
fi
if [ "${USER_UID}" = "automatic" ]; then
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 add sudo support for non-root user
# 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
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
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"
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"
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'
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
@@ -244,6 +246,7 @@ if [ -t 1 ] && [[ "${TERM_PROGRAM}" = "vscode" || "${TERM_PROGRAM}" = "codespace
# 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
@@ -254,16 +257,20 @@ if [ -z "$(git config --get core.editor)" ] && [ -z "${GIT_EDITOR}" ]; then
fi
fi
fi
EOF
)"
# code shim, it fallbacks to code-insiders if code is not available
cat <<'EOF' >/usr/local/bin/code
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
@@ -276,21 +283,21 @@ 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
cat << 'EOF' > /usr/local/bin/systemctl
#!/bin/sh
set -e
if [ -d "/run/systemd/system" ]; then
exec /bin/systemctl/systemctl "$@"
exec /bin/systemctl "$@"
else
echo '\n"systemd" is not running in this container due to its overhead.\nUse the "service" command to start services intead. e.g.: \n\nservice --status-all'
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="$(cat \
<<'EOF'
# Codespaces bash prompt theme
__bash_prompt() {
local userpart='`export XIT=$? \
@@ -313,12 +320,12 @@ __bash_prompt() {
unset -f __bash_prompt
}
__bash_prompt
EOF
)"
codespaces_zsh="$(
cat \
<<'EOF'
codespaces_zsh="$(cat \
<<'EOF'
# Codespaces zsh prompt theme
__zsh_prompt() {
local prompt_username
@@ -338,17 +345,18 @@ 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"
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"
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"
@@ -356,12 +364,12 @@ fi
# Optionally install and configure zsh and Oh My Zsh!
if [ "${INSTALL_ZSH}" = "true" ]; then
if ! type zsh >/dev/null 2>&1; 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
echo "${rc_snippet}" >> /etc/zsh/zshrc
ZSH_ALREADY_INSTALLED="true"
fi
@@ -380,11 +388,11 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
-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}
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"
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
@@ -397,10 +405,10 @@ if [ "${INSTALL_ZSH}" = "true" ]; then
fi
# Persist image metadata info, script if meta.env found in same directory
meta_info_script="$(
cat <<'EOF'
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}"
@@ -412,6 +420,7 @@ elif [ "$1" = "content" ] || [ "$1" = "content-url" ] || [ "$1" = "contents" ] |
echo "${CONTENTS_URL}"
exit 0
fi
#Full output
echo
echo "Development container image information"
@@ -429,7 +438,7 @@ 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
echo "${meta_info_script}" > /usr/local/bin/devcontainer-info
chmod +x /usr/local/bin/devcontainer-info
fi
@@ -440,6 +449,6 @@ echo -e "\
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}"
ZSH_ALREADY_INSTALLED=${ZSH_ALREADY_INSTALLED}" > "${MARKER_FILE}"
echo "Done!"
echo "Done!"

View File

@@ -1,10 +1,10 @@
#!/bin/bash
echo "To get started, login to GitHub and clone bun's GitHub repo into /workspaces/bun"
echo "Make sure to login with a Personal Access Token"
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 Jarred-Sumner/bun . -- --depth=1 --progress -j8"
echo "gh repo clone oven-sh/bun . -- --depth=1 --progress -j8"
echo ""
echo "# Compile bun dependencies (zig is already compiled)"
echo "make devcontainer"

View File

@@ -156,6 +156,23 @@ check_packages() {
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
@@ -175,11 +192,16 @@ fi
# Install the GitHub CLI
echo "Downloading github CLI..."
# 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 ${VERSION_CODENAME} main" >/etc/apt/sources.list.d/github-cli.list
apt-get update
apt-get -y install "gh${version_suffix}"
rm -rf "/tmp/gh/gnupg"
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

@@ -1,7 +1,7 @@
#!/bin/bash
chsh -s $(which zsh)
sh -c "$(curl -fsSL https://starship.rs/install.sh) -- --platform linux_musl"
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/fork-v1/zig-0.2.5.vsix >/home/ubuntu/vscode-zig.vsix
curl https://github.com/Jarred-Sumner/vscode-zig/releases/download/march18/zig-0.2.5.vsix >/home/ubuntu/vscode-zig.vsix

View File

@@ -1,7 +1,7 @@
#!/bin/bash
curl -L https://github.com/Jarred-Sumner/vscode-zig/releases/download/fork-v1/zig-0.2.5.vsix >/home/ubuntu/vscode-zig.vsix
git clone https://github.com/zigtools/zls /home/ubuntu/zls
curl -L https://github.com/Jarred-Sumner/vscode-zig/releases/download/march18/zig-0.2.5.vsix >/home/ubuntu/vscode-zig.vsix
git clone https://github.com/oven-sh/zls /home/ubuntu/zls
cd /home/ubuntu/zls
git submodule update --init --recursive --progress --depth=1
zig build -Drelease-fast

View File

@@ -1,15 +0,0 @@
#!/bin/bash
set -euxo pipefail
export DOCKER_BUILDKIT=1
docker login --username bunbunbunbun
docker build -f Dockerfile.base -t bunbunbunbun/bun-test-base --target bun-test-base . --platform=linux/$BUILDARCH --build-arg BUILDARCH=$BUILDARCH
docker build -f Dockerfile.base -t bunbunbunbun/bun-base-with-zig-and-webkit --target bun-base-with-zig-and-webkit . --platform=linux/$BUILDARCH --build-arg BUILDARCH=$BUILDARCH
docker build -f Dockerfile.base -t bunbunbunbun/bun-base --target bun-base --platform=linux/$BUILDARCH . --build-arg BUILDARCH=$BUILDARCH
docker push bunbunbunbun/bun-test-base:latest
docker push bunbunbunbun/bun-base-with-zig-and-webkit:latest
docker push bunbunbunbun/bun-base:latest

View File

@@ -1,24 +0,0 @@
#!/bin/bash
set -euxo pipefail
export DOCKER_BUILDKIT=1
docker buildx build \
-t bunbunbunbun/bun-test-base:latest -f Dockerfile.base \
--target bun-test-base \
--platform=linux/$BUILDARCH --build-arg BUILDARCH=$BUILDARCH .
docker buildx build \
--target bun-base \
-f Dockerfile.base \
-t bunbunbunbun/bun-base:latest --platform=linux/$BUILDARCH \
--build-arg BUILDARCH=$BUILDARCH .
docker buildx build \
-t bunbunbunbun/bun-base-with-zig-and-webkit:latest \
-f Dockerfile.base \
--target bun-base-with-zig-and-webkit \
--platform=linux/$BUILDARCH --build-arg BUILDARCH=$BUILDARCH .
docker push bunbunbunbun/bun-test-base:latest
docker push bunbunbunbun/bun-base:latest
docker push bunbunbunbun/bun-base-with-zig-and-webkit:latest

View File

@@ -3,7 +3,7 @@
set -euxo pipefail
bun install
bun install --cwd ./integration/snippets
bun install --cwd ./integration/scripts
bun install --cwd ./test/snippets
bun install --cwd ./test/scripts
make $BUN_TEST_NAME

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,7 +10,7 @@ examples
**/.next
.git
src/javascript/jsc/WebKit
src/bun.js/WebKit
**/CMakeCache.txt
packages/**/bun
packages/**/bun-profile

5
.gitattributes vendored
View File

@@ -1,7 +1,8 @@
.vscode/launch.json linguist-generated
src/api/schema.d.ts linguist-generated
fixture.*.c linguist-generated
src/api/schema.js linguist-generated
src/javascript/jsc/bindings/sqlite/sqlite3.c linguist-vendored
src/javascript/jsc/bindings/sqlite/sqlite3_local.h linguist-vendored
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

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 -mprsv`
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?

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

@@ -0,0 +1,44 @@
name: 🐛 Bug Report
description: Report an issue that should be fixed
labels: [bug, need repro]
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 -mprsv`
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: Enter the details about your bug. If possible, please provide a small code snippet that can reproduce the issue.
- type: textarea
attributes:
label: How often does it reproduce? Is there a required condition?
- 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.
validations:
required: true
- 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,31 @@
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
validations:
required: true
- 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.

52
.github/labeler.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
chore:
- any: ['*', '**/*']
all: ['!packages/*', '!packages/**/*', '!src/*', '!src/**/*', '!types/*', '!types/**/*', '!test/*', '!test/**/*', '!bench/*', '!bench/**/*', '!examples/*', '!examples/**/*']
'packages:bun':
- src/*
- src/**/*
'packages:bun-darwin-aarch64':
- packages/bun-darwin-aarch64/*
- packages/bun-darwin-aarch64/**/*
'packages:bun-error':
- packages/bun-error/*
- packages/bun-error/**/*
'packages:bun-framework-next':
- packages/bun-framework-next/*
- packages/bun-framework-next/**/*
'packages:bun-landing':
- packages/bun-landing/*
- packages/bun-landing/**/*
'packages:bun-linux-x64':
- packages/bun-linux-x64/*
- packages/bun-linux-x64/**/*
'packages:bun-macro-relay':
- packages/bun-macro-relay/*
- packages/bun-macro-relay/**/*
'packages:bun-types':
- packages/bun-types/*
- packages/bun-types/**/*
- types/bun/*
'packages:bun-wasm':
- packages/bun-wasm/*
- packages/bun-wasm/**/*
'tests':
- test/*
- test/**/*
'benchmarks':
- bench/*
- bench/**/*
'templates':
- examples/*
- examples/**/*

66
.github/labels.yml vendored Normal file
View File

@@ -0,0 +1,66 @@
- name: 'bug'
color: 'd73a4a'
- name: 'segfault'
color: 'b60205'
- name: 'documentation'
color: '0075ca'
- name: 'duplicate'
color: 'cfd3d7'
- name: 'wontfix'
color: 'cfd3d7'
- name: 'question'
color: 'd876e3'
- name: 'enhancement'
color: 'a2eeef'
- name: 'good first issue'
color: '7057ff'
- name: 'help wanted'
color: '008672'
- name: 'infrastructure'
color: '7c5f8a'
- name: 'invalid'
color: 'e4e669'
- name: 'need repro'
color: 'c66037'
- name: 'node.js'
color: '0E8A16'
- name: 'napi'
color: 'BE05D2'
- name: 'esm<>cjs'
color: '7dcde3'
- name: 'performance'
color: 'E99695'
- name: 'polyfill'
color: 'f9c5e6'
- name: 'tracking'
color: '5319E7'
- name: 'transpiler'
color: 'BFDADC'
- name: 'typescript'
color: '87511b'
- name: 'chore'
color: 'cfd3d7'
- name: 'templates'
color: 'FBCA04'
- name: 'benchmarks'
color: 'FBCA04'
- name: 'tests'
color: 'FBCA04'
- name: 'packages:bun'
color: 'FBCA04'
- name: 'packages:bun-darwin-aarch64'
color: 'FBCA04'
- name: 'packages:bun-error'
color: 'FBCA04'
- name: 'packages:bun-framework-next'
color: 'FBCA04'
- name: 'packages:bun-landing'
color: 'FBCA04'
- name: 'packages:bun-linux-x64'
color: 'FBCA04'
- name: 'packages:bun-macro-relay'
color: 'FBCA04'
- name: 'packages:bun-types'
color: 'FBCA04'
- name: 'packages:bun-wasm'
color: 'FBCA04'

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 }}

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 }}

46
.github/workflows/bun-landing.yml vendored Normal file
View File

@@ -0,0 +1,46 @@
name: bun-landing
on:
push:
paths:
- packages/bun-landing/**/*
branches: [main]
jobs:
build:
name: website build
runs-on: ubuntu-latest
if: github.repository_owner == 'oven-sh'
strategy:
fail-fast: false
matrix:
node-version:
- 16
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 bun
uses: xhyrom/setup-bun@v0.1.2
with:
bun-version: latest
- name: Install global dependencies
run: bun install
- name: Install package dependencies
run: cd packages/bun-landing && bun install
- name: Build
run: cd packages/bun-landing && bun run build.tsx
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: build:(landing) automated website build
token: ${{ secrets.GITHUB_TOKEN }}

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

@@ -0,0 +1,143 @@
name: bun-linux
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TEST_TAG: bun-test'
on:
push:
branches: [main, bun-actions]
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/oct28/bun-webkit-linux-amd64-lto.tar.gz"
webkit_basename: "bun-webkit-linux-amd64-lto"
- 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/oct28/bun-webkit-linux-amd64-lto.tar.gz"
webkit_basename: "bun-webkit-linux-amd64-lto"
- cpu: native
tag: linux-aarch64
arch: aarch64
build_arch: arm64
runner: linux-arm64
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/oct28/bun-webkit-linux-arm64-lto.tar.gz"
webkit_basename: "bun-webkit-linux-arm64-lto"
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc)
- 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
with:
context: .
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
ARCH=${{matrix.arch}}
BUILDARCH=${{matrix.build_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: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/main'
with:
prerelease: true
generate_release_notes: true
body: "This is the canary release of Bun that corresponds to the commit [${{ github.sha }}]"
name: "Canary (${{github.sha}})"
tag_name: "canary"
files: |
${{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

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

@@ -0,0 +1,353 @@
name: bun-macOS-aarch64
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TEST_TAG: bun-test'
on:
push:
branches: [main, bun-actions]
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
- name: Checkout submodules
run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc)
- 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
with:
context: .
push: false
tags: ghcr.io/oven-sh/bun-obj:${{github.sha}}-${{matrix.cpu}}-${{matrix.arch}}-macos
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=amd64
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
- 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/oct28/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/oct28/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/oct28/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/oct28/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/oct28/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 llvm@13 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@13)/bin:\$PATH" >> $GITHUB_ENV
brew link --overwrite llvm@13
- 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/oct28/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/oct28/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/oct28/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 llvm@13 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@13)/bin:\$PATH" >> $GITHUB_ENV
brew link --overwrite llvm@13
- 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: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/main'
with:
prerelease: true
generate_release_notes: true
body: "This is the canary release of Bun that corresponds to the commit [${{ github.sha }}]"
name: "Canary (${{github.sha}})"
tag_name: "canary"
files: |
${{runner.temp}}/release/${{matrix.tag}}.zip
${{runner.temp}}/release/${{matrix.tag}}-profile.zip

View File

@@ -0,0 +1,350 @@
name: bun-macOS-x64-baseline
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TEST_TAG: bun-test'
on:
push:
branches: [main, bun-actions]
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
- name: Checkout submodules
run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc)
- 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
with:
context: .
push: false
tags: ghcr.io/oven-sh/bun-obj:${{github.sha}}-${{matrix.cpu}}-${{matrix.arch}}-macos-baseline
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=amd64
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
- 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/oct28/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/oct28/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/oct28/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/oct28/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/oct28/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 rust llvm@13 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@13)/bin:\$PATH" >> $GITHUB_ENV
brew link --overwrite llvm@13
- 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/oct28/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/oct28/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/oct28/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 rust llvm@13 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@13)/bin:\$PATH" >> $GITHUB_ENV
brew link --overwrite llvm@13
- 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: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/main'
with:
prerelease: true
generate_release_notes: true
body: "This is the canary release of Bun that corresponds to the commit [${{ github.sha }}]"
name: "Canary (${{github.sha}})"
tag_name: "canary"
files: |
${{runner.temp}}/release/${{matrix.tag}}.zip
${{runner.temp}}/release/${{matrix.tag}}-profile.zip

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

@@ -0,0 +1,351 @@
name: bun-macOS-x64
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TEST_TAG: bun-test'
on:
push:
branches: [main, bun-actions]
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
- name: Checkout submodules
run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc)
- 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
with:
context: .
push: false
cache-from: type=gha
cache-to: type=gha,mode=min
build-args: |
ARCH=${{ matrix.arch }}
BUILDARCH=amd64
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
- 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/oct28/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/oct28/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/oct28/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/oct28/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/oct28/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 llvm@13 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@13)/bin:\$PATH" >> $GITHUB_ENV
brew link --overwrite llvm@13
- 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: 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/oct28/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/oct28/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/oct28/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 llvm@13 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@13)/bin:\$PATH" >> $GITHUB_ENV
brew link --overwrite llvm@13
- 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: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/main'
with:
prerelease: true
generate_release_notes: true
body: "This is the canary release of Bun that corresponds to the commit [${{ github.sha }}]"
name: "Canary (${{github.sha}})"
tag_name: "canary"
files: |
${{runner.temp}}/release/${{matrix.tag}}.zip
${{runner.temp}}/release/${{matrix.tag}}-profile.zip

View File

@@ -1,167 +0,0 @@
name: bun
on:
push:
branches: [main, bun-actions]
paths-ignore:
- "examples/**"
- "bench/**"
- "README.*"
- "LICENSE"
- ".vscode"
- ".devcontainer"
pull_request:
branches: [main]
paths-ignore:
- "examples/**"
- "bench/**"
- README.*
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TEST_TAG: bun-test'
jobs:
e2e:
runs-on: self-hosted
name: "Integration tests"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout submodules
run: git -c submodule."src/javascript/jsc/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j 8
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Pull Base Image
run: bash .docker/pull.sh
- name: Build tests
uses: docker/build-push-action@v2
with:
context: .
target: test_base
tags: bun-test:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
builder: ${{ steps.buildx.outputs.name }}
- name: Run test-with-hmr
env:
BUN_TEST_NAME: test-with-hmr
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
RUNNER_TEMP: ${RUNNER_TEMP}
run: bash .docker/runner.sh
- name: Run test-no-hmr
env:
BUN_TEST_NAME: test-no-hmr
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
RUNNER_TEMP: ${RUNNER_TEMP}
run: bash .docker/runner.sh
- name: Run test-bun-create-next
env:
RUNNER_TEMP: ${RUNNER_TEMP}
BUN_TEST_NAME: test-create-next
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
run: bash .docker/runner.sh
- name: Run test-bun-create-react
env:
RUNNER_TEMP: ${RUNNER_TEMP}
BUN_TEST_NAME: test-create-react
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
run: bash .docker/runner.sh
- name: Run test-bun-run
env:
RUNNER_TEMP: ${RUNNER_TEMP}
BUN_TEST_NAME: test-bun-run
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
run: bash .docker/runner.sh
- name: Run test-bun-install
env:
RUNNER_TEMP: ${RUNNER_TEMP}
BUN_TEST_NAME: test-bun-install
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
run: bash .docker/runner.sh
# This is commented out because zig test does not work on the CI
# Which sucks
# zig-unit-tests:
# runs-on: self-hosted
# name: "Unit tests (Zig)"
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Checkout submodules
# run: git -c submodule."src/javascript/jsc/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j 8
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
# - name: Login to Dockerhub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
# - name: Pull Base Image
# run: bash .docker/pull.sh
# - name: Build tests
# uses: docker/build-push-action@v2
# with:
# context: .
# target: build_unit
# tags: bun-unit-tests:latest
# load: true
# cache-from: type=gha
# cache-to: type=gha,mode=max
# builder: ${{ steps.buildx.outputs.name }}
# - name: Run tests
# env:
# GITHUB_WORKSPACE: $GITHUB_WORKSPACE
# RUNNER_TEMP: ${RUNNER_TEMP}
# run: bash .docker/unit-tests.sh
release:
runs-on: self-hosted
needs: ["e2e"]
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout submodules
run: git -c submodule."src/javascript/jsc/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j 8
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: jarredsumner
password: ${{ secrets.DOCKERHUB_ALT }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
install: true
- name: Pull Base Image
run: bash .docker/pull.sh
- name: Build release image
uses: docker/build-push-action@v2
with:
context: .
target: release
tags: |
ghcr.io/jarred-sumner/bun:${{github.sha}}
ghcr.io/jarred-sumner/bun:edge
jarredsumner/bun:${{github.sha}}
jarredsumner/bun:edge
platforms: |
linux/amd64
labels: |
org.opencontainers.image.title=bun
org.opencontainers.image.description=bun is a fast bundler, transpiler, JavaScript Runtime environment and package manager for web software. The image is an Ubuntu 20.04 image with bun preinstalled into /opt/bun.
org.opencontainers.image.vendor=bun
org.opencontainers.image.source=https://github.com/Jarred-Sumner/bun
org.opencontainers.image.url=https://bun.sh
builder: ${{ steps.buildx.outputs.name }}
push: true

2
.gitignore vendored
View File

@@ -10,6 +10,7 @@ node_modules
.swcrc
yarn.lock
dist
*.tmp
*.log
*.out.js
*.out.refresh.js
@@ -102,3 +103,4 @@ src/runtime.version
*.sqlite
*.database
*.db
misctools/machbench

111
.gitmodules vendored
View File

@@ -1,53 +1,78 @@
# [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
depth = 1
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 = https://github.com/Jarred-Sumner/WebKit.git
ignore = dirty
depth = 1
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/Jarred-Sumner/mimalloc.git
ignore = dirty
depth = 1
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
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
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/google/boringssl.git
ignore = dirty
depth = 1
path = src/deps/boringssl
url = https://github.com/google/boringssl.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/libbacktrace"]
path = src/deps/libbacktrace
url = https://github.com/ianlancetaylor/libbacktrace
ignore = dirty
depth = 1
path = src/deps/libbacktrace
url = https://github.com/ianlancetaylor/libbacktrace
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
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
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
path = src/deps/tinycc
url = https://github.com/Jarred-Sumner/tinycc.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/oniguruma"]
path = src/deps/oniguruma
url = https://github.com/kkos/oniguruma
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false

View File

@@ -1,7 +1,7 @@
#!/bin/bash
set -euxo pipefail
WEBKIT_VERSION=$(git rev-parse HEAD:./src/javascript/jsc/WebKit)
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)

View File

@@ -2,26 +2,50 @@
"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}/src/bun.js/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/WTF/Headers",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/*",
"${workspaceFolder}/src/bun.js/bindings/",
"${workspaceFolder}/src/bun.js/bindings/sqlite/",
"${workspaceFolder}/src/bun.js/bindings/webcrypto/",
"${workspaceFolder}/src/deps/boringssl/include/",
"${workspaceFolder}/src/bun.js/bindings/webcrypto/openssl/",
"${workspaceFolder}/src/bun.js/bindings/webcrypto/algorithms/",
"${workspaceFolder}/src/bun.js/bindings/webcrypto/parameters/",
"${workspaceFolder}/src/bun.js/builtins/",
"${workspaceFolder}/src/bun.js/builtins/cpp",
"${workspaceFolder}/src/bun.js/bindings/WebCore/",
"${workspaceFolder}/src/bun.js/WebKit/Source/bmalloc/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/ICU/Headers/",
"${workspaceFolder}/../webkit-build/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}/src/bun.js/bindings/*",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/**",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/JavaScriptCore/Headers/**",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/WTF/Headers/**",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/*",
"${workspaceFolder}/src/bun.js/bindings/**",
"${workspaceFolder}/src/bun.js/modules/**",
"${workspaceFolder}/src/bun.js/builtins/**",
"${workspaceFolder}/src/deps/boringssl/include/",
"${workspaceFolder}/src/bun.js/bindings/sqlite/",
"${workspaceFolder}/src/bun.js/builtins/cpp/**",
"${workspaceFolder}/src/bun.js/WebKit/Source/bmalloc/**",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/ICU/Headers/",
"${workspaceFolder}/src/bun.js/bindings/webcrypto/",
"${workspaceFolder}/src/bun.js/bindings/webcrypto/openssl/",
"${workspaceFolder}/src/bun.js/bindings/webcrypto/algorithms/",
"${workspaceFolder}/src/bun.js/bindings/webcrypto/parameters/",
"${workspaceFolder}/../webkit-build/include/",
"${workspaceFolder}/src/deps",
"${workspaceFolder}/src/deps/uws/uSockets/src"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ".vscode/cppdb"
@@ -38,9 +62,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",
"cppStandard": "c++20",
"intelliSenseMode": "macos-clang-x64"
}
],

766
.vscode/launch.json generated vendored
View File

@@ -4,269 +4,37 @@
{
"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": "fetch debug",
"program": "${workspaceFolder}/misctools/fetch",
"args": ["https://example.com", "--verbose"],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "fetch debug #2",
"program": "${workspaceFolder}/misctools/fetch",
"args": ["https://twitter.com", "--verbose"],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "fetch debug #13w",
"program": "${workspaceFolder}/misctools/fetch",
"args": ["http://127.0.0.1:8080/next.json", "--quiet", "--verbose"],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "fetch debug #12w",
"program": "${workspaceFolder}/misctools/fetch",
"args": ["https://registry.npmjs.org/next", "--quiet", "--verbose"],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "hop",
"program": "hop",
"args": ["swc-linux-arm64-musl-12.0.3.tgz"],
"cwd": "/Users/jarred/Downloads/hop-test",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "hop extract",
"program": "hop",
"args": ["swc-linux-arm64-musl-12.0.3.hop"],
"cwd": "/Users/jarred/Downloads/hop-test",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "fetch debug #2",
"program": "${workspaceFolder}/misctools/fetch",
"args": ["https://registry.npmjs.org/react", "--verbose"],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "fetch debug #3",
"program": "${workspaceFolder}/misctools/fetch",
"args": ["http://example.com/", "--verbose"],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun create debug",
"name": "bun test",
"program": "bun-debug",
"args": ["create", "next", "foo", "--open", "--force"],
"cwd": "/tmp",
"args": ["wiptest", "${file}"],
"cwd": "${workspaceFolder}/test",
"env": {
"FORCE_COLOR": "1"
},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun dev debug",
"name": "bun test (all)",
"program": "bun-debug",
"args": ["dev"],
"cwd": "/tmp/foo",
"args": ["wiptest"],
"cwd": "${workspaceFolder}/test",
"env": {
"FORCE_COLOR": "1"
},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun run debug",
"name": "bun run current file",
"program": "bun-debug",
"args": ["run", "/tmp/bar.js"],
// "args": ["--version"],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun a debug",
"program": "bun-debug",
"args": ["create", "https://github.com/ahfarmer/calculator", "--force"],
"cwd": "/tmp/",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun routes",
"program": "bun-debug",
"args": [],
"cwd": "${workspaceFolder}/integration/apps/routing",
"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/"
],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": ".bun",
"program": "bun-debug",
"args": [
"./examples/hello-next/node_modules.server.bun"
// "--origin=https://localhost:9000/"
],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Discord",
"program": "bun-debug",
"args": [
"discord"
// "--origin=https://localhost:9000/"
],
"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": "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": "bun-debug",
// "args": ["--serve", "--origin=http://localhost:3000"],
"args": ["dev", "--origin=http://localhost:3000"],
"cwd": "/tmp/next-app",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Demo ",
"program": "bun-debug",
// "args": ["--serve", "--origin=http://localhost:3000"],
"args": ["/Users/jarred/Desktop/text-encoder-hello.js"],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "wiptest",
"program": "bun-debug",
"args": ["wiptest", "transpiler"],
"cwd": "${workspaceFolder}/integration",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "debug test",
"program": "bun-debug",
"args": ["build", "/tmp/foo.ts"],
"cwd": "/tmp",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Dazzle serve",
"program": "bun-debug",
"args": ["dev"],
"cwd": "/Users/jarred/Build/lattice/apps/dazzle",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Dazzle bun",
"program": "bun-debug",
"args": ["bun"],
"cwd": "/Users/jarred/Build/lattice/apps/dazzle",
"args": ["${file}"],
"cwd": "${file}/../../",
"env": {
"FORCE_COLOR": "1"
},
"console": "internalConsole"
},
{
@@ -274,49 +42,20 @@
"request": "launch",
"name": "bun run",
"program": "bun-debug",
"args": ["cat.js", "./node_modules/@babel/standalone/babel.js"],
"cwd": "/Users/jarred/Build/foobar",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun run callback bench",
"program": "bun-debug",
"args": ["/Users/jarred/Code/bun/bench/snippets/callbacks-overhead.mjs"],
"cwd": "/Users/jarred/Build/foobar",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun test",
"program": "bun-debug",
"args": ["wiptest"],
"cwd": "${workspaceFolder}/integration",
"env": {
"FORCE_COLOR": "1"
},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun test current",
"program": "bun-debug",
"args": ["wiptest", "mmap"],
"cwd": "${workspaceFolder}/integration",
"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/bun/http.ts"],
"args": ["run", "examples/http.ts"],
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1"
@@ -347,471 +86,24 @@
},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun tes2t",
"program": "bun-debug",
"args": ["add", "imagemin-webpack-plugin"],
"cwd": "/tmp/testfoo",
"env": {
"FORCE_COLOR": "1"
},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "unicode check",
"args": ["--disable-hmr"],
"program": "bun-debug",
"cwd": "/Users/jarred/Build/app994",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Demo .bun",
"program": "bun-debug",
"args": ["bun", "--use=bun-framework-next"],
"cwd": "${workspaceFolder}/examples/hello-next",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "PNPM .bun",
"program": "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": "bun-debug",
"args": [],
"cwd": "/Users/jarred/Build/pnpm-bun/packages/app",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Mixed case resolve",
"program": "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": "bun-debug",
"args": ["bun", "./index.js", "--platform=browser"],
"cwd": "${workspaceFolder}/examples/lotta-modules/",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Dev CRA",
"program": "bun-debug",
"args": ["dev", "--platform=browser"],
"cwd": "${workspaceFolder}/examples/hello-create-react-app/",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Fragment",
"program": "bun-debug",
"args": [],
"cwd": "${workspaceFolder}/src/test/fixtures",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Context bun Bug",
"program": "bun-debug",
"args": ["bun", "./code.js"],
"cwd": "/Users/jarred/Build/context/www",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Context bun",
"program": "bun-debug",
"args": ["bun", "--use=next"],
"cwd": "/Users/jarred/Build/context/www",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun-hello",
"program": "bun-debug",
"args": [],
"cwd": "${workspaceFolder}/packages/bun-hello",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Integration Test Dev",
"program": "bun-debug",
"args": [],
"cwd": "${workspaceFolder}/integration/snippets",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "bun.sh dev",
"program": "bun-debug",
"args": ["dev"],
"cwd": "${workspaceFolder}/../bun.sh",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Instal 1l",
"program": "bun-debug",
"args": ["install", "-g", "which"],
"cwd": "/tmp/new-app",
"env": {},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Instal 32",
"program": "bun-debug",
"args": ["install"],
"cwd": "/tmp/foo",
"env": {},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Install",
"program": "bun-debug",
"args": ["install", "--backend=clonefile", "--force"],
"cwd": "/Users/jarred/Build/octokit-test",
"env": {},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Install #2",
"program": "bun-debug",
"args": ["add", "typescript"],
"cwd": "/tmp/wow-such-npm",
"env": {},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Add",
"program": "bun-debug",
"args": ["add", "react"],
"cwd": "/tmp/wow-such-npm",
"env": {},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Remove",
"program": "bun-debug",
"args": ["remove", "foo"],
"cwd": "/Users/jarred/Build/athena.yarn",
"env": {},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Print Lockfile",
"program": "bun-debug",
"args": ["./bun.lockb"],
"cwd": "/tmp/wow-such-npm",
"env": {
"BUN_CONFIG_SKIP_SAVE_LOCKFILE": "1"
},
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Integration Test Dev (no hmr)",
"program": "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": "lldb",
"request": "launch",
"name": "Context Dev",
"program": "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": "bun-debug",
"args": ["dev"],
"cwd": "${workspaceFolder}/examples/hello-next",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Type-only import",
"program": "bun-debug",
"args": [
"bun",
"./src/test/fixtures/type-only-import.ts",
"--external=react"
],
"name": "HTTP bench",
"program": "${workspaceFolder}/misctools/http_bench",
"args": ["https://twitter.com", "--count=100"],
"cwd": "${workspaceFolder}",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Dev lotta-modules",
"program": "bun-debug",
"args": ["dev", "./index.js", "--platform=browser"],
"cwd": "${workspaceFolder}/examples/lotta-modules/",
"console": "internalConsole"
},
{
"type": "lldb",
"request": "launch",
"name": "Demo Build .bun",
"program": "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": "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": "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"
},
// {
// "type": "lldb",
// "request": "launch",
// "name": "Dev Launch (other)",
// "program": "bun-debug",
// "args": ["./simple.jsx", "--resolve=disable"],
// "cwd": "${workspaceFolder}/src/test/fixtures",
// "console": "internalConsole"
// },
// {
// "type": "lldb",
// "request": "launch",
// "name": "Dev Launch",
// "program": "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": "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": "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": "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": "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": "bun-debug",
"program": "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",
"name": "fetch debug",
"program": "${workspaceFolder}/misctools/fetch",
"args": ["https://example.com", "--verbose"],
"cwd": "${workspaceFolder}",
"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
// }
// }
]
}

59
.vscode/settings.json vendored
View File

@@ -8,6 +8,8 @@
"search.useIgnoreFiles": true,
"zig.buildOnSave": false,
"[zig]": {
"editor.tabSize": 4,
"editor.useTabStops": false,
"editor.defaultFormatter": "AugusteRame.zls-vscode",
"editor.formatOnSave": true
},
@@ -44,9 +46,9 @@
"**/*.xcodeproj": true,
"packages/bun-types/*.d.ts": true,
"integration/snapshots": true,
"integration/snapshots-no-hmr": true,
"src/javascript/jsc/WebKit": 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,
@@ -55,25 +57,25 @@
"src/deps/uws": true,
"src/deps/zlib": true,
"src/deps/lol-html": true,
"integration/snippets/package-json-exports/_node_modules_copy": 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"
@@ -85,6 +87,7 @@
"editor.defaultFormatter": "xaver.clang-format"
},
"files.associations": {
"*.lock": "yarnlock",
"*.idl": "cpp",
"memory": "cpp",
"iostream": "cpp",
@@ -162,8 +165,22 @@
"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
}

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,48 +1,161 @@
FROM bunbunbunbun/bun-base:latest as lolhtml
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 CPU_TARGET=native
ARG ARCH=x86_64
ARG TRIPLET=${ARCH}-linux-gnu
ARG BUILDARCH=amd64
ARG WEBKIT_TAG=jul27-2
ARG ZIG_TAG=jul1
ARG WEBKIT_BASENAME="bun-webkit-linux-$BUILDARCH"
ARG WEBKIT_URL="https://github.com/oven-sh/WebKit/releases/download/$WEBKIT_TAG/${WEBKIT_BASENAME}.tar.gz"
ARG ZIG_URL="https://github.com/oven-sh/zig/releases/download/$ZIG_TAG/zig-linux-$BUILDARCH.zip"
ARG GIT_SHA=""
ARG BUN_BASE_VERSION=0.2
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 13
RUN install_packages \
cmake \
curl \
file \
git \
gnupg \
libc-dev \
libxml2 \
libxml2-dev \
make \
ninja-build \
perl \
python3 \
rsync \
ruby \
unzip \
bash tar gzip
ENV CXX=clang++-13
ENV CC=clang-13
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
ENV WEBKIT_OUT_DIR=${WEBKIT_DIR}
ENV BUILDARCH=${BUILDARCH}
ENV AR=/usr/bin/llvm-ar-13
ENV ZIG "${ZIG_PATH}/zig"
ENV PATH="$ZIG/bin:$PATH"
ENV LD=lld-13
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 unzip -q zig-linux-$BUILDARCH.zip && \
rm zig-linux-$BUILDARCH.zip;
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 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
RUN cd ${BUN_DIR} && \
RUN export PATH=$PATH:$HOME/.cargo/bin && export CC=$(which clang-13) && cd ${BUN_DIR} && \
make lolhtml && rm -rf src/deps/lol-html Makefile
FROM bunbunbunbun/bun-base:latest as mimalloc
FROM bun-base as mimalloc
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# 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 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}
RUN cd ${BUN_DIR} && \
make mimalloc && rm -rf src/deps/mimalloc Makefile
FROM bunbunbunbun/bun-base:latest as zlib
FROM bun-base as zlib
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# 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 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
@@ -52,55 +165,75 @@ WORKDIR $BUN_DIR
RUN cd $BUN_DIR && \
make zlib && rm -rf src/deps/zlib Makefile
FROM bunbunbunbun/bun-base:latest as libarchive
FROM bun-base as libarchive
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# 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 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
WORKDIR $BUN_DIR
RUN cd $BUN_DIR && \
make libarchive && rm -rf src/deps/libarchive Makefile
FROM bunbunbunbun/bun-base:latest as tinycc
FROM bun-base as oniguruma
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# 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 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/tinycc ${BUN_DIR}/src/deps/tinycc
COPY src/deps/oniguruma ${BUN_DIR}/src/deps/oniguruma
WORKDIR $BUN_DIR
RUN make oniguruma && rm -rf src/deps/oniguruma Makefile
RUN cd $BUN_DIR && \
make tinycc && rm -rf src/deps/tinycc Makefile
FROM bun-base as tinycc
FROM bunbunbunbun/bun-base:latest as libbacktrace
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# 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 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 libbacktrace
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/libbacktrace ${BUN_DIR}/src/deps/libbacktrace
@@ -110,16 +243,20 @@ WORKDIR $BUN_DIR
RUN cd $BUN_DIR && \
make libbacktrace && rm -rf src/deps/libbacktrace Makefile
FROM bunbunbunbun/bun-base:latest as boringssl
FROM bun-base as boringssl
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
RUN install_packages golang
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# 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 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
@@ -128,16 +265,18 @@ WORKDIR $BUN_DIR
RUN make boringssl && rm -rf src/deps/boringssl Makefile
FROM bunbunbunbun/bun-base:latest as base64
FROM bun-base as base64
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# 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 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/base64 ${BUN_DIR}/src/base64
@@ -146,16 +285,18 @@ WORKDIR $BUN_DIR
RUN make base64 && rm -rf src/base64 Makefile
FROM bunbunbunbun/bun-base:latest as uws
FROM bun-base as uws
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# 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 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
@@ -169,16 +310,18 @@ WORKDIR $BUN_DIR
RUN cd $BUN_DIR && \
make uws && rm -rf src/deps/uws Makefile
FROM bunbunbunbun/bun-base:latest as picohttp
FROM bun-base as picohttp
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# 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 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
@@ -191,16 +334,18 @@ RUN cd $BUN_DIR && \
make picohttp
FROM bunbunbunbun/bun-base-with-zig-and-webkit:latest as identifier_cache
FROM bun-base-with-zig-and-webkit as identifier_cache
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# 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 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
@@ -211,16 +356,18 @@ COPY src/js_lexer/identifier_cache.zig ${BUN_DIR}/src/js_lexer/identifier_cache.
RUN cd $BUN_DIR && \
make identifier-cache && rm -rf zig-cache Makefile
FROM bunbunbunbun/bun-base-with-zig-and-webkit:latest as node_fallbacks
FROM bun-base-with-zig-and-webkit as node_fallbacks
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# 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 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
@@ -230,17 +377,18 @@ 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 bunbunbunbun/bun-base-with-zig-and-webkit:latest as prepare_release
FROM bun-base-with-zig-and-webkit as prepare_release
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# 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 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
@@ -253,195 +401,249 @@ COPY ./package.json ${BUN_DIR}/package.json
COPY ./misctools ${BUN_DIR}/misctools
COPY Makefile ${BUN_DIR}/Makefile
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=libarchive ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=picohttp ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/
COPY --from=boringssl ${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=libbacktrace ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=zlib ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=tinycc ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=base64 ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
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
WORKDIR ${BUN_DIR}
FROM prepare_release as compile_release_obj
FROM prepare_release as build_release
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# 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 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
RUN cd $BUN_DIR && rm -rf $HOME/.cache zig-cache && make \
jsc-bindings-headers \
api \
analytics \
bun_error \
fallback_decoder && rm -rf $HOME/.cache zig-cache && \
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 ./build-id ${BUN_DIR}/build-id
RUN cd $BUN_DIR && mkdir -p src/bun.js/bindings-obj && rm -rf $HOME/.cache zig-cache && make prerelease && \
mkdir -p $BUN_RELEASE_DIR && \
make jsc-bindings-mac -j10 && \
make sqlite release copy-to-bun-release-dir && \
OUTPUT_DIR=/tmp $ZIG_PATH/zig build obj -Drelease-fast -Dtarget="${TRIPLET}" -Dcpu="${CPU_TARGET}" && \
cp /tmp/bun.o /tmp/bun-${BUN_BASE_VERSION}.$(cat ${BUN_DIR}/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 BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY --from=compile_release_obj /tmp/*.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
COPY --from=boringssl ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=zlib ${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=libarchive ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=oniguruma ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=picohttp ${BUN_DEPS_OUT_DIR}/*.o ${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=libbacktrace ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=tinycc ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=base64 ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
# Required for `make webcrypto`
COPY src/deps/boringssl/include ${BUN_DIR}/src/deps/boringssl/include
RUN 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 prepare_release 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
COPY Makefile ${BUN_DIR}/Makefile
WORKDIR $BUN_DIR
ENV JSC_BASE_DIR=${WEBKIT_DIR}
ENV LIB_ICU_PATH=${WEBKIT_DIR}/lib
RUN 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=base64 ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=boringssl ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
COPY --from=libbacktrace ${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=oniguruma ${BUN_DEPS_OUT_DIR}/*.a ${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=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=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# 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 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 jsc-bindings-headers \
CMD make headers \
api \
analytics \
bun_error \
fallback_decoder \
jsc-bindings-mac -j10 && \
bindings -j10 && \
make \
run-all-unit-tests
FROM bunbunbunbun/bun-base-with-zig-and-webkit:latest as bun.devcontainer
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
ENV WEBKIT_OUT_DIR ${WEBKIT_DIR}
ENV PATH "$ZIG_PATH:$PATH"
ENV JSC_BASE_DIR $WEBKIT_OUT_DIR
ENV LIB_ICU_PATH ${GITHUB_WORKSPACE}/icu/source/lib
ENV BUN_RELEASE_DIR ${BUN_RELEASE_DIR}
ENV PATH "${GITHUB_WORKSPACE}/packages/bun-linux-x64:${GITHUB_WORKSPACE}/packages/bun-linux-aarch64:${GITHUB_WORKSPACE}/packages/debug-bun-linux-x64:${GITHUB_WORKSPACE}/packages/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
RUN apt-get -y update && update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-13 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
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
FROM ubuntu:20.04 as release_with_debug_info
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
COPY .devcontainer/limits.conf /etc/security/limits.conf
ENV BUN_INSTALL /opt/bun
ENV PATH "/opt/bun/bin:$PATH"
ARG BUILDARCH=amd64
LABEL org.opencontainers.image.title="bun ${BUILDARCH} (glibc)"
LABEL org.opencontainers.image.source=https://github.com/jarred-sumner/bun
COPY --from=build_release ${BUN_RELEASE_DIR}/bun /opt/bun/bin/bun
COPY --from=build_release ${BUN_RELEASE_DIR}/bun-profile /opt/bun/bin/bun-profile
WORKDIR /opt/bun
ENTRYPOINT [ "/opt/bun/bin/bun" ]
FROM ubuntu:20.04 as release
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
COPY .devcontainer/limits.conf /etc/security/limits.conf
ENV BUN_INSTALL /opt/bun
ENV PATH "/opt/bun/bin:$PATH"
ARG BUILDARCH=amd64
LABEL org.opencontainers.image.title="bun ${BUILDARCH} (glibc)"
LABEL org.opencontainers.image.source=https://github.com/jarred-sumner/bun
COPY --from=build_release ${BUN_RELEASE_DIR}/bun /opt/bun/bin/bun
WORKDIR /opt/bun
ENTRYPOINT [ "/opt/bun/bin/bun" ]
FROM bunbunbunbun/bun-test-base as test_base
# 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 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
# 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
# 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
# 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 ./integration ${BUN_DIR}/integration
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
# 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
# # # 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
# 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" ]
# CMD [ "bash", "run-test.sh" ]
FROM release
# FROM release

View File

@@ -1,147 +0,0 @@
FROM ubuntu:20.04 as bun-base-with-args
FROM bun-base-with-args as bun-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
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 13 && \
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-13-dev \
libclang-13-dev \
nodejs \
gcc \
g++ \
npm \
clang-13 \
clang-format-13 \
libc++-13-dev \
libc++abi-13-dev \
lld-13 \
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-13 90 && \
update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-13 90 && \
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-13 90 && \
npm install -g esbuild
ENV CC=clang-13
ENV CXX=clang++-13
ARG BUILDARCH=amd64
WORKDIR $GITHUB_WORKSPACE
ENV WEBKIT_OUT_DIR ${WEBKIT_DIR}
ENV JSC_BASE_DIR $WEBKIT_OUT_DIR
ENV LIB_ICU_PATH ${GITHUB_WORKSPACE}/icu/source/lib
ENV BUN_RELEASE_DIR ${BUN_RELEASE_DIR}
ENV BUN_DEPS_OUT_DIR ${BUN_DEPS_OUT_DIR}
RUN cd / && mkdir -p $BUN_RELEASE_DIR $BUN_DEPS_OUT_DIR ${BUN_DIR} ${BUN_DEPS_OUT_DIR}
LABEL org.opencontainers.image.title="bun base image ${BUILDARCH} (glibc)"
LABEL org.opencontainers.image.source=https://github.com/jarred-sumner/bun
FROM bun-base as bun-base-with-zig-and-webkit
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
WORKDIR $GITHUB_WORKSPACE
RUN cd $GITHUB_WORKSPACE && \
curl -o zig-linux-$BUILDARCH.zip -L https://github.com/Jarred-Sumner/zig/releases/download/mar4/zig-linux-$BUILDARCH.zip && \
unzip -q zig-linux-$BUILDARCH.zip && \
rm zig-linux-$BUILDARCH.zip;
RUN cd $GITHUB_WORKSPACE && \
curl -o bun-webkit-linux-$BUILDARCH.tar.gz -L https://github.com/Jarred-Sumner/WebKit/releases/download/May8/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 cd $GITHUB_WORKSPACE && \
curl -o icu4c-66_1-src.tgz -L https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-src.tgz && \
tar -xzf icu4c-66_1-src.tgz && \
rm icu4c-66_1-src.tgz && \
cd icu/source && \
./configure --enable-static --disable-shared && \
make -j$(nproc)
ENV ZIG "${ZIG_PATH}/zig"
LABEL org.opencontainers.image.title="bun base image with zig & webkit ${BUILDARCH} (glibc)"
LABEL org.opencontainers.image.source=https://github.com/jarred-sumner/bun
FROM debian:bullseye-slim as bun-test-base
# Original creator:
# LABEL maintainer "Jessie Frazelle <jess@linux.com>"
# Install Chromium
# Yes, including the Google API Keys sucks but even debian does the same: https://packages.debian.org/stretch/amd64/chromium/filelist
RUN apt-get update && apt-get install -y \
chromium \
chromium-l10n \
fonts-liberation \
fonts-roboto \
hicolor-icon-theme \
libcanberra-gtk-module \
libexif-dev \
libgl1-mesa-dri \
libgl1-mesa-glx \
libpangox-1.0-0 \
libv4l-0 \
fonts-symbola \
bash \
make \
psmisc \
curl \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /etc/chromium.d/ \
&& /bin/echo -e 'export GOOGLE_API_KEY="AIzaSyCkfPOPZXDKNn8hhgu3JrA62wIgC93d44k"\nexport GOOGLE_DEFAULT_CLIENT_ID="811574891467.apps.googleusercontent.com"\nexport GOOGLE_DEFAULT_CLIENT_SECRET="kdloedMFGdGla2P1zacGjAQh"' > /etc/chromium.d/googleapikeys && \
curl -L https://deb.nodesource.com/setup_16.x | bash - && \
apt-get update && \
apt-get install -y nodejs npm

117
Dockerfile.devcontainer Normal file
View File

@@ -0,0 +1,117 @@
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG BUILDARCH=amd64
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
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 13 && \
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-13-dev \
libclang-13-dev \
nodejs \
gcc \
g++ \
clang-13 \
clang-format-13 \
libc++-13-dev \
libc++abi-13-dev \
lld-13 \
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-13 90 && \
update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-13 90 && \
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-13 90 && \
npm install -g esbuild
ENV CC=clang-13
ENV CXX=clang++-13
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
RUN cd $GITHUB_WORKSPACE && \
curl -o zig-linux-$BUILDARCH.zip -L https://github.com/oven-sh/zig/releases/download/jul1/zig-linux-$BUILDARCH.zip && \
unzip -q zig-linux-$BUILDARCH.zip && \
rm zig-linux-$BUILDARCH.zip;
RUN cd $GITHUB_WORKSPACE && \
curl -o bun-webkit-linux-$BUILDARCH.tar.gz -L https://github.com/oven-sh/WebKit/releases/download/oct28/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-13 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,139 +0,0 @@
# This doesn't work
# Specifically: there are a number of crashes and segfaults when using musl
# The cause is likely related to differences in pthreads implementations
# It is not just the stack size thing. It's something more complicated and importantly
# There was no meaningful file size difference between musl and glibc
# ARG BUILDARCH=aarch64
# ARG zig_base_image=ghcr.io/jarred-sumner/zig-linux-musl-${BUILDARCH}
# ARG webkit_base_image=ghcr.io/jarred-sumner/bun-webkit-musl-${BUILDARCH}
# FROM ${zig_base_image}:latest AS zig
# FROM ${webkit_base_image}:latest AS webkit
# FROM zig as bun_base
# COPY --from=webkit /webkit /webkit
# ENV PATH "/zig/bin:$PATH"
# ENV JSC_BASE_DIR=/webkit
# ENV LIB_ICU_PATH=/webkit/lib
# ENV BUN_DEPS_OUT_DIR /bun-deps
# ENV STATIC_MUSL_FLAG=-static
# ENV MIMALLOC_OVERRIDE_FLAG="-DMI_OVERRIDE=OFF"
# RUN apk add --no-cache nodejs npm go libtool autoconf pkgconfig automake ninja
# RUN mkdir -p $BUN_DEPS_OUT_DIR;
# WORKDIR /bun
# COPY Makefile /bun/Makefile
# FROM bun_base as mimalloc
# COPY src/deps/mimalloc /bun/src/deps/mimalloc
# RUN make mimalloc;
# FROM bun_base as zlib
# COPY src/deps/zlib /bun/src/deps/zlib
# RUN make zlib;
# FROM bun_base as libarchive
# COPY src/deps/libarchive /bun/src/deps/libarchive
# RUN make libarchive;
# FROM bun_base as boringssl
# COPY src/deps/boringssl /bun/src/deps/boringssl
# RUN make boringssl;
# FROM bun_base as picohttp
# COPY src/deps/picohttpparser /bun/src/deps/picohttpparser
# COPY src/deps/*.c /bun/src/deps/
# COPY src/deps/*.h /bun/src/deps/
# RUN make picohttp
# FROM bun_base as identifier_cache
# COPY src/js_lexer/identifier_data.zig /bun/src/js_lexer/identifier_data.zig
# COPY src/js_lexer/identifier_cache.zig /bun/src/js_lexer/identifier_cache.zig
# RUN make identifier-cache
# FROM bun_base as node_fallbacks
# COPY src/node-fallbacks /bun/src/node-fallbacks
# RUN make node-fallbacks
# FROM bun_base as prebuild
# WORKDIR /bun
# COPY ./src /bun/src
# COPY ./build.zig /bun/build.zig
# COPY ./completions /bun/completions
# COPY ./packages /bun/packages
# COPY ./build-id /bun/build-id
# COPY ./package.json /bun/package.json
# COPY ./misctools /bun/misctools
# COPY --from=mimalloc /bun-deps/*.o /bun-deps
# COPY --from=libarchive /bun-deps/*.a /bun-deps
# COPY --from=picohttp /bun-deps/*.o /bun-deps
# COPY --from=boringssl /bun-deps/*.a /bun-deps
# COPY --from=zlib /bun-deps/*.a /bun-deps
# COPY --from=node_fallbacks /bun/src/node-fallbacks /bun/src/node-fallbacks
# COPY --from=identifier_cache /bun/src/js_lexer/*.blob /bun/src/js_lexer/
# ENV ICU_FLAGS="-I/webkit/include/wtf $ICU_FLAGS"
# RUN apk add --no-cache chromium && npm install -g esbuild && make \
# jsc-bindings-headers \
# api \
# analytics \
# bun_error \
# fallback_decoder
# FROM prebuild as release
# ENV BUN_RELEASE_DIR /opt/bun
# ENV LIB_ICU_PATH /usr/lib
# RUN apk add icu-static icu-dev && mkdir -p $BUN_RELEASE_DIR; make release \
# copy-to-bun-release-dir
# FROM alpine:3.15 as bun
# COPY --from=release /opt/bun/bun /opt/bun/bin/bun
# ENV BUN_INSTALL /opt/bun
# ENV PATH /opt/bun/bin:$PATH
# LABEL org.opencontainers.image.title="bun - Linux ${BUILDARCH} (musl)"
# LABEL org.opencontainers.image.source=https://github.com/jarred-sumner/bun
# FROM release as test
# ENV PATH /opt/bun/bin:$PATH
# ENV PATH /bun/packages/bun-linux-aarch64:/bun/packages/bun-linux-x64:$PATH
# ENV BUN_INSTALL /opt/bun
# WORKDIR /bun
# COPY ./integration /bun/integration
# COPY ./integration/snippets/package-json-exports/_node_modules_copy /bun/integration/snippets/package-json-exports/_node_modules_copy
# CMD [ "bash", "-c", "npm install && cd /bun/integration/snippets && npm install && cd /bun && make copy-test-node-modules test-all"]
# # FROM bun

1097
Makefile

File diff suppressed because it is too large Load Diff

1905
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"
}
}

View File

@@ -1,6 +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) => readFileSync(file, "utf8")).join(""));
console.log(
arg.map((file) => Buffer.from(readFileSync(file, "utf8"))).join("")
);

View File

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

View File

@@ -1,4 +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();

View File

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

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();

View File

@@ -1,5 +0,0 @@
// clang -O3 -shared -mtune=native ./noop.c -o noop.dylib
void noop();
void noop() {}

Binary file not shown.

View File

@@ -1,15 +0,0 @@
import { dlopen } from "bun:ffi";
import { bench, run } from "mitata";
const {
symbols: { noop },
} = dlopen("./noop.dylib", {
noop: {
args: [],
returns: "void",
},
});
bench("noop", () => {
noop();
});
run({ collect: false, percentiles: true });

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"
}
}

View File

@@ -1 +0,0 @@
./napi-plus100

View File

@@ -1,37 +0,0 @@
## FFI overhead comparison
This compares the cost of simple function calls going from JavaScript to native code and back in:
- Bun v0.0.79
- napi.rs (Node v17.7.1)
- Deno v1.21.1
To set up:
```bash
bun setup
```
To run the benchmark:
```bash
bun bench
```
**add 100 to a number**:
| Overhead | Using | Version | Platform |
| -------- | ------- | ------- | --------------- |
| 7ns | bun:ffi | 0.0.79 | macOS (aarch64) |
| 18ns | napi.rs | 17.7.1 | macOS (aarch64) |
| 580ns | Deno | 1.21.1 | macOS (aarch64) |
**function that does nothing**:
| Overhead | Using | Version | Platform |
| -------- | ------- | ------- | --------------- |
| 3ns | bun:ffi | 0.0.79 | macOS (aarch64) |
| 15ns | napi.rs | 17.7.1 | macOS (aarch64) |
| 431ns | Deno | 1.21.1 | macOS (aarch64) |
The native [functions](./plus100.c) called in Deno & Bun are the same. The function called with napi.rs is based on napi's official [package-template](https://github.com/napi-rs/package-template) in https://github.com/Jarred-Sumner/napi-plus100

View File

@@ -1,7 +0,0 @@
#!/bin/bash
rm -rf plus100-napi
git clone https://github.com/Jarred-Sumner/napi-plus100 plus100-napi --depth=1
cd plus100-napi
npm install
npm run build

Binary file not shown.

View File

@@ -1,12 +0,0 @@
{
"name": "plus100",
"scripts": {
"setup": "bun run napi-setup && bun run compile",
"bench-deno": "deno run --allow-ffi --unstable -A plus100.deno.js",
"napi-setup": "bash download-napi-plus100.sh",
"bench-napi": "node plus100.napi.mjs",
"bench-bun": "bun ./plus100.bun.js",
"compile": "clang -mtune=native -O3 -shared ./plus100.c -o plus100.dylib",
"bench": "bun run bench-bun && bun run bench-napi && bun run bench-deno"
}
}

Submodule bench/ffi/plus100/plus100-napi deleted from 485de94d06

View File

@@ -1,52 +0,0 @@
import { run, bench, group, baseline } from "mitata";
import { dlopen, suffix } from "bun:ffi";
import { readdirSync } from "fs";
const {
symbols: {
plus100: { native: plus100 },
noop,
},
close,
} = dlopen(`./plus100.dylib`, {
plus100: {
args: ["int32_t"],
returns: "int32_t",
},
noop: {
args: [],
},
});
const {
plus100: plus100napi,
noop: noopNapi,
} = require("./plus100-napi/index.js");
group("plus100", () => {
bench("plus100(1) ffi", () => {
plus100(1);
});
bench("plus100(1) napi", () => {
plus100napi(1);
});
});
group("noop", () => {
bench("noop() ffi", () => {
noop();
});
bench("noop() napi", () => {
noopNapi();
});
});
// collect option collects benchmark returned values into array
// prevents gc and can help with jit optimizing out functions
await run({ collect: false, percentiles: true });
console.log("\n");
if (plus100(1) !== 101) {
throw new Error("plus100(1) !== 101");
}

View File

@@ -1,8 +0,0 @@
// clang -mtune=native -O3 -shared ./plus100.c -o plus100.dylib
#include <stdint.h>
int32_t plus100(int32_t a);
int32_t plus100(int32_t a) { return a + 100; }
void noop(void);
void noop(void) {}

View File

@@ -1,30 +0,0 @@
import { run, bench, group, baseline } from "https://esm.sh/mitata";
const {
symbols: { plus100: plus100, noop },
close,
} = Deno.dlopen("./plus100.dylib", {
plus100: {
parameters: ["i32"],
result: "i32",
},
noop: {
parameters: [],
result: "void",
},
});
bench("plus100(1) ", () => {
plus100(1);
});
bench("noop() ", () => {
noop();
});
// collect option collects benchmark returned values into array
// prevents gc and can help with jit optimizing out functions
await run({ collect: false, percentiles: true });
if (plus100(1) !== 101) {
throw new Error("plus100(1) !== 101");
}

Binary file not shown.

View File

@@ -1,19 +0,0 @@
import { bench, run } from "mitata";
const { plus100, noop } =
"Bun" in globalThis
? require("./plus100-napi")
: (await import("module")).createRequire(import.meta.url)("./plus100-napi");
bench("plus100(1) napi", () => {
plus100(1);
});
bench("noop() napi", () => {
noop();
});
await run({ collect: false, percentiles: true });
console.log("\n");
if (plus100(1) !== 101) {
throw new Error("plus100(1) !== 101");
}

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

View File

@@ -1,4 +1,4 @@
import { bench, group, run } from "mitata";
import { run, bench } from "mitata";
import { gzipSync, gunzipSync } from "bun";
const data = new TextEncoder().encode("Hello World!".repeat(9999));
@@ -17,4 +17,4 @@ bench(`gunzipSync("Hello World!".repeat(9999)))`, () => {
gunzipSync(compressed);
});
run({ collect: false, percentiles: true });
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;
}

View File

@@ -1,4 +1,4 @@
import { bench, group, run } from "mitata";
import { run, bench } from "mitata";
import { gzipSync, gunzipSync } from "zlib";
const data = new TextEncoder().encode("Hello World!".repeat(9999));
@@ -17,4 +17,4 @@ bench(`gunzipSync("Hello World!".repeat(9999)))`, () => {
gunzipSync(compressed);
});
run({ collect: false, percentiles: true });
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

@@ -36,7 +36,7 @@ bun is 14x faster than Next.js at hot reloading CSS.
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 innaccurate.
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:

View File

@@ -75,7 +75,7 @@ pub fn main() anyerror!void {
std.fs.deleteFileAbsolute(video) catch {};
var screen_recorder_argv = [_][]const u8{ "screencapture", "-v", video };
var recorder = try std.ChildProcess.init(&screen_recorder_argv, allocator);
var recorder = std.ChildProcess.init(&screen_recorder_argv, allocator);
recorder.stdin_behavior = .Pipe;
try recorder.spawn();
std.time.sleep(std.time.ns_per_s);

View File

@@ -75,7 +75,7 @@ pub fn main() anyerror!void {
std.fs.deleteFileAbsolute(video) catch {};
var screen_recorder_argv = [_][]const u8{ "screencapture", "-v", video };
var recorder = try std.ChildProcess.init(&screen_recorder_argv, allocator);
var recorder = std.ChildProcess.init(&screen_recorder_argv, allocator);
recorder.stdin_behavior = .Pipe;
try recorder.spawn();
std.time.sleep(std.time.ns_per_s);

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
echo "Running next at 24ms"
PROJECT=next SLEEP_INTERVAL=24 make generate &

View File

@@ -1,4 +1,3 @@
import { Global } from "@emotion/react";
export function CSSInJSStyles() {
return (

View File

@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {}
}
}
"compilerOptions": {
"baseUrl": ".",
"paths": {}
}
}

View File

@@ -0,0 +1,12 @@
import { bench, run } from "mitata";
bench("JSON.stringify({hello: 'world'})", () =>
JSON.stringify({ hello: "world" })
);
const otherUint8Array = new Uint8Array(1024);
bench("Uint8Array.from(otherUint8Array)", () =>
Uint8Array.from(otherUint8Array)
);
run();

3
bench/log/.env Normal file
View File

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

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

@@ -0,0 +1,5 @@
import { bench, run } from "mitata";
bench("console.log('hello')", () => console.log("hello"));
bench("console.log({ hello: 'object' })", () => console.log({ hello: "object" }));
await run();

5
bench/log/deno.mjs Normal file
View File

@@ -0,0 +1,5 @@
import { bench, run } from "../node_modules/mitata/src/cli.mjs";
bench("console.log", () => console.log("hello"));
bench("console.log({ hello: 'object' })", () => console.log({ hello: "object" }));
await run();

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

@@ -0,0 +1,5 @@
import { bench, run } from "mitata";
bench("console.log", () => console.log("hello"));
bench("console.log({ hello: 'object' })", () => console.log({ hello: "object" }));
await run();

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

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

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