Compare commits

...

7856 Commits

Author SHA1 Message Date
Jarred Sumner
57441cbc2a Update exports.zig 2025-01-01 01:49:32 -08:00
Jarred Sumner
697d9c19ff Report memory cost of sourcemaps 2025-01-01 01:31:43 -08:00
Jarred Sumner
be959e111a Do not assert valid windows path in chdirOSPath because the SetCurrentDirectoryW function will validate the path 2024-12-31 21:08:07 -08:00
Jarred Sumner
19191659cf Avoid resolving substrings in bun:sqlite and Buffer.byteLength (#16092) 2024-12-31 19:48:33 -08:00
Jarred Sumner
30008ed0fc Bump WebKit again (#16091) 2024-12-31 18:17:56 -08:00
Jarred Sumner
e3a1d026f9 Fix crash in bake on load (#16021) 2024-12-31 17:16:12 -08:00
Jarred Sumner
02196cbf0e Avoid resolving substrings unnecessarily (#16090) 2024-12-31 17:06:49 -08:00
Jarred Sumner
1ae855223c Bump WebKit (#16068) 2024-12-31 14:48:54 -08:00
Dylan Conway
5058bd3913 handle bundle(d)Dependencies in bun install (#16055) 2024-12-31 13:40:55 -08:00
Don Isaac
b406509afd refactor: remove unused script execution context file (#16059) 2024-12-31 13:31:33 -08:00
Dylan Conway
82f9b13e08 docs: fix bun.lock section (#16088) 2024-12-31 11:40:28 -08:00
Dylan Conway
37e7f5ba8f transpiler: fix crash with malformed enums (#16084) 2024-12-31 09:09:09 -08:00
Navishkar Rao
babd8b6028 Update nextjs.md docs with starter example (#16072) 2024-12-30 22:26:19 -08:00
Don Isaac
ab52058439 fix(us): memory leak when getting root certificate (#16073) 2024-12-30 22:20:15 -08:00
Lars Volkheimer
e96dded366 fix formatting of Set in Bun.inspect() (#16013) 2024-12-30 13:44:40 -08:00
Jarred Sumner
76bfceae81 Support jsonb, idle_timeout, connection_timeout, max_lifetime timeouts in bun:sql. Add onopen and onclose callbacks. Fix missing "code" property appearing in errors. Add error codes for postgres. (#16045) 2024-12-30 13:25:01 -08:00
Dylan Conway
f0073bfa81 fix(install): free correct pointer in bun patch --commit (#16064) 2024-12-30 12:38:39 -08:00
Devanand Sharma
18ac7f9509 Add remove() and isRemoved in HTMLRewriterTypes.Doctype interface (#16031) 2024-12-28 22:57:25 -08:00
Ciro Spaciari
fe4176e403 feat(s3) s3 client (#15740)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
2024-12-28 17:46:22 -08:00
Jarred Sumner
ed0980cf94 Make creating errors slightly faster (#16023) 2024-12-28 01:32:32 -08:00
Jarred Sumner
dd243a06a5 Log slow lifecycle scripts (#16027) 2024-12-28 01:31:30 -08:00
Jarred Sumner
7b06872abb Deflake fetch tests (#16000) 2024-12-27 14:07:41 -08:00
Don Isaac
d8e644fc25 fix(node/path): crash when joining long paths (#16019) 2024-12-27 17:58:21 +00:00
Meghan Denny
4bcc5b25d9 node: fix all of test-event-emitter (#16009) 2024-12-27 01:34:49 -08:00
Jarred Sumner
19675f474a Update .cursorignore 2024-12-26 11:48:30 -08:00
Jarred Sumner
bba998a611 Create .cursorignore 2024-12-26 11:48:11 -08:00
Jarred Sumner
145a7fd92e Better unicode identifier start / continue check (#15455) 2024-12-25 23:02:46 -08:00
Jarred Sumner
d4c0432a5f Refactor JS parser visitor step into individual functions to reduce stack space usage (#15993) 2024-12-25 23:02:05 -08:00
Jarred Sumner
379c79ee2e Fix typo 2024-12-25 22:35:52 -08:00
Jarred Sumner
2b2ca3275c Improve stack overflow, show more properties in Error objects (#15985)
Co-authored-by: Dave Caruso <me@paperdave.net>
2024-12-25 21:47:13 -08:00
Jarred Sumner
7317c7b4a2 Compress completions list to make zig build a little faster (#15992) 2024-12-25 18:04:46 -08:00
Jarred Sumner
608101c975 Add zlib microbenchmark
need to improve this
2024-12-24 04:20:24 -08:00
Jarred Sumner
52a568d2b2 Fix flaky zlib dictionary test (#15976) 2024-12-24 02:27:07 -08:00
Jarred Sumner
60cb505a98 Use JSObject instead of JSFunction in Bun.plugin (#15968) 2024-12-23 12:33:11 -08:00
Jarred Sumner
da54e81955 Support bundling HTML files and their js, css, and assets in Bun.build and bun build (#15940) 2024-12-23 11:04:38 -08:00
Jarred Sumner
774e30d383 Make originalLine and originalColumn getter calls not observable (#15951) 2024-12-23 03:40:51 -08:00
Jarred Sumner
c6b22d399f Fix showing source code that looks like export default "file-path" (#15957) 2024-12-23 03:40:00 -08:00
Jarred Sumner
1fa6d9e695 +2 passing node:events tests (#15952) 2024-12-23 01:45:13 -08:00
Jarred Sumner
4f8a6b33c4 +5 passing node:zlib tests (#15944) 2024-12-22 20:39:42 -08:00
Martin Amps
a6ad3b9be4 add --elide-lines override flag for workspace filtering (#15837) 2024-12-22 00:14:46 -08:00
github-actions[bot]
b63a6c83b4 deps: update libdeflate to v1.23 (#15934)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-12-21 21:28:17 -08:00
Don Isaac
14b44aeb49 fix(process): process.kill allows zero or negative pids (#15920) 2024-12-21 08:45:39 +00:00
Jarred Sumner
d6b9c444c1 Rename src/bundler.zig to src/transpiler.zig (#15921)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-12-21 00:59:37 -08:00
Don Isaac
3c37b7f806 fix(lexer): do not treat '#bun' in a url as a pragma (#15912)
Co-authored-by: Don Isaac <don@bun.sh>
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
2024-12-21 04:57:42 +00:00
Don Isaac
acb9fdfcf5 refactor: organize native glob code (#15914)
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
2024-12-20 20:59:07 -08:00
Jarred Sumner
50eec0025b Add regression test for #15902 2024-12-20 19:28:13 -08:00
Jarred Sumner
ac3cd09a42 Bump 2024-12-20 17:54:39 -08:00
Dylan Conway
6e222c8523 fix #15902 (#15911) 2024-12-20 17:03:37 -08:00
Jarred Sumner
b8f28ed8af Bump 2024-12-20 03:44:55 -08:00
dave caruso
7b3554f90c feat(bundler): add --windows-icon, --windows-no-console, fix bun.exe's main icon (#15894)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-12-20 03:22:16 -08:00
Jarred Sumner
0c50b0fcec Fix potential runtime crash if transpiler generates invalid commonjs (#15898) 2024-12-20 02:12:08 -08:00
Jarred Sumner
bf9c6fdc00 Revert "fix(lexer): do not treat '#bun' in a url as a pragma" (#15899) 2024-12-20 01:31:48 -08:00
Don Isaac
1d9fbe7d67 fix(lexer): do not treat '#bun' in a url as a pragma (#15888)
Co-authored-by: Don Isaac <don@bun.sh>
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
2024-12-20 01:26:30 -08:00
Brian Kim
a8893dcae5 Fix macro imports (#15833) 2024-12-20 08:34:45 +00:00
dave caruso
8a4852b8b0 fix: pass homedir test (#15811)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-12-20 00:36:59 -08:00
Dylan Conway
45ca9e08c3 fix(install): peer/dev/optional = false lockfile fix (#15874)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-20 00:34:21 -08:00
Jarred Sumner
e3fed49082 Implement expect().toHaveBeenCalledOnce() (#15871)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-12-20 00:23:55 -08:00
Dylan Conway
9164760a5a fix pnpm.test.ts (#15897) 2024-12-19 23:52:50 -08:00
Dylan Conway
747828965e fix(install): sort tree dependencies by behavior and name (#15895) 2024-12-19 23:14:33 -08:00
Jarred Sumner
35679b3178 Update node_util_binding.zig 2024-12-19 17:34:38 -08:00
Don Isaac
960b2b2c11 perf(node:util): fast path for extractedSplitNewLines (#15838)
Co-authored-by: Don Isaac <don@bun.sh>
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
2024-12-19 23:42:18 +00:00
Don Isaac
f546a9b605 chore: add usage messages to check-node.sh (#15885)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-19 22:32:25 +00:00
Ashcon Partovi
3cbcd43f9a ci: Enable merge queue, disable soft failing tests 2024-12-19 11:18:13 -08:00
Jarred Sumner
b254e69322 Fix svelte testing guide 2024-12-19 03:44:46 -08:00
Jarred Sumner
5dcfc6f10f Update svelte-test.md 2024-12-19 03:17:02 -08:00
Jarred Sumner
d9b2396948 Update svelte-test.md 2024-12-19 03:16:06 -08:00
Jarred Sumner
e21050dc6f Update svelte-test.md 2024-12-19 03:09:21 -08:00
Jarred Sumner
276da2dbf5 Create svelte-test.md 2024-12-19 03:09:10 -08:00
Jarred Sumner
b539ca32ea Make "use strict" become CommonJS if we don't know whether it's ESM or CJS (#15868) 2024-12-18 23:23:50 -08:00
Jarred Sumner
ebc2eb5c5b Support colors array in util.styleText (#15872) 2024-12-18 23:23:42 -08:00
Jarred Sumner
10990f5213 Fixes #3554 (#15870) 2024-12-18 22:54:11 -08:00
Jarred Sumner
42f23f0966 PR feedback from #15865 2024-12-18 19:42:33 -08:00
Jarred Sumner
ac6723eab7 +13 passing node:vm tests (#15865) 2024-12-18 19:41:37 -08:00
Michael H
8e20d02b9b update registry scope guide (.npmrc is supported) (#15866) 2024-12-18 19:28:23 -08:00
dave caruso
41924211f2 add throw: true in Bun.build, to be made default in 1.2 (#15861) 2024-12-18 19:27:59 -08:00
Michael H
5d2b72aa3b don't make inline sourcemap in normal vscode terminal (#15862) 2024-12-18 18:30:39 -08:00
Don Isaac
e66a347158 fix(module-loader): use a more descriptive crash message (#15831)
Co-authored-by: Don Isaac <don@bun.sh>
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
2024-12-18 14:10:46 -08:00
Jarred Sumner
b5b51004e8 Bump WebKit (#15828)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-12-17 20:59:10 -08:00
Dylan Conway
2272b852ba fix(install): npm version to git resolution package-lock.json migration (#15810) 2024-12-17 19:59:23 -08:00
Michael H
df5f95b19e vscode: allow trailing comma in bun.lock (#15747) 2024-12-17 18:05:30 -08:00
190n
59e06b0df5 fix(napi): set lossless parameter in napi_get_value_bigint_{int64,uint64}, and trim leading zeroes in napi_create_bigint_words (#15804) 2024-12-17 17:38:12 -08:00
Dylan Conway
430c1dd583 add install.saveTextLockfile to bunfig.toml (#15827) 2024-12-17 16:52:04 -08:00
Jarred Sumner
ad1738d23c Fix process.on from non-mainthread (#15825) 2024-12-17 16:51:19 -08:00
Jarred Sumner
b7efaa5b19 Bump 2024-12-17 15:30:18 -08:00
Jarred Sumner
1d48561709 Update plugins.md 2024-12-17 01:49:02 -08:00
Jarred Sumner
f2e0d606b6 Update plugins.md 2024-12-17 01:34:17 -08:00
Jarred Sumner
385868f504 Update plugins.md 2024-12-17 01:34:00 -08:00
Jarred Sumner
eecbeb32ec Move bundler plugin docs 2024-12-17 01:31:14 -08:00
Jarred Sumner
903d8bfa4a Be more careful about setting the rlimit max 2024-12-17 01:15:24 -08:00
Don Isaac
9524e1c86a fix: Bun.deepMatch on circular objects causing segfault (#15672)
Co-authored-by: Don Isaac <don@bun.sh>
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-16 22:33:34 -08:00
dave caruso
77acfa23a7 pass all upstream node:os tests, all supported node:async_hooks tests (#15802) 2024-12-16 22:22:54 -08:00
Jarred Sumner
9d3b461a25 CI: Remove unnecessary config 2024-12-16 20:38:05 -08:00
Jarred Sumner
9d63ee0edf CI: test concurrency group 2024-12-16 20:33:56 -08:00
Jarred Sumner
a3090fc204 CI: cancel previous canary build 2024-12-16 20:33:09 -08:00
Jarred Sumner
32c1fdf205 Rename estimateDirectMemoryUsageOf to estimateShallowMemoryUsageOf 2024-12-16 20:18:04 -08:00
Jarred Sumner
aada6f930f Fix heap snapshots memory usage stats. Introduce estimateDirectMemoryUsageOf function in "bun:jsc" (#15790) 2024-12-16 20:16:23 -08:00
Zack Radisic
3906d02e2c CSS fixes (#15806) 2024-12-16 19:40:53 -08:00
pfg
f276484f25 Add lldb scripts for zig & jsc (#15807) 2024-12-16 18:31:41 -08:00
Jarred Sumner
4bef96e8d1 Prevent unnecessary postinstall script from causing bun install to hang in unreliable networks 2024-12-16 18:19:43 -08:00
Michael H
f2d955f686 vscode extension: use new debug terminal provider (#15801)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-16 17:29:12 -08:00
Ashcon Partovi
e8b85cff40 ci: Retry and detect flaky tests (#15798) 2024-12-16 17:04:33 -08:00
Dylan Conway
d5f1f2f8ad Use the same hoisting logic for text lockfile (#15778) 2024-12-16 16:37:46 -08:00
Michael H
67e4aec990 attempt to fix debugger (#15788)
Co-authored-by: RiskyMH <RiskyMH@users.noreply.github.com>
2024-12-16 16:34:55 -08:00
Jarred Sumner
540a0a89ab Fix text input with ink (#15800) 2024-12-16 16:33:15 -08:00
190n
4eae3a90e8 fix(napi): Make napi_wrap work on regular objects (#15622)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-16 15:54:39 -08:00
Jarred Sumner
9604733ee1 ✂️ 2024-12-16 13:51:45 -08:00
Sam
7633f3cc35 docs: dns.prefetch doesn't require port anymore (#15792) 2024-12-16 06:52:49 -08:00
Michael H
1fa0dee5e9 document npm:<package-name> in install docs (#15754) 2024-12-15 07:19:34 -08:00
Jarred Sumner
80b0b88315 Deflake doesnt_crash.test.ts 2024-12-15 06:54:34 -08:00
github-actions[bot]
6a24a06741 deps: update c-ares to v1.34.4 (#15773)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-12-15 04:38:39 -08:00
Jarred Sumner
8a64038fae Deflake require.cache test 2024-12-15 00:55:18 -08:00
Jarred Sumner
65f5156589 Deflake process test 2024-12-15 00:47:59 -08:00
Brian Donovan
00a8392656 docs(bun-native-plugin-rs): fix typos (#15764) 2024-12-14 23:50:03 -08:00
Jarred Sumner
c218bffd94 Add "bin" field to bun.lock (#15763)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-12-14 22:52:17 -08:00
Jarred Sumner
3ce6ffa6be Make git dependencies faster + further optimize bun install (#15771) 2024-12-14 19:42:23 -08:00
Jarred Sumner
5326a998c7 Don't open node_modules 1,618 times (#15762) 2024-12-14 04:48:57 -08:00
Jarred Sumner
0d97c8157f Add debugger to entitlements plist 2024-12-14 01:57:08 -08:00
Jarred Sumner
ebc33327d3 Delete incorrect debug assertion 2024-12-14 01:56:55 -08:00
Dylan Conway
3df39f4bb7 bun.lock: fix --frozen-lockfile and resolving extra dependencies (#15748) 2024-12-13 22:40:12 -08:00
Jarred Sumner
c7020c2edc Make --expose gc work in nodetests 2024-12-13 22:30:26 -08:00
Meghan Denny
ac12438f69 node: fix test-zlib-from-gzip-with-trailing-garbage.js (#15757) 2024-12-13 21:51:02 -08:00
Jarred Sumner
1e19672841 fix clangd 2024-12-13 21:20:43 -08:00
Jarred Sumner
20f9cf0047 Fix flaky signal handlers on posix (#15751) 2024-12-13 20:13:56 -08:00
Don Isaac
bd1c5e9876 feat: add JSObject constructors (#15742)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-12 22:04:19 -08:00
Don Isaac
bbb56acdf7 test(ws): do not create temporary .sock files in root repo directory (#15670)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-12 21:39:30 -08:00
Jarred Sumner
f64ca29c0e Fix symbols test. Bump Webkit. (#15741) 2024-12-12 20:53:02 -08:00
Dylan Conway
8b3b1442fd bun.lock workspace sorting and comma bugfix (#15739) 2024-12-12 19:33:44 -08:00
Jarred Sumner
e72692801a [ci] Reduce number of environment variables we send (#15730) 2024-12-12 17:48:53 -08:00
Dylan Conway
e146734596 bun.lock fixes (#15724) 2024-12-12 16:45:26 -08:00
Jarred Sumner
7ded578547 [publish images] 2024-12-12 03:22:45 -08:00
Dylan Conway
71af1950fb bump webkit (#15328)
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Ben Grant <ben@bun.sh>
Co-authored-by: Meghan Denny <meghan@bun.sh>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2024-12-12 03:21:56 -08:00
Jarred Sumner
7991be86a3 Fix build 2024-12-12 02:18:25 -08:00
Jarred Sumner
6f50f51528 Deflake a test 2024-12-12 02:07:29 -08:00
Jarred Sumner
2bdf33cac8 Remove silly hack 2024-12-12 01:42:03 -08:00
Jarred Sumner
b3628a526d ✂️ 2024-12-12 01:39:34 -08:00
pfg
1b5cb891c8 More passing console tests (#15676)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-12 01:37:10 -08:00
Don Isaac
fe1e3be104 test(node): add parallel/test-path-resolve.js (#15707)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-12 01:36:36 -08:00
dave caruso
79dc13ca79 pass all string decoder tests (#15723)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-12 01:35:08 -08:00
Jarred Sumner
2ccdf0122c Fix edgecase with socketpair() impacting shell and spawn (#15725) 2024-12-12 01:23:40 -08:00
Zack Radisic
fddc28d608 CSS moar fixes (#15719) 2024-12-11 21:45:41 -08:00
Meghan Denny
834b6436c6 fix canary 2024-12-11 20:06:42 -08:00
Zack Radisic
113b62be82 Native plugin follow up (#15632)
Co-authored-by: zackradisic <zackradisic@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-11 17:51:21 -08:00
pfg
2e0f229722 test(events): 66% -> 94% (#15716) 2024-12-11 17:43:19 -08:00
Don Isaac
08e2cf3761 test: mock 'node:test' module in node test harness (#15696)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-11 17:40:44 -08:00
pfg
0e8f075191 Pass node querystring tests (#15695) 2024-12-11 17:39:46 -08:00
Ashcon Partovi
667821c53a ci: Fix canary releases (#15713) 2024-12-11 09:47:17 -08:00
Dylan Conway
b55ca429c7 Implement text-based lockfile (#15705) 2024-12-11 05:05:49 -08:00
Don Isaac
78445c543e refactor: set default for name in ErrorCode.ts (#15699)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-11 01:07:57 -08:00
Don Isaac
24d73e948a test(node): add passing path parse format test (#15703)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-11 00:34:58 -08:00
Jarred Sumner
5cfa4cc0af ✂️ 2024-12-11 00:34:19 -08:00
Don Isaac
0bc57eebcb test(deno): use expect.toBeGreaterThanorEqual on failing deno perf … (#15700)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-10 22:05:46 -08:00
Meghan Denny
455de2a449 deps: update boringssl (#15677) 2024-12-10 20:33:36 -08:00
Meghan Denny
81bc01d477 fix test-event-emitter-method-names.js on windows (#15692) 2024-12-10 16:33:57 -08:00
snwy
d21444a681 test: 100% punycode (#15691) 2024-12-10 15:38:48 -08:00
Don Isaac
2d5ea4993f fix(codegen): better error messages for internals using module.exports (#15687) 2024-12-10 15:10:21 -08:00
dave caruso
b39632c921 feat: new binding generator (#15638) 2024-12-10 12:43:17 -08:00
Jarred Sumner
38325aa41c Introduce env option in Bun.build() and bun build to let you inject FOO_PUBLIC_*-style env vars (#15678) 2024-12-10 01:09:46 -08:00
Jarred Sumner
969bab3848 [build images] 2024-12-10 00:54:04 -08:00
Jarred Sumner
5bd4972d5b Add passing node tests (#15675) 2024-12-10 00:02:09 -08:00
Meghan Denny
68780faee2 fix windows build 2024-12-09 22:30:44 -08:00
Jarred Sumner
0bbc18fd19 Fix rare crash in bun install (#15651) 2024-12-09 20:59:29 -08:00
Meghan Denny
53318c8b13 ci: run re-enable node tests on all platforms (#15572) 2024-12-09 19:08:30 -08:00
Jarred Sumner
abe69901b2 make the helper quieter 2024-12-09 17:42:40 -08:00
Jarred Sumner
c0cf0414a0 Add helper for running node tests 2024-12-09 17:37:53 -08:00
Natt Nguyen
3dc3527171 fix: testing library docs (#15667) 2024-12-09 16:29:34 -08:00
Don Isaac
af4f1c7d39 test: fix case to allow bun-debug (#15660)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-08 23:48:43 -08:00
github-actions[bot]
2c1dea818c deps: update sqlite to 3.470.200 (#15652)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-12-08 02:16:41 -08:00
Kai Tamkun
cc125b475f Fix missing "readable" events (#15629) 2024-12-06 23:59:47 -08:00
Don Isaac
cbbf88f3a6 refactor: remove unused main_api.zig file (#15635)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-06 21:01:25 -08:00
Don Isaac
8064a55a48 test(bake): fix double free (#15634)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-06 20:06:26 -08:00
Jarred Sumner
0531d6756c Ci is doing too much 2024-12-06 19:28:28 -08:00
Ciro Spaciari
6135b3dec9 fix(CI) deflaky node-http.test.ts (#15625) 2024-12-06 19:16:59 -08:00
Don Isaac
b08dd8795e test(web): fix setTimeout refresh test (#15630)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-06 19:14:07 -08:00
Ciro Spaciari
c1eba5886f fix(net) signal should destroy the connection and propagate the error properly (#15624) 2024-12-06 16:10:33 -08:00
Ciro Spaciari
fcca2cc398 fix(fetch) fix redirect + Connection: close (#15623) 2024-12-06 15:06:11 -08:00
Yuto Ogino
dd32e6b416 Fix zsh auto-completion for package.json scripts with name containing colons (#15619) 2024-12-06 10:53:43 -08:00
Jarred Sumner
b453360dff Fixes #15480 (#15611) 2024-12-05 21:15:21 -08:00
pfg
1476e4c958 implement toThrowErrorMatchingSnapshot, toThrowErrorMatchingInlineSnapshot (#15607) 2024-12-05 19:07:18 -08:00
Ashcon Partovi
eacf89e5bf ci: Fix CPU count on build runners 2024-12-05 14:20:05 -08:00
Ashcon Partovi
fa6ac405a4 ci: Add bootstrap.ps1 and automate Windows build images (#15606) 2024-12-05 15:16:37 -07:00
pfg
4c8cbecb08 Support flag parameter in readFileSync (#15595)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-05 13:41:44 -08:00
Michael H
00b7d6479b bun repl disable inspector/debugger (#15594) 2024-12-05 13:41:21 -08:00
pfg
bcf023c829 Implement expect().toMatchInlineSnapshot() (#15570) 2024-12-05 13:07:10 -08:00
Jarred Sumner
b7b1ca8ebe Fixes https://github.com/oven-sh/bun/issues/15307 2024-12-05 02:39:34 -08:00
Jarred Sumner
784bc4e012 Introduce high-performance native addon API in Bun.build, starting with build.onBeforeParse hook (#14971)
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com>
Co-authored-by: zackradisic <zackradisic@users.noreply.github.com>
2024-12-04 22:35:43 -08:00
Ciro Spaciari
dd5c40dab7 fix(node:http) fix node:http chunked encoding on server and add chunked encoding support on the client (#15579)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-04 17:58:21 -08:00
190n
3a4a9ae4e9 Add v8::api_internal::FromJustIsNothing (#15583)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-04 17:57:40 -08:00
Jarred Sumner
9d1a35b658 Fixes https://github.com/oven-sh/bun/issues/15556 (#15582)
Co-authored-by: Andres Gutierrez <andresgutierrez535@gmail.com>
2024-12-04 17:57:05 -08:00
Meghan Denny
61cc9c3947 Revert "ci: Add bootstrap.ps1 and automate Windows build images" (#15591) 2024-12-04 17:07:35 -08:00
Ashcon Partovi
e904a181d8 ci: Add bootstrap.ps1 and automate Windows build images (#15466)
Co-authored-by: Electroid <Electroid@users.noreply.github.com>
2024-12-04 17:33:00 -07:00
Jarred Sumner
55a0bdc68d deflake process.test.js 2024-12-04 13:52:37 -08:00
Meghan Denny
55454f7910 [publish images] 2024-12-04 13:46:17 -08:00
Jarred Sumner
e4aeb761e4 Ensure we always drain the dependency list in runTasks() (#15511) 2024-12-04 12:40:11 -08:00
pfg
f9efe94b85 Fixes ^C on bun vite (#15545) 2024-12-04 12:39:55 -08:00
Robert Shuford
7eb8a3feae Fixes #14433 - global .npmrc not using auth (#15539) 2024-12-04 12:37:18 -08:00
Dylan Conway
d7ed9c673e add a --config test for bun install (#15546) 2024-12-04 12:36:10 -08:00
Ashcon Partovi
b4dce96c40 ci: Publish musl releases to npm 2024-12-04 10:19:15 -08:00
Meghan Denny
52ef8b1778 ci: make annotations always link to file content by commit (#15573) 2024-12-04 01:30:26 -08:00
dave caruso
baff3c900e bake: fix the big regressions (#15544)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
2024-12-03 22:15:59 -08:00
Meghan Denny
23299dadf6 ci: run node tests directly instead of translated files (#15565)
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-12-03 22:10:50 -08:00
Jarred Sumner
0d5e4e162b spawnSync shouldn't throw (#15561)
Co-authored-by: Meghan Denny <meghan@bun.sh>
2024-12-03 19:26:36 -08:00
Don Isaac
d27594ecf4 fix(deps/boringssl): re-enable BIO_new_mem_buf (#15559)
Co-authored-by: Don Isaac <don@bun.sh>
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
2024-12-03 16:11:42 -08:00
Ciro Spaciari
a2e2d114e9 fix(net/tls) fix backpressure pause on socket (#15543) 2024-12-03 12:53:48 -08:00
Kai Tamkun
da3d64b1ef Remove a duplicate if statement (#15555) 2024-12-03 12:33:27 -08:00
Jarred Sumner
ce64e04b16 Reduce memory usage of WebSocket server (#15553) 2024-12-03 12:33:04 -08:00
Dylan Conway
55473cb64a fix(node:crypto): use options from createHash(alg, options) (#15547) 2024-12-03 12:32:41 -08:00
Meghan Denny
752441d911 package.json: put :local builds into their own folder (#15540) 2024-12-03 12:22:46 -08:00
Leah Lundqvist
da5d4d791c docs: add .env.test to guides/runtime/set-env for consistency with do… (#15542) 2024-12-02 15:01:08 -08:00
Dylan Conway
6d453be7d9 fix 14540 (#15498) 2024-12-02 14:57:49 -08:00
Meghan Denny
2d441d868b zig: make throw use JSError (#15444) 2024-12-02 14:19:18 -08:00
Michael H
56ad4cc4a6 simplify vscode extension title (#15519) 2024-12-02 06:29:07 -08:00
github-actions[bot]
d2acb2eac0 deps: update libdeflate to v1.22 (#15505)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-11-30 07:26:45 -08:00
github-actions[bot]
de7eafbdd1 deps: update lshpack to v2.3.3 (#15501)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-11-29 20:13:47 -08:00
github-actions[bot]
4114986c3e deps: update c-ares to v1.34.3 (#15502)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-11-29 19:10:10 -08:00
dave caruso
8aa451c2dc bake(dev): plugins in dev server, with other fixes (#15467)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-29 19:07:56 -08:00
Michael H
497cef9759 bun upgrade --help document --stable option (#15472)
Co-authored-by: RiskyMH <RiskyMH@users.noreply.github.com>
2024-11-29 18:02:18 -08:00
imide
dd57b95546 Add musl related documentation to installation.md (#15500) 2024-11-29 18:01:44 -08:00
github-actions[bot]
ea7c4986d7 deps: update lolhtml to 4f8becea13a0021c8b71abd2dcc5899384973b66 (#15462)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-29 04:20:10 -08:00
Jarred Sumner
6c7edf2dbe bump 2024-11-29 04:10:01 -08:00
Jarred Sumner
bf2f153f5c Check for unix:// instead of unix: 2024-11-28 22:07:06 -08:00
Jarred Sumner
f64a4c4ace Fix debugger connection issue on Windows 2024-11-28 22:05:58 -08:00
Jarred Sumner
0216431c98 Clean up debugger waiting logic (#15469) 2024-11-28 01:34:31 -08:00
Jarred Sumner
ae289c4858 use using 2024-11-28 00:40:47 -08:00
Jarred Sumner
5d1609fe5c Fixes #15470 2024-11-28 00:40:17 -08:00
Ciro Spaciari
471fe7b886 fix(net/tls) fix reusePort, allowHalfOpen, FIN before reconnect (#15452)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-27 21:30:30 -08:00
Alistair Smith
08222eda71 fix: Connect with 1 socket to new env var but still work with js debug terminal (#15458) 2024-11-27 20:47:23 -08:00
github-actions[bot]
6f8c5959d0 deps: update sqlite to 3.470.100 (#15465)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-11-27 20:39:38 -08:00
Jarred Sumner
40d5e745c9 Stagger the updates 2024-11-27 19:04:08 -08:00
Jarred Sumner
225bfd54fa Shorter branch names 2024-11-27 18:42:04 -08:00
Jarred Sumner
a6ca8c40d4 Add sqlite3 auto updater script 2024-11-27 18:36:41 -08:00
Jarred Sumner
b52ad226a5 Update actions 2024-11-27 18:08:23 -08:00
Jarred Sumner
5f8f805db9 Update update-libarchive.yml 2024-11-27 17:38:57 -08:00
Jarred Sumner
37c98bebd6 Update update-libarchive.yml 2024-11-27 17:36:32 -08:00
Jarred Sumner
bd01df19c1 github actions 2024-11-27 17:34:28 -08:00
Kai Tamkun
7fd16ebffa Fix incorrect public TS class field name minification (#15411) 2024-11-27 14:06:09 -08:00
Dennis Dudek
1bb211df56 bustDirCache on FileSystemRouter.reload & fix of dir_cache keys in windows (#15091)
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-27 12:21:32 -08:00
cdfzo
bdd0b89f16 docs: fix broken windows contributing guide url (#15451) 2024-11-27 13:01:39 -07:00
Jarred Sumner
841f593b12 Auto-update c-ares, libarchive, libdeflate, lolhtml, lshpack weekly (#15442) 2024-11-26 22:01:36 -08:00
Jarred Sumner
3afd19c73c Clean up .throwError (#15433) 2024-11-26 18:22:37 -08:00
Meghan Denny
b6a231add3 musl: fix test/js/bun/http/serve.test.ts (#15271)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-26 18:18:29 -08:00
Jarred Sumner
ca86bae5d5 Deflake next-build test (#15436) 2024-11-26 18:06:10 -08:00
Meghan Denny
215fdb4697 zig: make throwInvalidArgumentTypeValue use JSError (#15302)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-11-26 17:17:12 -08:00
snwy
578bdf1cd6 bake: params used when doing static site generation (#15430) 2024-11-26 16:58:14 -08:00
Ciro Spaciari
cf2fa30639 fix(fetch) fix deref + deinit (#15432) 2024-11-26 16:56:55 -08:00
Jarred Sumner
5b3c58bdf5 Update c-ares (#15435) 2024-11-26 16:55:53 -08:00
Michael H
0d6d4faa51 better printing for console.log types (#15404) 2024-11-26 14:27:39 -08:00
Meghan Denny
5e4642295a zig: eliminate errorUnionToCPP (#15416) 2024-11-26 14:11:48 -08:00
Kai Tamkun
68f026b3cd FFI: provide napi_env explicitly (#15431)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-26 13:54:24 -08:00
Meghan Denny
5e9563833d zig: fix missed compile error from merge 2024-11-26 13:35:32 -08:00
Nick Reilingh
6dd44cbeda Docs: cli/test.md - Completed GH Actions example (#15412) 2024-11-26 13:25:16 -08:00
Jarred Sumner
a9ce4d40c2 Add scratch*.{js,ts,tsx,mts,cts,mjs } to gitignore 2024-11-26 13:09:31 -08:00
Meghan Denny
663f00b62b zig: make throwOutOfMemory use JSError (#15413) 2024-11-26 12:58:43 -08:00
Jarred Sumner
f21fffd1bf Fix debugger printing exception 2024-11-25 19:57:08 -08:00
Jarred Sumner
d92d8dc886 Bump 2024-11-25 19:18:46 -08:00
Jarred Sumner
6d127ba3f4 Silence another debugger error 2024-11-25 19:13:56 -08:00
Jarred Sumner
c3d9e8c7af Fix crash in Bun v1.1.36 caused by VSCode extension update 2024-11-25 19:09:34 -08:00
Jarred Sumner
c25e744837 Silence debugger connection error 2024-11-25 19:02:56 -08:00
dave caruso
dc01a5d6a8 feat(DevServer): batch bundles & run them asynchronously (#15181)
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2024-11-25 18:55:47 -08:00
Meghan Denny
c434b2c191 zig: make throwPretty use JSError (#15410) 2024-11-25 18:08:42 -08:00
Jarred Sumner
8ca0eb831d Clean up some error handling code (#15368)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-11-25 15:42:02 -08:00
Ashcon Partovi
b19f13f5c4 bun-vscode: Bump version [no ci] 2024-11-25 15:19:56 -08:00
Meghan Denny
bb3d570ad0 zig: assert there is an exception when .zero is returned (#15362)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-25 15:19:02 -08:00
Jarred Sumner
a6f37b398c Fix bug with --eval & --print (#15379) 2024-11-25 12:58:30 -08:00
Alistair Smith
39af2a0a56 Fix VSCode extension hanging (#15407) 2024-11-25 12:43:46 -08:00
Jarred Sumner
7f6bb30877 Fixes #15403 2024-11-25 04:59:04 -08:00
Jarred Sumner
812288eb72 [internal] Add problem matcher for Zig 2024-11-25 04:43:58 -08:00
Jarred Sumner
9cbe1ec300 Include docs/ folder in bun-types (#15398) 2024-11-25 00:12:28 -08:00
Jarred Sumner
4f8c1c9124 Does this make the tests less flaky (#15399) 2024-11-25 00:11:10 -08:00
Ashcon Partovi
468a392fd5 ci: Larger zig agents 2024-11-25 00:09:57 -07:00
Ashcon Partovi
f61f03fae3 cmake: Fix cross-compiling zig on alpine (#15400)
Co-authored-by: Electroid <Electroid@users.noreply.github.com>
2024-11-25 00:07:08 -07:00
Ashcon Partovi
a468d09064 ci: Fix typo 2024-11-24 23:38:59 -07:00
Ashcon Partovi
898feb886f ci: Temporarily run zig build on ephemeral agents 2024-11-24 23:37:18 -07:00
Lua MacDougall
c5cd0e4575 Bun.serve incorrect file for error page template (#15397) 2024-11-24 22:04:54 -08:00
Jarred Sumner
f4a0fe40aa Fixes #8683 (#15389) 2024-11-24 22:03:54 -08:00
imide
2d2e329ee3 Update installation.md (#15392) 2024-11-24 16:53:39 -07:00
Christian Rotzoll
618d2cb3ac docs: clarify concurrency behavior in WAL mode (#15382) 2024-11-24 00:56:40 -08:00
Jarred Sumner
6c915fc1d0 Cherry-pick WebKit/WebKit#37039 (#15380) 2024-11-23 23:39:42 -08:00
Jarred Sumner
aa60ab3b65 Delete incorrect assertion 2024-11-23 04:35:41 -08:00
Alistair Smith
f855ae8618 VSCode in-editor error messages (readme updates) (#15325)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-22 22:36:15 -08:00
Jarred Sumner
514a47cb54 Slightly more complete undici polyfill (#15360) 2024-11-22 22:01:52 -08:00
Kai Tamkun
1a1cf0a4d7 Fix setRawMode return value on Windows (#15357) 2024-11-22 20:28:22 -08:00
advaith
9fbe64619b Remove outdated todo comment from Windows install script (#15358) 2024-11-22 20:25:38 -08:00
Ashcon Partovi
642e0ba73c cmake: Remove unused code that causes issues with commit messages 2024-11-22 17:33:42 -08:00
Ciro Spaciari
19d7a5fe53 fix(CI) make prisma avoid env url because of CI and rely on getSecret (#15352) 2024-11-22 15:23:39 -08:00
Ciro Spaciari
c04a2d1dfc fix regression on http2-wrapper caused by node.js compatibility improvements on net (#15318) 2024-11-22 15:22:35 -08:00
Meghan Denny
82cb82d828 pm: add some missing npm_ env vars (#14786)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-11-22 15:13:32 -08:00
Ciro Spaciari
4ae982be4e fix(CI) mark inspect test as todo and comment why we mark this as todo (#15354) 2024-11-22 15:02:26 -08:00
Jarred Sumner
2d65063571 Stub performance.markResourceTiming, add PerformanceResourceTiming, PerformanceServerTiming (#15341) 2024-11-22 14:14:05 -08:00
Grigory
746cf2cf01 feat(resolver): add support for self-referencing (#15284)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-22 04:48:02 -08:00
Jarred Sumner
9c1fde0132 Rewrite most of napi_threadsafe_function (#15309)
Co-authored-by: Ben Grant <ben@bun.sh>
2024-11-22 04:44:52 -08:00
Jarred Sumner
f8f76a6fe0 CSS fixes & fuzzing (#15312) 2024-11-22 04:41:10 -08:00
Alistair Smith
4117af6e46 feat(vscode-extension) error reporting, qol (#15261)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Electroid <Electroid@users.noreply.github.com>
Co-authored-by: Meghan Denny <meghan@bun.sh>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-11-22 02:55:21 -08:00
Jarred Sumner
5bcaf32ba3 Fix lockfile print crash (#15332) 2024-11-22 02:07:11 -08:00
Jarred Sumner
d01bfb5aa2 Ensure test with errors before JS execution exit with code 1 (#15321) 2024-11-22 01:33:58 -08:00
pfg
78b495aff5 fix \uFFFF printing regression (#15330)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-21 22:01:27 -08:00
Ciro Spaciari
6adb3954fe fix(ReadableStream) flush as much we can before ending the stream (#15324) 2024-11-21 20:16:43 -08:00
Jarred Sumner
b152fbefcd Remove a test.only 2024-11-21 17:49:54 -08:00
Ciro Spaciari
8c0c97a273 fix(ws) ping without parameters (#15319) 2024-11-21 17:48:50 -08:00
pfg
95fcee8b76 Fix expect toMatchSnapshot not working for some strings (#15183) 2024-11-21 17:46:45 -08:00
Meghan Denny
c3f63bcdc4 zig: make throwInvalidArguments use JSError (#15305) 2024-11-21 16:19:13 -08:00
Jarred Sumner
2283ed098f Remove Amazon Linux 2023 tests for now 2024-11-21 02:52:56 -08:00
Michael H
43dcb8fce1 docs: --bail [n] -> --bail=[n] (#15301) 2024-11-20 21:46:57 -07:00
Ciro Spaciari
0eb6a4c55e fix(Bun.file) throw OOM if read is too big (#15253) 2024-11-20 19:56:00 -08:00
Pham Minh Triet
144db9ca52 Fix typo in 15276.test.ts (#15304) 2024-11-20 19:11:12 -08:00
Jarred Sumner
a6a4ca1e49 fix(install): ensure aliases hash map is initialized (#15280)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-11-20 18:52:34 -08:00
Meghan Denny
314b4d9b44 fix fuzzy-wuzzy test (#15297) 2024-11-20 17:21:27 -08:00
Meghan Denny
0e3e33072b zig: rename CallFrame.arguments to .arguments_old to free up decl name (#15296) 2024-11-20 16:18:56 -08:00
Ciro Spaciari
3681aa9f0a fix(root_cert) use a more reliable source for the latest cert (#15262) 2024-11-20 15:57:35 -08:00
Meghan Denny
c9d0fd51a9 zig: make throwTODO use JSError (#15264)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-11-20 15:16:51 -08:00
Meghan Denny
4fe8b71437 ci: bootstrap.sh: musl download of bun no longer has to be special-cased (#15265) 2024-11-20 13:31:06 -08:00
Meghan Denny
1efab7f42d zig: JSValue: make .get and .toSliceOrNull use JSError (#15270) 2024-11-20 13:26:41 -08:00
Meghan Denny
61a3f08595 bindings: make throwInvalidArgumentTypeValue print the value like the real ERR_INVALID_ARG_TYPE (#14804) 2024-11-19 22:35:25 -08:00
Meghan Denny
363595fd31 bunjs: print received value when Bun.write is passed a bad argument (#14805) 2024-11-19 22:34:41 -08:00
Meghan Denny
173f67d81e zig: make throwError use JSError (#15267) 2024-11-19 22:21:02 -08:00
Meghan Denny
05d5ab7489 ci: disable testing on debian 10 2024-11-19 20:32:08 -08:00
Meghan Denny
b7bd5a4cf5 zig: remove noop JSGlobalObject.ptr() (#15268) 2024-11-19 19:45:40 -08:00
Ashcon Partovi
ab4da13785 ci: Disable changed files detection until bugs are fixed 2024-11-19 20:44:06 -07:00
Meghan Denny
ab3cb68f66 zig: make throwNotEnoughArguments use JSError (#15266) 2024-11-19 19:07:14 -08:00
Meghan Denny
795f14c1d1 zig: align getTruthy to use JSError (#15199) 2024-11-19 18:46:08 -08:00
Ashcon Partovi
708ed00705 ci: Expand automated build images to Debian, Ubuntu, and Amazon Linux (#15250) 2024-11-19 19:31:15 -07:00
Jarred Sumner
ff4eccc3b4 bump 2024-11-19 15:53:26 -08:00
Ashcon Partovi
ededc168cf Bun v1.1.36 [release] 2024-11-19 14:28:20 -08:00
Ashcon Partovi
46c750fc12 Bun v1.1.36 [release] 2024-11-19 14:27:46 -08:00
Meghan Denny
fc94db1efb ci: changedFiles can be undefined 2024-11-19 02:23:54 -08:00
Meghan Denny
958e531cc5 ci: always build images when core ci files change (#15229) 2024-11-19 02:19:56 -08:00
Meghan Denny
206d2edf12 docker:alpine: update to 3.20 and use bun musl build (#15241) 2024-11-19 00:57:40 -08:00
Meghan Denny
ecb0098b89 us_bun_verify_error_t: ensure c struct matches zig extern (#15244) 2024-11-19 00:52:38 -08:00
Meghan Denny
ba767aa5ba Revert "fix(tls) fix type matching" (#15243) 2024-11-19 00:08:25 -08:00
Kai Tamkun
46515d4865 Call Bun__onExit + std.os.windows.kernel32.ExitProcess to exit on Windows (#15237)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-11-18 22:58:19 -08:00
Jarred Sumner
3ef35d746a Implement junit test reporter (#15205)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-11-18 20:50:42 -08:00
Ashcon Partovi
daece6a0ed Revert "cmake: Set explicit rustc target"
This reverts commit cba3bda8ec.
2024-11-18 20:04:55 -08:00
Jarred Sumner
adaee07138 [Bun.sql] Support TLS (#15217)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-11-18 19:38:23 -08:00
pfg
8a0666acd1 Fix setTimeout with node:util.promisify (#15230) 2024-11-18 19:29:55 -08:00
pfg
fd1d6b10d4 Fix docs on todo tests (#15233) 2024-11-18 19:28:28 -08:00
Ciro Spaciari
d19c18580b fix(tls) fix type matching (#15224) 2024-11-18 19:23:27 -08:00
Ashcon Partovi
f8e9adeb64 ci: Do not check changed files on main 2024-11-18 18:52:02 -08:00
Zack Radisic
3c95d5d011 Fix bundler crash with onLoad plugins on copy-file loaders used on entrypoints (#15231) 2024-11-18 18:50:01 -08:00
Jarred Sumner
9ad3471fb0 Support Headers & URLSearchParams in expect().toEqual() (#15195)
Co-authored-by: Meghan Denny <meghan@bun.sh>
2024-11-18 18:49:29 -08:00
Ashcon Partovi
cba3bda8ec cmake: Set explicit rustc target 2024-11-18 18:33:28 -08:00
Ashcon Partovi
5b1808b90b Revert "Ensure that lolhtml builds the target platform"
This reverts commit b023bb805b.
2024-11-18 18:08:54 -08:00
Ashcon Partovi
b023bb805b Ensure that lolhtml builds the target platform 2024-11-18 17:59:01 -08:00
Dennis Dudek
98bb5999a3 Fixed Responses to OPTIONS Requests ignore Body (#15108) 2024-11-18 17:55:50 -08:00
Pham Minh Triet
d5a118e25f Fix(doc): update cluster.md (#15214) 2024-11-18 03:04:36 -08:00
Ciro Spaciari
1911fa1e75 fix(HttpParser) always check if content length is valid before calling requestHandler (#15179) 2024-11-16 19:41:59 -08:00
Meghan Denny
6dbf1bff4f musl: fix test/js/node/process/process.test.js (#15185) 2024-11-16 02:57:20 -08:00
Jarred Sumner
a5a0539f26 Fixes #15177 (#15180) 2024-11-16 02:18:13 -08:00
Meghan Denny
3393b0e1d3 musl: fix third_party/prisma.test.ts (#15186) 2024-11-16 01:44:53 -08:00
Dylan Conway
910efec0b7 fix auto-install on windows when symlinks aren't available (#15182) 2024-11-16 00:43:12 -08:00
Meghan Denny
dafd8156b0 ci: skip running tests on main branch 2024-11-15 22:18:55 -08:00
Meghan Denny
befb269b2d zig: align fromJS methods to using JSError (#15165) 2024-11-15 22:14:18 -08:00
Ashcon Partovi
39d8ade27c ci: musl builds (#15154)
Co-authored-by: Electroid <Electroid@users.noreply.github.com>
Co-authored-by: Meghan Denny <meghan@bun.sh>
2024-11-15 21:01:55 -08:00
Meghan Denny
4fedc41545 musl: fix 'bun upgrade' (#15178) 2024-11-15 20:58:23 -08:00
dave caruso
15f2bbb33a docs: remove contributing instructions involving winget (#15176) 2024-11-15 13:06:51 -08:00
Jarred Sumner
4ddb63e7e2 Try linker script (#15158) 2024-11-15 13:02:10 -08:00
Grigory
3791146476 docs(contributing): group os-specific code tabs (#15173) 2024-11-15 12:50:28 -08:00
ippsav
910e479d29 Fix node:net not handling path in listen (#15162)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-11-15 10:35:14 -08:00
Meghan Denny
266e033d6f node:https: fix prototype chain of Agent (#15160)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-11-14 19:03:16 -08:00
Ashcon Partovi
9a6f033206 ci: Fix changed files detection on forks 2024-11-14 18:34:13 -08:00
Meghan Denny
2810f39802 zig: make all JS constructors use JSError (#15146)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-11-14 16:36:01 -08:00
Michael H
3170b88058 fix vscode debugger (#14995) 2024-11-14 14:24:18 -08:00
Jarred Sumner
357581c61a Shrink Bun's binary by 3.5 MB (#15121) 2024-11-14 06:02:15 -08:00
pfg
d8987ccdb8 Remove assertion in js printer triggering for unicode comments (#15143) 2024-11-14 00:14:43 -08:00
Meghan Denny
fdd8d35845 allow zig js host functions to return JSError (#15120) 2024-11-13 21:11:56 -08:00
dave caruso
32ddf343ee bake: csr, streaming ssr, serve integration, safer jsvalue functions, &more (#14900)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-13 18:19:12 -08:00
Meghan Denny
bceb0a2327 ci: fix release script (#15129) 2024-11-13 18:29:14 -07:00
Meghan Denny
9b0cdf01f9 cpp: Bun::toStringRef: return dead when exception has been thrown (#15127)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-11-13 17:03:59 -08:00
Meghan Denny
35513a9d6d zig: remove JSValue.isEmpty (#15128) 2024-11-13 16:04:13 -08:00
Meghan Denny
f8979b05b1 rid nearly all use of ExceptionRef in zig (#15100)
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-11-13 15:23:52 -08:00
ippsav
ec91e91fda Pass missing signal code for child_process.spawnSync (#15137) 2024-11-13 15:07:43 -08:00
Meghan Denny
956853f036 test: dont overwrite root package.json when running bun-ipc-inherit.test.ts (#15126) 2024-11-13 00:14:57 -08:00
Dylan Conway
c5df329772 #15059 follow-up (#15118) 2024-11-12 18:17:35 -08:00
Ciro Spaciari
e945146fde fix(bundler) fix pretty path resolution (#15119) 2024-11-12 18:16:13 -08:00
Ciro Spaciari
873b0a7540 fix(socket) Support named pipes on Windows using forward slashes (#15112) 2024-11-12 16:09:43 -08:00
Dennis Dudek
c785ab921b ci: Fix detection of changed files (#15114)
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2024-11-12 15:27:27 -07:00
Meghan Denny
797958082c musl patches [v4] (#15066) 2024-11-11 19:23:58 -08:00
Jarred Sumner
2b9abc20da Use linux syscall interface more in I/O (#15067) 2024-11-11 14:47:04 -08:00
Jarred Sumner
d713001e35 Fixes #14982 2024-11-11 14:40:11 -08:00
Jarred Sumner
b49f6d143e Postgres client - more progress (#15086) 2024-11-11 14:40:02 -08:00
pfg
4cf9851747 Bump runtime transpiler cache version for #15009 (#15094) 2024-11-11 14:38:17 -08:00
pfg
56f7c8887b Fix unicode imports, unicode-escaped variable names, and printClauseAlias not working for utf-8 (#15009) 2024-11-11 13:27:42 -08:00
Ciro Spaciari
62cabe9003 fix(tests) new grpc certs (#15090) 2024-11-11 13:00:58 -08:00
Jarred Sumner
781a392baa Add micro-optimization to fs.readFile (#15076) 2024-11-11 10:35:17 -08:00
Jarred Sumner
d879f4370d Update hashing.md 2024-11-09 02:27:50 -08:00
Jarred Sumner
ae6e23ab28 Update hashing.md 2024-11-09 02:25:18 -08:00
Jarred Sumner
7a9165555d Update hashing.md 2024-11-09 02:19:24 -08:00
Michael H
b54137174b Bench updates (#15029)
Co-authored-by: RiskyMH <RiskyMH@users.noreply.github.com>
2024-11-08 23:15:24 -08:00
Dylan Conway
635789944b update 2024-11-08 21:14:42 -08:00
Jarred Sumner
a1c4f667d9 Support ${configDir} in tsconfig.json (#15063)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-11-08 17:08:54 -08:00
Zack Radisic
07dc1ae547 .defer(), .onStart(), and some small CSS changes (#15041) 2024-11-08 16:38:30 -08:00
Dylan Conway
8f5eab3c84 fix(install): package-lock.json migration and non-existent cafile fixes (#15059) 2024-11-08 14:34:44 -08:00
Jarred Sumner
6ec03b8b05 Add to documentation 2024-11-07 22:54:08 -08:00
Ciro Spaciari
183c661c40 net compatibility improvements (#14933)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-07 22:03:53 -08:00
Meghan Denny
c2e7643aa9 musl patches [v3] (#15031) 2024-11-07 21:31:32 -08:00
Jarred Sumner
376b1b4f97 Support preload option in Worker (#15045) 2024-11-07 21:30:51 -08:00
Jarred Sumner
27067d2a6d Allow using Proxy and module namespace objects in APIs (#15043) 2024-11-07 19:45:29 -08:00
Jarred Sumner
1e932ff38b [VSCode extension] Add [eval with bun] code lens on untitled, unsaved scratch JavaScript files (#14983) 2024-11-07 12:30:38 -08:00
Meghan Denny
a116b2281e musl patches [v2] (#15028) 2024-11-06 23:55:23 -08:00
Dylan Conway
66ba6ba061 fix 14957 (#15025) 2024-11-06 19:41:39 -08:00
Jarred Sumner
8d4bb080a3 Implement console.group (#15026) 2024-11-06 19:40:58 -08:00
Ashcon Partovi
bef50a9b9b ci: misc fixes and test runner changes (#15024) 2024-11-06 18:15:55 -07:00
Jarred Sumner
56b57012ed Bump! 2024-11-06 15:05:23 -08:00
Tim Ermilov
c39ae74d3e Fix importing of ES modules from data URIs (#14959) 2024-11-06 15:00:24 -08:00
Christophe Eymard
fc071d3362 remove checks for self closing tags (#14990) 2024-11-06 14:58:31 -08:00
Jarred Sumner
1a9d20e50a Support debugging builtin modules (#15018) 2024-11-06 14:57:35 -08:00
Jarred Sumner
8d8a6bc5c3 Fix prototypical inheritance issue in node:zlib and add a $toClass helper (#15015) 2024-11-06 14:56:10 -08:00
Jarred Sumner
076d1d3d36 Never try using epoll_pwait2 on old linux kernels (#14980) 2024-11-06 03:42:24 -08:00
Jarred Sumner
484c3de861 Show if napi_module_register or dlopen was called in crash reports (#15008) 2024-11-05 20:57:55 -08:00
Meghan Denny
27a1b2413b patches to allow linux-musl to bootstrap (#14994) 2024-11-05 17:22:05 -08:00
Amit Dhamu
3950873272 Fix typo for configuring specific registry (#15001) 2024-11-05 08:11:57 -08:00
pfg
6fb73f2011 Visually center logo in readme (#14969) 2024-11-04 15:28:16 -07:00
pfg
497fa59bf0 Fix #14865 (#14953) 2024-11-02 17:13:31 -07:00
Jarred Sumner
5e5e7c60f1 Fix release build 2024-11-01 20:41:20 -07:00
Ciro Spaciari
85fd471d9d fix(net) fix bytesWritten drain (#14949) 2024-11-01 19:43:42 -07:00
Jarred Sumner
6914c5e32c Fixes #13816 (#13906)
Co-authored-by: pfg <pfg@pfg.pw>
Co-authored-by: Ryan Gonzalez <git@refi64.dev>
Co-authored-by: Ben Grant <ben@bun.sh>
Co-authored-by: Dave Caruso <me@paperdave.net>
2024-11-01 18:38:01 -07:00
Jarred Sumner
ce2afac827 Align "encoding" option in node fs with node (#14937) 2024-11-01 18:16:04 -07:00
Ciro Spaciari
5236d974b5 revert 2024-11-01 17:25:59 -07:00
Ciro Spaciari
6e448619d0 fix drain event, drain must be called only after internal buffer is drained 2024-11-01 17:23:00 -07:00
Jarred Sumner
c89a958299 Fixes #11754 (#14948) 2024-11-01 15:35:28 -07:00
Jarred Sumner
d75488124d Inline process.versions.bun in bun build --compile (#14940) 2024-11-01 14:45:19 -07:00
Ashcon Partovi
4d269995ad Run tests from npm packages, elysia to start (#14932) 2024-11-01 11:57:47 -07:00
190n
71fdb59918 Fix napi property methods on non-objects (#14935) 2024-10-31 21:02:26 -07:00
Dylan Conway
62881ee36b Redact secrets in bunfig.toml and npmrc logs (#14919) 2024-10-31 18:44:24 -07:00
Dylan Conway
6933208790 fix(install): only globally link requested packages (#12506)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-31 18:21:04 -07:00
Jarred Sumner
b1e9e3b31b Add bytesWritten property to Bun.Socket, fix encoding issue in node:net (#14516)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-10-31 17:54:07 -07:00
Jarred Sumner
7035a1107e Fixes #14918 (#14921) 2024-10-31 14:26:19 -07:00
Ashcon Partovi
353d44f1ae ci: If only tests change, use artifacts from last successful build (#14927) 2024-10-31 12:50:09 -07:00
Jarred Sumner
4b8ca51b87 Clean up some code in node validators (#14897) 2024-10-31 12:28:07 -07:00
Ciro Spaciari
f8d5b2e6e2 Fix module resolution cache keys (#14901)
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
2024-10-30 22:06:21 -07:00
190n
9647291d73 Implement NAPI type tagging (#14915) 2024-10-30 19:57:48 -07:00
Jarred Sumner
eaa088ba55 Fix missing symbol errors and add a test (#14907)
Co-authored-by: Jarred Sumner <jarred@bun.sh>
2024-10-30 19:55:42 -07:00
Gerd Jungbluth
955cc6265b fix(docs): add missing character in drizzle guide (#14911) 2024-10-30 08:42:38 -07:00
Dylan Conway
489890deb1 fix(install): check cached package.jsons (#14899) 2024-10-29 18:55:52 -07:00
pfg
d7710c6c67 Fix additional arguments when running a package.json script (#14895)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-29 18:55:32 -07:00
Jarred Sumner
9f70f68f00 EventEmitter.name should be "EventEmitter" instead of "EventEmitter2" (#14898) 2024-10-29 18:42:24 -07:00
Jarred Sumner
240b2a539f Introduce Bun.randomUUIDv7 (#14858)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-10-29 16:39:09 -07:00
Jarred Sumner
b9e5420571 Add https://github.com/uNetworking/uWebSockets/pull/1792 (#14864) 2024-10-29 12:56:25 -07:00
Jarred Sumner
b5a73130ad Reduce memory usage in long-running processes (#14885) 2024-10-29 12:56:10 -07:00
Jarred Sumner
d5f9978007 Fix missing symbol error on llvm 18 2024-10-29 00:08:29 -07:00
pfg
698e87aa67 Fix #14187 (#14884) 2024-10-28 18:11:03 -07:00
Zack Radisic
5502278f3e CSS: More stuff and tests (#14832)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-27 13:49:25 -07:00
Jarred Sumner
f005e8c057 Fix HTTP spec issues by upgrading uWS version (#14853) 2024-10-27 12:34:45 -07:00
dave caruso
e93c5ad993 feat(bake): css, production build, dev separateSSRGraph=false (#14622)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-10-27 01:57:36 -07:00
Meghan Denny
5237869101 bun-install-registry.test.ts: remove ini format hint here (#14803) 2024-10-26 16:51:19 -07:00
Jarred Sumner
2456d70ac7 Fixes #14716 (#14834) 2024-10-26 15:15:13 -07:00
Meghan Denny
50d80a805d pm: fix weird package.json formatting after install (#14801) 2024-10-26 01:36:25 -07:00
Meghan Denny
2d9a73fc07 test: fix expected value of 'should perform bin-linking across multiple dependencies' (#14833) 2024-10-26 01:02:24 -07:00
Jarred Sumner
d0b3802a79 github actions 2024-10-25 23:50:12 -07:00
Jarred Sumner
7053212566 Update associate-issue-with-sentry.ts 2024-10-25 23:47:15 -07:00
Jarred Sumner
4f5660a6f7 Add sentry id to crash report comment 2024-10-25 23:40:27 -07:00
Dylan Conway
87279392cf fix 9395 (#14815) 2024-10-25 19:58:45 -07:00
Bjorn Beishline
7f5860331e Fixed compilation issues with no outdir (#14717)
Co-authored-by: Meghan Denny <meghan@bun.sh>
2024-10-25 18:43:58 -07:00
Dylan Conway
b895738156 fix(install): migrate package-lock.json with dependency on root package (#14811)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-25 01:32:17 -07:00
Dylan Conway
61534c7efe Remove warning for unused registry options from npmrc (#14813) 2024-10-25 01:31:39 -07:00
Jarred Sumner
ec4c9f8f84 Update mimalloc (#14814) 2024-10-25 01:31:24 -07:00
Jarred Sumner
35a64d8585 Bump WebKit (#14812) 2024-10-25 01:31:12 -07:00
Minsoo Choo
eb6995e09b Update SvelteKit usage guide (#14777) 2024-10-25 00:04:32 -07:00
Meghan Denny
1391e5269b Revert "ci: merge clang-format and clang-tidy into single pipeline" (#14809) 2024-10-25 00:04:13 -07:00
Dylan Conway
9621b641a1 update test/bun.lockb (#14746) 2024-10-25 00:03:52 -07:00
Dylan Conway
5eaa7301eb fix(install): patches with bin in package.json (#14807) 2024-10-25 00:03:19 -07:00
Arthur
f21870a06c chore(console): updated jsdoc table (#14792) 2024-10-24 21:20:46 -07:00
Don Isaac
0e4006eefd ci: merge clang-format and clang-tidy into single pipeline (#14798) 2024-10-24 15:26:05 -07:00
Dylan Conway
9643a924e1 bump 2024-10-24 14:24:08 -07:00
Dylan Conway
247456b675 fix(install): continue install if optional postinstall fails (#14783) 2024-10-23 21:58:53 -07:00
Meghan Denny
6f60523e6c " -> ' (#14776)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-23 19:21:36 -07:00
Jarred Sumner
2de2e9f600 48 -> 64 2024-10-23 18:27:02 -07:00
Ciro Spaciari
29bf8a505d fix(tests) pq -> pg + populate before (#14748) 2024-10-23 18:01:06 -07:00
Jarred Sumner
93d115f9b7 Reduce default max network connection limit from 256 to 48 in bun install (#14755) 2024-10-23 15:34:16 -07:00
Ashcon Partovi
74e440d58a ci: Set prioritization based on fork, main branch, or queue 2024-10-23 09:16:48 -07:00
Ashcon Partovi
aa4dde976d ci: Fix pipeline script when on main branch 2024-10-23 09:03:06 -07:00
Ashcon Partovi
eb0e9b9bde ci: Skip builds when only docs are changed (#14751) 2024-10-23 08:54:53 -07:00
Liran Tal
a656cc1b70 docs: fix missing code highlight in spawn.md (#14761) 2024-10-23 01:01:21 -07:00
Ashcon Partovi
4044ff740d ci: add scripts for building macOS images (#14743) 2024-10-22 16:07:12 -07:00
Ashcon Partovi
b9240f6ec7 cmake: only enable LTO when release + linux + ci 2024-10-22 13:10:58 -07:00
Eckhardt (Kaizen) Dreyer
3db0191409 fix(install): Skip optional dependencies if false in bunfig.toml (#14629) 2024-10-22 11:55:10 -07:00
Oliver Medhurst
00b055566e contributing: fix fedora llvm install steps (#14726) 2024-10-22 11:40:46 -07:00
snwy
517cdc1392 fix jsx symbol collisions when importing own variables with same names (#14343)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-22 00:17:18 -07:00
Pham Minh Triet
8b4b55725e Fix(doc): update Next.js guide (#14730) 2024-10-22 00:16:15 -07:00
Jarred Sumner
38d39109b3 Fix assertion failure 2024-10-21 21:46:17 -07:00
Jarred Sumner
ec29311c7a Bump 2024-10-21 18:05:10 -07:00
Ciro Spaciari
fe8d0079ec tls(Server) fix connectionListener and make alpnProtocol more compatible with node.js (#14695)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
2024-10-21 01:58:14 +00:00
Jarred Sumner
8063e9d6b8 Fixes #14411 (#14691) 2024-10-20 22:02:44 +00:00
Vaggelis Papadogiannakis
ae8de1926e Update instructions to run a bun application via pm2 with the use… (#14704) 2024-10-20 15:06:45 -07:00
Minsoo Choo
b9b94de5ed icu required on openSUSE for local webkit build (#14690) 2024-10-20 01:08:42 -07:00
Jarred Sumner
070e5804ad Implement crypto.hash() (#14683) 2024-10-19 12:14:23 -07:00
Jarred Sumner
67b4478137 Fixes #14333 (#14679) 2024-10-19 01:14:13 -07:00
Jarred Sumner
522c9fa22d Clarify some of this 2024-10-19 00:26:30 -07:00
Jarred Sumner
4b63ffeceb Clarify node-fallbacks 2024-10-19 00:23:57 -07:00
Pham Minh Triet
fe45b1e9b9 Fix(doc): SNI typo (#14508) 2024-10-18 22:37:57 -07:00
Jarred Sumner
d41ca824dd Bump 2024-10-18 22:32:42 -07:00
Meghan Denny
663331c56f fix regression in BunJSGlobalObjectDebuggable from most recent webkit upgrade (#14675) 2024-10-18 22:31:39 -07:00
Meghan Denny
64d0b626b9 Bun.color: fill out missing options and examples for outputFormat (#14656)
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com>
2024-10-18 22:29:53 -07:00
Dylan Conway
e5c00ab4b4 fix(CryptoHasher): throw error if update or digest are called after digest (#14677) 2024-10-19 02:21:41 +00:00
Meghan Denny
4f2d924db3 Bun.color: match accepted outputFormat options to error (#14657) 2024-10-19 00:34:56 +00:00
Ashcon Partovi
bf8a75a63f Revert "Remove soft_fail from Buildkite since merge queue is enabled"
This reverts commit 253cc15a9f.
2024-10-18 16:04:58 -07:00
Ashcon Partovi
253cc15a9f Remove soft_fail from Buildkite since merge queue is enabled 2024-10-18 13:28:24 -07:00
Meghan Denny
fbf4b30e70 bun-types: add missing options to DigestEncoding (#14654) 2024-10-18 19:17:10 +00:00
Dylan Conway
f3b658d9f7 fix double free with invalid TLSOptions (#14648) 2024-10-18 05:16:21 +00:00
Ciro Spaciari
b652136cf7 update docs (#14620) 2024-10-18 01:26:50 +00:00
Ashcon Partovi
8376b82371 Fix merge queue (#14646) 2024-10-18 01:22:35 +00:00
Ashcon Partovi
7bb39023b8 Merge queue (#14639) 2024-10-18 01:14:42 +00:00
Meghan Denny
850cdb0587 vscode: set the launch configs' cwd to the root (#14643) 2024-10-17 16:24:10 -07:00
Ciro Spaciari
2f2a24f625 bench: fix grpc and scripts (#14638) 2024-10-17 13:30:47 -07:00
Dylan Conway
e448c4cc3b fs.mkdir empty string bugfix (#14510) 2024-10-16 18:55:49 -07:00
Ciro Spaciari
2d0b557ff7 add grpc-js bench (#14601) 2024-10-16 11:11:53 -07:00
Meghan Denny
15f5ba3e26 jest: print received value when expect().toThrow() doesnt throw (#14608) 2024-10-16 11:11:26 -07:00
refi64
1385f9f686 cmake: force the c-ares libdir to always be 'lib' (#14602) 2024-10-16 10:13:20 -07:00
Ciro Spaciari
07ccec0fd8 H2 fixes (#14606) 2024-10-16 09:06:56 -07:00
Dylan Conway
7283453eed use memset_patternN in Buffer.fill (#14599) 2024-10-15 21:16:57 -07:00
Ciro Spaciari
1a08cfcd6b fix h2 tests failures (#14598) 2024-10-15 18:36:23 -07:00
Meghan Denny
06e733cc64 ci: run clang-format on .h files too (#14597)
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-10-15 16:54:49 -07:00
Ciro Spaciari
409e674526 feat(node:http2) Implement HTTP2 server support (#14286)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-15 16:28:21 -07:00
Meghan Denny
d15eadaa2c tsconfig.json: update excludes (#14578) 2024-10-15 15:39:09 -07:00
dave caruso
5532e1af10 feat(bake): hot-reloading error modal (#14573) 2024-10-15 00:02:58 -07:00
Meghan Denny
68e6304c73 node:child_process: 'ineherit' stdio should make getters be null (#14576) 2024-10-14 23:41:34 -07:00
Meghan Denny
709cd95c30 test: use isWindows from harness (#14577) 2024-10-14 21:19:09 -07:00
Meghan Denny
3830b0c499 more passing node buffer tests (#14371) 2024-10-14 20:22:14 -07:00
Meghan Denny
291b59eb19 bun-types: small fixes (#12794) 2024-10-14 20:15:03 -07:00
190n
035f97ba13 WIP: nuke EventSource as it doesn't work anyway (#14421) 2024-10-14 19:55:06 -07:00
huseeiin
fef9555f82 fix typo. constributors -> contributors (#14531) 2024-10-14 19:50:17 -07:00
Meghan Denny
ae0106b651 delete legacy node test runner (#14572) 2024-10-14 17:31:34 -07:00
Meghan Denny
355dc56db0 scripts/runner.node.mjs: print list of failing tests when run locally (#14571) 2024-10-14 17:22:06 -07:00
Jarred Sumner
5fc53353fb Allow disabling keep-alive (#14569)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-10-14 16:58:42 -07:00
dave caruso
d2fe1ce1c8 feat(bake): handle bundle errors, re-assemble full client payloads, initial error modal (#14504) 2024-10-14 16:49:38 -07:00
Jarred Sumner
29d287261b Fix several bugs when printing exceptions from Error.captureStackTrace (#14548) 2024-10-14 13:43:06 -07:00
Sebastian
6dbd679c06 docs: fix typo (#14565) 2024-10-14 13:29:28 -07:00
Meghan Denny
a5006a13a8 fetch-tcp-stress.test.ts: todo failing on macos ci (#14514) 2024-10-14 12:48:42 -07:00
Meghan Denny
bebf762bcf streams.test.js: todo failing macos test (#14513) 2024-10-14 12:48:04 -07:00
Minsoo Choo
e6ea389e4e Next.js dev server now runs on Bun (#14566) 2024-10-14 12:11:30 -07:00
Timo Sand
47ff4748bd Remove duplicate in import-json.md (#14521) 2024-10-13 15:34:38 +11:00
Don Isaac
09b031d044 fix(parser): uncaught mismatch between JSX opening/closing tags (#14528) 2024-10-12 19:49:45 -07:00
Zack Radisic
6b8fd718c2 Various CSS stuff (#14499)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-12 07:00:20 -07:00
Jarred Sumner
9ed3858e40 Some types and docs 2024-10-12 06:19:46 -07:00
Dylan Conway
6cf9c41d1f fix(install): ensure read permissions when extracting files (#14511) 2024-10-12 02:37:51 -07:00
Dylan Conway
183a8f61d8 fix bun-build-api.test.ts (#14503) 2024-10-12 00:48:22 -07:00
Jarred Sumner
85fbd1e273 we really need a merge queue 2024-10-11 21:51:40 -07:00
Mathieu Schroeter
9744684b10 Attempt to add support for iterate() with SQLite statements (#14361) 2024-10-11 21:42:59 -07:00
Jarred Sumner
43a5c4a044 Implement Bun.inspect.table (#14486) 2024-10-11 21:35:49 -07:00
Dylan Conway
d3323c84bb fix(publish): missing bins bugfix (#14488)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-11 21:28:47 -07:00
Jarred Sumner
f870293d30 Add timeout warning (#14478) 2024-10-11 21:20:55 -07:00
Jarred Sumner
4c26a257ac Fixes #14398 (#14401) 2024-10-11 21:18:07 -07:00
Jarred Sumner
c77fc5daa0 Implement --drop (#14492)
Co-authored-by: dave caruso <me@paperdave.net>
2024-10-11 20:52:23 -07:00
Dylan Conway
bbb41beadc bump webkit (#14497) 2024-10-11 19:44:53 -07:00
Meghan Denny
3f92ec8af3 fix label in 3-typescript-bug-report.yml (#14502) 2024-10-11 19:39:30 -07:00
Dylan Conway
5fd0a61ae2 CA support for bun install (#14416) 2024-10-11 13:16:26 -07:00
Meghan Denny
9fe6e25372 pm: fix assertion failure when printing lockfile summary after adding git transitive dependency (#14461)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-11 03:43:37 -07:00
190n
50e9be0dc7 Fix napi_value<=>integer conversions and napi_create_empty_array (#14479) 2024-10-10 23:50:39 -07:00
pfg
ba9db6cdb6 Fix console.table for numeric keys (#14484) 2024-10-10 23:50:02 -07:00
Meghan Denny
25fcbed8d1 enhance Buffer.from to support (de)serialization roundtrip (#14201)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-10 22:08:16 -07:00
Meghan Denny
170fafbca9 fix fs-non-number-arguments-throw.test.js (#14312) 2024-10-10 22:07:41 -07:00
Meghan Denny
874c9dbb24 fix fs-open.test.js (#14311) 2024-10-10 22:04:33 -07:00
Jarred Sumner
05f53dc70f Fixes #14464 (#14473) 2024-10-10 21:50:03 -07:00
Meghan Denny
584a8ceb84 enable iterator-helpers in webkit (#14455) 2024-10-10 15:47:59 -07:00
Michael H
05f68d79c8 docs: --conditions flag (#14463) 2024-10-10 04:04:58 -07:00
huseeiin
e650ee7967 Update bun.d.ts (#14429) 2024-10-10 02:35:53 -07:00
190n
50bb5fa1f6 Fix napi_throw_*/napi_create_*_error (#14446) 2024-10-10 02:35:38 -07:00
Dylan Conway
3452f50c96 update webkit (#14449) 2024-10-10 02:35:23 -07:00
snwy
ff476313a8 'let' statements before using statements are now properly converted into 'var' statements (#14260) 2024-10-09 19:14:22 -07:00
Jarred Sumner
def454d859 Bump 2024-10-09 18:20:19 -07:00
Grigory
73537de184 docs(bundler): add missing codetabs closing tag (#14443) 2024-10-09 15:13:42 -07:00
Meghan Denny
1bccd62784 actions: update help text for 'needs repro' label (#14428) 2024-10-09 10:44:31 -07:00
Jarred Sumner
c608a724a6 Update installation.md 2024-10-09 02:36:24 -07:00
Meghan Denny
ca6013acef move .clang-format up a folder so it affects all our c/cpp files (#14400)
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-10-08 23:04:05 -07:00
snwy
05e1832c68 remove function hoisting from _parse (#14419) 2024-10-08 18:04:18 -07:00
Jarred Sumner
7a6d17bb99 chore: Make hash formatter reusable (#14372)
Co-authored-by: dave caruso <me@paperdave.net>
2024-10-08 13:30:17 -07:00
Ashcon Partovi
05fb367c5f Move generated files to codegen/ directory (#14392) 2024-10-08 10:32:16 -07:00
versecafe
7996d06b8f --footer esbuild & rollup style! (#14396)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-08 02:32:37 -07:00
Jarred Sumner
a234e067a5 Make .get() ignore Object.prototype instead of using getOwn (#14322) 2024-10-08 00:34:31 -07:00
Meghan Denny
c20901fd4e Update 7-install-crash-report.yml (#14394) 2024-10-07 20:45:30 -07:00
Meghan Denny
0d5eb73db0 test: add missing vm.runInContext stubs (#14341) 2024-10-07 20:38:31 -07:00
Kiwi
87c3b2f8d3 Update lockfile.md - fix typo (#14385) 2024-10-07 20:23:45 -07:00
Meghan Denny
1ce2d0e9f5 fix fs-read-empty-buffer.test.js (#14316) 2024-10-07 19:03:30 -07:00
Meghan Denny
c41ff9da93 fix fs-promises-file-handle-write.test.js (#14315) 2024-10-07 18:26:43 -07:00
190n
b0b38b42ba Return undefined from napi_get_property when property does not exist (#14366) 2024-10-07 18:05:31 -07:00
versecafe
62da730060 add banner, .d.ts, cli, make sourcemap compat, and add tests + docs (#14370) 2024-10-07 18:05:06 -07:00
Dylan Conway
c071415664 add bun pm whoami (#14387) 2024-10-07 17:36:14 -07:00
dave caruso
fc85a2dc92 feat(bake): add dependencies to IncrementalGraph (#14368) 2024-10-07 14:18:26 -07:00
Meghan Denny
c5b1c9e302 ci: shorten label names (#14314) 2024-10-07 11:56:37 -07:00
Jarred Sumner
65a6803093 Fixes #14345 (#14374) 2024-10-05 06:00:17 -07:00
Jarred Sumner
6ca68cab65 Update JSType (#14373) 2024-10-05 03:37:24 -07:00
Jarred Sumner
6645eafa08 do not use std.debug.print 2024-10-05 01:16:45 -07:00
Jarred Sumner
29e1ba044d Make this log better 2024-10-05 00:00:19 -07:00
Dylan Conway
fd15e22d64 comment 2024-10-04 23:38:39 -07:00
Dylan Conway
b2cb3603e2 fix(publish): ignore npm-notice when x-local-cache exists (#14352) 2024-10-04 23:36:34 -07:00
Dylan Conway
a15244a4c9 update webkit (#14364) 2024-10-04 22:32:48 -07:00
Zack Radisic
a01f9d8e1b Integrate CSS with bundler (#14281)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Zack Radisic <zackradisic@Mac.attlocal.net>
Co-authored-by: zackradisic <zackradisic@users.noreply.github.com>
Co-authored-by: Zack Radisic <zackradisic@Zacks-MBP.attlocal.net>
2024-10-04 20:23:10 -07:00
lewismiddleton
3ab3dec34d fix(docs): typo in bundler/index.md (#13370) 2024-10-04 20:21:04 -07:00
Dylan Conway
794e416642 Update CONTRIBUTING.md 2024-10-04 18:54:20 -07:00
Mathias
7885742345 fix segfault when decorating computed property #10887 (#14304) 2024-10-04 18:14:20 -07:00
versecafe
7063116c61 add missing docs for new bun pm commands (#14347) 2024-10-04 15:30:30 -07:00
Meghan Denny
4a5ec261ef node: add more passing tests (#14317) 2024-10-04 11:33:46 -07:00
Ashcon Partovi
e3f4c9fd0b ci: Fix analysis commands (#14356) 2024-10-04 09:13:23 -07:00
Dylan Conway
f307d2a6ef test(publish): ci names in user-agent (#14328) 2024-10-04 00:15:22 -07:00
dave caruso
adc86c773b chore: rename kit -> bake (#14335) 2024-10-03 15:34:53 -07:00
Dylan Conway
15427134e1 update 2024-10-03 15:11:44 -07:00
Dylan Conway
808e58cc4d update 2024-10-03 14:50:23 -07:00
Eric Liu
a375ea94ef docs: fix typo in bun publish (#14334) 2024-10-03 14:03:30 -07:00
Dylan Conway
39b1c0111e add docs for bun publish (#14327) 2024-10-03 03:41:11 -07:00
Jarred Sumner
eda608d629 Tweak how we do symbol versioning for glibc (#14272) 2024-10-03 02:42:28 -07:00
Meghan Denny
9446fd60c9 fix Buffer method aliases not being equal to each other (#14198) 2024-10-03 02:31:23 -07:00
Meghan Denny
8e5255d753 node:stream: fix setDefaultHighWaterMark (#14305) 2024-10-03 02:15:39 -07:00
Meghan Denny
13ca4544f2 enhance INVALID_ARG_TYPE and cleanup some node:buffer error handling (#14200) 2024-10-03 02:13:14 -07:00
Jarred Sumner
4d4dd1c180 Refactor node:module (#14227) 2024-10-03 00:54:56 -07:00
dave caruso
dd6554294e bake: release to canary only (#14258)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
2024-10-03 00:52:14 -07:00
Dylan Conway
50ed09654f publish help text 2024-10-02 22:57:34 -07:00
190n
0a54c24bd3 Allow throwing exceptions from napi_async_complete_callback (#14302)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-10-02 22:35:45 -07:00
versecafe
b39f49a5b9 remove bun pack in favor of bun pm pack (#14319) 2024-10-02 22:32:42 -07:00
snwy
e8fec640d8 hoisting of exports when there is top level using (#14313) 2024-10-02 22:32:04 -07:00
Ciro Spaciari
25abe67d43 update root certificates to NSS 3.104 (#14276) 2024-10-02 22:29:32 -07:00
Jarred Sumner
5f135a21b3 Update writing.md 2024-10-02 22:28:14 -07:00
Jarred Sumner
b88ed18245 On test timeout, kill any spawned processes (#14310) 2024-10-02 20:55:59 -07:00
Dylan Conway
f374ae6db1 add bun publish (#14215) 2024-10-02 20:47:22 -07:00
Jarred Sumner
94a656bc4f Support bundling .node files in ESM & CJS when targeting Node.js (#14294)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-10-02 20:15:29 -07:00
190n
54e177e2f9 Rename internal NapiHandleScope push/pop methods to open/close (#14300) 2024-10-02 15:05:38 -07:00
Meghan Denny
39342e34b1 node: define missing constants (#14211) 2024-10-02 14:35:16 -07:00
Mathias
e1cd7e510e Update CONTRIBUTING.md, fix #14225 (#14303) 2024-10-02 13:44:54 -07:00
Meghan Denny
54a225953b use bun.String.static instead of ZigString when immediately converting to JSValue (#14169) 2024-10-02 13:02:48 -07:00
Meghan Denny
419229d950 add ERR_BUFFER_OUT_OF_BOUNDS to internal/errors (#14195) 2024-10-02 07:59:24 -07:00
Meghan Denny
b8a2a11c6f lazy load these requires so that node:cluster imports faster (#14291) 2024-10-02 02:30:19 -07:00
Meghan Denny
25083a4252 pm: print command name to stdout (#14266) 2024-10-02 02:24:37 -07:00
dave caruso
87424390e1 fix 14248 (#14277) 2024-10-02 02:23:54 -07:00
Dylan Conway
92e66691fa fix bun getcompletes index out of bounds (#14289) 2024-10-02 02:23:36 -07:00
Meghan Denny
edebd6faa3 windows: watcher: that line wasnt meant to go to stdout (#14288) 2024-10-02 00:26:20 -07:00
Meghan Denny
531d78aa97 BunProcess: dont use for-loop for isSignalName (#14285) 2024-10-01 23:42:52 -07:00
Meghan Denny
e831bbf4ca node: implement more validators in native code (#14177)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-10-01 21:55:05 -07:00
dave caruso
9870314ff6 fix 13394 (#14278) 2024-10-01 21:27:50 -07:00
Meghan Denny
e44d10cf17 node: lowercase primitive expectations of ERR_INVALID_ARG_TYPE (#14284) 2024-10-01 20:37:13 -07:00
Ashcon Partovi
db0750e90c cmake: Fix version detection 2024-10-01 15:48:13 -07:00
Ashcon Partovi
98e09efd02 cmake: Improve command detection (#14166) 2024-10-01 15:37:57 -07:00
Ashcon Partovi
944f342072 Revert "Remove old clang-tidy workflow"
This reverts commit 16917f7922.
2024-10-01 15:32:18 -07:00
Ashcon Partovi
16917f7922 Remove old clang-tidy workflow 2024-10-01 15:31:42 -07:00
Ashcon Partovi
27a157b6c1 Improve command detection in CMake 2024-10-01 13:50:15 -07:00
Jarred Sumner
07fd814629 Update index.md 2024-10-01 04:32:02 -07:00
Jarred Sumner
e348fef1c6 Update index.md 2024-10-01 04:26:19 -07:00
Jarred Sumner
68b910cbd9 Update index.md 2024-10-01 04:25:30 -07:00
Meghan Denny
e2f20d794f clang-format: add InsertNewlineAtEOF (#14267)
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-10-01 03:49:10 -07:00
Jarred Sumner
faa524bf67 Fix missing va_end call 2024-10-01 02:06:56 -07:00
Meghan Denny
016ebf7b9b cmake: only run prettier explicitly (#14228) 2024-09-30 23:43:29 -07:00
Jarred Sumner
2f7ff95e5c Introduce bytecode caching, polish "cjs" bundler output format (#14232)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-09-30 22:37:42 -07:00
Meghan Denny
857a472033 ci: fix build error (#14262) 2024-09-30 22:20:21 -07:00
Jarred Sumner
7720d23da1 Make v8 stack trace parser code more careful (#14205) 2024-09-30 19:09:14 -07:00
Dylan Conway
ecc3e5e187 fix 14250 (#14256) 2024-09-30 19:08:13 -07:00
snwy
dcaaeecfa3 allow importing of files with top level awaits in bundler (#14218)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-30 16:50:50 -07:00
dave caruso
9ab51983b8 chore: make watcher use an anyopaque pointer context (#14224) 2024-09-28 01:44:55 -07:00
Jarred Sumner
af82a446df Support hmac in Bun.CryptoHasher (#14210) 2024-09-27 23:33:22 -07:00
190n
dd12715071 Propagate exceptions in napi_run_script (#14222) 2024-09-27 22:27:57 -07:00
dave caruso
514d37b3d2 kit: implement server components dev server (#14025) 2024-09-27 20:53:39 -07:00
Jarred Sumner
d09df1af47 Deflake a test 2024-09-27 14:22:59 -07:00
Meghan Denny
05afe42f31 fix Buffer.fill with a non-null empty fill including uninitialized bytes (#14199) 2024-09-27 02:50:32 -07:00
Meghan Denny
123b5219e0 include code in detached buffer error for Buffer.isUtf8 and Buffer.isAscii (#14197) 2024-09-27 02:49:38 -07:00
Meghan Denny
7113206a7d fix MAX_STRING_LENGTH constant value (#14196) 2024-09-27 02:48:04 -07:00
Andres Kalle
89fc3ef34d types: clarified parameter name (#14209) 2024-09-27 02:09:37 -07:00
Meghan Denny
392a58b0ed remove duplicate root.h includes (#14194) 2024-09-26 22:01:05 -07:00
Ciro Spaciari
02fb802b25 add req.json leak test (#14191) 2024-09-26 22:00:40 -07:00
Meghan Denny
69d33bb1d0 fix small leak in node:process.execArgv getter (#14154) 2024-09-26 17:10:14 -07:00
190n
4e51f7d85b Refactoring and bug fixes in the V8 API (#13754)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-26 16:54:37 -07:00
Robert Shuford
5e97fb8d97 Support reading from $HOME/.npmrc (#13990) 2024-09-26 14:41:28 -07:00
Meghan Denny
d42c032eec cleanup some error handling in BunProcess (#14178) 2024-09-26 14:20:35 -07:00
Jarred Sumner
afe974a175 Update color.md 2024-09-26 13:47:09 -07:00
Zack Radisic
274e5a2022 CSS Parser (#14122)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-26 13:39:26 -07:00
Jarred Sumner
18822b9f45 Support AbortSignal in Bun.spawn (#14180) 2024-09-26 10:54:54 -07:00
Meghan Denny
7b058e24ff fix memory leak in Bun.shellEscape return value (#14130) 2024-09-25 18:13:28 -07:00
Meghan Denny
ec7078a006 dont leak the address string in UDPSocket.addressToString (#14127) 2024-09-25 18:12:32 -07:00
snwy
af12ff104a fix utf8 handling when importing json (#14168) 2024-09-25 17:50:11 -07:00
Meghan Denny
80db770521 rework node:zlib to match internal js api and properly support async writes (#14079)
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-09-25 15:55:53 -07:00
Meghan Denny
c4c3019cb0 no need to cache protocol in NewServer when its statically known (#14128) 2024-09-25 14:47:50 -07:00
Ashcon Partovi
1f0f666210 Fix zig build again (#14165) 2024-09-25 13:02:56 -07:00
Ashcon Partovi
73f90c3359 Remove unused .docker directory 2024-09-25 12:43:47 -07:00
Ashcon Partovi
291a50aff5 Fix zig build (#14163) 2024-09-25 12:42:47 -07:00
Ashcon Partovi
128c658f91 Use ephemeral vendor path for now 2024-09-25 11:19:42 -07:00
Ashcon Partovi
a87341b239 Fix download zig script 2024-09-25 10:55:22 -07:00
Ashcon Partovi
3ab990e615 cmake: Fix zig build issue 2024-09-25 10:45:43 -07:00
Ashcon Partovi
ecf5d79e01 bun run clang-tidy (#14162) 2024-09-25 10:31:38 -07:00
Ashcon Partovi
b9a56a6087 cmake: Add target to download Node.js headers 2024-09-25 09:39:06 -07:00
Jarred Sumner
5722ae8d04 Make prototype pollution attacks harder in most Bun APIs that accept objects (#14119) 2024-09-25 01:16:29 -07:00
Meghan Denny
2856267fda add missing defers to JSBundler.Plugin.hasAnyMatches (#14129) 2024-09-25 01:15:32 -07:00
Meghan Denny
da70c891df dont leak the message when node:util.getSystemErrorName is passed an invalid code (#14126) 2024-09-25 01:13:22 -07:00
Wilmer Paulino
6f27b5559d Switch RSA asymmetric sign implementation to BoringSSL (#14125) 2024-09-25 01:12:50 -07:00
Ashcon Partovi
117e1b3883 bun run prettier (#14153)
Co-authored-by: Electroid <Electroid@users.noreply.github.com>
2024-09-24 22:46:18 -07:00
Ashcon Partovi
1e1025ca37 bun run zig-format (#14152) 2024-09-24 22:10:12 -07:00
Ashcon Partovi
30dc72c17b bun run clang-format (#14148)
Co-authored-by: Electroid <Electroid@users.noreply.github.com>
2024-09-24 20:39:29 -07:00
Jarred Sumner
17d719fa4e Make server.stop return a Promise that fulfills when all opened connections are closed (#14120) 2024-09-24 14:07:29 -07:00
Meghan Denny
0ac2a7da0a dont leak return value in crash_handler jsGetFeaturesAsVLQ (#14131) 2024-09-24 12:26:58 -07:00
Dylan Conway
9d23ce16ec fix(install): relative paths to tarballs in workspaces (#14121) 2024-09-23 22:44:24 -07:00
Ashcon Partovi
7d94c59545 Publish VSCode extension 2024-09-23 16:05:12 -07:00
Meghan Denny
33075394a4 cpp: always return empty JSValue value after throwing exception (#13935)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-09-23 13:53:08 -07:00
Jarred Sumner
ff9560c82a Fix unbalanced ref count involving file descriptors passed to Bun.connect (#14107) 2024-09-23 10:28:50 -07:00
Jarred Sumner
2f8c20ef82 Implement --registry CLI flag in bun install (#14090) 2024-09-22 21:27:33 -07:00
Jarred Sumner
d05070dbfd Fix regression from #13414 (#14092) 2024-09-22 16:02:49 -07:00
Jarred Sumner
1244907a92 Bump 2024-09-22 02:53:21 -07:00
Jarred Sumner
81e5ee26bd Don't re-create the FIFO in streams every time (#14088) 2024-09-22 02:13:11 -07:00
Jarred Sumner
27e7aa7923 Update from-npm-install-to-bun-install.md 2024-09-22 00:33:41 -07:00
Jarred Sumner
f89623aa5e Update from-npm-install-to-bun-install.md 2024-09-22 00:31:01 -07:00
Jarred Sumner
3cc51ceb98 Update from-npm-install-to-bun-install.md 2024-09-22 00:30:08 -07:00
Jarred Sumner
e944bb3638 Update from-npm-install-to-bun-install.md 2024-09-22 00:29:23 -07:00
Jarred Sumner
797750ef42 Update from-npm-install-to-bun-install.md 2024-09-22 00:27:47 -07:00
Jarred Sumner
c267d76f05 Update from-npm-install-to-bun-install.md 2024-09-22 00:25:47 -07:00
Jarred Sumner
c5c1e8ff3a Update from-npm-install-to-bun-install.md 2024-09-22 00:24:56 -07:00
Jarred Sumner
1eab8ec107 Update from-npm-install-to-bun-install.md 2024-09-22 00:23:44 -07:00
Jarred Sumner
60d8c8ad4c Update from-npm-install-to-bun-install.md 2024-09-22 00:17:41 -07:00
Jarred Sumner
dba108f8c4 Update from-npm-install-to-bun-install.md 2024-09-21 23:32:34 -07:00
Jarred Sumner
18251e1b60 Create from-npm-install-to-bun-install.md 2024-09-21 23:29:16 -07:00
Xmarmalade
0bc21b3ddf docs: add ccache for Windows System Dependencies (#14080) 2024-09-21 01:35:01 -07:00
Jarred Sumner
c298b23c45 Fix process.cwd on windows (#14081) 2024-09-21 01:32:23 -07:00
snwy
722e3fa481 fix for windows debug support (#14048)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-21 00:20:33 -07:00
Jarred Sumner
3fc092d23f Fix ci issue 2024-09-20 22:13:16 -07:00
Jarred Sumner
6e0847ca49 Fix searching for lld in $PATH on Linux 2024-09-20 22:09:21 -07:00
Jarred Sumner
7a190de2f1 Fix upload-s3.ts script 2024-09-20 21:34:50 -07:00
Dylan Conway
57a1d7b4ee update 2024-09-20 20:38:52 -07:00
Dylan Conway
3e0e99176a udpate 2024-09-20 20:37:49 -07:00
Ashcon Partovi
fabb18208b Revert "Upload features.json"
This reverts commit 4f02152690.
2024-09-20 18:57:20 -07:00
Ashcon Partovi
4f02152690 Upload features.json 2024-09-20 16:51:16 -07:00
Jarred Sumner
64f4831059 Clarify WASI not WASM 2024-09-20 16:41:49 -07:00
Jarred Sumner
f9a8bed5c2 Make require.cache inspectable (#14072) 2024-09-20 15:27:10 -07:00
190n
08a77267da Keep event loop alive when refConcurrently has been called (#14068) 2024-09-20 14:57:55 -07:00
Jarred Sumner
73c553b25a Update ffi.d.ts 2024-09-20 00:07:26 -07:00
Jarred Sumner
6d43b36622 Allow TCP connections for BUN_INSPECT_NOTIFY (#14056) 2024-09-19 23:55:06 -07:00
Jarred Sumner
8dfa2abb53 Update nav.ts 2024-09-19 23:26:05 -07:00
Ciro Spaciari
d80d9f450c fix(node:http) improve agent support (#13780)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-19 23:04:36 -07:00
Jarred Sumner
ab07cf444d Bump 2024-09-19 21:52:39 -07:00
Jarred Sumner
f263436911 Experiment: Add buffer type and inline pointer (#14036) 2024-09-19 21:26:50 -07:00
Dylan Conway
e938791f77 fix(Bun.build): handle non-object plugins (#14050) 2024-09-19 19:37:28 -07:00
Dylan Conway
cff7b9843d fix 14037 (#14047) 2024-09-19 15:25:38 -07:00
Kevin Gibbons
260a0d16eb docs: Add new methods to binary-data.md (#14044) 2024-09-19 13:36:08 -07:00
Dylan Conway
47e4b826fa fix snapshot regression (#14031) 2024-09-19 13:27:42 -07:00
Jarred Sumner
6415296e96 Support napi inside of bun:ffi (#14028) 2024-09-19 03:19:08 -07:00
dave caruso
866a6d9180 fix(bundler): disable moving identifiers (#14033) 2024-09-19 03:18:16 -07:00
Jarred Sumner
181b8722e2 Enable cc test (#14026) 2024-09-18 21:55:49 -07:00
Jarred Sumner
572bcf0097 Fixes #14014 (#14023) 2024-09-18 19:06:33 -07:00
Dylan Conway
cf4e9cb69e disable most DOMJIT (#14005) 2024-09-17 21:43:38 -07:00
Jarred Sumner
6d98bccd8b TinyCC: -framework support, __attribute__(deprecated(string)) in enum, fix dlsym issue (#13993)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-09-17 15:50:02 -07:00
Dylan Conway
c74ec5ab18 compare major 2024-09-17 10:54:46 -07:00
Dylan Conway
3d68a9483f fix cloning dependencies 2024-09-16 12:18:53 -07:00
Jarred Sumner
b66d622c56 Bump WebKit (#13970) 2024-09-15 04:37:23 -04:00
190n
163e76ef96 Fix memory corruption in napi_open_escapable_handle_scope (#13955)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-15 01:39:18 -04:00
Jarred Sumner
14c63229a1 Revert "various node:buffer fixes" (#13971) 2024-09-14 23:41:33 -04:00
Jarred Sumner
f4391e7023 Support compiling and running C from JavaScript (#13403) 2024-09-14 04:57:44 -04:00
snwy
b9a5e4410f forward IPC to child process if running package script (#13934)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-14 04:40:00 -04:00
Meghan Denny
3c2e798eab various node:buffer fixes (#13757)
Co-authored-by: nektro <nektro@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-14 04:09:20 -04:00
Mattias Leino
a60d5211ca Add documentation for using bun with Testing Library (#13960) 2024-09-14 02:24:10 -04:00
Meghan Denny
ac53310fe9 misc node:zlib fixes [v2] (#13958) 2024-09-14 02:01:04 -04:00
Jarred Sumner
d9d4cff303 Micro-optimize path.resolve(), path.resolve("") (#13930) 2024-09-14 01:42:49 -04:00
Dylan Conway
5af782344f fix(watch): use case insensitive path comparison (#13909)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-14 01:41:33 -04:00
Dylan Conway
7ef0f04acd fix #13942 (#13943) 2024-09-14 01:22:28 -04:00
Meghan Denny
8b1c53dd36 Fix debug builds on macOS arm64 (#13952)
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2024-09-13 16:01:17 -07:00
Ashcon Partovi
44841d8924 Fix clang-cl flag: /O0 -> /Od 2024-09-13 16:00:16 -07:00
Dylan Conway
3c0327df3a debug libraries 2024-09-13 15:58:22 -07:00
Dylan Conway
e5e8861fde debug icu 2024-09-13 15:57:58 -07:00
Dylan Conway
620b7b101e update webkit (#13931) 2024-09-13 02:43:22 -07:00
Jarred Sumner
34e4447aea Update some paths 2024-09-13 00:40:49 -07:00
190n
3aef88842e Make setInterval leak test not flaky (#13929) 2024-09-12 18:57:06 -07:00
Ashcon Partovi
76191bed44 Various fixes for CMake (#13928) 2024-09-12 18:08:59 -07:00
190n
b146449ed5 Increase timeouts for shell-hang.test.ts (#13932) 2024-09-12 17:23:33 -07:00
dave caruso
c2c2048072 framework api: init / work in progress (#13215)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-12 16:44:03 -07:00
Jarred Sumner
ff6f8bd2d1 Update path-resolve.mjs 2024-09-12 15:00:52 -07:00
Ciro Spaciari
b1ca81a10d fix(node:net, node:tls) add named pipe support on node:net and node:tls modules (#13838) 2024-09-12 14:06:45 -07:00
Jarred Sumner
d9b851e426 Don't panic when a package.json manifest registry api name doesn't match the local name (#13907) 2024-09-12 14:05:45 -07:00
Jarred Sumner
872c7f0d91 Why is path slow (#13908) 2024-09-12 14:05:16 -07:00
Jarred Sumner
0a6594395c Add a couple uv symbols (#13808)
Co-authored-by: Ben Grant <ben@bun.sh>
2024-09-12 00:13:49 -07:00
snwy
043dfa4cc9 fix .env loader printing to stderr when running bun bun.lockb (#13905)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-12 00:10:03 -07:00
Jarred Sumner
173f465fbe ✂️ dead code 2024-09-11 22:04:32 -07:00
Jarred Sumner
51adc273a6 Add message on crash with old CPU (#13886) 2024-09-11 20:14:17 -07:00
190n
522493afa8 Attempt to fix spawn-streaming-stdin.test.ts on Windows (#13860) 2024-09-11 20:14:10 -07:00
Jarred Sumner
c48997050d Avoid creating a Napi handle scope within a finalizer (#13870)
Co-authored-by: Ben Grant <ben@bun.sh>
2024-09-11 20:05:44 -07:00
Jarred Sumner
2064876a7d Fix crash in socket.upgradeTLS (#13884) 2024-09-11 20:05:06 -07:00
snwy
c3197948c4 fixes --conditions for bun test (#13902) 2024-09-11 18:04:21 -07:00
Ashcon Partovi
f5b7a6708d Move dependencies from src/deps/ to vendor/ (#13901) 2024-09-11 17:46:03 -07:00
190n
b33d6b1416 Fix ReadFileUV not reading to the end of a non-regular file on Windows (#13900) 2024-09-11 17:33:01 -07:00
190n
f6841a06c5 Make NAPI garbage collection tests faster (#13898) 2024-09-11 16:59:03 -07:00
Dylan Conway
749632f125 fix(spawn): update cwd before searching for executable to run (#13845)
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-09-11 16:58:24 -07:00
Jarred Sumner
de9557b19e Fix edgecase with "os" and "cpu" in bun install (#13848)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-11 16:47:38 -07:00
Jarred Sumner
ed8e6115bb Fix using decimal numbers for file descriptors (#13881) 2024-09-11 15:52:53 -07:00
Jarred Sumner
0378e5a277 Update launch.json 2024-09-11 15:41:41 -07:00
Jarred Sumner
3689978b98 Update clangd 2024-09-11 15:14:59 -07:00
Ashcon Partovi
3939e16664 Fix build.mjs (#13893) 2024-09-11 09:45:42 -07:00
Ashcon Partovi
03285f2490 Reapply "Update build.mjs"
This reverts commit 03d7d9aadd.
2024-09-11 08:25:24 -07:00
Ashcon Partovi
19ef3eecd0 Reapply "Make configure faster with local WebKit build"
This reverts commit a832954c94.
2024-09-11 08:25:05 -07:00
Ashcon Partovi
d39e422b20 Reapply "Convert build scripts to CMake (#13427)"
This reverts commit 374bb15db6.
2024-09-11 08:24:50 -07:00
Dylan Conway
3e904303ac fix hot/hot.test.ts, hot/watch.test.ts, and watch/watch.test.ts (#13876)
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-09-11 01:24:46 -07:00
Jarred Sumner
97baeb80f0 Move EventLoopTask into a separate file because it causes clangd to crash (#13875) 2024-09-11 00:24:48 -07:00
Dylan Conway
4a58a97fa0 fix sleep tests in bun-install-registry.test.ts (#13874) 2024-09-10 22:28:57 -07:00
Dylan Conway
7e705b9d40 fix expo.test.ts (#13872) 2024-09-10 20:52:29 -07:00
Jarred Sumner
1f1e4a08d8 Update nodejs-apis.md 2024-09-10 20:40:34 -07:00
Jarred Sumner
58c74e1a75 Update nodejs-apis.md 2024-09-10 20:35:35 -07:00
Jarred Sumner
d483535693 Update nodejs-apis.md 2024-09-10 20:32:00 -07:00
Dylan Conway
374bb15db6 Revert "Convert build scripts to CMake (#13427)"
This reverts commit 354df17d16.
2024-09-10 19:57:19 -07:00
Dylan Conway
a832954c94 Revert "Make configure faster with local WebKit build"
This reverts commit 1694ca0e89.
2024-09-10 19:56:37 -07:00
Dylan Conway
03d7d9aadd Revert "Update build.mjs"
This reverts commit 24bb8d95b0.
2024-09-10 19:56:36 -07:00
Dylan Conway
ff9b003a9b Revert "Fix permissions on Zig download"
This reverts commit fb5ebe5ceb.
2024-09-10 19:56:34 -07:00
Jarred Sumner
ac17735cac Retry after chmod when cp fails 2024-09-10 19:30:13 -07:00
Ashcon Partovi
fb5ebe5ceb Fix permissions on Zig download 2024-09-10 19:01:09 -07:00
Jarred Sumner
24bb8d95b0 Update build.mjs 2024-09-10 18:54:52 -07:00
Ashcon Partovi
1694ca0e89 Make configure faster with local WebKit build 2024-09-10 17:40:12 -07:00
Ashcon Partovi
354df17d16 Convert build scripts to CMake (#13427) 2024-09-10 17:01:40 -07:00
Jarred Sumner
8d7d58606b Add generator for $ERR_* as fake private globals (#13843)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-10 16:07:22 -07:00
Jarred Sumner
d7f9346f67 Fix broken link 2024-09-10 15:22:08 -07:00
Jarred Sumner
80cb9e77bc Use absolute links in docs 2024-09-10 15:11:16 -07:00
Lev
036e030342 Add the missing 'linked' option to --sourcemap in bun build --help (#13855) 2024-09-10 04:08:52 -07:00
190n
2071507a1b Fix flaky process.cpuUsage tests (#13842) 2024-09-10 02:38:40 -07:00
Jarred Sumner
c7b874447f Add missing timers.promises (#13834)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-09 17:17:52 -07:00
190n
282b92d6e1 Fix issues with NAPI tests (#13831)
Co-authored-by: 190n <190n@users.noreply.github.com>
2024-09-09 17:08:40 -07:00
Ciro Spaciari
2b50554596 fix(node:http) always set headersSent to true after end (#13794)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
2024-09-09 17:08:17 -07:00
Jarred Sumner
8f5d78f498 Fix default value for zlib options (#13800) 2024-09-09 17:06:41 -07:00
Jarred Sumner
ee2d666e8e Add missing perf_hooks constants (#13833)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-09 16:54:09 -07:00
Jarred Sumner
3e8a50ba57 workerData should default to null instead of undefined (#13835)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-09 16:48:12 -07:00
Jarred Sumner
945175961c Set process._exiting to false by default (#13832)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-09 16:45:24 -07:00
dave caruso
d38f937d3d fix(transpiler): remove react element inlining (#13694)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-09 15:03:13 -07:00
Jarred Sumner
07e4b5f3d3 Update run-lint-cpp.yml 2024-09-09 14:32:55 -07:00
Wilmer Paulino
a0939ca4f1 Switch asymmetric encryption implementation to BoringSSL (#13786) 2024-09-08 03:19:23 -07:00
Danny Kirkham
09cbb51c81 Fix typo in http.md (#13793) 2024-09-08 00:56:31 -07:00
Dylan Conway
50d2f76075 fix(pack): don't automatically include CHANGELOG when files is populated (#13789) 2024-09-08 00:56:21 -07:00
github-actions[bot]
09fb2d1db0 Bump to 1.1.27 (#13805)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-08 00:48:15 -07:00
Dylan Conway
267afa2934 implement bun pm pack (#13723)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-09-07 03:55:09 -07:00
Jarred Sumner
08103aa7ae Fix 2 memory leaks in zlib from #11770 (#13787) 2024-09-07 02:12:09 -07:00
190n
084734db64 Implement napi_handle_scope and napi_escapable_handle_scope (#13756) 2024-09-07 00:55:19 -07:00
Meghan Denny
de5809b45a windows: fix sometimes crash when FDImpl.uv() is called on stdio (#13719)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Dave Caruso <me@paperdave.net>
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-09-06 21:00:55 -07:00
Jarred Sumner
f0a4b9f96f Copy fix from #13756 into separate PR (#13783)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-06 20:16:20 -07:00
Meghan Denny
8cd515f533 node:zlib: move deflate and gzip into native code (#11770)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-06 18:49:19 -07:00
Jarred Sumner
1458fcca4a Run formatter 2024-09-06 18:13:08 -07:00
Jarred Sumner
4dbd246c49 Update 7-install-crash-report.yml 2024-09-06 18:01:03 -07:00
Jarred Sumner
17553e8ea3 Update 7-install-crash-report.yml 2024-09-06 18:00:14 -07:00
Jarred Sumner
2507ff515a Update 7-install-crash-report.yml 2024-09-06 17:58:58 -07:00
Ciro Spaciari
1011b44d78 fix(node:http) implement request.setTimeout and server.setTimeout (#13772)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-06 17:52:38 -07:00
Ashcon Partovi
cbb57e5c5b Fix bun run being terminated randomly in CI
This was basically a chaos monkey in our CI
2024-09-06 17:37:49 -07:00
Jarred Sumner
ed6554314e github actions 2024-09-06 17:28:19 -07:00
Jarred Sumner
bd38aaab36 Update sqlite3_local.h 2024-09-06 17:25:51 -07:00
Jarred Sumner
6fe2d99a51 Github actions 2024-09-06 17:18:28 -07:00
Jarred Sumner
e8c65a009f clang fmt github action (#13724) 2024-09-06 17:15:07 -07:00
Jarred Sumner
3f9ad7cefc Add a debug assertion 2024-09-06 16:58:08 -07:00
Jarred Sumner
69f97cecf0 Ensure shell keeps process alive while running (#13777) 2024-09-06 16:28:50 -07:00
Meghan Denny
ed7741a662 node:https: provide proper Agent definition (#11826)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-06 16:11:19 -07:00
Jarred Sumner
9adf42b373 Handle oom in Buffer.byteLength (#13746) 2024-09-06 14:38:55 -07:00
Jarred Sumner
d3bc0ca722 Add if workers spawned / terminated to crash reports (#13763) 2024-09-06 14:34:33 -07:00
Jarred Sumner
debaa2cc34 Fix CTRL + C behavior in bun run so it doesn't ^[[A (#13762) 2024-09-06 13:54:01 -07:00
Jarred Sumner
ea12db4084 Deflake a test 2024-09-06 13:49:26 -07:00
Meghan Denny
981f1d4a60 fix bad translation in child-process-exec-timeout-kill.test.js (#13765) 2024-09-06 13:26:57 -07:00
Pham Minh Triet
419277f691 fix small typo in semver.md (#13767) 2024-09-06 13:26:20 -07:00
190n
da2a5661af Increase randomIntegrityAuditRate from 0.05 to 1.0 in CI (#13775) 2024-09-06 13:03:23 -07:00
Ciro Spaciari
d8e2c24d70 fix(fetch) fix lifecycle of SSL Proxy, fix lifecycle of tls_props, fix handling chunked encoded redirects when proxing. (#13752) 2024-09-06 01:50:02 -07:00
マルコメ
6010c33137 Add .toml extension to .gitattributes (#13761) 2024-09-05 23:52:12 -07:00
Ciro Spaciari
36c5f843ec feat(tls) add duplex upgrade (#13718) 2024-09-05 19:37:31 -07:00
Jarred Sumner
d38fc909e3 Support ReadableStream in request.clone & response.clone() (#13744) 2024-09-05 17:55:59 -07:00
Solomon ogu
cd7f6a1589 fix: typo in docs and types for sqlite (#13727) 2024-09-04 15:46:05 -07:00
Jarred Sumner
a9cf463eeb Introduce fast path for buffered ReadableStream (#13704)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-04 04:16:47 -07:00
Jarred Sumner
f3da37e486 Fixes #13725 2024-09-04 03:26:11 -07:00
Jarred Sumner
ebe070487b github actions 2024-09-03 21:51:04 -07:00
Jarred Sumner
f4539431a0 Update format.yml 2024-09-03 21:44:29 -07:00
Jarred Sumner
c91afdb35c Github actions 2024-09-03 21:43:34 -07:00
Jarred Sumner
128d69dcbe Update format.yml 2024-09-03 21:34:52 -07:00
Jarred Sumner
cd6785771e run prettier and add back format action (#13722) 2024-09-03 21:32:52 -07:00
Jarred Sumner
5108e3e0d9 Add snapshot tests for dependency/version parsing (#13658) 2024-09-02 15:12:00 -07:00
Wilmer Paulino
bd3e62df40 Use JSMapIterator and JSSetIterator for deep equal comparisons (#13674) 2024-09-02 15:10:33 -07:00
Jarred Sumner
1668fde0a9 Support hot reloading when .css or any other imported file changes (#13665) 2024-09-02 15:07:25 -07:00
Jarred Sumner
12174e0577 Call cancel on ReadableStream when Bun.serve() response is aborted (#13687) 2024-09-02 09:40:03 -07:00
Jarred Sumner
c50f8d82d5 Remove outdated callout
Still very active! More stable though.
2024-09-02 05:07:05 -07:00
Jarred Sumner
d30767ea68 Fix crash when throwing an exception from napi (#13664) 2024-09-02 05:00:46 -07:00
Jarred Sumner
6b30c1b30d Add missing OOM exception check in Bun.escapeHTML (#13677) 2024-09-01 23:37:07 -07:00
Jarred Sumner
b64f1e15b5 Fixes #13629 (#13660) 2024-09-01 22:40:31 -07:00
Jarred Sumner
5f6015bb79 Fixes #13657 (#13667) 2024-09-01 18:21:34 -07:00
Jarred Sumner
f123814d87 Fix missing ERR_INVALID_ARG_TYPE in 2 buffer methods (#13617) 2024-09-01 04:40:14 -07:00
Jarred Sumner
ef4bcb314c Use -mmacos-version-min instead of -mmacosx-version-min (#13640) 2024-09-01 04:39:32 -07:00
Mohit Srivastava
fd2ad27b6f Change contributing docs to use llvm 18 on macos (#13651) 2024-09-01 00:31:45 -07:00
Jarred Sumner
03de99afcf Add tests for static routes + support server.reload for static routes (#13643) 2024-08-31 03:32:08 -07:00
Wilmer Paulino
9ba63eb522 Fix AES-GCM encryption of empty messages (#13646) 2024-08-31 02:29:16 -07:00
Ciro Spaciari
bac38b8967 fix(tls/fetch) Better SSLWrapper for http proxy and start of Duplex support on tls (#12750)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-30 23:22:58 -07:00
Wilmer Paulino
76c4145f0e Return expected data when using Promises with crypto.generateKeyPair (#13600)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-30 20:14:47 -07:00
Ciro Spaciari
adb54f1849 fix(Server) handle requestIP after async call (#13532)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-30 19:13:53 -07:00
Jarred Sumner
0f4aa68575 Bump build.zig minimum to macOS 13 (#13639) 2024-08-30 19:12:53 -07:00
Jarred Sumner
6555248a04 Make the V8_UNIMPLEMENTED error include the function name (#13559)
Co-authored-by: 190n <ben@bun.sh>
2024-08-30 18:52:08 -07:00
Jarred Sumner
2f19b71e0f Bump WebKit again (#13641) 2024-08-30 18:18:29 -07:00
Jarred Sumner
9076b369f0 Fixes #4432 (#13597) 2024-08-30 18:01:32 -07:00
Ciro Spaciari
9cb203f229 update(root_certs) update certs (#13609) 2024-08-30 16:51:09 -07:00
Félix C. Morency
5650ed470c fix: lcov non-hit executable lines reporting (#13633) 2024-08-30 16:08:23 -07:00
Jarred Sumner
fc99dd27e3 Un-revert read .gitconfig (#13637)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-08-30 16:04:47 -07:00
Jarred Sumner
4d61637e8a Deflake bun-build-api test (#13636) 2024-08-30 14:59:47 -07:00
Michael H
aed0f58dfc bun install global package include -g flag in untrusted message (#13626) 2024-08-30 14:58:41 -07:00
Jarred Sumner
a37694cec2 Fix hypothetical race condition in Bun.build API (#13618) 2024-08-30 14:56:59 -07:00
Jarred Sumner
b52f9923e2 Delete macOS 10.5 support polyfills (#13635) 2024-08-30 14:47:31 -07:00
Jarred Sumner
1bed7a7fd1 Introduce static option in Bun.serve() (#13540) 2024-08-30 01:36:18 -07:00
Grigory
59eb5515c5 fix(nodevm): align behavior with node (#13590) 2024-08-30 01:34:18 -07:00
Jarred Sumner
682b3730a1 Revert "fix overriding sshCommand and askpass from gitconfig" (#13620) 2024-08-30 00:59:00 -07:00
Ciro Spaciari
bd3c258af4 fix(FormData, Bun.file()) FormData can append file slices, Bun.file(..).slice(..).text() works as expected (#13580)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-30 00:53:40 -07:00
Dylan Conway
9faaa9b982 fix overriding sshCommand and askpass from gitconfig (#13612) 2024-08-30 00:49:49 -07:00
Jarred Sumner
bd2eb40a39 Fix oom handling in Bun.file (#13603) 2024-08-29 18:54:33 -07:00
Dylan Conway
f3ed9eac4a fix(outdated): match scoped names with * (#13610) 2024-08-29 16:06:41 -07:00
Jarred Sumner
b55670ddb7 Fixes #10084 (#13601) 2024-08-29 11:02:34 -07:00
Ashcon Partovi
39eecc7757 Disable auto-labeler for now 2024-08-29 11:00:57 -07:00
Jarred Sumner
6faf657e32 Implement --max-http-header-size (#13577) 2024-08-29 00:38:47 -07:00
Jarred Sumner
e48369ddab Fixes #4443 (#13596) 2024-08-28 21:17:06 -07:00
Jarred Sumner
743f40b473 Make the panic message better when this assertion failure happens (#13579) 2024-08-28 19:07:22 -07:00
Jarred Sumner
b4e552dbeb WebKit upgrade (#13578) 2024-08-28 19:06:29 -07:00
Jarred Sumner
952d44b675 Fixes #13581 (#13583) 2024-08-28 13:54:57 -07:00
Jake Boone
8cb0b5db21 Fix alignment in bun outdated example grid (#13573) 2024-08-27 17:52:00 -07:00
Dylan Conway
1976e5bc00 fix #13563 and #12440 (#13575) 2024-08-27 17:46:16 -07:00
Jarred Sumner
f520715622 Update label-issue.ts 2024-08-27 14:13:21 -07:00
Jarred Sumner
a4264cef23 Update label-issue.ts 2024-08-27 03:56:06 -07:00
Jarred Sumner
09f002934c Update labeled.yml 2024-08-27 03:53:05 -07:00
Jarred Sumner
89dfe9beb6 Update label-issue.ts 2024-08-27 03:43:57 -07:00
Jarred Sumner
4ac415f58d Update labeled.yml 2024-08-27 03:39:13 -07:00
Jarred Sumner
acd8567fa0 Add issue labeler 2024-08-27 03:37:42 -07:00
Dylan Conway
ba2ea6fbb2 add --filter and package pattern arguments to bun outdated (#13557) 2024-08-27 00:18:27 -07:00
Pocky
36c621b6b1 docs: sync Statement.all and Statement.get docs with types (#13544) 2024-08-26 18:30:22 -07:00
Pocky
bab5fec95f Fix Date in SQLite Example Comment (#13558) 2024-08-26 18:29:34 -07:00
Jake Bailey
e6b30a90de Use more compatible screen clearing ANSI escape (#13553) 2024-08-26 18:17:31 -07:00
Jarred Sumner
fea302ee1d Add missing destroySoon (#13555) 2024-08-26 18:09:05 -07:00
Jarred Sumner
2ffcccc5b4 Fixes #5591 (#13541) 2024-08-26 16:09:48 -07:00
Ciro Spaciari
11d7a9d5e9 fix(randomInt) allow negatives and improve args validation (#13527) 2024-08-25 23:16:25 -07:00
Jarred Sumner
55cdf69415 Make the error better on Windows when you do Bun.file(path).writer() (#13536) 2024-08-25 22:29:52 -07:00
Jarred Sumner
ac8f9052a2 Deflake fs.test.ts (#13538) 2024-08-25 21:43:16 -07:00
Jarred Sumner
5a525d3042 Deflake test/js/web/fetch/fetch-tcp-stress.test.ts (#13537) 2024-08-25 21:24:36 -07:00
Ciro Spaciari
6fd06dd023 fix(Bun.serve) ensure timeout reset when we write data (#13525) 2024-08-25 20:27:49 -07:00
Ciro Spaciari
df9d18659c revert d8ac4c59ff 2024-08-25 19:43:24 -07:00
Ciro Spaciari
d8ac4c59ff deflaky 2024-08-25 19:35:35 -07:00
Ciro Spaciari
3309a8479c temporary disable this 2024-08-25 13:44:18 -07:00
Ashcon Partovi
3896b0e29f Fix build-bun.sh 2024-08-25 09:48:38 -07:00
Ashcon Partovi
c4f4d7c872 Fix build-bun.sh 2024-08-25 09:29:29 -07:00
Ashcon Partovi
ebdd678da5 Upload features.json to Buildkite 2024-08-25 09:19:42 -07:00
github-actions[bot]
7529cd76b5 Bump to 1.1.26 (#13504)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-08-24 16:12:43 -07:00
Jarred Sumner
9eeef3f5df Update release.yml 2024-08-24 01:29:28 -07:00
Jarred Sumner
2b1a10629b Update upload-npm.ts 2024-08-24 01:22:33 -07:00
Jarred Sumner
0a37423baf Expose subscriberCount in WebSocket server (#13498) 2024-08-23 23:12:01 -07:00
Dylan Conway
1a9307da08 bun outdated docs (#13497)
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-08-23 23:11:52 -07:00
Jarred Sumner
b005ef43d4 Deflake fs.test.ts 2024-08-23 22:55:30 -07:00
Jarred Sumner
078fdd3787 Make the test runner work on older versions of Bun 2024-08-23 22:55:12 -07:00
Jarred Sumner
dc58c42453 Fix test harness in older versions 2024-08-23 22:48:49 -07:00
Jarred Sumner
b53c25e5f8 Redo napi cleanup hooks (#13487) 2024-08-23 21:09:56 -07:00
Jarred Sumner
e97c65fd1e Add 59 more node tests + copy node test fixtures (#13495) 2024-08-23 19:06:35 -07:00
Ciro Spaciari
5a108c5027 fix(fetch) always make sure that abort tracker is cleaned, revise ref count (#13459) 2024-08-23 17:08:57 -07:00
Jarred Sumner
0f1d5d5dab Align getMockName and mockName behavior with jest (#13494) 2024-08-23 15:46:04 -07:00
Dylan Conway
6415cc3e92 implement bun outdated (#13461)
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-08-23 02:15:13 -07:00
Jarred Sumner
8d34846d19 Bump 2024-08-23 01:13:55 -07:00
Jarred Sumner
781998cf00 You shouldn't need --only to only run test.only tests (#13465) 2024-08-23 00:06:57 -07:00
Jarred Sumner
02a75070fb Preserve "use strict"; directive in CommonJS modules at top of file (#13485) 2024-08-22 23:51:27 -07:00
Jarred Sumner
ac8db43485 Throw ERR_INVALID_THIS in DOM types (#13484) 2024-08-22 23:25:41 -07:00
Jarred Sumner
94ee538dc6 About 13% of node's test suite (#13468) 2024-08-22 18:00:25 -07:00
Dylan Conway
9cdda49485 fix(node:util): use Object.setPrototypeOf in inherits (#13480) 2024-08-22 17:58:00 -07:00
Jarred Sumner
2c84840222 Fix crash in buffer found in node tests (#13460) 2024-08-22 16:16:25 -07:00
Jarred Sumner
dafa9946e4 Disable DOMJIT for crypto.getRandomValues() (#13470) 2024-08-22 15:52:38 -07:00
Ciro Spaciari
74d5b93ffc fix(dns.resolveSrv) (#13478) 2024-08-22 15:36:22 -07:00
Jarred Sumner
886c31f0c5 Fix expect.assertions() and done callback (#13463) 2024-08-22 15:26:58 -07:00
Jarred Sumner
1bac09488d Copy some node tests (#13458) 2024-08-21 23:09:09 -07:00
Jarred Sumner
83a256013f Support asymmetric matchers in expect().toThrow (#13455) 2024-08-21 21:06:05 -07:00
Ciro Spaciari
384988f26c feat(Bun.serve idleTimeout) allow custom timeouts (#13453) 2024-08-21 18:13:03 -07:00
190n
fe62a61404 Fix V8 API memory management and implement more APIs (#13426) 2024-08-20 19:32:44 -07:00
Jarred Sumner
ef8fd12e43 Include "name" and lastModified when console.log'ing Blob or File (#13435) 2024-08-20 19:27:38 -07:00
Jarred Sumner
999324a50c Add standalone_executable to crash reporter feature list (#13431) 2024-08-20 19:25:45 -07:00
Ciro Spaciari
8ace981fbc fix(node:http/node:https) emit continue (#13434) 2024-08-20 17:10:21 -07:00
Jarred Sumner
02ff16d95c Support Worker, relative file paths in standalone executables, and partially directories (#13421) 2024-08-20 13:05:40 -07:00
Ciro Spaciari
1d188dbc55 fix(subprocess) use deref and use new (#13429) 2024-08-20 12:45:46 -07:00
Jarred Sumner
f16d802eb1 Implement V8::String::{Utf8Length, IsOneByte, ContainsOnlyOneByte, IsExternal, IsExternalTwoByte, IsExternalOneByte} (#13417) 2024-08-20 11:51:23 -07:00
Ciro Spaciari
eb8ed27a4a fix(ipc/subprocess) (#13414)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-20 05:19:23 -07:00
190n
5eb053fa3b Use bun instead of npm even for Node.js build in V8 tests (#13352)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-19 19:06:12 -07:00
Ciro Spaciari
f9af7be5ae fix(net) make sure to always end the connection when destroy is called (#13412) 2024-08-19 15:55:05 -07:00
Ciro Spaciari
1367e5e85a fix(ipc) fix closing edge case (#13413) 2024-08-19 15:53:36 -07:00
Jarred Sumner
d55b5cc169 Enable reusePort in Bun.serve() by default when using node:cluster (#13381) 2024-08-18 22:34:58 -07:00
Dylan Conway
fa2e00f109 fix freeing semver ranges (#13399) 2024-08-18 22:34:38 -07:00
Roman
9993d72fee docs: remove extra assignment (#13389) 2024-08-18 10:52:00 -07:00
Meghan Denny
fd75ca7585 implement node:cluster (#11492)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: nektro <nektro@users.noreply.github.com>
Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
2024-08-18 00:12:42 -07:00
Jarred Sumner
a53db001db Fixes #13343 (#13360) 2024-08-17 20:22:12 -07:00
Jarred Sumner
1a5c05adca Another attempt to fix aarch64 mock module test failure (#13356) 2024-08-17 18:10:35 -07:00
Zack Radisic
58d02e467f Fix shell backticks crash (#13375) 2024-08-17 18:07:03 -07:00
Ciro Spaciari
63596c3f8c fix(sockets) always uncork when closing (#13358)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-17 02:53:10 -07:00
Meghan Denny
996847bcad ci: disable bun-jsc.test.ts 'profile async' on windows for now (#13363) 2024-08-17 02:50:48 -07:00
Jarred Sumner
33c91fe3fa Bump WebKit (#13355) 2024-08-16 22:40:29 -07:00
Meghan Denny
7fd072f4af node:fs: use bun.assert to fix zig linter (#13353) 2024-08-16 18:23:45 -07:00
Ciro Spaciari
15a8e72790 fix(ws test) deflaky (#13348) 2024-08-16 16:15:12 -07:00
Jarred Sumner
64d77e33f6 Fixes #13331 (#13340) 2024-08-16 15:42:11 -07:00
190n
babc907bfe Support Unicode strings in V8 APIs (#13335) 2024-08-16 15:16:39 -07:00
190n
83c5d8a942 Support doubles in v8::Number (#13336)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-16 14:34:04 -07:00
MARCROCK22
5a8e98cec2 add missing Timer types and Bun.build sourcemap "linked" (#13349) 2024-08-16 14:26:44 -07:00
Meghan Denny
d4237b0757 node:fs: mode+flags message cleanup (#13332) 2024-08-15 23:19:25 -07:00
Jarred Sumner
766a9cf4f2 Fix some argument validation issues in fetch() (#13337) 2024-08-15 23:14:59 -07:00
Jarred Sumner
98a709fb1b Further clang-analyzer (#13324) 2024-08-15 15:01:36 -07:00
Meghan Denny
715ff7f323 node:fs: add additional error handling for flags and mode (#13321)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-15 13:13:11 -07:00
Jarred Sumner
df1744f0da Bump 2024-08-15 13:12:32 -07:00
Dylan Conway
5bd344281f fix(TextEncoder): domjit crash in encode (#13320)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-15 03:35:58 -07:00
Viktor L
b70458c3e4 Fix "bun exec" examples (#13318) 2024-08-15 00:31:29 -07:00
Jarred Sumner
3f686222d4 Micro-optimize Module._resolveFilename (#13322) 2024-08-14 23:36:46 -07:00
Jarred Sumner
36fc324523 Fixes #13311 (#13319) 2024-08-14 22:46:45 -07:00
Meghan Denny
a5bd94f582 node:net.Server listen handler should be bound to the server (#13290)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-14 19:00:57 -07:00
Jarred Sumner
4fae1b4475 Increase max concurrent connection count for connecting sockets (#13294) 2024-08-14 19:00:31 -07:00
Jarred Sumner
2fa60f2d12 Appease clang-tidy (#13312) 2024-08-14 19:00:20 -07:00
Jarred Sumner
6d79edaa15 Fixes https://github.com/oven-sh/bun/issues/13001 (#13313) 2024-08-14 18:11:10 -07:00
190n
dc2929d4e1 Start implementing internal V8 APIs (#12821)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-14 17:51:12 -07:00
Meghan Denny
5bc45e2721 node:net.Socket#{ref,unref} are supposed to return this (#13291)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-14 17:23:39 -07:00
Dylan Conway
fe7f5fa731 switch nodemailer test to mailgun (#13314) 2024-08-14 17:18:03 -07:00
Meghan Denny
30edb594a8 node:fs: use libuv callbacks instead of custom workpool for some operations on windows (#13278)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-14 14:57:25 -07:00
Ashcon Partovi
1961a9acc8 Fix using tmpdir for clean builds 2024-08-14 14:09:07 -07:00
Ashcon Partovi
9482a0afdf Fix CI cache not working on macOS & Linux 2024-08-14 14:02:29 -07:00
Ashcon Partovi
a1312066b3 Fix secrets in CI tests (#13306) 2024-08-14 11:13:09 -07:00
Jarred Sumner
85a3299115 CI fixes 2024-08-14 02:09:30 -07:00
Jarred Sumner
3ea71a9672 Update env.sh 2024-08-14 02:07:01 -07:00
Jarred Sumner
bf945f6dbb Update env.sh 2024-08-14 02:05:16 -07:00
Jarred Sumner
a366135bd2 Update runner.node.mjs 2024-08-14 01:53:27 -07:00
Ciro Spaciari
eec5abd0da fix(net) remove unnecessary closeNT call (#13282)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-14 01:51:40 -07:00
Jarred Sumner
cede04b019 Ensure secrets are set in CI (#13285) 2024-08-14 01:50:57 -07:00
Jarred Sumner
cf1863236a Do not skip tests due to missing credentials in CI. (#13284) 2024-08-13 22:44:52 -07:00
Jarred Sumner
bd3517197c Fix flaky process.cpuUsage test on linux (#13279) 2024-08-13 21:16:39 -07:00
Daniel M.
2c93e917a9 Fix typo (#13266) 2024-08-13 21:10:44 -07:00
Jarred Sumner
5e6b509100 Bump 2024-08-13 17:52:15 -07:00
Ciro Spaciari
c229da8d9a fix(expect) fix behavior of .not.throw when receiving a string (#13272) 2024-08-13 17:51:18 -07:00
Jarred Sumner
4304368fc0 Clean up error codes in napi somewhat (#13179) 2024-08-13 12:42:10 -07:00
Ciro Spaciari
460d6edbda fix(net/tls) we need to call end when we got FIN if allowHalfOpen is false (#13212)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-13 00:24:37 -07:00
Meghan Denny
9628ee76fc windows: fix fs-promises-writeFile-async-iterator.test.ts [v2] (#13164)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-13 00:24:23 -07:00
Jarred Sumner
9fd6a04460 Fix importing empty toml file at runtime (#13252) 2024-08-13 00:21:18 -07:00
Meghan Denny
a13a020d4c console: remove further uses of unbuffered_writer (#13257)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-13 00:09:23 -07:00
Jarred Sumner
3a245dd248 upgrade webkit (#13192)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-08-12 23:17:17 -07:00
Ciro Spaciari
b972ed6540 fix(IPC) make IPC on windows compatible with node.js (#13258) 2024-08-12 20:14:43 -07:00
Ciro Spaciari
dfa3a9a369 fix(sockets) fix connecting sockets not reporting close when context or the socket it self is closed manually (#13249) 2024-08-12 13:30:10 -07:00
Jarred Sumner
444766833c Fixes #13226 (#13234) 2024-08-11 01:18:40 -07:00
Jarred Sumner
f7d459eea5 Create text-decoder-stream.mjs 2024-08-10 17:09:51 -07:00
Jarred Sumner
7d018fb323 Update text-encoder-stream.mjs 2024-08-10 03:20:14 -07:00
Jarred Sumner
5f08478229 Update text-encoder-stream.mjs 2024-08-10 03:15:11 -07:00
Jarred Sumner
d861347dc5 Optimize TextEncoderStream, part 1 (#13222) 2024-08-10 02:13:36 -07:00
Meghan Denny
1eb5ecb563 ci: fix setInterval.test.js on windows (#13213) 2024-08-10 00:53:23 -07:00
Meghan Denny
6661ab6022 console: implement cutoff for large arrays (#13220) 2024-08-10 00:53:02 -07:00
dave caruso
23aa4f2959 fix(bundler): tagged templates can never be moved (#13193) 2024-08-09 19:32:23 -07:00
Dylan Conway
9302b42919 revert 84c91bf7e1 (#13214) 2024-08-09 19:28:08 -07:00
Ciro Spaciari
b9ead441c1 fix(sockets) add socket wrapper and refactor context ownership handling in socket.zig (#13176) 2024-08-09 18:34:17 -07:00
Ciro Spaciari
24dbef7713 fix(server) fix flushing (#13207) 2024-08-09 18:20:04 -07:00
Ciro Spaciari
28c40babd2 fix(ws) fix handling of messages (#13210)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-09 16:27:29 -07:00
Jarred Sumner
35465d3a29 Set -ffile-prefix-map (#13190) 2024-08-09 14:36:44 -07:00
Jarred Sumner
7aaf935711 Handle OOM better (#13142) 2024-08-09 00:43:54 -07:00
Dylan Conway
bfca627dfa fix node:vm and DOMJIT (#13185) 2024-08-09 00:33:49 -07:00
Jarred Sumner
22e37a5c8d Add more debug exception checks (#13188) 2024-08-08 22:49:26 -07:00
Jarred Sumner
960514364e Bump 2024-08-08 22:02:31 -07:00
Jarred Sumner
98078e7639 Fix leak when throwing exception in Response constructor (#13186) 2024-08-08 21:48:17 -07:00
Jarred Sumner
62d973f19f throw("Out of memory") -> throwOutOfMemory() (#13182) 2024-08-08 20:53:43 -07:00
Jarred Sumner
5cbb6926f5 Add test for file descriptor leaks in FileSink (#13181) 2024-08-08 18:33:41 -07:00
Ciro Spaciari
077ee55211 fix fast shutdown (#13156) 2024-08-08 15:54:54 -07:00
Jarred Sumner
adb31c0752 Fixes #12881 2024-08-08 15:01:55 -07:00
Meghan Denny
ab55477c2d vscode/launch.json: audit and tidy (#13162) 2024-08-08 14:27:36 -07:00
Meghan Denny
ef23b8e60c package.json: add build:windows:release script (#13163) 2024-08-08 14:27:01 -07:00
Jarred Sumner
e6528f81c9 Update stale.yaml 2024-08-08 13:27:18 -07:00
Jarred Sumner
1481cc2730 Update stale.yaml 2024-08-08 13:24:46 -07:00
Jarred Sumner
e6c87bddee Update stale.yaml 2024-08-08 13:20:31 -07:00
Jarred Sumner
f7b2e2a795 Add stale label 2024-08-08 13:18:21 -07:00
huseeiin
3aaa240233 Add bytes() to Blob (#13166) 2024-08-08 10:23:08 -07:00
Meghan Denny
9d74b5bdc8 crash_handler: support printing windows version (#13157) 2024-08-07 21:34:07 -07:00
Ashcon Partovi
d74a192345 Fix submodules script 2024-08-07 14:03:20 -07:00
Ashcon Partovi
76a3dc268d Skip canary release on release build 2024-08-07 13:56:46 -07:00
Ashcon Partovi
d2c821bbf6 Potential fix for dependencies script 2024-08-07 13:54:06 -07:00
Ashcon Partovi
ff334da585 Rebuild dependencies if release build 2024-08-07 13:46:41 -07:00
huseeiin
d96629e053 Better MDN reference (#13144) 2024-08-07 13:22:41 -07:00
Ciro Spaciari
c527058f14 implement NODE_EXTRA_CA_CERTS (#13150) 2024-08-07 13:21:52 -07:00
Ciro Spaciari
3efd445084 refactor(fetch) make handshake less confuse (#13145) 2024-08-07 13:20:05 -07:00
Ashcon Partovi
84c91bf7e1 Revert TextDecoderStream until next release (#13151) 2024-08-07 12:34:04 -07:00
Dylan Conway
9f7c6e34cb Add TextDecoderStream, TextEncoderStream, and TextDecoder.decode("", { stream: true}) (#13115) 2024-08-07 02:36:29 -07:00
Meghan Denny
d44969769f darwin: implement node:os.freemem() (#12870) 2024-08-07 02:31:45 -07:00
Meghan Denny
ff0f9d5f4d node:worker_threads: fix assertion when require is used with 'eval:true' (#13108) 2024-08-07 02:30:40 -07:00
Meghan Denny
c63c55cbb1 node:fs: fix assertion when chown is passed non-numbers (#13113) 2024-08-07 02:29:50 -07:00
Meghan Denny
6d09772a13 ci: build windows in ReleaseSafe (#13140) 2024-08-07 02:24:54 -07:00
Jarred Sumner
df33f2b2a2 Make getIfPropertyExists binding safer (#13134) 2024-08-06 19:23:01 -07:00
Ashcon Partovi
923303047f Fix S3 upload URL for canary assets 2024-08-06 18:51:06 -07:00
Jarred Sumner
3876ecfde8 Add test for calling websocket server publish/send methods repeatedly on closed sockets (#13131) 2024-08-06 16:22:21 -07:00
dave caruso
2680deb5d3 feat: bun build --compile --sourcemap (#13047) 2024-08-06 13:51:11 -07:00
Jarred Sumner
e1aadd0d7a Fix missing user-provided reason in fs.watch abort (#13118) 2024-08-06 00:37:17 -07:00
Jarred Sumner
7a6efad44e Skip creating JSValue for abort when it's not necessary in more cases (#13117) 2024-08-06 00:37:03 -07:00
dave caruso
4ed0c36063 fix(bundler): handle assigning to exports (#13119) 2024-08-06 00:33:32 -07:00
Meghan Denny
b75c605a75 node:http: fix assertion when request() is given options.headers thats non-object (#13112) 2024-08-05 23:54:51 -07:00
Jarred Sumner
7da9e7c45d Add test to #13082 and use WTF_MAKE_FAST_ALLOCATED (#13105)
Co-authored-by: FuPeiJiang <42662615+FuPeiJiang@users.noreply.github.com>
2024-08-05 22:07:49 -07:00
dave caruso
30d06dec47 fix(bundler): use visited enum value (#13101) 2024-08-05 18:35:04 -07:00
Ashcon Partovi
3674493aa4 Potential fix for canary artifacts missing 2024-08-05 17:49:12 -07:00
Jarred Sumner
cacbaba524 Make signal.abort() from native code fast (#13064) 2024-08-05 15:50:36 -07:00
Jarred Sumner
0d7d789ebd Implement aborted() in node:util and getEventListeners in node:events (#13100) 2024-08-05 15:47:52 -07:00
Jarred Sumner
1aa35089d6 Enable more sanitizers and fix mimalloc debug configuration (#13086) 2024-08-04 21:25:00 -07:00
Jarred Sumner
1de1745085 Bump LLVM 18 in C++ lint 2024-08-04 21:24:31 -07:00
Jarred Sumner
639e9a83d5 Add nullability annotations (#13048) 2024-08-04 21:16:41 -07:00
Jarred Sumner
9db3379cc5 Fix missing source code preview in Next.js dev server (#13073) 2024-08-04 20:13:27 -07:00
Jarred Sumner
c5c55c7ce4 Fixes #13049 (#13069) 2024-08-04 19:50:53 -07:00
Jarred Sumner
43326b0b2d Fixes #12894 (#13067) 2024-08-04 19:49:49 -07:00
Jarred Sumner
680f842948 Fix missing error log in Bun.serve (#13066) 2024-08-04 17:54:43 -07:00
Ciro Spaciari
363a4934d0 fix(server) (#13078) 2024-08-04 17:34:31 -07:00
Andrew Johnston
98f9e276b0 fix(build): retry webkit download on failure, resume download with curl (#13061)
Co-authored-by: Andrew Johnston <andrew@bun.sh>
2024-08-04 09:00:00 -07:00
guest271314
ce1286efef Try to fix formatting in rendered guides document (#13077) 2024-08-04 08:59:00 -07:00
guest271314
fd84ace83b Document Bun supports Import Attributes and JSON modules syntax (#13074) 2024-08-04 07:44:38 -07:00
Andrew Johnston
483af7c33c fix (worker-eval): fail worker with source when eval = false (#13062)
Co-authored-by: Andrew Johnston <andrew@bun.sh>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-03 23:49:36 -07:00
Meghan Denny
6fbe3d8214 properly propogate exit code if process onexit handler throws (#13058) 2024-08-03 16:29:52 -07:00
Ciro Spaciari
c552cb40d1 fix(server/tls/streams) fix onReadFile, streams, avoid shutdown on fatal errors, ensure ssl loop data and server ref count refactor (#12979) 2024-08-03 01:41:18 -07:00
Jarred Sumner
63cf732ab4 Support async iterators in fs.promises.writeFile (#13044) 2024-08-02 23:05:48 -07:00
Dylan Conway
6303af3ce0 fix(TextDecoder): decoding sequences starting with 192 or 193 (#13043) 2024-08-02 23:01:34 -07:00
Ashcon Partovi
9104bd7210 Fix debug builds on macOS 2024-08-02 13:02:14 -07:00
Jarred Sumner
b5c91a4b7e Upgrade WebKit (#12873)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-08-02 04:58:31 -07:00
Jarred Sumner
82239371ab Enable -Werror=int-conversion and -Werror=nonnull (#13025) 2024-08-02 01:59:08 -07:00
Jarred Sumner
26526cba38 Fix UDP socket tests on macOS 13. (#13022) 2024-08-02 00:21:57 -07:00
Jarred Sumner
214b3ccca0 Make zig cache dir relative to the cmake dir instead of global 2024-08-01 21:04:52 -07:00
dave caruso
ada020b69f fix(bundler): printing e_commonjs_export_identifier when it got deoptimized. (#13017) 2024-08-01 21:02:54 -07:00
Ashcon Partovi
deb6ff5e6c Fix typo 2024-08-01 18:30:14 -07:00
Ashcon Partovi
f25599a6e8 Fix LTO setting on Linux 2024-08-01 18:29:06 -07:00
Ashcon Partovi
de64683b22 Fix ccache environment variable 2024-08-01 18:22:52 -07:00
Ashcon Partovi
c6d508972f Deflake some build issues
* Disable sccache on Windows
* Add workaround for EBUSY/UNKNOWN spawn errors
2024-08-01 18:20:20 -07:00
Jarred Sumner
2f30e19835 Disable LTO on Windows and macOS in BuildKite 2024-08-01 18:04:25 -07:00
Meghan Denny
0081ab4738 ci: disable BUN_ENABLE_CRASH_REPORTING (#13013) 2024-08-01 17:49:43 -07:00
Jarred Sumner
6f6ea0d6f3 Add -Xclang -fno-c++-static-destructors on Windows (#13014) 2024-08-01 17:49:01 -07:00
dave caruso
622432e843 feat(bundler): inlining/dead-code-elimination for import.meta.main (and --compile) (#12867)
Co-authored-by: Meghan Denny <meghan@bun.sh>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Andrew Johnston <apjohnsto@gmail.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2024-08-01 17:25:38 -07:00
dave caruso
80eb6d00e8 followup to recent feedback (#13009) 2024-08-01 17:21:24 -07:00
Meghan Denny
b6715d2c64 test/package-json-lint.test.ts: add back test/package.json to suite (#13011) 2024-08-01 16:56:29 -07:00
Meghan Denny
f371a78568 fix test/package-json-lint.test.ts (#13010) 2024-08-01 16:47:53 -07:00
dave caruso
c2cf528953 bundler: Add --ignore-dce-annotations, and other DCE annotation related stuff (#12808)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-01 15:00:38 -07:00
Jarred Sumner
9911407f26 Sort heapStats() object type counts (#12989) 2024-08-01 14:09:54 -07:00
Jarred Sumner
59c5c0fe48 Fix memory leak when requiring or importing modules that get GC'd later (#12997) 2024-08-01 12:05:37 -07:00
dave caruso
e585f900c9 escape windows in bun upgrade (#12985) 2024-08-01 01:04:20 -07:00
Jarred Sumner
dc620ea837 Fix a small memory leak when requiring CommonJS modules (#12984) 2024-07-31 22:30:01 -07:00
Jarred Sumner
49ab4c147a Shrink the list of setTimeout/setInterval timers after awhile (#12957) 2024-07-31 20:50:34 -07:00
Ciro Spaciari
b2a4df68c3 fix(server) fix extra data sent in HTTP after sendfile + Date headers (#12978)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-31 20:22:52 -07:00
Jarred Sumner
4c0a1f2983 Add a note 2024-07-31 18:38:19 -07:00
Ciro Spaciari
bec04c7341 change Body.Value.Error to not always allocate JSValues (#12955)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-31 02:26:14 -07:00
Jarred Sumner
a44b7e41d2 Pass --force to git submodule update in CI 2024-07-30 23:03:35 -07:00
Jarred Sumner
de5e56336c Use example.com as the test domain in a test 2024-07-30 22:44:47 -07:00
Ciro Spaciari
1c648063fa fix(tls/socket/fetch) shutdown fix + ref counted context (#12925)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-30 22:41:54 -07:00
Jarred Sumner
1c3354bc95 Deflake setInterval test 2024-07-30 22:33:04 -07:00
dave caruso
d5d4f53e82 fix(bundler): put unwrapped cjs imports at top level for minifyrenamer (#12951) 2024-07-30 21:30:09 -07:00
Pipythonmc
7ab4dc738f doc: fix incorrect documentation relating to the --define flag (#12952) 2024-07-30 19:17:32 -07:00
dave caruso
ebc7045ca4 fix crash handler test failures (#12932) 2024-07-30 16:52:59 -07:00
Ashcon Partovi
848ad19d9e Attempt to fix flaky Windows builds 2024-07-30 10:55:13 -07:00
Ashcon Partovi
1da3436266 Attempt to fix flaky build-deps on Windows 2024-07-30 10:48:24 -07:00
Ashcon Partovi
49e496399a Attempt to fix missing GitHub assets on release 2024-07-30 10:44:44 -07:00
Ashcon Partovi
9b8340a5b3 Attempt to fix 'spawn error' on Windows tests 2024-07-29 19:16:29 -07:00
Meghan Denny
8efcc61a7b windows: cleanup logging of NODE_CHANNEL_FD (#12930) 2024-07-29 19:16:02 -07:00
Meghan Denny
4d6480050c NodeError: add more and use them in child_process and dgram (#12929) 2024-07-29 19:15:23 -07:00
Meghan Denny
fc2c134bc6 test: rewrite "should call close" to use promise instead of done (#12931) 2024-07-29 19:05:44 -07:00
m1212e
4c4db1da37 docs: Add hint for memory timeline in debugger (#12923) 2024-07-29 19:05:13 -07:00
dave caruso
77e14c8482 fix template addition folding 12904 (#12928) 2024-07-29 19:04:59 -07:00
Ashcon Partovi
fba5d65003 Make the release script faster 2024-07-29 17:38:06 -07:00
Jarred Sumner
c181cf45a7 Fixes #12910 (#12911) 2024-07-29 17:19:47 -07:00
Ashcon Partovi
5aeb4d9f79 Fix missing assert in release script 2024-07-29 16:57:22 -07:00
Dariush Alipour
1d9a8b4134 fix: child_process test with specified shell for windows (#12926) 2024-07-29 16:36:46 -07:00
Ashcon Partovi
30881444df Fix flaky C++ build with missing submodules 2024-07-29 16:34:01 -07:00
Ashcon Partovi
a2b4e3d4c2 Fix syntax in env.ps1 2024-07-29 16:25:50 -07:00
Ashcon Partovi
e5662caa33 Fix release script, again 2024-07-29 16:21:55 -07:00
Ashcon Partovi
1f1ea7bf24 Fix release script 2024-07-29 15:29:46 -07:00
Ashcon Partovi
175746e569 Only upload canary artifacts when the build is canary 2024-07-29 14:54:29 -07:00
Ashcon Partovi
005dd776b6 Allow creating release builds with 'RELEASE=1' 2024-07-29 14:50:26 -07:00
Ashcon Partovi
81dec2657f Enable buildkite (#12653) 2024-07-29 14:39:50 -07:00
Jarred Sumner
dbd320ccfa Remove some dynamic memory allocations in uWebSockets (#12897) 2024-07-29 15:10:55 -03:00
Jarred Sumner
8f8d3968a3 Enable concurrent transpiler on Windows (#12915) 2024-07-29 06:25:38 -07:00
Jarred Sumner
0bbdd880e6 Fix various Windows build issues 2024-07-29 04:31:39 -07:00
Jarred Sumner
51257d5668 Add BUN_FEATURE_FLAG_DISABLE_ASYNC_TRANSPILER feature flag 2024-07-29 01:37:59 -07:00
Jarred Sumner
a2ae28d158 Add named allocator 2024-07-28 21:27:08 -07:00
Jarred Sumner
f04991f6bb Fix debug build issue 2024-07-28 19:38:03 -07:00
Andrew Johnston
80e651aca3 fix(build): use specific version of lld for link on unix (#12907) 2024-07-28 18:38:01 -07:00
Jarred Sumner
a5ba02804f Use typed allocators in more places (#12899) 2024-07-28 18:37:35 -07:00
Jarred Sumner
4199fd4515 Fix memory leak in RuntimeTranspilerStore (#12900) 2024-07-28 08:30:32 -07:00
Dylan Conway
848327d333 textencoder: remove DOMJIT (#12868) 2024-07-28 07:46:53 -07:00
Jarred Sumner
bfb72f84c4 In debug builds on macOS, add malloc_zone_check when GC runs 2024-07-28 05:13:50 -07:00
Jarred Sumner
e4022ec3c7 Bump versions of things 2024-07-27 02:02:48 -07:00
Jarred Sumner
a7f34c15fc Slightly better error.stack (#12861) 2024-07-27 01:02:46 -07:00
Meghan Denny
a0ebb051b0 implement node:util.getSystemErrorName() (#12837) 2024-07-27 00:20:50 -07:00
dave caruso
70ca2b76c3 fix: check if we are crashing before exiting gracefully (#12865) 2024-07-26 20:00:02 -07:00
Jarred Sumner
e5ac4f94fa Handle errors in node:http better (#12641)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-26 19:53:36 -07:00
dave caruso
d547d8a30e fix a bundler crash (#12864)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
2024-07-26 19:39:37 -07:00
Meghan Denny
32d9bb3ced ci: format: switch to mlugg/setup-zig (#12863) 2024-07-26 18:47:02 -07:00
dave caruso
75df73ef90 fix: make raiseIgnoringPanicHandler ignore the panic handler (#12578)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-26 18:36:53 -07:00
Dylan Conway
13907c4c29 fix(build): assertion failure when cross-compiling on windows (#12862)
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-07-26 17:29:01 -07:00
Jarred Sumner
87169b6bb3 Configure libcpp assert to avoid macOS 13.0 issue (#12860) 2024-07-26 16:03:16 -07:00
Jarred Sumner
244100c32f When crash reporter is disabled also disable resetSegfaultHanlder 2024-07-26 14:50:56 -07:00
Jarred Sumner
8a78b2241d Rename JSC.Node.StringOrBuffer -> StringOrBuffer 2024-07-26 14:50:30 -07:00
dave caruso
bf8b6922bb Fix memory leak when printing any error's source code. (#12831)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-26 14:14:16 -07:00
Dylan Conway
7aa05ec542 bump webkit (#12858)
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-07-26 14:13:58 -07:00
Meghan Denny
f95ae9baee launch.json: remove BUN_DEBUG_ALL=1 from 'bun run' (#12845) 2024-07-26 04:14:45 -07:00
Meghan Denny
f7cb2da542 use .undefined literal instead of jsUndefined() call (#12834) 2024-07-26 04:03:55 -07:00
Meghan Denny
d966129992 bindings: better use of jsc api in Path_functionToNamespacedPath (#12836) 2024-07-26 04:02:31 -07:00
Meghan Denny
6cb5cd2a87 node:v8: expose DefaultDeserializer and DefaultSerializer exports (#12838) 2024-07-26 03:58:47 -07:00
Meghan Denny
080a2806af uws: tidy use of ssl intFromBool (#12839) 2024-07-26 03:58:01 -07:00
Meghan Denny
92c83fcd9e ipc: make IPCInstance.context void on windows instead of u0 (#12840) 2024-07-26 03:56:13 -07:00
Meghan Denny
277ed9d138 bindings: fix zig extern def of Bun__JSValue__deserialize (#12844) 2024-07-26 03:48:30 -07:00
Meghan Denny
879cb23163 cpp: missing uses of propertyNames (#12835) 2024-07-26 03:47:41 -07:00
Jarred Sumner
d321ee97c5 Move napi_new_instance to c++ (#12658)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-07-25 18:51:01 -07:00
Jarred Sumner
3bfeb83e7e Fix [Symbol.dispose] on Bun.listen() & Bun.connect() + add types (#12739)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-07-25 18:49:35 -07:00
Meghan Denny
5a18b7d2fc fixes relationship between process.kill and process._kill (#12792)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-25 18:46:30 -07:00
Gert Goet
e75ef69fb4 Fix spacing of patch-command help (#12769) 2024-07-25 18:44:52 -07:00
Dylan Conway
78021e34ae fix(bun:test): make sure test.each doesn't return .zero (#12828) 2024-07-25 18:24:16 -07:00
Dylan Conway
d7187592c0 fix(brotli): protect and unprotect buffer values (#12829) 2024-07-25 18:24:01 -07:00
Jarred Sumner
5f1b569c52 Fix crash when creating a new Worker with a numeric environment varia… (#12810) 2024-07-25 18:10:57 -07:00
dave caruso
e54fe5995b fix(bundler): dont tree-shake imported enum if inlined and used (#12826) 2024-07-25 17:29:20 -07:00
Jarred Sumner
a2f68989a0 Retry on 5xx errors from npm registry (#12825) 2024-07-25 17:28:59 -07:00
Jarred Sumner
4a1e01d076 Use bun.New more (#12811)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-07-25 15:35:02 -07:00
Jarred Sumner
dd8b0a5889 Clean up socket_async_http_abort_tracker after a lot of requests (#12816) 2024-07-25 15:34:48 -07:00
Jarred Sumner
8cadf66143 Add malloc zones to heapStats() on macOS in debug builds (#12815) 2024-07-25 15:33:43 -07:00
Jarred Sumner
77cd03dad1 Workaround for BUN-2WQ (#12806) 2024-07-25 15:33:17 -07:00
Meghan Denny
82b42ed851 node: more process.exitCode fixes (#12809) 2024-07-25 15:18:41 -07:00
Dylan Conway
2de82c0b3b fix regression test 2024-07-25 14:07:57 -07:00
Jarred Sumner
30df04cd35 Add a couple feature flags 2024-07-25 05:52:50 -07:00
Jarred Sumner
585c8299d8 Clean up some stack trace printing logic (#12791) 2024-07-25 04:04:02 -07:00
Dylan Conway
375d8da8e6 fix(brotli): protect buffer jsvalues (#12800)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-25 04:01:53 -07:00
Jarred Sumner
0bd8db7162 Slightly reduce pointer lookups in hot code path (#12802) 2024-07-24 23:07:51 -07:00
Meghan Denny
d97260869d replace JSValue .callWithThis with always explicit .call (#12789) 2024-07-24 23:07:28 -07:00
Jarred Sumner
fdb58dc861 Fixes #9555 (#12801) 2024-07-24 23:07:04 -07:00
Meghan Denny
5f118704ec web-apis.md: make this list diff better; does not change presentation (#12795) 2024-07-24 22:27:32 -07:00
dave caruso
610c7f5e47 fix memory lifetime of define expressions (#12784) 2024-07-24 22:27:14 -07:00
Meghan Denny
1e0b20f514 node: fix observable value of process.exitCode (#12799) 2024-07-24 22:26:07 -07:00
Meghan Denny
f6c89f4c25 JSValue.toFmt doesn't need a globalThis param because ConsoleObject.Formatter already has one (#12790) 2024-07-24 22:03:51 -07:00
Meghan Denny
907cd8d45d fix crash in populateStackTrace() (#12793) 2024-07-24 21:08:25 -07:00
Dylan Conway
ac4523e903 fix(napi): unref threadsafe functions on finalize (#12788) 2024-07-24 18:57:01 -07:00
Jarred Sumner
24574dddb2 Ensure LLVM 18 with Homebrew on macOS 2024-07-24 15:56:05 -07:00
Dylan Conway
2da57f6d7b napi_threadsafe_function async tracker (#12780) 2024-07-24 15:27:51 -07:00
dave caruso
e2c3749965 fix(bundler): become smarter with __esm wrappers (#12729) 2024-07-24 02:00:20 -07:00
Jarred Sumner
57c6a7db35 libdeflate (#12741) 2024-07-24 01:30:31 -07:00
ippsav
c37891471a Fix alignment calculation in Zone.create function (#12748) 2024-07-24 01:30:11 -07:00
Jarred Sumner
8ba0791dc8 Use one JSC::SourceProvider instead of 322 (#12761) 2024-07-24 01:26:09 -07:00
dave caruso
f9371e59f2 fix(bundler): fix part liveness calculation (#12758) 2024-07-23 23:49:01 -07:00
Jarred Sumner
79ddf0e47a Fix assertion failure in bun build when entry point is a file loader (#12683)
Co-authored-by: dave caruso <me@paperdave.net>
2024-07-23 22:02:51 -07:00
David Stevens
177f3a8622 Fixes #12182 - update default port when server is created (#12201) 2024-07-23 11:07:38 -07:00
Ciro Spaciari
5a5f3d6b30 fix(http) timeout (#12728)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-23 01:13:43 -07:00
Ivan Baksheev
4e5d759c37 fix(bundler): ignore external rules for entrypoint (#12736) 2024-07-23 00:33:18 -07:00
Jarred Sumner
1a702dfdc7 Add canary to cache key 2024-07-22 22:16:27 -07:00
Jarred Sumner
3ef84816a6 Update WebKit 2024-07-22 20:47:53 -07:00
Jarred Sumner
6e9b592c56 try using LLVM 18 on macOS (#12727)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-22 20:44:29 -07:00
Jarred Sumner
a6b5543bd8 Don't set fuse-ld=lld in boringssl script 2024-07-22 15:41:41 -07:00
Jarred Sumner
a4759eb147 Bump minimum macOS build to 13.0 2024-07-22 14:50:23 -07:00
Dariush Alipour
732ed2b7df Fix: test coverage node_modules exclusion in Windows (#12691) 2024-07-22 13:25:42 -07:00
Jarred Sumner
63fab9a82b Update fetch.md 2024-07-22 04:06:00 -07:00
Jarred Sumner
ff17b427c8 Update fetch.md 2024-07-22 04:02:48 -07:00
Jarred Sumner
ca44df7c88 Update fetch.md 2024-07-22 03:57:29 -07:00
huseeiin
9daa7ea555 Update bun.d.ts (#12719) 2024-07-22 03:55:14 -07:00
Jarred Sumner
2f0020f00f Update fetch.md 2024-07-22 03:52:33 -07:00
Jarred Sumner
599d27d93e Update fetch.md 2024-07-22 03:50:22 -07:00
Jarred Sumner
696f209ec1 Update fetch.md 2024-07-22 03:49:32 -07:00
Jarred Sumner
1a6ead667b Introduce bun --fetch-preconnect <url> ./my-script.ts (#12698) 2024-07-22 03:41:59 -07:00
Jarred Sumner
bbf2f5d716 Experiment: disable C++ static destructors (#12652)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-21 21:32:52 -07:00
ippsav
9574044083 Fix expect.toThrow(expect.any()) matcher to correctly handle ExpectAny objects (#12670) 2024-07-21 20:35:18 -07:00
Jarred Sumner
822b725bec Fix BUN-2M9, take two 2024-07-21 08:49:00 -07:00
Jarred Sumner
dc775f75f0 Fix BUN-2M9 2024-07-21 07:40:57 -07:00
Jarred Sumner
738947bdec Deflake node-tls-connect test 2024-07-20 02:36:08 -07:00
Jarred Sumner
b7efeafc03 Deflake node-tls-connect test 2024-07-19 23:42:23 -07:00
Jarred Sumner
f5d1a17a5c Fix crash in bun exec cd (#12676)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-19 22:57:52 -07:00
Jarred Sumner
03024e6b4e Fix truncating in BigIntStats (#12643)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-19 20:00:32 -07:00
Jarred Sumner
1d61676c7b Check for file or directory 2024-07-18 13:56:21 -07:00
Jarred Sumner
23fb63f45c Fixes #12360 (#12364) 2024-07-18 09:10:15 -07:00
Jarred Sumner
0be71edf3f Upload .dSYM file 2024-07-18 03:19:48 -07:00
Jarred Sumner
6b50deb7b7 Move dev dependencies to "devDependencies"
Spammy vulnerability scanning software can't tell we aren't using these in the "bun" npm package.
2024-07-18 01:13:36 -07:00
Jarred Sumner
6ad3e6a5e3 Fixes #2532 (#12633)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-17 20:53:12 -07:00
HibanaSama
b1dce1e241 build(windows): fix esbuild errors when bundling node-fallbacks (#12628) 2024-07-17 19:40:25 -07:00
Jarred Sumner
cc42052039 node-fetch polyfill shouldn't break when web globals are overriden (#12634) 2024-07-17 18:57:03 -07:00
Jarred Sumner
ecf5aea071 Ensure undici primordials are pristine (#12635) 2024-07-17 18:56:22 -07:00
Jarred Sumner
79d21a0d02 Bump internal bun versions 2024-07-17 17:21:14 -07:00
dave caruso
43949151b1 fix(bundler): importing modules with trailing slash no longer uses a builtin (#12632) 2024-07-17 17:17:00 -07:00
Ciro Spaciari
16aad326e4 fix(setSystemTime) fix number parameter behavior (#12630)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-07-17 17:09:24 -07:00
Jarred Sumner
1a6f2d38da Github actions 2024-07-17 03:31:12 -07:00
Jarred Sumner
c6149d36b3 Bump 2024-07-17 02:40:42 -07:00
Jarred Sumner
34e493f945 Experiment: disable -fPIC and relro (#12582)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-17 02:33:46 -07:00
dave caruso
866b301626 bundler: make import() calls visit the options object (#12617) 2024-07-16 23:21:34 -07:00
dave caruso
cabc0fa0e6 fix typescript namespace merging with functions and classes (#12610) 2024-07-16 19:39:27 -07:00
HibanaSama
d703354fcd docs: close details block (#12533) 2024-07-16 17:50:47 -07:00
Ciro Spaciari
37036f2eb0 fix(serve) fix abrupt close when downloading data (#12581)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
2024-07-16 16:39:37 -07:00
190n
ff0dc62314 Accept undefined as explicit second argument for path.*.basename (#12609) 2024-07-16 16:37:21 -07:00
Ciro Spaciari
f05f13780e fix(CryptoHasher) check of .empty/null/undefined in update (#12607)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
2024-07-16 16:33:35 -07:00
190n
4d74855fd7 Prevent unref from hanging on uninitialized dgram socket (#12585)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-16 16:31:07 -07:00
Jarred Sumner
5088a360b5 Avoid stale reference to Body.Value when erroring (#12579) 2024-07-16 12:33:19 -07:00
dave caruso
891b1907ae feat(bundler): implement non-isolated hashes (#12576) 2024-07-15 20:34:15 -07:00
dave caruso
ae988642fb fix .use_count integer underflow (#12584) 2024-07-15 18:36:42 -07:00
190n
75e442c170 Change .mjs to .mts during TypeScript module resolution (fixes #12471) (#12580) 2024-07-15 18:12:18 -07:00
Jarred Sumner
8808af1c99 Replace some Identifier::fromString usages with vm->propertyNames (#12575) 2024-07-15 16:15:56 -07:00
Jarred Sumner
b9d2a03ffc Make creating a BufferList (used in node:stream) slightly faster (#12577) 2024-07-15 16:15:10 -07:00
Jarred Sumner
157b56cca5 Update launch.json 2024-07-15 15:12:57 -07:00
Eric L. Goldstein
caaeae123a Add documentation for mock.restore() (#12553) 2024-07-14 21:20:33 -07:00
Ivan Baksheev
20235a0d22 Add packages option to remove all dependencies from bundle (#12562) 2024-07-14 15:20:27 -07:00
Dylan Conway
ae19489250 bump 2024-07-12 19:45:10 -07:00
Dylan Conway
242c48f302 bump 2024-07-12 19:42:18 -07:00
dave caruso
110849355c make the windows binary smaller (#12523)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-12 00:20:28 -07:00
Jarred Sumner
36fd3115f1 Try icf=safe (#12524) 2024-07-11 22:37:04 -07:00
Jarred Sumner
7d9b876968 Use armv8a+crc 2024-07-11 20:59:37 -07:00
Jarred Sumner
40f0da1254 Use armv8-a 2024-07-11 20:30:21 -07:00
Jarred Sumner
aea3964abd Set -march instead of -mcpu 2024-07-11 20:14:43 -07:00
Jarred Sumner
780bff781d Set the cpu model in the right place 2024-07-11 19:00:06 -07:00
Jarred Sumner
c6a2ab5165 Revert "Don't set mtune"
This reverts commit ef1c660708.
2024-07-11 18:58:24 -07:00
Jarred Sumner
ef1c660708 Don't set mtune 2024-07-11 18:40:52 -07:00
Ciro Spaciari
11f8d3cb24 fix(server) fix abrupt stop (#12472)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
2024-07-11 18:22:23 -07:00
dave caruso
3ac9c3cc1c make bun static link the c redistributable (#12521)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
2024-07-11 17:35:35 -07:00
Jarred Sumner
aa0f54cb93 Fixes #12076 (#12504) 2024-07-11 16:59:14 -07:00
huseeiin
8a3f882ef7 Update README.md (#12512) 2024-07-11 07:24:13 -07:00
Jarred Sumner
b7dd57ac32 Fix zig build error on Windows 2024-07-11 00:08:05 -07:00
Jarred Sumner
cf1c7772f3 See if .dSYM will upload (#12502) 2024-07-10 23:53:17 -07:00
Jarred Sumner
329d5e2af5 Disable this debug log 2024-07-10 23:25:55 -07:00
Jarred Sumner
0098678a1d Upload .dSYM file in CI 2024-07-10 23:04:06 -07:00
Jarred Sumner
bf4c2caa11 Bump 2024-07-10 22:48:28 -07:00
Jarred Sumner
226f42e04a Rewrite js_ast.NewBaseStore (#12388)
Co-authored-by: dave caruso <me@paperdave.net>
2024-07-10 21:57:40 -07:00
Ciro Spaciari
96d19fcfe2 fix(fetch.tls.test) make test more reliable (#12499) 2024-07-10 21:52:34 -07:00
Dylan Conway
58483426cd fix(install): call GetFinalPathNameByHandle on cwd for postinstall scripts (#12497) 2024-07-10 21:09:14 -07:00
Dylan Conway
25f7ef7338 Revert "Nest test results under describe scopes (#12189)"
This reverts commit 6a43f7f52d.
2024-07-10 21:05:47 -07:00
Jarred Sumner
412806bb22 Make expect().toThrow faster (#12494) 2024-07-10 20:46:29 -07:00
Ciro Spaciari
4c87406391 fix(ssl) fix ssl shutdown (#12492)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-10 20:29:54 -07:00
Dylan Conway
5f7b96b58f fix(install): optional peer dependency bugfix (#12485)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-07-10 20:04:32 -07:00
Jarred Sumner
f1151a84ad On Windows, fix fs.writeFile(1, fs.writeFile(2, fs.writeFile(\\nul (#12410)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-07-10 19:49:36 -07:00
Zack Radisic
cdc68a2237 .npmrc follow up (#12390)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-07-10 19:35:21 -07:00
Jarred Sumner
e866793eb3 Fix Windows assertion failures 2024-07-10 18:08:04 -07:00
Dylan Conway
cf9c418bcb revert 2024-07-10 17:22:16 -07:00
Jarred Sumner
138ef1328e webcrypto tests are slow 2024-07-10 17:18:39 -07:00
Dylan Conway
e5e6d7ca43 comma 2024-07-10 17:03:19 -07:00
Jarred Sumner
cb81fc5445 Make ${encoding}Slice & ${encoding}Write work on Uint8Array (#12491) 2024-07-10 16:58:01 -07:00
Dylan Conway
d8caf7f9fa install all at once 2024-07-10 16:48:40 -07:00
Dylan Conway
6f8ceb0ea9 windows: bump llvm to 18.1.8 (#12490) 2024-07-10 16:45:54 -07:00
dave caruso
02b589b2ce fix a crash in remapping stacks (#12477)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-10 16:39:05 -07:00
Jarred Sumner
55d59ebf1f Try disabling the vs2022 build tools workaround 2024-07-10 02:01:29 -07:00
Jarred Sumner
e1bc6c55d5 Speculative fix for crash in visitChildren in BufferList (#12427) 2024-07-10 01:44:52 -07:00
Dylan Conway
e42dede529 upgrade webkit (#12474)
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-07-10 01:38:26 -07:00
arnab
73ef93ffa3 Fix spelling - following (#12479) 2024-07-09 23:35:06 -07:00
Derrick Farris
475f71a2a1 fix(jest): beforeEach, afterEach not called for test.todo (#12406) 2024-07-09 23:15:27 -07:00
Ciro Spaciari
af6035ce36 fix(server) wait for readFile on abort/process exit cases (#12441)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-09 22:38:32 -07:00
Jarred Sumner
bfa395d1d5 Warn when installing a global binary and global bin is not in path (#12454) 2024-07-09 22:32:56 -07:00
Jarred Sumner
76bb5b8619 Set __DARWIN_NON_CANCELABLE (#12354)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-09 17:48:31 -07:00
Imgodmaoyouknow
6354e608a7 chore(docs): fix wrongly written at binary-data.md (#12451) 2024-07-09 17:39:01 -07:00
Le Michel
28d9527189 Update cache.md (#12231) 2024-07-09 17:26:18 -07:00
Victor Homyakov
fbcd843c58 Make JSX in react-hello-world.node.jsx the same as others (#12259) 2024-07-09 17:25:54 -07:00
lmmfranco
6b0c2383d5 Adding proper bash quote escaping on install.sh (#5002)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-09 17:10:43 -07:00
silverwind
f1a748fcab Add -u alias to bun test (#10097)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-09 16:53:35 -07:00
Vladimir Pouzanov
87296405a7 Remove the case-insensitive bit from the docs. (#4858) 2024-07-09 16:47:48 -07:00
张新伟
4dfbabd590 chore(docs): add notes for ubuntu developers (#12296)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-09 16:31:26 -07:00
Jarred Sumner
ea1135a464 [bundows] Skip unnecessary GetFinalPathNameByHandle (#10338)
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-09 16:21:13 -07:00
Dmitrii
f1755df6f0 docs: update drizzle-kit cli command in drizzle.md (#11666) 2024-07-09 16:18:42 -07:00
Bjön Limell
b01f67857f Added missing commands to bun.bash (#7181) 2024-07-09 16:15:34 -07:00
Nikola Ristić
9fe7ea340d Add a note about bun add --exact alias to docs (#6968) 2024-07-09 16:09:24 -07:00
Ivan Baksheev
68ba6b9e79 docs: sync Database.run docs with types (#9993) 2024-07-09 15:47:15 -07:00
patricio
a703d2d019 fix(docs): correct value for BUN_CONFIG_NO_CLEAR_TERMINAL_ON_RELOAD (#9647) 2024-07-09 15:37:45 -07:00
dave caruso
5137213f86 heavy revision on heap_breakdown's safety (#12445) 2024-07-09 14:29:00 -07:00
Danny Lin
c98da7daf7 docs: Simplify Homebrew install command (#4595) 2024-07-09 13:32:30 -07:00
Jarred Sumner
25252c9b46 Use memmove in path handling code (#12413)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-09 11:22:54 -07:00
Imgodmaoyouknow
21ff566d69 chore(docs): fix wrongly written at binary-data.md (#12452) 2024-07-09 01:44:47 -07:00
Dylan Conway
a36a01e235 fix(--watch): ref or create new module specifier strings (#12442) 2024-07-08 19:55:21 -07:00
Jarred Sumner
9ae870546b On Windows, support Bun.stdin, Bun.stdout, Bun.stderr in Bun.write when the other argument is a file (#12411)
Co-authored-by: dave caruso <me@paperdave.net>
2024-07-08 18:03:48 -07:00
Jarred Sumner
a4b0817cd3 Print list of CPU features in crash reports (#12350)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-08 15:08:07 -07:00
Jarred Sumner
c2a5451e93 Fix argument validation with callbacks in node:fs (#12412) 2024-07-07 20:18:07 -07:00
Jarred Sumner
150ae032e8 Flip conditional 2024-07-07 09:47:30 -07:00
Jarred Sumner
37ee951448 Add unusable postgres client behind a canary-or-debug-only feature flag (#11920)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-07 09:43:48 -07:00
Jarred Sumner
b8c70ba6cf Deflake node-tls-connect test 2024-07-07 09:28:53 -07:00
Jarred Sumner
cbcf9506d9 Update CONTRIBUTING.md 2024-07-06 20:36:09 -07:00
Jarred Sumner
92bd629e60 Support promises in profile method in bun:jsc (#12165) 2024-07-06 20:24:21 -07:00
Jarred Sumner
e7031b07ae Fix memory leak in withFileTypes: true in fs.readdir (#12393) 2024-07-06 20:22:55 -07:00
Jarred Sumner
41a5ebe09f Fix memory leak in new Request(request) (#12387) 2024-07-05 22:11:09 -07:00
Jarred Sumner
cd97c21038 Handle OOM in btoa (#12353)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-05 22:02:07 -07:00
dave caruso
57d22908d1 fix(transpiler): Fix non-inlined nested namespaces (#12386) 2024-07-05 21:59:23 -07:00
dave caruso
749c51d71a simpler version of simplifyUnusedExpr rewrite (#12384) 2024-07-05 20:20:45 -07:00
Noah Friedman
80bbad6568 setup-bun action bumped to v2 in docs (#12315) 2024-07-05 18:54:53 -07:00
Jarred Sumner
da1b3d2007 Check that ccache points to a regular file instead of a non-empty string (#12382) 2024-07-05 18:33:00 -07:00
Andrew Johnston
050a4b5c71 fix(formdata): handle file names correctly when setting on formdata (#12379)
Co-authored-by: Andrew Johnston <andrew@bun.sh>
2024-07-05 18:29:12 -07:00
Jarred Sumner
6f52b649da Make debug log more useful 2024-07-05 17:28:48 -07:00
Zach Olivare
bbc621adff docs(argv): Correct cli file name (#12373) 2024-07-05 16:05:12 -07:00
Jarred Sumner
71c223e111 Handle EINTR in usockets (#12357)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-05 15:40:10 -07:00
Jarred Sumner
ee25618197 Use bun.ComptimeStringMap instead of std.StaticStringMap (#12351)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-04 23:05:51 -07:00
Vadzim
4f3ef07455 Fix crash on aborted timer (#12348) 2024-07-04 16:20:59 -07:00
Jarred Sumner
fad58168d2 Configure LTO on Windows (#12290) 2024-07-04 16:20:18 -07:00
Dylan Conway
4fefb8507c respect package.json indentation in bun install (#12328) 2024-07-03 23:10:34 -07:00
Jarred Sumner
39d5c8a8a5 Remove proto installation method from docs
We cannot recommend people install Bun using an installation method that makes Bun take 1 second to print the version number

https://github.com/oven-sh/bun/issues/12294
2024-07-03 20:55:18 -07:00
Jake Boone
6a43f7f52d Nest test results under describe scopes (#12189)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-07-03 20:46:55 -07:00
Jarred Sumner
c486a049a8 Implement buffer.resolveObjectURL (#12324) 2024-07-03 19:17:20 -07:00
Jarred Sumner
5a0b935231 Bump libarchive (#12314)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-03 11:56:17 -07:00
dave caruso
688ddbda74 feat(bundler): implement enum inlining / more constant folding (#12144)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-03 04:23:17 -07:00
Dylan Conway
b9fba61153 fix(install): patching in root package with workspaces (#12313)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-03 03:52:15 -07:00
Jarred Sumner
dfca8147df Bump WebKit submodule (#12310)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-03 03:08:11 -07:00
Umar Faruq Chowdhury
b85c30cd89 Remove unused details section (#12311) 2024-07-03 02:14:56 -07:00
Jarred Sumner
f83e42de20 GitHub actions 2024-07-03 01:46:46 -07:00
Jarred Sumner
927dde7b34 GitHub actions 2024-07-03 01:22:49 -07:00
Jarred Sumner
c85576b15d GitHub actions 2024-07-03 01:21:16 -07:00
Jarred Sumner
db60af1a44 GitHub actions 2024-07-03 01:14:52 -07:00
Jarred Sumner
292035efcb GitHub actions 2024-07-03 01:10:37 -07:00
Jarred Sumner
823d790b1c GitHub actions 2024-07-03 01:07:40 -07:00
Jarred Sumner
5573b2e899 Add comment when updating a submodule 2024-07-03 01:05:49 -07:00
Jarred Sumner
2f0789af7c Always set enable_logs in development 2024-07-01 23:38:03 -07:00
Jarred Sumner
f8e640c018 Remove callconv from a couple functions 2024-07-01 23:35:28 -07:00
Jarred Sumner
b0018465cc WebKit upgrade (#12246)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-07-01 23:27:59 -07:00
Justin Ho
dd057613b9 Update Buffer implementation status in nodejs-apis.md (#12274) 2024-07-01 22:08:09 -07:00
Zack Radisic
bf14a09a23 install: fix issues with patching hoisted dependencies in workspaces (#12141)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-07-01 17:44:18 -07:00
Filip Skokan
81711faebe fix: add Symbol.toStringTag to KeyObject instances (#12278) 2024-07-01 15:13:34 -07:00
Eric L. Goldstein
86fd13643b base64 decode the request body instead of encoding it a second time (#12219) 2024-07-01 11:59:33 -07:00
Zack Radisic
861be5560e Support reading from .npmrc (#11979)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-29 18:11:23 -07:00
Jarred Sumner
7f3e6f23f6 Refactor ZigString -> toJS (#12242) 2024-06-29 00:21:42 -07:00
Jarred Sumner
5f34387bea Fix crash in dns.lookup, ensure getaddrinfo() only returns IPv4-only or IPv6-only results when it should, normalize node:dns errors (#12223) 2024-06-28 18:45:10 -07:00
Zack Radisic
e22383dff9 fix bad test/snapshot in glob/scan.test.ts (#12239)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-28 18:39:53 -07:00
Dylan Conway
c1a5b4acc5 fix napi.test.ts (#12241)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-28 18:38:37 -07:00
Jarred Sumner
61b343cf7d GitHub actions 2024-06-28 18:01:29 -07:00
Jarred Sumner
ec3487867c Update build-windows.yml 2024-06-28 17:42:02 -07:00
Jarred Sumner
3c52344b53 Hardcode this 2024-06-28 17:40:23 -07:00
Jarred Sumner
f37d89afb1 Revert BuildKite for now 2024-06-28 17:38:27 -07:00
Jarred Sumner
a0b5006b78 Re-enable GitHub actions CI (#12240) 2024-06-28 17:31:38 -07:00
Jarred Sumner
1a10f2b46e Bump 2024-06-28 17:23:15 -07:00
Dylan Conway
acc0fe6db4 comment 2024-06-28 17:02:36 -07:00
Dylan Conway
6e89419250 fix(install): bugfix for tarball "overrides" (#12234) 2024-06-28 16:54:35 -07:00
Dylan Conway
d5aa7265df fix(install): bun pm trust with updated dependencies (#12215)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-28 16:51:06 -07:00
Ashcon Partovi
fe27a181d3 Increase macOS test parallelism to 3 [skip ci] 2024-06-28 11:05:43 -07:00
Ashcon Partovi
145b9e7d09 Skip no-lto builds on main branch [skip ci] 2024-06-28 10:24:41 -07:00
Ashcon Partovi
fab33be408 Fix release script 2024-06-28 09:56:55 -07:00
Dylan Conway
da27f22622 fix(install): install binaries for packages installed multiple times (#11886)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-06-28 03:24:39 -07:00
Kelvin Luck
20d33e480b Mark semver.order as this:void (#12224) 2024-06-28 02:59:14 -07:00
Ashcon Partovi
066e2f2589 Skip tests on main [no ci] 2024-06-27 16:33:17 -07:00
Per Karlsson
9697a2b058 docs: Update docker.md (#12197) 2024-06-27 16:24:56 -07:00
Isaiah Banks
b37f94d396 Fix typo in pm_trusted_command.zig (#12162) 2024-06-27 16:12:00 -07:00
Jake Boone
eff2ea6271 Fix "lines" and "functions" in coverage threshold guide (#12217) 2024-06-27 16:00:13 -07:00
Ashcon Partovi
d105b048b1 Use Buildkite for CI (#11477) 2024-06-27 14:56:07 -07:00
Ashcon Partovi
d356e27a4d Remove debug workflow
No longer needed
2024-06-26 23:54:51 -07:00
Ashcon Partovi
96e84b276b Add a debug workflow
Github actions only triggers the `status` event if the workflow is in the main branch. This can be removed later.
2024-06-26 18:38:56 -07:00
Jarred Sumner
60ef13e079 Fix assertion failure in Bun.escapeHTML with latin1 input (#12185) 2024-06-26 18:25:02 -07:00
Jarred Sumner
10ce5ddd24 Fixes #12188 2024-06-26 18:07:19 -07:00
Erik Dunteman
cab78045b7 Make console.log(someFunction) print AsyncFunction when appropriate (#12136)
Co-authored-by: Erik Dunteman <erik@MacBook-Pro.attlocal.net>
Co-authored-by: Erik Dunteman <erik@Eriks-MBP.attlocal.net>
2024-06-25 13:00:24 -07:00
Jarred Sumner
d5e3ea0ab7 Make node:v8 getHeapStatistics more plausible (#12139) 2024-06-25 00:17:51 -07:00
Dylan Conway
9f2533e24c update test 2024-06-24 22:45:36 -07:00
Jarred Sumner
bb66bba1bf Make PackageManifest.Serializer.readArray more careful (#12106) 2024-06-24 19:22:10 -07:00
Jarred Sumner
ccd92a98e5 Copy a42b74ae8139738a14148f94543c659ec2d5b92b from libxev (#12128) 2024-06-24 19:21:40 -07:00
Jarred Sumner
d191ec5933 Add OS version to crash report message (#12098) 2024-06-24 19:17:48 -07:00
Jarred Sumner
5f72f207de Make Lockfile.Buffers.readArray more careful (#12105) 2024-06-24 19:17:01 -07:00
Jarred Sumner
40858b4f25 Make reported node.js version a build option (#12104) 2024-06-24 15:34:28 -07:00
Jarred Sumner
de3ad9840b 5% faster fs.readdirSync for small directories on macOS (#12101) 2024-06-24 10:11:58 -03:00
Jarred Sumner
82c89bd8fc Fixes #12040 (#12072) 2024-06-23 17:38:35 -07:00
nmarks
314666d8ae Remove empty if statement in CMakeLists.txt (#12073) 2024-06-23 00:58:43 -07:00
Jarred Sumner
65df049fb4 Fixes #12070 (#12071) 2024-06-22 21:46:55 -07:00
Jarred Sumner
dfad48a6de Bump 2024-06-22 19:58:37 -07:00
Jarred Sumner
bf7b327f68 Fixes #12039 (#12066) 2024-06-22 17:40:45 -07:00
Jarred Sumner
a9e800ad5f Commit missing snapshot file 2024-06-22 15:31:29 -07:00
Jarred Sumner
1a8ec98fd0 Rename code coverage reporter for console -> text (#12054) 2024-06-22 14:46:40 -07:00
Ale Muñoz
484ce2ce60 Remove extraneous Bun.ArrayBufferSink mention. (#12065) 2024-06-22 14:46:22 -07:00
TATSUNO “Taz” Yasuhiro
4830e2d817 Implement initial LCOV reporter (no function names support) (#11883)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: dave caruso <me@paperdave.net>
2024-06-22 02:03:19 -07:00
Jarred Sumner
ff2080da1e Fixes #12045 (#12051) 2024-06-21 22:45:28 -07:00
forcefieldsovereign
191a06207f Fix TS experimental decorator crash (#11902) 2024-06-21 21:58:08 -07:00
Dylan Conway
ff15281b49 fix(install): fix potential flakiness with git dependencies (#12030)
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-06-21 21:34:23 -07:00
Zack Radisic
d563b6485a Use slow move-based fallback for renameatConcurrently (#12048)
Co-authored-by: zackradisic <zackradisic@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-21 20:41:22 -07:00
Dylan Conway
3b199cde59 remove glibc memfd_create from required symbols (#12050)
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-06-21 19:02:27 -07:00
dave caruso
131d8f5c80 fix mock function crash (#12023)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
2024-06-21 18:48:14 -07:00
Dylan Conway
3b6f1bb20e fix #4925 (#12049) 2024-06-21 18:45:05 -07:00
Kamaljot Singh
19bed6e05a [FIX]: Made the LICENCE a markdown file to be previewable and minor fixes in markdown syntax (#12025)
Co-authored-by: dave caruso <me@paperdave.net>
2024-06-21 15:14:22 -07:00
Zack Radisic
00f9410d92 Fix bun patch with workspaces and scoped packages (#12022)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-06-21 14:16:14 -07:00
surprisedpika
36fbad3709 Fix minor spelling mistake in bun:test toThrowError() (#12043) 2024-06-21 12:23:47 -07:00
Eckhardt (Kaizen) Dreyer
087b83c56d fix(install): use ssh keys for private git repos (#11917)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-06-21 01:31:12 -07:00
Jarred Sumner
8c548d2593 Deflake weboscket.test.js 2024-06-20 18:34:41 -07:00
Jarred Sumner
2338f16b36 Fixes #12012 (#12020) 2024-06-20 18:10:40 -07:00
Jarred Sumner
eaa7858df4 Bump 2024-06-20 17:55:05 -07:00
dave caruso
21b5bdf8b5 fix: execArgv sometimes could include user args (#11987) 2024-06-20 16:14:54 -07:00
Jarred Sumner
864cbc1555 Fixes #301 (#11988)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-06-20 16:14:26 -07:00
Jarred Sumner
c082ec5c9d Fixes #1288 (#11991) 2024-06-20 16:14:14 -07:00
dave caruso
3908ac073b fix(transpiler): mark non-ascii TS enum keys as UTF-16 (#11994)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
2024-06-20 16:14:03 -07:00
dave caruso
b76376f8a6 chore: upgrade zig to 0.13.0 (#9965)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Grigory <grigory.orlov.set@gmail.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: Meghan Denny <hello@nektro.net>
Co-authored-by: Kenta Iwasaki <63115601+lithdew@users.noreply.github.com>
Co-authored-by: John-David Dalton <john.david.dalton@gmail.com>
Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com>
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com>
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Georgijs Vilums <georgijs.vilums@gmail.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-06-20 13:48:39 -07:00
dave caruso
e58cf69f94 feat(bundler): Add --sourcemap=linked for //# sourceMappingURL comments (#11983)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-20 13:46:49 -07:00
Dylan Conway
dd22c71612 fix(shell): handle cwd paths with non ascii characters (#11990)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-19 23:53:50 -07:00
Jarred Sumner
a0032d1b5c Replace libbase64 with simdutf (#11982) 2024-06-19 23:02:56 -07:00
dave caruso
ba6e421e3b log the error when file watcher fails to start (#11986) 2024-06-19 22:37:45 -07:00
Dylan Conway
b23ba1fe18 fix(install): allow unresolvable optionalDependencies (#11977) 2024-06-19 15:23:51 -07:00
Jarred Sumner
3ff29955a1 Use stderr instead of stdout in bun patch errors (#11966) 2024-06-19 00:52:42 -07:00
Jarred Sumner
6df1bd5ed8 Oops 2024-06-19 00:51:13 -07:00
github-actions[bot]
43a5530f76 Bump to 1.1.14 (#11965)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-06-19 00:34:53 -07:00
Jarred Sumner
33ca0921f2 Update patch.md 2024-06-18 22:13:21 -07:00
Jarred Sumner
995bd374d8 Update patch.md 2024-06-18 21:33:31 -07:00
Jarred Sumner
45f9ec70dd Update patch.md 2024-06-18 21:33:13 -07:00
Jarred Sumner
a994bda80a Update patch.md 2024-06-18 21:31:06 -07:00
Jarred Sumner
3003dcb58f Update patch docs 2024-06-18 21:30:53 -07:00
Zack Radisic
7c27f3f9b4 Patch (#11858)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: zackradisic <zackradisic@users.noreply.github.com>
2024-06-18 16:34:10 -07:00
Jarred Sumner
604cbd0228 Add test for line and column property on Error instance (#11940) 2024-06-18 14:42:58 -07:00
huseeiin
85baa0f3c0 typo (#11957) 2024-06-18 13:39:20 -07:00
Ciro Spaciari
3a5077c622 fix(napi) napi_call_threadsafe_function should work with null data and napi_create_threadsafe_function should keep the process alive by default (#11952) 2024-06-18 13:38:04 -07:00
Jarred Sumner
3a17a2cb43 Update debugger.md 2024-06-17 23:41:32 -07:00
Jarred Sumner
52f2c22e3b Update debugger.md 2024-06-17 23:40:46 -07:00
Jarred Sumner
623b73171c Update debugger.md 2024-06-17 23:34:40 -07:00
Jarred Sumner
bf45791ae6 Update debugger.md 2024-06-17 23:31:21 -07:00
Jarred Sumner
7b9fe84cbd Update debugger.md 2024-06-17 23:30:34 -07:00
Jarred Sumner
0189dbb1b5 Update debugger.md 2024-06-17 23:29:02 -07:00
Jarred Sumner
3493dc634e Update debugger.md 2024-06-17 23:28:27 -07:00
Jarred Sumner
709b485294 Update debugger.md 2024-06-17 23:26:52 -07:00
Jarred Sumner
43733069bb Add more docs on debugging 2024-06-17 23:17:04 -07:00
Zayd Krunz
9621721e3d Change "what's new" link to bun blog instead of release page (#11909)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-17 21:28:58 -07:00
Jarred Sumner
b07e15ac29 Add needs repro label comment 2024-06-17 20:23:36 -07:00
Zack Radisic
a09e633b6f shell: Fix memory leak, lazily create ShellInterpreter object (#11830)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-17 20:08:00 -07:00
Jarred Sumner
c12baa3485 GitHub actions 2024-06-17 20:03:40 -07:00
Jarred Sumner
24182a4de0 Bump version on release 2024-06-17 20:03:40 -07:00
github-actions[bot]
30ae61fb03 Bump to 1.1.13 (#11935)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-06-17 19:58:29 -07:00
Jarred Sumner
478e2558e4 GitHub actions 2024-06-17 19:54:47 -07:00
Jarred Sumner
9dc36adf83 GitHub actions 2024-06-17 19:53:30 -07:00
Jarred Sumner
748209f79b GitHub actions 2024-06-17 19:51:03 -07:00
Dylan Conway
8b4ec84fb1 fix(install): use correct lockfile when printing install summary (#11930) 2024-06-17 19:30:16 -07:00
Jarred Sumner
f5b0951191 Github actions 2024-06-17 18:14:13 -07:00
Jarred Sumner
fc0335b987 Github actions 2024-06-17 18:10:44 -07:00
Jarred Sumner
4ea31d474f Github actions 2024-06-17 18:07:55 -07:00
Jarred Sumner
46610c7254 Update labeled.yml 2024-06-17 17:56:27 -07:00
Jarred Sumner
31cffe4ec0 Github actions 2024-06-17 17:54:37 -07:00
Jarred Sumner
bafaa9e80e Use commas instead of newlines as the delimiter 2024-06-17 17:46:54 -07:00
Jarred Sumner
a4aa146a2a Comment if crash report is on outdated version of Bun 2024-06-17 17:35:01 -07:00
dave caruso
ae656e8a4c fix(windows): dont call SetConsoleMode on stdin (#11927) 2024-06-17 15:11:01 -07:00
Ciro Spaciari
422c17d76c fix(http) mark completed true (#11926) 2024-06-17 15:09:20 -07:00
Jarred Sumner
8eabade199 Update sqlite.md 2024-06-17 13:55:09 -07:00
Jarred Sumner
72d925152c Update sqlite.md 2024-06-17 06:59:44 -07:00
Jarred Sumner
537c62396d Update sqlite.md 2024-06-17 06:52:51 -07:00
Jarred Sumner
77192072c8 [bun:sqlite] Support unprefixed bindings, safe integers / BigInt, as(Class) (#11887) 2024-06-16 23:44:07 -07:00
Dylan Conway
fa952b163c fix(install): tarball extracting bugfix (#11864)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-15 00:22:16 -07:00
Dylan Conway
eedb3e530c fix(install): handle transitive folder dependencies (#10445)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-06-15 00:08:40 -07:00
Jarred Sumner
fcfc68a43e Update labeled.yml 2024-06-14 15:06:26 -07:00
Jarred Sumner
1224540c89 Update labeled.yml 2024-06-14 15:02:26 -07:00
Jarred Sumner
5ef5dbe764 Update labeled.yml 2024-06-14 15:00:55 -07:00
Jarred Sumner
ac8d1726b6 Update labeled.yml 2024-06-14 14:57:59 -07:00
Jarred Sumner
18ec3a2190 Update labeled.yml 2024-06-14 14:54:33 -07:00
Jarred Sumner
bcc2289ddb Add platform label 2024-06-14 14:52:20 -07:00
Ciro Spaciari
48cefe14bd fix(WebSocket) don't touch casing on custom headers and don't use lowercased versions of well know headers (#11855) 2024-06-14 11:36:33 -07:00
Jarred Sumner
1454e9a0a6 Don't wait for both connections to fail before starting the next one (#11859) 2024-06-14 11:36:18 -07:00
Jarred Sumner
22be784714 Print like curl (#11865) 2024-06-14 01:57:20 -07:00
Jarred Sumner
ae5b1280e1 Fixes #11866 (#11867) 2024-06-14 01:50:36 -07:00
Dylan Conway
e9d1e7ac5e fix(install): return non-zero exit code when tarballs fail to download (#11828) 2024-06-14 01:15:53 -07:00
Jarred Sumner
baee597054 Bump! 2024-06-13 18:11:06 -07:00
Dylan Conway
9ad75c6b3a fix(install): possible sentinel mismatch when reading workspaces (#11856) 2024-06-13 16:54:04 -07:00
Ciro Spaciari
2f7cd38d81 fix(SSL) Fix clients write retry (#11849) 2024-06-13 13:00:24 -07:00
Ciro Spaciari
b8ca523bfb fix(Blob/stream) blob from fetch now reliable returns type, blob name can be set (#11815) 2024-06-13 12:55:41 -07:00
Grigory
3568702eca chore(test/bunx): remove duplicate check (#11837) 2024-06-13 04:31:33 -07:00
Jarred Sumner
c44d489ed0 Support NODE_TLS_REJECT_UNAUTHORIZED=0 at runtime and implement BUN_CONFIG_VERBOSE_FETCH (#11833) 2024-06-13 04:30:15 -07:00
Jarred Sumner
6c55ff6008 Fixes #11747 (#11829) 2024-06-12 19:59:53 -07:00
Meghan Denny
ba5dd63eb6 allow node:fs.promises.{read,write,append}File to accept a FileHandle (#11800) 2024-06-12 18:26:15 -07:00
oscar
0a99416764 docs: Fix hyperlink (#11827) 2024-06-12 17:41:19 -07:00
Grigory
49516c8d40 fix(bun_shim_impl): pass env to CreateProcessW (#11817)
Co-authored-by: dave caruso <me@paperdave.net>
2024-06-12 16:50:57 -07:00
Diogo
fab96a74ea Add the 5 new bun:test matchers to writing.md docs (#11803) 2024-06-12 09:08:06 -07:00
Dylan Conway
bd6a605120 fix(install): ensure capacity of preinstall_state before cleaning lockfile (#11792)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-11 14:56:21 -07:00
dave caruso
6e0f58bc05 fix(ci): make it so ci doesnt overwrite the release builds with canary's debug symbols (#11769)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-11 13:35:29 -07:00
Ciro Spaciari
6ff074ae27 followup on PR #11788 organize test imports and assert (#11791)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
2024-06-11 13:31:47 -07:00
Jarred Sumner
dc144f9519 In AbortSignal, use Ref explicitly to ensure its alive (#11790) 2024-06-11 13:31:33 -07:00
Ciro Spaciari
7c8701c96e fix(WebSocket) fix ref count so finalize is called (#11788) 2024-06-11 11:49:12 -07:00
Ciro Spaciari
27d0912f9d fix(AbortSignal.any) fire dependents signals (#11789) 2024-06-11 11:42:48 -07:00
Ludvig Hozman
ee30e8660c feat(https/fetch): Support custom ca/cert/key in fetch (#11322)
Co-authored-by: Liz3 (Yann HN) <accs@liz3.net>
2024-06-11 10:36:32 -03:00
Jarred Sumner
1b8a72e724 Fixes #11703 (#11776) 2024-06-11 03:52:40 -07:00
Nacho Martín
7f8143c5c9 Fix broken link in debugging docs (debugger.md) (#11774) 2024-06-11 02:24:48 -07:00
Dylan Conway
791ba794e8 add BUN_FEATURE_FLAG_LAST_MODIFIED_PRETEND_304 (#11767) 2024-06-10 20:58:02 -07:00
Jarred Sumner
5427646a30 Update .gitignore 2024-06-10 20:52:30 -07:00
Dylan Conway
5e619ee337 fix(install): manifest parsing and peer dependency bugfix (#11763)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-10 20:29:16 -07:00
Dylan Conway
6e6c10bc1f Remove duplicated code for binding for Object.values (#11765)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-10 19:36:27 -07:00
Dylan Conway
5b48bb1d5d Fix cloning File with structuredClone (#11766)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-10 19:35:09 -07:00
Jarred Sumner
b521b06147 Speculative fix for #11742 (#11743) 2024-06-10 19:00:45 -07:00
Jarred Sumner
c451ef5f31 Avoid passing nullptr to memcpy 2024-06-10 18:04:49 -07:00
Jarred Sumner
99b9be7a34 Sentinel-terminate file contents (#11738) 2024-06-09 19:37:57 -07:00
Jarred Sumner
4786c6139e Clean up some expect() matchers (#11721) 2024-06-09 03:42:36 -07:00
Jarred Sumner
72a33e487d Deflake bunx.test on Windows 2024-06-09 00:28:05 -07:00
Jarred Sumner
25a09d8858 Disable bun patch in release builds until #11719 is fixed
cc @zackradisic
2024-06-08 23:08:00 -07:00
Jarred Sumner
731a85f80d Prevent extremely unlikely division by zero 2024-06-08 23:08:00 -07:00
Jarred Sumner
c5010e9a12 Deflake child_process test 2024-06-08 23:08:00 -07:00
Ciro Spaciari
1ba57351b0 fix(Bun.serve) fix mimetype with utf16 (#11695)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-08 22:34:06 -07:00
Jarred Sumner
ccb76c20e9 Fixes #11677 (#11698)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-06-08 22:05:41 -07:00
Ciro Spaciari
376c02e62c fix(Bun.serve) fix async upgrade using custom protocols (#11707) 2024-06-08 21:21:49 -07:00
Nithin K Joy
80e4e60e57 feat: Implemented some jest-extended methods (#9741)
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-06-08 20:59:43 -07:00
Dylan Conway
61cb11dc2f remove sourceMap property 2024-06-08 15:50:33 -07:00
Ciro Spaciari
5df1c2689e fix napi ref/unref (#11690)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-08 14:39:23 -07:00
Ciro Spaciari
60af985863 fix(fs.watchFile) (#11669) 2024-06-07 22:54:10 -07:00
Ciro Spaciari
8ac8e4dc5f fix(fs:watch) fix missing char in filename (#11693)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-06-07 22:46:35 -07:00
Dylan Conway
d92ebf2a99 Fix windows build (#11689) 2024-06-07 22:24:34 -07:00
Meghan Denny
26201671d1 meta: update zig download url (#11692) 2024-06-07 19:13:59 -07:00
Jarred Sumner
1dcd1bba3d Revert "fix(fs:watch) fix missing char in filename" (#11691) 2024-06-07 17:34:20 -07:00
Ciro Spaciari
0bbef7eb94 fix(fs:watch) fix missing char in filename (#11686) 2024-06-07 17:33:59 -07:00
Ciro Spaciari
386bc212b1 update root certs (#11675) 2024-06-07 04:19:19 -07:00
dave caruso
2e44ee019a Fix crash when throwing an exception in setTimeout (#11670) 2024-06-06 22:15:27 -07:00
Dylan Conway
5b09384f01 add memrchr to strings.lastIndexOfChar on linux (#11671) 2024-06-06 22:01:28 -07:00
dave caruso
2cba070756 fix(bundler): Do not emit useless constructor (#11668) 2024-06-06 19:02:06 -07:00
Meghan Denny
c6187e3e3a correct node:crypto.randomInt behavior and accept a callback (#11505)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-06 18:24:26 -07:00
Zack Radisic
c85dd4e3bf feat: bun patch (#11470)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: zackradisic <zackradisic@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-06 17:48:05 -07:00
Dylan Conway
12f070d1a0 fix #11649 (#11659) 2024-06-06 17:26:39 -07:00
Dylan Conway
10608ea7d8 fix(bun:test): deepEquals undefined properties bugfix (#11661) 2024-06-06 17:01:45 -07:00
Dylan Conway
8d6f19516f root lifecycle scripts inherit stdin (#11647)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-06-06 05:10:43 -07:00
Dylan Conway
f3118d0f22 fix(install): git dependencies without package.json or a name (#11644) 2024-06-06 04:38:47 -07:00
Zack Radisic
7ac8ff6d8a shell: Fix #11554 and #11561 (#11574) 2024-06-06 03:42:52 -07:00
Dylan Conway
456aa1fc00 Worker and websocket close fix (#11635) 2024-06-06 03:25:36 -07:00
Dylan Conway
af95bfc7b1 Write registry hash and length before data in manifest cache (#11632) 2024-06-05 22:14:41 -07:00
Dylan Conway
c614d5b1da fix(install): aliased workspace without version in package.json (#11630) 2024-06-05 22:04:57 -07:00
Jarred Sumner
6fd47d6846 Improve the error message when Bun.serve() is passed a non-Response object (#11562)
Co-authored-by: dave caruso <me@paperdave.net>
2024-06-05 20:35:47 -07:00
Jarred Sumner
6a756bf979 Implement blob: URLs in fetch, import, and Worker (#11537)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
2024-06-05 18:49:03 -07:00
Jarred Sumner
bab8c0c0b2 fix(windows): handle invalid utf16le in command line arguments (#11612) 2024-06-05 18:48:08 -07:00
Dylan Conway
3e4c0918a4 fix(install): invalidate manifest cache on registry change (#11606) 2024-06-05 18:44:36 -07:00
Jarred Sumner
fe7b04085a Implement expect(value, customMessage?: string) (#11624)
Co-authored-by: dave caruso <me@paperdave.net>
2024-06-05 18:35:56 -07:00
MARCROCK22
e5ff1fdc25 fix: wrong help menu package names (#11611) 2024-06-05 18:31:26 -07:00
Dylan Conway
ac5f2e96c7 fix bun create test should create template from local folder (#11503) 2024-06-05 18:29:46 -07:00
Sushant Mishra
e76d212f18 fix: create_command telling to 'cd' when it should be omitted or cd . (#11567) 2024-06-05 13:30:22 -07:00
Jarred Sumner
c7a08f1ec5 Fixes #7263 (#11585) 2024-06-05 03:15:36 -07:00
dave caruso
bb8c0d97ba Fix runtime stack trace computation (#11581)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
2024-06-05 00:26:03 -07:00
Jarred Sumner
2580d199a4 fix some worker-related stability issues (#11494) 2024-06-04 23:29:21 -07:00
Jarred Sumner
0184097ba0 See if ReferenceError works (#11595) 2024-06-04 17:17:02 -07:00
Jarred Sumner
dc5023e26e Fix possible leak in fetch when checkServerIdentity is used (#11580) 2024-06-04 19:52:26 -03:00
Ashcon Partovi
29234f3ecb Use needs triage labels 2024-06-04 14:29:14 -07:00
Jarred Sumner
10a60b5d91 Update 7-install-crash-report.yml 2024-06-04 00:37:32 -07:00
Jarred Sumner
75209021c8 Update 7-install-crash-report.yml 2024-06-04 00:36:48 -07:00
Jarred Sumner
42d5a4e506 Issue template 2024-06-04 00:36:03 -07:00
Jarred Sumner
57fa0dcee4 Update 6-crash-report.yml 2024-06-04 00:32:31 -07:00
Jarred Sumner
2e263db3da Update 7-install-crash-report.yml 2024-06-04 00:31:23 -07:00
Jarred Sumner
d6fedd1d9d Issue template update 2024-06-04 00:30:42 -07:00
Dylan Conway
347dc264ac fix(install): bun update keeps pinned versions (#11575) 2024-06-03 20:13:25 -07:00
Jarred Sumner
16d08564e1 Fix speculative race in fetch (#11579) 2024-06-03 19:15:31 -07:00
Dylan Conway
f56e6c7d54 fix(install): semver mistaking . as the beginning of pre/build tags (#11577) 2024-06-03 16:50:21 -07:00
Jarred Sumner
8806bf9c4e Update process.versions (#11558)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-06-03 03:02:51 -07:00
Jarred Sumner
656ad7c7ae Fix port exhaustion issue (#11512) 2024-06-03 02:16:58 -07:00
Jarred Sumner
4b3c873ca7 Auto-update the generated versions list on commit 2024-06-03 01:54:37 -07:00
Jarred Sumner
30a9c394e8 Update libarchive (#11533) 2024-06-03 01:07:37 -07:00
Jarred Sumner
ff905ba5f5 Backport parts of d0250818dd (#11555) 2024-06-03 01:07:10 -07:00
Dylan Conway
c2eef9eded fix(install): manifest package name mismatch (#11549) 2024-06-02 22:56:57 -07:00
Ciro Spaciari
1d89c5988e refactor OOM errors (#11540) 2024-06-02 22:56:26 -07:00
Timo Sand
eb31675af9 Fix typo in ENV variable name (#11541) 2024-06-02 21:08:05 -07:00
Dylan Conway
c65a911a57 fix(install): lockfile printing bugfix (#11545) 2024-06-02 18:49:07 -07:00
Dylan Conway
8f5fbd50cd fix(install): bun update with unresolved package (#11547) 2024-06-02 18:16:59 -07:00
Jarred Sumner
a1c3ea0b33 Update pm.md 2024-06-02 04:09:02 -07:00
Jarred Sumner
7fb25acf5f Update zstd (#11534) 2024-06-02 03:10:47 -07:00
Jarred Sumner
9523ea3aea Update mimalloc (#11532) 2024-06-02 01:19:54 -07:00
Jarred Sumner
c717f52459 Update nodejs-apis.md 2024-06-01 19:29:32 -07:00
Jarred Sumner
d38890d30c Update nodejs-apis.md 2024-06-01 19:29:07 -07:00
Jarred Sumner
814b48116a Update nodejs-apis.md 2024-06-01 19:28:53 -07:00
Jarred Sumner
152a7e1bd3 Update nodejs-apis.md 2024-06-01 19:28:07 -07:00
Jarred Sumner
b10887c7cb Update nodejs-apis.md 2024-06-01 19:25:33 -07:00
Jarred Sumner
43f0913c38 Bump 2024-06-01 02:34:36 -07:00
Jarred Sumner
6ca5896e86 Revert "feat: 🎨 Show better bun upgrade progress" (#11515) 2024-06-01 02:34:12 -07:00
dave caruso
784022785d revert the last commit
we were testing if we could disable push-to-main permissions
i should probably just stop committing to main
2024-06-01 01:39:55 -07:00
dave caruso
bc64e6b8e5 hi 2024-06-01 01:39:08 -07:00
dave caruso
9dd22f0d8d fix submodules 2024-06-01 01:35:40 -07:00
dave caruso
00472fbb1c fix release script 2024-06-01 01:29:11 -07:00
Jarred Sumner
4fb6056f85 Update CMakeLists.txt 2024-06-01 00:20:34 -07:00
Jarred Sumner
30b0b49594 Deflake large_asset_regression test 2024-06-01 00:20:34 -07:00
dave caruso
18bba0dc44 revert sourcemap-related logging change (#11510) 2024-05-31 23:26:43 -07:00
dave caruso
0a5fa2dd8c fix sourcemap printing with multiple chunks sharing the same file (#11509) 2024-05-31 23:10:02 -07:00
Ashcon Partovi
3a63f46dc0 Docs for bun update --latest 2024-05-31 18:35:53 -07:00
Ciro Spaciari
e3b7635fa4 fix(Bun.Socket) onDrain will only be called after handshake + docs update (#11499)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-31 18:33:06 -07:00
Dylan Conway
dc051ae810 Revert "fix windows todo"
This reverts commit ec09e6e238.
2024-05-31 17:44:35 -07:00
Dylan Conway
ec09e6e238 fix windows todo 2024-05-31 17:44:13 -07:00
Georgijs
d9f7d053d5 fix peer hoisting (#11473)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Georgijs Vilums <=>
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-31 17:12:33 -07:00
Jarred Sumner
fd55cdae34 Try deflaking child process test again (#11496) 2024-05-31 04:17:59 -07:00
Jarred Sumner
75b64d9b8e Deflake child_process test (#11495) 2024-05-31 02:21:51 -07:00
dave caruso
c467fd9381 fix high cpu usage when using bun.build (#11455) 2024-05-31 00:05:33 -07:00
refi64
f127dbd127 Restore support for dynamic function names in tracebacks (#11475)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-31 00:04:28 -07:00
Dylan Conway
774d6a1efb fix potential integer overflow (#11491) 2024-05-31 00:03:57 -07:00
Jarred Sumner
a6d0e64196 Attempt to deflake bun-create.test 2024-05-30 23:41:51 -07:00
Jarred Sumner
c3142e1ae0 Hopefully deflake bun create tests 2024-05-30 21:12:06 -07:00
Jarred Sumner
9693fc9183 Deflake child process test (#11488) 2024-05-30 21:05:57 -07:00
Jarred Sumner
61805b5344 Try fast timer then fallback to slow timer (#11486) 2024-05-30 20:16:21 -07:00
Toby Cm
8de0ec598b feat: Show better bun upgrade progress (#11402)
Co-authored-by: dave caruso <me@paperdave.net>
2024-05-30 17:47:48 -07:00
Jarred Sumner
fca20f1a43 Make sure this is set 2024-05-30 17:32:55 -07:00
Jarred Sumner
323011980c Add fuzzer-like test of methods (#11436)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-05-30 15:12:29 -07:00
Parmar Jai Atul
b49853c24f Fix an ambiguous redirect in bun bash-completions (#11468) 2024-05-30 15:11:12 -07:00
Ashcon Partovi
f0bcc631d5 Undo commits meant for another branch 2024-05-30 14:43:44 -07:00
Ashcon Partovi
ce20abef5c Remove extra commit diff 2024-05-30 14:41:10 -07:00
Ashcon Partovi
ecfe2a0f1b Fix supruious sccache errors 2024-05-30 14:41:10 -07:00
Georgijs
6a7c35cb52 Fix crash with multiple Bun.stderr.text() calls (#11472) 2024-05-30 14:18:32 -07:00
Dylan Conway
8461a20d9b update output (#11474) 2024-05-30 14:17:23 -07:00
Ashcon Partovi
ff9ab489b0 sharding tests 2024-05-30 14:16:09 -07:00
Ciro Spaciari
55c5ed3d3e fix(tests) update http2 cert in tests (#11462) 2024-05-30 13:24:27 -07:00
Ciro Spaciari
a8fcb48609 fix(test) handle connect errors on node-tls-context (#11463) 2024-05-30 13:24:08 -07:00
Dylan Conway
4b8f89cb73 Allow bun update to edit package.json (#11340)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-30 02:14:01 -07:00
Jarred Sumner
45d0c1432b rewrite timers for setTimeout, setInterval, setImmediate (#11419)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Georgijs Vilums <=>
Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
Co-authored-by: Georgijs Vilums <georgijs.vilums@gmail.com>
Co-authored-by: gvilums <gvilums@users.noreply.github.com>
2024-05-30 02:11:12 -07:00
Dylan Conway
922f9191b0 fix(install): re-link workspaces if necessary (#11457) 2024-05-30 01:40:28 -07:00
Meghan Denny
c456622161 node:fs/promises.cp should make path if dest does not exist (#11433) 2024-05-30 01:15:20 -07:00
janos-r
b2c697296e Fix bun.fish completions (#11450) 2024-05-29 16:59:13 -07:00
Meghan Denny
2285735abd node:zlib: allow passing brotli params in encode+decode options (#11429) 2024-05-29 00:51:00 -07:00
Meghan Denny
7f1880cafb Bun.CryptoHasher: fix byteLength and add test (#11431) 2024-05-29 00:13:02 -07:00
dave caruso
1f8c121652 increase test timeout time for sourcemap tests (#11432) 2024-05-29 00:11:54 -07:00
Georgijs
370db08891 Replace Streams.Readable with a JS implementation (#11332)
Co-authored-by: Georgijs Vilums <=>
Co-authored-by: gvilums <gvilums@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-28 18:49:59 -07:00
Jarred Sumner
62b4c2141b Bump WebKit 2024-05-28 18:11:31 -07:00
Jarred Sumner
5f55d45d3b [internal] Fix showing source mappings for WebKit code in debugger 2024-05-28 18:09:43 -07:00
Jarred Sumner
4d03105614 Make dns tests use promises instead of done (#11347)
Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
2024-05-28 17:30:52 -07:00
Meghan Denny
367b69dff5 bindings: fix createTypeError and createRangeError inheritance (#11341) 2024-05-28 16:54:08 -07:00
dave caruso
96f29e8555 fix(bundler): some sourcemap generation bugs (#11344)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Meghan Denny <meghan@bun.sh>
Co-authored-by: nektro <nektro@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Le Michel <95184938+Ptitet@users.noreply.github.com>
Co-authored-by: Дмитрий Заводской <zawodskoj2@gmail.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: HUMORCE <humorce@outlook.com>
Co-authored-by: huseeiin <122984423+huseeiin@users.noreply.github.com>
2024-05-28 16:51:35 -07:00
Jarred Sumner
634cc82dd0 Fix guide 2024-05-28 15:49:18 -07:00
Abhijeet Prasad
474d4cf3ce docs: Add Sentry guide (#11276) 2024-05-28 15:14:34 -07:00
Jonny Burger
15603ab596 Lift http.createServer maxRequestBodySize (#11426) 2024-05-28 15:13:46 -07:00
Jarred Sumner
1041655ff6 Implement addAbortListener and getMaxListeners in node:events (#11392) 2024-05-28 15:13:27 -07:00
huseeiin
912bccb624 Update import-html.md (#11417) 2024-05-28 04:16:00 -07:00
Jarred Sumner
3d11e5042e Use calloc when allocating loop on Windows (#11409) 2024-05-27 19:20:54 -07:00
Jarred Sumner
34b02ada14 Move Timer into a separate file (#11408) 2024-05-27 16:40:34 -07:00
Jarred Sumner
ad5340d971 Deflake serve-body-leak.test 2024-05-27 15:37:40 -07:00
Dylan Conway
06231b51bd fix(node:path): toNamespacedPath bugfix (#11406) 2024-05-27 15:36:54 -07:00
Le Michel
856654a065 Added forgotten dot in utils.md (#11362) 2024-05-27 09:08:01 -07:00
Dylan Conway
d43922d3e1 follow up for #11387 (#11393) 2024-05-27 03:57:39 -07:00
Jarred Sumner
98b3aeb9ec Update nodejs-apis.md 2024-05-27 02:28:24 -07:00
HUMORCE
cfedd70110 docs: Correct command line of package upgrading with Scoop (#11391) 2024-05-27 02:18:57 -07:00
Dylan Conway
470e523c52 fix(install): semver tag parsing bugfix (#11387) 2024-05-27 02:17:43 -07:00
Jarred Sumner
e1eb4a4753 Improve unhandled error reporting in bun:test (#11386) 2024-05-27 01:55:33 -07:00
Дмитрий Заводской
ad5574b86f Run deinit() on CallbackJob regardless of result type (#11379)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-26 20:02:32 -07:00
Le Michel
ec8e5d7cd3 Fixed typo in context.md (#11373) 2024-05-26 16:22:38 -07:00
Jarred Sumner
af4e844b62 Deflake test 2024-05-26 04:15:39 -07:00
Jarred Sumner
fdbccef110 Speed up a couple tests (#11369) 2024-05-26 04:09:28 -07:00
Le Michel
4539d168b4 Removed ambiguous quotes in utils.md (#11363) 2024-05-26 02:39:04 -07:00
Jarred Sumner
c50e837f34 Fix kqueue event handling code (#11364) 2024-05-26 02:24:41 -07:00
Jarred Sumner
99b979e5ca Remove std.debug.print
@paperdave you left this
2024-05-25 23:22:29 -07:00
dave caruso
7be0669840 fix(bundler): more windows backslash stuff (#11333)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-25 21:52:59 -07:00
Jarred Sumner
59bbedf251 Update c-ares (#11361) 2024-05-25 21:36:19 -07:00
Meghan Denny
aa3aa888d5 ci: windows: fix dns.getServers test (#11309)
Co-authored-by: nektro <nektro@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-25 01:43:13 -07:00
Jarred Sumner
c689b2b265 Speculative crash fix (#11337) 2024-05-24 18:29:50 -07:00
Jarred Sumner
5102a94430 Fixes #11297 (#11331) 2024-05-24 14:44:14 -07:00
Georgijs
5f7282fea3 Fire listeners that are removed during their event (#11329)
Co-authored-by: Georgijs Vilums <=>
Co-authored-by: gvilums <gvilums@users.noreply.github.com>
2024-05-24 14:07:03 -07:00
Dylan Conway
6c9b3de217 add jest.setTimeout type 2024-05-24 02:15:26 -07:00
Jarred Sumner
d16c136e77 Fix linkat with O_TMPFILE on Ubuntu/non-privileged users 2024-05-24 01:10:28 -07:00
Dylan Conway
df83028546 fix(install): npm lockfile migration bugfix (#11311) 2024-05-24 00:19:56 -07:00
dave caruso
3d99c9af24 fix(bundler): unify code + codeWithSourceMapShifts (#11315) 2024-05-23 23:32:28 -07:00
dave caruso
ec082db67c fix: fix sourcemap generation (rewrites bun.StringJoiner) (#11288) 2024-05-23 23:30:11 -07:00
Jarred Sumner
230c760b42 Fix formatting in guide 2024-05-23 22:25:06 -07:00
Dylan Conway
d3fdb17321 add jest.setTimeout to bun test (#10687)
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-05-23 20:24:54 -07:00
dave caruso
c3157e2c50 fix(windows spawn): use Job Object to manage subprocesses of subprocesses (#11240)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-23 19:59:39 -07:00
Dylan Conway
d1ac51e442 fix bun-install-windowsshim.test.ts (#11258) 2024-05-23 19:55:53 -07:00
Jarred Sumner
0905e43049 Test gardening (#11285) 2024-05-23 19:54:36 -07:00
Jarred Sumner
0b821c6e25 Save to package manifest cache async, only check disk once (#11304)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-05-23 19:54:18 -07:00
Meghan Denny
f339e51d84 ci: windows: skip bunshell stacktrace test (#11306) 2024-05-23 19:43:44 -07:00
Georgijs
2528caa598 fix out of bounds error for bun install (#11308)
Co-authored-by: Georgijs Vilums <=>
2024-05-23 17:54:12 -07:00
Jarred Sumner
260366f1a6 ~2x faster uncached bun install on Windows (#11293) 2024-05-23 15:02:12 -07:00
Meghan Denny
bdc65d0f87 fix spawn-kill-signal.test.ts (#11290) 2024-05-23 12:53:22 -07:00
Georgijs
6566b8a6d6 limit concurrent connection count for happy eyeballs (#11282)
Co-authored-by: Georgijs Vilums <=>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-23 00:05:03 -07:00
Jarred Sumner
d06498bc96 Deflake serve-body-leak test 2024-05-22 19:22:22 -07:00
dave caruso
aff93ba9df crash_handler: add note if this crash is from canary (#11281)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-22 18:31:06 -07:00
Georgijs
d50acbc0bd Fix refConcurrent and unrefConcurrent (#11280)
Co-authored-by: Georgijs Vilums <=>
2024-05-22 16:57:05 -07:00
Jarred Sumner
12bb5d03a2 Always propagate error in EventEmitter (#11210)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-05-22 16:39:42 -07:00
Grigory
942061a40a docs(building-windows): add info about winget (#11204)
Co-authored-by: dave caruso <me@paperdave.net>
2024-05-22 15:46:16 -07:00
Ciro Spaciari
096cfeebc0 fix(fetch) allow Response to be GC'd before all the request body is received (#10933)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
2024-05-22 15:42:30 -07:00
dave caruso
f3e974102d ci: upload extra data for crash handler 2024-05-22 14:05:42 -07:00
Georgijs
81cebc789a Fix workers on windows taking a long time to exit (#11271) 2024-05-22 14:04:50 -07:00
Eigil Sagafos
ce8474b2a1 Update http2 NotImplementedErrors to report issue 8823 (#11277) 2024-05-22 14:03:43 -07:00
jess-render
cd5a97b383 docs: Add guide for deploying a Bun app to Render (#11248)
Co-authored-by: Jess Lin <jesslin@JesssMBPRender.home>
Co-authored-by: Jess Lin <jesslin@new-host-6.home>
2024-05-22 10:37:27 -07:00
Meghan Denny
9399b70138 ci: make bun-install-registry.test.ts less flaky on windows (#11253) 2024-05-21 23:14:10 -07:00
Meghan Denny
d4b3f16388 ci: skip next-pages/dev-server on windows (#11256) 2024-05-21 23:12:24 -07:00
Dylan Conway
cc0bce62e3 fix(install): adding packages in subdirectories of workspaces (#11254) 2024-05-21 22:46:26 -07:00
Meghan Denny
87cbaae4f0 meta: ci: dont linkify list of failing files (#11257) 2024-05-21 22:07:37 -07:00
Jarred Sumner
6e6cfcd839 Bump + crash reporter uploading 2024-05-21 21:54:53 -07:00
Meghan Denny
e5de03b8eb replace [bun.MAX_PATH_BYTES + 1]u8 with bun.PathBuffer (#11163) 2024-05-21 20:53:34 -07:00
マルコメ
0d76c416ed docs: update jest compatibility (#11247) 2024-05-21 19:25:49 -07:00
Dylan Conway
bb13798d98 fix(install): workspace version added to package.json (#11241) 2024-05-21 17:25:40 -07:00
Meghan Denny
ecb6c810c8 replace [bun.MAX_PATH_BYTES]u8 with bun.PathBuffer (#11162) 2024-05-21 15:55:49 -07:00
Georgijs
6c77d5e882 bypass getaddrinfo for ip addresses (#11238)
Co-authored-by: Georgijs Vilums <=>
2024-05-21 15:51:10 -07:00
dave caruso
e98c235e30 feat: load sourcemaps at runtime when using a bun build --target=bun bundle (#10998)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-21 14:41:53 -07:00
Jarred Sumner
c03b35ecfc Fix node:dns error code issue impacting MongoDB (#11235) 2024-05-21 14:41:00 -07:00
Georgijs
6e55612d36 fix http2 test on windows (#11236)
Co-authored-by: gvilums <gvilums@users.noreply.github.com>
2024-05-21 14:36:08 -07:00
dave caruso
0457d6a748 fix(win): bugs with files in roots / bugs with resolver and unc shares (#11155)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-21 13:51:47 -07:00
Meghan Denny
1c99cfebeb crypto: fix digestToBytes and add tests (#11234) 2024-05-21 13:51:00 -07:00
Dylan Conway
33aaf3376b use count instead of index for error output 2024-05-21 13:42:20 -07:00
Dylan Conway
fbde05b339 one 2024-05-21 13:38:04 -07:00
Jarred Sumner
bbaeeaeed2 Implement expect().toHaveReturned() && expect().toHaveReturnedTimes(n) (#11231) 2024-05-21 13:11:26 -07:00
Meghan Denny
396dc78522 node:fs: add Dirent.path and .parentPath fields (#11135)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-05-21 11:24:05 -07:00
Zack Radisic
adde0af7b4 fix which when bin or PATH is rlly long (#11218) 2024-05-21 11:21:29 -07:00
Jarred Sumner
40fcf25e01 Fixes "column must be greater than or equal to 0" error (#11211) 2024-05-21 11:19:18 -07:00
Gaurish Sethia
c66e290801 Alias util.debug to util.debuglog (#11189) 2024-05-21 10:45:14 -07:00
Grigory
b59868ced1 fix(scripts/env): also search for prerelease vs (#11222) 2024-05-21 10:18:48 -07:00
Jake Boone
b2b7ad235e Remove expect.extend from list of missing features in migrate-from-jest.md (#11214) 2024-05-20 22:12:29 -07:00
Georgijs
4df387d59f happy eyeballs (#11206)
Co-authored-by: Georgijs Vilums <=>
Co-authored-by: gvilums <gvilums@users.noreply.github.com>
2024-05-20 22:12:14 -07:00
Jarred Sumner
440c7cde9e Upgrade reported Node.js version to v22.2.0 2024-05-20 21:38:22 -07:00
Jarred Sumner
6d87c965bf Fixes #10170 (#11209) 2024-05-20 21:30:44 -07:00
Jarred Sumner
cabfca4039 Fix adding packages in workspaces (#11177)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-05-20 21:24:37 -07:00
Georgijs
06a9aa80c3 fix data race in us_internal_handle_dns_result (#11201)
Co-authored-by: Georgijs Vilums <=>
2024-05-20 15:06:07 -07:00
Zack Radisic
ff1db36aaa shell: handle operators and delimiters better (#11165)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-05-20 10:37:52 -07:00
Dylan Conway
a612d22e33 upgrade webkit (#11188) 2024-05-20 10:37:06 -07:00
Peter Ammon
ee13aabded Optimize fish completions (#11185) 2024-05-19 18:31:05 -07:00
Jarred Sumner
09438eb50c Add DNS docs page 2024-05-19 18:10:24 -07:00
Jarred Sumner
b15d47dfe8 Introduce bun.dns.prefetch API (#11176)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Eric L. Goldstein <3359116+mangs@users.noreply.github.com>
2024-05-19 18:08:16 -07:00
Meghan Denny
16e0f6e671 make WindowsFileAttributes a packed struct and add a windows junction test (#11161)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-05-19 14:28:43 -07:00
Kelvin Luck
dcec6906f6 Prefer import.meta.path in http server guide (#11180) 2024-05-19 13:37:17 -07:00
Jarred Sumner
8fffe01ef3 Fix crash in CodeCoverage 2024-05-19 11:43:25 -07:00
Jarred Sumner
b044387e58 Fix icu version test 2024-05-19 03:15:00 -07:00
Georgijs
814440b1c0 Asynchronous DNS for sockets (#11097)
Co-authored-by: Georgijs Vilums <=>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-05-18 05:11:21 -07:00
dave caruso
d0cacfc2ac fix junction/pnpm on window (#11157)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-17 19:32:44 -07:00
Zack Radisic
38122a99b2 shell: Fix some cd returning the wrong exit code (#11092) 2024-05-17 18:12:57 -07:00
Jarred Sumner
16920a552f Make unhandled exceptions in Bun.serve() within a test() or expect() call fail the test like any other exception (#11141) 2024-05-17 18:11:43 -07:00
dave caruso
4e714ae9dc fix: don't crash when seeing -1 in code cov (#11131)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-17 15:53:19 -07:00
Jarred Sumner
902c258c1b Use simdutf to validate utf8 in websocket server (#11140) 2024-05-17 04:03:37 -07:00
Jarred Sumner
dfb935dc73 Add test for ICU version 2024-05-17 03:41:30 -07:00
Jarred Sumner
593ad71891 [bun-types] Add missing serialization option to Bun.spawn 2024-05-17 02:58:14 -07:00
Jarred Sumner
b220254df4 Fix failing test 2024-05-16 23:48:48 -07:00
Meghan Denny
d35ea63e6d node:http: convert Agent from class to function (#11130)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-16 23:33:34 -07:00
Jarred Sumner
ca4d2fcbba A couple fixes to TypeScript types 2024-05-16 23:26:42 -07:00
Meghan Denny
c7d7bc120a node:crypto: add shake128 and shake256 (#11134) 2024-05-16 23:16:59 -07:00
Jarred Sumner
8c963f3430 macOS arm64 CI jobs are being enqueued for too long 2024-05-16 22:47:48 -07:00
Jarred Sumner
44891ee62d Skip bun build of react-dom/server test when react-dom/server is unsupported 2024-05-16 21:47:58 -07:00
Jarred Sumner
ffeaa77370 Add a debug assertion 2024-05-16 20:35:57 -07:00
Meghan Denny
5caca9cd48 add .bytes() method to various readables (#11104)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-05-16 19:10:50 -07:00
Meghan Denny
ac6eaac403 test: use resource disposal to ensure servers shutdown even if tests fail (#11106) 2024-05-16 17:26:13 -07:00
Jarred Sumner
93abd99202 Downgrade to React 18 2024-05-16 15:53:13 -07:00
Jarred Sumner
013d7c2e9c Fix flaky test
@zackradisic please don't use `^` in tests. It means a package updating in the future can cause the test to fail.
2024-05-16 15:44:28 -07:00
Ishan Anand
ed48b66d42 add guide for drizzle + neon (#11004) 2024-05-16 14:25:58 -07:00
Jarred Sumner
d55ac0fa43 Move docs/project/licensing.md to LICENSE so it's easier for people to find it
Fixes #241
2024-05-16 03:49:08 -07:00
Jarred Sumner
2fb0a5e311 Fix bug with errname not allowing double numbers as ints (#11103) 2024-05-16 02:55:07 -07:00
Jarred Sumner
f7a45b30fd GitHub actions 2024-05-16 02:29:59 -07:00
Jarred Sumner
b725be7288 GitHub actions 2024-05-16 02:12:09 -07:00
Jarred Sumner
8ed8acd4ae GitHub actions 2024-05-16 01:59:50 -07:00
Jarred Sumner
87cc3c9898 GitHub actions 2024-05-16 01:51:30 -07:00
Jarred Sumner
c3d4e2729f Github actions 2024-05-16 01:47:33 -07:00
Jarred Sumner
f00772e98d GitHub actions 2024-05-16 01:35:28 -07:00
Jarred Sumner
db80f22751 GitHub actions 2024-05-16 01:22:15 -07:00
Jarred Sumner
d51e144344 GitHub actions 2024-05-16 00:59:48 -07:00
Jarred Sumner
f58249e361 Fix loading bun-types in development (#11110)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-05-16 00:46:28 -07:00
Jarred Sumner
6098fc5492 GitHub actions 2024-05-16 00:44:55 -07:00
Jarred Sumner
24e195d848 GitHub actions 2024-05-16 00:29:31 -07:00
Jarred Sumner
0cbc5dff7f Bump Bun version used in format action 2024-05-16 00:20:42 -07:00
Jarred Sumner
2f7e3a9e26 GitHub actions 2024-05-15 22:29:12 -07:00
Jarred Sumner
29f840620c GitHub actions 2024-05-15 21:38:06 -07:00
Jarred Sumner
6e4b8215ed GitHub actions 2024-05-15 21:36:17 -07:00
Jarred Sumner
e5e5f98592 Tweak github actions C++ linter (#11105) 2024-05-15 21:28:43 -07:00
Jarred Sumner
d90058a522 GitHub actions 2024-05-15 20:48:07 -07:00
Jarred Sumner
1b77efdc52 GitHub actions 2024-05-15 20:44:35 -07:00
Jarred Sumner
e88118972c GitHub actions 2024-05-15 20:39:48 -07:00
Jarred Sumner
4f93db2c22 GitHub actions 2024-05-15 20:37:58 -07:00
Jarred Sumner
f4679be7fc Remove unnecessary change 2024-05-15 20:36:22 -07:00
Jarred Sumner
735f5d4b62 Setup clang-tidy (C++ linter) (#7961)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-05-15 20:35:39 -07:00
Jarred Sumner
9c5d339ccb 5x faster toString("base64url") (#11087) 2024-05-15 19:53:25 -03:00
Jarred Sumner
b5dff55ef3 Upgrade SIMDUTF, 8x faster atob (#11085) 2024-05-15 03:42:36 -07:00
Jarred Sumner
5389c7ab40 Bump 2024-05-15 00:59:33 -07:00
Meghan Denny
86bcc49bef node:http: allow setting response.statusCode and statusMessage [v2] (#11082) 2024-05-15 00:27:55 -07:00
Meghan Denny
5c8c112c4e fix corrupted file (#11081) 2024-05-14 22:15:20 -07:00
Meghan Denny
4efe026b5f test: unify how all files create a temp directory (#11057)
Co-authored-by: nektro <nektro@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-14 20:19:35 -07:00
阿豪
19f210b085 fix(test): use a real png image instead of Symbolic Link (#11059) 2024-05-14 18:41:47 -07:00
Jarred Sumner
c4840f8a58 Fix BUN_CONFIG_NO_CLEAR_TERMINAL_ON_RELOAD env var (#11078) 2024-05-14 18:22:21 -07:00
Jarred Sumner
d62cd47885 Update CONTRIBUTING.md 2024-05-14 18:18:59 -07:00
Jarred Sumner
53bf855c18 Update CONTRIBUTING.md 2024-05-14 18:17:08 -07:00
Meghan Denny
1e6fa76637 rework node:net.connect arg parsing (#10970) 2024-05-14 17:20:19 -07:00
Dale Seo
301b0fd2e7 Add missing code and reason to WebSocket docs (#10669) 2024-05-14 15:42:33 -07:00
Zack Radisic
60482b6e42 Fix backtick escaping and add more tests (#10980)
Co-authored-by: zackradisic <zackradisic@users.noreply.github.com>
Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-14 14:23:12 -07:00
Jarred Sumner
8fbdf32d74 Update cluster.md 2024-05-14 02:18:04 -07:00
Jarred Sumner
41569fa369 Update cluster.md 2024-05-14 01:57:43 -07:00
Jarred Sumner
5602b7a352 Update cluster.md 2024-05-14 01:56:55 -07:00
Jarred Sumner
e686c2ed7b Add guide for reusePort 2024-05-14 01:53:52 -07:00
Dylan Conway
f2cfa15e4e fix(install): make sure each has_install_script value is updated (#11051)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-13 21:10:33 -07:00
Dylan Conway
2d5cc719d2 fix coercion to double (#11056) 2024-05-13 20:07:00 -07:00
Jarred Sumner
889ec13b32 Fix sorting order of guides 2024-05-13 17:37:18 -07:00
阿豪
d7ba296a20 fix(install.sh): support windows mingw platform (#11017) 2024-05-13 16:58:13 -07:00
Georgijs
89d68debde emit newListener event before new listener is added (#10993)
Co-authored-by: Georgijs Vilums <=>
Co-authored-by: gvilums <gvilums@users.noreply.github.com>
2024-05-13 16:57:59 -07:00
Jarred Sumner
b079f8d907 fix links 2024-05-13 16:50:54 -07:00
Jarred Sumner
b10a954e99 Link to guides in Readme 2024-05-13 16:48:26 -07:00
Jarred Sumner
17763168c4 Update README nav links + script to update the table of contents 2024-05-13 16:24:16 -07:00
Ashcon Partovi
998c4ca0a7 Change node-http test so it doesn't emit annotation 2024-05-13 14:37:42 -07:00
Ashcon Partovi
c0c6d0fa27 Change issue template to just use "crash" tag 2024-05-13 10:19:40 -07:00
LuisAFK
5d51aa454e docs: bun upgrade --stable flag in installation docs (#11000) 2024-05-13 09:48:36 -07:00
Dylan Conway
88468a2c2c Snapshot lockfiles in some tests (#10994) 2024-05-12 17:27:48 -07:00
dave caruso
dbdc376005 fix(bundler): fix emitting invalid sourcemaps (#10999) 2024-05-11 21:58:22 -07:00
Zack Radisic
68cb85a61d Tilde expansion (#10981) 2024-05-10 15:01:17 -07:00
Jarred Sumner
89d25807fb Do not use always() in github actions
@Electroid this causes the tests to never cancel. GitHub has a concurrent actions limit which we easily reach. This causes CI to wait a long time before starting the job, wasting our time.
2024-05-10 06:11:54 -07:00
Jarred Sumner
aa05278d5d GitHub actions test 2024-05-10 05:53:45 -07:00
Jarred Sumner
1d119b7f87 Avoid loading libm.so.6 as it breaks Vercel (#10978) 2024-05-10 05:42:47 -07:00
Jarred Sumner
1fd021e1c4 Bump Webkit again (#10974) 2024-05-10 02:07:31 -07:00
Jarred Sumner
f52c17781e Add to gitignore incase someone still has it locally 2024-05-10 00:54:06 -07:00
Jarred Sumner
1a3f537b3a Remove unnecessary submodule which should be cloned in the integration test action instead 2024-05-10 00:53:20 -07:00
Jarred Sumner
8c6883d1ba Disable Node.js test suite until we start using it 2024-05-10 00:35:41 -07:00
Jarred Sumner
ce07eca2a2 Support overriding headers property in Request subclass (#10969) 2024-05-10 00:18:48 -07:00
Dylan Conway
1482c9fd65 fix(napi): check result arguments in some functions (#10972) 2024-05-10 00:14:08 -07:00
Jarred Sumner
5eb596a9dc Update json-parse-stringify.mjs 2024-05-09 23:51:53 -07:00
Dylan Conway
589a39d413 upgrade webkit (#10971) 2024-05-09 23:06:10 -07:00
Jarred Sumner
abe4fd9bd5 Add extra options to features.json (#10968) 2024-05-09 22:01:46 -07:00
Dylan Conway
e2aa36f8a6 fix(install): bug with dist-tags and workspaces with versions (#10959)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-09 17:22:25 -07:00
Meghan Denny
8528e9c670 make node:fs.ReadableStream and node:stream.NativeReadable constructor functions (#10943)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-09 17:18:43 -07:00
dave caruso
37006509d9 Update ICU on Linux to 75.1 (#10960) 2024-05-09 17:08:46 -07:00
Jarred Sumner
6d717ac852 Revert "Bump"
This reverts commit 86820edbf9.
2024-05-09 15:29:13 -07:00
Jarred Sumner
86820edbf9 Bump 2024-05-09 05:22:01 -07:00
Dylan Conway
159e8bc2a3 fix(install): workspaces without versions (#10913) 2024-05-09 03:55:15 -07:00
Jarred Sumner
50fd2b049a Update nodejs-apis.md 2024-05-08 23:45:01 -07:00
Jarred Sumner
28b5a90823 Fixes missing argument in signal events (#10940) 2024-05-08 23:32:11 -07:00
Jarred Sumner
75420ba12a Implement process.hasUncaughtExceptionCaptureCallback() (#10937) 2024-05-08 19:51:39 -07:00
dave caruso
13c6f46b20 feat: add canary to crash handler message (#10935) 2024-05-08 18:28:56 -07:00
Meghan Denny
93c0a37ec2 brotli: make sure stream encode on large inputs works as expected (#10936)
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-05-08 18:28:06 -07:00
Georgijs
c378febf5b Implement process.on("uncaughtException", ...) (#10902)
Co-authored-by: Georgijs Vilums <=>
Co-authored-by: gvilums <gvilums@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-08 17:38:31 -07:00
Zack Radisic
4b581b011c feat: Add cp builtin to shell for Windows (#10174)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: zackradisic <zackradisic@users.noreply.github.com>
2024-05-08 17:01:00 -07:00
dave caruso
f1fbf54b0a fix(win): do not allow exitcode==1 and signalCode to be set at once (#10907) 2024-05-08 16:00:35 -07:00
dave caruso
f60d87b7df chore: fix the build scripts again (#10912)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-08 14:57:15 -07:00
Zack Radisic
0d0fe75bec Fix more glob pattern problems (#10792)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-08 14:47:09 -07:00
Zack Radisic
656925ec97 Fix workspace packages not being found when they are moved (#10899)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-08 14:46:05 -07:00
dave caruso
3c082012b7 fix %i formatter with missing argument (#10910) 2024-05-07 23:51:10 -07:00
dave caruso
127cb9fd42 fix(crash_handler): add a newline 2024-05-07 23:40:55 -07:00
Meghan Denny
1589a1230d Revert "Align arguments of connect() in node:tls and node:net to Node (#10854)" (#10908) 2024-05-07 20:33:42 -07:00
Jarred Sumner
3cb5b2ff1a Add assertion that count() was called before allocate() in lockfile stringbuilder (#10901) 2024-05-07 19:06:11 -07:00
dave caruso
4c0d69af93 fix(windows): build all dependencies with proper cpu target (#10884)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-07 17:36:19 -07:00
Georgijs
d4db29c164 Fix fd offset handling in ReadStream (#10883)
Co-authored-by: Georgijs Vilums <=>
Co-authored-by: gvilums <gvilums@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-07 16:05:48 -07:00
Henrik Storck
6217d78567 fix: Align arguments of connect() in node:tls and node:net to Node (#10870)
Co-authored-by: dave caruso <me@paperdave.net>
2024-05-07 15:03:38 -07:00
rcaselles
c4fa1e38dc Fix confirm is never true in windows (#10802)
Co-authored-by: rcaselles <rcaselles@ganaenergia.com>
2024-05-07 14:51:02 -07:00
Dylan Conway
288b540621 fix(node:os): cpus bugfix (#10879) 2024-05-07 13:08:25 -07:00
Meghan Denny
4970ffc3a4 node:http: add agent getter to ClientRequest (#10878) 2024-05-06 23:05:43 -07:00
Meghan Denny
1da810adc1 node:zlib: Brotli (#10722)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-06 22:00:04 -07:00
Jarred Sumner
0a54bc0510 Speculative fix for napi_set_property crash (#10842) 2024-05-06 20:07:55 -07:00
dave caruso
f9be0bef45 add [Symbol.dispose] in some bun apis (#10818)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-05-06 19:49:23 -07:00
Dylan Conway
5cbb1ba96a console.table bugfix (#10876) 2024-05-06 19:46:35 -07:00
Artemiy Schukin
16bf341a60 fix: typo in the comment (#10817) 2024-05-06 16:35:55 -07:00
Jarred Sumner
b1b91d59d8 Set frame pointers and sigaltstack (#10847) 2024-05-06 15:08:43 -07:00
Jarred Sumner
5002a10ef0 Remove references to echo in spawn because it doesn't work on Windows and that confuses people 2024-05-05 23:07:03 -07:00
Jarred Sumner
34c5d083c6 Update http.md 2024-05-05 21:54:25 -07:00
Jarred Sumner
bafa32b39a Update http.md 2024-05-05 21:51:36 -07:00
Jarred Sumner
07cd586ad6 Update http.md 2024-05-05 20:59:50 -07:00
Jarred Sumner
1a23d95844 Update http.md 2024-05-05 20:51:06 -07:00
Jarred Sumner
b333992640 Add more to the HTTP doc 2024-05-05 20:48:54 -07:00
Jarred Sumner
5e9be3345b Create git-diff-bun-lockfile.md 2024-05-05 02:38:59 -07:00
Jarred Sumner
b01310c3f6 Update ssr-react.md 2024-05-05 00:53:52 -07:00
Jarred Sumner
9bfeb0a2ae Workaround https://github.com/facebook/react/issues/28941 2024-05-05 00:51:51 -07:00
Jarred Sumner
72bc2585e3 Fix passing stdout/stderr from Bun.spawn -> Bun.serve()'s Response (#10840) 2024-05-04 20:43:57 -07:00
Georgijs
7bfcc2c9e3 support onread in net (#10753)
Co-authored-by: Georgijs Vilums <=>
Co-authored-by: gvilums <gvilums@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-04 20:35:28 -07:00
dave caruso
9ba7d420d5 chore: upload release artifacts by hash so bun.report can remap them (#10819) 2024-05-04 20:34:59 -07:00
Dylan Conway
989cb79811 Update comment.yml 2024-05-04 00:54:39 -07:00
e3dio
45842893a4 Update websockets.md (#10808) 2024-05-03 20:23:23 -07:00
dave caruso
0ecc49ab7f fix(bundler): resolve failed assertion when lowering using syntax (#10814) 2024-05-03 20:22:25 -07:00
Ashcon Partovi
541744e583 Improve node:inspector stubs (#10807) 2024-05-03 19:44:30 -07:00
Eric L. Goldstein
d1eb35dd5d Update documentation for the [dir] option when customizing bundler naming (#10804) 2024-05-03 19:14:25 -07:00
Jarred Sumner
31d3d527f4 Update installation.md 2024-05-03 19:07:47 -07:00
Jarred Sumner
01fade7b1f Update installation.md 2024-05-03 19:06:13 -07:00
Jarred Sumner
669b47375f Add JS/TS code field to crash report template 2024-05-03 16:30:05 -07:00
Jared McCannon
d6d1a0bec8 Update solidstart.md (#10810) 2024-05-03 14:14:51 -07:00
Jarred Sumner
b0b7db5c06 Add missing $ 2024-05-03 01:47:38 -07:00
Jarred Sumner
13a7df1337 Update create-release-build.yml 2024-05-03 01:03:35 -07:00
Zack Radisic
461827902d Fix bad stack traces (#10778)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-05-02 23:01:06 -07:00
dave caruso
bbb906c66f fix(bundler): naming of dynamic import chunks (#10761)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-02 21:22:36 -07:00
codershiba
b4ae0ed0ca chore(types): Remove type for parseArgs (#10777) 2024-05-02 20:51:48 -07:00
fzn0x
ba3d5e0217 docs(sqlite): fix a small typo in .run() section (#10784) 2024-05-02 20:40:14 -07:00
Georgijs
ec6110e7e3 allow connecting a socket again after its connection was closed (#10781)
Co-authored-by: Georgijs Vilums <=>
Co-authored-by: gvilums <gvilums@users.noreply.github.com>
2024-05-02 20:36:58 -07:00
Dylan Conway
94bf404c41 Print bun version on unhandled errors (#10760)
Co-authored-by: dave caruso <me@paperdave.net>
2024-05-02 15:06:14 -07:00
dave caruso
d66a4fc0f4 add jsc to features list (#10759) 2024-05-01 22:49:53 -07:00
Dylan Conway
44e09bb7f4 fix(install): catch more errors for bun add/update/remove (#10758) 2024-05-01 21:42:06 -07:00
windwiny
2a0746d57e Update env.ps1, FIX when VS not installed in default path (#10684) 2024-05-01 21:13:42 -07:00
Jarred Sumner
56f3a80166 Revert "Make CONTRIBUTING.md a symlink to docs/project/contributing.md instead"
This reverts commit ca82b7f86c.
2024-05-01 20:23:55 -07:00
Jarred Sumner
ca82b7f86c Make CONTRIBUTING.md a symlink to docs/project/contributing.md instead
So that CI will pick up changes to it correctly
2024-05-01 20:18:17 -07:00
Jarred Sumner
6fbb32dd97 make contributing.md a symlink 2024-05-01 20:16:26 -07:00
Jarred Sumner
e1fdafd39c Update CONTRIBUTING.md 2024-05-01 20:09:39 -07:00
Jarred Sumner
f85323c72a Update docs.yml 2024-05-01 20:09:27 -07:00
Jarred Sumner
3c93a4c0c7 Update CONTRIBUTING.md 2024-05-01 20:09:11 -07:00
Jarred Sumner
f93a31596b Use CONTRIBUTING.md for visibility 2024-05-01 20:04:13 -07:00
Jonny Burger
c9108d19f9 Re-enable support_jsxs_in_jsx_transform flag (#10734) 2024-05-01 19:59:30 -07:00
Dylan Conway
5d7b3ab579 upgrade webkit (#10757) 2024-05-01 19:51:45 -07:00
Ciro Spaciari
79c7abe595 fix(server) handle ignored body and node:http destroy (#10268) 2024-05-01 16:18:35 -07:00
Ashcon Partovi
23fb8ce07a Rewrite some tests so they don't use GitHub annotations (#10748) 2024-05-01 16:13:20 -07:00
Meghan Denny
e45cd749e5 chore(zig): add a new lint for using bun.FD.cwd() (#10683) 2024-05-01 16:12:09 -07:00
Georgijs
5f4c5052d1 fix windows crosscompile to linux and mac (#10751) 2024-05-01 16:07:36 -07:00
Jarred Sumner
32120fe920 Cherry-pick https://github.com/WebKit/WebKit/pull/27964 (#10727) 2024-05-01 15:28:23 -07:00
Meghan Denny
23e4f609bf Revert "node:fs.readdir: should not fail even if folder contains self-referential symlinks" (#10750) 2024-05-01 14:59:01 -07:00
Meghan Denny
bd632464a0 node:fs.readdir: should not fail even if folder contains self-referential symlinks (#10679) 2024-05-01 13:25:47 -07:00
Eric L. Goldstein
2a401486d9 Remove util.styleText type overrides because @types/node has them now (#10746) 2024-05-01 12:53:08 -07:00
Georgijs
fd45c67e72 fix flaky jwt test (#10745) 2024-05-01 12:00:16 -07:00
Zack Radisic
303f86af41 Glob support for workspace names in bun install (#10462)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: zackradisic <zackradisic@users.noreply.github.com>
2024-05-01 11:01:55 -07:00
Jarred Sumner
3fc2e45960 Update proxy.md 2024-05-01 03:19:30 -07:00
Jarred Sumner
50ba690cad Update proxy.md 2024-05-01 03:17:06 -07:00
Jarred Sumner
2b193095d3 Update proxy.md 2024-05-01 03:16:27 -07:00
Jarred Sumner
e1a7fe55c3 Add guide for proxy 2024-05-01 03:14:25 -07:00
Jarred Sumner
c156a8db09 Fix build 2024-05-01 03:00:04 -07:00
Jarred Sumner
dc99eb69ca Move some dns code into bun.dns (#10728)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-05-01 02:54:32 -07:00
Dylan Conway
a38b3102b6 override std.mem.indexOfSentinel (#10721) 2024-05-01 01:28:04 -07:00
Dylan Conway
3106b890ac Skip threadlocal destructors at exit on Windows (#10723) 2024-05-01 01:27:12 -07:00
Georgijs
b48c6736e5 (green ci) fix issue in workers and process deinit (#10715)
Co-authored-by: gvilums <gvilums@users.noreply.github.com>
2024-04-30 18:12:03 -07:00
Dylan Conway
a5b5a2a725 fix requestCert and rejectUnauthorized option handling (#10710) 2024-04-30 17:29:03 -07:00
Ashcon Partovi
32bf5eb444 Support bunx --version (#10701) 2024-04-30 11:29:17 -07:00
Jarred Sumner
efd4e15f4c Deflake http2 tests (#10682) 2024-04-30 13:50:30 -03:00
Ashcon Partovi
18261046ee Run more Node.js tests 2024-04-30 08:44:08 -07:00
Jarred Sumner
ee0e69702e Fix run URLs in CI comments 2024-04-30 01:03:39 -07:00
Meghan Denny
74c6bd4197 node:fs.fdatasync: include fd in Error when thrown (#10678) 2024-04-29 22:35:09 -07:00
Meghan Denny
a78db0b8ae test: node:http: don't hardcode this value (#10671) 2024-04-29 19:18:42 -07:00
Jarred Sumner
b42f5227e3 Deflake fs.watchFile tests (#10673) 2024-04-29 19:15:53 -07:00
RanolP
93829420dc fix: seq, dirname, basename should exit with 0 even when they don't have stdout (#10590) 2024-04-29 18:06:43 -07:00
Georgijs
168d50e622 fix cpu model identification on linux aarch64 (#10653) 2024-04-29 18:06:04 -07:00
Zack Radisic
558aad5611 Make Windows command line argument parsing more robust (#10661) 2024-04-29 17:53:46 -07:00
Eric L. Goldstein
185a4bf90e Update Bun.serve() types documentation to match the exact values from bun.d.ts (#10420) 2024-04-29 17:40:37 -07:00
Jarred Sumner
ce4f85c2c5 Fixes #10624 (#10625) 2024-04-29 17:16:48 -07:00
Dylan Conway
cacf97ca0a fix flaky bun-create.test.ts with git templates (#10662) 2024-04-29 16:59:07 -07:00
Dale Seo
72b3045758 no need to open the parentheses (#10666) 2024-04-29 15:46:16 -07:00
David Ernst
0f4449d51b Fix "is" -> "as" typo in comment (#10664) 2024-04-29 15:37:11 -07:00
Jarred Sumner
6f15b90e83 Disable these assertions on Windows 2024-04-29 14:25:36 -07:00
Jarred Sumner
2724bd3649 Bump 2024-04-29 14:16:43 -07:00
Jarred Sumner
bca4d0be48 Speculative fix for alignment crash in directory iterator on Windows (#10628) 2024-04-29 14:07:00 -07:00
Jarred Sumner
3970339483 Use error handling callback in more places, emit 1015 when WSS TLS handshaking fails, micro-optimize ServerWebSocket, fix bug in util.inspect exceptions (#10633) 2024-04-29 13:57:23 -07:00
Georgijs
603588ac8c fix flaky udp test (#10650)
Co-authored-by: Georgijs Vilums <=>
2024-04-29 13:03:12 -07:00
Dylan Conway
fbbc20fe83 fix flaky setTimeout test (#10656) 2024-04-29 12:47:08 -07:00
Jarred Sumner
7af0ed164a Fixes #10584 (#10627) 2024-04-29 10:43:59 -07:00
Keigo Ando
7062e89d2e Support asymmetric matchers with equals in expect.extend (#10602) 2024-04-29 10:37:35 -07:00
Jarred Sumner
2bf3f32fb8 Update nodejs-apis.md 2024-04-28 22:58:40 -07:00
Dylan Conway
697f37e21f fix 10610 (#10618) 2024-04-28 16:55:20 -07:00
Dylan Conway
c7aed7e0a3 fix node-module-module.test.js on windows (#10620) 2024-04-28 16:54:47 -07:00
Jarred Sumner
84d81c3002 Add microbenchmark 2024-04-28 02:31:45 -07:00
Jarred Sumner
e58d67b468 Fixes #10588 & upgrade WebKit (#10596) 2024-04-28 01:10:52 -07:00
Jarred Sumner
dfcbe09035 Update create-release-build.yml 2024-04-27 17:44:20 -07:00
Jarred Sumner
cbb0b3113a Update create-release-build.yml 2024-04-27 16:55:31 -07:00
Yusup Hambali
9ebbe035b9 [docs] Fix scoop command (#10586) 2024-04-27 16:44:40 -07:00
João Lucas de Oliveira Lopes
57b529d181 fix: udp docs navbar (#10579) 2024-04-27 16:44:24 -07:00
Jarred Sumner
cc8cdf6c51 Fix napi_get_date_value (#10575) 2024-04-27 02:59:11 -07:00
Jarred Sumner
4cbd215d55 Fix regression with TOML & JSONC (#10573) 2024-04-27 02:58:44 -07:00
Dylan Conway
3b1311a84f fix 10556 (#10572) 2024-04-27 02:03:03 -07:00
Dylan Conway
2f1a3da21b fix 10567 (#10570)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-27 01:25:28 -07:00
Meghan Denny
adc631c9ef fix node:http events regression and add another test (#10566) 2024-04-27 00:53:51 -07:00
dave caruso
a52dd7853d final steps to getting dd-trace to work (#10568) 2024-04-27 00:07:44 -07:00
Georgijs
e2c36aabff add docs for UDP (#10562)
Co-authored-by: Georgijs Vilums <=>
2024-04-26 21:08:51 -07:00
Meghan Denny
9416ee49b2 windows: patch setTimeout.test.js flakiness (#10564) 2024-04-26 21:08:40 -07:00
Meghan Denny
8280defc30 node:http: preserve this value for onListen callback (#10533) 2024-04-26 18:42:29 -07:00
Jarred Sumner
609ef6a8ad Fix DNS lookup not draining microtasks (#10561) 2024-04-26 18:42:18 -07:00
Jarred Sumner
829ac49612 Add missing NOT_SAME_DEVICE -> EXDEV error translation 2024-04-26 15:38:25 -07:00
Jarred Sumner
555bd1defd Bump! 2024-04-26 15:30:38 -07:00
Ashcon Partovi
589f941aea UDP support (#7271)
Co-authored-by: Georgijs Vilums <georgijs@bun.sh>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: gvilums <gvilums@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
Co-authored-by: Georgijs Vilums <=>
2024-04-26 15:25:24 -07:00
Kilian Brachtendorf
a6d39e14fc Fixes #10551 Search for LLVM 16 during initial setup (#10552) 2024-04-26 15:15:09 -07:00
Jarred Sumner
4b87e1a909 Fixes #4718 (#10543) 2024-04-26 14:56:22 -07:00
Meghan Denny
181d6a0a83 node:net: stub out [get|set]DefaultAutoSelectFamily[AttemptTimeout] (#10529) 2024-04-26 14:35:34 -07:00
Meghan Denny
b257a30977 node:fs: fix arg parsing of readSync (#10527) 2024-04-25 20:49:17 -07:00
Jarred Sumner
189aa22845 Support comments & trailing commas in require/import package.json (#10531) 2024-04-25 20:48:42 -07:00
Dylan Conway
7f0b810d7a fix checking no_proxy env variable (#10530) 2024-04-25 20:45:10 -07:00
Jarred Sumner
17fc156460 Update create-release-build.yml 2024-04-25 19:45:45 -07:00
dave caruso
7502c9b391 fix: never create more than one stdin tty (#10528) 2024-04-25 19:20:37 -07:00
josephjclark
c7773975f6 docs: Remove duplicated content from guides/install/trusted (#10330) 2024-04-25 18:53:10 -07:00
dave caruso
006575a0f1 watcher: major refactor to use Maybe types for better error reporting (#10492) 2024-04-25 18:44:11 -07:00
Georgijs
9ba1181215 fix child-process-exec test on windows (#10522)
Co-authored-by: gvilums <gvilums@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-25 17:58:12 -07:00
Dylan Conway
588259fff1 fix flaky jsonwebtoken tests (#10524) 2024-04-25 17:57:22 -07:00
Jarred Sumner
c34428d47f Fix Linux spawn issue (#10503)
Co-authored-by: Zack Radisic <zack@theradisic.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-04-25 16:05:19 -07:00
Georgijs
78aef2d894 fix some child_process tests (#10521) 2024-04-25 16:02:19 -07:00
Jarred Sumner
9eab12f7b8 Support cross-compilation in bun build --compile (#10477) 2024-04-25 15:34:40 -07:00
Dylan Conway
196cc2a4cd fix windows install tests (#10497) 2024-04-25 14:27:18 -07:00
Jarred Sumner
49fa21f6dc Don't error on comments & trailing commas in package.json (#10287)
* Don't error on comments & trailing commas in package.json

* Fix windows tests

* Fixup

* Update lockfile.zig

* Woopsie

* Woopsie

* Fix workspace path stuff on Windows

* Always decode

* Always decode

* Revert some things

* Update lockfile.zig
2024-04-25 03:16:00 -07:00
Dylan Conway
d966fe6afd fix flaky and broken test (#10500)
* add package

* fix test
2024-04-25 01:14:11 -07:00
Meghan Denny
a64554bba6 node:http.request should emit events in the right order (#10447)
* node:http.request should emit events in the right order

* Apply formatting changes

* remove runOnNextTick alias

* make private event a symbol

* clean test

* fix regressions and add more tests

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-04-25 00:07:54 -07:00
Dylan Conway
a6714904e4 set length before copy (#10498) 2024-04-24 23:39:05 -07:00
dave caruso
e792bbdf5f fix: overriding self.postMessage should not impact worker_threads.parentPort (#10496)
* fix a bug in worker

* remove old
2024-04-24 22:14:37 -07:00
Meghan Denny
685dc02142 windows: fix bun-create ci tests (#10494)
* windows: fix bun-create ci tests

* fix lint

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-24 21:51:05 -07:00
Dylan Conway
ebeae0ff1c Revert "Fix issue #10376 (#10421)"
This reverts commit 7bc8456edf.
2024-04-24 19:33:23 -07:00
Uzini
7bc8456edf Fix issue #10376 (#10421)
* add: prevent script install to be spawned if bun install is invoked

* add: test for infinite install loop

* add: error message

* fix: error message, exit code, test

---------

Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-04-24 19:12:13 -07:00
Dylan Conway
fdff887c0a file protocol and abs path (#10493) 2024-04-24 18:55:13 -07:00
Meghan Denny
d789eb34c9 remove unnecessary use of ReflectApply (#10482) 2024-04-24 15:30:15 -07:00
Dylan Conway
b03c6690ba fix 10474 (#10478)
* use utf8string

* update
2024-04-24 15:03:12 -07:00
Meghan Denny
e3689e7e83 node:crypto: add blake2b512, sha512-224, sha3-* (#10383)
* node:crypto: add blake2b512, sha512-224, sha3-*

* update submodule

* flesh out rest of api

* remove new bun.newCatchable

* add SHA512_224 to HashClasses

* remove SHA512_224 js class

* better allocation

* remove memcpy in path where buffer is provided to us

* add back benchmark

* move zig crypto things into specific struct

* Apply formatting changes

* centralize algorithm definitions into one spot

* rsa-256 was deleted

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-04-23 19:35:27 -07:00
Meghan Denny
2abe6e7c3f node:child_process: allow passing stdin,stdout,stderr to spawn (#10451)
* node:child_process: allow passing stdin,stdout,stderr to spawn

* this doesnt actually need to be limited to 0,1,2

* Apply formatting changes

* fix stream guards

* undo process internals change

* wrap check in function for better clarity

* lazy load node:fs more

---------

Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-04-23 17:03:11 -07:00
Jarred Sumner
0989f1a575 Add comment 2024-04-23 16:42:45 -07:00
Zack Radisic
528a84d29f Fix absolute patterns with glob (#10121)
* Make it work with abs patterns

* add tests

* fixes

* Make all the ported fast-glob tests work for absolute path patterns, fix some stuff

* fix scan test

* remove TestBuilder in scan.test.ts

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-23 15:59:59 -07:00
Jarred Sumner
024c274a3d Support type import attribute with "text", "json", "toml", and "file" (#10456)
* Fixes #3449

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

* Apply formatting changes

* Update loaders.md

* Update text-loader-fixture-import.ts

* Add guide

* Update bundler_loader.test.ts

* Address comment

---------

Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-04-23 15:35:34 -07:00
Meghan Denny
ff624147ad existsSync should never throw ENAMETOOLONG (#10446)
* existsSync should never throw ENAMETOOLONG

* undo PathLike change and use better guard

* Apply formatting changes

* await promise

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

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-04-23 15:33:37 -07:00
Jarred Sumner
c1d7a5ed79 Update define-constant.md 2024-04-23 14:39:15 -07:00
Jarred Sumner
7593790308 Update define-constant.md 2024-04-23 14:37:32 -07:00
Jarred Sumner
3d770c112c Update define-constant.md 2024-04-23 14:36:27 -07:00
Jarred Sumner
d690504943 Update define-constant.md 2024-04-23 14:26:21 -07:00
Jarred Sumner
1a17d7179c Update define-constant.md 2024-04-23 14:23:31 -07:00
Jarred Sumner
309c2e3678 Update define-constant.md 2024-04-23 14:22:44 -07:00
Jarred Sumner
90fc629156 Update define-constant.md 2024-04-23 14:21:27 -07:00
Jarred Sumner
dd774c7f8c Formatting 2024-04-23 14:15:09 -07:00
Jarred Sumner
79a4cfb17d Fix example 2024-04-23 14:05:35 -07:00
Jarred Sumner
dc5044443f Add a guide for using --define 2024-04-23 13:58:55 -07:00
Jarred Sumner
68c13f2af5 Format 2024-04-23 01:31:15 -07:00
dave caruso
e6954c440e ci: make next build test ignore gzipped file sizes (#10443)
* fix next build

* window
2024-04-22 21:07:32 -07:00
Jarred Sumner
a1c771834c Fixes #10322 (#10384)
Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
2024-04-22 21:06:53 -07:00
Erik Brinkman
9768d30e6d check for nested define value identifiers (#10401)
fixes #10399

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-22 19:37:48 -07:00
Georgijs
9813341cef fix hang when spawning many processes (#10448)
* fix hang when spawning many processes

* update comment
2024-04-22 19:37:01 -07:00
Dylan Conway
0f13deb540 Switch to quick_exit (#10450)
* quick_exit

* remove macos
2024-04-22 19:34:23 -07:00
Meghan Denny
0f8d74e3dc node:*: fix some typescript errors (#10310)
* node:*: fix some typescript errors

* add dom to tsconfig

* fix url regression

* fix diagnostics_channel regression

* use $isJSArray instead of ArrayIsArray

* $isArray wasnt actually a real builtin

* Revert "$isArray wasnt actually a real builtin"

This reverts commit 319926b538.

* Apply formatting changes

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2024-04-22 18:24:07 -07:00
Ashcon Partovi
c3c1750ec7 Run tests from Node.js (#10377) 2024-04-22 15:28:16 -07:00
Dylan Conway
e8fa39f938 update crash handler (#10442)
* format null line

* single slash
2024-04-22 15:00:39 -07:00
Jarred Sumner
0fb10356f8 Update upload.yml 2024-04-22 13:28:07 -07:00
Jarred Sumner
c405a4bd21 Fixes #10304 (#10407) 2024-04-22 13:03:36 -07:00
vico
164b2f610f docs: update clang/llvm version to 17 (#10439) 2024-04-22 10:42:56 -07:00
welfuture
83e4aca269 chore: remove repetitive words (#10393)
Signed-off-by: welfuture <wellfuture@qq.com>
2024-04-22 08:47:57 -07:00
Johan Wigert
6758046f76 Fix typo in docker.md (#10430) 2024-04-22 08:46:51 -07:00
Jarred Sumner
7496299b00 Update CMakeLists.txt 2024-04-22 00:53:14 -07:00
Jarred Sumner
c2ad94aa01 CI actions 2024-04-22 00:51:01 -07:00
Jarred Sumner
a614336157 Tweak actions 2024-04-22 00:19:29 -07:00
Jarred Sumner
7bd305c573 Update upload.yml 2024-04-22 00:02:33 -07:00
Jarred Sumner
cd3b184ba0 Update upload.yml 2024-04-22 00:00:24 -07:00
Jarred Sumner
a010db8eca Update ci.yml 2024-04-21 23:50:54 -07:00
Jarred Sumner
a3dc94f1e1 Update ci.yml 2024-04-21 23:49:10 -07:00
Jarred Sumner
639f554c9c Update upload.yml 2024-04-21 23:47:21 -07:00
Jarred Sumner
536379b8ed Update build-darwin.yml 2024-04-21 23:43:02 -07:00
Jarred Sumner
04a79fa308 Update upload.yml 2024-04-21 23:38:02 -07:00
Jarred Sumner
0bd75cc3c5 Update upload.yml 2024-04-21 23:36:57 -07:00
Jarred Sumner
1f1df6be0c Update create-release-build.yml 2024-04-21 23:20:53 -07:00
Jarred Sumner
6ff77c978e Update create-release-build.yml 2024-04-21 23:20:33 -07:00
Jarred Sumner
7433f5a922 Update create-release-build.yml 2024-04-21 23:11:29 -07:00
Jarred Sumner
9c879064fe Update create-release-build.yml 2024-04-21 22:54:43 -07:00
Jarred Sumner
8168415e5a Create release build action 2024-04-21 22:43:50 -07:00
Jarred Sumner
22a289e272 Update ci.yml 2024-04-21 21:45:38 -07:00
Jarred Sumner
97efa6f505 Update ci.yml 2024-04-21 21:42:21 -07:00
Jarred Sumner
c604c57a32 Upgrade to LLVM 17, fix linux debug build, upgrade JSC, remove some C API usages (#10161)
* Upgrade to LLVM 17, JSC, remove more C API usages

* [autofix.ci] apply automated fixes

* Update scripts/setup.sh

Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>

* more

* update

* bump

* Fix unused variable

* Fix merge conflict

* [autofix.ci] apply automated fixes

* Increase limit

* double the limit

* CI

* Update CMakeLists.txt

* Update CMakeLists.txt

* Upgrade

* Upgrade more things

* Bump

* Remove ld64 flag

* typo

* Update Dockerfile

* update

* Update

* Up

* asd

* up

* Upgrade

* Bump!

* Fix crash

* Remove unnecessary cahnge

* Propagate canary flag + bump macOS 13

* Upgrades

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-04-21 19:03:01 -07:00
LuisAFK
ab79940e6a Fix typo in workspaces docs "pacakges" (#10417) 2024-04-21 18:03:17 -07:00
Jarred Sumner
1a4bad80b7 Bump 2024-04-20 21:30:14 -07:00
Jarred Sumner
30f4090571 Fix flaky test 2024-04-20 21:30:05 -07:00
Jarred Sumner
1191bf0c15 Delete dead test code (#10405)
* Delete dead test code

* Apply formatting changes

---------

Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-04-20 21:25:10 -07:00
Jarred Sumner
707fd7f1ea Update mimalloc (#10408)
* Update mimalloc

* Update runner.node.mjs
2024-04-20 20:48:55 -07:00
Georgijs
df1e9290ae filter: return with nonzero code if any script fails (#10374)
* filter: return with nonzero code if any script fails

* propagate exit code

* Update src/cli/filter_run.zig

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-20 17:59:14 -07:00
Jarred Sumner
fc4459991d Fixes #8697 (#10378)
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2024-04-20 17:58:14 -07:00
dave caruso
a062e2d367 fix(bundler): fix --compile with asset files on windows (#10385)
* fix some bundler things

* buh

* buh

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-20 17:13:50 -07:00
Dylan Conway
ad44949621 fix upgrade crash (#10387)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-20 16:14:09 -07:00
Arnaud Thomas D
d0a4fd5e80 docs: fix invalid links to other pages (#10404) 2024-04-20 16:13:31 -07:00
Dylan Conway
e6d8391e00 fix(windows): revert thread naming code (#10394) 2024-04-20 10:56:05 -07:00
dave caruso
5bdc5bebb1 feat: crash reporter followup (#10365)
* think about the future

* waaaaaaaaaaa

* a

* testing

* make it faster

* fire

* macos and linux

* stuff

* a

* a

* CI

* buh

* disable in debug

* Apply formatting changes

* a

* a

* Apply formatting changes

* more review comment resolution

* a

* a

* oh no i started writing macos code from within windows i should stop and switch devices again

* rookie mistake

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
2024-04-19 20:50:37 -07:00
Ciro Spaciari
e0f583df75 feat(SNI) Bun.serve/tls (#10364)
* add SNI support

* add some Bun.serve tests

* more tests

* wip move addServername to

* move addServerName

* clean

* fix types

* cleanup

* make TS happy

* opsie revert back

* version this

* internals

* opsie

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-19 17:11:05 -07:00
Ashcon Partovi
131183f747 Likely fix issue with Windows tests [no ci] 2024-04-19 14:56:25 -07:00
Ashcon Partovi
5ccc042cc4 Fix syntax error from workflow [no ci] 2024-04-19 14:05:41 -07:00
Ashcon Partovi
abaa505374 Set git config when running tests on Windows [no ci] 2024-04-19 13:50:23 -07:00
Jarred Sumner
c5270f8121 Fix typo 2024-04-18 22:57:36 -07:00
Jarred Sumner
c4d69146c8 [doc] Disambiguate the title 2024-04-18 22:46:43 -07:00
Jarred Sumner
2ce83953e5 [docs] Add a few more guides 2024-04-18 22:20:29 -07:00
Jarred Sumner
b6aebb58c2 [doc] Add guide for streaming with async iterators 2024-04-18 22:09:09 -07:00
Jarred Sumner
26428d5e1c [CI] Fixup windows 2024-04-18 20:52:37 -07:00
Jarred Sumner
05ff620d4d [Ci] Always cancel-in-progress 2024-04-18 19:12:51 -07:00
Jarred Sumner
e134ed253f [CI] Use bigger windows runners 2024-04-18 18:55:09 -07:00
Jarred Sumner
f663472d5f [CI] Normalize filepaths relative to cwd in output 2024-04-18 18:52:47 -07:00
Jarred Sumner
6f67c63873 Formatting tweak 2024-04-18 18:44:49 -07:00
Ashcon Partovi
f460d39298 Increase timeout for tests 2024-04-18 17:19:49 -07:00
Dylan Conway
246df1f43e check without .exe (#10362) 2024-04-18 17:03:38 -07:00
Ashcon Partovi
213461adc6 Fix Discord message on test failure 2024-04-18 13:05:23 -07:00
Jarred Sumner
a78668eb4c fix(bundler): fix a crash while computing character frequencies
* Fixes #10344

* Update bundler_compile.test.ts

* Apply formatting changes

* Track comments when bundling

* Fix embedded files and add test

* Make this const

* Update runner.node.mjs

* Prefill process arch/platform in bun build --compile

* nitpick

---------

Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
2024-04-18 12:35:59 -07:00
Ashcon Partovi
452dd68253 Fix comment not upserting 2024-04-18 10:56:54 -07:00
Ashcon Partovi
de7985b5a6 Fix unzip location 2024-04-17 19:02:46 -07:00
Ashcon Partovi
a1f86bf3f3 Add temporary SSH into workflow 2024-04-17 19:00:00 -07:00
Ashcon Partovi
df23f18461 Fix glob that unzips bun 2024-04-17 18:58:10 -07:00
Ashcon Partovi
1d7f80c73c Use always() to maybe fix trigger 2024-04-17 18:54:58 -07:00
Ashcon Partovi
6d6b2e8bc5 Add ability to manually trigger tests 2024-04-17 18:52:10 -07:00
Ashcon Partovi
accfff0271 Attempt to fix download artifact issue 2024-04-17 18:28:28 -07:00
Ashcon Partovi
aa1174df69 Probably fix permissions issues with CI 2024-04-17 17:51:41 -07:00
Jarred Sumner
997f57b97f Fix generate comment in CI 2024-04-17 17:41:59 -07:00
Jarred Sumner
074205d963 Fix generate comment in CI 2024-04-17 17:37:33 -07:00
Ashcon Partovi
cfce166a9b Use different GitHub action to download Bun 2024-04-17 17:13:39 -07:00
Ashcon Partovi
13f0188fec Allow concurrent CI runs on main, but only cancel-in-progress if not-main 2024-04-17 16:29:48 -07:00
Ashcon Partovi
97761cba67 Fix GIT_SHA not being populated in builds 2024-04-17 16:23:50 -07:00
Ashcon Partovi
492211f499 Tweak comment from PRs 2024-04-17 16:08:04 -07:00
Jarred Sumner
192577141b Update 6-crash-report.yml 2024-04-17 15:53:24 -07:00
Jarred Sumner
6e71dca5c2 Tweak crash report template 2024-04-17 15:52:09 -07:00
dave caruso
c99d7ed331 feat: overhaul the crash handler (#10203)
* some work

* linux things

* linux things

* feat: tracestrings on Windows

* bwaa

* more work on the crash handler

* okay

* adgadsgbcxcv

* ya

* dsafds

* a

* wuh

* a

* bru h

* ok

* yay

* window

* alright

* oops

* yeah

* a

* a

* OOM handling

* fix on window
2024-04-17 15:32:25 -07:00
Ashcon Partovi
f764c1233b Fix permissions in workflows, part 2 2024-04-17 15:09:26 -07:00
Ashcon Partovi
20d8261405 Fix permissions in workflows 2024-04-17 15:07:54 -07:00
Ashcon Partovi
a7273802a8 Debug comment workflow 2024-04-17 14:18:25 -07:00
Ashcon Partovi
303bf4d9f1 Fix comment workflow 2024-04-17 11:47:05 -07:00
Ashcon Partovi
d4c31d3c9e Maybe fix test workflow 2024-04-17 11:36:40 -07:00
Ashcon Partovi
d5e6ff4c97 Fix artifact uploads for canary builds 2024-04-17 10:04:57 -07:00
liudonghua
51bb5f3a04 Update platform.ts to fix isWindowsAVX2 implementation. (#10313)
The isWindowsAVX2 function is not working as expected due to the stdout endwith `\r\n`. So the simple `stdout == "True"` will never true.
2024-04-17 00:26:57 -07:00
Ashcon Partovi
fdaa01287a Maybe fix Windows tests 2024-04-16 22:53:42 -07:00
Ashcon Partovi
f8a28ad37e Probably fix comment workflow 2024-04-16 22:12:48 -07:00
Ashcon Partovi
c18c25f390 Testing workflows (#10157)
* Testing workflows

* Testing workflows

* Testing workflows

* Testing workflows

* Testing workflows

* Testing workflows

* Update .github/workflows/run-test.yml

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-16 19:39:06 -07:00
Stefano
3df202f91f Fix(windows) search correct path for esbuild(.exe|.cmd) (#10302) 2024-04-16 15:43:47 -07:00
Meghan Denny
df190815df node: convert remaining js packages to ts (#10289) 2024-04-16 15:42:24 -07:00
Meghan Denny
2ae48f3314 lint: ban comparing against undefined in Zig (#10288) 2024-04-16 14:37:09 -07:00
Jarred Sumner
291a39bd3f Do not run shell tests outside test scope (#10199)
* Do not run tests outside test scope

* Fix tests

* Fix type errors and remove potentially precarious uses of unreachable

* yoops

* Remove all instances of "Ruh roh"

---------

Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com>
2024-04-16 14:03:02 -07:00
Jarred Sumner
fbe2fe0c3f Bump 2024-04-15 21:32:17 -07:00
Dylan Conway
5a81dc8e33 fix(install): fix dependency install order (#10240)
* packages wait for parent trees before install

* use `directoryExistsAt`

* missing increment

* fix faccessat

* swap destination and target

* update

* force

* only create destination dir before installing package

* fix windows symlink/junction

* increment, false on extracting

* done
2024-04-15 18:29:34 -07:00
Georgijs
24a411f904 Correctly handle duplicate column names in sqlite joins (#10285)
* add tests

* working

* cleanup

* fix compile

* fix naming and comment

* fix lints in test

* apply suggested fixes
2024-04-15 14:02:28 -07:00
Jarred Sumner
3f10d5250a [bun:sqlite] Support sqlite3_file_control, better closing behavior, implement Disposable (#10262)
* [bun:sqlite] Support `sqlite_file_control`, better closing behavior, support `using` statements

* docs+flaky test

* Simplify the implementation
2024-04-15 13:06:30 -07:00
Jarred Sumner
dd6beb66d8 [doc] Simplify this guide slightly 2024-04-15 07:45:07 -07:00
Grigory
233624b6ff fix(which/windows): ignore file extension case (#10102)
* fix(which/windows): ignore file extension case

* feat(which): add test for `endsWithExtension` fun

* Revert "feat(which): add test for `endsWithExtension` fun"

This reverts commit fb3ad51de7.

* add test

---------

Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
2024-04-15 05:03:44 -07:00
Georgijs
fdcc844027 fix path resolution for writeFile in nodefs (#10179)
* fix path resolution for writeFile in nodefs

* add test

* [autofix.ci] apply automated fixes

* use force copy

* fix build

* fix test on windows

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-15 05:02:09 -07:00
Ciro Spaciari
74d91f6b51 feat(SSL_renegociate) (#10256)
* allow client renegotiation and allow server renegotiation with limits matching nodejs behavior

* wip before the refactoring and context separation

* investigate if BoringSSL can send a SSL_renegotiate request or only accept

* format-off

* option to disable server renegotiation

* allow tls options on https

* dead_socket when connectError

* propagate cert error

* test

* move the logic to the right place

* cleanup

* Update test/js/node/tls/renegotiation.test.ts

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

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
2024-04-15 05:00:41 -07:00
Jarred Sumner
9f81a6268e Fixes #10259 (#10260) 2024-04-14 03:07:18 -07:00
Jarred Sumner
7b5065c1c9 Use internal setup-bun action
We do not want metrics to come from internal usage. CC @Electroid please remember this going forward.
2024-04-13 05:03:37 -07:00
Jarred Sumner
21ad40e86c Allow SSL negotiation for clients (#10239)
@lithdew
2024-04-13 02:43:10 -07:00
Jarred Sumner
c59f49385f Make Command.Context a pointer (#10237) 2024-04-13 01:53:31 -07:00
Jarred Sumner
8d49a3ee37 Better way to check if a directory exists (#10235)
* Better way to check if a directory exists

* Update sys.zig

* Fix windows build

* Add missing file
2024-04-12 22:19:29 -07:00
Ciro Spaciari
f6b9c0c909 fix(socket) fix error in case of failure/returning a error in the open handler (#10154)
* fix socket

* one more test

* always clean callback on deinit

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

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

* make context close private

* keep old logic

* move clean step to SocketContext.close

* add comment

* wait for close on stop

* cleanup

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-12 20:58:45 -07:00
Jarred Sumner
65d8288d81 Revert "fix create with github URL on windows (#10231)" (#10236)
This reverts commit 1820d08d25.
2024-04-12 20:55:51 -07:00
Ciro Spaciari
4627af5893 fix(stream) fix http body-stream sending duplicate data (#10221)
* some fixes

* cleanup

* more complete test

* fix test + use same server

* opsie

* incremental steps
2024-04-12 19:58:13 -07:00
Dylan Conway
176af5cf58 reachable errors (#10190)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-12 19:02:45 -07:00
Georgijs
1820d08d25 fix create with github URL on windows (#10231)
* correctly ignore error on windows to match posix behavior

* replace zig accessat with bun.sys.existsAt

* fix posix build
2024-04-12 17:12:44 -07:00
Georgijs
472bd6c7de Allow fs.close with no callback (#10229)
* allow fs.close to only take one argument

* add test

* fix tests on windows
2024-04-12 17:11:58 -07:00
Georgijs Vilums
d785d30eaf return correct error code on overlong paths 2024-04-12 15:52:06 -07:00
Georgijs
22d6227a3a fix wrong truncation on fs.writeFileSync with fd argument (#10225)
* fix wrong truncate

* close fd in test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-12 13:02:24 -07:00
Meghan Denny
70023bc4ed linter: ergonomics and new rules (#10197)
* linter: allow a trailing field

* linter: dont fail if no matches are found

* lint: only import 'bun' once

* lint: ban std.mem.indexOfAny

* linter: ignore commented out code and ignore benchmarks

* this was testing nothing

* lint: ban std.debug.print

* this wasnt testing anything either
2024-04-11 22:26:23 -07:00
Jarred Sumner
19da72fe34 Truncate failing output in internal test runner 2024-04-11 21:30:07 -07:00
Meghan Denny
7d673dd7d8 node:child_process: fix propagation of windowsHide and windowsVerbatimArguments option (#10193) 2024-04-11 20:24:47 -07:00
Meghan Denny
ca98138936 add 'build:windows' package.json script for easier local dev (#10194) 2024-04-11 20:24:03 -07:00
Jarred Sumner
d00b5b94ea Make receiving data over TCP faster on Windows (#10191) 2024-04-11 20:10:09 -07:00
Georgijs
ff5ef512c7 correctly handle --cwd flag (#10187)
* actually change cwd on posix

* add test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-11 19:22:29 -07:00
Georgijs
545cb546cc feat(cli): --filter flag (#8185)
* Skeleton code for `bun run --workspace`

* Update run_command.zig

* implement directory traversal to find workspace root

* finish --workspace implementation

* clean up changes in run_command.zig

* add workspace tests, update harness to handle nested dirs

* [autofix.ci] apply automated fixes

* basic filtering

* [autofix.ci] apply automated fixes

* working filter without patterns

* update tests, filter mostly working

* simplify package name parsing, commit tests

* support filter even without workspace setup

* move filter arg handling to separate source file

* use bun.sys.chdir, match root package for scripts

* fix exit code handling

* ignore node_modules and directories starting with . in --filter

* progress converting --filter to use iterators

* convert filtering to use iterators

* cleanup

* implement DirEntry access method for glob (currently crashing)

* cleanup and fixes

* run js files in subprocess when filter flag passed

* clean up dead code

* fix fd leak in run_command.zig

* [autofix.ci] apply automated fixes

* fix issues after merge

* use posix-spawn in runBinary, fix resource PATH variable resource leak

* move filter argument to runtime category

* fix test harness

* add js and binary tests to filter-workspace

* [autofix.ci] apply automated fixes

* fix compile after merge

* [autofix.ci] apply automated fixes

* clean up filter-workspace test

* [autofix.ci] apply automated fixes

* fixes to running binaries

* fix actually setting cwd_override

* windows fixes

* address some review comments

* handle malformed JSON

* add various tests

* [autofix.ci] apply automated fixes

* update docs for filter

* [autofix.ci] apply automated fixes

* reset tinycc commit

* filtered run prototype

* make pretty

* implement abort handler (not working)

* make prettier

* prep for windows

* windows path and printing fixes

* implement log-style output (not tui)

* fix issues when logging to file

* revert a bunch of unecessary changes

* cleanup

* implement dependency order execution

* detect  circular dependencies, fix cancel hang

* Fix `$PATH`

* ignore dep order on loop, stream on linux, sort pkgs

* support pre and post scripts

* add more filter tests, print elapsed time

* enable 'bun --filter' without run

* fix harness after merge

* [autofix.ci] apply automated fixes

* print number of scripts we're waiting for

* update docs, fix windows build

* fix tests on windows

* [autofix.ci] apply automated fixes

* fix uninitialized memory

* use terminal synchronized update sequences

* Add skip list

* Preallocate

* Use current bun in tests

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-11 19:06:50 -07:00
Jarred Sumner
688844b472 refactor: ban std.debug.assert (#10168)
* Ban `std.debug.assert`

* Create .clangd

* Update lint.yml

* Update linter.ts

* update

* lint

* Update linter.ts

* Update linter.ts

* update

* Update linter.ts

* update

* Update linter.ts

* more

* Update install.zig

* words

* Remove UB
2024-04-11 17:52:29 -07:00
Georgijs
0f10d4f1be correctly ignore error on windows to match posix behavior (#10186) 2024-04-11 15:10:52 -07:00
Georgijs
c2ac5d4d18 fix example in bun add help text (#10185) 2024-04-11 15:10:33 -07:00
David Ferguson
edeb75a84a Reference .exists() in File-IO Docs (#9957)
* add mention of .exists()

* show that the exists method returns a promise in the docs

* remove unnecessary white space

* update type ref to show that exists returns a promise
2024-04-11 13:24:49 -07:00
Dale Seo
57208cb02e fix typos (#10131) 2024-04-10 12:32:47 -07:00
Evan Shortiss
5b4b6931c4 docs: add guide for neon serverless postgres driver (#10126) 2024-04-10 05:25:27 -07:00
Jarred Sumner
257f4c1b3e Bump zig std lib 2024-04-10 05:21:05 -07:00
Jarred Sumner
459bcdc5ac Concurrent uninstalls (#10111)
* Concurrent uninstalls

* Try disabling concurrency

* Get `rm` tests to pass on Windows

* Fix more things

* Undisable concurrency

* handle error

* Deflake

* [autofix.ci] apply automated fixes

* Undo

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-10 05:09:14 -07:00
Jarred Sumner
f5c8914c8a Re-sync URL from WebKit + set ERR_MISSING_ARGS (#10129)
* Update URL from WebKit

* Set `ERR_MISSING_ARGS` code on all Error objects from C++

* Fix the `code`

* [autofix.ci] apply automated fixes

* Micro optimize URL

* [autofix.ci] apply automated fixes

* Update url.mjs

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-09 23:21:11 -07:00
Jarred Sumner
1e20f618c9 [bundler] Do not generate sourceContents for non-javascript assets (#10140) 2024-04-09 23:18:09 -07:00
Meghan Denny
cd52f42148 windows: fs/promises: fix when writing to file opened in append mode (#10134)
* windows: fs/promises: fix when writing to file opened in append mode

* add default values since we're using one now

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-09 22:57:10 -07:00
Jarred Sumner
21fc1f7295 Add test for #10132 (#10136)
* Add test for #10132

* Update 010132.test.ts

* Update 010132.test.ts
2024-04-09 22:51:22 -07:00
Meghan Denny
e209ae81dd meta: ensure there's a single 'bun' import per file in zig (#10137)
* meta: ensure there's a single 'bun' import per file in zig

* undo this change in codegen
2024-04-09 22:41:07 -07:00
Meghan Denny
698d0f7c87 fix vscode json handling in prettier (#10133) 2024-04-09 20:42:42 -07:00
Zack Radisic
baf0d7c40f shell: Fix escaped newlines and add more tests (#10122)
* Fix multiline args and add more tests

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-09 17:25:10 -07:00
Dale Seo
81d021794e stdout and sterr are in err (#10130) 2024-04-09 16:42:23 -07:00
John-David Dalton
769d7a1680 fix: null is not an object at readableStreamCancel (#10091)
* fix: null is not an object at readableStreamCancel

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-09 14:02:23 -07:00
Jarred Sumner
df49a5a8e4 Upgrade AbortSignal & AbortController to latest from WebKit (#10106)
Fixes https://github.com/oven-sh/bun/issues/9977
Closes https://github.com/oven-sh/bun/pull/10086

Thank you @lithdew for investigating and most of the fixes. This adds more of the changes we missed from WebKit into Bun like the ability to follow other signals

Co-authored-by: Kenta Iwasaki <63115601+lithdew@users.noreply.github.com>
2024-04-09 00:49:13 -07:00
Meghan Denny
0dc0919119 vscode: dont hide submodules from file tree (#10104) 2024-04-08 23:54:53 -07:00
Meghan Denny
e30a848c4c vscode/settings: force prettier to use workspace config file 2024-04-08 19:02:40 -07:00
Dylan Conway
c739c4adeb unset ENABLE_VIRTUAL_TERMINAL_INPUT (#10089) 2024-04-08 18:19:52 -07:00
Grigory
00933d597a docs(contributing): add link to guide for windows (#10095)
* docs(contributing): add link to guide for windows

* fix broken link

---------

Co-authored-by: dave caruso <me@paperdave.net>
2024-04-08 15:43:40 -07:00
Jarred Sumner
5baa2fbb87 Use a different cache dir in each test file 2024-04-08 07:39:21 -07:00
Jarred Sumner
2615dc742e Partial fix for #10028 (#10030)
* Partial fix for #10028

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-08 07:32:43 -07:00
Jarred Sumner
a4e8534779 Use a separate cache dir for this test 2024-04-08 07:31:05 -07:00
Jarred Sumner
9380e99e2b Fixes #9952 (#10069)
* Fixes #9952

* Update CMakeLists.txt

* Update CMakeLists.txt

* linux

* isolate this test
2024-04-08 07:27:07 -07:00
Yoav Balasiano
9898e0a731 Improve bun shell docs examples (#10052) 2024-04-08 06:48:21 -07:00
Juan Pablo Rinaldi
ad6aadf7b2 Fix coverage documentation (#10059) 2024-04-08 06:47:43 -07:00
Jarred Sumner
ee05bae2be Make bun install 60% faster on Windows, improve reliability, reduce memory usage (#10037)
* [bundows] Make bun install 60% faster

* [autofix.ci] apply automated fixes

* Do not keep node_modules folder open between async tasks. Make sure we call runTasks on every event loop wakeup.

* Update install.zig

* Fix deadlock

* Make that deadlock impossible

* a little less repetitive

* Fix test failure with local tarball

* Get those tests to pass

* Normalize absolutely

* lets see how many times we call GetFinalPathNameByHandle

* Workaround https://github.com/ziglang/zig/issues/19586

https://github.com/ziglang/zig/issues/19586

* Is the dev-server-100 test failure a hash table collision?

* Give it its own cache dir

* We cannot change the git task ids

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-08 06:25:24 -07:00
Jarred Sumner
d615c11a57 Force non-zero exit code whenever bun install has any packages which failed to install (#10041)
* If any failed to install, always exit with non-zero

* [autofix.ci] apply automated fixes

* This test should fail

* Update bun-link.test.ts

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-07 16:12:16 -07:00
Jarred Sumner
3679f69b70 Disable assertion on Windows 2024-04-06 15:19:52 -07:00
Tomer Horowitz
0b0bf353fa docs: Updated Bun.nanoseconds documentation (#9986) 2024-04-06 02:47:47 -07:00
Giorgio Bellisario
c4847f464e fix typo: missing "v" prefix on installed Bun version (#9941) 2024-04-05 19:17:32 -07:00
Jarred Sumner
c8d072c2a9 Fixes #9978 (#9995) 2024-04-05 17:42:34 -07:00
dave caruso
f014f35531 fix(windows): use bun.spawnSync for bun upgrade + different check for bun (#10006)
* small changes

* [autofix.ci] apply automated fixes

* fxifsdahjfkdsahjk

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-05 17:30:32 -07:00
Meghan Denny
fd3cd05647 shell: more builtin commands (#9908)
* remove asString and improve fromString

* make writeNoIO return Maybe

* shell: add builtin command 'yes'

* shell: add builtin command 'seq'

* shell: yes+seq: fix usage string

* shell: add builtin command 'dirname'

* shell: add builtin command 'basename'

* add more tests

* update shell docs with list of commands

* add 'bun exec' launch configurations

* fix AsyncDeinitReader name

* fix 'yes' command IO

* shell: rewrite 'bun' to 'bun-debug' when self is bun-debug

* make the docs not lie about bun being a shell builtin

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-05 16:29:50 -07:00
Jarred Sumner
20085d8ddc Merge conflict fix 2024-04-05 15:41:45 -07:00
Jarred Sumner
5735feac5d Redo file watcher + Fix EBUSY when saving lockfile on Windows (#9972)
* Fix `EBUSY` when saving lockfile on Windows

* Redo file watcher wrapper on Windows

* Update lockfile.zig

* Update win_watcher.zig

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

Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>

* Add retry logic

* Comments

* more careful

* smaller

* Fix garbage

* Normalize the paths

* hmmm

* [autofix.ci] apply automated fixes

* try

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-05 15:40:05 -07:00
dave caruso
4ba993be7e fix(install.ps1): change cpu check (#9921) 2024-04-05 15:35:46 -07:00
sitiom
0b2bb1fdc1 docs: add scoop installation method (#9818)
* docs: add scoop installation method

* Update installation.md

* Add upgrade and uninstall instructions

* Update installation.md

* add ps prompt to code blocks

---------

Co-authored-by: dave caruso <me@paperdave.net>
2024-04-05 14:55:19 -07:00
Dylan Conway
b29cf75a24 fix(install): allow installing without lockfile with --production (#9923)
* check for not_found lockfile load result

* Fix tests

* update tests

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-04-05 14:54:57 -07:00
Eric L. Goldstein
05fb044577 Add types for node:util styleText() (#9945) 2024-04-05 13:31:50 -07:00
Jarred Sumner
8825b29529 bump webkit (#9997)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-04-05 12:09:27 -07:00
Dylan Conway
182b90896f fix(parser): handle empty type parameters and conditional union/intersection bugfix (#9964)
* tests

* allow_empty_type_parameters

* pass options through unions and intersections
2024-04-05 00:45:43 -07:00
Zack Radisic
40e33da4b4 Fixes (#9940) 2024-04-04 19:46:53 -07:00
Jarred Sumner
f393f8a065 bun install launch.json 2024-04-04 19:31:10 -07:00
Jarred Sumner
a09c421f2a ```sh-diff doesn't work 2024-04-04 08:48:51 -07:00
Jarred Sumner
ca1dbb4eb2 Revert "remove ENABLE_VIRTUAL_TERMINAL_INPUT (#9913)" (#9935)
This reverts commit 06ec233ebe.
2024-04-04 07:34:33 -07:00
Jarred Sumner
8a3b6f0439 Fixes #6730 (#9930)
* Fixes #6730

* Fix test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-04-04 07:26:53 -07:00
Jarred Sumner
e7d8abb263 Don't recommend something that doesn't work on windows 2024-04-04 04:51:53 -07:00
Dylan Conway
013bc79f62 ignore EndOfStream error (#9926) 2024-04-04 04:31:47 -07:00
Jarred Sumner
8326235ecc Ask for fewer permissions when opening directories (#9928)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-04-04 04:18:15 -07:00
Jarred Sumner
7543bf936a Add missing HasStaticPropertyTable structure flag 2024-04-04 01:36:18 -07:00
Dylan Conway
06ec233ebe remove ENABLE_VIRTUAL_TERMINAL_INPUT (#9913) 2024-04-04 00:30:20 -07:00
dave caruso
0cdad4bebb fix(bun-release): support windows in npm package (#9873)
* fix npm install on windows

* try again

* again

* copy less file

* revert changes

* remove package.json from git

* okay

* now?
2024-04-03 23:16:48 -07:00
Ashcon Partovi
14c23cc429 Define BUN_INSTALL_BIN in Dockerfiles
Fixes #8753
2024-04-04 13:24:53 +09:00
Ashcon Partovi
0dfbdc711a Remove python3 from slim and alpine Dockerfiles to match Node.js 2024-04-04 13:22:41 +09:00
Ashcon Partovi
3cde2365ea Do not format Dockerfiles 2024-04-04 13:22:11 +09:00
dave caruso
3cfb2816ac docs 2024-04-03 21:11:15 -07:00
Jarred Sumner
c8f5c9f29c Fixes #9851 (#9886)
* Fixes #9851

* Fix

* Fix
2024-04-03 21:02:02 -07:00
Jarred Sumner
00f27fbeec Get bunx tests to pass on Windows (#9729)
* Get bunx tests to pass on Windows

* wip

* WIP

* wip

* wip

* ads

* asdf

* makeOpenPath

* almost revert

* fix build

* enoent

* fix bun install git repos

* cleanup

* use custom zig stdlib from submodule

* update dockerfile to copy zig stdlib sources

* fix dockerfile, update gitmodules

* fix dockerfile

* fix build

* fix build

* fix symlinkat

* fix build

* fix build

* Remove usages of unreachable

* Fixup

* Fixup

* wip

* fixup

* Fix one of the bugs

* asd

* Normalize BUN_INSTALL_CACHE_DIR var

* Set iterable to false when we're about to delete

* Update bun.zig

* I still can't repro this outside CI

* i think that fixes it?

* fix posix compile

* factor out directory creation

* update all install methods to use InstallDirState

* move walker creation to init function

* fix error cleanup

* fix posix compile

* all install tests pass locally

* cleanup

* [autofix.ci] apply automated fixes

* Fix posix regressions

---------

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Meghan Denny <hello@nektro.net>
Co-authored-by: Georgijs Vilums <georgijs.vilums@gmail.com>
Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
Co-authored-by: Georgijs Vilums <georgijs@bun.sh>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-04-03 20:53:28 -07:00
Jarred Sumner
76795af695 Fixes https://github.com/oven-sh/bun/issues/9807 (#9875)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-04-03 20:27:50 -07:00
Zack Radisic
a4b151962a feat: Support subshells in Bun shell (#9905)
* fix #9823

* subshell

* Refactor a bit and add a lot of tests

* delete random code

* make tests pass on windows

* Cleanup

* add sharp test

* Resolve comments

---------

Co-authored-by: Georgijs Vilums <georgijs.vilums@gmail.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-03 20:27:20 -07:00
Ciro Spaciari
1cde9bcdac fix(server) fix body-stream (#9898)
* some fixes

* WIP

* wip wip

* more debug

* closer

* sending a really big payload at once is still broken

* now we need to avoid segfault happening inside onWritable after destroy

* opsie

* cleanup

* more cleanup

* more WIP, closer need to fix cork

* fix cork actually not writing non-optional data

* make onWritable return actually do something

* actually clean the on writable handler

* remove unreachable condition

* we are not looping anymore

* little revert

* fix possible fault

* inform backpressure on chunked encoding

* just queue when tryEnd

* remove unreachable code
2024-04-03 20:25:05 -07:00
Eric L. Goldstein
0bd7265e8f Remove documentation references to environment variable inlining because the bundler does not do so (#9901) 2024-04-03 18:14:20 -07:00
Dylan Conway
c831dd8db8 Upgrade webkit (#9885)
* span

* remove JSStringIsEqualToString

* bump webkit tag

* span literal

* undo

* fix windows build

* Update JSStringDecoder.cpp

* Update JSStringDecoder.cpp

* Update JSStringDecoder.cpp

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-04-03 17:10:39 -07:00
Jarred Sumner
390441327f Fixes #9778 (#9834)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-04-03 02:47:31 -07:00
Jarred Sumner
2e0e9f135b Fixes #9878 (#9883)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-04-03 02:47:13 -07:00
Jarred Sumner
36f1bd3694 Truncate source lines in error messages (#9832)
* Truncate source lines in error messages

* Update .prettierignore

* trim

* fix

* try

* fix

* 1 more time

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-04-03 02:46:10 -07:00
Ciro Spaciari
289d23b377 fix(uws) uWS uintmax_t > uint64_t (#9866)
* wip check this on Posix, probably better to used fixed types on uWS instead of uintmax_t here

* uintmax_t > u64
2024-04-03 01:57:33 -07:00
Meghan Denny
bb483e8479 shell: implement $0, $1, argv accessors (#9740)
* shell: organize imports

* shell: dont allocate when printing errors

* shell: implement $0, $1, argv accessors

* add more tests

* oops need this commit too

* make these logs listen to silencing logs

* expand switch else statements

* align behavior with bash

* this isnt referenced anywhere

* add missing test file

* add another test

* revert this change

* cache utf8 converted version of positionals

* rebase fixes

---------

Co-authored-by: Georgijs Vilums <georgijs.vilums@gmail.com>
2024-04-02 23:07:27 -07:00
Meghan Denny
268f13765c ci: windows: use bun install (#9730)
* ci: windows: use bun install

* run the workflow

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-02 17:57:44 -07:00
Georgijs Vilums
801e475c72 update readme again 2024-04-01 09:37:48 -07:00
Georgijs Vilums
a073c85fdb update readme to include windows install command 2024-04-01 09:35:03 -07:00
dave caruso
8cb9f59753 update installation docs 2024-04-01 09:30:47 -07:00
dave caruso
5903a61410 Bun 1.1 2024-04-01 08:57:05 -07:00
dave caruso
b4941cdb0c not canary 2024-04-01 08:55:21 -07:00
Jarred Sumner
58417217d6 Tweak cleanup code in PipeReader for files (#9746)
* WIP: some fixes and improvements

* cleanup

* WIP: some fixes and improvements

* cleanup

* dont pause

---------

Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
2024-04-01 08:53:39 -07:00
Jarred Sumner
2d57f25637 Bump 2024-04-01 08:52:24 -07:00
cirospaciari
83a99bf190 revert 2024-04-01 12:14:47 -03:00
cirospaciari
e2ffa66bf7 dont pause 2024-04-01 12:12:44 -03:00
Meghan Denny
8980dc026d shell: fix crash in 'ls' and other misc improvements (#9772)
* shell: ls: fix crash when passing argument

* shell: pwd: output was missing newline

* shell: exit: output was missing newline

* shell: pwd: make sure output goes to proper stdout/stderr

* add test ensuring all those work

* fix build error

* fix

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: dave caruso <me@paperdave.net>
2024-04-01 07:54:42 -07:00
Jarred Sumner
4192728592 fix build (#9773)
Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
2024-04-01 07:11:02 -07:00
Meghan Denny
bdfbcb1898 use bun shell for lifecycle scripts on windows [v3] (#9771)
* these comments were redundant

* better windows support here

* slightly better error message

* didnt realize this variable already existed

* fix node-gyp shim script

* move 'windows bin linking shim should work' to its own file

* run all lifecycle scripts on windows with bun shell

* tidy

* clean imports

* this seemed missing

* remove these comments

* fix the shim again

* fix posix release ensureTempNodeGypScript

* revert this change, it was correct before
2024-04-01 06:48:44 -07:00
Dylan Conway
6e07f9477c fix(streams): don't lose bytes on drain (#9768)
* fix

* clear

* update

* test

* fix test

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-01 05:23:47 -07:00
dave caruso
2dd2fc6ed0 install script 2024-04-01 04:02:26 -07:00
dave caruso
9e6e8b0234 feat(runtime): align import.meta.resolve with node.js's implementation (#5827)
* works

* works

* a

* fix zig compiler error

* fix things

* [autofix.ci] apply automated fixes

* a

* not done

* finish this

* [autofix.ci] apply automated fixes

* self check

* delete committed generated file (#9717)

* Fix bug with PipeWriter (#9714)

* fix!: do not lookup cwd in which (#9691)

* do not lookup cwd in which

* fix webkit submodule

* fix compilation on linux

* feedback

* default process.env.NODE_ENV to undefined (#9695)

* small changes

* [autofix.ci] apply automated fixes

* fix(windows) fix node-stream tests/ windows file reader/writer (#9718)

* fix canceled onFileRead

* report continue errors and fix closing

* also fix pipe writer

* avoid possible memory leaks

* Propagate errors in open

---------

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

* posix failures

* windows fixes

* avoid using c++ labels

* add a resolver

* fix compile test AGAIN

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Meghan Denny <hello@nektro.net>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-04-01 02:21:34 -07:00
Zack Radisic
d53e6d6323 feat: Shell if-else, conditional expressions, running commands in background (#9631)
* rename conditional -> binary

* Parse if clauses

* `if` works

* Conditional expressions

* Support If clause condition and branches multi-statements

* cond expr tests

* more

* Fix parse tests

* `&` commands

* clean up

* Make it compile for windows

* Fix test

* Remove If/Else/Elif/Then/Fi tokens

* Fix parsing ambiguities

* Resolve some comments

* More tests fix bugs

* Fix parsing and add more tests ported from GNU bash

* Fix `&`on left side of `&&` error message

* leak test fix hopefully

* todo some tests because `wait` is not implemented

* Disable background commands for now

* Resolve additional comments

* Fix merge conflicts

* Fix broken tests from merge

* Add `==` and `!=` and fix parsing bug

* wow

* fix 09401 test failing... forgot to update `this.inlined.len`

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-04-01 02:07:52 -07:00
Ashcon Partovi
1edacc6e49 Prepare npm i -g bun for Windows 2024-04-01 18:00:16 +09:00
dave caruso
81badbac4c fix(ipc): add json ipc type + buffer incoming messages until a listener is attached. (#8733)
* fix a few ipc issues

* a

* my own revisions

* remove none as a valid type

* a

* fix windows build

* remove comment

* make it work !!!!!!!!

* a

* formatter nonsense

* blah

* huge update refactor

* awa

* wow

* okay
2024-04-01 01:51:15 -07:00
Zack Radisic
7531bfbfe0 add bun exec (#9762)
* add `bun exec`

* Add tests for writing a lot of data for bun exec

* Resolve some comments

* fix on windows
2024-04-01 00:57:19 -07:00
Georgijs
1a989c9ad2 ref tls socket on upgrade (#9766)
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-03-31 21:32:25 -07:00
Chawye Hsu
ab7825cca5 windows: fix bun pm bin -g path not added complaining (#9763)
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
2024-03-31 17:55:36 -07:00
dave caruso
f02752577b fix: which should use cwd if given a relative filepath (#9761)
* Revert "fix!: do not lookup cwd in which (#9691)"

This reverts commit 4869ebff24.

* fix which implementation to be more accurate

* t

* which tests windows

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-31 16:50:16 -07:00
dave caruso
c177e054f5 feat!: shell will now throw on error by default (#9720)
* make the shell throw by default

* make shell default to throws(true)

* ok

* mv tests

* a

* a

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-31 16:13:59 -07:00
dave caruso
a01b01ae72 chore!: enable 1.1's breaking changes (#9724)
* root scripts in foreground

* ignore if silent

* test for breaking changes

* move back to installPackages

* [autofix.ci] apply automated fixes

* boolean variable, comptime, 1_1_0

* flip the 1.1 flag

* add for the next batch of breakings

* make it buidl

* enable breaking changes tests

* fix version fmt

* silent node-gyp

* comment change

---------

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-03-31 16:12:59 -07:00
dave caruso
456a32344e windows: skip cleaning up old binary (#9696) 2024-03-31 16:12:21 -07:00
Jarred Sumner
6164fac256 Revert "pipe.signal.ptr == subprocess.stdin, not subprocess"
This reverts commit 4bbcc39d2f.
2024-03-30 22:55:28 -07:00
Jarred Sumner
4bbcc39d2f pipe.signal.ptr == subprocess.stdin, not subprocess 2024-03-30 22:10:26 -07:00
Meghan Denny
62c8c97e24 add test.todoIf and fix bun-install-registry.test.ts on windows (#9723)
* bun:test: implement test.todoIf and describe.todoIf

* fix bun-install-registry.test.ts and mark some as todo

* add even more tests

* remove todoIf from this file

* [autofix.ci] apply automated fixes

* fix regression

* this extra expect was incorrect

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-30 21:25:05 -07:00
Jarred Sumner
eb708d34ae Fixes #9748 (#9751)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-30 21:23:34 -07:00
Jarred Sumner
c3ba60eef5 Fixes #9739 (#9752)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-30 20:57:40 -07:00
Meghan Denny
7f71f10ad1 import-meta.test.js: isolate the query param test into separate cases for esm and cjs (#9750)
* import-meta.test.js: isolate the query param test into separate cases for esm and cos

* make name more accurate
2024-03-30 20:09:01 -07:00
Jarred Sumner
9939049b85 Fixes #5319 (#9745)
* Fixes #5319

* Make this test better

* another test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-30 20:08:34 -07:00
Meghan Denny
a5c5b5dc61 console-iterator.test.ts: add a case that only uses latin1 characters (#9749) 2024-03-30 18:16:10 -07:00
Ciro Spaciari
a2835ef098 fix(websockets) fix socket/websockets (#9645)
* repro

* cleanup

* avoid shutdownRead on SSL

* still dont fix

* more

* some ssl

* cleanup

* handle shutdown

* make actually pass the tests

* fix STATUS_STACK_BUFFER_OVERRUN?

* revert some, cleanup fetch.tls.test

* make clear why we need on_handshake when closing

* more

* revert

* cleanup

* cleanup + less Bun.gc

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-30 16:32:19 -07:00
Jarred Sumner
31c4c59740 Make duplicate simultaneous bun install work better (#9738)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-30 14:06:37 -07:00
Jarred Sumner
0248e3c2b7 Add NODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT=1 (#9742)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-30 14:03:52 -07:00
Jarred Sumner
d869fcee21 Fixes #7896 (#9712)
* Fixes #7896

* Update ws.test.ts

* Delete the old one

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-30 04:27:00 -07:00
dave caruso
55f8ae5aea feat(windows): properly implement setRawMode (#9734)
* setRawMode rewrite for Windows

* work on posix using old approach

* [autofix.ci] apply automated fixes

* no print

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-30 04:06:23 -07:00
Meghan Denny
e414d107e6 ci: windows: show all failing files (#9736)
* ci: windows: show all failing files

* fix workflow variables

* fix workflow v2
2024-03-30 02:00:24 -07:00
Meghan Denny
0103e2df73 windows: pass bunshell.test.ts (#9733) 2024-03-30 01:58:28 -07:00
Jarred Sumner
02ad501f9e Add missing globs 2024-03-29 23:40:13 -07:00
saklani
d433a1ada0 fix: Define missing crypto.constants defined on Node (#9511)
* define crypto.constants

* requested changes

* fix: missing jsNumber wrap

---------

Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
2024-03-29 21:53:52 -07:00
dave caruso
d712254128 internal: remove secret hidden internals and introduce new way to call native code from js (#8166)
* oooooh magic

* stuff

* run format

* ok

* yippee

* run the formatter back

* finish things up

* fix webkit

* more

* [autofix.ci] apply automated fixes

* fix compile

* fix compilation on windows, it seems to not work though :(

* update

* a

* v

* ok

* [autofix.ci] apply automated fixes

* OOPS

* bump bun to reduce ci bugs

* a

* js2native is done!

* improve array binding

* rebase

* some final stuff

* wasi fixes

* os

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-29 21:47:11 -07:00
Meghan Denny
a500c69728 shell: implement 'true' and 'false' builtin commands (#9728) 2024-03-29 21:36:13 -07:00
Dylan Conway
d30b53591f fix(napi): fix finalizer callback (#9732)
* fix finalize callback

* fix test
2024-03-29 21:33:48 -07:00
Meghan Denny
b8389f32ce shell: add 'exit' builtin command (#9705)
* shell: add 'exit' builtin command

* remove loop here

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-29 18:20:44 -07:00
Dylan Conway
7172013a72 fix(windows): use extended max path prefix for hardlinks during install (#9721)
* uncomment code

* use GetFinalPathNameByHandleW

* add packages with large names

* delete

* test large package name
2024-03-29 18:13:39 -07:00
Jarred Sumner
8ff7ee03d2 stdio tweaks (#9726) 2024-03-29 18:11:47 -07:00
dave caruso
5296c26dab fix bunx-bins verdaccio package (#9697)
* fix bunx-bins verdaccio package

* env suck

* [autofix.ci] apply automated fixes

* ugh

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-29 17:55:06 -07:00
Jarred Sumner
da6826e2b7 Unmark known failing 2024-03-29 17:49:29 -07:00
Jarred Sumner
a637b4c880 Unmark known failing 2024-03-29 17:49:03 -07:00
Ciro Spaciari
d9074dfa5d fix(windows) fix node-stream tests/ windows file reader/writer (#9718)
* fix canceled onFileRead

* report continue errors and fix closing

* also fix pipe writer

* avoid possible memory leaks

* Propagate errors in open

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-29 16:58:55 -07:00
dave caruso
ba9834d746 default process.env.NODE_ENV to undefined (#9695) 2024-03-29 16:42:50 -07:00
dave caruso
4869ebff24 fix!: do not lookup cwd in which (#9691)
* do not lookup cwd in which

* fix webkit submodule

* fix compilation on linux

* feedback
2024-03-29 16:42:17 -07:00
Jarred Sumner
a9804a3a11 Fix bug with PipeWriter (#9714) 2024-03-29 16:11:24 -07:00
Meghan Denny
6bedc23992 delete committed generated file (#9717) 2024-03-29 15:53:11 -07:00
dave caruso
093e9c2499 ci: does this fix the windows build (#9715)
* does this fix the windows build

* [autofix.ci] apply automated fixes

* a

* enable tar oop

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-29 15:20:13 -07:00
dave caruso
3047c9005e fix: add a better error message for fetch when it fails with an unknown code (#9663)
* add a better error message for fetch when it fails with an unknown code

* Update src/bun.js/webcore/response.zig

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

* [autofix.ci] apply automated fixes

* fix compilation

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-29 14:18:11 -07:00
Jarred Sumner
e80e61c9a3 Allow 0-length ArrayBuffer & Blob in Bun.spawn stdio (#9557)
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-03-29 13:51:45 -07:00
Meghan Denny
e3bf906127 memoize all calls to selfExePath (#9703)
* memoize all calls to selfExePath

* Fix threadsafety issue

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-29 13:29:42 -07:00
Walter
4e7ed173ef fix!: remove worker from default conditions (#9256)
Co-authored-by: Walter Blacke <walter.blacke@vegabyte.studio>
2024-03-29 13:22:42 -07:00
Jarred Sumner
31befad163 Workaround for #9041 (#9580)
* Workaround for #9041

* Fix crash with auto install

* Fixup this test

* Update 09041.test.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-29 13:17:12 -07:00
Meghan Denny
94b01b2f45 test: pm: don't delete temporary directories (#9649) 2024-03-29 12:29:50 -07:00
PondWader
9ecb691380 Fix URL.canParse.length (#9710)
* Fix URL.canParse.length

* Add URL.canParse.length test

---------

Co-authored-by: John-David Dalton <john.david.dalton@gmail.com>
2024-03-29 12:21:49 -07:00
Meghan Denny
fb8a299765 shell: windows: make EnvMap case-insensitive (#9704)
* shell: windows: make EnvMap case-insensitive

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-29 12:21:09 -07:00
dave caruso
40f61ebb91 fix: EnvStr.initSlice handles zero length strings more reliably. (#9698)
* fix intcast on ptr value of zero-length strings

* Make this better

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-28 22:17:20 -07:00
Jarred Sumner
4512a04820 Add missing code to TextDecoder "Invalid byte sequence" error (#9700)
* Fix missing `ERR_ENCODING_INVALID_ENCODED_DATA` code in TextDecoder

* Update text-decoder.test.js

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-28 22:06:40 -07:00
Dylan Conway
1ad6a3dfb9 fix(http2): fix crash in http2 tests (#9676)
* add the settings

* dont crash on unsupported settings

* add missing property

* less flaky tests

* comment

* Update test/js/node/http2/node-echo-server.fixture.js

* Update test/js/node/http2/node-http2-memory-leak.js

* Update test/js/node/http2/node-http2-memory-leak.js

---------

Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-28 21:39:40 -07:00
dave caruso
1ae9f998f4 alternate approach to env fix (#9689)
* alternate approach to env fix

* rename variable

* Revert "rename variable"

This reverts commit 2374bcd487.

* a

* we pass on window

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-28 21:30:49 -07:00
dave caruso
d113803777 add server ws.terminate (#9693)
* add server ws.terminate

* [autofix.ci] apply automated fixes

* it has to be blazing fast

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-28 18:17:55 -07:00
Jarred Sumner
aaef6d350a Fix unlikely edgecase in WebSocket client (#9694)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-28 17:45:39 -07:00
dave caruso
0751581e86 bump: Bun v1.0.36 2024-03-28 17:42:06 -07:00
Zack Radisic
c510daac55 Fix shell regressions part 2 (#9684)
* Fix undefined memory on subprocess exit immediately and fix crash when writing a lot of data

* format

* Test for #9458

* Document

* Lazily create iowriters (i think this solves fdleak tests?)

* Fix `big_data` test hanging

* I think this make leak tests more stable

* accidentally had deinit in another thread

* oops

* Fixes

* shell `big_data` test redirect to file

* stuff

* Fix windows /dev/null

* Increase timeout

* Resolve comments and better input test
2024-03-28 17:31:43 -07:00
Jarred Sumner
ec66b07720 Make bun meta more helpful (#9690)
* Make `bun meta` more helpful

* More tweaks

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-28 15:55:47 -07:00
dave caruso
b53147ad97 docs: update contributing page 2024-03-28 13:15:56 -07:00
Jarred Sumner
dea877f19b Revert "Fix some shell regressions (#9630)" (#9670)
This reverts commit aee8eeaf45.
2024-03-27 20:56:54 -07:00
Jarred Sumner
d66ace959d Use &= ~ instead of ^= 2024-03-27 20:27:16 -07:00
Jarred Sumner
db1283e982 Fixes #9669 2024-03-27 20:09:31 -07:00
Jarred Sumner
79ced2767a Let's try calling close_range CLOSE_RANGE_CLOEXEC starting on 4 instead of 0 2024-03-27 19:16:23 -07:00
Ashcon Partovi
081c7fff00 Add missing aliases to expect() types 2024-03-27 18:28:48 -07:00
Dylan Conway
8a12c2992b fix(windows): fix prompts.test.ts (#9650)
* remove comment

* fix prompt test

* more time like leaky case

* remove comments

* fixed

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-27 16:49:33 -07:00
Dylan Conway
306b87e929 fix(test): fix crash in expect.toHaveProperty (#9653)
* make sure string doesnt unref

* use String and assign to variable
2024-03-27 16:48:44 -07:00
Stefan Buhrmester
fcd7b01dba add await to Bun.plugin(...) (#9665) 2024-03-27 16:47:40 -07:00
Eduard
9f20d40678 Fix docs for dynamic linking of libatomic (#9646) 2024-03-27 15:01:41 -07:00
Ciro Spaciari
d030cce8bb fix(windows) socket and timers/performance tests (#9651)
* WIP missing keepalive

* cleanup

* is a Bun.sleep bug?

* no bun sleep

* fix exception

* revert

* fix setTimeout/Bun.sleep

* add Bun.sleep keepalive test

* fixes

* one more bonus fix

* fix early firing of timers

* use localhost and pass the server.hostname

* opsie
2024-03-27 10:31:12 -07:00
Zack Radisic
aee8eeaf45 Fix some shell regressions (#9630)
* Fix undefined memory on subprocess exit immediately and fix crash when writing a lot of data

* format

* Test for #9458

* Document

* Lazily create iowriters (i think this solves fdleak tests?)

* Fix `big_data` test hanging

* I think this make leak tests more stable

* accidentally had deinit in another thread

* oops

* Fixes

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-27 09:33:38 -07:00
Jarred Sumner
a9ad303fe2 Add test for fs.writev & fs.readv (#9632)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-27 09:00:39 -07:00
dave caruso
e808cdb725 windows: fix argument handling in bin shim (#9622)
* awa

* update v5

* a

* [autofix.ci] apply automated fixes

* tarball

* a

* a

* blah

* [autofix.ci] apply automated fixes

* bump

* wah

* [autofix.ci] apply automated fixes

* farther

* a

* [autofix.ci] apply automated fixes

* im confused

* [autofix.ci] apply automated fixes

* Fix typo (#9623)

* Fix crash in Bun.escapeHTML (#9619)

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>

* Fixes #9610

* Implement `fs.openAsBlob` (#9628)

* Implement `fs.openAsBlob`

* Use a function

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>

* Fix `bun install -g` not working on Docker
Closes #8753

* Revert "Fix `bun install -g` not working on Docker"

This reverts commit 20fce1a1be.

* what happens if nonblocking tty (#9608)

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>

* merge

* a

* blah

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: sequencerr <45060278+sequencerr@users.noreply.github.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2024-03-26 22:38:01 -07:00
Jarred Sumner
1675349667 what happens if nonblocking tty (#9608)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-26 13:53:58 -07:00
Ashcon Partovi
264b4be44a Revert "Fix bun install -g not working on Docker"
This reverts commit 20fce1a1be.
2024-03-26 10:41:28 -07:00
Ashcon Partovi
20fce1a1be Fix bun install -g not working on Docker
Closes #8753
2024-03-26 10:39:40 -07:00
Jarred Sumner
fa145b2218 Implement fs.openAsBlob (#9628)
* Implement `fs.openAsBlob`

* Use a function

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-25 17:21:11 -07:00
Jarred Sumner
c8cc134edb Fixes #9610 2024-03-25 15:17:45 -07:00
Jarred Sumner
d9b7b45080 Fix crash in Bun.escapeHTML (#9619)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-25 14:37:20 -07:00
sequencerr
43ab5313da Fix typo (#9623) 2024-03-25 14:26:47 -07:00
Dylan Conway
c7289b2cd6 fix(windows): fix a few more tests (#9550)
* fix napi tests

* only windows, update passing tests

* remove closing remainder

* fix child_process-node.test.js

* might fail in ci

* oops

* fix dns tests

* remove comment

* sometimes it is slow

* update test

* maybe fix timeout error

* one more try

* off by one, valid npm package name

* update test

* fix hot tests

* revert

* remove close
2024-03-25 13:34:08 -07:00
Dylan Conway
e39a7851c8 fix(install): package binary map bugfix (#9621) 2024-03-25 12:49:52 -07:00
Jarred Sumner
ccaacdc56c Fix incorrect GETFD and O_NONBLOCK setting (#9607)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-24 20:26:08 -07:00
Jarred Sumner
c57cd5b6cd Update shell.md 2024-03-24 18:44:06 -07:00
Jarred Sumner
c71325b52e Fix regression with console.log in --watch on linux (#9601)
* Fix regression with console.log in --watch on linux

* Unset CLOEXEC

* more

* Enable inheritance on windows

* Don't forget to close the handles...

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-24 18:38:41 -07:00
Jarred Sumner
2765347b65 Enable more C++ warnings (#9602)
* Enable more C++ warnings

* Only enable these ones in release builds

* Update MessagePortChannel.cpp

* Update BunProcess.cpp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-24 17:28:58 -07:00
Jarred Sumner
39d1287f03 Port #9278 (#9596)
* Port #9278

Co-Authored-By: argosphil <argosphil@murena.io>

* Fix incorrect type

Co-Authored-By: argosphil <argosphil@murena.io>

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: argosphil <argosphil@murena.io>
2024-03-24 12:21:11 -07:00
Jarred Sumner
d8a09d8517 Remove known-failing-on-windows 2024-03-24 12:13:24 -07:00
Jarred Sumner
e8bb3389ef Tweak how we handle bun's process initialization (#9588)
* Tweak how we handle bun's process initialization

* Update panic_handler.zig

* Update output.zig

* Update __global.zig

* Update __global.zig

* Delete WindowsSpawnWorkaround, fix tests

* Fix bug in Bun.spawn on Linux when O_CLOEXEC is set on stdin stdout or stderr

* More errors

* tweak

* Bounds check

* Update install.zig

* Update dependency.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-03-24 12:09:16 -07:00
David Legrand
73fc225c4c docs: bun shell .sh loader fix (#9592)
`.sh` file loader is working with `.bun.sh` files, not `.sh` files as stated in the documentation
2024-03-24 11:17:00 -07:00
HT
0eb638c899 Update executables.md (#9593)
Bun build with `--compile` flag supports `--external` flag. Tested on bun `1.0.33` and it works
2024-03-24 11:15:19 -07:00
pfg
ee5fd51e88 Fix bundling for bun not using ascii_only (#9571)
* Fix bundling not using ascii_only

* add utf8 test to bundler_compile & make test source ascii

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-23 00:04:36 -07:00
dave caruso
73a55cf075 windows: make more windows tests pass (#9370)
* run-eval.test.ts

* transpiler-cache.test.ts

* node net

* some open things

* a

* a

* yikes

* incredible

* run it back

* a

* this code is what i like to call, incorrect

* ok its all worng

* remove an assertion that is wrong again

* update test things and rebase

* performance test

* mark filesink with mkfifo as todo. see #8166

* hehe

* not done

* awa

* fs test pass

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-22 23:40:45 -07:00
kunoka
32174a2a44 fix: added awaits in Bun.connect calls (#9574) 2024-03-22 20:46:50 -07:00
Xin Chen
71113182c2 fix(init): cannot find console in blank project (#9462)
* Fix cannot find console in default project

* Update src/cli/tsconfig-for-init.json

---------

Co-authored-by: dave caruso <me@paperdave.net>
2024-03-22 10:23:06 -07:00
Jarred Sumner
940448d6b6 add regression test 2024-03-22 07:58:27 -07:00
Jarred Sumner
be4b47d49d Fixes #9563 (#9566)
* Remove flag in a test

* Get this test file to run in jest again

* Fixes #9563

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-22 07:50:00 -07:00
Meghan Denny
f90bb7719b windows: test\js\bun\test\test-test.test.ts passes (#9554) 2024-03-22 00:34:53 -07:00
Jarred Sumner
7276ff9935 Make .decode(a, {stream :true}) slightly faster in TextDecoder 2024-03-22 00:30:50 -07:00
Jarred Sumner
2d61c865fc Replace some of std.ChildProcess with bun.spawnSync (#9513)
* Replace some of std.ChildProcess with bun.spawnSync

* Update process.zig

* Fix some build errors

* Fix linux build

* Keep error

* Don't print a mesasge in this case

* Update spawn.test.ts

* Make `bun install` faster on Linux

* Comments + edgecases

* Fix the tests

* Add bun install launch.json

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-03-21 23:50:48 -07:00
Dylan Conway
7e3e7d2ed4 enable autoinstall, fixup tests (#9539) 2024-03-21 21:12:54 -07:00
Jarred Sumner
b24d3ba5be Fix build 2024-03-21 11:05:52 -07:00
Jarred Sumner
c6f22de360 Make the version number bigger 2024-03-21 10:44:18 -07:00
Jarred Sumner
e124f08caf A few fixes related to CommonJS module loading (#9540)
* Ensure we always deref the source code

* Move more work to concurrent transpiler

* Update NodeModuleModule.h

* Update string.zig

* Make `Bun.gc()` more effective

* Update text-loader-fixture-dynamic-import-stress.ts

* Update ZigSourceProvider.cpp

* Fixes #6946

* Update ModuleLoader.cpp

* Update ModuleLoader.cpp

* Fixes #8965

* Fixups

* Update ModuleLoader.cpp

* Update ModuleLoader.cpp

* Load it

* Update module_loader.zig

* Update module_loader.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-21 10:42:57 -07:00
Jarred Sumner
0948727243 Fixes #9521 (#9530)
* Fixes #9521

* Another test

* Update load-file-loader-a-lot.test.ts

* Update module_loader.zig

* comments

* Rename variable

* Update module_loader.zig

* Update exports.zig

* small cleanup

* bundows

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-21 00:06:24 -07:00
Paul Eboselume
650dc552d4 fixed typo (#9535) 2024-03-20 20:04:05 -07:00
Dylan Conway
3e86b38f32 fix(windows): waiter thread tests (#9538)
* use Bun.sleepSync

* argv0
2024-03-20 20:03:17 -07:00
Ashcon Partovi
cc4479096a Update lockfiles 2024-03-20 09:16:01 -07:00
Ashcon Partovi
d14c99510c Change macOS version check to be a warning, instead of error 2024-03-20 09:09:29 -07:00
Paul Eboselume
e1e3e41e0f Fixed a typo (#9529) 2024-03-20 09:00:36 -07:00
Jarred Sumner
d9496c3802 update bench 2024-03-20 07:16:32 -07:00
Dylan Conway
931e04b019 fix(install): hoisting bug with devDependencies (#9519)
* fix with tests

* move to hoisting describe scope

* Update bun-install-registry.test.ts
2024-03-19 21:46:54 -07:00
Dylan Conway
cee6be12cc test for #9472 and bun pm trust waiter thread bugfix (#9498)
* test max concurrent scripts

* stress test, waiter thread bugfix

* different verbose

* escape

* Update src/install/lockfile.zig

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

* resource usage test

* fix invalid pointer

* another test

* update test

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-19 21:46:03 -07:00
Jarred Sumner
a54264177b Fix coercion edgecase with i32 and i64 (#9518)
* Fix coercsion edgecase

* Add sleep test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-19 20:49:13 -07:00
Gabriel Nunes
5ed609f96b fix(docs): fix broken links in guides (#9512) 2024-03-19 17:59:19 -07:00
Dylan Conway
f15e7f733d Revert "fix invalid pointer"
This reverts commit 3df320d0ed.
2024-03-19 16:48:34 -07:00
Dylan Conway
3df320d0ed fix invalid pointer 2024-03-19 16:45:27 -07:00
Dylan Conway
bf0e5a82f7 fix(windows): install bugfixes for workspaces, tarballs, and relative paths (#8813)
* more tests

* update migration.zig

* fix up paths

* update tests

* update tests

* test

* test

* update registry tests

* comments

* early exit if stream is invalid

* dont pass invalid_fd to openFileAtWindows

* fix merge

* misc crash fix

* make this use optional pointers instead of 0xaa

* ensure absolute paths are propagated properly

* package.json expects forward slash

* this assert was invalid

* add panic checks

* pass bun-remove

* more panic checks

* test: pass bun-add

* querying these hangs outside bun too

* fix compile error from merge conflict resolution

* use compileError instead of comptime unreachable

* tidy

* bunx: check for the .exe bin extension

* bunx: another route to make cache path if it doesnt exist

* install: another case of FolderResolution.getOrPut expecting absolute path

* fix a bun install crash

* dont print zig stack trace if bun install fails

* test: pass bun-link

* test: bunx: add more expects

* test: bun-install-registry: pass

* test: bun-install: pass

* test: bun-pm: pass

* fix merge main error

* fix posix tests

* fix last failing test in bun-install.test.ts
symlink difference between platforms

* bun-install-registry.test.ts fix

* bun-run.test.ts: remove stray console log

---------

Co-authored-by: Meghan Denny <meghan@bun.sh>
Co-authored-by: Meghan Denny <hello@nektro.net>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-18 22:34:15 -07:00
Dylan Conway
06f04b584c fix(install): default trusted dependencies on windows (#9500)
* make sure source data is set too

* make default trusted dependencies work

* undo

* test

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-18 19:40:11 -07:00
Jarred Sumner
76ced7c6ed WIP Make process.stdout sync on windows (#9398)
* Make some things sync on windows

* WIP

* WIP

* remove uses to uv_default_loop

* remove a compiler warning on windows

* edfghjk

* Windows build fixes

* Fixup

* bundows

* Add quotes

* Fix --cwd arg on Windows

* comment

* move this up

* Fix some tests

* `mv` tests pass

* spawn.test passes again

* Allow .sh file extension for Windows

* Unmark failing tests

* env test pass

* windows

* Fix some tests

* Update ProcessBindingTTYWrap.cpp

* Update CMakeLists.txt

* Set tmpdir

* Make it 5s on windows

* Fixup

* Fixup

* Update ProcessBindingTTYWrap.cpp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
2024-03-18 19:35:34 -07:00
Meghan Denny
e1593ce2e5 docs: api/ffi improvements (#9496) 2024-03-18 18:25:26 -07:00
Jarred Sumner
9e91e137f1 check is callable in util promisify timers (#9482)
* Update CMakeLists.txt

* Check is callable in util promisify

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-17 21:39:39 -07:00
Cezary Kupaj
4dd61bfd20 Fix crypto module to have proper id values for sign function (#9248)
* Fix crypto module to have proper id values for sign function

* Revert adding id hash to DSA sign functions - DSA algorithm doesnt use it

* Add tests for crypto.createSign() and crypto.verifySign()

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-17 21:13:43 -07:00
nellfs
ca97a757bb Development environment documentation for openSUSE Tumbleweed (#9479)
* Add openSUSE Tumbleweed to the list of supported Linux distributions in CMakeLists.txt

* openSUSE Tumbleweed setup

* Revert "Add openSUSE Tumbleweed to the list of supported Linux distributions in CMakeLists.txt"

This reverts commit 93faed88a1.

---------

Co-authored-by: nellfs <nellfs@localhost.localdomain>
2024-03-17 21:12:09 -07:00
Jarred Sumner
a74d6f5a20 Clean up a little after #9402 (#9454)
* Clean up after #9402

* More

* More cleanup

* Bring back `dead`

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com>
2024-03-17 21:09:25 -07:00
Zack Radisic
4a6cda8d80 Fixes #9459 (shell mv regression) (#9475)
* Fix `mv`

* Add `mv` tests
2024-03-17 21:08:16 -07:00
Jarred Sumner
5fec71bda4 Fixes #9430 (#9472)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-17 07:19:24 -07:00
Jarred Sumner
3d8c10c116 Fixes #7148 (#9467)
* Fixes #7148

* Fix failing tests

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-17 06:20:24 -07:00
Jarred Sumner
9e8bdaba93 Fixes #9433 (#9471)
* Fix assertion failure when package-lock.json is out of sync with package.json

* Fixes #9433

* Update bun.lockb

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-17 03:42:10 -07:00
Jarred Sumner
c8ec56ec1b Fix assertion failure when package-lock.json is out of sync with package.json (#9468)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-16 23:31:34 -07:00
Jarred Sumner
28d329893b Ensure some logs only generate in debug 2024-03-16 21:45:12 -07:00
Jarred Sumner
17631ce6a0 Fix subprocess.kill(undefined) (#9466)
* Fix subprocess.kill()

* Update spawn-kill-signal.test.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-16 19:35:21 -07:00
Jarred Sumner
7c9f076385 Fixes #3202 (#9461)
* Fixes #3202

* Update ws.js

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-16 17:47:49 -07:00
Jarred Sumner
1879c499b1 Add shell hanging tests (#9463)
* Add shell hanging tests

* Fix shell hanging

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com>
2024-03-16 16:22:14 -07:00
Ciro Spaciari
83863c27b4 fix(windows) fix some test failures (#9417)
* fix ReadFile and fix isEligible for sendfile on windows

* give it a little more time

* actually test tls property

* Update src/bun.js/webcore/blob/ReadFile.zig

Co-authored-by: John-David Dalton <john.david.dalton@gmail.com>

* getServers test on windows

* retry

* check comptime first on isEligible

* wip body-stream

* oopsie

* opsie 2

* revert this

* test

---------

Co-authored-by: John-David Dalton <john.david.dalton@gmail.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-16 05:47:33 -07:00
Jarred Sumner
785d2251da Fix incorrect include order (#9457)
* Update ImportMetaObject.cpp

* Add header guard

* Enable `-Werror=uninitialized` and `-Werror`

* Update napi.cpp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-16 02:50:38 -07:00
Jarred Sumner
a6633e554c Update bunfig.md 2024-03-15 23:38:28 -07:00
Jarred Sumner
324e4f5fff Update bunfig.md 2024-03-15 23:36:25 -07:00
Filip
c9a70f1686 Fixes shell mv with multiple files (#9341)
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-15 23:01:25 -07:00
Jarred Sumner
e89c8d2eaa Fix not using system shell on posix (#9449)
* Use system shell + add to bunfig

* Update CMakeLists.txt

* Fix tests + flags

* Use execPath

* windows

* Propagate exit code

* Add test for default shell in use

* Update bun-run-bunfig.test.ts

* Update bun-run-bunfig.test.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-15 23:00:53 -07:00
Meghan Denny
b23eb60277 test: updated prisma schema (#9450)
* test: updated prisma schema

* test: fix prisma non-determinism

* fix postgres too
2024-03-15 22:55:42 -07:00
dave caruso
b1719f3a70 make import.meta behave better when query string is provided (#9399)
* make import.meta actually use a vali url

* a
2024-03-15 22:44:23 -07:00
Zack Radisic
bd3812df50 Shell fixes (#9402)
* wip

* Fix a bunch of stuff

* Fix cat

* Fix shell rm windows

* Fix glob scan test on windows

* Fix rm on windows

* stuff

* make it compile on windows

* [autofix.ci] apply automated fixes

* fix compile

* Wow

* Minor changes

* Ensure handle is closed

* Regular files are not pollable on linux

* dupe the blob son

* fix mem leak stuf

* dont use O_NONBLOCK

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-15 21:41:11 -07:00
Dylan Conway
9512f5240f bun pm trust bugfix (#9426)
* check error

* test missing packages

* Update test/cli/install/registry/bun-install-registry.test.ts

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-15 21:22:12 -07:00
Jarred Sumner
307cac5ecd await FileHandle functions (#9451)
* Await FileHandle functions

* Update fs.promises.ts

* use await using = await

* Make this more robust + fix tests

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-15 21:05:43 -07:00
Brian Donovan
8c5ac06113 fix: return object from FileHandle#read and FileHandle#readv (#9444)
See the NodeJS docs for `read`: https://nodejs.org/api/fs.html#filehandlereadoptions
2024-03-15 14:56:02 -07:00
Ciro Spaciari
eae0f0318a fix ref counting onReaderDone (#9443) 2024-03-15 13:00:19 -07:00
Jarred Sumner
e256751218 Don't link libicudata? (#9424)
* Don't link libicudata?

* Fixups

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-14 20:46:11 -07:00
Dylan Conway
1e090a78c1 improve --print with promises (#9407)
* `.then` on pending promises

* remove header
2024-03-14 19:26:44 -07:00
Jarred Sumner
8852f2a28d Lost in the merge (#9423) 2024-03-14 19:26:28 -07:00
Jarred Sumner
924647f8b9 Fixes #9404 (#9408)
* Fixes #9404

* Fixup

* Test it on macOS and windows too why not

* fixup

* Fix test

* ignore

* seems to work?

* Update Dockerfile
2024-03-14 18:47:22 -07:00
Ashcon Partovi
c72cf989f4 Fix 'xcrun: error: unable to lookup item' error when building on macOS 2024-03-14 12:23:00 -07:00
Ashcon Partovi
eac2e52783 Remove cp.js 2024-03-14 09:48:49 -07:00
Jarred Sumner
9573c6e2b7 Upgrade HTTPParser.h from uWS v20.6.0 to v20.62.0 (#9355)
* Upgrade HTTPParser.h from uWS v20.6.0 to v20.62.0

* Make MAX_FALLBACK_SIZE larger to allow for large redirect urls

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-13 21:22:15 -07:00
Dylan Conway
3375a158de fix(install): make sure trustedDependencies is updated after removing packages (#9400)
* if lockfile diff, transfer new trusted list over

* oops

* comment

* not only

* remove constCast
2024-03-13 19:17:42 -07:00
Jarred Sumner
570b3e567a Bump 2024-03-13 15:26:38 -07:00
Dylan Conway
cce6cfb2b3 fix integer overflow on subprocess deinit (#9388)
* avoid overflow

* closeWithoutReporting

* PipeWriter too

* remove comment
2024-03-13 14:50:31 -07:00
Jarred Sumner
9bda350406 Add a helpful error message when the xcode SDK is newer than the current platform (#9397)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-13 14:34:31 -07:00
Jarred Sumner
c5cc2a45a6 Speed up this test 2024-03-13 12:34:38 -07:00
Dylan Conway
c64e52c67f if cjs, dont set through esm eval 2024-03-12 22:59:31 -07:00
Jarred Sumner
648fd5d138 Always set the result if its an entry point 2024-03-12 22:51:16 -07:00
Jarred Sumner
7f16164b25 Unwrap promises in bun --print 2024-03-12 21:54:07 -07:00
Dylan Conway
e45ece05d9 improve bun pm trust output (#9371)
* fix recursion

* accurate count of blocked package scripts

* update

* fix merge

* reset pipereaders, set bin linker error correctly

* more pretty

* small changes

* e

* update tests

* this one too

* bun.start_time, iterate package_ids, remove put
2024-03-12 19:50:46 -07:00
Dylan Conway
3765032dec feat: bun --print (#9358)
* --print cli flag

* less code elimination

* handle cjs module eval results

* make node -p work

* better test

* more tests

* if

* delete commented code

* delete commented code

* EvalGlobalObject

* remove one constructor

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-12 18:15:50 -07:00
dave caruso
4b0eb47164 fix hot test on windows 2024-03-12 05:38:59 -07:00
Jarred Sumner
2d0cf1a78b [windows] Fix fetch.unix.test.ts (#9369)
* Fix fetch.unix.test

* Skip mmap
2024-03-11 18:01:57 -07:00
Jarred Sumner
574dec0919 Fix a couple windows test failures (#9361)
* Fix a couple test failures

* Another test

* Return a promise on flush
2024-03-11 16:27:08 -07:00
Brian Donovan
840f1b4006 fix typo in error message (#9350)
It should be "its" (possessive), not "it's" (contraction of "it is").

Co-authored-by: John-David Dalton <john.david.dalton@gmail.com>
2024-03-11 11:53:58 -04:00
Jarred Sumner
c9fe57fa63 wip use wrapper for managing process (#8456)
* WIP sync close (shows ref count bug in stream)

* fix closing on PipeWriter and PipeReader

* remove old todos

* join

* Some shell changes

at least it compiles

* fix some compile errors

* fix ref/unref server on windows

* actually use the ref count in this places

* make windows compile again

* more tests passing

* Make shell compile again

* Slowly remove some `@panic("TODO SHELL")`

* Eliminate `@panic("TODO SHELL")` for BufferedWriter

* Holy cleansing of `@panic("TODO SHELL")`

at least it compiles now

* Okay now the shell compiles, but segfaults

* Fix compiler errors

* more stable stream and now Content-Range pass

* make windows compile again

* revert stuff until the fix is actually ready

* revert onDone thing

* Fix buffered writer for shell

* Fix buffered writer + shell/subproc.zig and windows build

* Fix for #8982 got lost in the merge

* Actually buffer subproc output

* Fix some stuff shell

* oops

* fix context deinit

* fix renderMissing

* shell: Fix array buffer

* more stable streams (#9053)

fix stream ref counting

* wip

* Remove `@panic("TODO")` on shell event loop tasks and Redirect  open flags got lost in merge

* Support redirects

* fixes

cc @cirospaciari

* Update ReadableStreamInternals.ts

* Fix spurious error

* Update stream.js

* leak

* Fix UAF

cc @cirospaciari

* Fix memory leaks

* HOLY FUCK big refactor

* misc cleanup

* shell: Fix a bunch of tests

* clean up

* gitignore: fix ending newline

* get windows compiling again

* tidy

* hide linker warn with icu

* closeIfPossible

* Better leak test

* Fix forgetting to decrement reference count

* Update stdio.zig

* Fix shell windows build

* Stupid unreachable

* Woops

* basic echo hi works on windows

* Fix flaky test on Windows

* Fix windows regression in Bun.main (#9156)

* Fix windows regression in Bun.main

* Handle invalid handles

* Fix flaky test

* Better launch config

* Fixup

* Make this test less flaky on Windows

* Fixup

* Cygwin

* Support signal codes in subprocess.kill(), resolve file path

* Treat null as ignore

* Ignore carriage returns

* Fixup

* shell: Fix IOWriter bug

* shell: Use custom `open()`/`openat()`

* windows shell subproc works

* zack commit

* I think I understand WindowsStreamingWriter

* fix thing

* why were we doing this in tests

* shell: Fix rm

* shell: Add rm -rf node_modules/ test

* shell: use `.runAsTest()` in some places to make it easier to determine which test failed

* [autofix.ci] apply automated fixes

* woopsie

* Various changes

* Fix

* shell: abstract output task logic

* shell: mkdir builtin

* fixup

* stuff

* shell: Make writing length of 0 in IOWriter immediately resolve

* shell: Implement `touch`

* shell: basic `cat` working

* Make it compile on windows

* shell: Fix IOReader bug

* [autofix.ci] apply automated fixes

* fix windows kill on subprocess/process

* fix dns tests to match behavior on windows (same as nodejs)

* fix windows ci

* again

* move `close_handle` to flags in `PipeWriter` and fix shell hanging

* Fix `ls` not giving non-zero exit code on error

* Handle edgecase in is_atty

* Fix writer.flush() when there's no data

* Fix some tests

* Disable uv_unref on uv_process_t on Windows, for now.

* fix writer.end

* fix stdout.write

* fix child-process on win32

* Make this test less flaky on Windows

* Add assertion

* Make these the same

* Make it pass on windows

* Don't commit

* Log the test name

* Make this test less flaky on windows

* Make this test less flaky on windows

* Print which test is taking awhile in the runner

* fixups

* Fixups

* Add some assertions

* Bring back test concurrency

* shell: bring back redirect stdin

* make it compile again cc @zackradisic

* initialize env map with capacity

* some fixes

* cleanup

* oops

* fix leak, fix done

* fix unconsumedPromises on events

* always run expect

* Update child_process.test.ts

* fix reading special files

* Fix a test

* Deflake this test

* Make these comparisons easier

* Won't really fix it but slightly cleaner

* Update serve.test.ts

* Make the checks for if the body is already used more resilient

* Move this to the harness

* Make this test not hang in development

* Fix this test

* Make the logs better

* zero init some things

* Make this test better

* Fix readSocket

* Parallelize this test

* Handle EPipe and avoid big data

* This was a mistake

* Fix a bunch of things

* Fix memory leak

* Avoid sigpipe + optimize + delete dead code

* Make this take less time

* Make it bigger

* Remove some redundant code

* Update process.zig

* Merge and hopefully don't breka things along teh way

* Silence build warning

* Uncomment on posix

* Skip test on windows

* windows

* Cleanup test

* Update

* Deflake

* always

* less flaky test

* [autofix.ci] apply automated fixes

* logs

* fix uaf on shell IOReader

* stuff to make it work with mini event loop

* fix 2 double free scenarios, support redirections on windows

* shell: Make `1>&2` and `2>&1` work with libuv

* yoops

* Partial fix

* Partial fix

* fix build

* fix build

* ok

* Make a couple shell tests pass

* More logging

* fix

* fix

* Fix build issue

* more tests pass

* Deflake

* Deflake

* Use Output.panic instead of garbled text

* Formatting

* Introduce `bun.sys.File`, use it for `Output.Source.StreamType`, fix nested Output.scoped() calls, use Win32 `ReadFile` API for reading when it's not a libuv file descriptor.

This lets us avoid the subtle usages of `unreachable` in std.os when writing to stdout/stderr.

Previously, we were initializing the libuv loop immediately at launch due to checking for the existence of a bun build --compile'd executable. When the file descriptor is not from libuv, it's just overhead to use libuv

cc @paperdave, please tell me if Iany of that is incorrect or if you think this is a bad idea.

* Fix closing undefined memory file descriptors in spawn

cc @zackradisic

* pause instead of close

* Fix poorly-written test

* We don't need big numbers for this test

* sad workaround

* fixup

* Clearer error handling for this test

* Fix incorrect test

@electroid when ReadableStream isn't closed, hanging is the correct behavior when consuming buffered data. We cannot know if the buffered data is finished if the stream never closes.

* Fix build

* Remove known failing on windows

* Deflake

* Mark no longer failing

* show all the failing tests

* Sort the list of tests

* fix argument handling

* dont show "posix_spawn" as an error code on windows

* make bun-upgrade.test.ts pass on windows

* fix bunx and bun create again sorry

* a

* fix invalidexe because we should not be running javascript files as if they were exes

* Concurrency in test runner + better logging

* Revert "fix invalidexe because we should not be running javascript files as if they were exes"

This reverts commit da47cf8247.

* WIP: Unix fixes (#9322)

* wip

* [autofix.ci] apply automated fixes

* wip 2

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* Update runner.node.mjs

* Update runner.node.mjs

* Document some environment variables

* shell: Make `Response` work with builtins

* Make it compile

* make pwd test pass

* [autofix.ci] apply automated fixes

* Fix printing garbage for source code previews

* Update javascript.zig

* Fix posix test failures

* Fix signal dispatch

cc @paperdave. Signals can be run from any thread. This causes an assertion failure when the receiving thread happens to not be the main thread. Easiest to reproduce on linux when you spawn 100 short-lived processes at once.

* windows

---------

Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com>
Co-authored-by: Zack Radisic <zackradisic@Zacks-MBP-2.attlocal.net>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Meghan Denny <meghan@bun.sh>
Co-authored-by: Zack Radisic <zack@theradisic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-03-11 08:24:30 -07:00
sequencerr
21ec6669df Fix bun description (#9345) 2024-03-10 10:19:38 -07:00
Jarred Sumner
44959e6826 Make printing errors faster (#9328)
* Make printing errors faster

* Make Next.js tests less flaky

* Update dev-server.test.ts

* Copy over runner from process pr

* bump next version

* Update javascript.zig

* Set port to 0

* p-queue

* no dont use docker buildx

* Prevent runner from hanging

* Update dev-server.test.ts

* Really fix hanging this time

* Fix bounds check for unix domain socket, support abstract namespace sockets

* Various fixes

* [autofix.ci] apply automated fixes

* Update runner.node.mjs

* Update runner.node.mjs

* windows

* Only care about stdout

* increase concureency + clean up test

* Tweak puppeteer

* Update runner.node.mjs

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-09 09:48:46 -08:00
Jarred Sumner
79e77f13ab Revert "Bun.serve: error: pass Request parameter when available (#9310)" (#9332)
This reverts commit b92d98556b.
2024-03-09 08:44:03 -08:00
dave caruso
cd320835d1 chore: just a little bit of cleanup (#9319)
* just a little bit of cleanup

* oops
2024-03-09 07:28:54 -08:00
dave caruso
c3a9a7c147 fix #8868 (#9327) 2024-03-09 07:28:31 -08:00
Meghan Denny
b92d98556b Bun.serve: error: pass Request parameter when available (#9310)
* Bun.serve: error: pass Request parameter when available

* this will be null when not found not undefined

* add an assert here

* reorganize tests

* add another test

* add another test
2024-03-08 19:59:58 -08:00
Jarred Sumner
51ac00e965 Move these below package.json script 2024-03-08 19:26:00 -08:00
Jarred Sumner
402f7079df Add tests for file path redirection + tweak 2024-03-08 19:20:41 -08:00
Meghan Denny
709fbc2565 allow bun run to accept js from stdin (#9311)
* allow bun run to accept js from stdin

* document it

* fix window test

* cli/run: use printForLogLevel

---------

Co-authored-by: dave caruso <me@paperdave.net>
2024-03-08 18:43:53 -08:00
Meghan Denny
702cae51f6 test: Bun.stringWidth is enabled by default (#9321) 2024-03-08 17:54:51 -08:00
John-David Dalton
ad6a1b1a71 chore: remove unused zig-datetime dep (#9315) 2024-03-08 10:40:05 -08:00
Dylan Conway
d37fbbd4e0 fix(install): lifecycle script changes (#8943)
* empty trustedDependencies

* tests

* handle edgecases with default trusted dependencies

* could be zero length

* --trusted and skipped scripts

* resolver too

* second run --trusted

* --trust, better formatting

* more tests

* --trusted applies to dep deps, more tests

* progress

* fix build

* fix crash, make it look good, comments

* alphabetize, verbose log

* feature flag

* update lockfile

* update skipped text

* check update requests first

* be more careful with inline strings

* only with scripts

* fix tests, todo tests

* fix another test

* fix merge

* fix fix merge

* check binding.gyp for tarball and git resolutions

* remove dead code

* debug assert

* move newline printing

* use enum for `__has_install_script`

* oops

* clone packages

* Update src/install/install.zig

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

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-07 19:22:21 -08:00
dave caruso
a927340ce3 fix: bun.serve crash due to ExceptionRef (#9309)
* fix bun.serve crash due to ExceptionRef

* add test
2024-03-07 18:54:15 -08:00
Robert Burke
7fc97fcf9c Fix sqlite benchmark setup when sh isn't bash (#9303)
Prevent deno from making noisy output

Co-authored-by: Robert Burke <robert.burke@ltcm.lol>
2024-03-07 17:32:23 -08:00
Meghan Denny
ea5354fc85 handle invalid URL in Location header for fetch() (#9305) 2024-03-07 17:32:05 -08:00
dave caruso
3b13f7f998 fix: large bunx changes, mostly for better windows support (#9143)
* make bun-debug properly override `bun` in path

* windows path

* fix more issues with bunx

* sync

* stuff

* stuff

* f

* stuff

* further work

* a

* [autofix.ci] apply automated fixes

* okay

* fix building on posix systems

* ok

* make it so bun create cant crash + review

* docuemnt why return false is ok

* .

* cache bust

* merge

* yeah

* yea

* Update src/install/install.zig

* review results

* this will probably fix hardlink issue on windwo

* okay

* how did that work before

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-07 14:20:39 -08:00
Ashcon Partovi
806dec7a35 fix: child_process.spawn({ timeout }) exiting too early (#9280) 2024-03-07 09:36:54 -08:00
Meghan Denny
5a8830fdcc NODE_ENV=test should load .env.test even when .env.production exists (#9291) 2024-03-07 03:36:09 -08:00
dave caruso
e8374ebd82 feat: implement util.styleText (#9287)
* feat: implement util.styleText

* i forgot to test
2024-03-07 03:20:08 -08:00
John-David Dalton
9734f4cf6b Allow for smaller allocations in node:path methods (#8932)
Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
2024-03-07 10:37:13 +01:00
Dylan Conway
ea6bf1257a fix(install): auto node-gyp script bugfix (#9289)
* preinstall and install

* comment
2024-03-06 23:05:23 -08:00
Meghan Denny
3f12d71fdd install: dont crash in debug mode when a semver has a build tag and multiple hyphens in the pre-release tag (#9288) 2024-03-06 20:38:49 -08:00
Jarred Sumner
27a504a45b Add microbenchmark for reading a file in chunks 2024-03-06 17:42:12 -08:00
Jarred Sumner
dd920dadb8 Shorten title 2024-03-06 15:34:18 -08:00
Jarred Sumner
f6d5325daa Support socketPath in node:http request (#9284)
* Support `socketPath` in node:http request

* fix dashes

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
2024-03-06 15:28:35 -08:00
Jarred Sumner
a66926243d Support unix domain sockets in fetch() (#9097)
* Support unix domain sockets in fetch()

* rename to 'socket' to 'unix', add test

* enable keepalive on unix socket fetch

* make ownership of unix_socket_path clear, refactor http.zig a bit

* [autofix.ci] apply automated fixes

* add fetch unix redirect test, fix crash

* [autofix.ci] apply automated fixes

* fix fetch redirect from unix to non-unix

* disable keepalive for unix sockets (for now) so we don't leak them

* Update test/js/web/fetch/fetch.unix.test.ts

Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Georgijs Vilums <georgijs@bun.sh>
Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-03-06 14:12:03 -08:00
Kyle Scully
440cee1755 refactor: remove unnecessary spread (#9137) 2024-03-06 09:00:29 -08:00
マルコメ
9b4a74715b docs: update test matchers on jest compatibility (#9272) 2024-03-06 00:11:29 -08:00
Meghan Denny
8fc08752e5 node:http: emit 'socket' event after calling http.request() (#9270)
* node:http: emit 'socket' event after calling http.request()

* add reference links for why this is how it is

* add guards to not waste time

* add a regression test

* use test harness port number
2024-03-05 23:01:32 -08:00
Meghan Denny
bb3295ba84 node:url implement domainToASCII and domainToUnicode (#9257)
* node:url implement domainToASCII and domainToUnicode

* fix arg checks

* remove unneeded use of WTF::Vector

* tidy

* throw a js error if icu fails

* add a ton more tests, fix ascii guard, upconvert latin1

* even more tests

* add a comment for this guard

* use ASSERT_NOT_REACHED() instead of raise(SIGABRT)
2024-03-05 19:46:38 -08:00
Ashcon Partovi
c837903e4e Fix new Request("/") not working with node-fetch (#9246)
* Fix `new Request("/")` not working with `node-fetch`

* Address review

* Address review 2

* Fix bad test
2024-03-05 16:51:52 -08:00
Ryan Dsouza
b55e62b634 Update cache.md (#9260)
Specify `bunfig.toml` to make it easy to check where this option needs to be added.
2024-03-05 16:28:08 -08:00
Cameron Haley
2b8fc7a9a8 Running absolute/relative path shouldn't rely on the existence of package.json script (#9265) 2024-03-05 16:27:57 -08:00
Jarred Sumner
edeeffc74c Fixes #9263 (#9266)
* Fixes #9283

* Update URLSearchParams.test.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-05 16:27:33 -08:00
Jarred Sumner
12c257a012 Fix out of bounds memcpy in crypto 2024-03-05 13:52:27 -08:00
Yash Singh
bd2176ffb0 fix: format specifier without characters in between (#9209)
* fix: format specifier without spaces in between, resolves #9208

* chore: test in console-log.test.ts
2024-03-04 17:46:19 -08:00
ErikOnBike
4f0a497660 Fix lost constructors in Node.js module classes (#9245) 2024-03-04 16:12:22 -08:00
dave caruso
472a0b482d feat: signal handling on windows (#9129)
* start some signal handling

* ok

* work on this from friday

* ok

* ref stuff

* threadsafety

* fix the buikld

* alright

* ok

* fix posix compilation error

* header fix

* revisions

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-03-04 15:37:08 -08:00
Brook Jeynes [SSW]
fa08ac34c9 Fixes #7767: Updated bun upgrade to return error when used with cmd arguments (#7784)
* Updated `upgrade` to return error when used with cmd arguments
- Updated `upgrade` command to check for command-line arguments and return an error if so providing a suggested `update` command.

* added test

* updated condition to allow

* Upgrade argument check now only checks if all arguments contain `--`
- Added more tests

* Using `cpSync` in the following context results in an "Is a directory" error

* Update message displayed back to user

Co-authored-by: dave caruso <me@paperdave.net>

* moved args check to upgrade_command.zig

* fixed broken tests

* changing string interpolation to join() for paths

* [autofix.ci] apply automated fixes

* Fixed build errors
- Removed call to `std.mem.span`
- Added conditional to only run if there's more than 2 arguments (ignores the exec and `upgrade`)
- Added new test to ensure `upgrade` runs with 0 arguments passed

---------

Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-04 15:30:20 -08:00
Yash Singh
51466ff1a2 fix: sep state for assertions and hasAssertions (#9210) 2024-03-04 12:01:50 -08:00
cyfung1031
b14c7aa0b5 docs: Correct Incorrect Information (#9214)
`URL.createObjectURL` is not yet implemented.
See https://github.com/oven-sh/bun/issues/3925
2024-03-04 08:27:18 -08:00
Jarred Sumner
1424a196ff Support "conditions" in Bun.build (#9234)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-03 23:52:24 -08:00
Zack Radisic
05a7779880 shell: Improve ShellError stacktrace (#9233)
* Improve stacktrace

* woops
2024-03-03 21:46:42 -08:00
Jarred Sumner
95fc939d0b Fixes #9225 (#9232)
* Fixes #9225

* Pass all arguments along

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-03 20:50:35 -08:00
Jarred Sumner
6d52b3b62b Fixes #8794 (#9231)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-03 20:13:22 -08:00
Jarred Sumner
30fdfdb295 Fixes #9222 (#9230)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-03 19:26:27 -08:00
Jarred Sumner
a43a8a8cea Fixes #9226 (#9229)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-03 17:32:18 -08:00
argosphil
4257457c6a Allow relative paths in cpAsync again (#9184)
* allow relative paths in cpAsync again

* test for #9024

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-03 16:30:34 -08:00
Cameron Haley
b5cea9a20c Avoid manually destroying stream when IncomingMessage stream is done reading (#9219)
* Avoid manually destroying stream when IncomingMessage stream is done reading

* Add test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-03-03 16:29:13 -08:00
Jarred Sumner
49ccad9367 Finish jest.clearAllMocks() implementation (#9217)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-03 03:48:13 -08:00
Jarred Sumner
71405ff4dc Fix regression from 648d5ae (#9215)
* Slightly reduce number of system calls on Linux

* Fix regression from 648d5aecf3

648d5aecf3 caused HTTP response bodies sent streamingly with a single chunk to include an extraneous 0\r\n\r\n chunk, leading valid clients to close the connection prematurely.

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-03 00:02:44 -08:00
Jarred Sumner
0017dbec4e Fixes #9180 (#9212)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-02 21:42:57 -08:00
Jarred Sumner
a3a5ed3870 Update shell.md 2024-03-02 01:39:34 -08:00
Jarred Sumner
dd111589b0 Update shell.md 2024-03-02 01:37:42 -08:00
Jarred Sumner
3c62580529 Add a couple guides 2024-03-02 01:24:40 -08:00
Dylan Conway
309b417009 add assertion for generated functions returning JSValue.zero without an exception (#9197)
* assert exception when JSValue.zero is returned

* Update generate-classes.ts
2024-03-01 20:18:40 -08:00
Yash Singh
b2794ad7cf feat: implement expect.assertions and expect.hasAssertions (#9190)
* chore: merge oven-sh/bun

* chore: merge oven-sh/bun

* chore: merge oven-sh/bun

* fix: comptime for compiling

* fix: error reporting

* chore: revert runner.node.mjs

* fix: dont construct err b4

* chore: rm force throw test

* chore: rerun

* chore: reset unrelated changes

* fix: return undefined

* fix: dont return undefined on invalid args

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-01 20:17:44 -08:00
Jarred Sumner
4489cda25b Bump (#9196)
* Bump

* Even more calloc

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-01 20:13:16 -08:00
Igor Wessel
dcf6f244a4 feat: add support --conditions flag (#9106)
* feat(options): add possibility to append a custom esm condition

* feat(cli): parse --conditions flag

* test: add case for custom conditions

* fix(cli): not get short-hand --conditions flag

* test: add case using cjs with custom condition

* fix(options): address possible memory issues for esm conditions

* refactor(cli): remove -c alias for --conditions flag

* test: add cases for multiple --conditions specified

* test(bundler): add support to test --conditions

* chore(cli): fix grammar mistakes in --conditions

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-03-01 18:57:45 -08:00
Meghan Denny
3134ae1ada ci: comment disabled actions/upload-artifact call (#9195) 2024-03-01 18:14:15 -08:00
Meghan Denny
4baad765ec windows: pass test/js/web/timers/setTimeout.test.js (#9176)
* windows: pass test/js/web/timers/setTimeout.test.js

* gotta go fast

* ci: windows: try reverting this line

reproducibly getting:
Error: Unable to download artifact(s): Artifact not found for name: bun-windows-x64-zig

* ci: switch back to namespace for zig build
2024-03-01 17:48:52 -08:00
Ashcon Partovi
714e04eeec Github actions changes (#9189)
* Test out custom oven-sh/setup-bun action

* Add files
2024-03-01 17:48:23 -08:00
Jarred Sumner
64bdf6a138 Zero initialize some things in usockets (#9191)
* Zero initialize some things in usockets

* Update epoll_kqueue.c

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-01 17:47:00 -08:00
Meghan Denny
141c2b52b1 ci: fail step if actions/upload-artifact fails (#9194)
* ci: fail step if actions/upload-artifact fails

* the arm64 workflow doesnt have these and they were failing on x86
2024-03-01 17:46:18 -08:00
Jarred Sumner
fd26c3fb55 Fixes #9153 (#9175)
* Fixes #9153

* Update napi.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-03-01 14:42:20 -08:00
Lucas Garron
7909f0eff4 Fix typo: demonstates → demonstrates (#9179) 2024-03-01 05:44:44 -08:00
Jarred Sumner
1e217ce78f Fix path bug (#9173) 2024-02-29 22:35:52 -08:00
Jarred Sumner
08ef0e8e8e Use namespace on more machines 2024-02-29 22:16:47 -08:00
Ashcon Partovi
536919e783 Use namespace.so for faster CI (#9160)
* Use namespace.so for faster CI

* arm64 runners arent working

* deflake

* more

* Update bun-mac-x64-baseline.yml

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-29 16:14:12 -08:00
Meghan Denny
e45a4019c1 windows: pass test/transpiler/transpiler-stack-overflow.test.ts (#9164)
* windows: pass test/transpiler/transpiler-stack-overflow.test.ts

* remove regression silencing comment

* needed this too

* use proper drive letter detection

* oopsie
2024-02-29 15:21:39 -08:00
Alexander Mykolaichuk
0b5e83db97 fix: linux distro name match (#9075) 2024-02-29 13:17:31 -08:00
Meghan Denny
2fb6733eeb windows: pass test/js/node/process/process.test.js (#9161) 2024-02-28 20:25:05 -08:00
Meghan Denny
bcd604edc7 windows: pass test/js/bun/resolve/resolve.test.ts (#9158) 2024-02-28 19:58:42 -08:00
Cameron Haley
bfdad44460 Fix issue where process.stdin is ended too early (#9155)
* Fix issue wherein process.stdin is ended too early

* [autofix.ci] apply automated fixes

* test: Generate prisma client on 'big' schema

* Update test/js/third_party/prisma/helper.ts

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-02-28 19:03:08 -08:00
Jarred Sumner
27a0deab5f Make this test less flaky on Windows 2024-02-28 17:03:00 -08:00
Jarred Sumner
c7a0c3c5fd Merge branch 'main' of https://github.com/oven-sh/bun 2024-02-28 16:56:02 -08:00
Jarred Sumner
bba9b39ef8 Fix flaky test on Windows 2024-02-28 16:55:58 -08:00
Jarred Sumner
f34de31edb Fix windows regression in Bun.main (#9156)
* Fix windows regression in Bun.main

* Handle invalid handles

* Fix flaky test

* Better launch config

* Fixup
2024-02-28 16:49:37 -08:00
Jarred Sumner
53378227ca [windows] Fix regression from #9154 2024-02-28 15:16:40 -08:00
dave caruso
360bbb4dea fix(windows): fix directory cache regression "expected to end with a trailing slash" (#9144)
* okaaaaaaaay

* Revert "resolver: fix debug mode crash in test/bundler/bun-build-api.test.ts (#9140)"

This reverts commit 331d079dad.

* correctly fix the cache bust bug

this was introduced a couple of commits ago in my random fixes,
where i put the wrong fix to another directory caching bug.

i still stand by the assertion in place despite it causing many people
issues. it's precense will prevent subtle module resolutions failures.

* add an extra comment

* fix building a release build locally

* add a better test case for 3216

* staging

* fix mac issues

* ok

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-02-28 14:51:14 -08:00
Jarred Sumner
dc6af25b54 Fix ownKeys issue (#9154) 2024-02-28 14:22:25 -08:00
Meghan Denny
331d079dad resolver: fix debug mode crash in test/bundler/bun-build-api.test.ts (#9140) 2024-02-27 22:22:52 -08:00
dave caruso
c54844b30b windows: random things (#9046)
* random things

* fix reliability of loading napi stuff

* fix posix build

* a
2024-02-27 16:30:34 -08:00
Dylan Conway
c9b5191fc2 fix(bun:test): fix toContainKeys with undefined and null (#9125)
* fix 9118

* update

* RELEASE_AND_RETURN

* cache and coerce

* test for toContainKey throwing in hasOwnProperty

* fix test

* [autofix.ci] apply automated fixes

* fix non-truthy and more test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-27 15:10:26 -08:00
dave caruso
4e2d00d052 windows: changes to install/upgrade/uninstallation process (#9025) 2024-02-27 03:11:43 -08:00
Jarred Sumner
fd6fd78f0f Fixes #9120 (#9128)
* Fixes #9120

* Update buffer.test.js

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-26 19:15:28 -08:00
Jarred Sumner
c4a9bdbb81 Silence not implemented warning (#9126)
* Silce not implemented warning

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-26 18:36:18 -08:00
Jarred Sumner
f1b8df29e8 Replace std.unicode.fmtUtf16le with bun.fmt.utf16 (#9127)
* Replace `std.unicode.fmtUtf16le` with `bun.fmt.utf16`

* Update fmt.zig

* Remove bun.fmt.fmtUTF16

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-26 18:35:18 -08:00
Marvin A. Ruder
675dad2fe8 Use bind mount for glibc APKs in Alpine Dockerfile (#9113)
* Fixes #9112

Signed-off-by: Marvin A. Ruder <signed@mruder.dev>
2024-02-26 14:22:30 -08:00
Jarred Sumner
57eb04f6f4 [internal] Switch back to prettier (#9109)
* Switch back to prettier

* wip

* Update .prettierignore

* Update .prettierignore

* ignores

* Update .prettierignore

* Rest

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-26 11:13:02 -08:00
Jarred Sumner
517aaad549 Update executables.md 2024-02-25 23:59:34 -08:00
Jarred Sumner
6e54787d4a Update executables.md 2024-02-25 23:51:36 -08:00
Jarred Sumner
dbb490f3bd Update executables.md 2024-02-25 23:47:49 -08:00
Jarred Sumner
e2ee5642e0 Update executables.md 2024-02-25 23:45:52 -08:00
Jarred Sumner
92dec0a871 Implement util.types.isKeyObject (#9091)
* Implement util.types.isKeyObject

* just use inherits

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-25 14:30:05 -08:00
Jarred Sumner
72d57464b9 Make Bun.main the resolved filesystem path (#9105)
* Make `Bun.main` the resolved filesystem path, but only Bun.main

* Fix flaky test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-25 13:05:34 -08:00
Cameron Haley
2333c94f8e Fix prisma generate by emitting readable event on EoF (#9101)
* Add test for ensuring the 'readable' event is emitted on end

* Run emitReadable on nextTick instead of as microtask

* perf: Store intermediate variables

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

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-02-25 13:01:07 -08:00
Jarred Sumner
a3adb8bd10 Add a couple TODO comments 2024-02-24 19:36:56 -08:00
Jarred Sumner
e9d4ced41e Bump WebKit 2024-02-24 18:46:00 -08:00
Jarred Sumner
fdd42eb67e Fixes #9096 2024-02-24 16:06:34 -08:00
Jarred Sumner
4ba1d4d7c8 Add missing fdatasync (#9092)
* Add missing fdatasync

* don't use /tmp/ since it might not support fdatasync on linux

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-24 15:47:14 -08:00
Dylan Conway
b6f3405fa7 fix(windows): fix uv_loop and uv_pipe_t struct sizes (#9085)
* use CRITICAL_SECTION struct instead of pointer

* WIN32_FIND_DATAW too

* INPUT_RECORD too
2024-02-24 02:49:47 -08:00
Aron Homberg
29466b884e feat: implemented jest.clearAllMocks, fixes #9079 (#9081) 2024-02-24 01:06:29 -08:00
Meghan Denny
968065ca73 Bun.stringWidth ambiguousIsNarrow option defaults to true (#9064)
* Bun.stringWidth ambiguousIsNarrow option defaults to true

* number was backwards too
2024-02-23 20:27:10 -08:00
Meghan Denny
72b700205a vscode: highlight invisible and ambiguous characters (#9066) 2024-02-23 20:26:58 -08:00
Meghan Denny
8ed02f9567 fix debug crash in bun.strings.firstNonASCII16 when input is multiple of ascii_u16_vector_size (#9080) 2024-02-23 20:26:08 -08:00
Meghan Denny
109a8c2c37 fix crash in test/transpiler/transpiler.test.js when macro isn't found (#9068) 2024-02-23 18:14:45 -08:00
Lucas Michot
d0d5475953 Update installation.md (#9069)
Simplify homebrew installation instructions

Co-authored-by: John-David Dalton <john.david.dalton@gmail.com>
2024-02-23 11:02:33 -08:00
Meghan Denny
d0293edc59 remove hidden zero-width-space characters from our md files (#9067) 2024-02-23 11:01:11 -08:00
Jarred Sumner
094750cc9c Update utils.md 2024-02-22 21:59:00 -08:00
Jarred Sumner
b48e5bbebd Update utils.md 2024-02-22 21:58:02 -08:00
Jarred Sumner
460d64a086 Update utils.md 2024-02-22 21:57:27 -08:00
Jarred Sumner
f75306db0f Update utils.md 2024-02-22 21:52:13 -08:00
Jarred Sumner
5147c0ba73 Fix incorrect assertion 2024-02-22 21:51:44 -08:00
jrz
f6a0edc7de docs: fix for contributing using linux (#9050)
Both debian:bookworm and ubuntu:latest (jammy) do not have curl, wget, lsb_release and software-properties-common installed by default.
2024-02-22 20:58:22 -08:00
Jarred Sumner
a146856d11 Support coercing port number from integer (#9047)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-22 20:11:47 -08:00
Jarred Sumner
7e906c1cae Remove ignore min branch (#9061)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-22 20:04:50 -08:00
Jarred Sumner
2e7d77b3b0 Add bench 2024-02-22 19:18:09 -08:00
Meghan Denny
ed339b367d improve Bun.stringWidth's algorithm (#9022)
* improve Bun.stringWidth's algorithm

* add a bunch more tests from string-width package

* make typescript happy

* undo typescript changes

* use better #define check for debug mode

* properly handle latin1 width tests

* support grapheme clusters

* fix trailing newline

* visibleUTF16WidthFn- add fast path for leading ascii

* add firstNonASCII16IgnoreMin

* fix firstNonASCII16CheckMin

* vectorize visibleUTF16WidthFn

* support emoji variation selector

* expose stringWidth in release mode too

* vectorize visibleLatin1Width

* support ambiguousIsNarrow option

* add typescript definition for stringWidth
2024-02-22 19:16:17 -08:00
Meghan Denny
22c25fad92 bun.js: write to pointer instead of stack in bun.js/webcore/body (#9059) 2024-02-22 19:07:56 -08:00
Jarred Sumner
a18b44d01f Bump version 2024-02-22 12:59:59 -08:00
Jarred Sumner
ee791a839f add microbenchmark 2024-02-22 12:58:35 -08:00
Zack Radisic
2605722891 shell: Allow duplicating output fds (e.g. 2>&1) (#9004)
* Open with proper perms when redirecting file to stdin

* Add test for redirecting file to stdin

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

* Remove dead code

* Support duplicating output file descriptors

* Clean up

* fix merge fuck up

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

* Update docs

* Delete dead code

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

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

* [autofix.ci] apply automated fixes

---------

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

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

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

* Handle exception

* Ignore non-bool

* Propagate errors when the message callback throws

* fixups

* Update preload.ts

* Update jest-extended.test.js

* Update expect.zig

* comments

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-21 18:31:14 -08:00
Dylan Conway
9ee39cac8b fix(install): semver prerelease bugfix (#9026)
* make sure prereleases match correctly

* add the file

* few more tests

* make sure pre is in query, not group
2024-02-21 14:47:43 -08:00
Kenta Iwasaki
20275aa040 fix(ws/client): handle short reads on payload frame length (#9027)
* fix(ws/client): handle short reads on payload frame length

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

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

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

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

* [autofix.ci] apply automated fixes

---------

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

* Update all the actions

* Configure temp

* use spawn instead of rm

* Use CLOSE_RANGE_CLOEXEC

* Make some tests more reproducible

* Update hot.test.ts

* Detect file descriptor leaks and wait for stdout

* Update runner.node.mjs

* Update preload.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-21 14:13:43 -08:00
Jarred Sumner
a0be3cb2ff Slightly reduce code duplication in expect (#9018)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-20 18:58:33 -08:00
dave caruso
5c6b9ea9b6 change how bunx caches things (#8921)
* some things

* yeah

* ok

* fix compilation error

* fix on windows

* ok

* username
2024-02-20 18:58:12 -08:00
Eemeli Palotie
48e7c0fb8e fix: install vendored node_modules when using hardlinks (#9007)
* fix: install vendored node_modules when using hardlinks

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-19 22:50:24 -08:00
Zack Radisic
2656418e50 Don't immediately delimit command substitution result (#9005) 2024-02-19 21:26:50 -08:00
Zack Radisic
7056384702 Fix file redirect stdin not working (#9000)
* Open with proper perms when redirecting file to stdin

* Add test for redirecting file to stdin

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

* Remove dead code

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-19 14:56:32 -08:00
Meghan Denny
5712ba8b3b debug: introduce bun.callmod_inline (#9001) 2024-02-19 14:43:42 -08:00
dave caruso
6f1939621c fix astro (#8999)
* fix astro

* set undefined

* [autofix.ci] apply automated fixes

* Fix astro

* Fix test

* Remove bad assertion

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-19 13:48:08 -08:00
Yannik Schröder
182d052d4b events.on: Add compatibility with readline module (#8885)
* fix: make event.on work with for...await of readline module

* fix: queueing events before next() call and multiple event vals

* test: add tests for events.on and readline for await...of

* style, docs

* [autofix.ci] apply automated fixes

* refactor: use removeListeners instead of check for done

* test: merge test files

* test: remove todo comment

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-02-19 11:44:09 -08:00
Jarred Sumner
42d15ea853 Fixes #8964 (#8978)
* Fixes #8964

* Fix test.each when used with test.only

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-19 10:36:08 -08:00
Jarred Sumner
7407080628 Bump 2024-02-19 10:28:05 -08:00
Jarred Sumner
7ec9ad5cb7 Add test for #7864 (#8997)
* Add test for #7864

* Add napi-rs/canvas

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-19 10:27:12 -08:00
Meghan Denny
141140ef7c windows: pass more tests (#8938)
* windows: implement bun.isWritable

* windows: pass test/cli/run/as-node.test.ts
C:\Users\dave\AppData\Local\Temp\bun-node-a2ae984c3\node.exe is a hardlink on windows so it will not resolve to C:\bun\build\bun-debug.exe
skip the first param since that is not the behavior this test is supposed to be testing

* windows: pass test/js/node/dns/node-dns.test.js

* windows: pass test/js/node/process/process.test.js

* windows: pass test/js/web/streams/streams.test.js

* windows: pass test/js/workerd/html-rewriter.test.js
Closes #8459

* windows: fix node:util.inspect

* windows: these pass now

* windows: pass test/js/node/stream/node-stream.test.js

* disable http sendfile on windows

* use url.origin here

* more sendfile removal

* windows: pass test/js/web/websocket/websocket.test.js

* test/js/deno/performance/performance.test.ts is flaky, come back to it

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-02-19 10:23:31 -08:00
Cameron Haley
8c7972fdc8 Don't rely on stored napiRef; Always create a new one in napi_create_reference (#8995) 2024-02-19 09:07:15 -08:00
Jarred Sumner
80e4712662 Skip sqlite math fns test on macOS 2024-02-18 12:08:17 -08:00
3λiȯ+
3221bfeeb7 docs: Fix unclosed code block in the example for WebSocketHandler (#8971) 2024-02-17 18:11:22 -08:00
Dale Seo
89641f2e4a chore: add types for date mocking api of jest (#8387) 2024-02-17 08:05:16 -08:00
Risu
bc74154536 docs: use consistent tsconfig for both in docs and bun init (#8953) 2024-02-17 08:04:03 -08:00
Jarred Sumner
a6acb257c1 Fixes #8940 (#8957)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-17 05:48:36 -08:00
Risu
c34bbb2e3f fix: organize tsconfig (#8654)
* fix: organize tsconfig

* fix: remove unnecessary comments in tsconfig

* docs: revert changes on comments and md text

* docs: fix case
2024-02-16 22:19:31 -08:00
Jarred Sumner
f9b12300d4 Make shell errors slightly better (#8945)
* Make shell errors slightly better

* Update shell.ts

* Fix the failing tests

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-16 20:43:42 -08:00
Jarred Sumner
abf1239976 feat: Support async generator functions in Response and Request for bodies (#8941) 2024-02-16 20:02:22 -08:00
argosphil
e2c92c69b5 fix: make sure Bun.sleep(Date) doesn't resolve prematurely (#8950)
* fix: make sure Bun.sleep(Date) doesn't return prematurely

Fixes #8834.

This makes Bun.sleep(new Date(x)) fulfill its promise only when
Date.now() >= x.

* resolve test now #8834 is fixed

11 ms is in fact the right limit.

---------

Co-authored-by: John-David Dalton <john.david.dalton@gmail.com>
2024-02-16 18:32:37 -08:00
Tony Zhang
135de4dff7 fix(sqlite): enable math functions (#8944)
* fix(sqlite): enable math functions

* fix(sqlite): enable math function flag in CMakeLists

* test: add math function tests

---------

Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
Co-authored-by: John-David Dalton <john.david.dalton@gmail.com>
2024-02-16 18:24:55 -08:00
Dmitri
fe8ec29f1f Add fs.exists[util.promisify.custom] (#8936)
* Add fs.exists[util.promisify.custom]

fs.exists doesn't follow the error-first-callback convention, so it
needs a custom implementation for util.promisify.

* Simplify

---------

Co-authored-by: John-David Dalton <john.david.dalton@gmail.com>
2024-02-16 18:24:04 -08:00
Ashcon Partovi
27eed543ef Add .env to .gitignore 2024-02-16 14:13:19 -08:00
John-David Dalton
17e01a284b Add url unit tests with failing tests TODO commented-out (#8933)
Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
2024-02-16 11:32:08 -08:00
Zack Radisic
2b56451a11 Shell changes/fixes (#8846)
* Fix #8403

* Throw on error by default

* Add the shell promise utilities to `ShellOutput` and `ShellError`

* Fix tests

* [autofix.ci] apply automated fixes

* Fix memleak

* [autofix.ci] apply automated fixes

* Woops

* `Bun.gc(true)` in fd leak test

* fd leak test should check if `fd <= baseline`

* wtf

* oob check

* [autofix.ci] apply automated fixes

* Fix double free

* Fix #8550

* increase mem threshold for linux

* Requested changes and make not throw on by default

* [autofix.ci] apply automated fixes

* more requested changes

* Do destructuring in function definition

* delete

* Change shell output test to enable throwing

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-16 05:01:55 -08:00
Zack Radisic
0e2a3a0197 fix(glob): fix patterns starting with * #8817 (#8847)
* Fix #8817

* [autofix.ci] apply automated fixes

* yoops

* fix broken stuff from merge

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-16 04:12:12 -08:00
Zack Radisic
ebaeafbc89 feat: More robust and faster shell escaping (#8904)
* wip

* Proper escaping algorithm

* Don't use `$` for js obj/string referencs

* [autofix.ci] apply automated fixes

* Changes

* Changes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-02-16 04:09:34 -08:00
Meghan Denny
2b335d72e7 windows: make websocket-client.test.ts pass (#8935) 2024-02-16 04:07:06 -08:00
guest271314
dcda49a271 Missing toWeb (#8937)
https://github.com/oven-sh/bun/issues/3927
2024-02-15 21:41:46 -08:00
John-David Dalton
d49cb0b98e chore: Add PrivateRecursive type annotations (#8291) 2024-02-15 17:35:08 -08:00
dave caruso
bb31e768de docs: update windows build instructions
this removes the WSL codegen step as it is no longer supported, and some other notes i am aware of now
2024-02-15 16:54:03 -08:00
Jake Gordon
099825e5ac Common HTTP server usage guide (#8732)
Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
2024-02-15 16:30:59 -08:00
Henrikh Kantuni
fc05cbfedc Fix typo (#8930)
"Buns supports" → "Bun supports"

Co-authored-by: John-David Dalton <john.david.dalton@gmail.com>
2024-02-15 16:20:55 -08:00
argosphil
c920919c42 fix: distinguish getters and setters in Bun.inspect() (#8858)
* Bun.inspect: distinguish [Getter], [Setter], [Getter/Setter]

fixes #8853

NOTE: this modifies files which were auto-generated at one point, but
which are now maintained as part of the Bun sources.

* test for #8853

---------

Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
2024-02-15 13:09:13 -08:00
Georgijs
da78103b1c fix typo (#8929) 2024-02-15 13:07:07 -08:00
dave caruso
a2ae984c3e disable some tests that are failing in ci (#8922)
* try to make ci green

* fix a crash in debug mode

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-15 07:09:44 -08:00
Jarred Sumner
151512dcc9 Release weak refs before responding to websocket messages (#8898)
* Release weak refs before responding to websocket messages

* Yes

* Wrap the methods instead of the callers

* oops

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-15 07:09:10 -08:00
Toby Cm
1b945ba2ef fix: Update URL in non-avx warning message (#8435)
`https://github.com/oven-sh/bun/release/bun-v1.0.25/bun-linux-x64-baseline.zip`

->

`https://github.com/oven-sh/bun/releases/download/bun-v1.0.25/bun-linux-x64-baseline.zip`
2024-02-15 03:57:22 -08:00
dave caruso
e8dff7b029 chore: random acts of cleanup to tests (#8915)
* random acts of cleanup to tests

* nerf the watchFile test, is CI slow?

* more things

* [autofix.ci] apply automated fixes

* a

* remove a log

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-14 22:40:50 -08:00
Jarred Sumner
d936f365c8 Fixes #8909 (#8911)
* Fixes #8909

* Add it

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-14 18:57:20 -08:00
Jarred Sumner
48c0d7aadc Fix incorrect type definition in usockets loop (#8912)
* Fix incorrect type definition

* Remove dead code

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-14 18:57:07 -08:00
dave caruso
cf054456ce fix build on all platforms 2024-02-14 18:38:20 -08:00
Jarred Sumner
57b1e545f8 This debug code should not have been committed 2024-02-14 18:36:24 -08:00
Meghan Denny
12f83cf48b make V8StackTraceIterator frame parser more robust (#8814)
* make V8StackTraceIterator frame parser more robust

* remove StringView_count and only call StringView::find as many times as we need
2024-02-14 18:25:30 -08:00
Lei
b0f9e03230 Fix coverage.md (#8864)
See lines 264/271 of bunfig.zig
2024-02-14 18:20:37 -08:00
argosphil
7481a29f4e fix: brotli decompression's multi-packet case (#8881)
* fix: reset buffer pointer (misleadingly named total_in) for brotly

Fixes #8017

* fix: panic if brotli decompressor misbehaves
2024-02-14 18:19:46 -08:00
argosphil
0714b3a06b fix: throw on gunzipSync/inflateSync error (#8901)
* fix: zlib functions should throw an error if appropriate

Fixes #8887.

* Tests for #8887

* fix: drive-by fix to avoid unreachable code being reached on error
2024-02-14 18:01:05 -08:00
Dylan Conway
08c2148000 fix(windows): console-iterator.test.ts fix (#8879)
* fix console iterator tests on windows

* rename and size only when bytes is active

* assert size > 0
2024-02-14 17:59:19 -08:00
James Anderson
00cc2eae67 Fix tsconfig path longest prefix matching (#8892) 2024-02-14 08:23:45 -08:00
Dylan Conway
82a07430ed fix(windows): use allocated memory for \\\\.\\NUL replacement on windows (#8889)
* use allocated memory for /dev/null

* deinit
2024-02-13 22:23:54 -08:00
Georgijs
636a8f1f0a Prevent open but inactive http connections from keeping alive http server (#8829)
* unref uv handle after creating uws socket

* unref sockets between http requests to allow the event loop to exit

* remove stale comment
2024-02-13 22:22:44 -08:00
7f8ddd
05d33c39cd fix: Add charset to text/css mime type (#8825)
* Add charset to text/css mime type

Standard: https://www.iana.org/assignments/media-types/text/css

More info: https://stackoverflow.com/questions/70643383/which-mime-types-contain-charset-utf-8-directive

Fixes the warning in Edge that says to include utf-8 when Bun returns a stylesheet.

* Add test

* Change "content type" to "mime-type"
2024-02-13 20:47:02 -08:00
dave caruso
aba37525a6 windows: fix bundler reliability and nuke WSL-based codegen scripts (#8890)
* bruh

* yeaaahhhhhhhhhhhhhhhhhhhhhhhhhhh

* revisions

* yeah

* fix

* make no codegen do less things
2024-02-13 20:33:24 -08:00
dave caruso
04a6ebaa17 fix: allow opening win32 device files in node:fs and bun.file (#8801)
* support opening device files in node:fs and bun.file

* tidy tests

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-02-13 18:24:14 -08:00
Augie
7405c5a615 feat: make curl install script run the windows installer (if run through cygwin) (#8875)
This updates the *nix install script to run the Windows Powershell install script if it detects it's on Windows.
2024-02-13 11:35:17 -08:00
Jarred Sumner
d0903f6b71 Cherry-pick 570fe762c8 (#8830)
This cherry-picks 570fe762c8

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
2024-02-13 10:58:27 -08:00
Ciro Spaciari
d0b6218bdf fix(fetch) redirects bodies should be handled (#8874)
* redirects bodies should be handled

* [autofix.ci] apply automated fixes

* Update src/http.zig

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

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-02-12 21:14:00 -08:00
Meghan Denny
8afcb39055 windows: more tests are passing (#8873) 2024-02-12 17:52:14 -08:00
Meghan Denny
b2a697f264 scripts/codegen.ps1: update wsl call (#8871) 2024-02-12 16:46:26 -08:00
Zack Radisic
aca936515a Make glob work for windows (#8382)
* Fix some related to paths and string encoding

* Fix relative paths with glob

* Fix scan tests

* Fix glob scan test

* [autofix.ci] apply automated fixes

* Fix leak test

* clean up post merge

* [autofix.ci] apply automated fixes

* clean up glob getcwd

* remove old struct

* fix open on posix

* feat: Add win32 path.toNamespacedPath and align rest of node:path with Node (#8469)

* restore zls file change

* [autofix.ci] apply automated fixes

* switch to using fs.top_level_dir in glob

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Georgijs Vilums <georgijs.vilums@gmail.com>
Co-authored-by: Georgijs Vilums <georgijs@bun.sh>
Co-authored-by: John-David Dalton <john.david.dalton@gmail.com>
Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
2024-02-12 16:30:58 -08:00
Zack Radisic
6ba146c3e0 Run zig fmt 2024-02-12 17:40:36 -06:00
Georgijs
a80b3569b4 disable quiet logs when BUN_DEBUG_LOG is set to 0 (#8866) 2024-02-12 15:20:38 -08:00
argosphil
8b5cac1ea1 chore: use shell-independent globbing in bun run fmt:zig (#8861)
* fix: use shell-independent globbing in bun run fmt:zig

* Erase experimental creature escaped from @paperdave's lab.

See https://github.com/oven-sh/bun/pull/8861#discussion_r1485747297
2024-02-12 14:51:39 -08:00
John-David Dalton
96e7227087 feat: Add win32 path.toNamespacedPath and align rest of node:path with Node (#8469) 2024-02-12 14:27:26 -08:00
Dale Seo
f88855da4f docs: non-null assertion is needed on document.getElementById (#8540) 2024-02-11 20:10:17 -08:00
Ujjwal gupta
19cb3ab6ff fix: ws.publish() not working (#8855)
* fix: ws.publish() not working

* fixes
2024-02-11 13:56:06 -08:00
argosphil
862d35d832 fix: bun test -t (#8845) 2024-02-11 08:39:27 -08:00
argosphil
a0bcd0f946 Fix expect().toBeGreaterThan() not throwing when ANSI is disabled (#8838) 2024-02-10 14:00:16 -08:00
guest271314
2264bb3d04 Substitute js/ for test/js/ (404) (#8808) 2024-02-10 10:44:22 -08:00
Ciro Spaciari
3e1231deb4 fix(crypto) fix KeyObjectkey handling (#8824)
* ref/deref buffer

* Clean up this code

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-09 21:14:35 -08:00
dave caruso
dfcac563bc fix error message in bun.serve (#8828)
* fix error message in bun.serve

* ok
2024-02-09 17:24:46 -08:00
Ciro Spaciari
90fd322b5c fix timer tests (#8804) 2024-02-09 14:00:47 -08:00
Zack Radisic
f77b217abf Correct shell docs for $.escape() 2024-02-09 11:41:59 -06:00
Risu
7c2be6a877 Fix bun-types/index.d.ts (#8802) 2024-02-09 08:46:42 -08:00
Dylan Conway
a3c3dad351 wrap (#8812) 2024-02-09 03:42:03 -08:00
Travis Cooper
98b438d0a4 Update bunfig.md (#8807) 2024-02-09 01:54:00 -08:00
cirospaciari
58d22b063c Unmark tests that are now passing on Windows 2024-02-08 23:02:32 -03:00
Ciro Spaciari
8cd1db9cda [windows] fix crypto (#8797)
* fix password

* refactor

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-02-08 18:00:22 -08:00
dave caruso
2d7df726fd fix: get bun build working on window (#8712)
* work on bundler

* a

* YAAAAYYAYAYAYYAYA

* get some more bundler tests working

* Update src/bundler/bundle_v2.zig

* rev

* ok

* i converted the cmakelists into LF

* personal review

* we didnt win

* okey they pass

* revert :(

* a

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-02-08 17:56:26 -08:00
Ashcon Partovi
1ccf0c2e9c Fix some errors not showing up in GitHub annotations (#8799)
* Remove dead code now that `expect()` can be used outside of tests

* Fix some errors not being rendered to GitHub annotations

* [autofix.ci] apply automated fixes

* Update jest.zig

Try `execCallback`

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-08 17:52:58 -08:00
cirospaciari
db85e04ade Unmark tests that are now passing on Windows 2024-02-08 22:19:31 -03:00
Ciro Spaciari
c2936b205d [windows] fix(fetch) file:///, keepalive and tests on Windows (#8784)
* fix file:/// on windows

* skip fifo test

* fix keepalive

* fixes

* avoid std.os.getcwd on POSIX
2024-02-08 17:11:06 -08:00
dave caruso
8680641c23 make process.test.js pass (#8798) 2024-02-08 16:54:09 -08:00
Ciro Spaciari
e77db8ebac [windows] fix which (#8791)
* fix which

* [autofix.ci] apply automated fixes

* refactor

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-08 15:44:56 -08:00
Steven Roussey
dfbedd6a10 fix: flaky test (#8796)
This often fails in CI (and on my machine) non-deterministically.

The 1ms + the 5000 is likely setting up a race condition in tasks/microtasks. Just changing it to to +10ms instead of +1ms is enough.
2024-02-08 15:17:14 -08:00
Ashcon Partovi
8624a86eba Unmark tests that are now passing on Windows 2024-02-08 13:42:13 -08:00
Georgijs
bfc6091faf correctly unblock all signals (#8792) 2024-02-08 12:09:33 -08:00
Joe
9d0a88ab82 docs: quick note on dependencies for C++ (#8772)
* quick note on dependencies for C++

* note Ubuntu C++ standard lib issue and anchor link to troubleshooting

* clarify ubuntu distros
2024-02-08 11:18:37 -08:00
Jarred Sumner
2f8f77eeb7 Ignore panic in reload (#8778)
* Ignore panic in reload

* Use

* Update c-bindings.cpp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-08 00:29:08 -08:00
Steven Roussey
7b6e0f7164 fix: Increase max depth of expect diffs (#8771)
Fix Issue #6519
2024-02-07 16:07:20 -08:00
Ciro Spaciari
5df59cb02b [windows] fix(fs.watch) (#8746)
* clean fixes

* [autofix.ci] apply automated fixes

* more tests passing

* EPERM instead of AccessDenied

* [autofix.ci] apply automated fixes

* fix test on windows

* cleanup

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-07 15:44:07 -08:00
Jarred Sumner
b61282e290 Fix async module mocking (#8769)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-07 15:40:10 -08:00
Dylan Conway
dd3227c436 fix: crash in release builds (#8773)
* zig

* unreachable

* more comment
2024-02-07 15:38:14 -08:00
Georgijs
a9a4bbcd24 remap 0.0.0.0 to localhost on windows (#8770) 2024-02-07 15:17:24 -08:00
Georgijs
55aa35ee35 Fix watch attempting to reuse ports that are not yet released by the old process (#8764)
* windows watcher start new process only after previous terminated

* simplify env setup in spawnWatcherChild
2024-02-07 15:11:28 -08:00
dave caruso
a99459ffdc fix: symlinked files as entry points do not show Bun.main (#8762) 2024-02-07 13:06:11 -08:00
Jake Gordon
08f957d33b fix glob example to be recursive as stated (#8755) 2024-02-07 12:53:28 -08:00
Georgijs
2bd4fe578e Make HTTP shutdowns more robust, speed up connection to localhost (#8730)
* http use arraylist to handle shutdowns

* on windows use wsaconnectbyname to speed up localhost connections

* use arbitrary port

* close socket on setsockopt error

* use null timeout in wsaconnectbyname

* Update src/http.zig

* fix zig compile

* update hostname on linux

* [autofix.ci] apply automated fixes

* fix getpeername failing after connecting with socket

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-07 12:19:41 -08:00
Georgijs
d672309547 c-ares dns on windows (#8737)
* c_ares dns on windows works

* handle errors

* fix invalid hostnames test
2024-02-07 16:26:53 -03:00
argosphil
e171f04ce6 Fix ref-counting of Bun.file(0) etc. (#8687) (#8741)
* Test for #8687

* Fix reference counting of Bun.file(0) etc. (#8687)

Fixes #8687.
2024-02-06 18:11:25 -08:00
Ciro Spaciari
651d5699a0 [windows] fix(fs.watchFile) (#8735)
* fix fs.watchFile

* oopsie

* fix bigint and persistent

* use repeat to make watchFile tests more reliable

* [autofix.ci] apply automated fixes

* follow the pattern

* add increment

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-06 18:10:28 -08:00
Meghan Denny
d0d4d8bf85 windows: enable more passing tests (#8711)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-02-06 16:08:49 -08:00
Ciro Spaciari
53814dda00 [windows] fix(http2) (#8734)
* fix win http2

* add includes

* cleanup

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-06 15:37:39 -08:00
Meghan Denny
d3d5c7a1d6 tidy: access env map through getter rather than direct field (#8716) 2024-02-06 11:25:45 -08:00
Jarred Sumner
972a7b7080 skip some tests 2024-02-05 19:51:08 -08:00
Jarred Sumner
e3759bbbfe Update bun-windows.yml 2024-02-05 18:46:18 -08:00
Jarred Sumner
f722236978 [windows] Make child_process.spawn not say "TODO: IPC" when IPC isn't used 2024-02-05 17:39:47 -08:00
dave caruso
e366921e90 fix(windows): make fs.symlink normalize forward slashes to backslashes (#8710)
* fix fs.symlink()

* update comment

* .

* add todo
2024-02-05 16:09:50 -08:00
Georgijs
bd2779b029 Fix --hot with empty file, make --hot faster on windows (#8708)
* reduce watcher timeout in windows, fix hot reload with empty files

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-05 14:40:18 -08:00
Ashcon Partovi
a05ef0aeb1 Remove unintentional commit
This reverts commit 23b292ac21.
2024-02-05 12:50:09 -08:00
Ashcon Partovi
264142e756 Add isWindows and related helpers to test harness 2024-02-05 12:47:52 -08:00
Ashcon Partovi
51def5f5d6 Use biome in bun-types 2024-02-05 12:22:39 -08:00
Ashcon Partovi
23b292ac21 T 2024-02-05 12:22:39 -08:00
dave caruso
48ed1dfb65 less (#8651)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-02-05 10:06:23 -08:00
Drake Semchyshyn
bd4d0d15db Update plugins.md (#8674)
Updated Custom Plugins section (Svelte) so that the import name, and the name that was used, matches each other.
2024-02-04 01:19:00 -08:00
Jarred Sumner
1f0c1c81e9 Fix test 2024-02-04 00:42:40 -08:00
Jarred Sumner
e93eb6c1ab Add event loop debug assertion for Promise.resolve() and Promise.reject() 2024-02-04 00:03:45 -08:00
Jarred Sumner
1009b07807 Implement server.unref() and server.ref() (#8675)
* Implement server.ref() and server.unref()

* Update dns_resolver.zig

* Update server.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-03 23:57:34 -08:00
Georgijs
1a695f13bf Async file copying on windows (#8649)
* rework and simplify file opening in windows

* fix tests

* symlink tests pass

* update error handling

* remove outdated normalization check

* fix mac build

* apply suggested fixes

* fix path tests

* remove debug print

* fix windows compile
2024-02-03 22:33:35 -08:00
Jarred Sumner
c75e768a6c Assert we drained the microtask queue since the last time we called into JavaScript (#8646)
* Add checks that we drain the microtask queue whenever we call into JavaScript

* Drain microtasks in more places

* Tweak assertions for entering/exiting the event loop

* Drain more

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-03 07:40:15 -08:00
Dylan Conway
7d86f9e590 fix(test): strict equals and deleted properties (#8663)
* deleted properties size

* dont need count if structure id is eql

* more test

* fix slow path

* oops forgot this
2024-02-03 06:35:13 -08:00
Dylan Conway
a8600b0878 upgrade 2024-02-03 06:20:24 -08:00
Dylan Conway
5b228256f9 method and comment 2024-02-03 04:24:20 -08:00
Dylan Conway
ba4daee7e5 fix: statement joining and tmpdir on windows (#8659)
* drive letter

* joinwithcomma bundle

* tmpdir update

* same order as os.tmpdir
2024-02-03 04:17:12 -08:00
Jarred Sumner
2c0c562d1d Fixes #4746 (#8661)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-02-03 03:38:59 -08:00
Jarred Sumner
683a03d8c7 Set a default value for Error.prepareStackTrace to align with Node (#8657)
* Set a default value for `Error.prepareStackTrace` to align with Node

* Ensure we never set negative line/column numbers in error.stack (#8656)

* fix(windows): fix macros (#8653)

* fix macro tests

* path format options

* remove failing comment

* fix buffer toString memcpy length

* Ensure we never set negative line/column numbers in error.stack

---------

Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-02-03 02:04:58 -08:00
Dylan Conway
e0c0fe235a fix(windows): fix macros (#8653)
* fix macro tests

* path format options

* remove failing comment

* fix buffer toString memcpy length
2024-02-03 00:35:25 -08:00
Jarred Sumner
d16ac87347 Export compile_commands.json 2024-02-02 23:25:07 -08:00
Dylan Conway
5934b17f00 fix(windows): fix a few more tests (#8644)
* fix regression tests

* fix fs.test.ts bigintstats

* enable transpiler cache lol

* remove failing

* fix filesystem router

* update

* fix run-unicode test

* update comment

* add updated snapshot

* fix remaining node-module-module tests

* fixup

* [autofix.ci] apply automated fixes

* fix tty tests

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-02-02 18:58:16 -08:00
Ashcon Partovi
eedf008c80 Fix formatting not always working 2024-02-02 14:25:53 -08:00
Meghan Denny
3a6318b67c windows: fix module.paths getter causing a crash (#8633)
* windows: fix module.paths getter causing a crash

* use the buffer that was there before
2024-02-02 01:29:50 -08:00
dave caruso
647b15e4f3 fix(windows): initialize uv allocators earlier (#8631)
* uv loop is thread local

* hi

* stuff so far

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-02-02 00:18:28 -08:00
ふかねこ
625b172a71 docs: Update binary-data.md (#8635)
Binary notation ("0b") is appropriate instead of hexadecimal notation ("0x").

Sorry for the omission of the correction in this [PR](https://github.com/oven-sh/bun/pull/8619).
2024-02-02 00:16:14 -08:00
Meghan Denny
4959c7d363 remove ZigString.Slice.from .init is the exact same thing (#8632)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-02-01 20:35:47 -08:00
Meghan Denny
8808437a02 meta: remove remaining references to prettierrc.cjs (#8634) 2024-02-01 19:24:17 -08:00
Tiramify (A.K. Daniel)
330a4744de chore: fix compiling fd.zig on linux (#8630) 2024-02-01 17:31:54 -08:00
Ashcon Partovi
3a1229d03d Add mysql2 integration test (#8075) 2024-02-01 15:04:49 -08:00
Ashcon Partovi
63a9a8b015 Improve .vscode extensions, tasks, and configuration (#8511) 2024-02-01 14:55:35 -08:00
dave caruso
f73bde79c7 fix(debug): get the result for fd debug message before we close it (#8626) 2024-02-01 14:26:20 -08:00
Meghan Denny
3a7df3f6c7 windows: add more passing test (#8615) 2024-02-01 13:45:47 -08:00
dave caruso
0037dc2537 chore: update webkit 2024-02-01 13:38:09 -08:00
ふかねこ
c0fe042102 Update binary-data.md (#8619)
Binary notation ("0b") is appropriate instead of hexadecimal notation ("0x").
2024-02-01 12:38:54 -08:00
Andres Guarneros
ce1eba1954 Update quickstart.md (#8622)
Update index.ts code snippet for consistency in quickstart.md.
2024-02-01 12:38:21 -08:00
Dylan Conway
8191fbd970 fix: id instead of path (#8617)
* use id

* another path
2024-02-01 02:19:18 -08:00
Dylan Conway
2af7cdedc2 path should be dirname 2024-02-01 00:34:34 -08:00
Dylan Conway
4f98336f86 fix(windows): fix installing non-ascii paths and make normalizeBuf generic (#8608)
* comptime type normalizeStringBuf

* delete

* revert

* revert revert

* revert

* remove unused

* remove unnecessary assert

* add comment

* remove normalize, need ../

* use Output.err

* update error message

* generic T suffix

* fix windows build

* more fix build

* more fix build

* mkdiratZ

* update test

* [autofix.ci] apply automated fixes

* update snapshot again

* fix merge

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-31 22:44:23 -08:00
dave caruso
91cfd614ca fix(window): some more bin things (#8612)
* allow linking bins that do not exist.

* fix some things
2024-01-31 22:37:03 -08:00
Meghan Denny
42e4cd8408 get more bundler tests passing on windows (#8560)
* get test/bundler/bundler_naming.test.ts passing on windows

* move platformToPosixInPlace to bun.path and use the vector'd version

* only resolve rel_path if it contains '/./', most of the time './' needs to be preserved

* fix another file too

* move kernel32 extern to better location

* [autofix.ci] apply automated fixes

* use bun.path.posixToPlatformInPlace here

* rewrite this whole section to stay in utf16 and handle errors

* remove dead comments

* fix a typo

* undo these relative changes

* preserve path.pretty from getting lost

* use bun's instead of zig's resolve here

* both side of this loop need the inplace normal

* use existing generic dirname function

* make path inplace functions generic

* we might need to modify this so copy on windows

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

* don't assume the prefix we get from this

* more robust path traversal

* don't mangle absolute paths

* do this bit in a loop

* this line is a u16

* dont forget to compile before pushing

* this was wrong

* look into this later

* check pointer math first since its faster

* posix syscalls support path traversal, don't do the work for them

* its already inside stable, no need to change

* used the online editor

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-31 22:29:33 -08:00
dave caruso
dbe0a4a978 do more assertions (#8610) 2024-01-31 22:14:03 -08:00
Georgijs
350cc1178a --watch and --hot on windows (#8607)
* draft impl of windows watcher

* synchronous watcher

* working standalone watcher

* in progress changes to watcher

* make watcher non-global

* prepare watcher for windows impl

* add windows watcher scaffold and clean up imports

* fix inotify

* make watch code more generic over platforms

* fix visibility

* watcher starts without error

* printing changes works

* basic windows watching works

* handle process exit from watcher

* cleanup in process cloning

* clean up logging and panic handling

* fix hot reload test on windows

* misc cleanup around watcher

* make watch test actually useful

* [autofix.ci] apply automated fixes

* remove old files

* clean up watchers

* update .gitignore

* rework windows watcher into single watcher instance watching top level project dir

* use non-strict utf16 conversion

* change to contains

* fix mac and linux compile

* add baseline in crash report (#8606)

* allow linking bins that do not exist. (#8605)

* fix linux compile

* fix linux compile (again)

* remove outdated todo

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
2024-01-31 22:06:33 -08:00
Jarred Sumner
dccabd9423 Make test work better on windows 2024-01-31 22:03:52 -08:00
dave caruso
345a061d3b fix(windows): make process.env case-insensitive (#8578)
* yay!!!!!!

* [autofix.ci] apply automated fixes

* ok

* do not use reflect here

* ok

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-31 21:52:50 -08:00
3λiȯ+
690346b30b docs: Fix typo in code example for Transpiler.transformSync (#8553)
* Docs: Fix typo in code example for transformSync

* Remove await since transformSync is synchronous

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

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-31 21:18:57 -08:00
huseeiin
16b7b94aea Update bun.d.ts (#8595)
Add `string | ArrayBuffer` to compressing/uncompression functions
2024-01-31 21:13:12 -08:00
Meghan Denny
fcf0047763 windows: pass ws.test.ts (#8611) 2024-01-31 21:08:19 -08:00
dave caruso
af1a124831 allow linking bins that do not exist. (#8605) 2024-01-31 19:08:50 -08:00
dave caruso
f5754e3c19 add baseline in crash report (#8606) 2024-01-31 18:13:39 -08:00
Joe
4e09f8ef8f Issue-6526 - clarify web docs for the use of .only() (#8600)
* Update writing.md

clarify the use of `.only()`

* Update test.d.ts

Small clarification in JSDoc
2024-01-31 14:12:26 -08:00
Luke Ingalls
1969204fa5 docs: remove outdated callout (#8584)
seems like this is already patched https://github.com/oven-sh/bun/issues/5394
2024-01-31 00:08:26 -08:00
dave caruso
2d9db9b28f fix napi-rs libraries on windows (#8583)
* yay

* a

* ok

* typo

* un-CRLFify these files
2024-01-30 20:21:52 -08:00
dave caruso
0333c7b0bf Fix "__dirname" on windows (#8579) 2024-01-30 16:17:32 -08:00
Dylan Conway
82829c5925 fix crash 2024-01-30 13:44:00 -08:00
dave caruso
8fdb46cb91 ok 2024-01-30 10:04:06 -08:00
vinnichase
0aba51230c dx: create symlink on every execution (#8568)
Symlink is not created on first setup.
2024-01-30 09:41:18 -08:00
Dylan Conway
ca801a35fe fix(windows): fix win32 errors (#8569)
* translate eexist

* use SystemErrno translation

* update
2024-01-30 06:49:59 -08:00
vinnichase
692fb220a4 Update launch.json to use ${workspaceFolder}/build/bun-debug (#8570) 2024-01-29 22:38:43 -08:00
dave caruso
cf1c849e4a fix(windows): more reliable extracting (#8567)
* finally

* a

* Update src/install/extract_tarball.zig

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

* fix compilation

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-29 20:03:02 -08:00
Jarred Sumner
2eede4f435 Fixes #8555 (#8566)
* Fixes #8555

* Make this closer to what npm does

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-29 17:52:08 -08:00
dave caruso
4989ef88b8 docs: mark PerformanceEntry and friends as implemented (#8466)
* docs: mark PerformanceEntry and friends as implemented

* Update docs/runtime/nodejs-apis.md

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-29 15:49:06 -08:00
Jarred Sumner
9fa26e6a09 Close more file descriptors in bun --watch (#8533)
* Close more file descriptors in `bun --watch`

* Reset signals

* Add comment

* Update bun.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-29 15:48:26 -08:00
Jarred Sumner
413aaaff33 [bun:sqlite] Support multiple statements in db.run() (#8541)
* [bun:sqlite] Support multiple statements in db.run()

* Update sqlite.test.js

* Update JSSQLStatement.cpp

* Another test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-29 15:17:51 -08:00
Dylan Conway
c538bf87d1 fix(windows): transpiler cache and other test fixes (#8471)
* umask

* process args

* update reportError.test.ts

* file exists

* transpiler cache

* back to const

* remove failing comments

* [autofix.ci] apply automated fixes

* update comment

* debug assert and remmove branch

* oops

* escape

* path sep

* seekTo

* disable

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-29 15:17:23 -08:00
dave caruso
1e9b44adda internal: report all failing tests to our internal feed (#8563)
* yeah

* oop

* yeahh
2024-01-29 15:17:14 -08:00
dave caruso
3046b0ee39 feat(windows): allow open and Bun.file() with /dev/null (#8499)
* DEV NULL

* oops

* ok
2024-01-29 11:08:09 -08:00
dave caruso
01d41838c5 fix(builtin-bundler): do not replace globals when extending classes (#8557)
* fix(builtin-bundler): do not replace globals when extending classes

* format
2024-01-29 11:07:39 -08:00
dave caruso
bc7e7027e4 windows: some random things (#8521)
* swaggin

* fix(bun_shim_impl): support exe names that are shorter than four characters

* hi

* a
2024-01-29 10:50:24 -08:00
João V. Farias
eaea6dea54 chore(build): adjust arch/manjaro linux auto detect to include artix (#8510) 2024-01-29 09:41:58 -08:00
Jarred Sumner
d0b759f784 Remove references to bun-types 2024-01-29 08:10:14 -08:00
Dale Seo
dbfc62e288 docs: include .jsx (#8542) 2024-01-28 10:00:54 -08:00
Yahya Jirari
34ae040d95 docs: remove unnecessary await in lines() example (#8537) 2024-01-28 06:36:29 -08:00
Ben Limmer
3caa846988 docs: expect.extend is implemented (#8525) 2024-01-27 20:39:46 -08:00
Dylan Conway
5a0ae3c256 not on windows 2024-01-27 07:32:06 -08:00
Dylan Conway
568f87eb8f fix(windows): bun link, unlink, and fix tests in test/cli/install (#8517)
* link and unlink

* valid git dependency cache path

* windows global link

* not git

* update some tests

* update more tests

* update

* update log

* fix snapshots

* more tests

* fix bun pm ls

* make it possible to delete cache dir

* normalize

* fix bun-create tests

* update bun-remove tests

* silent

* bun-run update

* update more tests

* update more

* update

* [autofix.ci] apply automated fixes

* update simdutf for getFdPath

* update test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-27 04:22:04 -08:00
dave caruso
968c21d80a feat(windows): support bun build --compile (#8503)
* alright

* were winning

* WAOOOOOO
2024-01-26 20:56:08 -08:00
dave caruso
6faeef6dc2 Workaround https://github.com/microsoft/terminal/issues/16606 (#8506)
Fixes #8504
2024-01-26 20:55:48 -08:00
Georgijs
08c9511acc [windows] nodefs (#8509)
* 100 passing fs tests

* 111 fs tests passing

* 114 passing fs tests

* 115 passing (TODO: fix path normalization for windows ntCreateFile

* all fs tests passing

* [autofix.ci] apply automated fixes

* make windows path norm smarter, fix tests

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-26 20:07:33 -08:00
Meghan Denny
1644f341f9 windows: setInterval.test.js is passing now (#8508) 2024-01-26 14:11:03 -08:00
nullun
17fc1e7be1 chore: Remove trailing whitespace (#8502) 2024-01-26 07:25:45 -08:00
Jarred Sumner
7492b3a203 [windows] Remove no longer failing tests from being marked as failing 2024-01-25 21:59:11 -08:00
Jarred Sumner
681baedab2 Track hasInstallScript and libc in NPM registry api (#8495)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-25 20:38:20 -08:00
Jarred Sumner
c7c3ae381b Make this test less flaky on Windows 2024-01-25 20:37:41 -08:00
Jarred Sumner
7543da0bb3 Always normalize the carriage returns in the bundler tests 2024-01-25 20:27:58 -08:00
dave caruso
83ac4f0c33 windows: fix bun plugin (#8485)
* plugins work now

* real

* Update src/js/builtins/BundlerPlugin.ts

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-25 19:34:51 -08:00
Jarred Sumner
3c42dfd42b [internal] Tweak jsonc formatting 2024-01-25 19:19:32 -08:00
Jarred Sumner
e3188c918a use Biome to format Bun's codebase instead of Prettier (#8494)
* Ignore

* Create biome.json

* Ignore

* biome

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-25 19:15:26 -08:00
Jarred Sumner
045672cf67 Force \n instead of \r\n on Windows CI 2024-01-25 19:05:47 -08:00
Dale Seo
345ed18454 fix: mock() should work with no arguments (#8492) 2024-01-25 17:06:36 -08:00
Jarred Sumner
5462ca01fd Typo 2024-01-25 16:33:07 -08:00
Jarred Sumner
4bfd8a8cef Make this test less flaky on Windows 2024-01-25 16:30:25 -08:00
Jarred Sumner
a2a12b5802 Make this test less flaky on Windows 2024-01-25 15:09:32 -08:00
Jarred Sumner
b6c1dc1fa8 Use native AbortController & AbortSignal when abort-controller is loaded (#8489)
* Nationalize `abort-controller`

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-25 15:01:29 -08:00
Jarred Sumner
f4f8bb377a Make this test less flaky on Windows 2024-01-25 14:53:20 -08:00
Jarred Sumner
5c21695db6 Bump + ci autofix (#8490)
* Bump

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-25 13:58:59 -08:00
Adam Dimitry Enzo Ambrosino
2c16b204ff Fix type definition for Array.fromAsync (#8486) 2024-01-25 10:32:47 -07:00
dave caruso
20f7fd5b08 fix(windows): do not use GetTempPath2W (#8477) 2024-01-25 08:13:36 -08:00
dave caruso
c9a7d24538 windows(install): add bun_shim (support bin linking, bin shebangs, etc) (#8265)
* shim v1 TODO

* fix BunXShimData

* wip

* put a little bit of the sa u c e on it

* wow

* wat

* a

* swag

* swag

* allllllllllllright

* Update src/install/bin.zig

Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>

* [autofix.ci] apply automated fixes

* swag

* swag

* finis

* fix submodules

* ok

* omg it works again

* silly

* ok

* OK

* update laucnh jsn

* swaaaaaaaaaaaaag

* remove debug

---------

Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-25 07:38:55 -08:00
Jarred Sumner
108cae5189 Disable dead code elimination when code coverage is enabled (#8473)
This should hopefully make source mappings more accurate

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-25 05:31:44 -08:00
dave caruso
358be9e727 docs: update the windows build documentation and list it on the docs site 2024-01-25 04:15:41 -08:00
Jarred Sumner
2a6388d50b Silence log when ENOTCONN
When using sendfile() to stream, if the user aborted the request it may appear as `ENOTCONN`, which we were logging to the terminal. We really shouldn't be logging anything here, but it's a little unclear what kind of error to emit. It's not a fatal error.
2024-01-25 01:03:29 -08:00
Jarred Sumner
aa901a22c2 Update types.zig 2024-01-24 23:11:58 -08:00
Jarred Sumner
562495b878 [windows] Mark as known failing 2024-01-24 23:11:55 -08:00
Jarred Sumner
875728da83 [windows] Make more things panic 2024-01-24 22:47:40 -08:00
Jarred Sumner
47e7e004b1 Remove @known-failing-on-windows for tests which are no longer failing on windows 2024-01-24 21:03:32 -08:00
Georgijs
80bd3254cc fix argv parsing on windows (#8458)
* fix argv parsing on windows

* directly use zig stdlib

* remove debug comments, fix double deinit

* change bun.argv() to return slices, not null-terminated pointers

* fix test on windows to escape file paths correctly

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-24 20:54:01 -08:00
Jonathan Deiss
0bf8a25d50 Clarifies bun shebang in bunx documentation (#8437)
* Update bunx.md

* better phrasing of shebang
2024-01-24 19:59:56 -08:00
Meghan Denny
effb8f189b windows: fix some websocket tests (#8433)
* windows: fix some websocket tests

* this file should work now, report any errors

* make this change later

* add back running this with node

* add as const to these

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-24 19:40:59 -08:00
Johann
7eeefc1497 chore(password): fix sha256 typo (#8461) 2024-01-24 19:27:29 -08:00
Georgijs
025a5ba140 fix sys.dup on windows and make console-iterator work (#8463)
* fix sys.dup on windows and make console-iterator work

* fix(windows): fix console async iterator to not include the \r

* fix kill on windows again. and report the right errno

---------

Co-authored-by: dave caruso <me@paperdave.net>
2024-01-24 19:25:45 -08:00
Ashcon Partovi
885d705d55 Fix bun-types version being incorrect 2024-01-24 15:21:10 -07:00
dave caruso
3447bc2ed3 fixy 2024-01-24 03:16:23 -08:00
Jarred Sumner
f1f861fd74 [windows] Fix panic in server 2024-01-24 02:20:29 -08:00
dave caruso
58ba802ca6 ci(windows): install the profile build 2024-01-24 02:12:16 -08:00
Zachary Huang
73f3b92dc9 fix(ci): fix MacOS build when OpenSSL is also installed (#7759)
Co-authored-by: dave caruso <me@paperdave.net>
2024-01-24 01:44:04 -08:00
dave caruso
eeb10f3f7d fix(windows): fix node:url pathFromFileURL and fileURLFromPath and file url tests (#8442)
* yay for file urls

* swag

* oops

* merge conf

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-24 01:19:47 -08:00
dave caruso
8544f8ae68 ci(windows): debug info in the binaries + ship a version on github (#8443)
* debug info yaaaaaaaaaaaaaaaaaay

* fix the build
2024-01-24 01:16:17 -08:00
Jarred Sumner
9f5ce53544 Normalize another newline 2024-01-23 23:44:38 -08:00
Jarred Sumner
82b6a42a3c Normalize more paths 2024-01-23 20:48:48 -08:00
Jarred Sumner
0974479655 Normalize slashes 2024-01-23 20:47:37 -08:00
Jarred Sumner
918e1878a5 Normalize newlines 2024-01-23 20:45:37 -08:00
Jarred Sumner
17deafd05f Add TypeScript issue template 2024-01-23 20:39:08 -08:00
Dylan Conway
b7ae984ca1 fix(windows): update some bundler tests (#8440)
* replace invalid path character

* windows paths
2024-01-23 20:23:01 -08:00
Jarred Sumner
e848c3f226 Get Bun.write tests to pass on Windows and bun:sqlite tests to pass (#8393)
* Move ReadFile and WriteFile to separate file

* Use libuv for Bun.write()

* Update windows_event_loop.zig

* build

* Get bun-write tests to pass. Implement Bun.write with two files.

* UPdate

* Update

* Update failing test list

* update

* More

* More

* More

* More

* Mark the rest

* ok

* oops

* Update bun-write.test.js

* Update blob.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Dave Caruso <me@paperdave.net>
Co-authored-by: Georgijs Vilums <georgijs.vilums@gmail.com>
2024-01-23 20:03:56 -08:00
Dylan Conway
cd3de9c788 fix(windows): fix text-decoder.test.js (#8436)
* use with_errors

* remove comment

* use correct index
2024-01-23 19:28:54 -08:00
dave caruso
945ad77bce window: fix runtime.js build process (#8438)
Co-authored-by: Georgijs Vilums <georgijs.vilums@gmail.com>
2024-01-23 19:27:57 -08:00
Chen Yufei
04a99deb0e copy_file: ioctl_ficlone EACCES, EPERM as not supported. (#8425)
ioctl_ficlone may return EPERM (in LXC container), EACCESS (in Android).
Those error should be taken as ficlone being not supported instead of
error.

Refer to this coreutils bug report https://bugs.gnu.org/62404
2024-01-23 18:24:54 -08:00
Ciro Spaciari
cff5dc0ee8 fix close on spawn and watch (#8426)
* fix close on spawn and watch

* add check closed, and fixes

* fix subprocess close
2024-01-23 18:09:13 -08:00
Dylan Conway
77ccf77e35 Revert "Revert "fix(windows): a bunch of install test fixes"" (#8431)
* keep cache dir path, use correct buffer

* make it work more better

* more working

* more fix

* more update

* more fix

* fix test

* update

* fix

* update pointers

---------

Co-authored-by: dave caruso <me@paperdave.net>
2024-01-23 18:00:18 -08:00
DidaS
864a726249 Improve bun-types (#8195) 2024-01-23 13:51:45 -07:00
Jarred Sumner
1407683f95 Revert "fix(windows): a bunch of install test fixes" (#8408) 2024-01-23 06:38:13 -08:00
dave caruso
1f928e9b6e goddamn (#8405) 2024-01-23 06:37:14 -08:00
Dylan Conway
e0cf77c660 fix(windows): a bunch of install test fixes (#8402)
* keep cache dir path, use correct buffer

* make it work more better

* more working

* more fix

* more update

* more fix

* fix test

* update tests

* comment and fix test

* one more fix

* fix build

---------

Co-authored-by: dave caruso <me@paperdave.net>
2024-01-23 06:36:53 -08:00
dave caruso
07a685bd3d feat(windows): implement the rest of node:os (#8399)
* feat(windows): implement os.networkInterfaces

* we are cooking (os tests almost pass)

* os

* fix version struct

* oops

* [autofix.ci] apply automated fixes

* fix the submodules

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-23 05:06:51 -08:00
dave caruso
80ad8d57f2 windows: fix a path resolution case (#8392)
* fix resolving certain filepaths

* extra

* swag

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-22 21:53:34 -08:00
Jarred Sumner
41b45599c6 Delete some dead code (#8391)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-22 21:06:13 -08:00
Ciro Spaciari
416e896c63 [windows] Implement fs.watch on Windows (#8379)
* implement fs watch

* fix unref

* fixes

* actually use bun.New

* fix destroy, use another buffer for joinPath, remove Win prefix

* oopsie
2024-01-22 20:29:46 -08:00
Dylan Conway
2d1e0dc240 trim correctly (#8388)
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-22 19:57:20 -08:00
Meghan Denny
c52e7c57d2 add another launch config for windows bun test (#8389) 2024-01-22 19:45:39 -08:00
Georgijs
c4a60f9059 fix to enqueue bundler tasks in correct event loop (#8386)
* fix to enqueue bundler tasks in correct event loop

* fix posix build

---------

Co-authored-by: Georgijs Vilums <georgijs@bun.sh>
2024-01-22 19:45:24 -08:00
Dale Seo
15fe30ac41 docs: remove unncessary use of async in bun test examples (#8341) 2024-01-22 17:57:02 -08:00
Dale Seo
a014f1c566 docs: correct imports (#8380) 2024-01-22 17:14:55 -08:00
Jarred Sumner
73b0b35a42 Make the dev-server test more reliable 2024-01-22 17:09:47 -08:00
Georgijs
75524d0ae3 Fix eqlComptimeCheckLenWithKnownType (#8377)
* fix some env tests

* fix and simplify comptime string equality

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-22 16:41:30 -08:00
John-David Dalton
c21dc25a65 Change type for expect().toThrow(unknown) (#8373) 2024-01-22 13:27:25 -07:00
Georgijs Vilums
3bc0f90a7c skip invalid stringWidth test 2024-01-22 12:25:49 -08:00
Jarred Sumner
eaa1cd5553 Add shell-spawn microbenchmark 2024-01-22 03:23:47 -08:00
Jarred Sumner
6019665d4b Fixes #8276 (#8346)
* Fixes #8276

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-21 20:25:00 -08:00
Jarred Sumner
b7b0e28b10 Rename bun.zig to BunObject.zig (#8344)
* Rename `bun.zig` to `BunObject.zig`

* Rename `bun.classes.ts` to `BunObject.classes.ts`

* Update references to `bun.zig`

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-21 19:55:24 -08:00
moznion
c577c64aa7 docs: add description how to parse the CLI ARGV by the built-in parseArg (#8345)
Signed-off-by: moznion <moznion@mail.moznion.net>
2024-01-21 19:54:49 -08:00
Jarred Sumner
1560a866fe Skip stringWidth tests for now 2024-01-21 19:25:57 -08:00
Dale Seo
5b9e1e5708 docs: fix a typo (#8338) 2024-01-21 17:17:55 -08:00
Jarred Sumner
353f724a9c Update bun.d.ts 2024-01-21 06:11:49 -08:00
Jarred Sumner
a8ff7be642 Disable Bun.stringWidth until failing test case passes 2024-01-21 06:10:07 -08:00
Jarred Sumner
af67ee77a0 Bump 2024-01-21 04:48:55 -08:00
Jarred Sumner
b82656d9fc Introduce Bun.stringWidth (#8327)
* Introduce `Bun.stringWidth`

* [autofix.ci] apply automated fixes

* Update utils.md

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-21 04:47:36 -08:00
Jarred Sumner
7b9201a0fc Fixup 2024-01-21 04:23:18 -08:00
Jarred Sumner
627d60c6c7 Fix crash in fs.readFile
We were default-initializing the vm pointer to undefined
2024-01-21 04:19:33 -08:00
Jarred Sumner
c00f0787f0 [types][bun:sqlite] Make SQLiteError a class instead of an interface 2024-01-21 03:57:38 -08:00
Jarred Sumner
3ca0fcb67a [node:vm] Add missing createScript function 2024-01-21 03:57:17 -08:00
Jarred Sumner
43107f48fa Add onLongTimeout callback for WebSocket (#8323)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-21 03:49:28 -08:00
Dylan Conway
b1273e53d8 windows(install): fix linking workspaces and file: dependencies (#8289)
* install workspaces with junctions

* fix #8272

* symlink auto type

* fix file: dependencies

* a better fix

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-20 23:00:29 -08:00
Jarred Sumner
10e57fdc1e windows pipes (#8230)
* spawn sync investigation, pipe closed before uv_read_start is called

* oopsie

* win rusage

* oopsie

* Fix some things

* readable stream now works without FIFO like solution

* blob, ArrayBuffer, Buffer stdin now works

* remove unused

* add UVStreamSink

* update headers.j

* more bindings

* now works yay

* fix rusage on windows

* oops

* fix rare data

* win getUserName

* [autofix.ci] apply automated fixes

* fix build

* oopsie

* fix linux/macos

* exit code fix

* fix kill for win

* disable Bun__crashReportDumpStackTrace on Windows

* remove windows stack dump in report.zig and increase windows test timeout

* condition instead of assertion

* remove IPC again

* fix blob writer when not using TTY

* bump windows tests time again

* bump time again so we see how much we need (this is probably too much)

---------

Co-authored-by: cirospaciari <ciro.spaciai@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
2024-01-20 22:58:01 -08:00
Bjön Limell
fad3db84f0 (docs) Fixed color in node compat (#8299)
`node:module` was green, when it should be yellow.
2024-01-20 22:54:30 -08:00
Dylan Conway
fccab2f0da fix(node:child_process): fix crash with ipc (#8319)
* make sure `onLongTimeout` doesn't happen

* add `onLongTimeout` handler
2024-01-20 22:53:16 -08:00
Dylan Conway
885f9372f4 fix(transpiler): loose equality folding bugfix (#8317)
* fix #8311

* fix `bigint` comparison

* cleanup

* couple tests

* fix `"-0" == 0`

* Update transpiler.test.js

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-20 22:52:53 -08:00
Hanaasagi
509a2c5a69 fix: fix the invalid free pointer in toStringWithBytes. (#8322)
Close: #8264
2024-01-20 22:26:58 -08:00
Meghan Denny
b433beb016 8096 isnt 8kb, 8192 is (#8296)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-19 23:16:11 -08:00
Dylan Conway
c71bad205c Update shell.md 2024-01-19 22:15:23 -08:00
Dylan Conway
d4794bbac8 Update shell.md 2024-01-19 20:05:22 -08:00
Dylan Conway
6fa35839c3 remove .only, update shell.md 2024-01-19 19:59:06 -08:00
Jarred Sumner
35d551c174 Fix passing undefined to $().cwd() and $().env() 2024-01-19 19:55:26 -08:00
Jarred Sumner
4674ee16a1 Simplify $.escape 2024-01-19 19:55:26 -08:00
Jarred Sumner
ce2ef65122 Small docs tweaks for shell 2024-01-19 19:55:26 -08:00
Dylan Conway
0d88dcb0fa Update shell.md 2024-01-19 19:21:26 -08:00
Jarred Sumner
15f727dc2f Update shell.md 2024-01-19 19:05:54 -08:00
Jarred Sumner
dcfec52b11 Update nav.ts 2024-01-19 18:55:29 -08:00
Meghan Denny
7ca4ca8972 copy_file: this TODO is no longer a compiler bug (#8294)
* copy_file: this TODO is no longer a compiler bug

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-19 18:45:59 -08:00
Dylan Conway
76ed8d8086 fix(install): remove invalid bin symlinks (#8293)
* handle invalid bin symlink

* test
2024-01-19 18:37:03 -08:00
Jarred Sumner
1f126cd91a Fix benchmark in node 2024-01-19 18:36:00 -08:00
Jarred Sumner
5e520884cd Add to docs 2024-01-19 18:35:46 -08:00
Max Milton
1c5b318207 feat: Carry over node isIPv4/isIPv6 performance improvements (#8271)
Copy over the `isIPv4`/`isIPv6` performance improvements from
<https://github.com/nodejs/node/pull/49568>.
2024-01-19 17:31:52 -08:00
Zack Radisic
1b1760a9c9 feat: Bun shell (#7748)
* bring in shell impl

* add `$` to global bun scope

* Expose shell parse func on debug mode

* Expose lex tokens and add tests

* refactor parser to have better ast

* assigns and export

* pipeline kinda working

* Decouple Subprocess spawning code from JS stuff

* Subprocess works!

* Conditional execution

* Support JS objects in template expression

* More complete redirection

* Properly drain stdin/stdout/stderr and fix crash from deallocating JSC memory

* Return errors in parser

* Support command substitution

* wip brace expansion stuff

* Rearrange some files

* expansion wip

* Brace expansion working

* wip brace expansion

* refactor brace algorithm

* wip brace expansion on shell

* fix brace expansion

* Working nested brace expansion!

* brace expansion in shell variable assignment only set the last expanded

* stuff

* Small little perf things

* benchmark and test and stuff

* stuff

* fix nested braces but its also kinda broken

* attempt to fix complicated nested braces

* test

* Use fast tokenized algorithm for non nested braces, use parsed algorithm for nested braces

* fix nested braces one and for all

* small stuff

* Not sure if that made a difference

* revert that

* good speed optimization

* rip

* Environment variables, builtin/native shell cmds

* Fix tests

* Support `cd`, `pwd`, add boilerplate for glob expansion

* Support `which`

* Support `rm`

* wip

* wip

* escaping and abstract shell char iterator

* strpool unicode

* Brace expansion support unicode, disallow invalid surrogates in shell script

* shell choose ascii or unicode lexer depending on input

* fix bugs write tests

* kinda start async stuff

* HOLY SHIT big refactor of Subprocess

woops forget to commit this

...and this

* HOLY MOLY it works

* Refactor some stuff, start eval word expansion

* interpret all the nodes

* stuff

* stuff

* stuff

* kind of works but doesnt

* Buffered output works

* no need to heap allocate autosizer

* Fix bug

* Fix some stuff

* unprotect

* move out dummy shell thing

* Bring back assignments

* create expansion state so it can be non blocking for expansions that need IO (glob, cmd subst)

* glob back in action

* Setup builtin non blocking IO commands and implement export

big issue is control flow is really fcked up here need to fix that

* make Cmd state machine use a loop so control flow is a bit more clear

* rename stuff

* move that

* Implement the echo builtin again

* implement cd again but non blocking io

* Fix ls and use proper write function to prevent blockign writes

* Implement which

* holy moly big port std.fs.deleteTree

* fix compile errors

* Okay that works

* rm works thatsnice

* damn

* split it out

* rm async implementation

* fix rm bug for nested

* Work on files as well

* prevent root from being deleted

* rm error handling

* oops

* pwd and fix some script exec bug

* Implement `mv`

* stub out mv to work accross filesystems

* move it around

* woops

* boilerplate for ls and options

* more boilerplate

* stuff

* that got lost in merge

* upgrade shell stuff zig 0.12.0-dev.1828+225fe6ddb

* Implement basic ls

* smol cleanup

* Fix stream, response redirect stdin

* No longer need spawn to be abstract

* Custom promise

* move around some stuff

* shell promise returns shell output

* make tht work for builtins

* refactor IO abstractions to work with JS or mini event loop

* woops

* scaffolding for refactor

* refactor builtins to make event loop refactor easier

* Fix parsing edge case on assignments, fix expansion on cmd assignments

* change subproc to work with any event loop

* Finish refactoring subproc

* move global abstraction out

* big refactor boys

* holy moly: integrate into cli and fix allll the compile errors

* okay works in bun run now

* actually tick the event loop lol

* Fix more stuff

* Support comments

* Fix some tests

* delete that

* Properly report errors when failing to spawn command

* fix a whole bunch of tests

* fix a whole bunch of tests again

* .

* Fix rm

* Fix some exit code bugs, write force rm from deno, fix ls stderr

* fix `rm -d`

* fix `rm -d`

* Fix boolean logic

* error on subshells (e.g. `true && (echo hi && echo lol)`)

* Move out shell state from interpreter struct

* Cmd substitution supports arbitrary script, not just a single cmd

* Some escaping/quotation tests

* Fix stuff add more tests:

- cmd substitution quotations
- escape backticks in single quots

* ALOT of stuff:

- fix proper subshell inheritance of env for cmd subst
- fix: was wrong, assignments don't run in subshell in conditionals
- fix lexing chained vars `$VAR$VAR`
- more tests

* Fix subtle bugs

* Fix crazy redirect to arraybuffer bug

* more crazy echo edgecases

* Proper lexer errors instead of just panicking lol

* yoops

* Proper parsing errors

* Errors for bun run shell script

* Fix redirecting to file

* More test fix bugs yay

* Fix redirect on builtins

* Open redirection fds with O_TRUNC

* Fix lexing invalid variables and add ability to change cwd from JS api

* yoops

* Fix `.cwd()`

* `$PWD` and fix redirection bugs

* `$PWD` and fix redirection bugs

* Get rid of  some `FIXME`s

* throw errors in some places instead of panicking

* Print some errors to stderr

* Get rid of some more panics again

* Handle errors on glob

* pwd test

* `.env()`

* copy-on-write abstraction

* Reference counted env strings + fix some tests

* deinit cwd

* Put commands into a pipeline properly

* deinit Expansion and Assigns properly

* comments

* Comments

* Make it compile

* Update types

* [autofix.ci] apply automated fixes

* Only one WaiterThread

* Fix lifetimes and clean up interface

* Update shell.ts

* Add lazy test

* Remove some dead code

* Update shell.zig

* Fix memory leak

* Fix crash with empty braces

* [autofix.ci] apply automated fixes

* Linux build + bun.sh

* Update subproc.zig

* Update interpreter.zig

* Update interpreter.zig

* Fix some stuff that broke

* Fix Windows compile errors

* Fix some fd leaks

* Fix ls

* Fix a bunch of stuff

* Fix quiet

* Update leak tests fix rm bug

* More reproducible tests

* [autofix.ci] apply automated fixes

* more mem leak tests

* [autofix.ci] apply automated fixes

* Fix merge conflict

* Fix test not actually using temp directory

* Update bunshell.test.ts

* Shell instance

* Capture async context

* Increase test timeouts

* [autofix.ci] apply automated fixes

* Escape

* [autofix.ci] apply automated fixes

* Fix crash

* Add more methods

* [autofix.ci] apply automated fixes

* Fix leak

* Treat file(path) blobs as a file path string

* Create bunshell-file.test.ts

* Support Blob input

* Fix leak + organize imports

* doc

* Update shell.md

* Update shell.md

* Update shell.md

* Update shell.md

* Update CMakeLists.txt

* Fix segfault by cloning error path so it's not freed by arena

* deinit ShellErr

* Delete dead code

* fix really stupid segfault

* don't deinit shell ls task in event loop

* Fix ls bug

* Fix tests

* make truly lazy

* allow more things in the shell substitution and escape whitespace

* Fix newline and exit when finishing shell in `bun run`

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-19 17:30:57 -08:00
Lukas Kastern
751ff68268 feat: Add async support to Bun.serve onError (#8233)
* WIP

* Support not immediately fullfilled promises

* Typo

* Add tests

* Fix test

* Rename test

* Remove file

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-19 16:01:09 -03:00
Jarred Sumner
3c785c88fb Fix issue with perf_hooks in canary (#8279)
* Update perf_hooks.ts

* Update perf_hooks.test.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-19 05:22:06 -08:00
Dylan Conway
8efa01bd62 fix(bun:test): toContain and toContainEqual string fix (#8270)
* update toContain, toContainEqual, and tests

* fix build, use cursor

* `strings.indexOf` and `jsType` once
2024-01-18 20:13:57 -08:00
Ashcon Partovi
e17709a2d3 Fix bun --inspect with fully-qualified URL (#8267) 2024-01-18 18:32:51 -08:00
Alexandre Seo
c50400e186 Fix bug in string handling in toContain and return undefined in all matchers (#7692)
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: John-David Dalton <john.david.dalton@gmail.com>
2024-01-18 14:14:16 -08:00
guest271314
ff965af067 Update comment to include "except a built-in" (#8251)
build.module() throws for "buffer"

 9 |   setup(build) {
10 |     build.module(
         ^
error: module() cannot be used to override builtin module "buffer"
2024-01-18 03:29:10 -08:00
Jarred Sumner
48d642e9e0 Add a note about timeouts and max payload size 2024-01-18 03:14:03 -08:00
Jarred Sumner
e197b7c3a0 Fix crash in socket (#8241)
* Fix crash in socket

* Fix Socket timeout issue

* Add test for socket timeout

* Update socket.test.ts

* Fix linux tests

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-18 02:19:58 -08:00
Jarred Sumner
95e466628b Add a note about reading directories 2024-01-17 22:16:34 -08:00
dave caruso
41dda11802 fix: upgrade_command compilation error 2024-01-17 22:08:02 -08:00
dave caruso
8ba332b43a fix(windows): Implement bun.sys.renameat on Windows and fix crash during bun upgrade (#8242)
* fix #7989

* doc

* oops
2024-01-17 22:01:53 -08:00
Michael H
52894121ea bun run: "package.json scripts" at bottom (#8224)
* `bun run`: put "package.json" scripts at bottom & better errors

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-17 18:18:40 -08:00
Jarred Sumner
a5e83189df Stub more of perf_hooks (#8239)
* Stub more of perf_hooks

* Update perf_hooks.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-17 17:41:47 -08:00
dave caruso
405e2d1517 windows: implement os.hostname (#8223)
* windows: implement os.hostname

* oops

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-17 17:33:02 -08:00
Meghan Denny
483b73c4bf absorb bun.fdcast into FileDescriptor and remove (#8240) 2024-01-17 17:32:03 -08:00
Cena Kopahi
cb97baed22 Update docs for @types/bun (#8160)
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2024-01-16 23:26:50 -07:00
Jarred Sumner
01df0e6ef0 Fix prettier 2024-01-16 20:20:30 -08:00
dave caruso
08aa40c570 fix windows CI (use -MD again) (#8220)
* chore: upgrade webkit again

* fix submodules
2024-01-16 19:26:32 -08:00
dave caruso
82fcb38005 fix(windows): support utf16-le files in the bundler and in Bun.file (#8219)
* support utf16-le files

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-16 17:15:16 -08:00
Jarred Sumner
fc80683256 In fs.ReadStream, use $isObject to check options (#8218)
* In fs.ReadStream, use `$isObject` to check if function or object rather than typeof options === "object"

* Update fs.js

* Add test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-16 16:41:24 -08:00
Jarred Sumner
54be1d7705 Fix decimal -> integer conversion bug in process.exit & process.exitCode (#8216)
* Fix process.exit to allow numbers which were previously decimals

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-16 16:19:33 -08:00
Emre Cakiroglu
7eed9d893e fix: handle encoding deconstruction in node:fs (#8212) 2024-01-16 15:56:02 -08:00
Yusup Hambali
e77f9036e0 Fix title in dataview-to-string guide (#8209) 2024-01-16 15:27:38 -08:00
Lukas Kastern
5a6ef045aa fix: Hang when recursively logging via ConsoleObject.messageWithTypeAndLevel (#8213)
* Avoid deadlock in messageWithTypeAndLevel by adding a recursion counter

* Add test for recursive logs

* Do not rely on output of console-recursive.test.js

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-16 15:26:23 -08:00
Aarav Juneja
9350f6bc0b fix: match node's path.parse on dotfiles. (#8142)
* Fix #8090

* Fix bug from modification order.
2024-01-16 14:12:18 -08:00
dave caruso
4ccf6fb284 chore: fix building mimalloc debug with valgrind support (#8199)
* fix valgrind mimalloc

* thens
2024-01-16 00:06:10 -08:00
Jarred Sumner
83f2432da6 Update prettier (#8198)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-15 23:47:13 -08:00
Jarred Sumner
f673a84c75 Update nodejs-apis.md 2024-01-15 23:46:12 -08:00
Jarred Sumner
51680dbfdc Update nodejs-apis.md 2024-01-15 23:45:10 -08:00
Jarred Sumner
1aa36e27cb Update nodejs-apis.md 2024-01-15 23:44:09 -08:00
Jarred Sumner
e6285a1cc8 Update nodejs-apis.md 2024-01-15 23:43:52 -08:00
Meghan Denny
a064ae71ad make node:fs/promises.open return a FileHandle and expose fdatasync (#8141)
* make node:fs/promises.open return a FileHandle and expose fdatasync

* node_fs: add fn spacing

* fix this assert usage too

* move primordial preservation higher

* use expect().toBe() instead of assert

* ensure top level node:fs/promises functions always receive fd's as a number

* add needed fixture

* [autofix.ci] apply automated fixes

* this was the wrong fix for a different thing
will look into it later

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-15 23:20:20 -08:00
dave caruso
f9e78c419f feat: Implement using keyword (explicit resource management) (#8151)
* port 'initial support for using declarations'

1:1 port of this commit:

56a3e01244

* port 'initial support for await using declarations'

1:1 port of this commit:
1634a0b5ad

* fix cmake config for local jsc

* add global defines for symbols

* begin porting lowering implementation

based off of
https://github.com/evanw/esbuild/pull/3192

* [autofix.ci] apply automated fixes

* add some fun webkit scripts

* fix the minification bug

* refactor runtime_js, etc

* rename test file

* finished yapping

* silly silyl

* Update src/bundler.zig

* ok

* a

* Fix crash

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-15 23:14:41 -08:00
Jarred Sumner
0fb864e0ca Bump WebKit 2024-01-15 20:28:05 -08:00
Jarred Sumner
a4da0acb0e Document additions to import.meta 2024-01-15 19:53:49 -08:00
Jarred Sumner
f47def8515 Update run_command.zig 2024-01-15 19:50:05 -08:00
Jarred Sumner
14398ae27e Upgrade to Node.js v21.6.0 2024-01-15 19:50:05 -08:00
Jarred Sumner
64d351b102 Upgrade to SQLite v3.45.0 (#8196)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-15 19:45:14 -08:00
Meghan Denny
6b577a3970 implement events.on (#8190)
* exit event loop if there's unhandled errors

* move FixedQueue to a special package

* require(events) is also EventEmitter

* implement events.on

* move fixed_queue to internal and make it lazy in node:events

* use better Promise intrinsics

* move $shared to internal/shared

* make test not dependent on cwd
2024-01-15 18:54:37 -08:00
Lukas Kastern
a159850cce fix: Bun.serve logging error when fetch returns rejected promise (#8169)
* Handle rejected promise returned from onResponse

* Add test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-15 18:26:08 -08:00
Jarred Sumner
87eedc29d5 Move the standalone executable page 2024-01-15 18:13:28 -08:00
Lukas Kastern
124392ee98 fix: Report error and close event when creating WebSocket fails (#8186)
* Defer websocket error/close when websocket client is null

* Rename test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-15 18:08:34 -08:00
Jarred Sumner
e5421c56b1 feat: Support import db from './my.db' with {type: "sqlite"} (#8178)
* Support SQLite imports

* Docs

* Update executables.md

* Update loaders.md

* Update js_parser.zig

* Update loaders.md

* Update CMakeLists.txt

* Update Module.ts

* JSC got rid of `$trunc`?

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-15 17:56:02 -08:00
Lukas Kastern
407f42718c Only integrate loop us_loop once (#8187) 2024-01-15 17:37:21 -08:00
Jarred Sumner
a36355cefb Some Windows tweaks (#8118)
* Some windows tweaks

* Make this pub

* Update bundle_v2.zig

* Fix woopsie

* Make this error better

* Add assertion for using allocator for HTTP client from another thread.

* Do fewer copies in readdir()

* Fix crash/failing tests

* Update tests

* Fix windows build

* Update loop.c

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-15 17:33:33 -08:00
Ashcon Partovi
2d21567271 Update debugger things (#8180)
* T

* Update Debug Adapter Protocol

* Update JSC and V8 debugger protocols

* Update inspector-frontend

* Fix empty keys not being printed in `console.log`

* Add `bun --inspect` tests and fix edge cases

* bun install --exact
2024-01-15 17:00:29 -08:00
Jarred Sumner
611b296a6a Fixes #8170 2024-01-14 21:01:51 -08:00
Jarred Sumner
317998fdd6 Make toBunString increment the reference count (#8146)
* Make `toBunString` increment the reference count

* Fix WASI

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-14 05:36:31 -08:00
Jarred Sumner
ab40b0e054 Fix file descriptor leak in ipc (#8165)
* Fix file descriptor leak in ipc

* Do not assume sequential file descriptors

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-14 02:57:44 -08:00
Jarred Sumner
2c3dc5176b Upgrade uWebSockets & usockets (#8164)
* Upgrade uWebSockets & usockets

* Update HttpRouter.h

* Defensively prevent sending to blocking sockets

* Add test for receiving large amounts of data

* Large data optimization

* Update loop.c

* Avoid extra system call before entering event loop

* Update internal.h

* 1 less pointer lookup

* Fix error

* Update socket-huge-fixture.js

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-14 02:04:30 -08:00
dave caruso
5fc4538477 windows: support bun:ffi (#8114)
* compile tcc

* initial linking

* ffi and stuff

* swag

* wala

* Update settings.json

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-13 19:14:29 -08:00
Meghan Denny
be0896e204 remove while loops where a for would be more efficient (#8131)
* remove while loops where a for would be more efficient

* this needs to be a stack copy

* this can use the better loop

* this was translated wrong

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-13 19:13:54 -08:00
Jarred Sumner
56f1e5a362 Hide some noisy stack frames (#8148)
* Hide some noisy stack frames

* Update javascript.zig

* Add `asyncModuleEvaluation` to the list

* Sort

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-13 19:11:01 -08:00
Jarred Sumner
702da52312 Fix rawMode regression (#8163)
* Fix rawMode regression

* arg0

* Update ProcessBindingTTYWrap.cpp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-13 19:10:33 -08:00
Jarred Sumner
2a8956a268 Use one isosubspace for all generated constructors (#8162)
* Use one Isosubspace for constructors

* Update generate-classes.ts

* Update generate-classes.ts

* Update generate-classes.ts

* Update generate-classes.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-13 18:50:09 -08:00
Jarred Sumner
86b1aa02b3 Update CMakeLists.txt 2024-01-13 00:57:45 -08:00
Meghan Denny
065eae5a95 tidy: use std.mem.zeroes instead of loop or memset (#8138)
* use std.mem.zeroes instead of loop or memset

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

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-12 23:56:51 -08:00
Meghan Denny
9fa13aec09 fix signalNumberToNameMap assignment for SIGINFO (#8132) 2024-01-12 23:53:35 -08:00
Jarred Sumner
3e703c4c76 For build scripts, symlink zig.exe to zig on posix (#8147)
* Add `zig.exe` as a symlink of `zig` on posix

* Update scripts/download-zig.sh

Co-authored-by: dave caruso <me@paperdave.net>

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
2024-01-12 23:52:07 -08:00
Jarred Sumner
01453be2d1 Move function from a header to a .cpp file 2024-01-12 23:48:14 -08:00
Jarred Sumner
9b32516bcb Implement tty_wrap in process.binding (#8130)
* Implement `tty_wrap` in process.binding

Fixes #4694

* [autofix.ci] apply automated fixes

* Rename some things

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-12 23:31:18 -08:00
Jarred Sumner
7e787d2a5a Move console methods from exports.zig to ConsoleObject.zig (#8145)
* ZigConsoleClient -> ConsoleObject

* Rename more

* Rename more

* ZigConsoleClientFormatter -> ConsoleObject

* More renaming

* Wire up console.profile?

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-12 23:15:36 -08:00
dave caruso
b7a32b87ab fix(bundler): improve external require transpilation on all targets (#8057)
* fix(build): do not emit import.meta.require for browsers/node.js

* update test snapshots

* sweep

* prefer require ref instead of `import.meta.require`

* remove option i did not use

* stuff

* remove rewrite_require_resolve

* ok

* ok

* wooooo

* [autofix.ci] apply automated fixes

* fix bugs

* ok

* [autofix.ci] apply automated fixes

* OOOOOPPPPPPPPPPPPS

* fix Bun.Transpiler regressions

* fix(bundler): make --splitting ensure --outdir

* fix final

* oops

* [autofix.ci] apply automated fixes

* use require.resolve

* revert but ... it no longer crashes there

* ok

* [autofix.ci] apply automated fixes

* fix fetch test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-01-12 22:15:51 -08:00
Meghan Denny
0491ff4186 tidy: remove some redundant bun.toFD calls (#8136)
* remove some redundant bun.toFD calls

* windows fix
2024-01-12 19:46:56 -08:00
Meghan Denny
943c72c8a1 allow StringOrTinyString to hold 31 bytes (#8134) 2024-01-12 19:43:50 -08:00
Meghan Denny
cb6f4b9f4d tidy: remove if(false) dead block (#8129)
* remove if(false) dead block

* remove if (true) {...}

---------

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-01-12 18:18:19 -08:00
Meghan Denny
45bd2264e3 more small undefined fixes (#8133) 2024-01-12 18:17:53 -08:00
Meghan Denny
8733748eb6 remove bun.assertDefined, comparing against undefined is UB (#8137) 2024-01-12 18:16:04 -08:00
Kaio Duarte
66fa317390 fix(node:url): handle url with missing host on url.parse (#8126)
* fix(node:url): handle url with missing host on `url.parse`

* lazy load punycode module

* use URL class

* add comment and also extra sanity check tests

* extra test

---------

Co-authored-by: dave caruso <me@paperdave.net>
2024-01-12 18:11:10 -08:00
Dylan Conway
ef0e96a2b2 fix(install): add warning and skip patched packages (#8143)
* add warning and skip patched packages

* also overrides

* comment
2024-01-12 18:03:30 -08:00
Meghan Denny
b0d326dfb9 zig_backend stage1 doesnt exist anymore (#8140) 2024-01-12 17:44:03 -08:00
Meghan Denny
517d5ecde9 remove more big endian handling (#8139) 2024-01-12 17:43:30 -08:00
dave caruso
072f2f15ea ci: run windows tests and also run them concurrently (#7758) 2024-01-12 17:02:20 -08:00
Georgijs
0cd7fa1a63 fix(webkit:performance): correctly track size of measures map (#8128)
Co-authored-by: Georgijs Vilums <georgijs@bun.sh>
2024-01-12 14:58:05 -08:00
Ashcon Partovi
2fe0f90d36 Fix loose comparisons and incorrect tag length in semver (#8108) 2024-01-12 15:31:58 -07:00
Jarred Sumner
0783b4bf0e Implement import.meta.{dirname, filename} for Node.js compatibility (#8127)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-12 14:26:50 -08:00
Kaio Duarte
4f96bc416b fix(bun-install): gracefully handle missing package removal (#8091)
* fix(bun-install): gracefully handle missing package removal

* update bun remove test
2024-01-12 14:08:58 -08:00
hugo-syn
f43ecd8aa2 chore: Fix multiple typos (#8121) 2024-01-12 14:07:40 -08:00
Ashcon Partovi
31db26b054 Fix error when null/undefined is passed to stdio in spawn/spawnSync (#8110)
* Fix error when null/undefined is passed to stdio in spawn/spawnSync

* Change conditional
2024-01-12 14:05:55 -08:00
Aayush
f5675284c7 fix(docs): prisma not installed as dev dependency (#8119) 2024-01-12 03:23:47 -08:00
Dylan Conway
98d253d9bb fix(install): incremental support for windows (#7991)
* update for windows

* use correct sizes

* mode

* fchmod and correct error checking

* some progress

* walker_skippable.zig for windows

* no segfault

* comptime only

* normalize

* create files in .bin

* bun.sys.write

* string formatters in bun.fmt, diriterator enum

* isAllASCII comptime

* update more

* some cleanup

* fix 1

* fix 2

* simlink

* cast

* remove normalize

* to zig err

* update fchmod

* fixup

* fix running bin files

* --bun for running binaries

* --bun for scripts

* remove binary linking

* update

* remove todo

* todos

* fix

* simlink

* cast

* more cast
2024-01-11 22:00:47 -08:00
Meghan Denny
9846383b01 all: make bun.FileDescriptor a unique type (#8022)
* all: make bun.FileDescriptor a unique type

# Conflicts:
#	src/bun.js/api/bun/socket.zig
#	src/bun.js/api/bun/spawn.zig
#	src/deps/uws.zig

* need this change too

* convert another bun.FD.asDir call

* more fixes + linux

* fix this size

* accidentally flipped these fd numbers

* more fixes + windows

# Conflicts:
#	src/deps/uws.zig

* dont include type name in serialization

* add another TODO

* resolve review comments

* address more pr comments

* build fixes post-rebase

* another rebase fix

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-11 19:59:48 -08:00
Dylan Conway
fbe4ed206a More bun install hoisting tests (#8112)
* hoisting tests

* more comments on hoistDependency

* fix test
2024-01-11 16:57:24 -08:00
Erik
15263664b6 fix: #7932 (#8038)
* updating package with child peerDependency doesn't keep old version

* [autofix.ci] apply automated fixes

* fixed TODO test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-11 16:38:39 -08:00
Ciro Spaciari
4611b84352 incremental(windows) add TransmitFile and some fixes for fetch, h2 and http (#8089)
* fix win header decoding zig issue

* fix libuv file read lifecycle

* upload working without sendfile (yet)

* undo

* oops uncoment expect

* add TransmitFile aka sendfile on windows

* cleanup

* [autofix.ci] apply automated fixes

---------

Co-authored-by: cirospaciari <ciro.spaciai@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-11 16:38:13 -08:00
hugo-syn
922ff08a80 chore: Fix multiple typos (#8105) 2024-01-11 16:37:36 -08:00
Jarred Sumner
4c933f733b Fixes #7001 (#7861)
* Fixes #7001

* One more test

* Use `disturbed`

* [autofix.ci] apply automated fixes

* Fix failing test

* Test is no longer todo!

* Make bodyUsed work too

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-11 16:25:26 -08:00
Ciro Spaciari
f1c3e87a06 incremental(windows) setTimeout, setInterval and setImmediate should work (#8101)
* fix compilation and types for FD option using usockets

* comment

* clarify HOST_MAME_MAX on windows

* use libuv for timers on windows

* [autofix.ci] apply automated fixes

* fix linux build

---------

Co-authored-by: cirospaciari <ciro.spaciai@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-11 15:09:40 -08:00
Jarred Sumner
0bfe3760f6 Remove musl libraries from trusted dependencies because bun doesn't support musl yet 2024-01-10 21:13:20 -08:00
Ashcon Partovi
68bc548dce Fix 'Not a string or buffer' from zlibBufferSync (#8085)
* Fix 'Not a string or buffer' from zlibBufferSync

* Use `Buffer2`
2024-01-10 15:13:53 -08:00
Dylan Conway
7d4cef53a8 construct package paths without getFdPath for lifecycle scripts (#8056)
* use abs paths instead of getFdPath for lifecycle scripts

* fix aliased packages

* oops

* logs

* remove assert
2024-01-09 23:30:41 -08:00
Jarred Sumner
b400b36ca5 Bump! 2024-01-09 15:40:28 -08:00
Hanaasagi
36d4f09d28 fix(socket): fix 0.0.0.0 binding address (#7366)
* fix(socket): fix `0.0.0.0` binding address
Close: #7355

* test

* test

---------

Co-authored-by: dave caruso <me@paperdave.net>
2024-01-09 13:48:56 -08:00
Jarred Sumner
e77e1c1a58 perf: 5% - 10% faster new Headers(object) & new URLSearchParams(object) (#8028)
* 5%-10% faster `new Headers(object)`

* Add another test

* Remove extra parentheses

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-09 13:45:45 -08:00
Aarvin R
6e1ef49ad4 fix #8067 plugin fileapis (#8068)
- use Bun.file() instead of readFileSync
2024-01-09 13:00:31 -08:00
Jarred Sumner
2daade39a9 Don't close the file descriptor since close_range will get it anyway 2024-01-09 03:33:58 -08:00
Jarred Sumner
ae78441b25 Fixes #8010 (#8064)
* Don't use posix_spawn on Linux

* Make it work

* Avoid closing inherited file descriptors

* Hopefully fix test failures

* Reset close-on-exec flag

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-09 03:11:31 -08:00
Kainoa Kanter
fb8b47b2db chore: sort default-trusted-dependencies.txt (#7837)
* chore: sort default-trusted-dependencies.txt

* remove old trusted deps
2024-01-08 20:36:39 -08:00
Markus Ekholm
9a0dadad24 feat: implemented assert.doesNotMatch (#8008)
* implemented assert.doesNotMatch

* fixed assert.match and assert.doesNotMatch tests and ensure it throws when actual is not a string

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-08 17:31:54 -08:00
Archaeopteryx
f27fc77b3b docs: add missing comma in examples (#8018) 2024-01-08 16:21:44 -08:00
Lino Le Van
88fcfa4461 chore: fix typos in js_parser.zig (#7804)
* chore: fix typos in js_parser.zig

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Lino Le Van <linolevan@Linos-MacBook-Air.local>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-08 15:22:30 -08:00
John-David Dalton
9d56ea4880 Add icu4c to macOS install dependencies section (#8050) 2024-01-08 14:48:16 -08:00
karmabadger
b488734c50 docs: Update dev env instructions for Fedora (#8014)
* Update contributing.md

Added documentation for the installation of the perl Math::BigInt module

* Update contributing.md

merged the fedora perl math bigint module with the other dependencies
2024-01-08 14:42:06 -08:00
Jarred Sumner
8f975ec8ec Faster Buffer.concat, fixes #8034 (#8039)
* Faster, safer `Buffer.concat`

* Use wrappers when creating `Buffer` in C++

* Bun.concatArrayBuffers small optimization

* Add comment

* Add tests

* Ignore empty buffers

* Add assertion

* Update buffer-concat.mjs

* Update buffer-concat.mjs

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-08 14:37:18 -08:00
Pramit Sharma
1aee55524a Update hash-a-password.md (#8048)
Fixed a possible typo and improved grammar and conciseness throughout
2024-01-08 12:59:15 -07:00
Jake Gordon
8805e6150a Remove rogue word in doc (#8047) 2024-01-08 12:42:01 -07:00
huseeiin
237b5eded6 Update to-json.md (#8046)
better title
2024-01-08 11:56:30 -07:00
Jarred Sumner
437faa9444 Tweaks to lifecycle script enqueue (#8037)
* Tweaks to lifecycle script enqueue

* Use helper

* Use `bun.openDir`

* Fixup

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-07 21:05:11 -08:00
Jarred Sumner
e65bab75bc Fixes #8010 (#8025)
* Fixes #8010

* Update install.zig

* Copy the metahash when cleaning the lockfile

* Save more, but error less

* Change copy when there are no more dependencies

* Tweak some tests

* Update bun-add.test.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-07 06:16:31 -08:00
Jarred Sumner
d985e4db65 Use SQLiteError in a test 2024-01-07 03:11:40 -08:00
Jarred Sumner
9a267db105 [bun:sqlite] Ban new SQLiteError() 2024-01-07 01:42:27 -08:00
Jarred Sumner
06c530ba2e Fix crash when exiting bun test (#8026)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-07 00:02:08 -08:00
Jarred Sumner
a1e742734a Fixes #5178 (#8023)
* Fixes #5178

* Update comment

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-06 18:47:13 -08:00
Jarred Sumner
0dc6108bd3 Make PerformanceEntry use 40% less memory (#8016)
* Make PerformanceEntry use 40% less memory

* slightly faster create array of elements

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-06 16:05:03 -08:00
Georgijs
ecdde88670 implement PerformanceObserver and friends (#8011)
* implement PerformanceObserver, PerformanceMeasure, PerformanceMark and friends

* add PerformanceObserver test, clean up other performance tests

* [autofix.ci] apply automated fixes

* Small cleanup

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-05 22:39:29 -08:00
Lucas Coratger
2fd85ef0e6 fix: params in help menu for commands update and install (#7998)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-05 22:27:16 -08:00
guest271314
a774f92757 Fix using two const result=... in same script (#8013)
const result = await ... 
for (const result of result.outputs) {... 

throws

const result = await Bun.build({
                         ^
ReferenceError: Cannot access uninitialized variable.
2024-01-05 22:26:33 -08:00
hborchardt
eb84ebf974 Fix multiple partial consume from BufferList (#8007)
* Add test for multiple partial consume from BufferList

This shows the problem indicated in #7385

* Fix multiple partial consume from BufferList

The JSUint8Array::possiblySharedBuffer() returns the backing array,
not taking into account the byteOffset that indicates the start of
the data in the backing array. This means that when creating an array
with the same backing array, the current byteOffset needs to be added
to the start of the new slice.

This led to consume() returning the same data when repeatedly consuming
small numbers of bytes from the BufferList.
2024-01-05 22:25:01 -08:00
Lucas Coratger
bfe8afd674 feat: add toContainAnyKeys (#7946)
* feat: add toContainAnyKeys

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-05 21:21:12 -08:00
dave caruso
e8179adcbb chore: clarify my comments (#8006) 2024-01-05 21:19:57 -08:00
karmabadger
515ce30a85 docs: Update contributing.md (#8012)
Adding ruby to dependencies installation for macOS and Fedora
2024-01-05 21:17:19 -08:00
Ciarán
97f8c92cf4 feat(build): adjust arch linux auto detect to include manjaro (#7912) 2024-01-05 17:26:10 -08:00
sitiom
d4d6ef9e89 docs: Add Scoop installation reference for Windows (#7882)
* Add Scoop installation for Windows

* Update installation.md

* update powershell/cmd

irm is used because on certain installs of Windows 10 iwr does not work because of something related to Internet Explorer. haha~

---------

Co-authored-by: dave caruso <me@paperdave.net>
2024-01-05 10:26:40 -08:00
Meghan Denny
fa7e4bce27 node:child_process: support defining extra pipes (#7958)
* node:child_process: support defining extra pipes

* unneeded

* lazily load node:fs

* use $isJSArray instead of ArrayIsArray

* remove std.log call

* don't close child fd we don't own

* close child fd's in parent

* add Subprocess.stdio getter that aligns with ChildProcess.stdio fd's

* [autofix.ci] apply automated fixes

* use ArrayList instead of BoundedArray for stdio_pipes

* fix stream primordials

* dont use unreachable for syscalls

* this file was testing Bun.spawn not child_process.spawn

* skip ipc for now

* ensure the socketpair is created non-blocking on non-mac posix

* allow creating a node:net.Socket from an fd via node:net.connect

* node:stream tidy

* node:child_process: use net.Socket for stdio instead of fs streams

* try again

* fix Socket eager loading

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-05 00:38:08 -08:00
Meghan Denny
89ec2fcb35 fix replacing node:module._resolveFilename not passing the parent module (#7993)
* fix replacing node:module._resolveFilename

* add a test
2024-01-05 00:36:07 -08:00
Meghan Denny
39ab26a663 node:readline: move up when decoder is instantiated (#7994) 2024-01-05 00:26:22 -08:00
Ciarán
e103b53c86 docs(test/writing.md): Add documentation for test.each (#7983) 2024-01-04 17:10:08 -08:00
Moris Kramer
ee85bbc0a3 Update simple.md (#7987)
* Update simple.md

* Update docs/guides/http/simple.md

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-04 16:59:01 -08:00
Jarred Sumner
0103dd56ab Update guide 2024-01-04 16:53:22 -08:00
Lucas Coratger
5d6c68122c feat: add toContainKeys (#7945)
* feat: add toContainKeys

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-04 15:16:07 -08:00
Jarred Sumner
47acee5d87 Fix webpack test, fix errors in Worker (#7980)
* Update subprocess.zig

* Fix logging errors in Worker

* Update webpack.test.ts

* Update webpack.test.ts

* 😪

* Fix `self` setter

* Set IsImmutablePrototypeExoticObject and make globalThis.self = work

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-04 02:57:43 -08:00
asomethings
54d762531a fix: properly transform http method to uppercase (#7982)
* fix: http method uppercase transformation using wrong length

* feat: add test case for method uppercase
2024-01-04 02:54:59 -08:00
Jarred Sumner
e5bd7fcb8f Add brotli test (#7976)
* Add brotli test

* Check if we can use brotli

* vendor brotli

* Update .gitattributes

* Brotli is now always available

* Update licensing.md

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-03 21:57:19 -08:00
Meghan Denny
f30689256d tidy: use Arguments.slice() (#7978)
* use Arguments.slice()

* slice should be *const

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-03 16:59:44 -08:00
Meghan Denny
50c1f37230 make the tracy callstack depth configurable (#7979) 2024-01-03 16:33:34 -08:00
Meghan Denny
80ebcbf3d8 no big endian (#7974) 2024-01-03 14:52:50 -08:00
Meghan Denny
6345add18a dont use custom DeclEnum impl (#7975) 2024-01-03 14:52:29 -08:00
Otger Rogla
2946bacbbd feat(worker_threads) support argv and execArgv options (#7962)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-03 14:23:39 -08:00
Otger Rogla
7fa2cf3f61 fix(console.table): fixes for character width breaking the layout (#7966) 2024-01-03 14:22:30 -08:00
Meghan Denny
aa388e6762 vscode: set zig path to local one (#7973) 2024-01-03 14:19:31 -08:00
Jarred Sumner
5a2ad792a0 Try larger runners (#7972)
* Try larger runners

* Update bun-mac-aarch64.yml

* Update bun-mac-aarch64.yml

* Update bun-mac-aarch64.yml

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-03 14:18:39 -08:00
Jarred Sumner
69c85dbe17 Hardcode bun version 2024-01-03 14:10:15 -08:00
Jarred Sumner
71d9199270 Try to make fs.watch tests less flaky (#7909)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-03 13:05:10 -03:00
Jarred Sumner
6b3e1af25d Fix linter warnings in bun:sqlite (#7960)
* [bun:sqlite] Don't call memcpy on a 0 length value or nullptr

* [bun:sqlite] Add missing flags argument

* Make this a reference I guess

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-02 23:27:53 -08:00
Lucas Coratger
9f8ee7c8f7 feat: add toBeEmptyObject (#7772)
* feat: add toBeEmptyObject

* fix: feedbacks

* fix: feedbacks

* fix: feedbacks

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-01-02 17:11:57 -08:00
Meghan Denny
233622d6bb node:child_process: remove require destructure (#7949) 2024-01-02 17:03:50 -08:00
Jarred Sumner
837cbd60d5 Fix crash in WebSocket client when handshaking fails or when the HTTP response is invalid (#7933)
* Fix double-free in websocket client

* Update test

* Fix null pointer dereference

* Fix missing protect() / unprotect() call

* More careful checks

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-01 18:08:08 -08:00
Jarred Sumner
9d6c0649a4 Fix potential uninitialized memory access when loading CommonJS modules 2024-01-01 17:37:07 -08:00
Jarred Sumner
693a00dc5b Make file uploads use less memory on Linux (#7938)
* Add Linux memfd file upload memory optimization

* various build fixes

* cleanup

* Update blob.zig

* Update base.zig

* Add COW test

* Update blob.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-01 00:07:26 -08:00
Lucas Coratger
1f9ce68348 feat: add toContainKey (#7773)
* feat: add toContainKey

* feat: add hasOwnProperty to bindings

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-31 15:29:53 -08:00
Jarred Sumner
492b2d5b76 Implement Brotli support in fetch() (#7839)
* Implement Brotli support in fetch()

* Use @panic

* Update src/http.zig

Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>

* Update src/http.zig

Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>

* Fix redirect logic

* Allow extremely long redirect URLs

* Update fetch.test.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2023-12-31 06:19:08 -08:00
Kaio Duarte
8eebfd8e22 fix: add ws properties to BunWebSocketMocked prototype (#7898)
* add ws properties to BunWebSocketMocked prototype

* add tests for Server class

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-31 02:42:58 -08:00
Jarred Sumner
1d684e0d4f Tweak formatting of console.table (#7927)
* Tweak alignment of console.table

* " " empty string instead of "#"

* Fix assertion failure

* Only get the length when necessary

* Avoid stale copies

* Add `asUTF8` helper to `bun.String`

* Cautiously handle recursion

* Further tweaks to output

* output

* Add native implementation of `getStringWidth`

* [autofix.ci] apply automated fixes

* If its not a string then quote it by default

* Add snapshot for headers

* Make it easier to debug when a builtin throws an exception

* This must be hoisted

* Fix bugs in `getStringWidth`

* Update getStringWidth.test.ts

* Eager load it

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-31 02:38:52 -08:00
Jarred Sumner
14c60eca94 Fix crash that can occur due to invalid UTF-8 (#7926)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-30 17:52:52 -08:00
Jarred Sumner
6eab178790 Add OpenSSL v1.1.0 to process.versions.openssl (#7924)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-29 21:36:41 -08:00
Ciarán
32ca195f60 docs(test/writing.md): update matchers to indicate support for arrayContaining, closeTo, objectContaining (#7800) 2023-12-29 21:35:34 -08:00
Michael H
c381816c57 Clean Trusted Dependencies (#7857)
* clean

* add back node version ones
2023-12-29 20:46:56 -08:00
Jarred Sumner
ae8f2a3afb Windows Build Fixes (#7923)
* Windows Build Fixes

* windows

* Update event_loop.zig

* Update bindings.zig

* Update event_loop.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-29 20:39:23 -08:00
Ciro Spaciari
25441ede20 fix(bun.serve) avoid double ending chunk (#7897)
* avoid double ending chunk

* re-format

* Ensure we run tests on bun-uws changes

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-29 20:35:32 -08:00
Jarred Sumner
a0c8ee31a1 Bump version number 2023-12-29 18:38:18 -08:00
Jarred Sumner
135039b137 Better errors for bun:sqlite (#7906)
* Better errors for bun:sqlite

* Add `byteOffset`

* Add `code` property

* Fix error

* Update test

* Add a couple more tests for errors

* Add file with sqlite error codes

* Report extra memory from `sqlite3_stmt`

* Add polyfills for macOS x64

* Use -1 when unavailable

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-29 18:37:16 -08:00
Jarred Sumner
05f14c8d6a Add setMayBePrototype where it should be added (#7922)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-29 18:26:33 -08:00
Otger Rogla
15755a0246 feat: implement console.table (#7866)
* feat: implement console.table

* console.table minor changes

* fix console.log for arrays after console.table changes
2023-12-29 18:04:49 -08:00
Jeroen
b6cadf387b docs(bundler): update CLI command in index.md for bun build with publicPath (#7916)
* docs(bundler): update CLI command in index.md for bun build with publicPath

* Update docs/bundler/index.md

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-12-29 15:26:35 -08:00
Jarred Sumner
b011fd2567 Fixes https://x.com/jeroendotdot/status/1740651288239460384?s=46&t=0Uhw6mmGT650_9M2pXUsCw (#7910)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-29 15:26:06 -08:00
Lucas Coratger
5e72a27a76 feat: add toBeObject (#7770)
* feat: add toBeObject

* fix: feedbacks

* [autofix.ci] apply automated fixes

* feat: add more information on error message

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-29 12:37:02 -08:00
Meghan Denny
9ef7b304d9 misc: use compileError instead of unreachable for comptime-known switches (#7905) 2023-12-29 02:07:17 -08:00
Meghan Denny
38d5a5fe9a tidy: bun.zig: remove switch on literal (#7907) 2023-12-29 02:06:56 -08:00
Jarred Sumner
43b99021f8 Fix flaky timeout test 2023-12-29 01:29:40 -08:00
Jarred Sumner
8a34b8f6f8 Add flags for Valgrind build 2023-12-29 00:25:02 -08:00
Jarred Sumner
70f344101b Revert " feat(server): add server backlog parameter (#7822)" (#7908)
This reverts commit 411094b82d.
2023-12-28 23:44:27 -08:00
Jarred Sumner
a3a6b894c5 [bun:sqlite] Cache the structure and call the destructor (#7904)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-28 21:33:55 -08:00
Meghan Denny
a5bf1216d1 cli: resolve TODO filing upstream issue (#7903) 2023-12-28 20:11:51 -08:00
Jarred Sumner
ae5f1b0168 Fix crash with latin1 supplemental characters in bun:sqlite query (#7902)
* Fix crash with latin1 supplemental characters in bun:sqlite queries

* Make it run from any dir

* Fix comment

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-28 20:00:58 -08:00
Jarred Sumner
20690403da Fixes #7868 (#7884)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-28 17:53:11 -08:00
Jarred Sumner
903a202473 Support Blob in CryptoHasher (#7878)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-28 16:33:18 -08:00
Kaio Duarte
14bc121dc8 Compare error name and message on Bun.deepEquals and assert.deepStrictEqual (#7867)
* check error name and message on Bun.deepEquals

* add tests

* add test with subclass of Error
2023-12-28 16:32:49 -08:00
Oleg Sevruk
eac3bda895 Update bun-create.md (#7889)
Typo. Correct the 8th item in the hidden section “How to create buns”
2023-12-28 16:30:29 -08:00
Aarvin R
0a7bbcb9a6 finish docs for env quotes (#7895)
- added template literal backticks to sentence
- added example of quotes in .env files
2023-12-28 16:17:16 -08:00
Aarvin R
107015fd48 fix example syntax for plugins (#7894)
- updated docs/runtime/plugins.md to use plugin()
- update docs/runtime/plugins.md to use "loaded" instead of "registered" for clarity
2023-12-28 16:14:56 -08:00
Malthe Borch
813afe6c53 Add 'listening' boolean property to 'net:Server' (#7658)
* Add 'listening' boolean property to 'net:Server'

* Convert to getter

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-28 14:20:41 -03:00
Hanaasagi
411094b82d feat(server): add server backlog parameter (#7822)
* feat(server): add server backlog parameter

* add some tests

* Apply suggestions from code review

Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>

* fix test

* chore: fix style

---------

Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2023-12-28 14:19:20 -03:00
Jarred Sumner
1f90608d66 Fixes #7827 (#7858)
* Fixes #7827

* Add some assertions and errors

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-27 20:22:44 -08:00
Xiliang Chen
2b09347dc6 fix toMatchSnapshot signature (#7880) 2023-12-27 20:16:05 -08:00
Meghan Denny
f02ef8fb35 script/setup.sh: don't hardcode search for pkg-config (#7871) 2023-12-27 18:35:09 -08:00
Meghan Denny
da13884295 inspect: print 'call' property in objects (#7874)
functions have separate code path now
2023-12-27 18:34:52 -08:00
Meghan Denny
8a39c02e7a bun.js bindings: tidy with inline range (#7875) 2023-12-27 18:34:18 -08:00
Meghan Denny
bfc065c5cc bun.js bindings: remove redundant as-bitcast-as (#7876) 2023-12-27 18:33:56 -08:00
Meghan Denny
93c081f351 scripts/setup.sh: don't check for zig since it installs zig later (#7870)
* scripts/setup.sh: don't check for zig since it installs zig later

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-27 16:26:46 -07:00
Ciarán
4a66091491 Fixes #7740: Change "Duplicate dependency" to warn instead of error (#7766)
* fix(#7740): change 'Duplicate dependency' to be warning instead of error

* chore(07740.test.ts): clean up test

* [autofix.ci] apply automated fixes

* fix(src/logger.zig): increment warnings instead of errors in addRangeWarningFmtWithNotes()

* chore(07740.test.ts): simplify package.json to avoid increasing test times

* chore(bun-install.test.ts): update test to expect 'warn' instead of 'error'

* chore(07740.test.ts): fix formatting

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-27 00:53:02 -08:00
johnpyp
d1dcf5ccf7 doc: improve Bun.Glob api docs (#7859)
* doc: improve Bun.Glob api docs

* Update docs/api/glob.md

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

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-12-26 22:20:25 -08:00
Ciro Spaciari
f8159f1b36 fix(fetch) Fix fetch redirect (#7847)
* clean socket instance before closing on redirect

* fetch redirect test

* fix flask test

* oops
2023-12-26 17:37:41 -08:00
cirospaciari
1a370eb483 revert 2023-12-26 11:33:30 -03:00
cirospaciari
f12ff9d1e5 clean client ref from socket before close 2023-12-26 11:22:12 -03:00
Jarred Sumner
4d6219eda4 Revert "whitelist nuxt (#7840)"
This reverts commit a3630dde2e.

`nuxt` does not list any scripts in their package.json
2023-12-25 23:39:57 -08:00
Larry Williamson
a3630dde2e whitelist nuxt (#7840) 2023-12-25 23:27:56 -08:00
Ryan
c6ba32b850 Add purescript and spago to default-trusted-dependencies.txt (#7838)
These are two important packages for purescript development, purescript is the language (including a binary file that must be installed), and spago is the purescript package manager (also including a binary file that must be installed).
2023-12-25 22:58:32 -08:00
Omar
05984d405f Whitelist Railway CLI (#7832)
https://railway.app

Railway CLI is used to deploy Railway services. The CLI npm package requires running postinstall scripts.

9de89415f0/package.json (L17)
2023-12-25 20:32:16 -05:00
thunfisch987
696a5a28c9 Update docs/typescript.md (#7825) 2023-12-25 09:22:29 -07:00
Jarred Sumner
b399deebdd 15% faster crypto.randomUUID (#7824)
* Fixes #7811

* [autofix.ci] apply automated fixes

* Update src/bun.js/webcore.zig

Co-authored-by: Markus Staab <maggus.staab@googlemail.com>

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Markus Staab <maggus.staab@googlemail.com>
2023-12-25 01:25:35 -08:00
xxxhussein
39ea8cbfea Update installation.md (#7817)
npm states that their name should be written as "npm" in lowercase rather than "NPM" or "Npm" etc.
2023-12-24 19:52:38 -08:00
Jarred Sumner
09d51486e9 Enable forceConsistentCasingInFileNames in bun init 2023-12-24 06:18:25 -08:00
Jarred Sumner
ead3bdf947 Make the tsconfig.json used in bun init sloppier 2023-12-24 06:16:44 -08:00
Arnaud Barré
6077ace528 Update init template & TS documentation (#7813)
* Update init template & TS documentation

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-24 06:13:53 -08:00
Jarred Sumner
a119e8d636 fs.readFile & fs.writeFile encoding + simplify string handling + fix memory leak (#7797)
* Simplify string handling code

* add extra + external

* Update fs.test.ts

* Bump

* woopsie

* prettier

* Rename stats() to resourceUsage()

* Fix leak

* Fix more leaks

* Setup malloc heap breakdown

* Thread safety

* Fix bug when creating buffer from utf-16 string

cc @dylan-conway

* Use global allocator

* More new

* Update fs.test.ts

* Update setTimeout.test.js

* Fix UAF in HTMLRewriter

* More bun.new

* Remove logs

* Un-skip test which no longer is flaky

* Even more `bun.new`

* Fix memory leak in HTMLRewriter.

Fixes #2325

* Don't accept Buffer for now

* Fix issue with node-fetch polyfill

* Don't destruct the response value too soon

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-24 06:10:46 -08:00
vitalspace
72eb607e21 FIx "Inconsistent script not found error message" (#7799) 2023-12-23 01:37:58 -08:00
Ciro Spaciari
26325aca95 fix(setTimeout) fix high CPU usage (#7792)
* fix timers CPU usage

* add stats to subprocess

* fix issue number

* add ResourceUsage

* better names on ResourceUsage

* add wait4 for macOS

* better names 2

* add types

* change comments style

* BigInt
2023-12-22 16:59:00 -08:00
Risu
98242fa10d Add node:test to Node.js compatibility docs (#7779) 2023-12-22 09:21:35 -08:00
Dylan Conway
906f86d6fd always set name (#7783) 2023-12-21 23:46:32 -08:00
Omar
9fdd1068da whitelist lightningcss-cli (#7782)
lightningcss is a popular css library with over 0.5 million weekly downloads. It also offers a cli tool that requires postinstall script to run.

https://www.npmjs.com/package/lightningcss
https://www.npmjs.com/package/lightningcss-cli?activeTab=code
2023-12-21 23:42:57 -08:00
Jarred Sumner
7e59f287a1 Fix bug in bun upgrade --canary (#7777)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-21 20:18:02 -08:00
Jarred Sumner
56df6a9888 Bump! 2023-12-21 18:29:16 -08:00
Jarred Sumner
ada49eb96d Update setInterval-leak-fixture.js 2023-12-21 18:21:00 -08:00
Jarred Sumner
c5436c09ab Fix setInterval regression (#7776)
* Fix setInterval regression

* Add some comments

* Add another test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-21 18:00:24 -08:00
Jarred Sumner
a93f467a74 NAPI fixes (#7765)
* napi fixes

* Make bcrypt work

* Always return this

* Fixes #7685

* [autofix.ci] apply automated fixes

* Update napi.cpp

* Make it clearer what this is doing

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-21 15:55:58 -08:00
Ashcon Partovi
cd55401eba Fix flaky tests 2023-12-21 08:14:43 -08:00
SirHyperNova
0f8bcfdc53 Remove "not production ready" from WebSocket (#7760) 2023-12-20 23:31:48 -08:00
Jarred Sumner
2428da9354 Fix formatting error 2023-12-20 21:18:19 -08:00
Jarred Sumner
65e11c48b6 Fix hashing consistency issue (#7757)
* Fix color issue in `bun test`

* Fix hashing consistentcy issue

* Fix Windows build failure

* Update types.zig

* Fix build

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-20 20:57:20 -08:00
dave caruso
6b549ee592 fix: random improvements to bun.String (#7695)
* make bun.String.createUninitialized harder to mess up

* remove toJSConst

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

* ok

* aaaaaaaa

* fix ucs2 encoding oopsies

* a

* [autofix.ci] apply automated fixes

* fix baseline build

* hello

* remove commented code

* aaa

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-20 19:18:32 -08:00
Jarred Sumner
5b538fb076 Fix Windows build failure 2023-12-20 19:09:53 -08:00
Vlad Sirenko
7e511f55de 4415 es5 class http.Server (#7705) 2023-12-20 15:55:30 -08:00
Jarred Sumner
c271c6c38e perf: More efficient setTimeout and setInterval (#7715)
* Use timer heap for `setTimeout`

* Further efficiency improvement to timers

* Fix assertion

* Make this test less flaky?

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-20 15:13:23 -08:00
dave caruso
00955c712e fix: crash in bun init by renaming string function to be more consistant (#7746) 2023-12-20 13:44:53 -08:00
dave caruso
00e745ec2c fix(windows): use path normalizer in bun run index.ts (#7723)
* cleanup stuff

* hi

* fix building on posix

* a

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-12-20 13:42:09 -08:00
Alex Martin
6ee812d63d Handle holey arrays console log edge case (#7751)
", " was only being written when appropriate before "empty item", and not
"N x empty items".
2023-12-20 13:36:28 -08:00
Jarred Sumner
a623e7c702 Fixes #7736 (#7752)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-20 00:57:16 -08:00
Jarred Sumner
59a0e885d9 Make large stdio in Bun.spawnSync efficient on Linux (#7733)
* Use memfd in spawnSync when possible

* Make it work

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-19 20:25:31 -08:00
Dylan Conway
3f1c39ad0b fix(install): lifecycle script verbose logging and a couple bug fixes (#7726)
* trim trailing slash, always create temp node-gyp

* verbose lifecycle scripts

* move node_modules from other package managers to subdirectory

* fix merge

* remove for another branch

* Update bun-install-registry.test.ts

* Update bun-install-registry.test.ts

* inherit mac only

* Update src/install/lifecycle_script_runner.zig

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

* cache directory created when ensuring temp node-gyp

* fix merge

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-12-19 19:39:33 -08:00
dave caruso
39d062cf3c feat: print the longest postinstall if it took more than 500ms (#7719)
* print the longest postinstall if it took more than 500ms

* build error

* make newlines print right

* fix tests

* sdfafdsa

* i hope this is it
2023-12-19 17:51:39 -08:00
dave caruso
92901eb6e0 fix: change how exit codes and signals are printed (#7674)
* change how exit codes and signals are printed

* second iteration of this

* [autofix.ci] apply automated fixes

* dasfsa

* Fix Linux Build

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-12-19 16:55:15 -08:00
dave caruso
ab68aa5a8e dx(win): fix codegen.ps1 on 2023-12-19 13:29:31 -08:00
Supachai Kheawjuy
3f131c0411 docs(api): typo Diffie Hellman in http.md (#7744) 2023-12-19 11:17:11 -08:00
Supachai Kheawjuy
db60c92e25 docs(bundler): remove unused callout tag in index.md (#7742) 2023-12-19 10:20:14 -08:00
Bjön Limell
1730cfbbbf docs: fixed Bun.gunzip (#7738) 2023-12-19 09:14:47 -08:00
Supachai Kheawjuy
45a499912b docs(guides/process): change file extension from tsx to ts in stdin.md (#7737) 2023-12-19 08:44:34 -08:00
Jarred Sumner
61f92d9e5f fix(install): fix false positive "lockfile is frozen" when using bun install --production (#7713)
* More lkogs

Add more logs for `--verbose`

* Fixes #5792

This makes `--frozen-lockfile` use a hash of all the resolved package versions that were installed, instead of the more permissive logic used to decide whether or not to re-run the install

* Fix debug assertion failure in `bun install --production`

* Update src/install/install.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-19 00:56:21 -08:00
Spencer Smith
3baaa28f93 Update index.md (#7727) 2023-12-18 22:23:31 -08:00
Dylan Conway
b88324db31 chore: upgrade webkit (#7720)
* update

* alwaysInline

* update webkit commit

* update webkit tag

* remove webkit_url

* check for exception and update webkit commit

* update webkit tag
2023-12-18 20:54:04 -08:00
Dylan Conway
dc19541719 update bun.zig 2023-12-18 20:15:02 -08:00
Jarred Sumner
2d2f3c4e50 fix: Tweaks to syntax highlighter (#7711)
* [syntax highlighter] Highlight `from` and `as` in `import`. Don't bold function calls or identifiers

* Update bun.zig

* Update bun.zig

* Update src/bun.zig

Co-authored-by: dave caruso <me@paperdave.net>

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
2023-12-18 18:32:45 -08:00
dave caruso
f3ce571a29 fix: parsing error from "a<b>" as typescript (#7722) 2023-12-18 18:24:04 -08:00
dave caruso
1a2643520b fix(bundler): handle direct eval better (#7693)
* fix(bundler): handle  direct eval better

* error message
2023-12-18 14:41:04 -08:00
Colin McDonnell
31c17a1bb3 Better types (#7670)
* Rewrite bun-types to include @types/node

* Incorporate new commits

* Update bun.lockb

* [autofix.ci] apply automated fixes

* Update readme, add back webkit

* Updates

* BunJS -> Bun

* Switch init to @types/bun

* [autofix.ci] apply automated fixes

* Tweaks

* Revert docs changes

* Fix bugs

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-18 13:27:48 -08:00
Jarred Sumner
a1a4178c3f Fix next build integration test 2023-12-18 01:21:00 -08:00
Jarred Sumner
7ac5bdc9dd Fix flaky test 2023-12-18 01:11:36 -08:00
Jarred Sumner
506c165860 Fix napi tests 2023-12-18 00:03:45 -08:00
Jarred Sumner
6fc29b6412 Recommend the .start() method 2023-12-17 23:18:41 -08:00
Jarred Sumner
b6f60680f6 Remove protobuf.js from default trusted dependencies list
The postinstall script will never print anything, since it does not exit with a non-zero exit code.

Therefore, this warning will never have an impact

Therefore, it should not be allowed to increase how long it takes to install your packages

4436cc748c/scripts/postinstall.js
2023-12-17 00:10:49 -08:00
Jarred Sumner
1f71ad5661 Fixes #7694
Verified it now calls the function the correct number of times
2023-12-16 23:47:57 -08:00
dave caruso
cbb477cbe2 perf: make Bun.peek 90x faster on pending promises, 1.5x on resolved (#7697)
* perf: make peek() 90x faster on pending promises, 1.5x faster on resolved promises

* more bench

* test edits
2023-12-16 17:36:08 -08:00
dave caruso
369e3022e4 chore: upgrade zig to 0.12.0-dev.1828+225fe6ddb (#7671)
* chore: upgrade zig to 0.12.0-dev.1828+225fe6ddb

* open as iterable

* fix building identifier cache

* fix windows build

* fix linux build

* fix linux build
2023-12-16 00:14:15 -08:00
Ciro Spaciari
925a94ffe6 test(grpc-js) update certs for macOS (#7678)
* update certs

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-12-15 20:40:04 -08:00
Jarred Sumner
ca89087684 feat: Make using await inside a non-async function have a helpful error message (#7690)
* Update fs.test.ts

* Make using `await` inside a non-async function have a good error

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-15 18:04:40 -08:00
dave caruso
9e47ceac87 ci: attempt to fix linux-aarch64 ci (#7691)
* experiment with this

* rerun on changed
2023-12-15 17:45:10 -08:00
dave caruso
4098dd0df5 chore: fix the commit of WebKit
bump to "657558d4d4c9c33f41b9670e72d96a5a39fe546e" which has some
windows-specific fixes, as well as fixes linux-arm64 debug build,
and adds the debug windows build.
2023-12-15 16:41:45 -08:00
dave caruso
c3b1333ae8 ci: fix windows release action 2023-12-15 16:41:45 -08:00
Vincent Lechemin
f88e5d128c Fix file descriptor leak in readdir (#7688) 2023-12-15 16:39:40 -08:00
Jarred Sumner
4d7c66066b fix: Resolve specifiers passed to mock.module (#7673)
* Mention module mocks in docs

* [autofix.ci] apply automated fixes

* Fix relative file paths that do not exist

* add test for file: URL

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-15 14:41:56 -08:00
Scott Trinh
3872f7a5b7 Use EdgeQL for expression for bulk insert in seed.ts (#7686)
* Use EdgeQL `for` expression for bulk insert in seed.ts

Perhaps this was a JavaScript for loop before to make it a little easier to grok for non-EdgeDB users. However, hopefully this is easier enough to understand that people can still follow the example even if they do not know EdgeQL.

* Fix small typo in assignment
2023-12-15 14:13:02 -08:00
dave caruso
6443c26a4a fix node_env regression (#7666) 2023-12-15 16:51:26 -03:00
Jarred Sumner
c2cd7402a0 Upgrade from SQLite v3.38.5 to v3.44.2 (#7668)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-14 20:03:29 -08:00
Ashcon Partovi
fbcb622335 Implement expect().toContainEqual() (#6589)
* Support `expect().toBeValidDate()`

* Support `expect().toContainEqual()`

Also fixes a bug where `expect(new Set()).toContain()` would not work

* Update expect.zig

* docs

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-14 17:11:14 -08:00
Mathias Wulff
fc733fe89c Use stderr for info about how to open inspector (#7270)
* Use stderr for info about how to open inspector

* Write to stderr without red colors
2023-12-14 17:07:46 -08:00
dave caruso
441612917d windows: more windows stuff (#6938)
* fix(win/upgrade): do not show powershell expand-archive info while upgrading

* start working bun run

* experiment: `bun.new`

* you can now bun run

* Update src/install/install.zig

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

* Update src/install/install.zig

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

* stuff

* fix stuff

* fix this

* farther but not really

* sadfs

* path hell

not sure how much worse or better this makes things. its a mess. windows path handlign is a mess aaaaaaaaaaaaaaaa

* path.resolve bs

* remove old build system stuff from pr

* a

* fix some path.parse/join cases

* path closer not perfect

* normalize and join tests tests  done

* paths

* implement path.relative

* ,

* stuff

* assert

* fix compile

* hate

* the code isnt great

* stuff

* housekeeping for build system

* blah

* explain windows sitaution in docs

* some progress? not much though

* zig compiler crashes here

* fix

* yippee

* ok

* a

* ala wala

* fix builds on stuff

* clean

* the tests now run

* a

* aa

* dedupe uv event loop

* fix fs test accuracy

* stuff

* [autofix.ci] apply automated fixes

* huge updat e

* [autofix.ci] apply automated fixes

* url

* [autofix.ci] apply automated fixes

* start windows spawnSync

* [autofix.ci] apply automated fixes

* add --webkit for update submodules

* add better err message for `bun setup`

* fix unix platform build

* .

* [autofix.ci] apply automated fixes

* un-upgrade libarchive

* z

* asdfghj

* wrk

* todo -> panic

* ok

* a

* [autofix.ci] apply automated fixes

* fix build scripts l ol

* dfghj

* fa

* [autofix.ci] apply automated fixes

* aaaa

* a

* l

* [autofix.ci] apply automated fixes

* more logs

* [autofix.ci] apply automated fixes

* j

* fix init_command

* CORE DUMP HELL

* i swear im being pranked by the github actions gods

* fadsjkfdshjkhjkdfsahjkdfshjksdafjkhhjkfdsahfsdkjhfsdjkahf

* thanks IAS

* this is the correct fix

* personal review

* ddisablbe these

* revisions!

* ok

* fix submodule

* stuff

* fix libarchive

* [autofix.ci] apply automated fixes

* stuff

* [autofix.ci] apply automated fixes

* a

* fix addressToJS on windows

* make dns async again

* dx: add flag to update submodules ps1 to clone webkit

* dns error case for libuv

* dx improvements on windows

* newline

* obvious fix

* install steps

* extra note

* fix fs test

* Update building-windows.md

* fix builtins bundler to support \r\n line endnigs

* better

* some windows stuff

* a

* a

* a

* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

* [autofix.ci] apply automated fixes

* bunfile text works

* fix build on the mac

* hellooooooooooo

* install steps

* ci for baseline?

* fix

* aaa

* wow

* install script revamp

* bug

* OK

* ok

* aaaaaaaaaaaaaa

* okay

* fix the node test runner lol

* fix napi stuff

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cirospaciari <ciro.spaciai@gmail.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2023-12-14 16:56:33 -08:00
Osmose
adcad39e1d Update install.dryRun docs to be accurate. (#7275)
The previous line appeared to be copied from `install.optional`.
2023-12-14 15:44:13 -08:00
Jarred Sumner
453a270b2e linker ld scripts expect unmangled names 2023-12-14 14:25:18 -08:00
Jarred Sumner
fe5e19da59 Implement v8::Isolate::TryGetCurrent, v8::Isolate::GetCurrent, v8::Isolate::GetCurrentContext, stub node::AddEnvironmentCleanupHook & node:: RemoveEnvironmentCleanupHook (#7665)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-14 13:46:38 -08:00
Vlad Sirenko
19e80771ac http convert es5 class (#7485)
* http convert es5 class

* remove additional object with private fields

* add comment to http method
2023-12-14 03:03:30 -08:00
Dylan Conway
36c316a24a fix(install) make sure node-gyp is available during lifecycle scripts (#7622)
* bunx node-gyp

* add test

* create temp node-gyp when used in script

* windows reminder

* closer?

* Update bunx_command.zig

* append fake node to end of path

* Update install.zig

* correct temp node-gyp dir, always append parent `node_modules/.bin` dir

* make sure temp node-gyp doesnt run itself

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-13 23:19:37 -08:00
James Anderson
c0ccdccbeb fix(resolver): wildcard tsconfig path not including suffix (#7612)
* fix(resolver): wildcard tsconfig path not including suffix

* different approach
2023-12-13 23:19:20 -08:00
dave caruso
1fc9b56936 feat(test): rejects.toThrow and resolves.toThrow (#7652) 2023-12-13 23:18:17 -08:00
dave caruso
8ec405facc fix(build): add a missing / in a fallback path route (#7653) 2023-12-13 23:12:25 -08:00
dave caruso
beedb28e38 fix: stuff i forgot to push (#7651)
* i forgot

* a
2023-12-13 22:41:37 -08:00
BaboonKing
1aaf63efc4 fix(types): add "webcrypto" to "node:crypto" (#7580)
* fix(types):  add "webcrypto" to "node:crypto"

* chore(types): remove wrong version flag as jsdoc
2023-12-13 22:15:00 -08:00
Jarred Sumner
0bce2b46ca Fixes #7641 2023-12-13 22:04:05 -08:00
dave caruso
c8305df5c2 fix(runtime): make process.stdin work (fix vite create on linux) (#7650)
* a

* make fds cached

* fghjfdsaa

* dsfafsa

* 😭
2023-12-13 21:52:37 -08:00
dave caruso
9787ea91f2 fix(node): always use .RunCommand when binary is named node (#7615)
* make the cli act more like node when the binary is named node

* mmmmmmmmmmm review comments

* whatever

* fix test

* am stupid am stupid

* sure
2023-12-13 21:43:05 -08:00
Hanaasagi
a648ed9e6a chore: fix build (#7648) 2023-12-13 18:56:51 -08:00
chocolateboy
ab95e2189f Prevent shell-option changes leaking out of the bash-completion script (#7646)
- save and restore `globstar` rather than leaving it unset
  - don't change `extglob` as it's already defined and required by
    bash-completion
2023-12-13 17:32:53 -08:00
Andrew Shoener
dc0736d61d Clarify dead code elimination (#7639) 2023-12-13 17:31:50 -08:00
dave caruso
5029fc8564 fix: do not inline process.env during bun run and bun test (#7614)
* env stuff

* ok

* undo

* remove unused param

* resolve review comment

* dupe

* it compiles now i promise
2023-12-13 06:05:03 -08:00
Jarred Sumner
38c6575dc8 Fix incorrect pipe reading code for lifecycle scripts, add basic ioctl_ficlone support (#7628)
* Move code for lifecycle scripts into a separate file

* Fix slow & incorrect pipe reading code used for bun install lifecycle scripts

* Fix crash in IPC due to calling on_socket_long_timeout when its a null ptr

* Only try to get the node path one time

* Fix incorrect glob pattern for rebuilding Zig files

@paperdave doing `**/**/**` does not work

* Implement basic support for ioctl_ficlone

* lowercase these

* intcast

* This is backwards

* Fix "waiting for tasks" spam

* Update install.zig

* Add helper

* Update install.zig

* Address PR feedback

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-13 06:03:21 -08:00
Dylan Conway
efb2cb5871 get auto and prefer from install expr (#7624) 2023-12-13 03:11:03 -08:00
pacexy
9fc12a1244 Fix install.exact does not work (#7603)
* fix

* fix
2023-12-13 01:24:05 -08:00
Jarred Sumner
900eec71fa Bump 2023-12-12 17:35:36 -08:00
Jarred Sumner
4fec7f84c8 Run libc atexit callbacks 2023-12-12 17:34:19 -08:00
Dylan Conway
5787350243 add sharp 2023-12-12 13:38:43 -08:00
Imamuzzaki Abu Salam
35ba928430 test: init sharp integration test (#7481)
* test: init sharp integration test

* Update sharp integration tests and package.json

* Delete unnecessary files and dependencies

* refactor sharp dir with path.join import.meta.dir

Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>

* Update dependencies and fix image resizing

* Remove trustedDependencies from package.json

---------

Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2023-12-12 13:35:13 -08:00
Jarred Sumner
7ec64c2cc8 Update lifecycle.md 2023-12-12 02:36:48 -08:00
Jarred Sumner
5e60861c34 Disable this warning 2023-12-12 02:32:48 -08:00
Jarred Sumner
39b66ded08 Bump 2023-12-12 02:31:36 -08:00
dave caruso
a2f595d352 fix: better error message for bun install fs permission errors (#7550)
* remove `prettyWarn`, add easy print utils, clarify a package.json loading error

* error when node_modules isnt writable

* hmm

* fix instal

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-12 00:18:05 -08:00
Dylan Conway
d163351f3e fix(install): fix semver sorting with prereleases (#7588)
* compare number with string correctly

* Update semver.zig

* invalidate cache

* seconds
2023-12-11 22:29:22 -08:00
Dylan Conway
351e47355a add default trustedDependencies and run lifecycle scripts during installation (#7132)
* [install] allow parallel execution of `postinstall` scripts

- fixes spurious exit code 42 from `spawn()`

* postinstall to a pipe

* feat(install): include top 500 packages as defaults for postinstall

* windows newline handling*

*i did not test it

* stuff

* cool

* a

* fix merge

* set `has_trusted_dependencies`

* fix a bunch of tests

* fix merge

* remove `PackageManager`

* remove commented code

* change to function

* Update lockfile.zig

* run scripts if added to `trustedDependencies` after install

* packages without `resolved` properties

* node-gyp scripts

* node-gyp script in the root

* another test

* git deps run prepare scripts

* fix merge

* run lifecycle scripts during installation

* Update lockfile.zig

* always increment

* 🏗️

* update tests

* tickWIthoutIdle

* const uws

* loop forwards through trees

* single buffer bitset list

* tag.isGit

* windows path separators

* `bun.sys.read` and enable/disable buffering

* fix test and waiter thread

* waiter thread and tests

* Update bun-install-registry.test.ts

* workspace exclude `preprepare` and `postprepare`

* Create esbuild.test.ts

* make sure length is the same

* remove deferred binlinks, add estrella test

* test with another version

* address some comments

* remove .verdaccio-db.json

* ooops

* fix build

* use `pid` to wait

* dont register pid_poll when using waiter thread

* stress test

* free

* fix failing tests

* fix linux crash, snapshot stress test

* oops

* concurrent scripts

* activate as soon as possible

* test

* delete stress test packages

* remove unused packages

* comment stress test and maybe fix segfault

* delete snapshot

* fix assertion

* use cpu_count * 2 for default concurrent scripts

* gear emoji

* add --concurrent-scripts to docs

* more docs

---------

Co-authored-by: alexlamsl <alexlamsl@gmail.com>
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Dylan Conway <33744874+MilesWright7@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-12-11 22:08:25 -08:00
hustLer2k
83ed65c687 Add -h as alias to --help (#7519)
* feat: add -h as alias to --help

* fix: remove redundant -h flag check

* fix: remove unneeded -h equality tests
2023-12-11 16:27:17 -08:00
hustLer2k
ab85b2a2a0 test: Migration tests fixes (#7393)
* use lockfile path passed as an argument instead of a literal string

* clean up tmp folders in migrate.test

---------

Co-authored-by: Alex See <alexsee@Alexs-MacBook-Air.local>
2023-12-11 16:07:20 -08:00
hustLer2k
6a63224f86 fix(node:fs): interpret string options as encoding in Readable constructor and fs.createReadStream (#7516)
* fix: match Readable constructor and createReadStream to node api

* remove typo from node-stream.test.js

Co-authored-by: Aaron Silvas <aaronsilvas@gmail.com>

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Aaron Silvas <aaronsilvas@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-11 16:06:29 -08:00
Dale Seo
c9e98db258 docs: remove unncessary empty line (#7581) 2023-12-11 14:54:18 -08:00
Jarred Sumner
351810e5bc Switch to std.sort.pdq from std.sort.block (#7574)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-10 19:49:21 -08:00
Nick Reilingh
3aabe58180 bun-types: add recursive option to readdir/Sync (#7568) 2023-12-10 19:48:54 -08:00
Jarred Sumner
800fb12906 Handle holey arrays in console.log, don't omit length property, cleanup logLevel option (#7557)
* Add `fromJS` helper method to `ComptimeStringMap` and `logLevel` parsing better

* Handle holey arrays

* Update console-log.expected.txt

* More tests

* Add TODO

* More fixture

* [autofix.ci] apply automated fixes

* Update bindings.cpp

* Cleanup some spacing

* update

* Handle externals in `bun build` from package.json "imports"

* Prevent recursion in Web Worker

* Fix failing test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-10 04:33:25 -08:00
Bin Xin
7541f4ce4f fix: jsx key after spread (#7464)
* fix: jsx key after spread

* feat: configurable logLevel
2023-12-09 22:49:39 -08:00
Jarred Sumner
402f3353ac Make some regexes lazy 2023-12-09 22:37:25 -08:00
Jarred Sumner
73b0426596 Fixes #7400 2023-12-09 22:17:08 -08:00
Jarred Sumner
54f1f4635e Fixes #7554 2023-12-09 21:59:27 -08:00
Jarred Sumner
300d17f223 Slightly refactor Bun.file().text() control flow (#7535)
* Clean up control flow in Bun.file().* file reader

* Preallocate large files on Linux

* remove `this.wrote` field

* push

* doesnt work yet

* Create if not exists

* Fix for macOS

* Update blob.zig

* Slightly clean up this test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-09 21:47:40 -08:00
Otger Rogla
ce63023553 fix: re-enable util.parseArgs with memory fixes (#7460)
* Fix parseArgs issues and reenable it

* Minor changes to parseArgs

* Another minor change to parseArgs

* Add exception handling to JSValue putMayBeIndex
2023-12-08 17:43:40 -08:00
dfa
59f9d2fe70 fix: Unconditionally reset stack on Bun.deepEquals exit (#7542)
* Unconditionally reset stack on deepEqual exit

* [autofix.ci] apply automated fixes

---------

Co-authored-by: evan <Evan Bergeron>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-08 17:32:27 -08:00
dave caruso
aaa827f90e fix(node:module): allow file url strings in createRequire (#7533)
* fix(node:module): allow file url strings in createRequire

* add a non-happy path test :)
2023-12-08 16:32:35 -08:00
Brady Madden
c84be8c48b fix: ws onmessage callback to return data within an object (#7529) 2023-12-07 19:05:23 -08:00
Dale Seo
1d45c1c412 docs: remove unncessary phrase (#7532) 2023-12-07 18:48:08 -08:00
Jarred Sumner
653e2934fe Fixes #7503 (#7511)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-07 02:19:11 -08:00
dave caruso
798f548607 fix(resolver): allow builtins to be imported via subpath imports (#7505)
* fix(resolver): allow builtins to be imported via subpath imports

* [autofix.ci] apply automated fixes

* Fix target

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-07 01:51:21 -08:00
dave caruso
1337bb6923 fix(create): make bun create @ org work (#7498) 2023-12-07 00:57:31 -08:00
dave caruso
b6775e2df7 fix(upgrade): print a better message on NixOS (#7489) 2023-12-07 00:56:36 -08:00
Jarred Sumner
4519f97661 Don't call read() with an empty buffer (#7509)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-07 00:55:34 -08:00
Hanaasagi
dfd4b01a97 fix(jest): fix segfault when passing jest.fn into another jest.fn (#7507)
Close: #5900
2023-12-07 00:41:31 -08:00
dave caruso
1bf540efcf feat: allow "bun:test" utilities at runtime (#7486)
* feat: allow "bun:test" utilities at runtime

* fsdafdsafd

* yippee
2023-12-06 22:09:43 -08:00
Jarred Sumner
b1c8ae97ff Rewrite IO for Bun.file() (#7470)
* WIP rewrite IO for Bun.file()

* It seems to work on macOS

* Update ffi.zig

* Handle many more cases

* Clarify this more

* More comments

* [autofix.ci] apply automated fixes

* Add empty

* Make it work in epoll

* fetch fixes + tests fmt

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
2023-12-06 18:10:06 -08:00
Jérôme Benoit
6a5995e27d test(worker): refactor worker tests (#6732)
* test(worker): refactor worker tests

+ constify variables
+ typing
+ untangle web worker from worker_threads tests
+ cleanup variables namespace

no functional changes on tests

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: move worker_threads related code to node/worker_threads

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: move worker tests into workers directory

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* refactor: report upstream changes

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* refactor: report upstream change

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* fix: address review comments

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* chore: fix submodule

---------

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
Co-authored-by: dave caruso <me@paperdave.net>
2023-12-06 17:06:11 -08:00
dave caruso
24ca605832 feat(test): run any test file by passing it as a path (#7483)
* feat(test): allow file paths to test specific files.

* [autofix.ci] apply automated fixes

* be less stupid about what files the CI runs as tests

* aa

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-06 08:52:12 -08:00
dave caruso
ad4b98b287 perf: make napi_create_object 2.5x faster (#7475)
* Faster napi

* Reduce number of headers exposed for JSStringDecoder

* Add missing header

* test: this test was meant to be marked as TODO

* revert the string decoder garbage

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-06 00:30:51 -08:00
Sylvain
fd1d4b4e5a Fix small typo in update.md (#7477)
* Fix small typo in update.md

* Update update.md

---------

Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2023-12-05 21:12:55 -08:00
Vlad Sirenko
f0e0c6d5df fix: improve compatibility of http.ServerResponse (#4431) 2023-12-05 16:15:16 -08:00
dave caruso
b77480758f Fix bug with syntax highlighter (#7474)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-05 15:53:44 -08:00
Dylan Conway
93d9b20974 increase (#7476) 2023-12-05 15:53:05 -08:00
Imamuzzaki Abu Salam
f303bcd997 docs: update misleading clonefile information (#7388)
* docs: update misleading `clonefile` information

* Fix macOS exception in cache module
2023-12-05 14:35:19 -08:00
dave caruso
62e1389e17 test: import describe properly
@Jarred-Sumner you forgot to import describe. this is casusing test failures on all PRs.
2023-12-05 14:22:28 -08:00
Anner Visser
b952ef8ad9 Base prelease build stage on base instead of on install (#7289)
There is no reason to have the entire install stage for the
prerelease stage. Instead use the base as base and copy
in the relevent files (which already happened)
2023-12-04 17:06:46 -08:00
Aaron Silvas
ec6339c25a Fix for building lambda runtime zip files (#7446) 2023-12-04 09:44:26 -08:00
Max Kayander
2ff788f463 Update typedarray-to-string.md (#7453) 2023-12-04 09:43:42 -08:00
Jarred Sumner
df17598026 Allow expect.extend in preload, remove "expect must be called in a test" error (#7430)
* Allow `expect.extend` in preload, remove "expect must be called in a test" error

* Bump

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-03 22:31:56 -08:00
Michael H
298a60419b Fix bun create help script (#7450)
* remove unnessary escape + fix bold

* ...
2023-12-03 22:31:36 -08:00
Jarred Sumner
2f83f32582 Update websockets.md 2023-12-02 09:30:58 -08:00
Jarred Sumner
b3bdf22ebb Handle EXDEV when saving lockfile (#7419)
* Handle `EXDEV` when saving lockfile

* Update fs.zig

* Update c.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-02 08:00:35 -08:00
Jarred Sumner
d45f2dae15 Disable usage of O_TMPFILE for now 2023-12-02 06:54:33 -08:00
Jarred Sumner
67c7769ddb Make some warnings errors (#7417)
* Make some warnings errors

* Modifying CMake should trigger a rebuild...

* bring this back + fix tmpfile issue

* Add assertion + fix error

* use cast

* Handle EEXIST

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-02 06:03:14 -08:00
Jarred Sumner
03298cba70 Disable parseArgs implementation until https://github.com/oven-sh/bun/pull/7310#issuecomment-1837135393 is addressed 2023-12-02 04:29:13 -08:00
Jarred Sumner
3963d2de64 Rename async asymmetric matchers 2023-12-02 03:50:30 -08:00
Jarred Sumner
b2bf3f0dcf Handle stack overflow in binary expressions in JS Parser (#7414)
* Fix stack overflow in large files

* Add test for stack overflow

* wip

* Disable cache in debug build

* Remove our extra `captureStackTrace` call

* Update RuntimeTranspilerCache.zig

* Update RuntimeTranspilerCache.zig

* Fix issues with integer environment variables

* Add missing ref

* Add missing null check

* Update bindings.cpp

* Update transpiler-cache.test.ts

* Add version check

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-12-02 03:46:25 -08:00
dave caruso
ffe447ba5a fix(standalone): runtime dynamic imports now transpile correctly. (#7404)
* fix issue in compile

* add tests

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-02 00:42:34 -08:00
Jay Bell
7389f1b108 fix(lockfile): print yarn lockfile aliases deps with quotes (#7409)
* fix(lockfile): print yarn lockfile aliases deps with quotes

* Update src/install/lockfile.zig

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-12-02 00:42:21 -08:00
Hanaasagi
7538c20afe fix(worker): fix SIGSEGV when terminating a Worker (#7411)
Close: #7209
2023-12-02 00:39:26 -08:00
Dylan Conway
ed02691f8b Remove line truncation in logger (#7413)
* Update logger.zig

* less out of bounds
2023-12-02 00:06:02 -08:00
Ashcon Partovi
dae985ab3c Fix Location header not being cloned from Response.redirect() (#7402)
* Fix `Location` header not being cloned from `Response.redirect()`

* Fix was something else
2023-12-01 16:35:28 -08:00
Jarred Sumner
52e1c2de08 feat: syntax highlight stack traces + overall visual improvements (#7335)
* Parse stack trace string

* Syntax highlight error messages

* Fix off-by-one

* Undo changes to populateStackTrace

* Highlight more things

* Add a way to write tests for it

* Create highlight-cat.ts

* Bump

* fix: off by ones

* feat: add function highlighting to these errors

* revisions

* undo

* l

* fix webkit submodule

* imo this looks worse

* [autofix.ci] apply automated fixes

* fix off by one <3

* fix more situations

* ch changes

* ok

* [autofix.ci] apply automated fixes

* fix this

* fix snapshot

* ok

* mark test as todo

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-12-01 14:02:08 -08:00
Jarred Sumner
0c532eac7b Make tsc --help 2x faster (#7365) 2023-12-01 22:56:40 +01:00
Jarred Sumner
70e57a7da0 Fixes #4876 (#7391) 2023-12-01 22:54:40 +01:00
Dylan Conway
fdece8611a Update thread_pool.zig (#7389)
* Update thread_pool.zig

* default stack size

* fix assertion
2023-12-01 02:07:13 -08:00
Zack Radisic
1147c70881 Glob fixes + optimization (#7344)
* idk why that was left out

* No need for stat call, add text for broken symlinks

* tests for crashes

* Fix test

* Add some checks to limit max open file descriptors

* Update glob.zig

* Update glob.zig

* Update scan.test.ts

---------

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-11-30 19:18:55 -08:00
mimikun
3c97f568a7 Fix typos (#7378) 2023-11-30 18:36:44 -08:00
Dylan Conway
310d0c5646 oopsies 2023-11-30 18:16:47 -08:00
Dylan Conway
d79fa7ac1a remove bun.parseargs and update docs 2023-11-30 18:04:48 -08:00
Ciro Spaciari
906ba8b2a0 fix(WebSocket) improve WebSocket Client (#7371)
* improvements

* autobahn tests

* add all tests

* check if docker is active move autobahn to a new file

* fix non SIMD UTF8 validation

* use no trim to catch utf8 issues

* fix extended payload fragmentation

* fmt

* Update src/string_immutable.zig

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

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-11-30 18:00:41 -08:00
Dylan Conway
54df5c032d createEmptyObjectWithNullPrototype 2023-11-30 16:48:53 -08:00
Otger Rogla
70039ff038 feat(parseArgs): Native implementation of parseArgs from node:util (#7310)
* Native implementation of parseArgs from node:util

* small change to validators + added some docs
2023-11-30 16:34:44 -08:00
Otger Rogla
90654143bb feat(test): expect.extend and asymmetric matcher improvements (#7319)
* bun-test expect.extend and asymmetric matcher improvements

* [autofix.ci] apply automated fixes

* Changes to expect.extend and asymmetric matchers

* expect-extend: remove global custom matchers registry

* test custom matchers: better way of storing matcher func

* made expect.arrayContaining/objectMatching reject non-arrays/non-objects

* [autofix.ci] apply automated fixes

* fixes for test changes

* create 1 wrapping function instead of 2 per each custom matcher

* fix expect.extend error messages and support for async matchers

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-11-29 23:20:25 -08:00
liqiang
bc114fb9d3 fix console.timeLog (#7089)
* fix console.timeLog

* fix console.timeLog can log arguments

* console timeLog test use bunEnv

Co-authored-by: Ashcon Partovi <ashcon@partovi.net>

* fix console timeLog test

* Update console.timeLog

Co-authored-by: dave caruso <me@paperdave.net>

* Update test/js/web/console/console-timeLog.js

Co-authored-by: Radhi Rasho <54078496+RadhiRasho@users.noreply.github.com>

* Update console-timeLog.js

* fix console-timeLog.js test

* fix timeLog tests due to trailing comma PR

---------

Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Radhi Rasho <54078496+RadhiRasho@users.noreply.github.com>
2023-11-29 20:07:03 -08:00
dave caruso
f3727f00dc allow migrating from npm lockfile v2 (#6695)
* allow lockfile version 2

* force save lockfile

* add migration from npm lockfilev2 test (#7370)

Co-authored-by: Alex See <alexsee@Alexs-MacBook-Air.local>

* [autofix.ci] apply automated fixes

---------

Co-authored-by: hustLer2k <61846786+hustLer2k@users.noreply.github.com>
Co-authored-by: Alex See <alexsee@Alexs-MacBook-Air.local>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-11-29 20:06:44 -08:00
Jarred Sumner
6389a6e24f fix: reduce noise in stack traces (#7307)
* Mark require as private

* [autofix.ci] apply automated fixes

* fix(runtime): clean up cjs + stack trace stuff

- CJS wrapper is like 200x simpler to understand. it is also 1-10% faster
- Make a few more things hidden in stack tracess. This only affects release build.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
2023-11-29 18:03:29 -08:00
Brian Knight
851b19ee0e Fix imports in run-tests example (#7368)
Adds `describe` to the import statement in a run tests example. Without this, the example does not run properly and returns an error.
2023-11-29 18:00:15 -08:00
Nick Reilingh
ebae02a08b Update file-io.md: BunFile.stream() doesn't return promise (#7372)
According to my lsp, `.stream()` returns a ReadableStream directly instead of a promise.
2023-11-29 13:44:31 -08:00
dave caruso
809266fc7a dx: clarify zig version error 2023-11-29 11:21:50 -08:00
Joey Wendt
98885279eb Fix scripts/download-zig.sh (#7364)
* fix: scripts/download-zig.sh file is not gzipped

* fix: scripts/download-zig.sh Linux x86_64 arch var
2023-11-29 00:52:59 -08:00
hustLer2k
666e615889 feat(console): Use trailing commas when printing multiline JS objects (#7334)
* feat: use trailing commas when printing multi-line objects

* test: update console-log.expected.txt to include trailing commas

* test: update a couple tests to match new object output with trailing commas

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Alex See <alexsee@Alexs-MacBook-Air.local>
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-11-28 13:28:37 -08:00
Adrien Brault
0b99b01b0e fix: printf invalid option in download-zig (#7351) 2023-11-28 13:27:19 -08:00
Adrien Brault
eb98b61201 docs: fix macos clang-16 PATH command (#7350)
Even though I had run the export, `bun setup` was erroring with:
```
$ ./scripts/setup.sh
setup error: LLVM 16 is required. Detected CXX as '/usr/bin/clang++'
error: script "setup" exited with code 1 (SIGHUP)
```

Running `export PATH="$(brew --prefix llvm@16)/bin:$PATH"` fixed the error
2023-11-28 13:26:53 -08:00
Jérôme Benoit
a043497fb4 fix(worker_threads): do not terminate worker at parentPort closing (#7238)
* fix(worker_threads): do not crash worker at parentPort closing

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* doc: add TODO comment as per review request

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

---------

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
2023-11-28 11:44:01 -08:00
Sukka
f5115835da dx: fix auto install zig script (#7348) 2023-11-27 20:34:12 -08:00
Alexandre Seo
34881922c8 fix(transpiler): error when parsing keys with hyphen in some JSON files (#7316)
* Quote export aliases with hyphens when converting jsons to modules

* Add test

* Handle quotes in printer and not in bundler

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-11-27 20:03:53 -08:00
Jérôme Benoit
44b9960113 fix(worker_threads): make onmessageerror setter work (#7237)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
2023-11-27 19:32:24 -08:00
Bin Xin
713d72703d feat(transpiler): add jsx spread children support (#7294)
* feat: jsx spread children

* test: spread children
2023-11-27 19:30:59 -08:00
dave caruso
383a615d21 dx: automatically install and update zig (#7305)
* dx: automatically install and update zig

* update repo

* ensure system zig compiler in ci

* a

* b

* good

* i am stupid

* why did this happen

* fix installer
2023-11-27 17:27:01 -08:00
Jarred Sumner
6ee42f7719 Fixes #7324 (#7330)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-27 12:12:55 -08:00
James Anderson
1840de3661 feat(test): toHaveBeenNthCalledWith + improve some fail messages (#7320)
* feat(test): `toHaveBeenNthCalledWith` + improve some fail messages

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-11-26 15:59:44 -08:00
Steven Almeroth
6aa1319fd9 fix typo (#7327) 2023-11-26 15:59:19 -08:00
Jarred Sumner
6a7b1a3208 Clean up lifetime handling for napi_create_string_utf16 (#7311)
* Clean up lifetime handling for `napi_create_string_utf16` and `napi_create_string_latin1`

* Fix `napi_create_arraybuffer`

* Update globals.d.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-26 15:59:03 -08:00
Jarred Sumner
5c23d670a3 Fix bug with readable streams that have been detached (#7308)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-26 02:11:42 -08:00
Jarred Sumner
22818e6806 Fix assertion failure when Worker is shutting down 2023-11-25 02:15:53 -08:00
Michael H
0abe3745d2 Add import.meta.env to bun-types (#7309)
* Add `import.meta.env` to `bun-types`

* add type to codeblock
2023-11-24 22:04:20 -08:00
DidaS
ea0ffde991 Update docs (#7193) 2023-11-24 21:25:37 -08:00
Sam
194294f5b5 fix(node:fs): fix fs.promises.opendir not having a path property (#7292)
Closes #4995
2023-11-24 19:11:45 -08:00
Jarred Sumner
7f10622a84 Implement recursive option in fs.readdir (#7296)
* Implement `fs.readdir(path, {recursive: true})` and `fs.readdirSync(path, {recursive: true})`

* Update node_fs.zig

* FIx memory leak in error code

* Add fail test

* Update readdir.mjs

* Update bun.zig

* Update readdir.mjs

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-24 19:08:07 -08:00
Jarred Sumner
a71a9e3447 Fix warning 2023-11-24 18:49:59 -08:00
Ciro Spaciari
53ee2d77b2 fix(crypto) oneshot Sign and Verify (#7256)
* WIP

* native oneshot sign

* add native verify

* fallback rsa to non-native

* WIP der dsaEncoding

* pass encoding

* RSA-PSS padding and saltLength

* oopies

* improve RSA-PSS support

* accepts hash identifiers like nodejs and add options.hashAlgorithm support

* fix string check

* tests

* define hash for ECDSA

* fix compilation
2023-11-24 18:43:17 -08:00
WingLim
3d58437fc8 fix(Response): single Content-Range in http response (#7199)
* fix: only write header if not exist

If user set header by himself, then we not write duplicate header.

* feat: add test to check header

* chore: format code
2023-11-24 18:29:52 -08:00
Michael H
6517252153 Environment Variables (#7306)
* Environment variables

* .
2023-11-24 18:25:34 -08:00
James Anderson
5f86b839b4 feat(test): toHaveBeenCalledWith and toHaveBeenLastCalledWith (#7277) 2023-11-24 18:24:21 -08:00
Jarred Sumner
5692f82aaf Delete bun_dev_http_server.zig (#7283)
* Rename http_client_async -> http

* Delete bun_dev_http_server.zig

* update these

* [uws] Add method for getting SO_ERROR

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-24 18:21:56 -08:00
Dylan Conway
93714292bf require bun:test (#7276) 2023-11-23 01:12:03 -08:00
Jarred Sumner
0766fb5ae8 Fix assertion failure in mocks 2023-11-23 00:54:12 -08:00
Dylan Conway
e83a9132d5 fix duplicate workspace bug (#7281)
* fix duplicate workspace dependency bug

* dedupe workspace names from package json

* more tests

* Update bun-install-registry.test.ts

* make sure workspace path entry is assigned

* Update bun-install-registry.test.ts

* Update bun-install-registry.test.ts
2023-11-22 22:18:27 -08:00
Jarred Sumner
bc4146295f Update nav.ts 2023-11-22 16:13:41 -08:00
Jarred Sumner
d8be3e51b4 Support glob.scan(string) (#7279)
* Support `glob.scan(string)`

* Create glob.md

* Update glob.md

* fixup

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-22 16:12:28 -08:00
Zack Radisic
6ba4e950cc Add Bun.Glob (#6861)
* initial glob impl

* Add `Bun.globMatch`

* Glob boilerplate setup

* Experiment with Rust glob implementation

* Rust impl is slow revert

* Setup glob walking

* Basic glob walker working

* Fix segfault

* Recursive directory traversal

* Fix glob match non-ascii

* Make faster lil bit

* use arena

* ASCII fast path

* Experiment with packed codepoint cursor

Results in ~4% perf boost if the glob pattern needs to create/manipulate cursors (for example when the pattern uses braces)

* Try converting to u32 array

Made it pretty slow

* Lazily create codepoint buffer

* Different walk algorithm

* Fast path optimizations

* Add `dot` option to `Glob`

* .

* Fix some bugs

* Fix bug, clean up lil bit

* Windows fix

* Non absolute paths

* use specific version of fast-glob for benchmarks and tests

* .

* Fix some stuff

* Fix more stuff

* Add `hasPendingActivity()` to glob

* accident

* Symlinks

* fast-glob e2e tests

* remove

* woops

* Fix relative paths

* Fix absolute

* add test for `onlyFiles`

* Fix invalid surrogate pairs problem

* Rename: `match/matchSync` -> `scan/scanSync` and `matchString` -> `match`

* forgot to close cwd fd

* Update types

* Add stress test

* Port `micromatch` / `glob-match` / `globlin` tests

* fix stale reference arena thing

* stupid bug

* Add builtins to classes code generator and add `Glob.scanIter()`

* all iterables

* generate fixtures, remove from git

* fix test

* Fix

* woops on test

* Fix stuff

licenses

license

`has_pending_activity` to usize

cwd threadSafe fix atomic compile errors

`GlobWalker` own `cwd`

Fix windows path and absolute test

stuff

* Fixes

* Fix stuff

* Use Syscall.close

* Use private symbols for underlying scan functions to preevent misuse

* Update types

* Fix build for zig

* Fix tests

* Fix more tests

* Prevent these tests from GC'ing too much

* Make this benchmark work in Node and Bun

* Fix memory leak

* Add leak test

* Fix windows

* comment about arena allocator use for glob walker

* Make leak test run in separate process

* Iterator api for glob

* GlobWalker.Iterator

* fix leak test

* Remove old impl

* filter functions wip start

* stuff

* wip lockfile use glob

* glob working with lockfile

* revert lockfile changes

* Update bun.lockb

* Manually set to cwd to prevent test failing on linux CI

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-22 14:26:09 -08:00
Jarred Sumner
81067477dc Load *.{m,c}ts{x} last in node_modules (#7259)
* Load `.{m,c}ts{x}` last in node_modules

* feat(console.log): Print className for an object if present (#6508)

* feat(console-log): fix className not printed for objects that are instances of classes

Uses getClassName native method instead of getName

* test(console-log): objects with class names are printed correctly

* test(esbuild): add class name to log message

* Fix failing `which` test (#7258)

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>

* Make test less flaky

* Get it working and add test

* Handle relative paths

* Add comment

* Consolidate + add test

* Bump

* Fix getObjectName

* Update dir_info.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Jibran Kalia <jibran.kalia@gmail.com>
2023-11-22 14:11:35 -08:00
Jarred Sumner
d8ca6ca699 Make test less flaky 2023-11-21 18:56:14 -08:00
Jarred Sumner
05ef3329c4 Fix failing which test (#7258)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-21 18:10:21 -08:00
Jibran Kalia
ab93f9f74e feat(console.log): Print className for an object if present (#6508)
* feat(console-log): fix className not printed for objects that are instances of classes

Uses getClassName native method instead of getName

* test(console-log): objects with class names are printed correctly

* test(esbuild): add class name to log message
2023-11-21 17:39:00 -08:00
Dylan Conway
8db407e9a7 make tmpdir more random (#7243)
* make tmpdir more random

* 100
2023-11-21 14:29:35 -08:00
Dylan Conway
5eb6f83251 fix test :( 2023-11-21 12:34:36 -08:00
Jarred Sumner
1b8d7d5cb1 Update base64 library (#7220)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-20 15:12:31 -08:00
Jarred Sumner
bf32d36e4c Cleanup how build errors are displayed slightly (#7223)
* Cleanup error formatting a little

* Add error for using import statement with CommonJS-only features

* Update js_ast.zig

* Further tweaks to formatting, also print error.cause

* Add some snapshot tests for errors

* Make these snapshot tests

* Ignore mimalloc warnings

* Update error message parsing in bundling tests

* Increase timeout on the test

* Update expectBundled.ts

* Update test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-20 15:07:13 -08:00
Anton Golub
e9661c2953 fix(process): enable SIGKILL and SIGSTOP mappings (#7172)
* fix: enable SIGKILL -> 9 mapping

* fix: enable SIGSTOP -> 18 mapping
2023-11-20 14:11:46 -08:00
Jérôme Benoit
0b66fd643e fix: test for make presence in the buildsystem (#7234)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
2023-11-20 09:12:24 -08:00
Liz
778bad9dfd fix(Bun.serve): return EACCESS when we don't have perms (#7191)
* fix(Bun.serve): return EACCESS when we don't have perms

The error reported to js land when listening fails was always the same,
this adds a second one for EACCESS when we are not the super user.

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

* fix: adjust code to be only ran on linuz

* fix: correct typo

* fix: remove comment since its linux only now
2023-11-19 10:38:33 -08:00
Jarred Sumner
ef8b9efaa4 Fixes #7201 2023-11-18 22:24:49 -08:00
Jarred Sumner
864d59f822 Add missing JSC debug build flag 2023-11-18 21:04:45 -08:00
Dylan Conway
f5bf67bd1b choose correct resolved package for peer dependencies (#7192)
* fix sometimes failing install test

* loop to make sure it happens
2023-11-17 19:15:47 -08:00
Ashcon Partovi
075c09401a Output verbose logs when running in Github Action with debug mode (#7183) 2023-11-17 18:19:29 -08:00
Ciro Spaciari
c23579d66c feat(http2) Client Support (#6761)
* init

* WIP fix post data/refactor

* make it compile again

* more things

* undo padding and continue + fix posting + update lshpack

* re-add fixes

* really simple tests + fixes

* add aborted event

* fix trailers

* add getDefaultSettings, getPackedSettings and getUnpackedSettings

* fix + fmt

* fixes

* fix enablePush o be boolean

* fix sendTrailers

* fmt

* fix goaway, fix some error messages

* oops

* revert some changes

* more reverts

* WIP

* get CMAKE building lspack + ping behavior

* remove files that should not be added anymore

* remove old out files

* remove old file

* fix header reduce

* bunch of fixes

* fix socket unref

* fix abort signal, rebase and fmt

* socket unref tests

* oops re-add cmake

* fix stream state

* more tests and fixes

* fixes and ping tests

* lshpack in Dockerfile

* just copy lshpack

* oops

* fix end

* wantTrailers

* encode/decode fixes + grpc

* channel credentials test

* rebase

* support h2c

* fix h2c

* fix h2c connect event + h2c tests

* 'copy ls-hpack

* ls-hpack build sh

* oops

* changing CMake + Docker

* add ps1 build for ls-hpack fix clean

* optimizations + fixes

* remove protect/unprotect from handlers

* more consistent errors

* fix error code

* oops

* add goaway tests

* oops uncoment tests

* better errors more tests

* add broken priority frame

* better memory leak, some fixes and less flask tests

* zig update .Big -> .big

* closer threshold + h2 fix

* remove log

* test should not be flask

* increase timeout on leak memory test

* windows build

* less flasky

* always 127.0.0.1

* [autofix.ci] apply automated fixes

* remove .call and use primordials

* apply socket fix

* fix win-build

* should properly mark inactive

* postgres fix

* increase deadline

* test tests

* high light deadline timeouts

* event loop test

* make memory leak test faster

* use buffer on payload test

* check for socket.data before use

* reduce iterations to see if timeout on mac intel

* fix assertions

* avoid localhost and simplify things

* refactor memory leak test

* Update src/js/node/tls.js

* fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cirospaciari <ciro.spaciai@gmail.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-17 18:14:54 -08:00
Jarred Sumner
6c200c089c Tweak napi PR (#7177)
* Fix assertion failure

* Fix the test

* Fix assertion failure

* Update bun.lockb

* Add node-gyp

* Update CMakeLists.txt

* Update napi.test.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-17 17:00:44 -08:00
Mike Dotty
3eb086f5fa fix(dx): Stop swallowing errors from create_hash_table during the build (#7110)
* Stop swallowing errors from create_hash_table during the build

If src/codegen/create_hash_table can't be run due to some reason
(e.g. due to missing Math::BigInt Perl module) the build continues
but fails later, during bindings compilation, because the generated
files are empty.

Fix it by handling the failure to run create_hash_table properly.

Closes #7074

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-11-17 13:45:32 -08:00
DidaS
fbff18a723 fix(types): Change Bun.serve types to allow void when using websockets (#7160)
* `Response` -> `any`

* Revert previous commit & allow void in ws fetch

* Added type test to check if you can upgrade connection without returning

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-11-17 05:34:05 -08:00
Olivier Guimbal
6e7014c91b Fix napi_get_value_string_utf8 to match node (#7175)
* fix napi_get_value_string_utf8 to match node
closes #6949

* [autofix.ci] apply automated fixes

* Update test/napi/napi.test.ts

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

* Update test/napi/napi.test.ts

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

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-11-17 05:27:58 -08:00
Jarred Sumner
711ea1604b Set umask once (#7176)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-17 05:08:25 -08:00
Jarred Sumner
538a243453 Bump! 2023-11-17 04:12:08 -08:00
Dylan Conway
8be492c080 fix require transpile (#7170)
* bounds checks

* do this all the time

cc @paperdave

* use length of string

* ttest

* min

* can't prefix if length isn't at least equal

* substring

* Update pretty_format.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-11-17 04:10:50 -08:00
jhmaster
6c7a0e5a79 node:util core-js compat. fix (#7101)
* node:util: fix compatibility issue with corejs
2023-11-17 09:10:32 -03:00
Jarred Sumner
f4d14c02c7 Implement process.report.getReport() (#7171)
* Prevent assertion failure

* Implement process.report.getReport()

* Update process.test.js

* }

* Update BunProcess.cpp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-17 03:35:35 -08:00
Dylan Conway
3ca2d8ae5e ensure .bin folder is created before linking binaries (#7166)
* bin might need to be created after iterating node_modules

* Update bun-install-registry.test.ts

* test this functionality in a few more tests

* fix a test

* another test

* revert

* more test
2023-11-16 23:54:49 -08:00
Jarred Sumner
c23aed993f Update pull_request_template.md 2023-11-16 23:52:27 -08:00
Jarred Sumner
11e07caaa4 Update pull_request_template.md 2023-11-16 23:52:19 -08:00
Jarred Sumner
e4de49df2a Update pull_request_template.md 2023-11-16 23:51:28 -08:00
Jarred Sumner
47e1fbe468 Update pull_request_template.md 2023-11-16 23:50:09 -08:00
Jarred Sumner
8353ba7857 Update pull_request_template.md 2023-11-16 23:50:02 -08:00
HK-SHAO
606c80b049 Fix the TypeError of isValidTLSArray for http (https://github.com/oven-sh/bun/issues/7153) (#7154) 2023-11-16 23:41:19 -08:00
Jarred Sumner
d1436e3ecc Support Object.create in Stats within node:fs (#7168)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-16 23:39:10 -08:00
Jarred Sumner
7e0e007e3e Fix bug where with statements do not trigger CommonJS (#7167)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-16 23:37:22 -08:00
Ashcon Partovi
2e74f7f079 Properly handle errors from posix_spawn (#7163) 2023-11-16 21:02:13 -08:00
Jarred Sumner
2c81c2a13f Fix crash due to isEmpty check checking only size and not capacity 2023-11-16 19:37:14 -08:00
Jarred Sumner
d9a0fd4f59 Don't allocate new "require" and "resolve" strings in CJS modules (#7162)
* Don't allocate new `"require"` and `"resolve"` strings in every CommonJS module

* Use builtinNames more

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-16 15:10:27 -08:00
Mathias Wulff
d1ec8f86f3 Add license to bun-types (#7149) 2023-11-16 09:18:46 -08:00
Dylan Conway
85c997513d node modules bin directory fix (#7151)
* place binaries in `.bin` of package node_modules

* test

* fix tests
2023-11-15 22:44:44 -08:00
Mike Dotty
904134cc75 Handle whitespace in no_proxy environment variable (#7072)
De facto standard format of no_proxy enivronment
variable allows whitespace around the host names.
Make it work.

Closes #6339
2023-11-15 21:55:31 -08:00
Alex Kwiatkowski
15e4f1bad3 fix typo in help menu (#7150) 2023-11-15 21:19:38 -08:00
Jarred Sumner
09b8b6b468 Bump! 2023-11-15 19:41:00 -08:00
Jarred Sumner
4dfc7feae0 Reorder the flags 2023-11-15 19:17:10 -08:00
Jarred Sumner
77e6b946f4 Support using bultin functions in macros (#7113)
* `zig fmt`

* Support using macros in builtins

* Make fetch work a little better in macros

* Delete a bunch of code

* Update macro-test.test.ts

* Update macro-test.test.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-15 18:25:27 -08:00
Colin McDonnell
31814934f3 CLI flags (#6395)
* WIP

* WIP

* Improve helptext

* WIP

* WIP

* WIP

* WIP

* Clean up, implement warn_on_unrecognized_flag

* Fix struct

* Tweaks

* Fix bunx test

* Address reviews

* Init and create

* Updates

* bunx

* Tweaks

* Lockfile

* tweak

* tweak

* tweak

* tweak

* Remove comments

* Add back origin and port

* Remove logging

* Updates

* fmt

* fix rebasing mistakes

* bruh

* expose node builtins for -e

* add tests and fix it on windows

* a

* lol

* okay

* finish things up

* Update src/deps/zig-clap/clap/streaming.zig

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

---------

Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-11-15 18:15:10 -08:00
Jarred Sumner
b43a8b54cf Implement expect.unreachable(msg?: string | Error) (#7131)
* Implement `expect.unreachable`

* UIse expect.unreachable() in some tests

* Use more unreachable

* More unreachable

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-15 16:14:13 -08:00
Pierre-Mike
a165306fd9 Update gitignore-for-init removing duplicate .cache pattern (#7133)
'.cache' pattern is defined more than once
2023-11-15 09:19:12 -08:00
Hanaasagi
056d45cf6b fix(install): fix the case that package scope contains tilde. (#7049)
* fix(install): fix the case that package name contains tilde.
Close: #7045

* add tests

* emm, let me know why test failed

* overwrite registry config

* check more chars

* remove $
2023-11-15 01:31:31 -08:00
Dylan Conway
46955e95ef migration without resolved properties (#7123)
* packages without `resolved` properties

* test

* free more

* find registry scope
2023-11-14 23:17:59 -08:00
Jarred Sumner
e6e4ffb4ae Fixes #6789 (#7129)
* `zig fmt`

* Fixes #6879

* Update bun-test.d.ts

* More tests

* Bump WebKit

* [autofix.ci] apply automated fixes

* woops

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-11-14 21:00:28 -08:00
Jarred Sumner
5946e13e27 Fixes #7035 2023-11-14 20:18:04 -08:00
Anton Golub
8f3e278ab9 Add stubs for zlib.brotli* (#7096) 2023-11-14 08:52:42 -08:00
Ashcon Partovi
547ed6d74d Add workflow that fixes PRs that do not match formatting (#7098) 2023-11-14 08:51:19 -08:00
Jarred Sumner
d4adcb3ccf Update zig version (#7103)
* Update zig version

* Update Dockerfile

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-14 02:34:18 -08:00
Jarred Sumner
d4628992d8 Fixes #6929 (#7059)
* Fixes #6929

* TIL macOS symbols are case insensitive

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-14 02:14:11 -08:00
Jarred Sumner
24b4b2c16d Remove unnecessary unprotect() call causing assertion failure 2023-11-14 02:06:40 -08:00
Jarred Sumner
35bac672bb Make globalThis.crypto.subtle = 123 do nothing 2023-11-14 01:46:46 -08:00
Jarred Sumner
d649f69404 Add a test for expect() no arguments called repeatedly 2023-11-14 01:32:16 -08:00
Jarred Sumner
7ce5061343 Make a test less flaky 2023-11-14 01:20:41 -08:00
Jarred Sumner
20d9e25ae2 Fix hang introduced in #6991 (#7104)
This causes keep-alive to be disabled for HTTP status codes that do not support bodies, leading to many HTTP client hangs.

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-14 01:14:56 -08:00
Jarred Sumner
89c76f2b45 Fixes #6604 2023-11-14 00:55:19 -08:00
Jarred Sumner
a9a68c3143 Allow a longer timeout in this potentially flaky test 2023-11-13 22:25:13 -08:00
Jarred Sumner
d1c1c8fb5f Fix flaky test 2023-11-13 22:16:34 -08:00
Jarred Sumner
4228ecea98 [Guides] Suggest actions/checkout@v4 2023-11-13 22:15:36 -08:00
Jarred Sumner
909a821d3d [CI] Disable assertions build for now 2023-11-13 22:15:13 -08:00
Jarred Sumner
7a4e0158d6 Lots of stuff (#7027)
* Use debug mode by default

* Enable build with assertions enabled

* Update cli.zig

* Update bun-linux-build.yml

* Fixes

* Fix `ASSERT_ENABLED`

* try this

* Update Dockerfile

* mimalloc debug

* Update CMakeLists.txt

* `Bun.deepMatch` - fix assertion failures

cc @dylan-conway, looks like we need to use `putDirectMayBeIndex` and check for `isCell` more carefully.

* Object.create support in code generator and callbacks wrapper

* Remove unused file

* zig upgrade

* zls

* Fix various errors

* Support `BuiltinAccessor` in create_hash_table script

* Fix assertion failure in `process.mainModule`

* Fix assertion failure in `onerror`

* Fix assertion failure when creating a Worker

* Fix asssertion failure when loading lots of files in bun test

* Fix assertion failure when termating a `Worker`

* Add helper for converting BunString to a WTFString

* Fix assertion failure in notifyNeedTermination

* Add more debug logs in `bun test`

* Fix compiler warning in usockets

* Fix assertion failure with `Worker` termination (another)

* Fix assertion failure in `coerceToInt64`

* Fix assertion failure in `BroadcastChannel`

* Fix assertion failure in `Headers.prototype.getAll`

* Fixes #7067

* Add heap analyzer label for CommonJS modules

* Fix assertion failure in module.require && module.require.resolve

* Remove unused code

* Fix assertion failure in debugger

* Fix crash in debugger

* Fix assertion failures in bun:sqlite

* Bump zig

* Bump WebKit

* Fix assertion failure in JSPromise::reject && JSInternalPromise::reject

* Fix assertion failure in ReadableStream::cancel

* Fix assertion failure in AsyncContextFrame::create

* Fix assertion failure in bun:sqlite

* Fix assertion failure in mocks

* Fix assertion failure in ServerWebSocket.close

* Fix assertion failure in N-API with subclasses

* [napi] Make promises cheaper

* undo

* Don't check for exceptions in ObjectInitializationScope

* Add separate entry point for test runner that doesn't generate code

* Don't deref builtin code

* Fix preload test

* Fix assertion failure in memoryUsage()

* Fix preload test, part 2

* Ensure that the env map for a Worker is empty after it is used

* The pointer for the Arena allocator used in parsing should not change

* Terminate thread on exit

* Start to implement scriptExecutionStatus

* Update worker.test.ts

* Fix Dirent.name setter

* Update settings.json

* Fix assertion failure in node:http

* Use correct value for `JSFinalObject::maxInlineCapacity`

* JSFinalObject::maxInlineCapacity x2

* Don't strip when assertions are enabled

* Make `m_wasTerminated` atomic

* Preserve directives in the transpiler

cc @ctjlewis

* Workaround assertion failure in ServerWebSocket.sendBinary and ServerWebSocket.sendText

* windows

* Buffer lockfile serialization in-memory

* PR feedback

* PR feedback

* PR feedback

* Windows

* quotes

* Update CMakeLists.txt

* Update bun-linux-build.yml

* Update bun-linux-build.yml

* Move this code to BunString.cpp

* Update BunString.cpp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-13 22:10:09 -08:00
Zack Kollar
228bfbd24a Install the deps from test during the setup.sh script (#7047) 2023-11-13 17:26:57 -08:00
Ashcon Partovi
45e1bc3a21 Revert "Stop swallowing errors from create_hash_table during the build (#7086)" (#7097)
This reverts commit e1489d4fe3.
2023-11-13 14:42:25 -08:00
Mike Dotty
e1489d4fe3 Stop swallowing errors from create_hash_table during the build (#7086)
If src/codegen/create_hash_table can't be run due to some reason
(e.g. due to missing Math::BigInt Perl module) the build continues
but fails later, during bindings compilation, because the generated
files are empty.

Fix it by handling the failure to run create_hash_table properly.

Closes #7074
2023-11-13 13:46:20 -08:00
Ciro Spaciari
273f612c77 fix(async_hooks) fix disable and disable test (#7090)
* fix disable

* test should fail on exception

* oops
2023-11-13 13:21:27 -08:00
Otger Rogla
a82b2b2d04 support import.meta.env (#7094) 2023-11-13 12:37:20 -08:00
Shah Bakhteyar Haider
bf767b53d7 Update CI/CD guide (#7050)
* Update CI/CD guide

The guide at https://bun.sh/guides/runtime/cicd shows an outdated example for specifying a version of Bun.
It currently shows "version" and it should be updated to "bun-version".

* Add more examples in CI/CD guide
2023-11-13 09:54:03 -08:00
Juan A
1db1941577 Remove bad escaping from .gitignore in bun init (#7056)
Closes #7036
2023-11-13 09:37:42 -08:00
Mike Dotty
49f86c87b4 Refresh dependencies in contribution guide (#7087)
- move dependencies installation to the front, as the next steps
  depend on them
- add missing xz-utils, which, libicu-devel to the dependencies

Closes #7076
Closes #7077
2023-11-13 09:33:57 -08:00
cdfzo
346e27083f Fix typo in bundler docs (#7085) 2023-11-13 02:43:13 -08:00
Jarred Sumner
6d666da4b9 Update schema after env file change (#7061)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-11 21:08:08 -08:00
Jarred Sumner
feca0c2647 Delete unused files (#7060)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-11 21:07:56 -08:00
Jarred Sumner
bf806602d8 Update .gitattributes 2023-11-11 19:55:27 -08:00
Jarred Sumner
e3ab7408c9 Update .gitattributes 2023-11-11 19:39:56 -08:00
Jarred Sumner
c49a5a7d7d When getting properties, treat undefined the same as though the property was not defined (#7048)
It works this way in JS.

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-11 05:06:24 -08:00
Otger Rogla
450397a277 Fix fetch response skipping body if no content-length (#6932) (#6991)
* Fix fetch response skipping body if no content-length (#6932)

* Fix timeout on status 1xx/204/304 without content-length, tests changes

* Fix test that was wrong

* fix fetch response without content-length not disabling keep-alive

---------

Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2023-11-11 02:22:05 -08:00
Antonin CLAUZIER
f63eba952e Fixes output path for build command (#7026) 2023-11-11 02:13:23 -08:00
Otger Rogla
eaa9ba99fa add support for --env-file arg to bun run to load custom env files (#7032) 2023-11-11 02:10:47 -08:00
Ashcon Partovi
f0cbc79d8b Implement server.url (#7043)
* Implement `server.url`

* Fix memory leak
2023-11-10 23:00:27 -08:00
Lorenzo Donadio
01e0136d7c fixed small typo in allow_in_out_variance_annotations (#7030) 2023-11-10 15:17:08 -08:00
Joseph Yu
520845217e Fix toBeNaN's misleading JSDoc comment (#7019) 2023-11-10 11:25:08 -08:00
Brett Goulder
42d8a0b44b Fix util.formatWithOptions typings. (#7002) 2023-11-10 03:29:02 -08:00
Meghan Denny
84414f8fe8 fix fs.read being passed to util.promisify (#6999)
* fix fs.read being passed to util.promisify

* Update test/js/node/fs/fs.test.ts

* Update test/js/node/fs/fs.test.ts

* Update src/js/node/fs.js

* Fix write, add more tests, clean up the code

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-09 20:00:41 -08:00
Ciro Spaciari
046d197519 fix asyncLocalStorage disabled (#7015) 2023-11-09 17:51:49 -08:00
Dylan Conway
1250655ddb check for empty in JSValue.jsType (#7000)
* check for empty

* better comment

* move empty check to before `jsType()`

* Update src/bun.js/test/jest.zig

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-11-09 14:17:22 -08:00
dave caruso
29b1a4f61b fix(ffi): fix ffi with large uint32_t values (#7009)
* fix(ffi): fix ffi with large uint32_t values

* clean up
2023-11-09 12:02:20 -08:00
Ciro Spaciari
2d5698c719 fix(node-fetch) Set-Cookie key on node-fetch.raw() should be set-cookie instead of Set-Cookie to match nodejs behavior (#7011)
* fix set-cookie header name

* add test

* fix test

* fix test to match nodejs behavior

* oops
2023-11-09 11:59:20 -08:00
Meghan Denny
c08e8a76ef don't pass script flags to pre- or post- scripts (#6997) 2023-11-08 17:44:15 -08:00
MuhibAhmed
03298eb8dd Update edgedb.md (#6985)
Small fix
2023-11-08 04:41:12 -08:00
Jarred Sumner
a86a57e1b8 Update semver.md 2023-11-08 04:40:07 -08:00
Jarred Sumner
45f2eac44c Add a doc on Bun.semver 2023-11-08 04:32:29 -08:00
Jarred Sumner
b05e753c9f Add microbenchmark for Bun.semver 2023-11-08 04:03:48 -08:00
Dylan Conway
f7f6233ea8 fix semver edge cases and buffer used for prerelease comparisons (#6981)
* use different buf for group and manifest versions

* tests

* tests for installs that should fail

* allow `<=<prerelease-version`

* `Bun.semver.satisfies`

* one

* stringify

* symbol tests

* deinit

* arena

* more tests

* fix test

* version always on the left

* `Bun.semver.order`

* handle more edge cases, more tests

* whitespace

* more
2023-11-08 03:36:17 -08:00
Jarred Sumner
6d5c513195 Fixes #6200 (#6983)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-08 03:28:57 -08:00
Jarred Sumner
131b96bbba Fix debug build crash 2023-11-07 23:26:22 -08:00
Jarred Sumner
b7587b76e0 Revert "fix: correctly prepend system path to relative urls on pathToFileURL (#6472)"
This reverts commit 8130d9f3e1.

This fixes https://github.com/oven-sh/bun/issues/6953
2023-11-07 19:04:25 -08:00
Jarred Sumner
ee43932189 Update CMakeLists.txt 2023-11-07 19:02:32 -08:00
Jarred Sumner
9082193568 Add missing raw method to node-fetch polyfill (#6976)
* Add missing `raw` method to node-fetch polyfill

* Update node-fetch.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-07 16:58:48 -08:00
Jarred Sumner
b52e503ce4 Fixes #6973 (#6975)
Fixes #6973

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-07 16:42:25 -08:00
cirospaciari
e581f732d7 callback instead of trhowing 2023-11-08 00:21:24 +01:00
cirospaciari
c939ec1544 change sinon version to match jsonwebtoken tests 2023-11-08 00:21:24 +01:00
cirospaciari
a2f2ed5411 less flasky test utils 2023-11-08 00:21:24 +01:00
cirospaciari
55f636ffb8 fix reference error 2023-11-08 00:21:24 +01:00
cirospaciari
cbba20804e revert 2023-11-08 00:19:49 +01:00
cirospaciari
91c2edc0f2 really fix 2023-11-08 00:19:49 +01:00
cirospaciari
09a4d864da better test name 2023-11-08 00:19:49 +01:00
cirospaciari
11e7937c3c cleanup 2023-11-08 00:19:49 +01:00
cirospaciari
22a7e3a310 clean read before handshake 2023-11-08 00:19:49 +01:00
Jarred Sumner
4fbde727d2 Revert d1244c8b1f
This fixes #6954 and adds a test. `DOMAttribute` ensures the `this` value of getters are always set.
2023-11-07 04:22:44 -08:00
Jarred Sumner
990ca9cb9d the real fix 2023-11-07 13:19:58 +01:00
Jarred Sumner
21e32c042e Speculative fix for #6951 2023-11-07 13:19:58 +01:00
Dylan Conway
d85bd49d87 remove error 2023-11-07 07:55:01 +01:00
Dylan Conway
c0853959c2 cleanup tests 2023-11-07 07:55:01 +01:00
Dylan Conway
fef7920b17 Revert "split('||'), fix up tests"
This reverts commit 5fd09153cd.
2023-11-07 07:55:01 +01:00
Dylan Conway
b5a04827e1 split('||'), fix up tests 2023-11-07 07:55:01 +01:00
Dylan Conway
bb5d6fff77 count might be zero for alias 2023-11-07 07:55:01 +01:00
Dylan Conway
8d3a0ddd47 another test 2023-11-07 07:55:01 +01:00
Dylan Conway
75aa963fef test for invalid version 2023-11-07 07:55:01 +01:00
Dylan Conway
b0126b5962 remove &, mark skip tests as todo 2023-11-07 07:55:01 +01:00
Dylan Conway
a7251047b7 allow no spaces 2023-11-07 07:55:01 +01:00
Dylan Conway
2f301e8404 skip tags in version ranges 2023-11-07 07:55:01 +01:00
Jarred Sumner
3fae8933e5 Bump 2023-11-06 21:41:47 -08:00
Jarred Sumner
c3a7b574c8 Update sys.zig (#6942)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-06 18:05:46 -08:00
Paul Baumgart
fa25d60df8 fix: remove stray semicolon that causes sqlite3_compileoption_used to always return true on Mac (#6941) 2023-11-06 16:52:40 -08:00
Liz
8130d9f3e1 fix: correctly prepend system path to relative urls on pathToFileURL (#6472)
* fix: correctly prepend system path to relative urls on `pathToFileURL`

The `pathToFileURL` was not handling the case that when a relative link is passed,
it should convert it to a absolute url and prepend the top_folder,
or otherwise described, resolve the path before creating the url.

This does that by calling into buns Path api and using its `resolve` function.

Theres the detail that i used preprocessor directives to determine whether
we are on windows because there does not seam to be a easy way to get that
at runtime in the `BunObject.cpp` file.

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

* fix: add issue id to test name

* fix: implement changes requested in review

* style: fix styling

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

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

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

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-11-06 13:57:25 -08:00
Jarred Sumner
3ba9647858 Fix a couple bugs with node:http (#6924)
* Update to latest SIMDUTF

* Fix issue with `Headers.toJSON` having an incorrect size set with set-cookie header

* [node:http] Fix `undefined` when multiple Set-Cookie headers are sent

* Count UTF8 byteLength for headers

This is not necessary, just being cautious.

* Update http-hello.node.mjs

* Be 100% sure the test isn't caching anything

* move this up

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-06 03:51:49 -08:00
Jarred Sumner
c77c6ea53e Update settings.json 2023-11-05 03:35:20 -08:00
Jarred Sumner
98f20170a3 Add more tests for Bun.spawn lifecycle and address edgecase (#6904)
* FIxup spawn ref / unref

* Fix test failures

* Add test for #3480

* windows

* 🪟

* Skip on linux

* Fix test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-05 00:00:19 -07:00
Jarred Sumner
e954bce301 Fix test 2023-11-04 16:19:38 -07:00
Jarred Sumner
8554683297 Fix build 2023-11-04 16:11:42 -07:00
Dylan Conway
5d1a7d8d5a Spawn ref count (#6890)
* fix(Bun.spawn): Fix integer overflow from unref()

* rewite

* has disable flag

* tests

* packed

* remove comments

* make tests more smarter

* unref

* another test

* kevent timeout 0

* possibly fix MacOS x64 baseline action

---------

Co-authored-by: dave caruso <me@paperdave.net>
2023-11-04 15:21:37 -07:00
dave caruso
39101d16c3 fix: baseline+linux arm64 builds (#6873)
* Fix the linux aarch64 workflow.

* sanity check

* do not set march to native

* fix windows compile error

* enable verbose

* fix baseline builds

* fix windows build canary flags

* use a real windows runner

* w
2023-11-03 21:35:52 -07:00
Jarred Sumner
e7a83ad70e Fix edgecase from eeb3f7be18 (#6870)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-03 02:58:57 -07:00
Dylan Conway
142cdf1714 more install tests (#6867)
* some tests

* Apply suggestions from code review

* Update src/install/install.zig

* `zig fmt`

* Update install.zig

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-03 02:37:03 -07:00
Jarred Sumner
2d4011b22f Fix clang warnings in usockets
cc @cirospaciari
2023-11-02 23:53:09 -07:00
Dylan Conway
eeb3f7be18 fix jsx key parse and visit order (#6866)
* jsx key parse and visit order

* only use index

* fix underflow

* oops

* tests
2023-11-02 22:56:40 -07:00
dave caruso
12272bb527 ci: publish workflow to gh releases 2023-11-02 22:47:49 -07:00
dave caruso
4403c40755 chore: build and publish canary windows builds (#6834)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-11-02 22:40:00 -07:00
Dylan Conway
2a405f691e fix #6831 (#6859)
* latin1 zigstring

* skip check
2023-11-02 15:55:54 -07:00
Jarred Sumner
75393e02b8 Fix assertion 2023-11-02 15:46:18 -07:00
Jarred Sumner
e646853d7a Fix assertion failure 2023-11-02 15:15:16 -07:00
Liz
3912f4d064 fix(build): add option and auto detect for arch linux (#6835)
* fix(build): add option and auto detect for arch linux

This adds a option and a automatic routine for decting arch linux,
where the path for libatomic is a bit special.

* fix: don't statically link if not needed
2023-10-31 23:21:45 -07:00
dave caruso
53d1acb0a5 chore: build system improvements (#6811)
* build system improvements

* public the secret download link

* typo

* i think i fixed it

* fix ci

* un-bump the cmake version
2023-10-31 17:25:13 -07:00
マルコメ
23d2c4c8e4 workflows(bun-mac-x64.yml): Fix typo "bun-obj-darwin-x6" (#6819) 2023-10-31 09:47:16 -07:00
Anton Golub
732650d6a4 fix: provide nodejs compat for dns methods wrapped with util.promisify (#6748)
* fix: add nodejs compat for dns methods wrapping with util.promisify

* fix: use single symbol for util.promisify.custom

* style: linting
2023-10-30 23:54:48 -07:00
Jarred Sumner
b29d68bbaf Fix memory leak in require (#6790)
* Fix memory leak in require() and add test

* Mark fixtures as generated code

* Add optimization for large files

* Fix small memory leak

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-30 23:54:02 -07:00
Kerem Kat
715be35764 Fix 6281 (#6809)
* throw an error when `Script` is called without new

fix https://github.com/oven-sh/bun/issues/6281

* fix typo in `File` without constructor error

fix https://github.com/oven-sh/bun/issues/6281
2023-10-30 23:05:32 -07:00
Dylan Conway
e259056bd8 peer dependency and semver prerelease bug fixes (#6814)
* `order` and `satisfy` prerelease numbers

* remove sorter

* use existing package for peer dep if possible

* fix test, remove loop

* count workspace versions, compare each part of prerelease

* other peer dependencies

* use existing packages if possible

* don't install peer more than once

* fix update tests
2023-10-30 23:04:47 -07:00
Kerem Kat
68146d0544 Fix minify-whitespace case undefined (#6808)
Print a space before `undefined` in `printUndefined`.

fix https://github.com/oven-sh/bun/issues/6750
2023-10-30 16:15:45 -07:00
Dylan Conway
7e09c7ca1e format 2023-10-30 16:09:34 -07:00
Ciro Spaciari
4d780837ac fix(fetch) (#6672)
* fix fetch

* oops

* revert

* fix checkServerIdentity

* check dns len

* use same checks on wsclient and fetch, fix tests

* more tests and more fixes

* fix node-http flask test

* orelse

* fix requestCert

* more fixes, but no data receiving

* fix pause on connect behavior on TLS

* WS Client + rejectUnauthorized progress

* move test to the right place

* more test

* oops

* oops 2

* fmt

* cleanup

* WIP: handle handshake properly on uWS

* handle rejectUnauthorized in uWS

* fmt

* duplicated test

* fix leak

* add rejectUnauthorized option in WS types

* fix merge

* fix merge2
2023-10-30 12:56:31 -07:00
IAS
cbc5ca770b fix: Macro segmentation faults (#6756)
* Fix for seg faults when using macros

* Update src/js_ast.zig to reflect review suggestions

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

* add test for checking non-zero exitcodes under macros. regression, issue 3830

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-10-30 12:36:38 -07:00
Jarred Sumner
2972cfadfb More resilient test for fetch body memory leak (#6794)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-30 12:35:55 -07:00
Jarred Sumner
6be17538e7 Fix flaky test 2023-10-30 02:01:29 -07:00
Liz
e5ccce1e89 feat(console): add printer for mapiterator (#6778)
* feat(console): add printer for mapiterator

MapIterator was not supported in printing, libraries like discordjs make big use of maps and
so i think supporting them would be a good idea.

* fix: snake case var

* fix: add tests for log and add setiterator printer
2023-10-30 01:29:25 -07:00
Rohit Kaushal
08fdbb3c7d [docs] fix ws/pubsub; closed ws don't publish to topic (#6739) 2023-10-30 00:07:50 -07:00
Hanaasagi
8880bf1026 fix(node:buffer): fix Buffer.readUintBE (#6770)
Close: #6759
2023-10-30 00:07:27 -07:00
Ross Martin
d7cb7884c3 Update contributing.md (#6787)
Adding ruby as a dev dependency to Arch list
2023-10-29 18:07:00 -07:00
Samuel Batista
bb19677ae4 docs(contributing) add ruby dependency (#6788)
Don't know why ruby is required to build bun, but without it `bun setup` fails.
2023-10-29 18:06:40 -07:00
Smoothieewastaken
a7a74b73f2 docs: spelling of necessarily (#6772) 2023-10-29 06:34:54 -07:00
perpetualsquid
e4394ef5cc Fixed broken link in deflatesync section (#6774)
* Fixed broken link in deflatesync section

* fixed link

* fixed link
2023-10-29 06:34:35 -07:00
Omar
e4e811d0a7 fix: remove extra parenthesis (#6775) 2023-10-29 06:34:19 -07:00
Jarred Sumner
6851a57ebd Update nodejs-apis.md 2023-10-28 20:17:20 -07:00
dave caruso
3b25c8637b dx: Fix setup script and contributing docs (#6752)
* Updated Dependencies Script

* demo

* fix submodule hell!!!

* lol

* attmept 2

* install nasm in ci

* setup sh 1

* yeah

* better zlib building

* codegen stuff

* attempt 2 at bun codegen ci

* o

* deps improvements

* generaet part of compile-cpp-only.ps1

* restore these

* good enough for Unix

* remove libuv submodule lol

* pass over docs
2023-10-28 04:46:56 -07:00
Jarred Sumner
d1244c8b1f Remove unnecessary DOMAttribute annotation
Preparation for https://github.com/WebKit/WebKit/pull/19606
2023-10-27 22:00:29 -07:00
Rohan Mayya
d1a7bb4a69 add cache and main (#6679) 2023-10-27 11:26:59 -07:00
Darshan Sen
a0bd8365da docs: fix setup.sh path in contributing.md (#6745)
It was added in https://github.com/oven-sh/bun/pull/4410. The `src`
directory is not supposed to be a part of the path.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
2023-10-27 04:08:37 -07:00
Jarred Sumner
16a0801058 Format cmakelists + increase stack size 2023-10-27 04:01:06 -07:00
Jarred Sumner
c4156376d9 Fix debug log 2023-10-27 04:01:05 -07:00
dave caruso
4ff54139b7 fix(ci): typo 2023-10-27 03:20:44 -07:00
Jarred Sumner
8d2e0725e7 Fix fallback to copyfile 2023-10-27 02:36:10 -07:00
Jarred Sumner
700f932ddf Fix warning 2023-10-27 02:20:51 -07:00
Jarred Sumner
7485c7c7cb feat: Windows + CMake Build System (#4410)
* Prepare for windows event loop

* More progress

* Update libuv.zig

* wip

* Make compiling each dependency a shell script

* Bump mimalloc

* Add the build scripts

* Update settings.json

* Fix a bunch of compiler warnings

* Remove more warnings

* more warnings

* cmake works

* Update JSSQLStatement.h

* put it in the zig file

* Fix usockets warnings

* Fixup

* Fix one of the compiler errors

* chunk

* draw the rest of the owl

* theres more

* Rename Process -> BunProcess

Works around a Windows issue

* Add musl polyfill for memmem on Windows

* More

* 12 mb

* Fix getenvZ

* fix variosu issues

* Add fast-ish path for bun install on Windows

* Update windows.zig

* Update windows.zig

* Fix build issue

* it works

* hmmm

* Rename file

* Fixups

* Update wtf-bindings.cpp

* Update src/bun.js/bindings/headers-handwritten.h

Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>

* further!

* more

* Update .gitignore

* hm

* quite a lot of fixes

* Update CMakeLists.txt

* zig fmt

* Many more things are starting to work.

* reb

* regenaret

* Update JSSink.h

* fixup

* fetch works

* Bun.serve() and much of the event loop works now

* Make require() work

* bun install progress

* more things work

* use less std.os

* Fixes

* small fixes

* Bump

* Bummp

* Undo that change

* We have to bump the version of Debian because libarchive has a higher minimum requirement

* ok

* some clenaup

* windows

* Update bun.zig

* fixup

* avoid duplicate symbols

* avoid undefined symbols

* bump

* Remove issue template for install

It's not used, and use the bug issue instead.

* Add types for cp and cpSync

* Add types for watchFile and unwatchFile

* Add bun-types to 'bun fmt' script

* Update nodejs compat docs cp/cpSync/watchFile/unwatchFile (#4525)

* feat(fetch) rejectUnauthorized and checkServerIdentity (#4514)

* enable root certs on fetch

* rebase

* fix lookup

* some fixes and improvements

* fmt

* more fixes

* more fixes

* check detached onHandshake

* fix promise case

* fix cert non-Native

* add fetch tls tests

* more one test

* churn

* Update feature_flags.zig

* Update response.zig

* Revert "avoid undefined symbols"

This reverts commit ca835b726f.

* Revert "avoid duplicate symbols"

This reverts commit 4ac6ca8700.

* Update feature_flags.zig

* Set permissions

* more

* Update mimalloc

* Fix sqlite test failures

* Fix some test failures

* Make sure we remove libusockets is removed

* hm

* [dave]: fix webcrypto crash

* bump

* Update index.ts

* windows zig compiles

* cmake on mac works

* progress

* yay

* bun run build

* fix

* ok

* oops

* asdfasfdafdsafda

* fghjkl

* git ignore

* wow

* Process -> BunProcess

* hmm

* blah

* finalize merge

* now it only has linker errors on mac

* sdfadsf

* g

* getting farther

* sxdcvbnmk,

* adfhjskfjdhkas

* a

* fgh

* update build dot zig

* asdfg

* theoretical -DCANARY flag we can use

* asdf

* cool

* okay

* colorterm

* New build workflow

* Fix script

* Use sudo

* More sudo

* Tweak dependencies

* Another sudo attempt

* Tweak script

* 16.0 -> 16

* Tweak script

* Tweak script

* Tweak script

* Tweak script

* Tweak script

* bun install

* ssh into github actions

* add more to ssh

* Fix postinstal

* Skip llvm

* New dockerfile

* Build

* More changes to Dockerfile

* chaos chaos chaos

* okay

* a

* more cmake nonsense

* add unified sources code (does not work)

* stuff

* prepare for CI builds

* ok

* yay

* yeah

* make this more stable simply by trying again if it fails, 5 times, then lose. it fixes the stability issue i was running into L O L

* messing with ci

* x

* a

* clean dependencies before build

* oops

* this is not going to work but its closer

* not gonna work either

* a

* a

* did i do it

* a

* a

* work around weird fs+Bun.build issues

* properly pass debug flag correctly

* idk im sorry

* lose

* maybe

* run the tests please

* a

* fix zlib script

* a

* hi

* prevent stupid ci issue

* i totally didnt leave in a syntax error on cmakelists

* a

* lol

* relax

* 😭

* a

* SO SILLY

* 😡 one line mistake

* one character diff

* fix linking symbols missing

* work on dependency scripts

* does this work now?

* fix mac build

* a

* bump!

* woops

* add macos baseline build

* .

* fix sqlite and also enable $assert/$debug support in builtin functions

* okay

* oops

* zig upgrade lol

* Merge

* Fix spawn test issue

* Set a timeout

* yeah

* etc

* mi

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Birk Skyum <74932975+birkskyum@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
2023-10-27 01:51:56 -07:00
Jarred Sumner
46a337cbc8 Fix running Bun.spawn on Vercel and GCP (#6724)
* Fix running `Bun.spawn` on Vercel and GCP

* Update subprocess.zig

* Deflake test

* Update spawn-streaming-stdout.test.ts

* Fix tests + cleanup

* Fix hang

* Handle edgecase

* Update subprocess.zig

* Update subprocess.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-27 00:03:03 -07:00
Colin McDonnell
58d9a0d770 Add EdgeDB guide 2023-10-26 17:28:57 -07:00
Liz
8f42d8c2dd fix: emit close on stdin stream end (#6720)
* fix: emit close on stdin stream end

We where not emitting the `close` event when done reading stdin data.
It took me way too long to find this but i kept searching in zig/cpp code of the stream implementations...

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

* fix: don't emit close twice
2023-10-26 17:00:37 -07:00
Hanaasagi
b5fb980145 fix(requestIP): fix type cast from binary to text format for IPv4. (#6725)
* fix(requestIP): fix type cast from binary to text format for IPv4.
Close: #6668

* use ares_inet_ntop
2023-10-26 12:31:53 -03:00
Jarred Sumner
2b8aae05d1 Add test for custom thenables in AsyncLocalStorage and fix flaky test and make expect(fn).toThrow drain unhandled promise rejections (#6701)
* Copy Node.js test for async-local-storage thenables

* Fix flaky test

* Make expect(fn).toThrow() more reliable

* Fix setImmediate order

* Support restoring mocked modules with spyOn

* Fix vm test

* Fix more tests

* alright

* Upgrade WebKit

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-25 22:35:14 -07:00
Susheel Thapa
2327737b14 docs: fixed typo in guides, install and runtime folder (#6718) 2023-10-25 18:27:05 -07:00
Pierre CM
58ce044607 fix cli create from local template (#6670)
* fix #4766

* fix cli create command for local folders

* zig fmt

* rm comment
2023-10-25 16:54:36 -07:00
Jasper Kelder
85bde43c2f fix bun add drizzle to bun add drizzle-orm (#6703) 2023-10-25 12:55:16 -07:00
Colin McDonnell
4fb5ab0ca8 Update drizzle guide 2023-10-25 12:52:15 -07:00
Colin McDonnell
c275cecfd1 Updates to drizzle 2023-10-25 12:16:59 -07:00
Jarred Sumner
6a2768f247 Implement mock.module in bun:test (#6685)
* Implement Module Mocks

* Update javascript.zig

* Add test for spyOn + ESM namespace

* Bump WebKit

* Bump WebKit

* Drain microtasks at end of test executions

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-25 02:59:47 -07:00
Jarred Sumner
7bcf60324a Fix setTimeout(() => {}, 0) and align setImmediate behavior with Node.js (#6674)
* Fix setTimeout(() => {}, 0)

* Align `setImmediate` with Node.js

* Update event_loop.zig

* Update test

* use Bun.sleep

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-25 02:59:29 -07:00
dave caruso
c700a70872 fix(runtime): remove env variable limit (#6697)
* fix env limit

* test
2023-10-24 20:11:06 -07:00
Colin McDonnell
ce4e1894f6 Remove unnecessary line 2023-10-24 18:48:07 -07:00
Colin McDonnell
f60167c015 Add Drizzle guide (#6698)
* Add drizzle guide

* Add Drizzle guide

* Tweak
2023-10-24 18:28:39 -07:00
Dylan Conway
042a6cdbce Update worker_threads.test.ts 2023-10-24 17:07:48 -07:00
Jérôme Benoit
85a0d71c52 fix(worker_threads): off by one on threadId (#6671)
* fix(worker_threads): off by one on threadId

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: refine worker_threads threadId consistency test

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: improve worker_threads tests

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: fix worker_threads threadId consistency test

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: simplify worker_threads threadId consistency test

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: refine worker_threads threadId consistency test

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>

* refactor: cleanup import on worker_threads tests

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: switch worker_threads worker to TS

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: revert wrong refactoring

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: format

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: port worker_threads worker to ESM

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: cleanup worker_threads test

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: improve worker_threads coverage

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>

---------

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
2023-10-24 17:05:22 -07:00
Dylan Conway
fa1bbec023 Update bun-install.test.ts 2023-10-24 13:18:51 -07:00
nxzq
1496681297 Update workspaces.md (#6673) 2023-10-23 23:16:42 -07:00
Liz
3906d17165 add new repo (#6676) 2023-10-23 23:16:13 -07:00
Yam Borodetsky
f297b95436 docs: fix react.md typos (#6656)
* docs: fix react.md typos

* docs: fix one more typo
2023-10-23 13:48:45 -07:00
Jarred Sumner
fafd9368f5 Backport uWS & usockets changes (#6649)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-22 13:44:08 -07:00
Ai Hoshino
1836ecd2ed fix(node:buffer): fix Buffer.write stuck (#6651) 2023-10-22 13:42:05 -07:00
Jarred Sumner
4cdaabd433 Dump as json 2023-10-21 16:27:11 -07:00
Jarred Sumner
4a74a46780 Add require builtins snippet 2023-10-21 16:18:18 -07:00
Dylan Conway
b62c010e95 fix bun link in workspace package (#6631)
* link workspace package

* add test

* more complete test
2023-10-20 22:38:46 -07:00
Pedro Nogueira
074534b292 revert: back the test/README.md file (#6626)
Co-authored-by: pedromdsn <pedromdsn@hotmail.com>
2023-10-20 16:38:06 -07:00
Dylan Conway
b0393fba62 Update InternalModuleRegistryConstants.h 2023-10-20 14:15:05 -07:00
Dmitry Nourell
7166fe10b5 Fixes IV calculation for AES-GCM mode (#6590)
* fix(crypto): fix the error in IV calculation for AES-GCM mode

* chore(crypto): add basic unit tests for Cipher & Decipher
2023-10-20 14:01:58 -07:00
chandi Langecker
2890ad53c4 fix(napi): incorrect refCount with napi_wrap() (#6598)
while trying to get [`node-usb`](https://github.com/node-usb/node-usb) running with bun, it always failed because close() is only allowed when there are no open references.

7e0182df8c/src/node_usb.h (L39-L41)
```c++
    inline void ref(){ refs_ = Ref();}
    inline void unref(){ refs_ = Unref();}
    inline bool canClose(){return refs_ == 0;}
```

`Ref()` and `Unref()` are both called once, with node.js resulting in `refs_ == 0` (which is expected), but with bun `refs_ == 1`.

I've made this small script to reproduce the bug:
https://github.com/alangecker/bun-ref-bug/blob/main/binding.cc
```
run with bun 1.0.6:
 - refcount: 2 (expected: 1)
run with node 20.8.1:
 - refcount: 1 (expected: 1)
```

during a long debugging journey I found out, that buns `NapiRef::ref()` is also just called once (as expected), but within `napi_wrap()` the `NapiRef` gets initialized already with the refCount set to 1

378385ba60/src/bun.js/bindings/napi.cpp (L669)
```c++
extern "C" napi_status napi_wrap(napi_env env,
    napi_value js_object,
    void* native_object,
    napi_finalize finalize_cb,
    void* finalize_hint,
    napi_ref* result)
{
    // [...]
    auto* ref = new NapiRef(globalObject, 1);
    // [...]
}
```

After changing it to `new NapiRef(globalObject, 0)` it got the expected behavior / same as with node.js and node-usb works.
as far as I understand it, a `NapiRef`` with refCount=0 should then be weak instead of strong, which is why I have changed this too.
2023-10-20 13:02:35 -07:00
Paula Burghelea
01e3474600 Update quickstart.md - removed the part for editing compilerOptions… (#6620)
* Update quickstart.md - removed the part for editing `compilerOptions` in `tsconfig.json`

The line is already added to `compilerOptions` in `tsconfig.json` so there is no need to edit the file.

    "types": [
      "bun-types" // add Bun global
    ]

This was already added when the project initialized it seems.

* Typescript section

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-10-20 11:26:19 -07:00
Jarred Sumner
756eee087a Sort list of dependencies and fix test (#6616)
* fix findBestMatch so it finds the best match and not the first match

* update complex-workspaces to include lines-and-columns ^1.1.6

* PR feedback

* PR feedback

* This test doesn't reproduce the original issue

* Support pre release versions the same way

* Add a test that reproduces the original issue

* Sort the list of package versions before serializing to disk

* Remove test that didnt reproduce it

* Fix the count

* Fix 0 and 1 and sorting order

* Fix assertions and ordering

---------

Co-authored-by: Dylan Greene <dgreene@medallia.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-20 03:55:40 -07:00
Dylan Conway
4b2cdc4fc1 respect optional peer dependencies and update docs (#6615)
* update docs

* optional peer dependencies

* rename offset variable name, cache invalidation time

* Update install.zig

* install more peer dependencies
2023-10-20 03:27:10 -07:00
Dylan Greene
184528e4eb fix findBestMatch so it finds the best match and not the first match (#6611)
* fix findBestMatch so it finds the best match and not the first match

* update complex-workspaces to include lines-and-columns ^1.1.6

* PR feedback

* PR feedback
2023-10-20 02:18:37 -07:00
Jarred Sumner
8cf7d6157a Fix missing function names in console.log and Bun.inspect (#6612)
* Fix missing function names in Bun.inspect

* Fix failing tests

* Handle @@toStringTag

* Update bindings.cpp

* Revert breaking changes to snapshots until a minor version

* Fix test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-19 22:38:05 -07:00
Vladimir Vlach
68324daf78 String response for lambda function - no need to strinfigy string (#6208) 2023-10-19 22:27:36 -07:00
Liz
66debb1ce4 fix: support custom file type in Bun.file (#6512)
* fix: support custom file type in Bun.file

In the docs it seamed to suggest this is something supported,
it seamed to be only supported in JSDOMFiles or blob.
This Adds the 2 properties `type` and `lastModified` to be supported on `Bun.file`

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

* fix: implement changes requested in review

Add changes requested in the review and add a test for a non standard
mimetype
2023-10-19 22:26:27 -07:00
Ashcon Partovi
d5d9fc4684 Fix websocket upgrade (#6564)
* Remove ancient changelog

* Fix `Host` header excluding port in WebSocket upgrade

* `byteSlice()`

* Revert `byteSlice()`
2023-10-19 22:24:45 -07:00
Liz
f6b694ee2c fix(install): dont replace git urls when already present (#6607)
* fix: dont replace git urls when already present

* fix: set request e_string

* test: add test for git url duplication
2023-10-19 21:28:59 -07:00
Dylan Conway
bb623196a3 fix install add (#6609)
* fix add package

* update test

* initWithCLI once

* skip searching for workspaces if package json was created
2023-10-19 19:17:38 -07:00
nygma
e9948f1291 Add append content to a file guide (#6581)
* Add append content guide

Resolve #6559

* Update guide

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-10-19 17:29:31 -07:00
Jarred Sumner
378385ba60 Bump Zig 2023-10-19 00:19:21 -07:00
Ai Hoshino
ef5930e8bc fix(serve): When IPv6 is not enabled, attempt to bind to IPv4 address under the same hostname. (#6533)
* fix(serve): When IPv6 configuration is incorrect, attempt to bind to IPv4 address under the same hostname.
Close: #5315

* fix review

* fix review again

---------

Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2023-10-18 17:40:26 -07:00
Ai Hoshino
0173571b19 fix(node:buffer): fix the behavior of totalLength in Buffer.concat (#6574)
* fix(node:buffer): fix the behavior of `totalLength` in `Buffer.concat`
Close: #6570
Close: #3639

* fix buffer totalLength type

---------

Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2023-10-18 14:30:53 -07:00
Dawid Sowa
35259c0c1d fix: change --no-scripts to --ignore-scripts (#6587) 2023-10-18 14:00:04 -07:00
Mountain/\Ash
e7cba822e4 fix: online docs moved (#6579) 2023-10-18 12:57:46 -07:00
Kevin Latka
0d34e7a141 Fix minimum kernel version in docs (#6153)
* Fix minimum kernel version in docs

* Update install.md

* Update install.md

* Update install.md

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-10-18 11:49:09 -07:00
Dylan Conway
aedc8c0ead build-id++ 2023-10-18 11:02:44 -07:00
Liz
9c0cd5c030 fix(web): stub performance.getEntriesByName (#6542) 2023-10-18 10:04:45 -07:00
Dylan Conway
2f10398c74 update root package variable 2023-10-17 23:10:10 -07:00
Ashcon Partovi
49ef5bccec Fix missing {port: 0} causing flaky test 2023-10-17 21:23:13 -07:00
Dylan Conway
dcbcf9803a test changes in usockets in ci 2023-10-17 19:38:13 -07:00
Pierre CM
e731eff382 fix #4766 (#6563) 2023-10-17 16:56:27 -07:00
Dylan Conway
a57d7ecb5b Update ZigGeneratedClasses.cpp 2023-10-17 16:46:31 -07:00
Dylan Conway
d187563d36 use npm alias in dependencies (#6545)
* aliased package in dependencies

* other buf

* make sure version works

* make sure overrides don't override alias

* tests

* update

* comments
2023-10-17 16:34:03 -07:00
Ai Hoshino
e91436e524 fix(node:http): fix server.address() (#6442)
Closes #6413, #5850
2023-10-17 13:18:14 -07:00
Aral Roca Gomez
bbc2e96090 docs: fix ws.publish (#6558)
In this example there is no server variable in the context, and here it makes more sense to use ws.publish. It is explained below that once the serve is done, the server.publish can be used.
2023-10-17 09:23:10 -07:00
Mikhail
f53eb7cd59 perf(bun-types): remove needless some call (#6550) 2023-10-17 08:59:05 -07:00
dave caruso
98d19fa624 fix(runtime): make some things more stable (partial jsc debug build) (#5881)
* make our debug assertions work

* install bun-webkit-debug

* more progress

* ok

* progress...

* more debug build stuff

* ok

* a

* asdfghjkl

* fix(runtime): fix bad assertion failure in JSBufferList

* ok

* stuff

* upgrade webkit

* Update src/bun.js/bindings/JSDOMWrapperCache.h

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

* fix message for colin's changes

* okay

* fix cjs prototype

* implement mainModule

* i think this fixes it all

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-10-16 21:22:43 -07:00
dave caruso
a3958190e8 fix(runtime): improve IPC reliability + organization pass on that code (#6475)
* dfghj

* Handle messages that did not finish

* tidy

* ok

* a

* Merge remote-tracking branch 'origin/main' into dave/ipc-fixes

* test failures

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-10-16 20:01:24 -07:00
Mikhail
6504bfef74 Simplify getting Set of extentions (#4975) 2023-10-16 17:16:10 -07:00
Ashcon Partovi
220cb0eb94 Fix formatting 2023-10-16 17:11:04 -07:00
Igor Shapiro
01e04e3341 fix(test): when tests run with --only the nested describe blocks `.on… (#5616) 2023-10-16 16:33:02 -07:00
Yannik Schröder
0853e19f53 perf(node:events): optimize emit(...) function (#5485) 2023-10-16 16:18:40 -07:00
Liz
a9b8e3ecc8 fix: don't remove content-encoding header from header table (#5743)
Closes #5668
2023-10-16 16:11:44 -07:00
Hugo Galan
bec6161dce fix(sqlite) Insert .all() does not return an array #5872 (#5946)
* fixing #5872

* removing useless comment
2023-10-16 16:08:58 -07:00
Ashcon Partovi
8c580e6764 Fix formatting 2023-10-16 16:02:11 -07:00
Chris Toshok
c5354951ba Fix Response.statusText (#6151) 2023-10-16 15:57:16 -07:00
Nicolae-Rares Ailincai
f1658e2e58 fix-subprocess-argument-missing (#6407)
* fix-subprocess-argument-missing

* fix-tests

* nitpick, these should === not just be undefined

---------

Co-authored-by: dave caruso <me@paperdave.net>
2023-10-16 15:31:14 -07:00
Voldemat
90d7f33522 Add type parameter to expect (#6128) 2023-10-16 15:24:56 -07:00
Jérôme Benoit
d9c0273421 fix(node:worker_threads): ensure threadId property is exposed on worker_threads instance (#6521)
* fix: ensure threadId property is exposed on worker_threads instance

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* fix: rename lazy worker_threads module properties

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* fix: add getter for threadId

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: improve worker_threads UTs

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: fix lazy loading

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: fix worker_threads test

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>

* fix: return the worker threadId

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>

* test: refine worker_threads expectation on threadId

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>

---------

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
2023-10-16 15:19:38 -07:00
Ashcon Partovi
d65b1fd80b Fix use before define bug in sqlite
Fixes #6481
2023-10-16 15:14:15 -07:00
João Alisson
7becb5ec74 fix(jest): fix toStrictEqual on same URLs (#6528)
Fixes #6492
2023-10-16 15:14:15 -07:00
Ashcon Partovi
c3f5baa091 Fix toHaveBeenCalled having wrong error signature
Fixes #6527
2023-10-16 15:14:15 -07:00
Ashcon Partovi
800ad150ff Fix formatting 2023-10-16 15:14:15 -07:00
Ashcon Partovi
5608e59270 Add reusePort to Bun.serve types 2023-10-16 15:14:15 -07:00
Ashcon Partovi
e31ed84b1b Fix request.url having incorrect port
Fixes #6443
2023-10-16 15:14:15 -07:00
Ashcon Partovi
548b1d02f2 Remove uWebSockets header from Bun.serve responses 2023-10-16 15:14:15 -07:00
Ashcon Partovi
f63955a01f Rename some tests 2023-10-16 15:14:15 -07:00
Ashcon Partovi
2996ef7156 Fix #6467 2023-10-16 15:14:15 -07:00
Dylan Conway
2b1f3438e6 Update InternalModuleRegistryConstants.h 2023-10-16 14:21:39 -07:00
Colin McDonnell
2a8f3a3b4e Development -> Contributing (#6538)
Co-authored-by: Colin McDonnell <colin@KennyM1.local>
2023-10-16 16:11:03 -04:00
Ciro Spaciari
a87aa2fafe fix(net/tls) fix pg hang on end + hanging on query (#6487)
* fix pg hang on end + hanging on query

* remove dummy function

* fix node-stream

* add test

* fix test

* return error in test

* fix test use once instead of on

* fix OOM

* generated

* 💅

* 💅
2023-10-14 16:16:49 -07:00
Dylan Conway
9b5e66453b fix installing dependencies that match workspace versions (#6494)
* check if dependency matches workspace version

* test

* Update lockfile.zig

* set resolution to workspace package id
2023-10-13 20:37:48 -07:00
Dylan Conway
46f978838d fix lockfile struct padding (#6495)
* integrity padding

* error message for bytes at end of struct
2023-10-13 20:37:06 -07:00
Nicolae-Rares Ailincai
21576589c6 Guide to containerize a bun application using Docker (#6478)
* docker.md

* use-debian

* Updates

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-10-13 18:03:32 -07:00
Jarred Sumner
d7062eb367 [node:dns] Fix unnecessary array creation + prettier 2023-10-13 17:57:43 -07:00
João Alisson
851dc9aadc fix(node): dns lookup deprecated behavior (#6391)
Co-authored-by: alisson <alisson@Ubuntu.myguest.virtualbox.org>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-10-13 17:52:57 -07:00
Ai Hoshino
d08e112d41 fix(error): correct the path field in syscall error message. (#6370)
* fix(error): correct the `path` field in syscall error message.
Close: #6336

* fix pathlike union case
2023-10-13 17:51:36 -07:00
Ashcon Partovi
77d7e47019 Fix dns.lookup returning wrong address for family (#6474)
* Fix #6452

* Fix formatting
2023-10-13 17:47:05 -07:00
Dylan Conway
1bad64bc5e Update settings.json 2023-10-13 16:29:06 -07:00
Nicolae-Rares Ailincai
0794767291 Adds systemd guide to run a bun application as a daemon (#6451)
* systemd-guide

* remove-root-from-example

* add-more-description

* Updates

* Updates

* Updates

* Update

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-10-13 11:14:57 -07:00
Clay Curry
d7c8a58453 fix obvious typo in CONTRIBUTING.md (#6479)
Co-authored-by: Clay Curry <me@claycurry.com>
2023-10-13 09:33:44 -07:00
Colin McDonnell
4fab8fee21 Update descriptions 2023-10-12 23:19:53 -07:00
Colin McDonnell
3f2df4526e Fix links 2023-10-12 23:17:51 -07:00
Colin McDonnell
d6d4ead438 Tweaks to pm docs 2023-10-12 23:08:52 -07:00
Colin McDonnell
4e67862753 Add overrides/resolutions docs (#6476) 2023-10-12 23:05:20 -07:00
dave caruso
584e6dd1c2 Upgrade zig to 0.12.0-dev.888+130227491 (#6471)
* update build.zig

* save

* works?

* better workaround

* fix install

* Fix compiler crash
2023-10-12 19:38:33 -07:00
Dylan Conway
4bb753295d use a different package 2023-10-12 19:35:00 -07:00
Dylan Conway
892593c73b fix install test 2023-10-12 15:17:03 -07:00
Dylan Conway
691cf338c2 fix editing package json when adding github dependency (#6432)
* fix package name added to package json

* check for github tag

* remove alloc

* some tests

* fix test
2023-10-12 15:02:05 -07:00
Colin McDonnell
beb746e5ea Update installation.md 2023-10-12 14:12:53 -07:00
Colin McDonnell
89faee2522 Update installation.md 2023-10-12 13:43:45 -07:00
dave caruso
969da088f5 fix(install): re-evaluate overrides when removed 2023-10-12 02:03:02 -07:00
Luna
c50be68790 chore: add missing ending quote (#6436) 2023-10-12 01:00:27 -07:00
dave caruso
2fbb95142a feat(install): support npm overrides/yarn resolutions, one level deep only (#6435)
* disable zig fmt on generated ResolvedSourceTag.zig

* overrides

* it works

* ok

* a

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-10-12 00:44:15 -07:00
Dylan Conway
755e16d962 fix #6416 (#6430)
* make sure latest is checked after prerelease

* test and fix

* test for when latest matches prerelease
2023-10-11 20:41:12 -07:00
Jarred Sumner
b1063edf3e Bump WebKit 2023-10-11 20:04:15 -07:00
Jarred Sumner
edb4cbac2b Bump! 2023-10-11 19:05:52 -07:00
Dylan Conway
a59a69e21b Update JSCUSocketsLoopIntegration.cpp 2023-10-11 15:26:55 -07:00
Colin McDonnell
4c9e009971 Update installation.md 2023-10-11 14:31:39 -07:00
h2210316651
4531cf18c2 Docs : Added instructions to run bun apps in daemon (PM2) to address … (#5931)
* Docs : Added instructions to run bun apps in daemon (PM2) to address issue #4734

Added instructions to set bun as pm2 interpreter to extend same functionality as node.js apps.

* Add pm2 guide

* Add pm2 file

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-10-11 14:22:43 -07:00
Ashcon Partovi
31bda68f24 Update bun-release.yml 2023-10-11 12:05:16 -07:00
dave caruso
1bf28e0d77 feat(install): automatically migrate package-lock.json to bun.lockb (#6352)
* work so far

* stuff

* a

* basics work

* stuff

* yoo

* build lockfile

* correct

* f

* a

* install fixture havent tested

* i made it worse

* lol

* be more reasonable

* make the test easier to pass because bun install doesn't handle obscure lockfile edge cases :/

* a

* works now

* ok

* a

* a

* cool

* nah

* fix stuff

* l

* a

* idfk

* LAME

* prettier errors

* does this fix tests?

* Add more safety checks to Integrity

* Add another check

* More careful lifetime handling

* Fix linux debugger issue

* a

* tmp dir and snapshot test

---------

Co-authored-by: Jarred SUmner <jarred@jarredsumner.com>
2023-10-11 02:27:07 -07:00
Jarred Sumner
6a17ebe669 Update nodejs-apis.md 2023-10-11 01:59:56 -07:00
Arden Sinclair
39446ebdb8 Fix lifecycle scripts not running on reinstallation (#6376)
* Include trusted dependencies in lockfile

* Add a remote dependency to lifecycle script test
2023-10-10 21:13:42 -07:00
Elad Bezalel
c2c3b0d4a9 feat(test): implement toEqualIgnoringWhitespace (#6293)
* feat(test): implement `toEqualIgnoringWhitespace`

* equality check in matcher & incorrect arg error
2023-10-10 20:27:19 -07:00
saurabh
9a90d90966 fix: form data content type (#6380)
* fix: form data content type

* fix: condition if no extension for file
2023-10-10 20:08:32 -07:00
Dylan Conway
05781dd91e make peer dependencies install by default (#6396)
* peer dependencies

* default true

* add test

* cleanup

* some tests

* skip peer deps if they are non optional

* remove debug print, fix build

* iterate peer dependencies
2023-10-10 20:05:58 -07:00
Aaron Dewes
a6a474a83f Add File to binary data TOC (#6025) 2023-10-10 16:47:35 -07:00
cyfung1031
44dd744f0a docs: rearranged cli/runtime related sections (#6275)
* docs: rearranged cli/runtime related sections

* docs: update README.md for the updated docs path

* Updates

* Rearrange

* Rearrange

* Add files

* readme

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-10-10 16:34:35 -07:00
Ashcon Partovi
df4ec8aaad Update inspector-protocol 2023-10-10 16:14:46 -07:00
Ashcon Partovi
0348b169d6 Update debug-adapter-protocol 2023-10-10 16:14:46 -07:00
Vasilis Themelis
54dbf3ba21 Add missing ws declarations (#6307) 2023-10-10 15:39:20 -07:00
Clément P
5f09a4dd0a Update vite.md (#6399)
remove outdated information
2023-10-10 15:36:28 -07:00
Nicolae-Rares Ailincai
e58e85cd5c Documentation for the IPC of Bun.spawn (#6400)
* doc/ipc.md

* update/spawn.md

* improved-documentation-and-added-send-type

* Updates

* Updates

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-10-10 15:35:05 -07:00
Ciro Spaciari
6301778a58 fix(AbortSignal/fetch) fix AbortSignal.timeout, fetch lock behavior and fetch errors (#6390)
* fix abort signal and fetch error

* fix fetch error and lock behavior
2023-10-09 19:56:48 -07:00
Ashcon Partovi
3667b93871 Fix npm tag for canary bun-types, again 2023-10-09 12:14:26 -07:00
otterDeveloper
0a8aab6b23 Add Fedora build instructions to development.md (#6359) 2023-10-09 11:52:16 -07:00
babar
6a73f2b1e7 added commands (#6314)
added commands to install unzip package and to check Linux kernel version
2023-10-09 11:51:41 -07:00
TPLJ
99a78f8540 Update README.md (#6291)
fixed some minor documentation.
2023-10-09 11:50:08 -07:00
Michael Di Prisco
8d4b296bd2 docs: fixing a couple typos (#6331) 2023-10-09 11:48:07 -07:00
Liz
a9e1792607 fix: support uint8 exit code range (#6303)
The exit code support is between 0-255 and not only in the signed positive range
(0-127).
Node.js does not seam to throw on a bigger integer and just wraps around,
but throwing a error is a good approach and makes the behaviour more defined.

This allows the range to be 0-255

Fixes: https://github.com/oven-sh/bun/issues/6284
2023-10-09 11:47:38 -07:00
2hu
0965e6ddfd Fix array variables preview in debugger (#6379) 2023-10-09 11:47:00 -07:00
Ciro Spaciari
35109160ca feat(KeyObject) (#5940)
* oops

* createSecretKey but weird error

* use the right prototype, do not add a function called export lol

* HMAC JWT export + base64 fix

* Fix Equals, Fix Get KeySize, add complete export RSA

* fix RSA export

* add EC exports

* X25519 and ED25519 export + fixes

* fix default exports

* better asymmetricKeyType

* fix private exports

* fix symmetricKeySize

* createPublicKey validations + refactor

* jwt + der fixes

* oopsies

* add PEM into createPublicKey

* cleanup

* WIP

* bunch of fixes

* public from private + private OKP

* encrypted keys fixes

* oops

* fix clear tls error, add some support to jwk and other formats on publicEncrypt/publicDecrypt

* more fixes and tests working

* more fixes more tests

* more clear hmac errors

* more tests and fixes

* add generateKeyPair

* more tests passing, some skips

* fix EC key from private

* fix OKP JWK

* nodejs ignores ext and key_ops on KeyObject.exports

* add EC sign verify test

* some fixes

* add crypto.generateKeyPairSync(type, options)

* more fixes and more tests

* fix hmac tests

* jsonwebtoken tests

* oops

* oops2

* generated files

* revert package.json

* vm tests

* todos instead of failues

* toBunString -> toString

* undo simdutf

* improvements

* unlikely

* cleanup

* cleanup 2

* oops

* move _generateKeyPairSync checks to native
2023-10-07 15:22:45 -07:00
Jarred Sumner
bb9933fa7e Exclude more files 2023-10-07 14:15:53 -07:00
Jarred Sumner
673f6fc634 Exclude more files 2023-10-07 14:14:42 -07:00
Jarred Sumner
09663a5558 Update settings.json 2023-10-07 14:11:39 -07:00
Jarred Sumner
66b15a8df6 Update settings.json 2023-10-07 14:10:54 -07:00
Dylan Conway
96aa9c0a38 fix a couple install tests 2023-10-06 22:06:28 -07:00
Dylan Conway
46736d5ecb format 2023-10-06 22:02:55 -07:00
Jarred Sumner
25cf4016d3 Fix memory leak in fetch() (#6350)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-06 20:14:44 -07:00
Silver
48635fd910 [types] allow onLoad plugin callbacks to return undefined (#6346)
Returning undefined simply falls through to the next plugin, or to the default loader.
This is defined by esbuild, and supported by Bun, but the types don't reflect it properly.
2023-10-06 19:22:38 -07:00
Paul Nodet
456d6be022 docs: file.stream() is not a promise (#6337) 2023-10-06 03:26:42 -07:00
Colin McDonnell
16cf1fe5f3 Generate compat docs (wip) 2023-10-05 17:19:33 -07:00
Ai Hoshino
e0e9bc16bf fix(serve): fix close_connection behaviour in endWithoutBody (#6315)
Close: #6031
2023-10-05 20:43:58 -03:00
Filip Skokan
30b8993edd WebCryptoAPI: remove JWK "EdDSA" alg checks (#6294) 2023-10-05 20:43:42 -03:00
Justin "J.R." Hill
5c37d5293c test(bun install): cover http(s) non-github case (#6190) 2023-10-05 16:12:07 -07:00
Colin McDonnell
323ae0f2a3 Update Node.js compat docs (#6282)
* Update nodejs-apis

* No commas

* Updates
2023-10-05 16:03:21 -07:00
Jake Boone
7ef4cd26ac Use singular nouns when appropriate on install messages (#2543)
* Use singular nouns when appropriate on install messages

* Fix one more pluralization

* Fix bun-add tests for "1 package installed"

* Fix bun install/remove/update tests for "1 package installed"
2023-10-05 15:59:02 -07:00
Dylan Conway
df1b0c4332 fix printing latest available version 2023-10-05 11:30:52 -07:00
Dylan Conway
4a2e1574e4 fix semver and repository host bugs (#6312)
* releases before prereleases

* handle different repo hosts

* remove log

* Update bun-install.test.ts

* test for `bun add`

* gitlab test

* use comptime hash map, another test case

* don't need length

* bump timeout, use tld

* infer git dependencies for https and ssh
2023-10-04 22:46:21 -07:00
Dylan Conway
5a315f4df0 fix another os test failure 2023-10-04 22:45:11 -07:00
Dylan Conway
f0a914ea8d fix os test failure 2023-10-04 22:27:28 -07:00
Dylan Conway
d4a458a95b generated 2023-10-04 21:40:02 -07:00
Jarred Sumner
5c8233515a Fix query property of url object (#6274)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-04 21:31:29 -07:00
Gavin John
c5c7934ebc Update preload documentation to make applicability to plugins more obvious (#6298) 2023-10-04 21:29:54 -07:00
Jarred Sumner
b0ffe68675 Create AbortSignal without JS (#6278)
* Create `AbortSignal` without JS

* Don't leak

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-04 21:29:35 -07:00
Colin McDonnell
5da79a8366 Closes #6309 (#6310) 2023-10-04 21:28:23 -07:00
Jarred Sumner
ff88510e5f Bump! 2023-10-04 21:19:33 -07:00
Colin McDonnell
df9461ecc5 Update tsconfigs 2023-10-03 23:16:55 -07:00
Dylan Conway
98e9e9b112 Upgrade webkit (#6277)
* `reportExtraMemoryAllocated` parameters changed

* bump webkit

* Update Dockerfile

* format
2023-10-03 19:56:33 -07:00
Ashcon Partovi
9308e1bf09 Support bun run --if-present (#6248)
* Support --if-present
Closes #5670

* More robust tests, handle more cases
2023-10-03 17:39:45 -07:00
Andrey Smirnov
aa8ccce952 compat: Buffer: allow optional positional arguments to be undefined (#4911)
* fix `Buffer` compat with Node.js: compare

* fix `Buffer` compat with Node.js: copy
2023-10-03 15:30:04 -07:00
Dylan Conway
ffe6bb0b7f fix decorator tests 2023-10-03 13:50:36 -07:00
Ai Hoshino
b7982ac131 fix(blob): Add the current offset to the new blob. (#6259)
Close: #6252
2023-10-03 12:03:57 -07:00
Ashcon Partovi
60e7ae9aee Remove old package 2023-10-03 12:02:28 -07:00
Ashcon Partovi
86e4f72f00 Fix permissions for Github Actions 2023-10-03 12:02:15 -07:00
axel escalada
0ca9a7889a Fix bunx command for github package #5974 (#6042)
* fix bunx command for github package

* refactor fmt package to use it when the path is seted

* use labeled block to assign const instead of use 'undefined'
2023-10-03 11:49:24 -07:00
WingLim
476fa4deda feat(encoding): support BOM detection with test passed (#6074) 2023-10-03 10:28:59 -07:00
JS Park
4f1710d2d6 docs: update typescript.md (#6222)
Fix inconsistent results from `bun init`.
2023-10-03 09:12:37 -07:00
John Beene
1acc8191f5 Docs: Update context.md (#6256)
Use token from cookies, not from ws.data
2023-10-03 09:11:52 -07:00
Mathias Wulff
0ee04261b9 Add license information to package.json (#6255) 2023-10-03 09:11:02 -07:00
Dylan Conway
745b6b94ee Store workspace package versions (#6258)
* Store workspace package versions in the lockfile

* more logging

* wip

* keep information from workspace name array and cache

* hash key

* remove cache, compare workspaces with initially loaded

* uncomment sort

* remove comments

* remove allocation

* package json

* test `bun add <package>` without workspace prefix

* Update test/cli/install/bun-install.test.ts

Co-authored-by: Markus Staab <maggus.staab@googlemail.com>

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Markus Staab <maggus.staab@googlemail.com>
2023-10-03 02:17:21 -07:00
Colin McDonnell
47651f321a Update ws example 2023-10-02 19:02:27 -07:00
Jarred Sumner
b444c0b98d Set fetch timeout to 5 minutes (#6217)
* Increase timeouts

* Update uws.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-02 18:01:59 -07:00
Ashcon Partovi
15880308b7 Fix bun install reading Github API from wrong environment variable (#6247)
* Fix `bun install` reading Github API from wrong environment variable

* Update src/install/install.zig

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-10-02 18:00:17 -07:00
Jarred Sumner
89bb526e14 Warn at start when using AVX build of Bun without AVX support (#6242)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-02 17:59:38 -07:00
Colin McDonnell
63a00791fa Update development and document env var expansion 2023-10-02 17:52:29 -07:00
Cícero Santos
a6af1c89b9 Update development.md (#6221) 2023-10-02 15:18:55 -07:00
Colin McDonnell
08bf8b8ad1 Add Bun.TOML to types (#6161) 2023-10-02 15:18:29 -07:00
Colin McDonnell
0c3c57cc35 Add dns.reverse and dns.getServers to types 2023-10-02 14:11:55 -07:00
Ashcon Partovi
237a5ada47 Fix npm tag for canary bun-types 2023-10-02 13:56:14 -07:00
Corné Dorrestijn
0a2d490bf8 Added the fileExtensions field to file-system-router.md (#6231) 2023-10-02 02:42:17 -07:00
Jarred Sumner
ea956e58e9 more logging 2023-10-02 02:38:47 -07:00
Jarred Sumner
46b5069c40 Slightly reduce number of open file descriptors in bun install (#6219)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-01 16:55:05 -07:00
Ai Hoshino
f7618aba20 fix(node:process): fix return value of process.kill (#6207) 2023-10-01 12:55:38 -07:00
Jarred Sumner
e020ecec15 Fix bug causing "Connection Refused" errors (#6206)
* Loop through the return values of getaddrinfo

* Remove incorrect assertion

* Remove extra check

* Remove extra check

* Update bsd.c

* More consistent

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-30 22:59:42 -07:00
Jarred Sumner
8775d37559 Fix regression 2023-09-30 17:16:06 -07:00
Jarred Sumner
54d25b8f6b Update cp.test.ts 2023-09-30 17:09:27 -07:00
Jarred Sumner
960922bba9 Add title 2023-09-30 17:09:12 -07:00
Jarred Sumner
c21be13be4 tweak github actions (#6195)
* Discord comments

* better

* better

* actions

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-30 02:50:38 -07:00
Jarred Sumner
c0b758ad45 Bump 2023-09-29 23:44:57 -07:00
Jarred Sumner
d65fdb6035 Fix hang in bun install (#6192)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-29 20:45:51 -07:00
Jarred Sumner
a97847a494 Implement virtual module support in Bun.plugin (#6167)
* Add support for `build.module` in `Bun.plugin`

* Another test

* Update docs

* Update isBuiltinModule.cpp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-09-29 16:34:20 -07:00
dave caruso
eddb0078b5 fix(runtime): followup for server.requestIP (#6185)
* fix(runtime): followup for `server.requestIP`

* oops

* yeah

* sure

* Update src/deps/libuwsockets.cpp

* Update Dockerfile

* lol

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-29 16:17:54 -07:00
Liz
fa7d7bd1e4 fix: don't set default request method when creating a Request (#6154)
In the case of creating a Request with the parameters `(Request, object)`,
there was a bug that method and headers are set from the default created by
the init rather then the already present value from the request param.
This is because for a to me unknown reason the order in which the parameters
are processed is reversed.

This fixes that by adding a check which stops the defaults from being set,
unless they are explicitly passed.

Fixes: https://github.com/oven-sh/bun/issues/6144
2023-09-29 16:13:49 -07:00
dave caruso
72bdd380af add Socket.prototype; lol (#5945) 2023-09-29 15:42:06 -07:00
dave caruso
10bee33909 fix(resolver): support encoded file urls (#5766)
* start working on this

* it works now

* better implementation imo

* yippee

* more tests and better unrefing

* fix leak?
2023-09-29 14:58:39 -07:00
dave caruso
6afa78120a feat(runtime): implement server.requestIp + node:http socket.address() (#6165)
* [server] requestIp and AnyRequestContext
Changed Request.uws_request to the new AnyRequestContext. This
allows grabbing the IP from a Request. Unfinished.

* [server] basic `requestIp` implementation

Currently using uws's requestIpAsText, which always returns a ipv6
string. We should return a `SocketAddress` object to the user instead,
which will contain the formatted address string and what type it is.
We'll have to use requestIpAsBinary and parse that ourselves.

* TypeScript docs, use `bun.String`, return `undefined` instead of `null`
if we can't get the ip.

* binary address formatting

* uws getRemoteAddress binding

* remove dead code

* working

* final touches

* I will abide by the results of this poll.

---------

Co-authored-by: Parzival-3141 <29632054+Parzival-3141@users.noreply.github.com>
2023-09-29 03:39:26 -07:00
Jarred Sumner
6514dcf4cb Fixes #6053 (#6162)
Fixes #6053

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-29 00:03:58 -07:00
Jarred Sumner
d3caf37b49 Upgrade to latest Node.js version (#6158)
* Upgrade to latest reported Node.js version

* Upgrade

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-28 23:20:26 -07:00
Devin Johw
315125c43a docs (runtime): the order of checking files when using bare impoort (#5919) 2023-09-28 22:13:52 -07:00
Dylan Conway
f6fbf86910 fix decorator tests 2023-09-28 19:18:36 -07:00
axel escalada
e1117c6ae5 Add local tarball install #5812 (#6118)
* check if the value passed for add command is a local tarball and install it, test for local tarball

* use bunExe()

* use absolute path to copy tarball

* fmt ts
2023-09-28 19:07:51 -07:00
Jarred Sumner
4bdec01619 Reduce memory usage of HTTP server (#6135)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-28 19:06:04 -07:00
dave caruso
2e8d9d4607 Revert WebKit submodule to where it should be 2023-09-28 18:01:14 -07:00
Colin McDonnell
640b0b4df9 Improve docs 2023-09-28 14:14:44 -07:00
Alba Silvente Fuentes
16be721d8a docs: update image astro.md (#6149) 2023-09-28 12:52:00 -07:00
Colin McDonnell
26794680dd Update prisma 2023-09-28 11:32:46 -07:00
Colin McDonnell
5fedc8bd6c Revert "Update prisma guide"
This reverts commit e62fef6765.
2023-09-28 11:31:47 -07:00
Colin McDonnell
e62fef6765 Update prisma guide 2023-09-28 11:27:08 -07:00
dave caruso
387f1260c9 Get Next.js Pages Router to work (#6095)
* hell

* make it so bun-debug-src

* teag

* wild

* yippee

* fas

* fix async hooks assertions

* yap

* yeah that's wild

* aa

* a

* increase time allowed

* so trivial
2023-09-28 03:53:24 -07:00
jhmaster
e60b3607c1 Complete rework of the majority of node:util, primarily util.inspect (#4493)
* 1st revision of new util.inspect impl. (not done)

* fix util.types.isArrayBuffer

* fix some utl tests and bugs

* fix node:tty missing primordials

* fix utl stackoverflow handling & some tests

* narrow down diff. context test

* util.inspect indirect circulars optimization

* temp workaround for buggy is...Function checks

* impl. Map/Set/Iterator entries inspection

* fix bigint & symbol objects inspection

* error inspection fixes

* misc util tests stuff

* inline getExternalValue stub

* leftovers

* util.inspect promise internals

* run bun fmt

* commit make js changes

* cut out unnecessary utl files

* reorganize utl folder structure

* remove browserify buffer check

* Try to revert git messing up uws somehow

This reverts commit 2c27e16e7d.

* commit src/js/out files again

* redo this edit too

* refresh js/out files

* Removed uws submodule

* tidy up

* unused primordials

* run fmt

---------

Co-authored-by: dave caruso <me@paperdave.net>
2023-09-27 23:51:49 -07:00
Dylan Conway
31d96a1b7f fix typescript metadata for import identifiers (#6130)
* handle import identifiers

* a test

* handle dot case
2023-09-27 23:37:53 -07:00
Dylan Conway
3ee09bfe79 update snapshots 2023-09-27 22:35:06 -07:00
jhmaster
3d37684253 deadCodeElimination toggle for Bun.Transpiler (#5932)
* add Bun.Transpiler DCE option

* mark DCE toggle experimental + tests

* full (hopefully) DCE toggle

* update DCE toggle tests

* add DCE option to types

* run fmt

* Removed uws submodule
2023-09-27 19:26:03 -07:00
Dylan Conway
06a82b7725 real fix was #5679 (#6123) 2023-09-27 19:23:28 -07:00
Justin "J.R." Hill
1d6d639352 fix(bun install): Handle vercel and github tarball path dependencies (#6122)
* fix(bun install): Handle vercel and github tarball path dependencies

* test(bun install): test tarball path with when

* Simplify github tarball detection

---------

Co-authored-by: bun <noreply@oven.sh>
2023-09-27 19:22:50 -07:00
Daniel Amemba
7cd1dc2817 Update run.md (#6099)
Changed the verb form from ignores to ignored.
2023-09-27 17:44:38 -07:00
Justin "J.R." Hill
57d1ae234c Update developer arch install steps for llvm and clang (#6120)
`llvm` and `clang` are both at v16

`llvm16` and `clang16` are AUR packages https://aur.archlinux.org/packages/llvm16 https://aur.archlinux.org/packages/clang16 and need extra steps to setup
2023-09-27 17:41:06 -07:00
Liz
8608b5286a fix: implement correct behaviour for urls with blob: scheme (#5825)
* fix: implement correct behaviour for urls with blob: scheme

Urls using the blob scheme can have special behaviour if their origin itself
is a url.
This fixes that by parsing the subdomain and if valid and the schemes(protocols)
are valid returns its origin.
Ive used node.js here a lot to make sure its behaviour is copied 1:1 and enabled
the automated tests for it.

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

* fix: subUrl can be const, we are not modifying it

* style: add spaces after `if` keyword
2023-09-27 16:15:45 -07:00
Brennan Kinney
a5f76e690a fix: Docker - Apply workaround with RUN to symlink bunx (#6100)
Using `RUN --mount`, we can run the command with the build stage files overlayed for the `ln` and `which` commands.

`/bin` is a symlink to `/usr/bin`, both seem required to work correctly.
2023-09-27 09:49:33 -07:00
Ai Hoshino
a0081f9e29 fix(node:fs): fix fs.exists callback parameters (#6097)
Close: #6073
2023-09-27 03:40:45 -07:00
Dylan Conway
4d2b442a33 Update bun-install.test.ts 2023-09-26 22:19:33 -07:00
Dylan Conway
0268807be2 fix workspace dependency install (#6092)
* handle `*`

* test

* always use the package name

* more tests

* install dependency in each
2023-09-26 21:53:14 -07:00
Ashcon Partovi
f354a29683 Remove one of the tags 2023-09-26 20:07:27 -07:00
Ashcon Partovi
e5b62bf074 Fix docker tags 2023-09-26 20:01:39 -07:00
Ashcon Partovi
e05d190e6a Fix plain tag not releasing 2023-09-26 19:50:12 -07:00
Liz
d7b43f8ea1 fix: support console.dir options object correctly (#6059)
* fix: support console,dir options object correctly

`console.dir` can be passed a second argument which is a object of options.
This implements that logic with the currently supported properties: `depth`
and `colors`.
I used node as a reference for implementation details.

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

* style: format zig file

* fix: implement changes from review

Implements changes requested from review, like adding
more test cases and refactoring code style.
2023-09-26 19:47:37 -07:00
Ciro Spaciari
648d5aecf3 fix server end of stream, fix fetch not streaming without content-length or chunked encoding, fix case when stream do not return a promise on pull (#6086) 2023-09-26 19:31:20 -07:00
Ashcon Partovi
dc55492698 Add Docker section to docs 2023-09-26 19:30:00 -07:00
Ashcon Partovi
2b2927dedc Fix latest tag 2023-09-26 19:22:38 -07:00
Ashcon Partovi
500c52af62 Add is-latest flag to manual release 2023-09-26 19:18:24 -07:00
Ashcon Partovi
c1deec3c16 Use ln -s instead of ln due to image size 2023-09-26 19:05:39 -07:00
Ashcon Partovi
fbbf184b1d Fix homebrew 2023-09-26 18:57:32 -07:00
Ashcon Partovi
e127c520a9 Better bun-release workflow 2023-09-26 18:51:57 -07:00
Ashcon Partovi
80195557c9 Fix alpine image for arm64 2023-09-26 17:59:38 -07:00
Ashcon Partovi
9e26485b04 Fix docker release tag 2023-09-26 17:40:17 -07:00
Ashcon Partovi
5cf29df066 Fix debian-slim docker workflow 2023-09-26 17:12:26 -07:00
Ashcon Partovi
1bf36cf123 Fix github workflow permissions 2023-09-26 17:08:11 -07:00
Brennan Kinney
d060474f3a fix: Docker - Include bunx symlink in distroless variant (#6090) 2023-09-26 17:06:44 -07:00
Ashcon Partovi
fae646da3b Remove latest tag from canary Docker workflow 2023-09-26 16:38:44 -07:00
Ashcon Partovi
298515c368 Improve Docker images (#5771)
* Improve Docker images

* Add alpine and distroless images

* Update docker workflow
2023-09-26 16:35:12 -07:00
Alba Silvente Fuentes
2a14d9e5c9 Update astro.md to v3 (#6070) 2023-09-26 16:13:59 -07:00
0xflotus
549d01a4d6 docs: fixed small error (#6077) 2023-09-26 16:13:27 -07:00
Dylan Conway
aec0d35f9b no this value (#6063) 2023-09-25 23:27:55 -07:00
Colin McDonnell
b5c80d9476 Better typings for test.each() 2023-09-25 20:01:34 -07:00
Jarred Sumner
17fa9378e9 Drain microtasks at end of abort() if called into JS (#6036)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-25 16:09:37 -07:00
Jarred Sumner
6cde1d3b89 Add Module._extensions (#5998)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-25 16:09:09 -07:00
Jarred Sumner
6d842e7dcb Make error message for new URL(invalid) better (#6032)
* Make error message for `new URL(invalid)` better

Thanks to @karlcow https://github.com/WebKit/WebKit/pull/13802

* redact

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-25 16:07:33 -07:00
Colin McDonnell
9d9fcbbdeb Update docs 2023-09-25 15:22:12 -07:00
Vlad
cd09bb0e9b Add fs.statfs{Sync} to missing fs apis (#6030) 2023-09-25 10:55:55 -07:00
axel escalada
bbc70d2b73 Fix create command with template prefixed with @ char #6007 (#6013)
* fix create command with template prefixed with @ char

* add typescript test for create command

* format test
2023-09-25 05:22:47 -07:00
Ai Hoshino
3eca2c7fee fix c-string sentinel (#6026) 2023-09-25 05:19:33 -07:00
Jarred Sumner
af0cb893b5 Add microbenchmark for symbol-based private variables 2023-09-25 03:27:38 -07:00
Jarred Sumner
7027493196 Update nodejs-apis.md 2023-09-25 00:39:53 -07:00
Jarred Sumner
bd4523798f Clarify 2023-09-24 23:47:20 -07:00
Jarred Sumner
6326eb4246 Add buggy note 2023-09-24 21:28:33 -07:00
Jarred Sumner
96411580c1 Do not use removefileat() (#6001)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-24 18:27:55 -07:00
Jarred Sumner
3f463786a5 Correctly fix #5888 (#6000)
* Update our MultiArrayList

* More consistent CI

* Fix serialization issue

* Update bun.lockb

* Update bun.lockb

* fixup

* Fix `Bin{}`

* `bun update` should not cache the manifest

* Make bun install tests more consistent

* This differs by platform evidently

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-24 17:43:59 -07:00
Jeroen van Rensen
43f092807b Update writing.md - Remove duplicate code snippet (#5966) 2023-09-24 08:50:18 -07:00
cyfung1031
b8817ab188 Update README.md (#5989) 2023-09-24 08:49:57 -07:00
asrar
ef7f679edf Fix link to vitejs (#5959) 2023-09-24 08:49:14 -07:00
Jarred Sumner
57010cc448 Avoid using std.net.Address.parse (#5950)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-24 03:17:19 -07:00
Jarred Sumner
b6a4161cc5 Fixes #5985 (#5986)
* Fixes #5985

* Update confirm-fixture.js

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-24 03:16:51 -07:00
Ai Hoshino
a5908e9f27 fix(lockfile): ensure all bytes of union are initialized before serialization. (#5957) 2023-09-23 20:09:45 -07:00
Moritz Eck
72f9017b21 docs: update link to templates in remix guide (#5965) 2023-09-23 09:56:37 -07:00
Sony AK
93f1d91083 Update installation.md (#5968)
* Update installation.md

Adding notes for users that currently use canary version and want to  switch back to stable version.

* Upadte

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-09-23 09:56:03 -07:00
Jarred Sumner
ec0e931e9f Bump! 2023-09-22 21:26:59 -07:00
Jarred Sumner
a229cfd3c6 Make this function inline 2023-09-22 21:26:35 -07:00
Dylan Conway
966b636e5d isBinary (#5944) 2023-09-22 19:48:36 -07:00
Dylan Conway
ee93f1b88c [install] fix GitHub dependency bugs (#5941)
* handle branches with slashes

* handle empty repo string
2023-09-22 18:41:55 -07:00
Colin McDonnell
ffd21e98e7 Remove bun dev stuff from create_command (#5939) 2023-09-22 18:41:05 -07:00
Kilian von Pflugk
a3db02832e use the correct channel name for feedback (#5899) 2023-09-22 18:40:37 -07:00
Ai Hoshino
1445775d64 fix(runtime): exclude unevaluated module in require.cache (#5903)
Close: #5898
2023-09-22 18:40:06 -07:00
Colin McDonnell
feefaf00d7 Update workspaces.md 2023-09-22 16:42:23 -07:00
dave caruso
25e69c71e7 Implement module.parent (#5889)
* Make module.parent work

* yay

* oops

* yay
2023-09-21 22:09:55 -07:00
Dylan Conway
9d5459221f fix #5865 (#5890)
* make sure types are the same

* tests
2023-09-21 21:02:34 -07:00
dave caruso
341c1c1804 disable child_process execArgv + fix crash in cli parsing (#5843)
* stuff

* stuff

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-21 20:37:32 -07:00
Colin McDonnell
b218c40a5d Hide env elapsed time when loglevel=info (#5882)
* Hide env elapsed time when loglevel=info

* Updates

* Update

* Fix test
2023-09-21 20:07:25 -07:00
Dylan Conway
09d6e8553b ref and deinit (#5883)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-21 20:02:51 -07:00
Imamuzzaki Abu Salam
0502c134e8 docs: add await to all Bun.build() call (#5885) 2023-09-21 19:08:57 -07:00
Jarred Sumner
e34ff61339 Don't use arena in node:fs (#5863)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-21 18:59:01 -07:00
Igor Shapiro
8684a59029 chore(git): ignore .envrc file (#5873) 2023-09-21 18:44:59 -07:00
Liz
b297fabd17 fix: correctly pass the encrypted(bool) property on "Socket" for express.js (#5878)
* fix: correctly pass the encrypted property on "Socket" for express.js

Express relies on this for setting the requests protocol.
Since this is on a dummy object, a property is simply set with the actual value.
Which seams okay as a workaround.

* chore: add generated files

* chore: add test

* refactor: set property directly rather then through a getter
2023-09-21 18:44:05 -07:00
dave caruso
b05e10cd8b fix(node:fs): use the right copyFile constants (#5874) 2023-09-21 18:42:49 -07:00
Ai Hoshino
92a5d845ae chore: Update ZSH completions (#4428) 2023-09-21 17:43:01 -07:00
Colin McDonnell
030407c52e Update completions list 2023-09-21 17:32:19 -07:00
Colin McDonnell
cfc56dafeb Update install docs 2023-09-21 15:17:16 -07:00
Colin McDonnell
b011f94250 Update test script 2023-09-21 12:55:27 -07:00
Colin McDonnell
66cdb077ad Add docs for extending process.env 2023-09-21 12:35:41 -07:00
Dylan Conway
4a1573e007 decorator metadata defaults and rest args 2023-09-21 12:20:53 -07:00
Jarred Sumner
0b4a34bbd6 Fix test failures (#5862)
* Fix test failures

* Fixes #5851

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-21 07:56:44 -07:00
Jarred Sumner
d1e9b33cac On Linux, respect memory limit from cgroups (#5849)
* Implement `process.constrainedMemory()`

* Add a comment

* Handle max

* Missing header

* We can use WTF::ramSize now

* Update WebKit

* Update ZigGlobalObject.cpp

* WebKit

* ✂️

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-21 07:25:18 -07:00
Jarred Sumner
abfc10afeb Revert "feat(encoding): support BOM detection (#5550)"
This reverts commit 5f66b4e729.

This caused test failures in text-encoder. cc @WingLim
2023-09-21 07:10:07 -07:00
Jarred Sumner
a18ef053a4 Don't await plugins 2023-09-21 06:16:31 -07:00
Jarred Sumner
6abc9af472 Add another test 2023-09-21 06:04:58 -07:00
Jarred Sumner
e1cf08b3a6 Fixes #5859 2023-09-21 05:48:40 -07:00
Jarred Sumner
28f3453466 Regenerate builtins 2023-09-21 02:59:50 -07:00
Aaron Dewes
9c45487763 Fix make jsc on Linux (#4779)
* Fix `make jsc` on Linux

Previously, it failed with `/usr/bin/bash: Line 3: -DUSE_BUN_JSC_ADDITIONS=ON: Command not found`.

* Update Makefile

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

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-21 02:10:54 -07:00
Jarred Sumner
01d2cb5d98 Prettier 2023-09-21 00:51:48 -07:00
Liz
2664dfad9b fix: add check to sqlite extension loading logic (#5773)
The sqlite3 logic to dynamically load extensions can be disabled to save space,
which macos does by default.
sqlite3 provides a api to check for these compile time settings at runtime,
we can use that to throw a js error rather then crashing.
It is worth noting though that the api to check for these settings at runtime
itself can be disabled through SQLITE_OMIT_COMPILEOPTION_DIAGS but this seams
to be a edge case.
2023-09-20 23:43:21 -07:00
Jibran Kalia
e0c5debc57 fix(console.log): change default depth from 8 to 2 (#5839)
This make it as the same default depth in Node.
Source: 480ab8c3a4/doc/api/console.md (L285)
2023-09-20 23:42:44 -07:00
Jarred Sumner
e160223627 In http client, use .toOwnedSlice() instead of potentially re-using the WTFString here 2023-09-20 23:40:42 -07:00
Ai Hoshino
b00588e98c fix(fetch): fix redirect in relative path location. (#5781)
* fix(fetch): fix redirect in relative path location.

* fix utf-8 encoding

* use server.reload

* check buf size

* add RedirectURLTooLong test
2023-09-20 23:34:00 -07:00
dave caruso
ac19c7c62e remove /test.js and git ignore it - sorry 2023-09-20 20:30:15 -07:00
saurabh
539eec85db docs(project): development fix Arch install-dependencies command (#5270)
sudo is required to run pacman if not root user
2023-09-20 20:11:13 -07:00
dave caruso
b7951511a3 fix(run): interpret extensionless files as typescript (#5711)
* test

* gadsgsagdsa

* add better err msg

* r

* oops

* ok
2023-09-20 19:48:46 -07:00
Ciro Spaciari
b65862e23b fix(ffi) fix size limit for dlopen (#5516)
* fix size limit

* 63

* throw error

* ffi.test.js

* add macos tests

* oops
2023-09-20 18:50:10 -07:00
WingLim
5f66b4e729 feat(encoding): support BOM detection (#5550)
* fix(encoding): export `getIgnoreBOM`

* feat(encoding): support ignoreBOM

* fix(encoding): not replace BOM to 0xFFFD

* chore: use strict equal
2023-09-20 18:44:05 -07:00
Ai Hoshino
7319142fd8 feat(node:dns): implement dns.lookupService (#5613)
* feat(node:dns): implement dns.lookupService
Close: #4347

* fix flags

* add `getSockaddr`

* fix sockaddr size

* flaky test
2023-09-20 18:43:08 -07:00
dave caruso
365fc0d39d implement Module.prototype._compile (#5840) 2023-09-20 18:31:57 -07:00
dave caruso
34d191be67 feat(runtime): implement console._stdout (#5842)
* implement console._stdout

* nonenum
2023-09-20 18:28:07 -07:00
Colin McDonnell
5c6d7760a5 Improve types for test.each, describe.each (#5838)
* Improve types for each

* more

* remove
2023-09-20 17:43:08 -07:00
Ashcon Partovi
3c7b9353e1 Fix rendering of bun.lockb in vscode extension 2023-09-20 17:39:33 -07:00
Ashcon Partovi
64a717ab33 Run bun fmt 2023-09-20 17:24:09 -07:00
Colin McDonnell
bbff5b7735 Update quickstart 2023-09-20 16:32:51 -07:00
Colin McDonnell
2e06dbaffe Update prisma guide 2023-09-20 15:42:03 -07:00
Colin McDonnell
19151bb1d2 Update env doc 2023-09-20 13:04:03 -07:00
Colin McDonnell
f8343f25b8 Clarify hot mode 2023-09-20 13:04:02 -07:00
Jonah Snider
67defd95af [bun install] Add -E as alias of --exact (#5104)
* [bun install] Add `-E` as alias of `--exact`

* Add test for -E flag
2023-09-20 11:14:55 -07:00
Lucas Coratger
aa3355dc82 feat: switch disableTelemetry to bunfig (#5690)
* feat: switch disableTelemetry to bunfig

* feat: zig fmt

* revert: the env variable and invert the logic of telemetry

---------

Co-authored-by: MrPalixir <73360179+MrPalixir@users.noreply.github.com>
2023-09-20 10:13:31 -07:00
LongYinan
8c612adcdb Treat undefined value as empty in expect.toThrow (#5788)
Fix: https://github.com/napi-rs/napi-rs/blob/main/examples/napi/__tests__/test.framework.js#L16-L19
2023-09-20 10:11:41 -07:00
JeremyFunk
711a2bcdd1 Fix various bugs in vscode extension (#5772)
* Fix bugs

* Fix bugs

* Revert "Fix bugs"

This reverts commit 608639eb22.
2023-09-20 10:09:51 -07:00
Dylan Conway
689b28455c add emitDecoratorMetadata (#5777)
* some progess

* needs more tests

* make tests easier to debug

* get metadata for constructor arg decorators

* fix some things

* merge `emitDecoratorMetadata` option

* remove `^`

* bundler tests and get option from tsconfig earlier

* remove spaces

* fix tests
2023-09-20 08:10:03 -07:00
Ai Hoshino
4439f16155 fix(doc): correct server.reload (#5799) 2023-09-20 08:08:11 -07:00
Jarred Sumner
ff7f642099 Call Error.prepareStackTrace on new Error().stack (#5802)
* Always call `Error.prepareStackTrace`

* Support node:vm

* Remove this

* Handle more cases

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-20 05:52:59 -07:00
Jarred Sumner
1456c72648 Fixes #5800
Fixes #5800
2023-09-20 04:33:38 -07:00
Jarred Sumner
5d09a06100 Fix path used in bunx (#5785)
* Fix path used in bunx

* Add test

* Use a different package

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-20 01:00:29 -07:00
ggobbe
4a0eb19038 Fix RedirectURLTooLong errors (#5786)
The URL to download the manifest for Artifact Registry in Google
is larger than 4092 bytes.

cf. issue #4748
2023-09-20 00:18:47 -07:00
Jarred Sumner
edee1e3d04 Show when a newer version is available in the install screen (#5780)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-19 23:03:11 -07:00
Colin McDonnell
e2fb524993 Fix broken links 2023-09-19 22:42:54 -07:00
Sanyam Kamat
ee33d5ced4 docs: add Qwik guide (#4810) 2023-09-19 21:54:45 -07:00
h2210316651
53fd9ff4bf Updated modules.md to address issue #5420 (#5456)
* Update modules.md

Updated docs to address `The ES modules aren't always asynchronous. #5420` Issue. 
- Included an elaborate explanation citing the difference between CommonJS and ES Modules, 
- Added a summary

* Tweaks

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-09-19 21:39:22 -07:00
Ahmad Addel
e3558b626c add warning to Ensure correct placement of the '--watch' flag (#5447)
* Update run.md

* remove the wrong command example

* Tweak

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-09-19 21:34:26 -07:00
Jarred Sumner
5defdf3e28 Fixes #5769 (#5775)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-19 18:16:51 -07:00
Ciro Spaciari
f8d7f50cdb some fix (#5762) 2023-09-19 17:20:50 -07:00
WingLim
ddb1189b2d fix(cli): bun pm cache rm command not work (#4571)
* fix(cli): rm arg is in positionals[1]

* chore(cli): add cache remove test

* chore: remvoe unnecessary join

* chore: run formatter

---------

Co-authored-by: dave caruso <me@paperdave.net>
2023-09-19 16:54:54 -07:00
Colin McDonnell
4fce34854b Doc updates (#5759)
* WIP

* WIP
2023-09-19 16:31:38 -07:00
Colin McDonnell
615beee1ae More improvements to azure guide 2023-09-19 13:48:59 -07:00
Colin McDonnell
ef98a1b761 Improve formatting again 2023-09-19 13:38:00 -07:00
sum117
8709fd7855 docs(development): typo which would lead to wrong llvm installation (#5513) 2023-09-19 13:35:37 -07:00
Colin McDonnell
ebc7b037ed Update azure guide 2023-09-19 13:31:31 -07:00
Weyert de Boer
f4e7f6db7c docs: update node compability (#5562) 2023-09-19 13:26:50 -07:00
Kilian von Pflugk
f6eaf4bc78 remind users of the latest version (#5597)
Reduce Bug reports for fixed issues.
2023-09-19 13:26:23 -07:00
Andrey Gurtovoy
fc14902f73 Added react installation to react.md (#5620)
* Update react.md

Added install react part

* Updates

* Updates

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-09-19 13:25:13 -07:00
Brooks Lybrand
d362a8b9ec docs: Update Remix guide (#5702)
* Update Remix guide

* Update callout

* Update docs/guides/ecosystem/remix.md

Co-authored-by: Michael Jackson <michael@jackson.us>

* update

* Add link to remix

---------

Co-authored-by: Michael Jackson <michael@jackson.us>
Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-09-19 12:39:23 -07:00
Jarred Sumner
8677ae9fb1 Get artifactory to work (#5744)
* Get artifactory to work

* Cleanup url normalization a ltitle more

* Clean up tests

* prettier

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-19 08:01:47 -07:00
Jarred Sumner
66d490d109 Align fetch() redirect behavior with spec (#5729)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-19 05:51:05 -07:00
Jarred Sumner
19fc8ecba2 Fixes #3712 (#5730)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-19 05:50:23 -07:00
Jarred Sumner
ed9e64805f Delete long-broken package which is causing confusion 2023-09-19 04:33:58 -07:00
Jarred Sumner
8ca691693f Delete extremely out of date docs 2023-09-19 04:32:45 -07:00
Jarred Sumner
4b5dcc8a6a Make bun install --verbose more verbose (#5726)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-19 03:58:55 -07:00
Jarred Sumner
d2328285f9 Update azure-artifacts.md 2023-09-19 00:13:52 -07:00
Jarred Sumner
346f8e9c94 Update azure-artifacts.md 2023-09-18 23:52:42 -07:00
Jarred Sumner
b34da183bd Update azure-artifacts.md 2023-09-18 23:50:37 -07:00
Jarred Sumner
db1263662c Update azure-artifacts.md 2023-09-18 23:49:42 -07:00
Jarred Sumner
63afadcb91 Update azure-artifacts.md 2023-09-18 23:46:42 -07:00
Jarred Sumner
8b690aaf0d Update azure-artifacts.md 2023-09-18 23:43:06 -07:00
Jarred Sumner
9b7fb8b0f3 Update azure-artifacts.md 2023-09-18 23:42:34 -07:00
Jarred Sumner
cc54b62fac Encode slashes in package names in the registry manifest request (#5716)
* Encode slashes in package names in the registry manifest request

Co-Authored-By: Max Brosnahan <1177034+gingermusketeer@users.noreply.github.com>

* Update dummy.registry.ts

* Fix tests

* Add guide for Azure Artifacts

* Update azure-artifacts.md

* Update azure-artifacts.md

* Typo

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Max Brosnahan <1177034+gingermusketeer@users.noreply.github.com>
2023-09-18 23:27:02 -07:00
Jarred Sumner
9d3f60d44e Prettier 2023-09-18 21:30:17 -07:00
Rui He
b453ec38d6 add navigator type definition (#5444) 2023-09-18 20:23:18 -07:00
Julian
1b949d4f5a bun run fix missing script error on empty file (#5025)
* Fix empty file not found bug

* Add tests

* fix test

---------

Co-authored-by: Jeremy Funk <jeremy@kombo.dev>
Co-authored-by: dave caruso <me@paperdave.net>
2023-09-18 20:14:32 -07:00
Liz
0647216687 fix: provide empty string to 0 length process environment variables (#5679)
* fix: provide empty string to len 0 process env vars

For process loaded env vars, its a bug to give them the literal value '""'
if the provided length is 0.

* fix: add test and remove unneeded branch

Removes the redundant branch for empty env vars and adds a test for the
process specific case.

* fix: remove empty_string_value

Removes the constant in favor of using the empty values or passing the
literal "".

* style: format env.test.ts
2023-09-18 18:14:29 -07:00
Nithin K Joy
6df837cff1 updated llvm version from 15 to 16 in makefile (#5696) 2023-09-18 17:34:57 -07:00
Liz
c55b2c56a4 fix: remove unneeded branch in toJSONWithBytes (#5684)
This branch resulted in the same the same statement so having the branch,
is not needed
2023-09-18 17:34:39 -07:00
dave caruso
eb1dc7eede fix(runtime/node): Allow new Buffer.alloc() + Upgrade WebKit (#5699)
* make bufferconstructor a static hash table

* chore: Upgrade WebKit to 4d995edbc44062b251be638818edcd88d7d14dd7

* make it constructable now

* fix comment

* yippee

* update CI workflows
2023-09-18 17:33:58 -07:00
Jarred Sumner
79dd196edd Implement node_api_create_external_string_latin1 and node_api_create_external_string_utf16 (#5675)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-18 17:31:26 -07:00
dave caruso
333e217c32 feat(runtime): Implement console.Console (#5448)
* prototype

* asdfg

* It works!

* okay its done now fr

* self review

* ok

* fix

* fix test

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-18 16:29:56 -07:00
dave caruso
f77df12894 Fix HTTP listen behavior being non-compliant with node (#5689)
* Fix HTTP listen behavior being non-compliant with node

* Add error code for address in use

* use SystemError

---------

Co-authored-by: SuperAuguste <19855629+SuperAuguste@users.noreply.github.com>
2023-09-18 14:57:48 -07:00
Hamed Zakery Miab
8f8ab301b4 change circles for color-blinds (#5594) 2023-09-18 10:31:53 -07:00
Kilian von Pflugk
0800f7017c docs: add missing options from bun init (#5638) 2023-09-18 10:28:57 -07:00
Rauny
8c1c2a0d9d fix(docs): update formatting (#5685) 2023-09-18 10:26:25 -07:00
Ai Hoshino
bab9889601 fix(config): support for registry url without trailing slash (#5662)
* fix(config): support for registry URLs without trailing slash
Close: #4589, #5368

* Update src/bunfig.zig

* Update src/bunfig.zig

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-18 04:32:02 -07:00
Jarred Sumner
b27b04690b In bun:sqlite, make sure we set the number tag correctly when creating the JSValue (#5655)
* Make sure we set the number tag correctly when returning values from SQLite

* Add DOMJIT test

* Update JSSQLStatement.cpp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-18 03:01:19 -07:00
WingLim
c7de270bbb feat(test): Implement arrayContaining (#5572)
* feat(test): implement `arrayContaining`

* feat: early return when expectedArray is empty

* feat: add test for toEqual

* chore: use `JSC::isArray`

* chore: use getIndex for performance

* fix: use deepEqual

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-18 02:59:09 -07:00
Jibran Kalia
c66d4a724b feat(console.log): Print annonymus when class name is unknown (#5595)
This matches the functionality in Node.
2023-09-18 00:33:07 -07:00
Reagan
9acc081c3a Remove hardcoded references to zig in Makefile (#5660) 2023-09-18 00:32:20 -07:00
Jarred Sumner
630bbfca91 Add a way to disable the GC timer (#5656)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-18 00:11:18 -07:00
Jarred Sumner
57e38e8312 Fix assertion failure in debug builds 2023-09-17 19:41:51 -07:00
Jarred Sumner
ffa88a1f81 Fix make headers 2023-09-17 19:41:33 -07:00
Quentin
2a6fdc2298 Fix a 'app.server' is possibly 'null'. error (#5626) 2023-09-17 18:18:18 -07:00
Jarred Sumner
bca88b67e3 Workaround #5604 (#5615)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-17 17:38:03 -07:00
Cilooth
c6899940ab Added .DS_Store to gitignore-for-init (#5628) 2023-09-17 17:34:35 -07:00
Shinichi Katayama
639a12f59f Fix ZLS commit hash in the document (#5510)
* Fix ZLS commit hash in the document

* Remove ZLS section from the doc
2023-09-17 09:13:30 -07:00
pan93412
25aa51dfc4 fix(install): Return NotSupported when errno == XDEV (#5610) 2023-09-17 09:09:57 -07:00
JeremyFunk
c6b25adeea Implement VSCode tasks for bun (#5529)
* Fix VSCode extension configuration documentation

* Fix config descriptions

* Fix typo

* Implement bun.lockb highlighter

* Update style

* Improve styling

* Revert bunlock change

* Implement bun tasks

* Revert change

* Package json codelens

* Fixes

* Refactor
2023-09-17 08:59:01 -07:00
Jarred Sumner
0404d09cc7 Bump minimum macOS version 2023-09-16 23:45:09 -07:00
Jarred Sumner
f5b37fa0b0 Use a better error label 2023-09-16 22:53:23 -07:00
Ciro Spaciari
4e0c589562 fix(child_process) unref next tick so exit/close event can be fired before application exits (#5481)
* unref next tick so exit callback can be called

* fmt + test

* oops

* add ref_count

* update pending

* comment and fix
2023-09-16 22:44:13 -07:00
WingLim
a098c6e5f6 feat(encoding): TextDecoder support undefined (#5387)
* feat(encoding): TextDecoder support undefined

* chore: format test file
2023-09-16 22:41:52 -07:00
Ciro Spaciari
383d5b55d6 fix(fetch) handle 100 continue (#5496)
* handle 100 continue

* move comment

* cleanup

* fmt
2023-09-16 21:55:41 -07:00
Ethan Steere
80e1f32ca1 Update tsconfig-paths.md (#5593)
Change string:string mapping in the docs to match the expected string:array[string] mapping. 

See: https://www.typescriptlang.org/tsconfig#paths
2023-09-16 21:44:02 -07:00
Vilsol
eca93d4257 docs: fix typo in lockflie nav (#5576)
Looks like someone shifted their hand a bit to the right.

Changes `ytrr` to `tree`
2023-09-16 21:43:43 -07:00
Jarred Sumner
77781e2fa1 Make this error message clearer (#5603)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-16 21:32:52 -07:00
MrPalixir
0a318ecca1 fix: node compatibility with empty path string (#4693)
Co-authored-by: MrPalixir <73360179+MrPalixir@users.noreply.github.com>
2023-09-16 18:51:18 -07:00
Max Karou
08426962fa fix: failing array-buffer.test-d.ts test (#5580) 2023-09-16 12:07:01 -07:00
Max Karou
7f45866d76 fix: ArrayBufferConstructor type signature (#5579) 2023-09-16 11:19:36 -07:00
Bruce Denham
5e6490d905 Update workspaces.md to reflect "workspace:*" syntax (#5555) 2023-09-16 10:21:42 -07:00
Dylan Conway
b651b16fdd webkit upgrade (#5535)
* update files

* Update cold-jsc-start.cpp

* bump webkit
2023-09-16 00:44:07 -07:00
Dylan Conway
caa192480c mark binding 2023-09-15 23:39:36 -07:00
Jarred Sumner
6d8056554e Update build-id 2023-09-15 22:22:39 -07:00
David Hewitt
43c463f078 fix(node/fs.watch): Check first char before trimming event filenames (#5505)
* Add failing test

* fix(node/fs.watch): Don't lose first char in event

* run prettier
2023-09-15 21:21:15 -07:00
David Hewitt
787281ee5e fix(bundler): Add a space before minified require (#5521)
Fixes #5501
2023-09-15 21:19:49 -07:00
Ciro Spaciari
cb057e61ba fix(request) handle undefined/null/empty signal on request (#5503)
* handle undefined/null/empty signal on request

* better approach
2023-09-15 21:19:26 -07:00
Ciro Spaciari
b54e3f3c04 fix(corking) uncork if needed (#5525)
* fix size limit

* uncork if needed instead of terminating

* undo unrelated changes
2023-09-15 21:18:57 -07:00
Sony AK
7f2e40af46 Update development.md (#5531)
Fix to version 16 on docs
2023-09-15 20:28:52 -07:00
Dylan Conway
d976b22c95 Update InternalModuleRegistryConstants.h 2023-09-15 16:00:59 -07:00
Zong
575a85a3fd docs(runtime): fix some typo. (#5451) 2023-09-15 14:10:04 -07:00
JeremyFunk
8eabb4d1d5 Improve rending of lockfiles in VSCode extension (#4652)
* Fix VSCode extension configuration documentation

* Fix config descriptions

* Fix typo

* Implement bun.lockb highlighter

* Update style

* Improve styling

* Revert bunlock change
2023-09-15 13:25:44 -07:00
Jarred Sumner
99a92465f3 Add Permission 2023-09-15 09:54:58 -07:00
Jarred Sumner
37edd5a6e3 Add missing visitors
cc @paperdave
2023-09-15 08:24:35 -07:00
dave caruso
29b22175bf feat(runtime): add process.binding uv/natives/config + make global object properties lazy (#5355)
* binding uv

* we did that

* some more bindings

* fix doc

* fix uv

* yo

* static hash table nonsense <3

* huge refactor to the global object i am not ready for merge conflicts

* it works part 3

* lose

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-15 08:22:06 -07:00
Jarred Sumner
75697890ce Rename this file 2023-09-15 07:10:30 -07:00
Jarred Sumner
7662f99ee0 Update README.md 2023-09-15 07:09:48 -07:00
Jarred Sumner
1e99419127 Set permissions 2023-09-15 07:09:06 -07:00
Jarred Sumner
cd1846a414 Update build-id 2023-09-15 07:04:38 -07:00
Jarred Sumner
a39b0d86a0 Fixes #5465 (#5468)
* Fixes #5465

Fixes #5465

* Update tty.js

* Update InternalModuleRegistryConstants.h

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-15 06:53:39 -07:00
Jarred Sumner
6cc5872765 Fixes #5461 (#5467)
* Fixes #5461

* Update runtime-transpiler.test.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-15 06:04:34 -07:00
Jarred Sumner
898962770e Implement URL.canParse (#5463)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-15 05:36:06 -07:00
Ai Hoshino
7d0db82bb3 fix(proxy): allow empty string http_proxy env. (#5464)
Close: #5380
2023-09-15 05:24:03 -07:00
Jarred Sumner
4b00144211 Revert "decode regex if needed (#5167)"
This reverts commit 32664df254.
2023-09-15 05:07:22 -07:00
Jarred Sumner
92f2d9ab27 Does not fix #4622 (#5452)
* Fixes #4622

* cleanup

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-15 04:23:37 -07:00
Jarred Sumner
56c471a005 Make bun run --silent omit "error: "..." exited with code 1 (#5459)
* Make --silent behave as expected

* Make the "tsconfig.json extends" error a debug level

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-15 04:21:43 -07:00
Jarred Sumner
20f61b2369 Fix test 2023-09-15 04:10:05 -07:00
Jarred Sumner
9168be4f15 Add missing "size" getter to URLSearchParams prototype 2023-09-15 03:50:03 -07:00
Dylan Conway
d26addeca1 dup and close file descriptors (#5341)
* track one shot fds

* dup fd

* skip for rearm on mac

* dup if fd

* cleanup

* force unregister on close

* deinitForceUnregister

* test

* add prompts

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-15 01:39:42 -07:00
Dylan Conway
f84fbd6e3e remove convertToASCIILowercase 2023-09-15 00:45:47 -07:00
Jarred Sumner
f2a8575e4d Reduce log level for loading tsconfig.json extends message 2023-09-15 00:15:22 -07:00
Dylan Conway
29a6ece6c6 next bun.lockb 2023-09-15 00:03:21 -07:00
Dylan Conway
9c44ec1b0d next 2023-09-15 00:02:39 -07:00
Sony AK
819a1fde28 Update docs/quickstart.md (#5425)
* Update quickstart.md

Update quickstart.md

* Update quickstart.md

Update quickstart.md
2023-09-15 00:01:05 -07:00
Colin McDonnell
31fec8f704 Clean up run.md 2023-09-14 23:44:19 -07:00
Jarred Sumner
c5e8271cdc [build] --force on git submodule update 2023-09-14 23:27:37 -07:00
Ciro Spaciari
da7db2230f fix(nitro) fix sourcemaps and JSSink closing (#5422)
* fix JSSink progress on sourcemap checking

* fix sourcemaps

* update JSSink fix

* undo + tests

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-14 23:25:01 -07:00
Dylan Conway
94e9f8bdca fix http set cookie headers (#5428)
* allow multiple set-cookie values

* make it work for `getHeader`

* move `getHeader` to cpp

* remove set-cookie check

* move `setHeader` to cpp

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-14 23:03:20 -07:00
Jarred Sumner
2e6898470e fix dockerfile (#5439)
* fixup docker

* Update Dockerfile

* Update Dockerfile

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-14 22:23:10 -07:00
Dylan Conway
d606958f11 thread 2023-09-14 21:43:58 -07:00
Jarred Sumner
ced69d3818 async-ify all node:fs functions (#5360)
* async all node:fs functions

* draw the rest of the owl

* LLVM & Clang 16

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-14 21:26:37 -07:00
Colin McDonnell
b262b0153a Clean up bunfig.md 2023-09-14 21:25:57 -07:00
Colin McDonnell
75e68e356b Mention dotenv 2023-09-14 21:09:14 -07:00
Colin McDonnell
31691e3898 Fix links 2023-09-14 21:02:52 -07:00
Colin McDonnell
332141a6f2 Rework bunfig docs 2023-09-14 20:54:53 -07:00
Dylan Conway
308237752a v8 date parser tests (#5332)
* Create v8-date-parser.test.js

* one more test

* add permalinks and enable parser in bun

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-14 19:43:11 -07:00
dave caruso
e8d58f24af fix(runtime): emit node:net connect error event vs throw (#5336)
* fix(runtime): emit `node:net` connect error event vs throw

* oops

* finally

* ok

* we are good
2023-09-14 17:30:30 -07:00
Colin McDonnell
07b10bbc16 Clean up trustedDependencies guide 2023-09-14 17:28:11 -07:00
Dylan Conway
969b0cf539 remove tsconfig warning 2023-09-14 17:10:32 -07:00
Nang Chan
23b1276ee2 fix warnings during bun run publish-layer (#5419)
- add missing package @oclif/plugin-plugins to resolved warning: could not find package.json with { type: 'dev',
2023-09-14 15:47:44 -07:00
Colin McDonnell
a983ec713f Improve run.md 2023-09-14 15:30:14 -07:00
DuGlaser
a31d69bf93 fix(docs): Fix the text that bun run --bun is the same as bun (#4647)
* fix(docs): Fix the text that `bun run --bun` is the same as `bun`

* Updates

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-09-14 15:19:37 -07:00
Dylan Greene
f3fe4508ae docs - Add "workspace:*" to workspace docs. (#5379)
* add workspace:* to docs

* Updates

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-09-14 15:04:26 -07:00
Colin McDonnell
96a1d5382f Improve docs 2023-09-14 14:51:42 -07:00
Dylan Conway
e923e23270 oops 2023-09-14 14:38:46 -07:00
Dylan Conway
f815ffa467 bump webkit 2023-09-14 14:01:33 -07:00
Chris Boette
6e1472b9f8 Fix typo in HTTPThread name. (#5376) 2023-09-14 09:09:22 -07:00
Jarred Sumner
92e95c86dd Always get latest version when @tag is explicitly passed (#5346) 2023-09-14 00:48:18 -07:00
Nathan Hammond
8ae9aeea6b Remove the ability to configure lockfile. (#5335) 2023-09-13 22:32:03 -07:00
Colin McDonnell
4ebed280dc Fix helptext for bun update 2023-09-13 22:01:31 -07:00
Soheil Nazari
b31d76b03d Update nuxt.md (#4452)
* Update nuxt.md

* --bun

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-09-13 22:00:31 -07:00
Twan L
0a5e44cd39 Update simple.md (#4881)
I have removed the / before ${server.port} because it its incorrect and I replaced the localhost to ${server.hostname}

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-09-13 22:00:05 -07:00
kryparnold
49a44eef0f Update nextjs.md (#4905) 2023-09-13 21:59:16 -07:00
Ciro Spaciari
fa2ef0972b fix(Bun.serve) fix buffering edge case (#5152)
* fix buffering clean

* fix resolveMaybeNeedsTrailingSlash and try to fix ci/cd error

* fix resolveMaybeNeedsTrailingSlash and try to fix ci/cd error

* oops

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-13 21:48:30 -07:00
dave caruso
9976e3f528 fix(runtime): make most globals configurable/deletable, allow resuming the console iterator (#5216)
* Fix #5177

* Fix #5175

* make most globals deletable/overridable

* not done

* cool

* a

* done

* fix test

* oops

* yippee
2023-09-13 21:39:36 -07:00
Colin McDonnell
fbafbd3394 Reorganize Intro section 2023-09-13 21:36:35 -07:00
Colin McDonnell
66c0401426 Make TypeScript instructions easier to find 2023-09-13 21:22:41 -07:00
Colin McDonnell
631c826866 Use Bun global 2023-09-13 21:22:41 -07:00
Mordy Tikotzky
088bea026e Fix bug with multiline string in CRLF terminated files (#4893) (#5318)
* Fix bug with multiline string in CRLF terminated files (#4893)

* add test for #4893
2023-09-13 21:05:02 -07:00
dave caruso
503c808929 test (#5244) 2023-09-13 20:54:46 -07:00
Jacques Desmarais
0927624608 fix link to "local template" (#5115) 2023-09-13 20:50:58 -07:00
miccou
cf834964a6 modules documentation didn't have correct import example (#5225) 2023-09-13 20:50:21 -07:00
Colin McDonnell
6ac70a6dd2 Use bun create everywhere 2023-09-13 20:47:36 -07:00
Madhurjya Roy
a8cef7ae75 doc(guides): update sveltekit guide (#5285)
* doc(guides): update sveltekit guide

Use `bun create svelte` instead of `bunx create-svelte`. 

This is to bring the documentation at par with the SvelteKit official doc to [create a project](https://kit.svelte.dev/docs/creating-a-project).

* Update text instructions for sveltekit.md
2023-09-13 20:45:37 -07:00
Colin McDonnell
c99caccdb2 More docs & helptext cleanup (#5229)
* wip

* Flesh out resolution docs

* Polish

* More

* WIP

* WIP

* WIP

* Document --watch
2023-09-13 20:43:39 -07:00
Colin McDonnell
22f14129e5 Fix mock example 2023-09-13 20:42:10 -07:00
Ciro Spaciari
d37602f316 fix(BunFile.slice) fix slice when length is greater than the size (#5186)
* check the limits for file, when slicing

* check eof

* undo test
2023-09-13 19:49:43 -07:00
Patrick Klitzke
cb52556bd1 fix(doc): Add "compilerOptions" to bun-types README.md (#5325)
Reading the documentation on bun-types it was not clear to me that the tsconfig.ts needs to look like this:

```
{
  "compilerOptions": {
    "types": ["bun-types"]
  }
}
```

So i added the "compilerOptions" information.
2023-09-13 19:27:49 -07:00
Ai Hoshino
03d9bcd440 fix(node:dns): fix the crash. (#5200) 2023-09-13 17:43:10 -07:00
Ciro Spaciari
972a6f29cc fix(console.log) fix printing long custom format (#5164)
* avoid overflow

* Update src/bun.js/bindings/exports.zig

* add mongodb inspect test

* bun db test

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-13 17:41:47 -07:00
WingLim
932fa35f99 feat(nodejs): implement os.availableParallelism (#5109)
* feat(nodejs): implement `os.availableParallelism`

* chore: do not throw error as same as node

* refactor: use `navigator.hardwareConcurrency`
2023-09-13 17:41:09 -07:00
Jarred Sumner
9c9f4ed6ad Make --watch instant (#5236)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-13 17:31:59 -07:00
dave caruso
4f8edb825f fix(runtime): require cache should not include unevaluated ESM modules. (#5233) 2023-09-13 16:57:59 -07:00
James Gordo
cb01cb0d4a Fixed api & cli docs typo. (#5262)
* Fixed api & cli docs typo.

* Fix

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-09-13 16:36:11 -07:00
Steven
64033f11cc chore(docs): include missing links to Node.js APIs (#5281)
These links make it easy to click and jump to another section.
2023-09-13 14:08:28 -07:00
wing
1c570b41bc docs(guide): fix expect assertion example in guide for spyOn (#5294)
Fixes example with `spyOn` and assertions. The example failed because the spied function would be called once but the expectation asserted 0 calls.
2023-09-13 14:08:09 -07:00
Andrew Brown
500bd15fb5 add uninstall instructions (#5311)
it's always good to have uninstall instructions as well as install, and I couldn't find them anywhere else on the site.

IMO, this gives users a little more confidence to try new tools out, as they know it's easily reversible.

I'm not familiar with how to uninstall with Docker, so would appreciate some help there.

We could possibly add a note for "bash" on how to remove Bun from the `$PATH`.
2023-09-13 14:07:43 -07:00
Guilherme J. Tramontina
687e31dc3a docs: update lockfile diff instructions (#5275) 2023-09-13 10:27:32 -07:00
David Hewitt
c3455c0cee fix(node/fetch): Make data URL fetch consistent with node (#5126) 2023-09-13 05:35:39 -07:00
iidebyo
9101774593 avoid inserting extraneous"accept-encoding" header (#5057)
* add no extraneous accept-encoding header test

* ensure fetch honors no decompress opt

* fix format on test/js/node/http/node-http.test.ts
2023-09-13 02:02:25 -07:00
Zong
9a0ea00705 docs(runtime): fix plugins loader extensions typo (#5250) 2023-09-13 02:00:11 -07:00
Gareth Jones
ec6b75ff54 chore: make comment grammatically correct (#5140) 2023-09-13 01:56:19 -07:00
Colin McDonnell
a18e3ff451 Add informative message on 'bun create react' (#5248) 2023-09-13 01:48:42 -07:00
Zong
eeb790a2f1 docs(runtime): fix jsx FragmentFactory output example (#5243) 2023-09-13 01:47:54 -07:00
amt8u
878b473085 file.exists() needs to be awaited to get the value (#5061) 2023-09-13 01:41:18 -07:00
Antonin CLAUZIER
6161c201e1 Update discordjs.md (#5227) 2023-09-13 01:38:17 -07:00
Dylan Conway
32664df254 decode regex if needed (#5167)
* decode regex if non-ascii

* make it comptime

* add test

* use `bun.BabyList(u16)`
2023-09-13 01:26:18 -07:00
Nathan Hammond
15f7bacb8b Correct the configuration file names. (#5234) 2023-09-13 01:19:15 -07:00
Colin McDonnell
473513db7e Update tsconfig.json for bun init 2023-09-12 23:53:28 -07:00
cfal
75b5c71540 js/node/stream.js: call write() callback when encoding is not provided (#4841)
* js/node/stream.js: call write() callback when encoding is not provided

* js/out/InternalModuleRegistryConstants.h: update
2023-09-12 22:21:58 -07:00
Gordon Goldbach
c9c62f37e5 docs: Made bun-types install as dev dependency in example (#5120) 2023-09-12 22:04:39 -07:00
Colin McDonnell
18b521d9b8 Various docs (#5201)
* Updates

* Improve jest guide

* Improve
2023-09-12 21:51:49 -07:00
Southpaw
534fd30dbd Use git's --global flag for lockfile diffs instead of manually modifying config files (#5143) 2023-09-12 21:51:07 -07:00
Jonathan Neal
3b2c0941e4 docs: fix typo in import.meta.resolve (#5146) 2023-09-12 19:14:26 -07:00
Nazeel
8d3829114e Update hot.md (#4990) 2023-09-12 18:54:23 -07:00
Tom Redman
5f9c30b717 Update simple.md (#4997)
Remove errant slash preventing the correct console log
2023-09-12 18:53:55 -07:00
xnacly
c55574b4d3 fix typo and grammar errors (#5046) 2023-09-12 18:53:23 -07:00
mi4uu
2f27e24778 clang and llvm on arch install v16, update to use v15 (#5069) 2023-09-12 18:52:30 -07:00
Diogo Goncalves
b910db74be Add missing full stop on nodejs-apis.md (#5072) 2023-09-12 18:51:15 -07:00
Toby
b37cb98a6e udate README.md (#5127)
update path
2023-09-12 18:50:50 -07:00
Samuel Rigaud
263382103f docs: fix typos (#5151) 2023-09-12 18:50:05 -07:00
Thomas Rupprecht
8777c3f72c fix lifecycle docu (#5159) 2023-09-12 18:49:19 -07:00
Colin McDonnell
996491f719 Clean up Modules doc 2023-09-12 16:54:07 -07:00
Colin McDonnell
12c2da0ebf Create SECURITY.md 2023-09-12 16:53:59 -07:00
Dylan Conway
a3166457d3 Update node-dns.test.js 2023-09-12 16:50:11 -07:00
Mitchell K
b1bd93bffc fix(bun-lambda) Fix API Gateway V1 events and expand on Lambda documentation (#5161)
* Fix issues with using V1 API Gateway events with Bun Lambda Layer.

* Remove aws-lambda as it is not needed
2023-09-12 14:59:19 -07:00
James Gordo
4c113d1866 Fixed Websocket Compression Example. (#5087)
* Passed message variable to ws.send() method.

* Passed message variable to ws.send() method.
2023-09-12 08:30:23 -07:00
ped
f9d2e687f5 Fix typo in http file upload example (#5088) 2023-09-12 08:30:06 -07:00
Jarred Sumner
31aec4ebe3 Fix bug with bun build --compile (#5102)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-12 07:07:07 -07:00
Jarred Sumner
b432006e43 Clean up some edgecases with posix_spawn usage (#5079)
* Check that the pid matches

* Fixup EINTR check

* Remove extra slashes

* fixup

* fixup

* != 0

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-12 06:34:20 -07:00
Alex Lam S.L
015f0a6e9a fix up with prettier (#5092) 2023-09-12 05:53:55 -07:00
David Hewitt
07a6443a80 fix(node/path): Prevent memory corruption in parse (#5083)
* Add failing test for issue #4954

* fix(node/path): Return results with toValueGC
2023-09-12 05:05:00 -07:00
Jarred Sumner
6e4f746ace Fix some bugs blocking Turborepo from using bun run (#5071)
* Clean up some error handling when loading `tsconfig.json`

* [bun run] don't parse tsconfig.json for package.json scripts

* Make this error message better

* Bump

* Don't print build errors twice

* Handle quotes in error messages a little better

* Add a couple tests

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-12 03:35:29 -07:00
Ai Hoshino
b5a3bed7f2 fix(JSC): copy string in toJSStringValueGC (#5067) 2023-09-12 03:08:42 -07:00
Ciro Spaciari
8615b8ad6b add NODE_TLS_REJECT_UNAUTHORIZED (#4829) 2023-09-11 21:52:31 -07:00
Eric Bidelman
4992839232 Update gzip.md (#5041)
typo
2023-09-11 21:47:35 -07:00
Colin McDonnell
03b8e9d5cf fix formatting in sveltekit guide 2023-09-11 20:12:48 -07:00
Ai Hoshino
f267c1d097 fix(path): Fix edge case in path.relative (#4811)
Close: #4789
2023-09-11 17:53:43 -07:00
Ai Hoshino
c4507a5db3 Fix Buffer.from to handle double-byte hex encoding strings (#4933)
Close: #4919
2023-09-11 17:27:12 -07:00
Ciro Spaciari
c9a0ea96cd fix(BunFile) .slice offset on macOS (#4991)
* fix offset

* simplify error
2023-09-11 17:19:43 -07:00
Dylan Conway
ca461f9e83 fix loading env from .env.production and friends (#4630)
* reload conditional vars

* test

* change `get` and `put` methods

* dont clone empty env variables
2023-09-11 17:19:21 -07:00
Colin McDonnell
9c4765f616 Update benchmark readme 2023-09-11 16:53:34 -07:00
Justin "J.R." Hill
e091290748 fix(bun-lambda): Don't drop arguments in console.log(...) (#4992)
Closes #4826
2023-09-11 12:39:56 -07:00
Ben Jervis
350403663e Fix error message typo in js_ast.zig (#4937) 2023-09-11 11:03:45 -07:00
Dylan Conway
895f3824b5 update test 2023-09-11 10:43:33 -07:00
Diogo Goncalves
58e69ef9f4 Remove unnecessary backticks in quickstart doc page (#4927) 2023-09-11 08:54:22 -07:00
Vladimir Pesterev
decad91d24 Fixed inconsistent log messages in the Quickstart guide (#4942)
Looks like it is just a typo and needs to be fixed.

Signed-off-by: Vladimir Pesterev <8786922+pesterev@users.noreply.github.com>
2023-09-11 08:53:54 -07:00
Yonathan Benolol
ea56182c5a Update http.js - Fix Methods Fallback naming (#4948) 2023-09-11 08:51:35 -07:00
Matthew Yu
9d6a8ee79d Fix punctuation (#4870) 2023-09-11 08:50:39 -07:00
fehnomenal
b55b511f68 Make detect-libc package match the upstream api (#4910) 2023-09-11 08:49:57 -07:00
Krzysztof Szala
49b9306dce fix: changes wrong command name in the tests chapter (#4965)
This PR fixes the command name for running tests flagged with `.only`
2023-09-11 08:48:53 -07:00
Krystian Pracuk
2956ed4289 added .idea to .gitignore (#4951) 2023-09-11 08:48:26 -07:00
Jarred Sumner
51d3d43822 Support named imports for json & toml files at runtime (#4783)
* Support named exports in json imports

* Support named imports for `*.json` files

* Remove stale comments

* Don't export arrays as non-default

* Add test for default exports

* Don't break webpack

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-10 23:15:35 -07:00
Jarred Sumner
edea4f095a Fixes #4588 (#4804)
* Fixes #4588

* typo

* fixup

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-10 21:40:46 -07:00
Diogo Goncalves
07c88435e0 Replace unnecessary '' wih "` in code snippets (#4792) 2023-09-10 11:34:04 -07:00
Jeroen van Rensen
7121c1d6ab Update modules.md - Explain case-insensitivity (#4782) 2023-09-10 11:33:39 -07:00
Ed Knowles
60dc76676c docs: remove duplicate sentence from debugger (#4807) 2023-09-10 11:33:04 -07:00
toneyzhen
f64b504bae Update todo-tests.md (#4771) 2023-09-10 11:32:31 -07:00
Vyacheslav Kulik
97153c5a5f Add compatibility page link to index.md (#4809)
Add a link to compatibility page (https://bun.sh/docs/runtime/nodejs-apis) to its reference in index.md, so it's easier to reach out to.
2023-09-10 11:30:46 -07:00
Tom Sherman
d48ff53e4e docs: Update Bun.write(path, Response) example to be clear that it writes the body (#4802) 2023-09-10 05:06:25 -07:00
WingLim
afcbed218c fix(bindings): add missing binding (#4682) 2023-09-10 02:58:10 -07:00
Rinku Chaudhari
682406c42c docs: fix spelling (#4763) 2023-09-09 22:40:56 -07:00
Richard
6fe40f383a Fix mongoose ecosystem guid (#4740)
Fix missing method declaration on schema and Schema database name from Kitten to Animal
2023-09-09 19:05:13 -07:00
thunfisch987
e2d327881c fix(docs); typo on Nuxt guide page (#4745) 2023-09-09 19:04:05 -07:00
Robert Soriano
4280f74429 docs: fix wasi-js link (#4741) 2023-09-09 19:03:46 -07:00
Chris Hutchinson
8139a20c9f fix: remove from bun-server.test.ts test case (#4709) 2023-09-09 19:03:28 -07:00
akumarujon
620f6c51ce fix typo (#4639) 2023-09-09 14:46:41 -07:00
Ashcon Partovi
ffe4f561a3 Fix listen() using unix socket if argument is a valid port (#4620)
* Fix listen() using unix socket if argument is a valid port

Fixes #4582

* Add test
2023-09-08 16:27:44 -07:00
Ana Margarida Silva
c896792c37 fix(docs): connect websocket client repeated documentation (#4615) 2023-09-08 14:22:28 -07:00
Colin McDonnell
088491cb59 Add extension guide 2023-09-08 13:49:12 -07:00
xxxhussein
f27ef667c7 Delete docs/ecosystem/buchta.md (#4536)
Delete buchta.md since its development is discontinued by LowByteFox: https://twitter.com/LowByteFox/status/1694025965452636612
2023-09-08 13:21:41 -07:00
Arjunkumar
7d9820d478 Update mongoose.md (#4534) 2023-09-08 13:20:07 -07:00
Ethan Steere
b5da5168bf Update Svelte Kit Docs (#4541)
* Update Svelte Kit Docs

I added some guidance about how to build for production. Still WIP since I would like to add a more complete deployment guide.

* Formatting

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-09-08 13:19:53 -07:00
rajatdua
61569fab80 docs(template.md): spelling (#4614) 2023-09-08 13:19:33 -07:00
Frederik De Bleser
0887825f54 Fix code typo in transpiler.md (#4604)
There are some extra closing brackets at the end of the `scanImports` example. These cause a syntax error ("Unterminated string literal")
2023-09-08 12:10:17 -07:00
Colin McDonnell
6d02b18680 Remove await plugin 2023-09-08 11:42:27 -07:00
Vitor Dino
1b8c6f266f docs: fix --backend options list on cache.md (#4599)
`symlink` wasn’t an item, it appeared the same as `copyfile`
2023-09-08 11:19:29 -07:00
Dan Fabulich
989dd92ea8 Move "Importing CJS from CJS" back out of low-level details section (#4600)
This section appears to have been accidentally moved into the low-level details section in 5424ea3403.

This fixes the example in the low-level details section, because the "Importing CJS from CJS" section is not the example code that the low-level details section is intended to provide.
2023-09-08 11:18:52 -07:00
Colin McDonnell
9e3cabc540 Remove community-templates 2023-09-08 10:55:16 -07:00
Ondrej Brablc
3170cf08ba Make the link to application clickable in the terminal (#4544)
Terminals like iTerm require valid URL to make them clickable. Adding a space to make it valid. Similar problem is on https://bun.sh/, where protocol is missing.
2023-09-08 09:33:35 -07:00
Samual Norman
182d3f1567 Fix Bun.CryptoHasher missing argument in docs (#4585) 2023-09-08 09:32:36 -07:00
Tiramify (A.K. Daniel)
189f0f7c36 Update development.md (#4578) 2023-09-08 09:32:15 -07:00
Ashcon Partovi
a05a1780c1 Fix bun-types 2023-09-08 08:29:59 -07:00
Jarred Sumner
822a00c4d5 Fix a couple important bugs (#4560) 2023-09-07 21:07:00 -08:00
Adam
f6a621f36a Fix typo in sveltekit.md (#4550) 2023-09-07 13:11:09 -07:00
dave caruso
5b9d8b87c4 Bump version to Bun 1.0.0 (#4543)
* hi

* Update Version to 1.0.0

* 2

---------

Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2023-09-07 10:57:46 -07:00
Colin McDonnell
a7c3bc8a5a Fix markdown 2023-09-07 10:12:52 -07:00
Colin McDonnell
5424ea3403 Doc updates for v1.0 (#4485)
* Remove v0.x messages

* Add windows section to Installatino

* update

* update

* Update

* Comment out windows
2023-09-07 10:09:09 -07:00
dave caruso
4b63ced72d fix(cli): final touches for 1.0 (#4538)
* better

* cli

* remove submodule

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-07 09:04:21 -07:00
Ciro Spaciari
c8883a39a5 fix(fetch) closeAndFail instead of close (#4537)
* closeAndFail instead of close

* use constant

* add some protection

* dont deinit

---------

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-07 08:34:13 -07:00
dave caruso
36e5a072a9 revert (#4539)
* Revert "remove native events from streams"

This reverts commit e063a47a53.

* finish revert

* remove accidental submodule

* dfghj
2023-09-07 07:45:00 -07:00
dave caruso
57a06745a4 Progress for Next.js (#4468)
* L

* ipc

* asdfghjkl

* dfghjk

* it works!

* types

* patches for next.js

* sdfghj

* wsdfgn,./

* this

* yolo

* okay loser

* asdfghjk

* add some more APIs

* MESS

* sdfghjkl

* remove native events from streams

* stuff

* remove lazy(primordials) test

* debugging

* okay

* less fake extensions object

* fix `Buffer.toString()` args logic

* fix deserialize

* make tests work

* add test for `Buffer.toString` args

* Update server.zig

* remove test

* update test

* Update spawn-streaming-stdin.test.ts

* fix linux build

* Update fs.test.ts

* cli message improvements

* dfshaj

* Fix fs.watch bug maybe?

* remove

---------

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-09-07 04:58:44 -07:00
Ciro Spaciari
4360ec83b4 feat(fetch) rejectUnauthorized and checkServerIdentity (#4514)
* enable root certs on fetch

* rebase

* fix lookup

* some fixes and improvements

* fmt

* more fixes

* more fixes

* check detached onHandshake

* fix promise case

* fix cert non-Native

* add fetch tls tests

* more one test
2023-09-06 22:23:24 -07:00
Birk Skyum
3b9829f171 Update nodejs compat docs cp/cpSync/watchFile/unwatchFile (#4525) 2023-09-06 14:04:07 -07:00
Ashcon Partovi
849a2cdfae Add bun-types to 'bun fmt' script 2023-09-06 10:03:12 -07:00
Ashcon Partovi
77f1f2480d Add types for watchFile and unwatchFile 2023-09-06 10:02:48 -07:00
Ashcon Partovi
5e074209c6 Add types for cp and cpSync 2023-09-06 09:58:00 -07:00
Ashcon Partovi
0c2675c8d3 Remove issue template for install
It's not used, and use the bug issue instead.
2023-09-06 09:37:39 -07:00
dave caruso
a79440f0c3 fix(runtime): fix events.once not working (#4520) 2023-09-06 07:13:05 -07:00
Dylan Conway
daaac7792c allocate task for ThreadSafeFunction (#4513)
* create thread safe function task

* Update napi.zig

* Update napi.zig
2023-09-06 02:04:00 -07:00
Derrick Farris
7c82dc86ba Update development.md (#4480)
Remove comment about removed `BUN_OVERRIDE_MODULE_PATH` env var
2023-09-05 20:28:39 -07:00
Ciro Spaciari
125880af7d update root certs (#4499) 2023-09-05 20:28:20 -07:00
Dylan Conway
70a5cfe908 fix text decode trim (#4495)
* remove trim

* separate function

* a test

* trim when `stream` is true

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-05 17:53:31 -07:00
Jarred Sumner
1bd5b245b8 Align process.nextTick execution order with Node (#4409)
* Align `process.nextTick` execution order with Node

* some tests

* formatting

* fixups

* fix the test failures

* simplify the logic here

* push it up

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
2023-09-05 17:52:57 -07:00
dave caruso
acfd028e8f feat(runtime): Implement fs.watchFile (#4467)
* really lame prototype

* uses threads but badly

* it works i guess

* unwatchFile but lame

* it works

* test

* a

* aomitcs

* fix unwatching race condition

* use hasPendingActivity and GC stuff better

* test

* revert this
2023-09-05 17:41:39 -07:00
dave caruso
6f8a393492 fix(node:net): emit close event on connection error (#4336)
* emit close event on connection error

* re-review

* add test
2023-09-05 16:59:40 -07:00
Ciro Spaciari
6e50dd210f fix(fetch) always use readable stream if it is available (#4503)
* always use readable stream if it is available

* use bun sleep

* fix tests

* rm uws dep
2023-09-05 15:22:09 -07:00
Ciro Spaciari
d268097ded fix SSL proxy tunneling on fetch (#4510) 2023-09-05 15:21:34 -07:00
dave caruso
1e998c1bf2 fix(install): ensure all lockfile structs do not have undefined padding (#4401)
* padding sucks

* this assertion is already done elsewhere

* remove test. will be covered alex's pr i believe?

* fix webkit submodule

* fix uws submodule
2023-09-05 14:25:19 -07:00
Alex Lam S.L
bc2b55fdee fix checkout/build failure due to src/deps/uws (#4505) 2023-09-05 19:16:11 +03:00
Dylan Conway
7dae4db52a fix ipv6 localhost fetch (#4498)
* `node` null for localhost getaddrinfo

* more test
2023-09-05 06:12:54 -07:00
Alex Lam S.L
bcab2f9a0e minor rebuild diffs (#4486) 2023-09-05 14:49:07 +03:00
Jason
a85bd5d083 fix dup syscall on Windows (#4496) 2023-09-05 01:33:30 -07:00
Dylan Conway
f73f77d0de no need to chmod (#4490) 2023-09-04 17:16:37 -08:00
Ciro Spaciari
f1afd58338 fix zlib deflate on fetch (#4483)
* fix zlib deflate on fetch

* mention issue on test

* more tests

* oops
2023-09-04 17:37:47 -07:00
Ai Hoshino
5f34c44ec6 chore: fix typo (#4476)
Close: #4377
2023-09-04 12:35:08 -07:00
Ciro Spaciari
2d80f94eda fix(HTMLRewriter) buffer response before transform (#4418)
* html rewriter response buffering

* pipe the data when marked as used

* fix empty response

* add some fetch tests

* deinit parent stream

* fix decompression

* keep byte_reader alive

* update builds

* remove nonsense

* was not nonsense after all

* protect tmp ret value from GC, fix readable strong ref deinit/init

* fmt

* if we detach the stream we cannot update the fetch stream

* detach checking source

* more tests, progress with javascript and Direct sink

* drop support for pure readable stream for now

* more fixes

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-04 12:26:49 -07:00
Dylan Conway
18767906db initialize JSC for macros from cli 2023-09-03 20:49:06 -07:00
Ai Hoshino
f1b109d5dd fix(syscall): fix handling syscall errno (#4461)
* fix(syscall): fix handling syscall errno
Close: #4198

* remove unused code

* add more tests

* remove unused code
2023-09-03 17:30:30 -07:00
dave caruso
5c43744bce workaround a zig bug (#4440) 2023-09-02 01:39:39 -07:00
Karl Böhlmark
db2faf7c5b docs: fix http simple example log statement (#4320)
Co-authored-by: Karl Böhlmark <karl.bohlmark@netinsight.net>
2023-09-01 23:49:50 -07:00
Jorge Jiménez
bd690bb2b5 Fix typo (#4445)
Replace
`key: [Bun.file('./key1.pem'), Bun.file('./key2.pem']`
with
`key: [Bun.file('./key1.pem'), Bun.file('./key2.pem')]`
2023-09-01 23:49:09 -07:00
Dylan Conway
900f38d144 keep export star as (#4451) 2023-09-01 22:32:27 -07:00
Colin McDonnell
4920f458bc bun-vscode 0.0.8 2023-09-01 22:16:54 -07:00
Colin McDonnell
48cf9dddcb Update commands 2023-09-01 21:35:34 -07:00
Dylan Conway
0019073c8a fix Bun.serve with tls and Bun.file (#4450)
* check sendfile ctx

* add test

* undo blob check

* undo undo and add assert
2023-09-01 20:10:54 -07:00
Dylan Conway
45edb7bcf7 exclusive max 2023-09-01 20:09:45 -07:00
Ashcon Partovi
f0f91a2a31 Fix debug console from appears on start 2023-09-01 19:34:57 -07:00
Ashcon Partovi
94a4cda713 Add configuration options to extension 2023-09-01 18:56:25 -07:00
Ashcon Partovi
eeb683d977 Fix run button starting cwd at / 2023-09-01 15:35:14 -07:00
dave caruso
0fd0ad993b fix(runtime): fix dns_resolver crash (#4435)
* fix incorrect c pointer

* format

* lets go

* random other test case fixed

* hanassagi patch

* Update dns_resolver.zig

* Revert "Update dns_resolver.zig"

This reverts commit 53eb338048.

* See if the tests pass

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-09-01 15:27:59 -07:00
Ashcon Partovi
27de8bbf7b Fix background color 2023-09-01 13:55:19 -07:00
Ashcon Partovi
6bdf24c8ef Allow older versions of VSCode 2023-09-01 13:49:52 -07:00
Ashcon Partovi
57caea5ae7 Fix README for extension 2023-09-01 13:40:48 -07:00
Ashcon Partovi
fe3be666bc Update VSCode extension 2023-09-01 13:34:29 -07:00
Ashcon Partovi
2b421be06f Fix breakpoint on entry for extension 2023-09-01 10:19:14 -07:00
Ashcon Partovi
1ff8155c28 Add Bun.canReload event to inspector 2023-09-01 00:33:33 -07:00
Ashcon Partovi
40d749b480 JavaScript Debug Terminal == Bun Terminal 2023-08-31 23:19:04 -07:00
dave caruso
5288178c86 fix(runtime): fs.cp edge cases (#4439)
* yippee

* enable cpSync tests

* much better

* that doesnt actually do anything

* lose
2023-08-31 23:04:19 -07:00
Dylan Conway
6ae4dd808b only set initial debugger breakpoint once (#4441)
* unset `set_breakpoint_on_first_line` on reload

* move to `module_loader.zig`
2023-08-31 23:03:44 -07:00
Ashcon Partovi
b07bb3ce17 Make breakpoints faster in VSCode extension 2023-08-31 21:42:11 -07:00
Julian
59edbe645c bun install correctly join dependency URLs (#4421)
* use WTF to join registry strings

* show dependency error messages, better join error

We actually report errors when enqueuing dependencies now. I also made
the join URLs error message read better. It'd be cleaner to handle it
all in one place, but there's currently no way to propagate the data up.

* starting on registry URL tests

* added more registry URL tests

* [install] prevent optional/peer deps from failing builds

Couldn't get the peer dependency test to work, but the code is there.

* ran prettier

* changed error note to use realname, updated tests

* ran prettier again...
2023-08-31 17:36:03 -07:00
Dylan Conway
fef70f2473 get name if not provided in FormData.append (#4434)
* get file name from blob if not provided

* add test

* another test

* format
2023-08-31 17:33:08 -07:00
Ashcon Partovi
bd7262f037 Fix vscode debug terminal 2023-08-31 00:18:59 -07:00
Jarred Sumner
10c8013ef2 Create cp-r.mjs 2023-08-30 22:18:04 -07:00
Jarred Sumner
82d26dd9bd Add bench 2023-08-30 21:00:44 -07:00
Ai Hoshino
9334fbe9b4 fix(install): resolve semver matching with pre-release tags. (#4412)
Close: #4398
2023-08-30 18:49:09 -07:00
dave caruso
0a5d2a8195 feat(node:fs): add cp/cpSync/promises.cp + async copyFile (#4340)
* half working disaster code

* this

* async copyFile

* .

* its failing symlink tests

* asdfg

* asdf

* hmm

* okay i think ti works

* small edits

* fix test on linux

* i hate atomics / atomics hate me back <3

* add a message in the builtins bundler that 0.8 is needed. it breaks on older versions lol.

* fixed

* rebase
2023-08-30 18:30:06 -07:00
Dylan Conway
89f24e66ff add life cycle scripts to lockfile metahash (#4420)
* add life cycle scripts to lockfile metahash

* Update lockfile.zig
2023-08-30 18:29:08 -07:00
Alex Lam S.L
037463fc48 [install] fix stale root life-cycle script in lockfile (#4411)
fixes #4319
2023-08-30 17:35:28 -07:00
Dylan Conway
04215e2f3a reset tty at exit (#4419) 2023-08-30 16:38:25 -07:00
Alex Lam S.L
c19714aff7 minor rebuild diffs (#4416) 2023-08-30 14:48:30 -07:00
Ciro Spaciari
908018a4df fix(http/https) disable decompress on http/https client (#4399)
* disable decompress on http/https module

* make js again
2023-08-30 13:50:09 -03:00
Jarred Sumner
f24ca39004 Fix bug in util/types.{isGeneratorFunction,isAsyncFunction} 2023-08-30 00:19:39 -07:00
Jarred Sumner
e3dc5b6b4c reset signal handlers in Bun.spawn (#4405)
* see if this fixes it

* We don't need this

* Remove extra flag

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-30 00:16:08 -07:00
Ashcon Partovi
f2553d2454 More support for DAP (#4380)
* Fix reconnect with --watch

* Support setVariable

* Support setExpression

* Support watch variables

* Conditional and hit breakpoints

* Support exceptionInfo

* Support goto and gotoTargets

* Support completions

* Support both a URL and UNIX inspector at the same time

* Fix url

* WIP, add timeouts to figure out issue

* Fix messages being dropped from debugger.ts

* Progress

* Fix breakpoints and ref-event-loop

* More fixes

* Fix exit

* Make hovers better

* Fix --hot
2023-08-29 23:44:39 -07:00
Jarred Sumner
c028b206bc Fix assertion failure in spawn-related tests (#4400)
* Clean up some of the event loop code

* Support timeouts

* Defer freeing FilePoll

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-29 21:17:56 -07:00
dave caruso
a846852818 fix(node-fetch): use stream.Readable instead of web streams (#4394)
* fix blobFrom

* fix(node-fetch): use stream.Readable instead of web streams

* uncomment

* comment why
2023-08-29 19:45:16 -07:00
Ai Hoshino
3f4bc625ff parse unix socket path param in http.server (#4390) 2023-08-29 19:39:12 -07:00
Jarred Sumner
5d84ef7780 Rename uws_event_loop to event_loop_handle 2023-08-29 15:31:06 -07:00
Jarred Sumner
a77ed151af [git] Normalize line endings 2023-08-29 15:30:07 -07:00
Jarred Sumner
cf151a256c Enforce unix line endings in git 2023-08-29 15:29:09 -07:00
Dylan Conway
de58e9d583 emit open and call close callback (#4384) 2023-08-29 09:44:45 -07:00
Dylan Conway
07d8623976 fix #4356 (#4386) 2023-08-29 01:49:12 -07:00
Ai Hoshino
c53372c9f3 feat(node:dns): implement dns.reverse. (#4332)
* feat(node:dns): implement `dns.reverse`.
Close: #4299

* fix dns reverse for ipv6

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-08-28 20:10:33 -07:00
Dylan Conway
d1c2d6b25c use options.fd if provided for fs.Read/WriteStream (#4378)
* use `options.fd` over path

* tests

* fix `@clack/prompts`

* == null
2023-08-28 20:08:08 -07:00
Colin McDonnell
a2aad40171 docs: use table tag 2023-08-28 13:05:23 -07:00
Colin McDonnell
177e02b304 docs: hot reloading with Bun.serve 2023-08-28 12:55:22 -07:00
Colin McDonnell
726f8aa3ef Update nuxi output 2023-08-28 12:24:51 -07:00
Prabhat Sachdeva
d3626287bd remove uws from .gitmodules (#4374) 2023-08-28 10:39:45 -07:00
Jarred Sumner
a2ddfe6913 Bring uSockets & uWebSockets forks into Bun's repository (#4372)
* Move uWebSockets and uSockets forks into Bun's repository

* Update Makefile

* Update settings.json

* Update libuwsockets.cpp

* Remove backends we won't be using

* Update bindings.cpp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-28 08:38:30 -07:00
Ciro Spaciari
6e4a1f2918 make pending_response and metdata life cycle more clear and make fetch more reliable (#4331)
* make pending_response and metdata life cycle more clear

* typo

* WIP: memory investigation

* check zlib and fix zlib

* use state allocator for metadata

* remove postBodyProcess

* undo some test things

* fix race condition

* fix removing compressed header

* some extra checks

* remove arenas on zlib and comment repoter.assert because of toOwnedSliceZ

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-08-28 07:21:46 -07:00
Jarred Sumner
ebfaa682f7 More renaming 2023-08-28 04:53:51 -07:00
Jarred Sumner
277e5c0b77 mv src/bun.js/node/syscall.zig -> src/sys.zig 2023-08-28 04:53:18 -07:00
Jarred Sumner
e2a17344dc just kernel32 things (#4354)
* just kernel32 things

* more

* Update linux_c.zig

* Update windows_c.zig

* Add workaround

Workaround https://github.com/ziglang/zig/issues/16980

* Rename http.zig to bun_dev_http_server.zig

* Rename usages

* more

* more

* more

* thanks tigerbeetle

* Rename `JSC.Node.Syscall` -> `bun.sys`

* more

* woops

* more!

* hmm

* it says there are only 37 errors, but that's not true

* populate argv

* it says 32 errors!

* 24 errors

* fix regular build

* 12 left!

* Still 12 left!

* more

* 2 errors left...

* 1 more error

* Add link to Tigerbeetle

* Fix the remainign error

* Fix test timeout

* Update syscall.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-28 04:39:16 -07:00
Ai Hoshino
efe987e8d1 Fix some edge cases in the env param of spawn. (#4364)
Close: #4362
2023-08-27 23:58:31 -07:00
Jarred Sumner
ed5dc5bbf9 @electroid's dap changes (#4367)
* Rework terminal, launch is still WIP

* Use the proper Terminal profile API

* More changes

* progress

---------

Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2023-08-27 09:03:15 -07:00
Jarred Sumner
36f9d2291c Workaround zig wasm bug 2023-08-26 21:09:08 -07:00
Jarred Sumner
9e653e610c Update WebKit 2023-08-26 03:10:16 -07:00
Jarred Sumner
f16d729c76 Set the timezone in spawn (#4337)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-26 02:35:10 -07:00
Ashcon Partovi
2a9e967fd1 More improvements to debugger support (#4345)
* More fixes for dap

* More changes

* More changes 2

* More fixes

* Fix debugger.ts

* Bun Terminal
2023-08-26 02:34:25 -07:00
Ai Hoshino
910daeff27 Fix the crash when importing a module that does not exist. (#4348)
Close: #4240
2023-08-26 01:14:40 -07:00
Jarred Sumner
e1dacf88d0 don't get too excited but there are at least hundreds of compiler errors when you run this command 2023-08-25 22:05:02 -07:00
Jarred Sumner
d72763dc29 bump! 2023-08-25 21:54:16 -07:00
Jarred Sumner
d98a93c318 Automatically hot reload Bun.serve() (#4344)
* Automatically hot reload Bun.serve()

* Update doc

* Update example

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-25 21:08:41 -07:00
Colin McDonnell
f70bb2497b Fix link 2023-08-25 12:50:13 -07:00
Colin McDonnell
d62b0c3652 Readability tweaks 2023-08-25 12:47:47 -07:00
Jarred Sumner
21b2d5c3a5 Update executables.md 2023-08-25 04:45:41 -07:00
Jarred Sumner
10815a7d43 Update executables.md 2023-08-25 04:33:54 -07:00
Jarred Sumner
f839640c17 Update executables.md 2023-08-25 04:32:20 -07:00
Jarred Sumner
557e912d9a Fix assertion failure with sourcemaps in multi-threaded transpiler (#4321)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-25 04:00:54 -07:00
Jarred Sumner
1e75a978e5 Skip disabled test 2023-08-25 04:00:23 -07:00
Jarred Sumner
95e8c24db1 Update WebKit 2023-08-25 03:56:44 -07:00
Jarred Sumner
755f41fe2a [Inspector] Get firefox to work 2023-08-25 03:56:39 -07:00
Jarred Sumner
9aabe4eea1 Upgrade peechy 2023-08-25 01:43:25 -07:00
Jarred Sumner
90f3bf2796 Update http.md 2023-08-24 23:05:27 -07:00
Jarred Sumner
16b4bf341a Disable minifying "str".length until https://github.com/oven-sh/bun/issues/4217 is fixed 2023-08-24 23:00:53 -07:00
Ashcon Partovi
1480889205 Improved support for debug-adapter-protocol (#4186)
* Improve support for \`debug-adapter-protocol\`

* More improvements, fix formatting in debug console

* Fix attaching

* Prepare for source maps

* Start of source map support, breakpoints work

* Source map support

* add some package.jsons

* wip

* Update package.json

* More fixes

* Make source maps safer if exception occurs

* Check bun version if it fails

* Fix console.log formatting

* Fix source maps partly

* More source map fixes

* Prepare for extension

* watch mode with dap

* Improve preview code

* Prepare for extension 2

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-24 22:53:34 -07:00
Jarred Sumner
f269432d90 Listen on a unix domain socket with Bun.serve() (#4311)
* Update response.zig

* Comment this out for now

* Support unix domain socket in Bun.serve()

* Add test

* add types

* Update JSFetchHeaders.cpp

* comment this test out

* tls unix web socket serve options

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
2023-08-24 22:49:58 -07:00
Colin McDonnell
73b3fb7b0f Add guides for test runner (#4308) 2023-08-24 22:28:07 -07:00
Ashcon Partovi
2bcbafe7d3 Fix debugger not updating after reload with --hot 2023-08-24 20:09:32 -07:00
Colin McDonnell
f7f734788c Update tsconfig.base.json 2023-08-24 19:54:03 -07:00
Colin McDonnell
2cd1d59387 Update toml import type test 2023-08-24 19:52:53 -07:00
Colin McDonnell
b70210a005 Use noEmit 2023-08-24 19:51:14 -07:00
Code Hz
b9c2309c8a Remove conflict option in tsconfig-for-init.json (#4284)
fix https://github.com/oven-sh/bun/issues/4283
2023-08-24 19:41:23 -07:00
Jarred Sumner
43c4da8c9a Update build-id 2023-08-24 19:39:54 -07:00
Jarred Sumner
8a48e8bb0b Report extra memory more (#4289)
* Report memory allocated in fetch

* Memory size reporting to `Headers`

* Fixup memory reporting allocator

* Make these tests do more

* cleanup some of this

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-24 19:39:00 -07:00
Dylan Conway
097ae4e982 fix build 2023-08-24 19:05:40 -07:00
Alex Lam S.L
213f5bef9d [install] fix stale life-cycle scripts from lockfile (#4307)
fixes #4269
2023-08-24 17:18:51 -07:00
Alex Lam S.L
e115638cba [install] fix crash when installing package that uses loose semver pre-release (#4302)
- also fix parsing of `1.2.3pre+build`

fixes #4266
2023-08-24 17:17:48 -07:00
Ai Hoshino
6e57556fad Fix(node:http): fix URL formatting when using a proxy. (#4297)
Close: #4295
2023-08-24 17:17:18 -07:00
Ai Hoshino
339d2c7f19 Make the server not crash if an error occurs in dev build. (#4300)
Close: #4298
2023-08-24 17:16:51 -07:00
Jarred Sumner
d2bef4fbea Don't inline require/import errors at runtime (#4306)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-24 17:03:05 -07:00
Jason
19aa9d93de update zig to 0.11.0 (#4233)
* WIP

* backup

* more change

* json related error sovled

* number related issue solved

* revert WriterType changed before

* destroy -> free

* jsonStringify related issues solved

* fix mem.free expected []T or *[_]T, passed [*]const u8

* fix expected []T or *[_]T, passed [*:0]const u8

* fix build script

* fix build script, for real

* replace 0.11.0-dev.4006+bf827d0b5 to 0.12.0-dev.161+6a5463951

* fix build on macOS, COPYFILE.DATA -> COPYFILE_DATA

* fix the last destroy on [*]ptr issue

---------

Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2023-08-24 16:13:14 -07:00
jhmaster
55eb4ffe8f Update bun-polyfills & bun-wasm (#4246)
* automate Bun.version & revision polyfills

* polyfill Bun.gc

* bun:jsc module initial polyfills

* update peechy schema

* bun-polyfills: fix some project configs

* bun-wasm: lots of fixes

* bun-polyfills: Bun.Transpiler impl.

* revision hash update
2023-08-24 14:39:28 -07:00
Jarred Sumner
a051a6f620 Fix performance regression in reading from the request body (#4291)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-24 14:36:39 -07:00
Jarred Sumner
9c68abdb8d wip (#4282)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-24 01:32:22 -07:00
Jarred Sumner
ad326b7734 [Inspector] Fix bug with sourcemaps including internal metadata bytes 2023-08-23 22:22:55 -07:00
Colin McDonnell
aa08c35c06 Add Debugger docs and a couple guides (#4281)
* Add debugger docs. Add guides.

* Add files
2023-08-23 18:15:21 -07:00
dave caruso
20d42dfaa3 Fix <const T>() => (#4278) 2023-08-23 17:22:54 -07:00
VietnamecDevelopment
3556fa3b1e Update globals.d.ts (#4276) 2023-08-23 16:25:05 -07:00
Code Hz
5e07fd4fbc Fix ffi type (#4265)
* add readonly so it works with as const

* split ffi type infer to args and returns

* add JSCallback to FFITypeToArgsType

* add read functions

* simplify FFITypeOrString

* fix cstring type

* fix pointer type test

* fix readonly

* add unknown handling

* trigger action

* use Parameters

* add read type test

* add other read function to tests
2023-08-23 15:56:46 -07:00
Jarred Sumner
c60385716b Bunch of streams fixes (#4251)
* Update WebKit

* Don't do async hooks things when async hooks are not enabled

* Smarter scheduling of event loop tasks with the http server

* less exciting approach

* Bump WebKit

* Another approach

* Fix body-stream tests

* Fixes #1886

* Fix UAF in fetch body streaming

* Missing from commit

* Fix leak

* Fix the other leak

* Fix test

* Fix crash

* missing duperef

* Make this code clearer

* Ignore empty chunks

* Fixes #3969

* Delete flaky test

* Update bun-linux-build.yml

* Fix memory issue

* fix result body, and .done status before the last callback, dont touch headers after sent once

* refactor HTTPClientResult

* less flasky corrupted test

* oops

* fix mutex invalid state

* fix onProgressUpdate deinit/unlock

* fix onProgressUpdate deinit/unlock

* oops

* remove verbose

* fix posible null use

* avoid http null

* metadata can still be used onReject after toResponse

* dont leak task.http

* fix flask tests

* less flask close tests

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
2023-08-23 14:05:05 -07:00
Quentin
f3266ff436 docs: remove broken DNS link which is also not present in the official docs (#4268) 2023-08-23 10:36:26 -07:00
xxxhussein
b01764b31e Fix more types. (#4273) 2023-08-23 10:35:51 -07:00
Jozef Steinhübl
851763174e ask for bun --revision instead bun -v (#4256) 2023-08-23 00:42:33 -07:00
dave caruso
8518fbb573 fix yield (#4264) 2023-08-22 21:54:59 -07:00
Colin McDonnell
d86084dd8e Fix Bun.inspect types 2023-08-22 14:28:01 -07:00
dave caruso
52802a4c55 fix fsevents and stub for qwikcity (#4247)
* fix test

* ok

* cm

* EE

* remove the hack we didnt need
2023-08-21 23:39:56 -07:00
Dylan Conway
44e4d5852a fix stdin stream unref and resuming (#4250)
* fix stream unref and resuming stream

* fix `child-process-stdio` test
2023-08-21 23:39:41 -07:00
Colin McDonnell
3a45f2c71b Docs and types for v0.8.0 (#4199)
* Improve test documentation

* Update nodejs compat docs with tty

* Add debugger guide

* Document Bun.inspect.custom, improve bun test nav

* Address reviews

* Update Bun.file types

* Add Nuxt guide

* Add tty types
2023-08-21 21:34:03 -07:00
Jarred Sumner
9eeb7bdbff Bun v0.8 2023-08-21 21:26:45 -07:00
Jarred Sumner
ed14b64e65 Make the code generator less duplicative 2023-08-21 21:24:49 -07:00
Jarred Sumner
bca1bcf29c import errors have code set to ERR_MODULE_NOT_FOUND and require errors have code set to MODULE_NOT_FOUND (#4244)
* ResolveMessage

* Fix it

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-21 21:11:27 -07:00
Ciro Spaciari
9027484ae1 fetch(stream) add stream support for compressed and uncompressed data (#4127)
* streams non compressed data in 64kb chunks (at least)

* fmt

* wip remove pause

* fix default streaming and buffering

* fix atomic lags

* fix size

* make chunked encoding work again (WIP streaming chunked)

* WIP: chunked encoding streaming

* fix end of streamings

* working streaming + compression

* add fixes + tests

* fmt + fix proxy

* fix oopsies

* codegen after merge

* fmt + fixes

* more fixes

* more fixes and logs

* avoid double free

* check empty before pop

* check empty on pop

* fix copy to real when complete

* remove unnecessary logs

* better has_schedule_callback swap, body locked size helper, remove isEmpty from unbounded_queue pop

* fix response ref, fix body_size

* add deflate support, fix error throw, add more tests

* codegen after merge

* remove logs, add connection close test

* fix macOS build

* fix redirect error option

* make body_size more clear

* support new Reponse(response)

* toString DOMWrapper objects properly instead of supporting response in Response constructor

* ignore headers with no name, add more tests

* oops

* handle transform with fetch

* add gz image stream test

* remove duplicate test

* fix missing chunk on macOS under pressure

* oops include all OS

* some fixes

* compare buffers instead of sizes

* refactor err.err and protect it
2023-08-21 20:30:34 -07:00
dave caruso
91eacade97 Fix inquirer (#4245) 2023-08-21 19:32:41 -07:00
Jarred Sumner
6a02edef5d Update module_loader.zig 2023-08-21 19:04:18 -07:00
Ai Hoshino
a61953bbfd Fix(bundler): allow generating exe file in nested path. (#4226)
* Fix(bundler): allow generating binary file in nested path.
Close: #4195

* Add read flag for fd.

* refactor
2023-08-21 18:22:37 -07:00
Colin McDonnell
f629365cb7 Fix typo 2023-08-21 17:48:48 -07:00
dave caruso
cdace9bffb Fix crypto.EC constructor (#4242)
* Fix EC constructor

* make js
2023-08-21 16:40:25 -07:00
dave caruso
664119841a Implement napi_ref_threadsafe_function (#4156)
* Implement napi_ref_threadsafe_function

* work on this

* i hate event loops

* little better

* clean
2023-08-21 16:26:07 -07:00
dave caruso
397182b400 feat: Implement Bun.inspect.custom (#4243)
* add Bun.inspect.custom

* test

* Add Types
2023-08-21 16:25:37 -07:00
Jarred Sumner
752e59f23c Fixes #4089 (#4105)
* Fixes #4089

* Update bindings.cpp

* address PR feedback

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-21 16:25:23 -07:00
Jarred Sumner
def5a85d90 40x faster .toString('hex') (#4237)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-21 08:31:17 -07:00
Jarred Sumner
1b8f569792 Fix memory leak in buffer.toString("hex") (#4235)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-21 03:31:33 -07:00
xxxhussein
183b818462 Update README.md (#4232)
Fix typo in README.md
2023-08-21 01:32:08 -07:00
Jarred Sumner
9cf868fef4 Add missing header change 2023-08-21 01:30:45 -07:00
Jarred Sumner
ed803f7d1c Add LazyProperty 2023-08-21 01:30:13 -07:00
Jarred Sumner
c13a27121c Fix BigIntStats generated class
cc @paperdave, code generator script misses a constructor decl when this isn't true
2023-08-21 01:30:01 -07:00
Jarred Sumner
8c23e77e99 Regenerate 2023-08-21 01:29:15 -07:00
Jarred Sumner
c99a9ba33a Implement File 2023-08-21 01:29:06 -07:00
Jarred Sumner
f75b949524 Fixes #1675 (#4230)
* Fixes https://github.com/oven-sh/bun/issues/1675

* Add fallback for Bun.write

* Update blob.zig

* Fix test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-20 21:29:09 -07:00
Jarred Sumner
3de9ce5f30 Implement --inspect-brk (#4222)
* Implement `--inspect-brk`

* Bump WebKit

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-20 19:34:33 -07:00
Jarred Sumner
65280853ac Fix test failures from 3a9a6c63a (#4231)
cc @Hanaasagi

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-20 19:22:55 -07:00
Ai Hoshino
3a9a6c63ac Fix(bundler): use different alias mappings based on the target. (#4163)
* Fix(bundler): use different alias mappings based on the target.
Close: #3844

* chore: reduce duplicated code.

* chore: split to two separate ComptimeStringMap.
2023-08-20 01:52:17 -07:00
Jarred Sumner
360acf5a80 Update BunDebugger.cpp 2023-08-19 22:11:48 -07:00
Jarred Sumner
d432dad666 Introduce bun --inspect-wait
This waits for the inspector to connect before beginning execution
2023-08-19 22:07:35 -07:00
Jarred Sumner
eec5bfb23a misc non-posix fixes 2023-08-19 20:14:29 -07:00
Jarred Sumner
53c755467b Update lockfile.md 2023-08-19 19:10:20 -07:00
Jarred Sumner
039404800f Update lockfile.md 2023-08-19 19:09:10 -07:00
Jarred Sumner
3c4b689050 Update lockfile.md 2023-08-19 19:08:17 -07:00
Omar
394dd86797 Update Dockerfile-distroless (#4210) 2023-08-19 18:48:59 -07:00
Jarred Sumner
62bde005b2 Fix symbol visibility 2023-08-19 18:48:07 -07:00
Jarred Sumner
19054ebc35 [napi] Implement node_api_create_syntax_error, node_api_symbol_for, node_api_throw_syntax_error
These were marked as experimental
2023-08-19 18:34:56 -07:00
Jarred Sumner
507761b463 Fix crash impacting sharp & resvg (#4221)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-19 18:17:16 -07:00
Jarred Sumner
196620183f Fixes #172 (#4220)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-19 17:46:59 -07:00
Jarred Sumner
86ad015147 Add inline sourcemaps when --inspect is enabled (#4213)
* Add inline sourcemaps when --inspect is enabled

* Add some assertions

* Update javascript.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-19 00:20:23 -07:00
Dylan Conway
db09ed15fd tty ReadStream, WriteStream, and readline rawmode (#4179)
* tty `WriteStream`, `ReadStream`, and rawmode

* tests

* refactor prototypes

* fix failing test

* fix test and library usage

* more merge

* fix child_process test

* create pseudo terminal for tty tests

* match node logic

* handle invalid tty

* close descriptors

* move tests to another process

* fix test again

* fix test on linux
2023-08-19 00:11:24 -07:00
Jarred Sumner
bf517d9f8e Fix make headers (again) 2023-08-18 22:14:38 -07:00
Jarred Sumner
e9b684c972 Add HTMLRewriter microbnechmark 2023-08-18 22:14:24 -07:00
Jarred Sumner
e8f0ed3beb Fix make headers 2023-08-18 22:09:27 -07:00
Jarred Sumner
3ca7fde363 prettier 2023-08-18 20:41:54 -07:00
Brúnó Salomon
c2ec47ff32 feat: add self-closing & can-have-content (#4206) 2023-08-18 19:59:23 -07:00
dave caruso
26036a390b Implement BigIntStats (#4208)
* Implement BigIntStats

* changes

* rename test

* comment

* test changes?
2023-08-18 19:59:03 -07:00
Jarred Sumner
943a664224 Remove most C API usages, add debugger pretty printers for Headers, URLSearchParams, FormData, Worker, EventTarget (#4187)
* Add pretty printers for `Headers`, `URLSearchParams`, and `FormData`

* [untested] Add way to code generate getInternalProperties

* bump

* Bump Webkit

* Ref the event loop while loaded

* wip

* checkpoint

* another checkpoint

* The code has been written

* Fixup exports

* Fix all the errors

* Fix bug

* [console.log] Fix bug when printing non-reified types missing values

* Fix loading hash table

* fix plugin

* Fix ref & unref

* auto-unref

* various fixes

* Update bun.zig

* Set toStringTag

* Delete code for macro JSX

* Delete code for `bun dev` HTTP JS

* Move Bun.serve to C++ API

* Delete JSC C API code

* ✂️ 💀 code

* Use JSC C++ for `confirm`, `Crypto`, `prompt`, `alert`

* more dead code

* Update exports.zig

* Use JSC C++ API for FFI

* Remove remaining usages

* Remove remaining usages

* Update ffi.ts

* Update InternalModuleRegistryConstants.h

* draw the rest of the owl

* Update webcore.zig

* bind it

* Fix performance regression in crypto.randomUIUD()

* Update js_parser.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-18 19:58:03 -07:00
Dylan Conway
d0664f8377 fix --bail test 2023-08-18 14:51:55 -07:00
dave caruso
6fd0043f6b Add util.inspect.custom support to util.inspect/Bun.inspect/console.log (#4194)
* start work on util.inspect.custom

* asdf

* finish util inspect custom inspect

* inspect

* fix tests

* revert

* tidy

* revert

* oops

* test

* fix issues
2023-08-17 20:56:52 -07:00
dave caruso
0424fd8f6e Support Nitro (#4098)
* Add formatWithOptions

* tests and tweaks

* adjust

* changes

* hi

* add mark/measure stubs

* stuff

* allow unix absolute paths here

* typo

* rebase

* fix stats
2023-08-17 19:34:05 -07:00
Colin McDonnell
cfbd1373e2 Update Astro guide 2023-08-17 18:38:10 -07:00
dave caruso
f74585ff01 Allow IncomingRequest.req to be overwritten. (#4154)
* Allow IncomingRequest.req to be overwritten.

* add test

* fix test

* yoo
2023-08-17 14:57:43 -07:00
Ai Hoshino
b2f8ef4dff Fix(node:fs): add buffer parameter in fs.read callback. (#4191)
Close: #4178
2023-08-17 14:27:33 -07:00
Brúnó Salomon
b0e76a965d refactor: move HTMLRewriter to c++ bindings (#4193) 2023-08-17 14:25:09 -07:00
Colin McDonnell
cfce38858f Fix description for executables page 2023-08-17 14:07:36 -07:00
Colin McDonnell
540740c129 Add Astro guide (#4110) 2023-08-17 12:51:45 -07:00
xxxhussein
b1356718ad correct guide's bunfig example option (#4192) 2023-08-17 12:13:16 -07:00
Colin McDonnell
b9b50e39d6 Fix broken link 2023-08-16 22:58:36 -07:00
Jarred Sumner
6c3dabd84e Fix leaking .ptr (#4181)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-16 22:10:01 -07:00
Colin McDonnell
d4438e9496 Add solidstart guide (#4182) 2023-08-16 21:30:37 -07:00
Colin McDonnell
56d591b903 Add sveltekit guide (#4180) 2023-08-16 20:52:49 -07:00
Jarred Sumner
0486cea35a bun --inspect (#4158)
* Let the debugger to pause/resume the event loop

* Add initial support for Debug Adapter Protocol

* Add progress

* Update Worker.cpp

* Fix require("console") #3820 (#4073)

* Fix #3820

* Add Module (#4074)

* Set exports to {} in user-constructed CommonJSModuleRecords (#4076)

* feat(bun/test): Implement "toSatisfy" & "toIncludeRepeated" (fwup) (#3651)

* Fix merge issues

* oop

* make codegen

* Fix build issues

---------

Co-authored-by: dave caruso <me@paperdave.net>

* worker tests (#4058)

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

* feat(bun:test) add support for test.each() and describe.each() (#4047)

* rename callback to func

* update testscope to handle function arguments

* works

* big cleanup

* works in debug, not release

* fix memory issue & update tests

* catch & str test

* write types for each() & switch tests to ts

* rm & typo

* move some code around & support describe

* review changes

* Fix one of the astro segfaults, also fix bun init version (#4079)

* 4->16

* add assertions

* fix version stuff

* Remove unintentional logs from #4043

* Run prettier

* Update main-worker-file.js

* Update SIMDUTF (#4078)

* Fix constructing buffer from a UTF16 string with the Latin1 encoding. (#4086)

Close: #3914

* Add support for `bun --revision` (#4027)

Co-authored-by: Yash Sharma <yashsharma@Yashs-MacBook-Air.local>

* Updates

* Update __global.zig

* remove non-node node-fallbacks (#4082)

* remove non-node node-fallbacks.

* organize the imports

* Fix test

* Sync bun-polyfills branch (#4081)

* bun-polyfills: initial impl. & baseline refactor

* move @types/ws dep from root to /test/

* bun-types: remove ReadableStream.forEach method
(this does not exist, probably added by mistake)

* bun-polyfills: remove extraneous stream utils

* bun-polyfills: add types syncing file

* bun-polyfills: re-arrange global polyfills

* bun-polyfills: fix FileBlob streams types again

* bun-polyfills: sync all of @types/node

* bun-polyfills: typeguard all current polyfills

* bun-polyfills: fix import paths

* bun-polyfills: switch to wasm impl. of farmhash

* bun-polyfills: support default import of bun obj

* bun-polyfills: transpiler placeholder file

* bun-polyfills: loaderless import.meta polyfill

* bun-polyfills: refactor import.meta polyfill

* bun-polyfills: repl entrypoint & todo list index

* bun-types: Add null to return type of Bun.which

* bun-types: match Bun.sha with Bun.hash.SHA512_256

* bun-polyfills: new "repl" package.json script

* bun-polyfills: full refactor of toplevel hashes

* bun-polyfills: these are fixed

* bun-types: NODE_ENV is optional

* bun-polyfills: fix Bun.env types

* bun-types+polyfills: fix HeapSnapshot.version type

* bun-polyfills: fix some web streams type conflicts

* bun-polyfills: update internal FileBlob.slice

* bun-polyfills: fix subproc stdin conversions

* bun-polyfills: better internal fileblob types

* bun-polyfills: try to sync global performance type

* bun-polyfills: working zig wasm polyfills setup

* bun-polyfills: update scripts

* bun-polyfills: fix wasm file location resolution

* bun-polyfills: goodbye farmhash (replaced by zig)

* bun-polyfills: move all Bun.hash polyfills to zig

* bun-polyfills: reimpl. seeding of seeded hashes

* bun-polyfills: impl. undocumented murmur32v2

* bun-polyfills: switch zighash from jsdoc to .d.ts

* bun-types: partial fix of Hash types

* bun-polyfills: documented Hash.murmur32v2

* bun-polyfills: misc updates

* bun-polyfills: enable sourcemaps

* bun-polyfills: handle empty inputs to hash funcs

* bun-types: narrow down hash func types

* bun-polyfills: remove unnecessary bigint casts

* bun-polyfills: impl. Bun.isMainThread

* bun-polyfills: impl. Bun.sleep and fix sleepSync

* bun-polyfills: impl. indexOfLine

* bun-polyfills: impl. Bun.peek.status

* bun-types: fix hashing test

---------

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

* Add remix guide

* Fix title

* add util.formatWithOptions (#4090)

* Add formatWithOptions

* tests and tweaks

* adjust

---------

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

* bun test: format description of test.each (#4092)

* bun test: format description

* add tests for tests

* only

---------

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

* Fixes #4062 (#4106)

* Fixes #4062

* Update encoding.zig

* Use faster C++ impl

* Update wtf-bindings.cpp

* undo

* Fixup

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>

* zig fmt

* Update remix guide

* fs.zig: create temp files with 0o700, not 0o007 (#4107)

* Handle thundering herd of setInterval (#4109)

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>

* Fix memory leak in base64url (#4111)

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>

* run files without extensions (#4113)

* run script without extension

* process stdio write fix

* don't check for trailing slash, var stream

* More lazily initialize these static strings

* Remove assertion

* wip

* Add --inspect flag

* Deprecate loading `node_modules.bun`

* realpath

* regenerate schema

* More

* more

* Update cli.zig

* Debugger JS loads

* have fun

* Most of the code

* Its starting to work.

* more progress

* win some, lose some

* Update dap.ts

* Async Context Tracking

* untested websocket

* Emit Console messages

* Error handling

* errors

* Make profiling work better

* [clap] CLI arguments with optional values ignore positional params

In `bun --inspect foo.js`, `foo.js` should not be the value of `--inspect`. It is a positional parameter. `--inspect=foo`

* Support multiple simultaneous clients, automatically unpause on disconnect

* regenerate

* Update Makefile

* Update WebKit

* Update cli.zig

* Update InternalModuleRegistry+createInternalModuleById.h

* BaseURL

* Update WebKit

* Add web-inspector-bun

* Update build.ts

* formatting, mostly

* Update debugger.ts

* Update InternalModuleRegistryConstants.h

* wrap

* Update test

* Update test

---------

Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Tiramify (A.K. Daniel) <94789999+TiranexDev@users.noreply.github.com>
Co-authored-by: Jacques <25390037+jecquas@users.noreply.github.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Ai Hoshino <ambiguous404@gmail.com>
Co-authored-by: Yash Sharma <yashosharma@gmail.com>
Co-authored-by: Yash Sharma <yashsharma@Yashs-MacBook-Air.local>
Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
Co-authored-by: jhmaster <32803471+jhmaster2000@users.noreply.github.com>
Co-authored-by: Adhityaa Chandrasekar <github@adtac.in>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2023-08-16 19:40:20 -07:00
Ciro Spaciari
2634c64aa3 Fix prisma linux generation (#4150)
* check

* fmt + fix

* fmt

* ops

* add more targets

* more targets

* oops

* update bun lock and prisma

* manually add openssl

* targets on sqlite
2023-08-16 16:12:02 -07:00
Dylan Conway
af23dab833 Create domjit.test.ts (#4173) 2023-08-15 22:13:13 -07:00
Dylan Conway
9efeef2e24 res.then 2023-08-15 21:51:43 -07:00
dave caruso
67a8b75183 fix this page (#4172) 2023-08-15 19:02:46 -07:00
Dylan Conway
bdaa712357 disable domjit for Buffer.alloc 2023-08-15 19:00:02 -07:00
dave caruso
b682e5bf59 Fix event loop issue with Bun.connect (#4157)
* Fix event loop issue with Bun.connect

* sorry

* add test and fix another edge case
2023-08-15 18:09:11 -07:00
Dylan Conway
17c348ed0a fix make headers 2023-08-15 14:56:21 -07:00
Dylan Conway
f05a38757a fix build 2023-08-15 14:33:45 -07:00
Ai Hoshino
553a471cdf chore: fix method name typo (#4162) 2023-08-15 08:11:11 -07:00
dave caruso
1a6a52314f fix importing too long of strings (#4155) 2023-08-15 01:56:37 -07:00
dave caruso
47450ed12c Make builtins' source origin use a valid url (#4152)
* Make source origin use a valid url

* disable minifyWhiteSpace

* the change
2023-08-14 20:28:18 -07:00
Colin McDonnell
eab7b4c3ea Small docs change 2023-08-14 12:08:33 -07:00
dave caruso
0329061f15 fix makefile (#4148) 2023-08-13 20:43:44 -07:00
Revenity
1e96cbfb02 Update Stric guides (#4137) 2023-08-12 20:03:41 -07:00
dave caruso
78defe7a87 Fix worker event loop ref/unref + leak (#4114)
* make more tests pass

* worker changes

* fix some bugs

* remove this

* progress

* uh

* okay

* remove console log

* a

* comment assert for later

* mergable state

* remove test

* remove test
2023-08-12 13:51:03 -07:00
Ai Hoshino
b94433ce86 Fix using uninitialized variable when formatting config_path. (#4129)
Close: #4128
2023-08-11 22:14:08 -07:00
Jarred Sumner
ca26780b27 Deprecate loading node_modules.bun (#4131)
* Deprecate loading `node_modules.bun`

* realpath

* regenerate schema

* More

* more

* Update cli.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-11 22:13:46 -07:00
jhmaster
117cee5ca5 bun-wasm fixes & improvements (#4126)
* automate Bun.version & revision polyfills

* polyfill Bun.gc

* bun:jsc module initial polyfills

* fixes & improvements to bun-wasm
2023-08-11 18:20:21 -07:00
Jarred Sumner
43ebffedcd Support TypeScript's export type * as Foo from 'bar' (#4125)
* [TypeScript] Support `export type * as Foo from 'bar'`

* Update js_parser.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-11 18:06:48 -07:00
Jarred Sumner
ccb9daf7a4 Fix wasm build 2023-08-11 16:24:29 -07:00
Jarred Sumner
c6d3b375b8 async realpath (#4117)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-10 22:15:07 -07:00
Jarred Sumner
4731a460a2 Remove assertion 2023-08-10 19:58:59 -07:00
Jarred Sumner
99af827f25 More lazily initialize these static strings 2023-08-10 19:56:02 -07:00
Dylan Conway
a6ec7fe9b1 don't check for trailing slash, var stream 2023-08-10 19:06:51 -07:00
Dylan Conway
513a6d0df3 run files without extensions (#4113)
* run script without extension

* process stdio write fix
2023-08-10 19:00:06 -07:00
Jarred Sumner
115704b27b Fix memory leak in base64url (#4111)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-10 16:43:19 -07:00
Jarred Sumner
85b81624dc Handle thundering herd of setInterval (#4109)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-10 15:25:52 -07:00
Adhityaa Chandrasekar
cf12d80f5e fs.zig: create temp files with 0o700, not 0o007 (#4107) 2023-08-10 14:00:13 -07:00
Colin McDonnell
58e74eadb5 Update remix guide 2023-08-10 13:54:17 -07:00
Jarred Sumner
be05b93f39 zig fmt 2023-08-10 13:32:37 -07:00
Jarred Sumner
e25833d009 Fixes #4062 (#4106)
* Fixes #4062

* Update encoding.zig

* Use faster C++ impl

* Update wtf-bindings.cpp

* undo

* Fixup

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-10 13:32:04 -07:00
Jacques
e65535cc05 bun test: format description of test.each (#4092)
* bun test: format description

* add tests for tests

* only

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-08-10 13:29:53 -07:00
dave caruso
74f9fabd01 add util.formatWithOptions (#4090)
* Add formatWithOptions

* tests and tweaks

* adjust

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-08-10 13:09:03 -07:00
Colin McDonnell
8d207925d7 Fix title 2023-08-10 12:37:14 -07:00
Colin McDonnell
e0569ac47a Add remix guide 2023-08-10 12:36:54 -07:00
jhmaster
40befd8770 Sync bun-polyfills branch (#4081)
* bun-polyfills: initial impl. & baseline refactor

* move @types/ws dep from root to /test/

* bun-types: remove ReadableStream.forEach method
(this does not exist, probably added by mistake)

* bun-polyfills: remove extraneous stream utils

* bun-polyfills: add types syncing file

* bun-polyfills: re-arrange global polyfills

* bun-polyfills: fix FileBlob streams types again

* bun-polyfills: sync all of @types/node

* bun-polyfills: typeguard all current polyfills

* bun-polyfills: fix import paths

* bun-polyfills: switch to wasm impl. of farmhash

* bun-polyfills: support default import of bun obj

* bun-polyfills: transpiler placeholder file

* bun-polyfills: loaderless import.meta polyfill

* bun-polyfills: refactor import.meta polyfill

* bun-polyfills: repl entrypoint & todo list index

* bun-types: Add null to return type of Bun.which

* bun-types: match Bun.sha with Bun.hash.SHA512_256

* bun-polyfills: new "repl" package.json script

* bun-polyfills: full refactor of toplevel hashes

* bun-polyfills: these are fixed

* bun-types: NODE_ENV is optional

* bun-polyfills: fix Bun.env types

* bun-types+polyfills: fix HeapSnapshot.version type

* bun-polyfills: fix some web streams type conflicts

* bun-polyfills: update internal FileBlob.slice

* bun-polyfills: fix subproc stdin conversions

* bun-polyfills: better internal fileblob types

* bun-polyfills: try to sync global performance type

* bun-polyfills: working zig wasm polyfills setup

* bun-polyfills: update scripts

* bun-polyfills: fix wasm file location resolution

* bun-polyfills: goodbye farmhash (replaced by zig)

* bun-polyfills: move all Bun.hash polyfills to zig

* bun-polyfills: reimpl. seeding of seeded hashes

* bun-polyfills: impl. undocumented murmur32v2

* bun-polyfills: switch zighash from jsdoc to .d.ts

* bun-types: partial fix of Hash types

* bun-polyfills: documented Hash.murmur32v2

* bun-polyfills: misc updates

* bun-polyfills: enable sourcemaps

* bun-polyfills: handle empty inputs to hash funcs

* bun-types: narrow down hash func types

* bun-polyfills: remove unnecessary bigint casts

* bun-polyfills: impl. Bun.isMainThread

* bun-polyfills: impl. Bun.sleep and fix sleepSync

* bun-polyfills: impl. indexOfLine

* bun-polyfills: impl. Bun.peek.status

* bun-types: fix hashing test

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-08-10 12:17:39 -07:00
Jarred Sumner
6718950a39 Fix test 2023-08-10 12:08:05 -07:00
dave caruso
68ac8c12c2 remove non-node node-fallbacks (#4082)
* remove non-node node-fallbacks.

* organize the imports
2023-08-10 11:57:37 -07:00
Jarred Sumner
28d1676d50 Update __global.zig 2023-08-09 16:50:00 -07:00
Colin McDonnell
883c4d8778 Updates 2023-08-09 13:47:32 -07:00
Yash Sharma
8717303a80 Add support for bun --revision (#4027)
Co-authored-by: Yash Sharma <yashsharma@Yashs-MacBook-Air.local>
2023-08-09 10:43:04 -07:00
Ai Hoshino
385d440694 Fix constructing buffer from a UTF16 string with the Latin1 encoding. (#4086)
Close: #3914
2023-08-09 09:45:50 -07:00
Jarred Sumner
b3019270c9 Update SIMDUTF (#4078) 2023-08-09 09:14:51 -07:00
Jarred Sumner
5d7c77aab0 Update main-worker-file.js 2023-08-08 23:02:45 -07:00
Jarred Sumner
2c70837ae7 Run prettier 2023-08-08 23:01:03 -07:00
Jarred Sumner
bed7ff7dd0 Remove unintentional logs from #4043 2023-08-08 22:59:40 -07:00
dave caruso
450b066cb8 Fix one of the astro segfaults, also fix bun init version (#4079)
* 4->16

* add assertions

* fix version stuff
2023-08-08 22:27:18 -07:00
Jacques
63f58f4026 feat(bun:test) add support for test.each() and describe.each() (#4047)
* rename callback to func

* update testscope to handle function arguments

* works

* big cleanup

* works in debug, not release

* fix memory issue & update tests

* catch & str test

* write types for each() & switch tests to ts

* rm & typo

* move some code around & support describe

* review changes
2023-08-08 22:25:32 -07:00
dave caruso
009fe18fa2 worker tests (#4058)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-08-08 22:19:46 -07:00
Tiramify (A.K. Daniel)
40d00a961e feat(bun/test): Implement "toSatisfy" & "toIncludeRepeated" (fwup) (#3651)
* Fix merge issues

* oop

* make codegen

* Fix build issues

---------

Co-authored-by: dave caruso <me@paperdave.net>
2023-08-08 22:14:30 -07:00
dave caruso
1941dbbd71 Set exports to {} in user-constructed CommonJSModuleRecords (#4076) 2023-08-08 19:37:36 -07:00
dave caruso
320cdcf97e Fix require("console") #3820 (#4073)
* Fix #3820

* Add Module (#4074)
2023-08-08 18:23:33 -07:00
Dylan Conway
454407003e Update Worker.cpp 2023-08-08 15:08:16 -07:00
Ai Hoshino
511f6bdf79 1. Check if the argument is an empty string in path.format. (#4064)
2. Avoid duplicating '/' at the beginning of the path.
Close: #4005
2023-08-08 07:03:18 -07:00
Jarred Sumner
320ee6b6b7 import bun (#4055)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-08 01:42:44 -07:00
Jarred Sumner
38df5b146f Enable Headers.prototype.getSetCookie
Fixes #4057
2023-08-08 01:18:36 -07:00
Jarred Sumner
25c91aecab Remove printf 2023-08-08 00:31:46 -07:00
dave caruso
5497accbdb Add env option for node:worker_threads (#4052)
* almost works

* env stuff

* test fixes

* wtfmove

* ok

* ok

* ref by default

* it now does the ref stuff by default

* cool
2023-08-07 23:58:38 -07:00
jhmaster
182e600eb7 Fix Bun.hash functions (#4054)
* fix `Bun.hash` functions to behave as expected

* update Bun.hash tests
* properly test the returned hash
* include murmur32v2

* update Bun.hash docs

* run fmt
2023-08-07 23:30:05 -07:00
Dylan Conway
cb873cc081 fix worker.ref() 2023-08-07 22:40:32 -07:00
Jarred Sumner
330d19e344 add bun update to help menu 2023-08-07 21:14:42 -07:00
Dylan Conway
2fe6a965af implement fetching data urls (#4000)
* fetch data urls

* `byteSlice`

* deinit slice

* allocate `mime_type` string if needed

* `content_type_allocated` and uncomment tests

* `str_`

* createAtom and slice decode result
2023-08-07 20:15:53 -07:00
Alex Lam S.L
a32097aa9f implement bun update (#4046)
- analogous to `npm update`
- `bun update <name>` to refresh specified package under `package.json`
- `bun update` to refresh all package to latest versions
2023-08-07 20:11:32 -07:00
Dylan Conway
1239c9460a fix iterating headers with set-cookie (#4048)
* fix iterating headers with `set-cookie`

* a test

* move work to `HTTPHeaderMap::set`

* append set-cookie after sort

* remove compare function
2023-08-07 19:32:23 -07:00
Jarred Sumner
f2f227720b WASM test analyzer (#4043)
* wasm

* WASM test scanner

* Update Makefile

* Update Makefile

* Configurable heap limit

* slightly better error

* Update js_parser.zig

* Update path.test.js

* Update node.mjs

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-07 18:51:16 -07:00
Colin McDonnell
0b183beb51 Improve plugin docs 2023-08-07 14:02:43 -07:00
Ai Hoshino
5ce393aab8 Fix path.normalize edge case. (#4042)
Close: #4041
2023-08-07 06:44:04 -07:00
Jarred Sumner
00a907c7de Fixes #4001 (#4034)
* Avoid a utf8 conversion in isDetached

* Fixes #4001

* hit the long url codepath

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-06 22:49:10 -07:00
Jarred Sumner
0665733b03 Fixes #4029 and fixes #4022 (#4032)
* Fixes #4029 and Fixes #4022

Fixes #4029

Fixes #4022

* Add test for all the fetches

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-06 20:39:40 -07:00
Jarred Sumner
70c3371b14 Fixes #4010 (#4031)
* Fixes #4010

* Update websocket_http_client.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-06 19:30:06 -07:00
Jarred Sumner
0b2be88bac Update build-id 2023-08-06 18:07:15 -07:00
Jarred Sumner
8297fb0d2f Bind require.resolve() (#4030)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-06 18:06:18 -07:00
Jarred Sumner
04925bb94c Fixes #4020 2023-08-06 17:57:44 -07:00
Yash Sharma
3185ca2d95 Running missing scripts exits with non-0 (#4026)
Co-authored-by: Yash Sharma <yashsharma@Yashs-MacBook-Air.local>
2023-08-06 17:43:24 -07:00
Alex Lam S.L
b93f304c06 [install] handle bun add of existing peerDependencies correctly (#4028) 2023-08-06 17:42:08 -07:00
Jarred Sumner
a9b3d58353 fix nan 2023-08-06 07:55:22 -07:00
Jarred Sumner
cf48379921 Update coverage.md 2023-08-06 07:48:06 -07:00
Jarred Sumner
f8026df821 Update lol-html 2023-08-06 07:35:29 -07:00
Jarred Sumner
fa4e5d033e Fixes #3129 (#4018)
* Fixes #3129

* add CloseEvent

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-06 07:35:07 -07:00
Jarred Sumner
1462445419 Code coverage for bun test (#3975)
* WIP code coverage initial commit

* almost works

* one approach

* Code Coverage

* Update WebKit

* it works but is not yet accurate

* skip double ascii check

* wrapper

* it works but i'm not sure what to do about blocks

* hide blocks for now

* Update ZigSourceProvider.cpp

* Create coverage.md

* Update nav.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-06 06:30:23 -07:00
Ai Hoshino
ecdf2ffa6c feat: impl dns.getServers (#3982)
* feat: impl `dns.getServers`
Close: #3981

* check return value of `ares_inet_ntop`
2023-08-06 06:16:54 -07:00
dave caruso
cd0774cd89 Implement --test-name-pattern (#3998)
* Fix end not being emitted all the time

* stuff

* Implement -t

* Undo js_printer changes

* Undo http changes

* Update InternalModuleRegistryConstants.h

* Delete unrelated test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-06 06:13:39 -07:00
Ai Hoshino
cf8650937a Fix(cli/init): support subpath entrypoint. (#4002) 2023-08-05 04:48:22 -07:00
dave caruso
3803d39840 Remove Bun.plugin transpiler hook, encourage usage of --preload instead (#3987)
* Remove Bun.plugin transpiler hook

* one missing case
2023-08-05 04:42:30 -07:00
Colin McDonnell
78081cbb40 Support --dev/-D and support more flags on bun install (#3989) 2023-08-04 20:41:16 -07:00
Dylan Conway
6bdee80cfc fix macro string escaping (#3967)
* handle macro escaping

* remove printer

* use `js_lexer.decodeEscapeSequences`
2023-08-04 19:34:09 -07:00
Jarred Sumner
637a38f394 Fixes #3991
Fixes #3991
2023-08-04 18:54:08 -07:00
Alex Lam S.L
190ba6b743 [install] handle workspace:* correctly (#3994)
- parse as path so it works on unversioned workspaces
- fix missed storage of workspace version

fixes #3985
2023-08-04 18:21:13 -07:00
Jarred Sumner
e2c526708a Update import-meta.md 2023-08-04 17:40:11 -07:00
Jarred Sumner
f06f178862 Fix incorrect docs 2023-08-04 17:38:17 -07:00
Alex Lam S.L
8275b8ccd2 [types] fix blob.json() (#3995) 2023-08-04 17:30:38 -07:00
dave caruso
d196aa2de6 FFI typo (#3973)
* FFI typo

* add tests

* it was a newline
2023-08-04 16:08:50 -07:00
Yifei Wang
bdbc21ff7b Buffer.copy should ignore out-of-range sourceEnd (#3971) 2023-08-04 16:08:25 -07:00
Alex Lam S.L
ff315a3bf2 [install] store resolved workspace path in lockfile (#3974)
- resolve cwd consistently
- speed up package diff
- update `test/bun.lockb`

fixes #3685
fixes #3958
2023-08-04 23:28:42 +03:00
Colin McDonnell
63d265780f Fix types (#3963)
* Fix types

* Add ws module

* Add *.toml module declaration

* Clean up
2023-08-04 12:56:34 -07:00
simylein
18a2e18ae1 feat(hot-clear-screen): clear terminal on hot reload (#3976)
* feat(hot-clear-screen): clear terminal on hot reload

* fix(hot-clear-screen): is now I n the correct place

* fix(hot-clear-screen): enable buffering after terminal clear
2023-08-04 04:01:10 -07:00
Jarred Sumner
76dee9312b Add microbenchmark for private properties 2023-08-03 20:14:17 -07:00
Jarred Sumner
9beccc3305 Fix thread safety issue in async fs functions file paths (#3964)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-03 20:09:05 -07:00
Jarred Sumner
717f0a2f42 Make the test better 2023-08-03 18:23:57 -07:00
Jarred Sumner
c2ebdf812b Test for Module.wrap() 2023-08-03 18:22:45 -07:00
Jarred Sumner
9ab2acced6 Implement Module.wrap() 2023-08-03 18:22:45 -07:00
Jarred Sumner
944fcebc2b Update build-id (#3940)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-03 18:15:55 -07:00
Colin McDonnell
9222316101 Update Node.js compat docs 2023-08-03 17:48:18 -07:00
Colin McDonnell
d10860d272 Add type tests 2023-08-03 17:44:18 -07:00
Colin McDonnell
76fa3076cd Add type tests, update modules.md 2023-08-03 17:41:47 -07:00
Colin McDonnell
112030481f More guides and fixing links (#3960)
* More guides

* WIP

* Updates

* Fix
2023-08-03 16:31:05 -07:00
Dylan Conway
9574db355f allow bundling builtins for browser (#3959)
* Update resolver.zig

* bundle resolve error for non-existent builtins

* tests
2023-08-03 16:27:45 -07:00
Ai Hoshino
a4d996c337 Fix edge case in path.relative. (#3952)
Close: #3924
2023-08-03 15:40:37 -07:00
Ashcon Partovi
08cf0d562a Bunch of fixes (#3516)
* Fix #3497

* Fix #3497

* Run prettier

* Fix package.json

* remove this too

* yeah

* Fix missing tests

* Use native for utf-8-validate

* Add module ID names to builtins

* Defer evaluation of ESM & CJS modules until link time

* Use builtin name for exports in plugins

* Add module IDs to builtins

* Update JSC build with new flag

* WebKit upgrade fixes

* Update WebKit

* prettier

* Upgrade WebKit

* bump

* Update once again

* Add visitAdditionalChildren, remove .fill() usage

* Update process.test.js

* Update fs.test.ts

---------

Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-03 15:31:55 -07:00
Alex Lam S.L
9a2c3dea88 [install] fix stale bun.lockb on workspaces (#3945)
- handle workspaces under `--production` correctly
- fix `Makefile`
2023-08-03 12:37:29 -07:00
Ai Hoshino
2c9ff9584a Minor optimization: Avoid extra copying when the chunk has only one element. (#3946)
* Optimize the case where there is only one chunk.

* add generated code
2023-08-03 12:35:04 -07:00
Ai Hoshino
30dde62521 Fix the string encoding in path.extname. (#3949)
Close: #3948
2023-08-03 12:34:41 -07:00
Jarred Sumner
928816bef0 SvelteKit compatibility hack 2023-08-02 21:07:39 -07:00
dave caruso
f17655b2eb typo (#3941) 2023-08-02 20:43:39 -07:00
Ashcon Partovi
9f2dcb064d Fix formatting 2023-08-02 19:02:54 -07:00
dave caruso
6c176cb243 Dave/removedeprecation (#3938)
* hide deprecated stuff

* this edit

* hi
2023-08-02 18:57:11 -07:00
dave caruso
e83058cfe7 Fix http write (#3939)
* Fix encoding problem when uploading a binary file.
Close: #3116

* use BufferList

* Finish rebase

---------

Co-authored-by: Hanaasagi <ambiguous404@gmail.com>
2023-08-02 18:56:41 -07:00
dave caruso
aaaaf744a8 Remove module and browser conditions (#3935)
* fix astro compiler

* clean this up

* Update options.zig

---------

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-08-02 18:46:57 -07:00
Jarred Sumner
207c7eb509 Implement node:worker_threads (#3923)
* Start to implement `worker_threads`

* more

* more!!

* more

* Update bundle_v2.zig

* delete outdated tests

* `receiveMessageOnPort`

* props test and export default

* fix merge

* not implemented tests

* individual imports

* `receiveMessageOnPort` tests

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-08-02 18:12:12 -07:00
Ashcon Partovi
505e77c2d0 Implement node:diagnostics_channel (#3934)
* Add types for `node:async_hooks`

* Implement \`node:diagnostics_channel\`
2023-08-02 18:04:24 -07:00
Jarred Sumner
ef6d25a48f Fix 2023-08-02 17:55:42 -07:00
dave caruso
c2a77cf7ec Rewrite built-in modules to use CommonJS over ESM (#3814)
* stfdsafsd

sadffdsa

stuff

finish commonjs stuff

asdf

not done but work

not done but work

not done yet but this is how far i am

remove files

lol

update built files

uncomment everything in events lol

export default

stuff

* afdsafsd

* its not perfect but almost done

* okay

* cool

* remove temp file

* finish rebase

* revert settings.json

* a

* ch-ch-ch-ch-changes

* okay

* remove this check in release for now

* sxdcfghnjm,

* lkjhgf

* fmt

* filename can be null

* Update NodeModuleModule.h

* weee

* fmt

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-02 16:27:36 -07:00
Jarred Sumner
7656b4b17e Fixes #3931 (#3933)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-02 16:16:22 -07:00
Ciro Spaciari
25553e62c1 Fix path_watcher (#3920)
* fix callback and onError

* fix main watcher error return

* fixup

* rename to be more clear
2023-08-02 13:00:01 -07:00
Vaughan Rouesnel
4f39d5b54a Update streams.md (#3926) 2023-08-02 12:59:21 -07:00
Ciro Spaciari
d9f162ff95 clean declare structs (#3929) 2023-08-02 12:58:44 -07:00
Dylan Conway
9bbac35fd0 close BroadcastChannel in tests 2023-08-01 19:12:30 -07:00
Ciro Spaciari
eba27540b0 Fix some flaky tests (#3919)
* fix some flask tests

* fix condition on prisma test

* oops
2023-08-01 19:06:08 -07:00
Ciro Spaciari
9cb3f3386e Fix expanding on .env files (#3918)
* fix expanding

* refactor locks

* bound checks

* fix comment

* one more test

* oops
2023-08-01 19:04:05 -07:00
Dylan Conway
6c40d6f2f5 add BroadcastChannel (#3922)
* copy and format

* update `SerializedScriptValue.cpp`

* use `expect().fail()` in message channel tests

* rename `BroadcastChannelIdentifier.h`

* copy registries

* progress and tests

* cleanup

* worker and broadcast channel test

* `BroadcastChannel` ref and unref

* `MessagePort` ref, unref, and hasRef

* remove `SecurityContext.cpp/h`

* add types
2023-08-01 18:40:02 -07:00
Dylan Conway
0ced5520e6 Update worker.test.ts 2023-08-01 18:05:11 -07:00
Jarred Sumner
8aa5892f70 Update types 2023-08-01 16:44:16 -07:00
Jarred Sumner
bd2563ef4c Update JSWorker.cpp 2023-08-01 16:43:48 -07:00
Jarred Sumner
214dc039e0 Implement Worker.prototype.threadId 2023-08-01 16:42:49 -07:00
Emilio Sánchez
e2b39d0807 Fix prisma.md typo (#3921) 2023-08-01 12:03:53 -07:00
Vlad Sirenko
7a8f57c4e5 throw error if node module does not exist (#3913) 2023-07-31 19:41:41 -07:00
Colin McDonnell
8589ba2f17 Update stricjs 2023-07-31 17:07:01 -07:00
Colin McDonnell
dd8fdd87dc Switch table to headings in Nodejs compat page 2023-07-31 16:39:09 -07:00
Colin McDonnell
7b8df184b3 Add env guides 2023-07-31 14:24:08 -07:00
Colin McDonnell
90991da908 Update titles, add Workspaces guide 2023-07-31 13:57:17 -07:00
Colin McDonnell
404b90badc Add ecosystem guides (#3847)
* Add ecosystem guides

* Update titles

* Rename stric

* Add unlink and fetch guides

* Add formdata guide

* Tweak title

* Moar
2023-07-31 12:20:23 -07:00
Jarred Sumner
67599f97ad More logging 2023-07-31 06:50:55 -07:00
Jarred Sumner
8b715dee5b Fixes #1669 2023-07-31 06:39:19 -07:00
Jarred Sumner
f2983e50b7 Add a test for TransformStream 2023-07-31 06:17:56 -07:00
Jarred Sumner
e47a448434 Fixes #2935 2023-07-31 06:03:31 -07:00
xxxhussein
de5890ff20 Update arraybuffer-to-buffer.md (#3906)
Fix title. This page shows how to convert an ArrayBuffer to a Buffer, not a Uint8Array
2023-07-31 04:00:21 -07:00
Jarred Sumner
aae92c76a6 Fix incorrect function 2023-07-31 01:33:39 -07:00
Jarred Sumner
9ecae59bbb Fix memory leak in response.clone(), further reduce memory usage of Request & Response (#3902)
* Atomize respsone.url & response.statusText

* Fix warning

* Atomize Request & Response URLs when possible

* Fix memory leak in response.clone()

bun/bench/snippets on  jarred/atomize
❯ mem bun --smol request-response-clone.mjs
cpu: Apple M1 Max
runtime: bun 0.7.2 (arm64-darwin)

benchmark             time (avg)             (min … max)       p75       p99      p995
-------------------------------------------------------- -----------------------------
req.clone().url     77.3 ns/iter  (40.35 ns … 222.64 ns)  91.53 ns 128.11 ns 172.78 ns
resp.clone().url  162.43 ns/iter    (116 ns … 337.77 ns)  177.4 ns 232.38 ns 262.65 ns

Peak memory usage: 60 MB

bun/bench/snippets on  jarred/atomize
❯ mem bun-0.7.1 --smol request-response-clone.mjs
cpu: Apple M1 Max
runtime: bun 0.7.1 (arm64-darwin)

benchmark             time (avg)             (min … max)       p75       p99      p995
-------------------------------------------------------- -----------------------------
req.clone().url   115.85 ns/iter  (80.35 ns … 247.39 ns) 128.19 ns 181.93 ns 207.23 ns
resp.clone().url  252.32 ns/iter  (202.6 ns … 351.07 ns) 266.56 ns 325.88 ns 334.73 ns

Peak memory usage: 1179 MB

* Update tests

* Update js_ast.zig

* Update test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-30 23:51:43 -07:00
audothomas
2ea7290172 FIx Uint8Array to a ReadableStream code snippet (#3895) 2023-07-30 17:53:22 -07:00
Jarred Sumner
092ada6d2f Micro-optimize LineOffsetTable.generate
5.00 ms  100.0%	0 s	 	bun (81023)
2.00 ms   40.0%	2.00 ms	 	 WTF::HashTableAddResult<WTF::HashTableIterator<WTF::HashTable<WTF::Packed<WTF::StringImpl*>, WTF::Packed<WTF::StringImpl*>, WTF::IdentityExtractor, WTF::DefaultHash<WTF::Packed<WTF::StringImpl*>>, WTF::HashTraits<WTF::Packed<WTF::StringImpl*>>, WTF::HashTraits<WTF::Packed<WTF::StringImpl*>>>, WTF::Packed<WTF::StringImpl*>, WTF::Packed<WTF::StringImpl*>, WTF::IdentityExtractor, WTF::DefaultHash<WTF::Packed<WTF::StringImpl*>>, WTF::HashTraits<WTF::Packed<WTF::StringImpl*>>, WTF::HashTraits<WTF::Packed<WTF::StringImpl*>>>> WTF::HashTable<WTF::Packed<WTF::StringImpl*>, WTF::Packed<WTF::StringImpl*>, WTF::IdentityExtractor, WTF::DefaultHash<WTF::Packed<WTF::StringImpl*>>, WTF::HashTraits<WTF::Packed<WTF::StringImpl*>>, WTF::HashTraits<WTF::Packed<WTF::StringImpl*>>>::addPassingHashCode<WTF::HashSetTranslatorAdapter<WTF::BufferFromStaticDataTranslator<unsigned char>>, WTF::HashTranslatorCharBuffer<unsigned char> const&, WTF::HashTranslatorCharBuffer<unsigned char> const&>(WTF::HashTranslatorCharBuffer<unsigned char> const&, WTF::HashTranslatorCharBuffer<unsigned char> const&)
2.00 ms   40.0%	2.00 ms	 	 heap.StackFallbackAllocator(1024).free
2.00 ms   40.0%	0 s	 	  em.Allocator.rawFree
2.00 ms   40.0%	0 s	 	   em.Allocator.log2a
2.00 ms   40.0%	0 s	 	    em.Allocator.free__anon_1330765
2.00 ms   40.0%	0 s	 	     em.Allocator.resize__anon_1069235
2.00 ms   40.0%	0 s	 	      array_list.ArrayListAligned(i32,null).toOwnedSlice
2023-07-30 08:27:31 -07:00
Jarred Sumner
e636f1b026 skip flay test 2023-07-30 08:26:41 -07:00
Jarred Sumner
54a2d89bd2 Support bun . to run the entry point (#3891)
* Support `bun .`

* Fix tests

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-30 07:54:17 -07:00
Tiramify (A.K. Daniel)
0ea59b4c93 Update install.md (#3890) 2023-07-30 06:41:51 -07:00
Jarred Sumner
b0d3ea5a43 Fix issue with file loader (#3889)
* Fix issue with file loader

* Update jest-extended.test.js

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-30 05:59:54 -07:00
Jarred Sumner
a9dc5d51e3 Fixes #3884 2023-07-30 04:04:06 -07:00
Jarred Sumner
749194378a Bump 2023-07-30 04:04:06 -07:00
Jarred Sumner
794e657eb2 remove unnecessary move 2023-07-30 04:04:06 -07:00
Jarred Sumner
1db119ec11 Fix memory leak (#3887)
* Fix memory leak

* Remove an extra copy

* Further fixes

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-30 02:03:32 -07:00
Ai Hoshino
413fd28120 Fix coredump when reading an empty file(node:stream:createReadStream) (#3882)
* Fix coredump when reading an empty file.
Close: #3607

* It seems that the fd is closed when `auto_close` is true.
2023-07-30 01:18:13 -07:00
Tiramify (A.K. Daniel)
40a9ba6340 Improv. (#3885) 2023-07-30 01:17:02 -07:00
Jarred Sumner
681be10294 Make bun:jsc memoryUsage more accurate (#3876)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-29 06:18:51 -07:00
0xflotus
dccf82b1c6 docs: fixed small errors (#3879)
* Update cache.md

* Update index.md

* Update macros.md

* Update writing.md
2023-07-29 03:58:45 -07:00
0xflotus
5563be99d3 fix: small error (#3878) 2023-07-29 03:32:24 -07:00
Jhorman Tito
bcb6dc7806 typo spawn.md (#3875) 2023-07-29 00:35:13 -07:00
Jarred Sumner
dae2928620 Update nodejs-apis.md 2023-07-28 23:58:59 -07:00
Jarred Sumner
05ef9ec141 Update nodejs-apis.md 2023-07-28 23:57:02 -07:00
Jarred Sumner
53cc4df191 Defer task destruction 2023-07-28 20:34:57 -07:00
Jarred Sumner
05716ff39b Stat largefile test (#3870)
* Add test for stat on a large file

* Update fs.test.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-28 18:55:04 -07:00
Jarred Sumner
4f914cbfe8 Ignore when printing to stdout errors (#3869)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-28 18:53:44 -07:00
Jarred Sumner
da7c1d84e9 Fix bug with /path/to/absolute/bun.lockb 2023-07-28 18:52:04 -07:00
Dylan Conway
aebec5b329 markBinding 2023-07-28 18:07:28 -07:00
Dylan Conway
c68d9ae634 optional parameter 2023-07-28 18:04:00 -07:00
Jarred Sumner
bd66a9a94c Fixes #3868
Fixes #3868
Fixes #849
2023-07-28 17:53:12 -07:00
Jarred Sumner
1490cdc4ff Fix assertion failure and possible infinite loop when printing as yarn lock files 2023-07-28 17:40:05 -07:00
Jarred Sumner
97009a49bd Mark broken test as todo 2023-07-28 16:59:46 -07:00
Dylan Conway
d432448ac8 fix types and add message channel/port gc test 2023-07-28 16:55:49 -07:00
Dylan Conway
d614fdfaac MessageChannel and MessagePort (#3860)
* copy and format

* copy

* copy

* cleanup

* some tests

* spellcheck

* add types

* don't lock getting contextId

* array buffer test
2023-07-28 16:44:28 -07:00
Jarred Sumner
0a4e476a7c mark tests as todo 2023-07-28 16:24:22 -07:00
Vlad Sirenko
9078b1286d add fork to child_process (#3851)
* add fork to child_process

* fix export

* add test to child_process method `fork`

* fmt fork

* remove only from test
2023-07-28 16:00:43 -07:00
Tiramify (A.K. Daniel)
242d8655d8 feat(bun/test): Impl. expect().pass() & expect().fail() (#3843)
* Impl. pass & fail

* fix

* fix 2

* smol
2023-07-28 15:46:44 -07:00
Ai Hoshino
9b91e3c1a2 fix the chunk boundary (node:stream:createReadStream) (#3853)
* fix the slice boundary.
Close: #3668

* Add more boundary test case.

* fix end is 0.
2023-07-28 15:44:33 -07:00
Jarred Sumner
7a1ebec26f Support file: URLs in fetch (#3858)
* Support file: URLs in `fetch`

* Update url.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-28 15:44:05 -07:00
Ciro Spaciari
e7c80b90b8 fix(tls) exposes native canonicalizeIP and fix rootCertificates (#3866)
* exposes native canonicalizeIP

* remove unintended duplicate

* add tests

* add tests for debug builds

* add rootCertificates test and fix len

* just randomize test ids on prisma

* remove work around and bump usockets with the actual fix

* fix case

* bump uws
2023-07-28 15:43:15 -07:00
Jarred Sumner
e110ccf84d Fixes #3795 (#3856)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-28 01:33:00 -07:00
Jarred Sumner
c2a744f0cc Add todo
cc @cirospaciari
2023-07-28 00:34:54 -07:00
Jarred Sumner
38168f3c85 Update pull_request_template.md 2023-07-28 00:17:47 -07:00
Jarred Sumner
cbaab23f6d Update pull_request_template.md 2023-07-28 00:17:26 -07:00
Jarred Sumner
3e5beb1279 Fix bug with // @bun annotation in main thread (#3855)
* Uncomment test

* Fix bug with // @bun + async transpiler

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27 22:30:10 -07:00
Jarred Sumner
70b9bf743c Add Bun.isMainThread 2023-07-27 22:28:28 -07:00
Jarred Sumner
f3153fbee9 Uncomment test 2023-07-27 20:46:25 -07:00
Ciro Spaciari
7fa71dd032 Resolve watch directories outside main thread + async iterator and symlink fixes (#3846)
* linux working pending tests with FSEvents

* add more tests, fix async iterator

* remove unnecessary check

* fix macos symlink on directories

* remove indirection layer

* todos

* fixes and some permission test

* fix opsie and make prisma test more reliable

* rebase with main

* add comptime check for macOS

* oops

* oops2

* fix symlinks cascade on FSEvents

* use JSC.WorkPool

* use withResolver, createFIFO and fix close event on async iterator

* remove unused events

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-07-27 19:23:54 -07:00
Jarred Sumner
52f39d728f Update pull_request_template.md 2023-07-27 18:12:11 -07:00
Jarred Sumner
73eb59019a Update pull_request_template.md 2023-07-27 18:11:28 -07:00
Jarred Sumner
3b24305b7c Update pull_request_template.md 2023-07-27 18:10:49 -07:00
Jarred Sumner
1304779826 Update pull_request_template.md 2023-07-27 18:03:44 -07:00
Jarred Sumner
65d0884361 Update pull_request_template.md 2023-07-27 18:01:01 -07:00
Jarred Sumner
16fdc074ca Update pull_request_template.md 2023-07-27 18:00:03 -07:00
Jarred Sumner
6b35fd847f Create pull_request_template.md 2023-07-27 17:56:11 -07:00
Jarred Sumner
007f357495 Make readFile() async (#3850)
* less leaky

* async readfile

* Update types.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27 16:55:49 -07:00
Jarred Sumner
16a7224ce5 Fix hot reloading in canary (#3848)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27 15:52:52 -07:00
Jarred Sumner
7c44773f38 Outdated copy 2023-07-27 15:22:53 -07:00
Jarred Sumner
85895bd248 Use putDirectIndex instead of initializeIndex (#3839)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27 14:45:32 -07:00
Luigi Pinca
6c2ec2868f Remove no longer needed flag from benchmark documentation (#3845)
`Deno.serve()` was stabilized in version 1.35.0.
2023-07-27 13:27:54 -07:00
Jarred Sumner
704ee13392 Make readdir() async, fix crash in large directory trees (#3838)
* Fix unsafe GC behavior on large arrays returned by fs

* Fix crash in large arrays of strings

* async readdir

* Add tests for large number of files returned by readdir

* Move this down

* Fix encoding edgecase in path.join

* Async stat & lstat

* add test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27 04:27:09 -07:00
Jarred Sumner
d7aebc2222 Remove lstat call in fs.watch (#3836)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-27 03:34:18 -07:00
Jarred Sumner
dc0d767f27 Enable Promise.withResolvers()
https://github.com/tc39/proposal-promise-with-resolvers

Thanks @dcrousso
2023-07-26 23:52:57 -07:00
Jarred Sumner
86633e0af4 Start time performance improvements to build tools (#3797)
* Make os.cpus() faster on Linux

* Fix crash

See https://github.com/ziglang/zig/issues/16540

* Handle watcher_count == 0

* Add assertion

* Clean up lifetimes of fs watcher a little

* ✂️

* Use `errdefer`

* Make the error better

* Make os.cpus() more lazy

* Please don't translate-c on the entire C standard library

* immediately closing works correctly is still bug

* ops

* fmt+fixeup

* add back verbose

* free instead of destroy

* remove destroy option for watcher tasks

* flush verbose and add debug log

* fixup files

* use log for debug

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
2023-07-26 21:35:49 -07:00
Jarred Sumner
ec2cf38ad8 [fetch] Ignore invalid Content-Encoding header (#3834)
Fixes #3802

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-26 20:24:36 -07:00
Colin McDonnell
34fd4df646 Fix broken anchors 2023-07-26 17:11:15 -07:00
Jarred Sumner
a6d54e5949 Update macro-test.test.ts 2023-07-26 16:56:26 -07:00
Jarred Sumner
664ccec7d3 Disable concurrent transpiler in macros 2023-07-26 16:54:36 -07:00
Dylan Conway
1a558ef753 fix decorator and declare (#3828)
* return the prop if there are decorators

* test and comment
2023-07-26 16:31:08 -07:00
Jarred Sumner
f3200ac0ca Don't hoist bun plugin in concurrent transpiler 2023-07-26 16:06:04 -07:00
Jarred Sumner
011b50589c Concurrent Transpiler (#3816)
* Concurrent Transpiler

* Fix bug with some improts and add jsc alias

* Some comments

* Fix crash

* Update module_loader.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-26 15:36:05 -07:00
Alex Lam S.L
06503663b1 [install] handle workspace:[alias@]range (#3819) 2023-07-26 15:35:47 -07:00
Colin McDonnell
4c89c60867 Add files (#3826) 2023-07-26 14:59:39 -07:00
Colin McDonnell
6bfee02301 Fix typo 2023-07-25 12:27:27 -07:00
Ai Hoshino
0297cb1527 fix the encoding of dirname's return value. (#3799) 2023-07-25 05:49:48 -07:00
Jarred Sumner
4209703b35 Make this other name better 2023-07-25 02:08:51 -07:00
Jarred Sumner
8edeb617a8 Make this name better 2023-07-25 02:08:23 -07:00
Ai Hoshino
130079b558 fix some cases in the dirname function. (#3785)
Close: #3782
2023-07-25 00:41:22 -07:00
Jarred Sumner
8356830727 Trace printing at runtime 2023-07-24 22:00:43 -07:00
Jarred Sumner
5edb756533 Trace module resolution 2023-07-24 21:59:50 -07:00
Jarred Sumner
e402159df1 test gardening 2023-07-24 19:36:53 -07:00
dave caruso
8a0152e129 Merge import.meta.require and require to be the same thing (#3732)
* Merge import.meta.require and require to be the same thing

* support `require` and BunPlugin (runtime plugin)

* plugins

* unused code

* revert launch.json
2023-07-24 19:32:04 -07:00
Jarred Sumner
1f1d0bfcfb Make this test less flaky 2023-07-24 19:18:07 -07:00
Jarred Sumner
4ebf858f43 Less flaky 2023-07-24 19:14:41 -07:00
Jarred Sumner
90ce74a43e Skip test 2023-07-24 19:13:25 -07:00
Jarred Sumner
e1a59d355a slow test is allowed to be slow 2023-07-24 19:11:53 -07:00
Dylan Conway
e154763e4d fix rope string push (#3796)
* push to next next

* couple more tests

* end
2023-07-24 19:08:56 -07:00
Jarred Sumner
ac10a1b633 move this to troubleshooting 2023-07-24 17:16:34 -07:00
Alex Lam S.L
961312eab0 [install] fix workspace override of aliased npm dependency (#3784) 2023-07-24 17:01:43 -07:00
Jarred Sumner
6ca50526d7 bun:sqlite gets 10% faster (#3780)
* bun:sqlite gets 10% faster

❯ bun-debug bun.js # After
[0.03ms] ".env"
cpu: Apple M1 Max
runtime: bun 0.7.1_debug (arm64-darwin)

benchmark                        time (avg)             (min … max)       p75       p99      p995
------------------------------------------------------------------- -----------------------------
SELECT * FROM "Order"         13.65 ms/iter   (12.79 ms … 15.41 ms)  13.69 ms  15.41 ms  15.41 ms
SELECT * FROM "Product"       31.02 µs/iter    (27.08 µs … 1.33 ms)  30.33 µs  42.33 µs  45.25 µs
SELECT * FROM "OrderDetail"   140.2 ms/iter (127.97 ms … 172.31 ms) 144.02 ms 172.31 ms 172.31 ms

bun/bench/sqlite on  jarred/faster-sqlite took 5s
❯ bun bun.js # Before
[0.52ms] ".env"
cpu: Apple M1 Max
runtime: bun 0.7.1 (arm64-darwin)

benchmark                        time (avg)             (min … max)       p75       p99      p995
------------------------------------------------------------------- -----------------------------
SELECT * FROM "Order"         15.44 ms/iter   (14.36 ms … 17.94 ms)  15.59 ms  17.94 ms  17.94 ms
SELECT * FROM "Product"       36.89 µs/iter    (31.54 µs … 3.18 ms)  37.25 µs  49.75 µs  54.88 µs
SELECT * FROM "OrderDetail"  156.63 ms/iter (151.68 ms … 175.93 ms) 157.63 ms 175.93 ms 175.93 ms

* Handle empty just incase

* GCDeferral scope is unnecessary

* Make this code more careful

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-24 17:01:21 -07:00
Colin McDonnell
31976f6af1 Update install method order 2023-07-24 14:40:13 -07:00
Jarred Sumner
967ccb5d50 Upgrade WebKit (#3777)
* Upgrade to latest WebKit

* Upgrade WebKit

* hm

* Fix failing tests

* Delete utf8-encoding-fixture.bin.cmp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-23 22:37:48 -07:00
Alex Lam S.L
d8135e85ca more tests for #3754 (#3774) 2023-07-23 21:19:10 -07:00
Jarred Sumner
b02f097f4d Fix bugs with connecting to localhost (#3758)
* Fix bugs with connecting to localhost

* Update uws

* More logs

* Allow not setting a hostname

* Make server.hostname & server.protocol faster

* Fixup

* normalize listening host

* Fix test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-23 05:13:48 -07:00
Jarred Sumner
4e852918a3 Raise redirect limit in bundler 2023-07-23 03:59:43 -07:00
Jarred Sumner
c76516fa38 Fixes #3764 2023-07-23 03:58:10 -07:00
Alexander Trefz
ce77266cc5 Update nodejs-apis.md (#3762)
`structuredClone` is implemented as of v0.7
2023-07-23 03:40:46 -07:00
Artur Androsovych
ce9bba9dd5 Update development.md (#3718)
* Update `development.md`

* Update `development.md`
2023-07-22 22:24:59 -07:00
Jarred Sumner
e2e44661c2 Explicitly ref/unref blobs before extracting the value (#3755)
* Explicitly ref/unref blobs before extracting the value

* ✂️

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-22 22:20:10 -07:00
Jarred Sumner
601fd3ead5 in Bun.write(), defer creating the Promise until we're just about to schedule the task 2023-07-22 20:49:35 -07:00
Alex Lam S.L
07e08b086a [install] improve workspace substitution of npm dependencies (#3754)
- respect semver ranges
2023-07-22 20:05:24 -07:00
Jarred Sumner
53eb126898 ref() before creating the JSPromise 2023-07-22 19:56:39 -07:00
Jarred Sumner
6809d08a90 Make zig build obj fail a little later when src/runtime.out.js or src/fallback/out.js doesn't exist 2023-07-22 19:35:00 -07:00
Jarred Sumner
6402967b6d bump! 2023-07-22 17:08:31 -07:00
Jarred Sumner
bfaf095c2e Fixes https://discord.com/channels/876711213126520882/1131175053409656833/1131175053409656833
@tr1ckydev this fixes the issue you ran into, see the diff for an example usage of a Bun.plugin that makes a network request on import.
2023-07-22 16:59:54 -07:00
dave caruso
b17b61b8c6 fix path.format for vite build (#3734)
* fix path.format for vite

* Update path.test.js

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-22 16:45:45 -07:00
Jarred Sumner
27c88c8046 Fixes #3753 2023-07-22 16:42:17 -07:00
Ai Hoshino
04d19d6f6a Fix writeFileSync when the mode is greater than 0o777. (#3747)
Close: #3740
2023-07-22 07:10:36 -07:00
Jarred Sumner
3418feb2e9 Fixes #3744 2023-07-22 04:33:54 -07:00
Jarred Sumner
c6a3467625 Unified event loop (#3741)
* Unified event loop

* Update WebKit, add test for es-module-lexer

* Update README.md

* Use async wasm

* Explicitly set whether concurrenttask should be deinit'd

* Update package.json

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-22 04:31:58 -07:00
Jarred Sumner
636cec03e1 Use WebKit's URL parser in fetch() and bun install (#3730)
* Use WebKit's URL parser in fetch() and `bun install`

* Allocate less memory

* Fix test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-21 23:27:28 -07:00
Ai Hoshino
1ecd9f8a18 handle latin1 in Bun__encoding__toString. (#3739)
Close: #3738
2023-07-21 22:01:26 -07:00
Dylan Conway
2323f5d08d fix #3716 (#3733)
* don't break on comments for process env variables

* break for `\r` and `\n`

* don't parse process env vars
2023-07-21 20:33:15 -07:00
Alex Lam S.L
311dffc690 improve test (#3731)
- minor build diffs
2023-07-22 02:42:30 +03:00
Ciro Spaciari
c4f062dbf4 clean tables before testing (#3721)
* clean tables before testing

* typo
2023-07-21 16:13:04 -07:00
Vaughan Rouesnel
7ac94e5b4c Typo in loaders.md (#3728) 2023-07-21 15:43:34 -07:00
Dylan Conway
aa1ad7f009 string escape edgecase (#3717)
* fix edgecase when joining rope strings with backtick

* bonus bugfix in ts decorator

* Update transpiler.test.js

* Fix test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-07-21 01:35:06 -07:00
Dylan Conway
21bb3b2bdd fix isFIFO (#3715)
* check poll ref flags

* Update WebCoreJSBuiltins.cpp
2023-07-21 00:18:15 -07:00
Jarred Sumner
cd49615e2c fix flaky test
@paperdave we must always use `bunEnv` in the `env` to ensure that the color settings and other stuff doesn't cause bun to produce extraneous stdout input when using console.log

Additionally, the console.log was left in (which is okay)
2023-07-20 21:45:05 -07:00
Jarred Sumner
eb37794a3b Bump 2023-07-20 21:34:42 -07:00
Jarred Sumner
da298635ef Bump 2023-07-20 21:22:49 -07:00
Dylan Conway
218958dbd1 Update async_hooks.node.test.ts 2023-07-20 21:13:11 -07:00
Jarred Sumner
1c6e464a68 bump 2023-07-20 21:08:42 -07:00
dave caruso
9c85465a58 fix process.exit status code handling (#3714) 2023-07-20 19:16:56 -07:00
Jarred Sumner
2eb79afb2a Update sqlite.md 2023-07-20 18:14:34 -07:00
dave caruso
020cf46346 Fix builtins again (#3713) 2023-07-20 17:33:40 -07:00
dave caruso
134c97a282 fix directory caching with workaround (#3710)
* ok

* test
2023-07-20 16:44:43 -07:00
dave caruso
e2c11c4856 fix process.binding (#3711) 2023-07-20 16:25:02 -07:00
Dylan Conway
9ad330d917 Update process.test.js 2023-07-20 15:32:20 -07:00
Jarred Sumner
ef89f03de6 Update text-decoder.test.js 2023-07-20 15:26:06 -07:00
Julian
c383c6cd81 Pass constructor arguments to TextDecoder (#3692)
* Make TextDecoder constructor use options parameter

The constructor now actually sets TextDecoder properties using the
options parameter.

* Defer decoder allocation to end of constructor

* Verify types of TextDecoder options

* TextDecoder throw TypeError on failure

* Tidying
2023-07-20 14:50:54 -07:00
Dylan Conway
68b4a64569 resolveRopeIfNeeded (#3708) 2023-07-20 14:50:23 -07:00
Dylan Conway
8e12999917 set _preload_modules to empty array (#3709) 2023-07-20 14:50:13 -07:00
Jarred Sumner
73e44e16ea Update Dockerfile 2023-07-20 14:49:57 -07:00
Ciro Spaciari
99da0ae54b fix start delay on Worker (#3707)
* fix start delay on Worker

* fmt

* add delay test
2023-07-20 14:49:10 -07:00
Colin McDonnell
4686f5395e Add number types for FFI (#3706) 2023-07-20 11:52:45 -07:00
Jarred Sumner
2dc90f3908 Update worker.test-d.ts 2023-07-19 23:59:37 -07:00
Colin McDonnell
53ad9b922f Docs & types for 0.7 (#3665)
* Docs & types for 0.7

* Tweak

* Update

* Tweaks

* Tweak

* Tweaks

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-07-19 23:59:15 -07:00
Jarred Sumner
0b365781a8 Bump version to Bun v0.7.0 2023-07-19 23:57:41 -07:00
Jarred Sumner
dd46c11273 Support streams in response.formData() & request.formData, introduce Bun.readableStreamToFormData() (#3697)
* codegen

* FormData.from

* Fixes #3225

* Introduce `Bun.readableStreamToFormData`

* Update bun.d.ts

* Add examples

* add

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-19 23:12:06 -07:00
Jarred Sumner
8a13e02473 Fixes #3670 (#3698)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-19 23:04:07 -07:00
Jarred Sumner
ed8be46a7b Inlinebun object from workers 2023-07-19 22:53:28 -07:00
dave caruso
36866c4d79 Fix vite (#3694)
* Fix ServerWebSocket.readyState

* Add create_hash_table to our repo

* Fix #3216
2023-07-19 19:28:53 -07:00
dave caruso
dd58508684 Fix browser bundled string_decoder (#3693)
* Fix #3660

* doc fix
2023-07-19 17:37:20 -07:00
dave caruso
9b6dc49575 Implement AsyncLocalStorage (#3089)
* work to get async local storage working.

* a

* a

* everything but queueMicrotask

* sdfghj

* .

* finish

* tests

* test

* ok

* done

* im so stupid

* Upgrade WebKit

* refactor

* refactor

* changes requested

* oops

* cool

* fix runInAsyncScope
2023-07-19 17:20:00 -07:00
Jarred Sumner
723e9d1ea7 Fix make headers 2023-07-19 16:05:43 -07:00
Ciro Spaciari
f63398ffe4 update root certificates and add tls.rootCertificates (#3688)
* implement tls.rootCertificates

* add test

* bump uws/usockets

* bump uws + .len on certs
2023-07-19 16:02:29 -07:00
Ciro Spaciari
2fbf73535c fix createDecipheriv (#3680)
* fix createDecipheriv

* fix createDecipheriv iv and password validations
2023-07-19 16:01:36 -07:00
dave caruso
ebbbd63ed6 fix #3681 (#3690) 2023-07-19 15:58:07 -07:00
Dylan Conway
bc28ec39cf set did_panic flag (#3687) 2023-07-19 15:39:15 -07:00
Ciro Spaciari
568cadb51e move constants module to cpp (#3683) 2023-07-19 15:39:02 -07:00
Dylan Conway
0dbcb84cbe fix make headers 2023-07-19 15:26:14 -07:00
Jarred Sumner
d74d95d9ab Better error for workspace dependency not found (#3678) 2023-07-20 00:08:52 +03:00
Jarred Sumner
a59ddb131e Fix crash in postMessage that repro'd after ~100,000 messages 2023-07-18 23:09:39 -07:00
Jarred Sumner
8bd2b784a2 more progress on fixing gc issue 2023-07-18 20:49:11 -07:00
Dylan Conway
f494e1b50d add padding bytes 2023-07-18 16:30:58 -07:00
Ciro Spaciari
112f01ca61 feature(constants) add constants/node:constants module and tests(prisma) use prima 5.0.0 + use same connection for postgres, add prisma mssql (disabled for now) (#3672)
* use prima 5.0.0 + use same connection for postgres

* change mongodb test URL

* constants module + mssql prisma test (disabled)
2023-07-18 16:09:18 -07:00
Ciro Spaciari
49231b2cb9 patch checkServerIdentity (#3671) 2023-07-18 16:03:05 -07:00
Jarred Sumner
0179ebcb8c Update workers.md 2023-07-18 05:00:09 -07:00
Alex Lam S.L
1790357021 [jest] execute lifecycle hooks on empty blocks (#3663)
fixes #3494
2023-07-18 04:54:24 -07:00
Jarred Sumner
105919d7ae Clarify 2023-07-18 04:51:29 -07:00
Jarred Sumner
777ee4ecec Fixes #3669 2023-07-18 04:35:04 -07:00
Dylan Conway
661355546a zig upgrade (#3667)
* upgrade

* more fixes

* Bump Zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-18 01:20:20 -07:00
Jarred Sumner
71f1aa1802 Enable postgres prisma test 2023-07-17 23:17:06 -07:00
Jarred Sumner
eaff66b098 Emit writeBarrier in napi_module_register 2023-07-17 23:07:09 -07:00
Jarred Sumner
b760d1da30 Fix potential crash in process.dlopen() 2023-07-17 23:02:33 -07:00
Jarred Sumner
728c8fdcdb Implement process.{stdout, stderr}.{columns, rows, getWindowSize} 2023-07-17 21:21:43 -07:00
Ciro Spaciari
13b54fbdb8 [tls] General compatibility improvements (#3596)
* wip

* subjectaltname

* more progress

* bindings

* fmt

* getCert/getPeerCertificate

* fix checkServerIdentity

* fix checkServerIdentity

* add a lot of TLSSocket functions

* getEphemeralKeyInfo fix and comment

* add alternative for getEphemeralKeyInfo

* add get session and set session

* fix isSessionReused

* get back the raw data for MSSQL

* fixeup

* fixup getSession + tests

* fix doc + fmt

* getFinished/getPeerFinished

* codegen

* fixup

* revert webkit

* more fixes

* ssl helper + revert test oops

* asserts
2023-07-17 19:39:09 -07:00
Dylan Conway
9273e29f0e package json main field extension order (#3664) 2023-07-17 19:26:33 -07:00
Alex Lam S.L
9f031b3642 [install] handle duplicated workspace declarations gracefully (#3662)
fixes #3644
2023-07-17 16:06:31 -07:00
Colin McDonnell
ca3b7fa3c9 Clean up worker docs 2023-07-17 13:10:22 -07:00
Colin McDonnell
8a176913d8 Tweak test docs 2023-07-17 11:42:13 -07:00
Alex Lam S.L
570a44d73a workaround readable-stream compatibility (#3626)
- update `bun link` tests
- update `tests/bun.lockb`
- drop unused import in test
2023-07-17 20:05:01 +03:00
Jarred SUmner
5218a33fb6 Fix flaky process test 2023-07-17 04:51:26 -07:00
Jarred Sumner
58824ea743 Fix test with incorrect text 2023-07-17 04:44:56 -07:00
Jarred Sumner
99de971359 Fix incorrect name 2023-07-17 04:21:00 -07:00
Jarred Sumner
55b5aa3571 Fix speculative crashes in console.log(formData) and console.log(headers) 2023-07-17 04:18:43 -07:00
Jarred Sumner
6ca20424d6 Fix crash in console.log(urlSearchParams) on a URLSearchParams object with a lot of keys 2023-07-17 04:18:43 -07:00
Jarred Sumner
36a25c3580 Fix memory leak in await new Response(latin1String).arrayBuffer() and await Response.json(obj).json() (#3656)
❯ mem bun --smol response-arrayBuffer.mjs
cpu: Apple M1 Max
runtime: bun 0.6.15 (arm64-darwin)

benchmark                                                        time (avg)             (min … max)       p75       p99      p995
--------------------------------------------------------------------------------------------------- -----------------------------
new Response().arrayBuffer() (new string each call, latin1)    12.9 µs/iter      (625 ns … 4.18 ms)      1 µs 567.17 µs 711.79 µs
new Response().arrayBuffer() (new string each call, utf16)    12.85 µs/iter     (1.67 µs … 1.56 ms)   2.17 µs 462.75 µs 621.13 µs
new Response().arrayBuffer() (existing string, latin1)         6.53 µs/iter     (6.21 µs … 7.07 µs)   6.64 µs   7.07 µs   7.07 µs

Peak memory usage: 49 MB

bun on  jarred/memory-leak-fix took 2s
❯ mem bun response-arrayBuffer.mjs
cpu: Apple M1 Max
runtime: bun 0.6.15 (arm64-darwin)

benchmark                                                        time (avg)             (min … max)       p75       p99      p995
--------------------------------------------------------------------------------------------------- -----------------------------
new Response().arrayBuffer() (new string each call, latin1)     1.2 µs/iter     (1.04 µs … 1.42 µs)   1.22 µs   1.42 µs   1.42 µs
new Response().arrayBuffer() (new string each call, utf16)     2.74 µs/iter     (2.42 µs … 6.37 µs)   2.68 µs   6.37 µs   6.37 µs
new Response().arrayBuffer() (existing string, latin1)       746.37 ns/iter   (643.82 ns … 1.04 µs) 776.11 ns   1.04 µs   1.04 µs

Peak memory usage: 104 MB

bun on  jarred/memory-leak-fix took 2s
❯ mem ~/.bun/bin/bun response-arrayBuffer.mjs
cpu: Apple M1 Max
runtime: bun 0.6.15 (arm64-darwin)

benchmark                                                        time (avg)             (min … max)       p75       p99      p995
--------------------------------------------------------------------------------------------------- -----------------------------
new Response().arrayBuffer() (new string each call, latin1)    1.69 µs/iter      (1.56 µs … 2.1 µs)   1.73 µs    2.1 µs    2.1 µs
new Response().arrayBuffer() (new string each call, utf16)     2.65 µs/iter     (2.47 µs … 3.17 µs)   2.69 µs   3.17 µs   3.17 µs
new Response().arrayBuffer() (existing string, latin1)       667.67 ns/iter   (547.67 ns … 1.28 µs) 694.21 ns   1.28 µs   1.28 µs

Peak memory usage: 2735 MB

bun on  jarred/memory-leak-fix took 2s
❯ mem ~/.bun/bin/bun --smol response-arrayBuffer.mjs
cpu: Apple M1 Max
runtime: bun 0.6.15 (arm64-darwin)

benchmark                                                        time (avg)             (min … max)       p75       p99      p995
--------------------------------------------------------------------------------------------------- -----------------------------
new Response().arrayBuffer() (new string each call, latin1)   13.51 µs/iter       (541 ns … 3.2 ms)   1.92 µs 553.42 µs 709.92 µs
new Response().arrayBuffer() (new string each call, utf16)    13.07 µs/iter     (1.71 µs … 3.43 ms)   2.13 µs 451.21 µs 651.67 µs
new Response().arrayBuffer() (existing string, latin1)         6.25 µs/iter     (5.79 µs … 6.81 µs)    6.4 µs   6.81 µs   6.81 µs

Peak memory usage: 292 MB

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-17 04:15:13 -07:00
Jarred Sumner
13b5d9d4de 20% faster deserialize (#3655)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-17 02:22:00 -07:00
Jarred Sumner
fa4db1de42 Document --smol 2023-07-16 23:24:00 -07:00
Jarred Sumner
2a02f3d669 Add --smol to bunfig 2023-07-16 23:23:33 -07:00
Jarred Sumner
75213aad37 Document serialize/deserialize 2023-07-16 23:16:54 -07:00
Jarred Sumner
5856639833 Add serialize snippet 2023-07-16 23:16:38 -07:00
Jarred Sumner
edeb3b48e8 Fix test 2023-07-16 22:46:06 -07:00
Jarred Sumner
3613429dc3 Update workers.md 2023-07-16 22:43:38 -07:00
Jarred Sumner
7917ebd58f Fixes base64url encoding for crypto (#3654)
* Fixes base64url encoding for crypto

* 🍏

* Update nodejs-apis.md

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-16 22:42:19 -07:00
Jarred Sumner
a86d00c672 Update nav.ts 2023-07-16 21:43:22 -07:00
Jarred Sumner
d5c51092c8 rename 2023-07-16 21:40:07 -07:00
Jarred Sumner
6a234e6fce Add structuredClone microbenchmark 2023-07-16 21:17:55 -07:00
Jarred Sumner
dc766eb18a Add --smol flag 2023-07-16 21:17:47 -07:00
Jarred Sumner
209dc981c0 Implement Workers (#3645)
* copy files

* format

* options

* Introduce `Worker`, `onmessage`, `onerror`, and `postMessage` globals

* Stub `Worker.prototype.ref` & `Worker.prototype.unref`

* Update web_worker.zig

* Worker works

* Add "mini" mode

* add wakeup

* Partially fix the keep-alive issue

* clean up refer behavior

* Implement `serialize` & `deserialize` in `bun:jsc` & add polyfill for `node:v8`

* Types & docs

* Update globals.d.ts

* Add mutex

* Fixes

---------

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-16 21:15:24 -07:00
Jarred Sumner
7fc392b182 Support napi_wrap in constructors (#3614)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-16 20:32:33 -07:00
Jarred Sumner
6baa08313c Fixes #3641 (#3643)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-16 20:32:18 -07:00
Jiri Spac
131ed06020 docs: add one missing line in typescript.md (#3650) 2023-07-16 20:31:54 -07:00
Dylan Conway
e546e4064c structuredClone types 2023-07-14 19:49:15 -07:00
Dylan Conway
c39c11e101 structured clone (#3637)
* copy `SerializedScriptValue`

* format

* make `SerializedScriptValue` compile

* add `transfer` option

* tests

* serialize/deserialize blobs

* tests for blobs

* serialize/deserialize file blobs

* more tests

* small cleanup

* format

* small changes + serialize offset

* slice helper

* map and set test
2023-07-14 19:37:22 -07:00
Colin McDonnell
2551210426 Update docs 2023-07-14 11:33:07 -07:00
Colin McDonnell
43abf2629f Remove fdatasync from types 2023-07-13 17:48:46 -07:00
Colin McDonnell
325147261f Update docs/types for process (#3631)
* Update docs/types for process

* Tweaks

* Tweaks

* Fix types
2023-07-13 17:40:46 -07:00
Tiramify (A.K. Daniel)
044b09afc2 Impl. fix (#3630) 2023-07-13 14:29:24 -07:00
Ashcon Partovi
9eb8eea2a8 Implement ping(), pong(), terminate() for WebSocket client and server (#3257) 2023-07-13 09:39:43 -07:00
Jarred Sumner
04b4157232 Fixes #3629 2023-07-13 02:57:25 -07:00
Jarred Sumner
a02a79e26c Bump WebKit 2023-07-12 20:48:52 -07:00
dave caruso
ae0a724981 Improve our internal typedefs (#3608)
* types

* some more

* yeah

* i think that fixes it

* oop
2023-07-12 15:21:55 -07:00
Tiramify (A.K. Daniel)
0631f87866 feat(bun/test): Implement "bail" option for "bun test" (#3253)
* Implement bun test --bail

* Fixes

* move printSummary() (more readable)

* Fixes 2

* idk why it got deleted

* Fixes 3

* fmt this better

* Update test_command.zig

* Fix "0 files"

* track number of files so bailing out early prints the right number

---------

Co-authored-by: dave caruso <me@paperdave.net>
2023-07-12 13:41:46 -07:00
Jarred Sumner
4e1a81231c Update build-id 2023-07-12 01:37:08 -07:00
Jarred Sumner
b566573977 Fix another crash in Error.captureStackTrace (#3611)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-11 21:01:35 -07:00
Jarred SUmner
666feb3b7e Fix crash on linux when throwing SystemError from C++ 2023-07-11 20:52:10 -07:00
Jarred Sumner
5ea32a976e Update process.test.js 2023-07-11 19:49:41 -07:00
Jarred Sumner
34b0e7a2bb Update ZigGlobalObject.cpp 2023-07-11 19:06:49 -07:00
Jarred Sumner
c5f2280489 Implement process.kill and process._kill 2023-07-11 19:06:01 -07:00
Jarred Sumner
a686b3bfc1 Fixes #3595 2023-07-11 19:00:51 -07:00
dave caruso
a1fb289c96 typo (#3610) 2023-07-11 18:50:34 -07:00
Dylan Conway
8ca2194a37 fix #3597 (#3609)
* fix #3597

* Update http.ts

* initialize to true
2023-07-11 18:49:35 -07:00
Jarred Sumner
03904f73cc Merge branch 'jarred/throw-if' 2023-07-11 17:48:52 -07:00
Jarred Sumner
2106e1d7f6 Tests 2023-07-11 17:48:13 -07:00
Jarred Sumner
854ddaa909 Implement throwIfNoEntry 2023-07-11 17:44:29 -07:00
Colin McDonnell
609f81a746 Add npmrc note 2023-07-11 15:32:52 -07:00
Jarred Sumner
fd4c8fb871 Merge branch 'jarred/fix-http-compression' 2023-07-11 13:09:37 -07:00
Jarred Sumner
bab58b7541 Avoid Object.getPrototypeOf 2023-07-11 13:07:03 -07:00
Dylan Conway
5c8726d602 process signal events (#3569)
* signal events

* simple tests

* ignore SIGSTOP

* better tests

* use `EventEmitter`

* use `Bun__getDefaultGlobal`

* progress

* don't use 'Bun__getDefaultGlobal`

* fix tests

* remove signals from map

* update tests

* don't overwrite event emitter methods

* avoid two lookups

* use `std::once`

* releaseEarly()

* Remove signal handler after use

* Update call-raise.js

* Create process-signal-handler.fixture.js

* Don't register duplicates

* Add missing lock

* another test

* update test

* revert some changes

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-11 12:48:46 -07:00
Dylan Conway
ae7bc37e94 fix iterating stack trace (#3600)
* `i + 1` and remove `defer`

* a test

* fix test
2023-07-11 12:48:32 -07:00
dave caruso
31ab56d362 Fix: console.log with class constructors (#3602)
* Fix console.log with class constructors

* oops

* fix it

* lol

* fix test
2023-07-11 12:48:19 -07:00
simylein
4b333b2d35 docs(sqlite): database prepare types reflect runtime (#3599)
* docs(sqlite): database prepare types reflect runtime

* Update sqlite.d.ts

---------

Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2023-07-11 09:09:06 -07:00
Hanaasagi
c4c5eb2d32 use Object.getPrototypeOf 2023-07-11 21:31:49 +09:00
Ai Hoshino
e7afae305c Merge branch 'main' into fix-http 2023-07-11 19:35:11 +08:00
Hanaasagi
17031936c8 small fix, check if the method has been reassigned. 2023-07-11 20:32:09 +09:00
dave caruso
b2c576bba2 fix "readable" event being emitted incorrectly (#3475)
* fix "readable" event being emitted incorrectly

* fix impl and add test

* changes

* asdfghj

* esm
2023-07-10 18:25:20 -07:00
Ciro Spaciari
4af4b508a1 feat(crypto) add getCurves (#3598)
* add getCurves

* add nodefallbacks

* update docs

* oops
2023-07-10 17:14:37 -07:00
Hanaasagi
0c2df4ae01 ignore check 2023-07-10 22:33:07 +09:00
Ai Hoshino
cc0d920018 Merge branch 'main' into fix-http 2023-07-10 21:12:00 +08:00
Hanaasagi
438d54f186 add tests 2023-07-10 22:04:39 +09:00
Hanaasagi
c6e1135548 call writeHead before send headers
Close: #3585
2023-07-10 21:35:10 +09:00
Jarred Sumner
ec11170311 Fixes #3588 (#3590)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-10 02:21:03 -07:00
Jarred Sumner
538bcef731 Update globals.d.ts 2023-07-10 01:33:46 -07:00
Jarred Sumner
93b0e94410 trim node:stream a little 2023-07-10 01:26:02 -07:00
Jarred Sumner
963d4311e6 Fixes #3530 (#3587)
* Fixes #3530

* Handle OOM

* Add test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-09 22:36:24 -07:00
Jarred Sumner
2f5e4fffe9 Implement process.memoryUsage() and process.cpuUsage() (#3586)
* Implement process.memoryUsage() and process.cpuUsage()

* Avoid mi_process_info

* Update bench

* Update Process.cpp

* fixup

* More tests + linux fixup

* Skip it for now since it seems less accurate

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-09 21:50:19 -07:00
Jarred Sumner
ca42c820d2 Implement nearly all of process object methods and properties (#3581)
* Add special case

* Make process object load faster

* Fix openStdin

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-09 16:33:49 -07:00
Ai Hoshino
565d1689e9 fix metadata bits of uuid (randomUUID()) (#3583)
* fix uuid version
Close: https://github.com/oven-sh/bun/issues/3575

* add unittest

* small fix

* avoid unnecessary copying
2023-07-09 07:20:52 -07:00
Jarred Sumner
59570fe237 Handle case with TS decorators and export default anonymous class (#3578)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-08 17:41:24 -07:00
Jarred Sumner
aa8b832ef6 Implement process.on("beforeExit", cb) and process.on("exit", cb) (#3576)
* Support `process.on('beforeExit')` and `process.on('exit')`

* [bun:sqlite] Always call sqlite3_close on exit

* Update process.test.js

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-08 14:26:19 -07:00
Jarred Sumner
fa632c3331 Fix bug with decorators not being generated in export default class (#3577)
* Fix bug with decorators not being generated in `export default class`

* Update decorator-export-default-class-fixture.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-08 04:00:55 -07:00
Jarred Sumner
5846ad00ed Add assertion 2023-07-07 22:01:58 -07:00
Jarred Sumner
e26d3821ce Update settings.json 2023-07-07 22:01:43 -07:00
Jarred Sumner
fceacea37c Unmark as TODO 2023-07-07 22:01:02 -07:00
Jarred Sumner
52b7962dae Use BunString in JSBundlerPlugin (#3557)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-07 21:20:30 -07:00
Jarred Sumner
386d8b7836 Update test 2023-07-07 21:20:16 -07:00
Jarred Sumner
67ee498861 Fix potential coercion issue (#3558)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-07 20:12:39 -07:00
Artur Androsovych
42eacaf3a9 Update installation guide in development.md (#3532)
* Update installation guide in `development.md`

* Updates

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-07-07 16:24:07 -07:00
Ai Hoshino
c0cf7b4501 fix decoding invalid UTF-8 input (#3563)
* fix decoding invalid UTF-8 input
Close: https://github.com/oven-sh/bun/issues/3562

* add unittest
2023-07-07 15:10:49 -07:00
Colin McDonnell
affd06d05c Update types, partially fix typecheck (#3551)
* Update types

* Remove caret
2023-07-07 15:10:33 -07:00
Jarred Sumner
7ab8d832fb Add obscure HTTP methods (#3553)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-07 00:38:18 -07:00
Jarred Sumner
0ecdbf4793 [node:fs] read, write - support large numbers and BigInt (#3556)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-07 00:33:43 -07:00
Jarred Sumner
284aaec3cd Remove unnecessary @setRuntimeSafety(false) 2023-07-06 23:50:32 -07:00
Dylan Conway
9bebb7f03d add [dir] to default 2023-07-06 20:51:41 -07:00
Jarred Sumner
5c0a5646cd Update list 2023-07-06 17:11:01 -07:00
Jarred Sumner
4d2c86fd5c Add util.toUSVString 2023-07-06 17:08:01 -07:00
Jarred Sumner
d905dbe214 Minify zlib because its huge 2023-07-06 16:50:03 -07:00
Jarred Sumner
038ca83004 Add missing export in url 2023-07-06 16:49:41 -07:00
Colin McDonnell
d377265b67 Update trustedDeps doc 2023-07-06 15:44:48 -07:00
Colin McDonnell
a415f482db Update trustedDeps doc 2023-07-06 15:33:49 -07:00
Ciro Spaciari
954b6fcaf3 refactor (#3543) 2023-07-06 13:55:27 -07:00
Dylan Conway
abe095dd1e fixes #3544 (#3549) 2023-07-06 13:55:00 -07:00
Colin McDonnell
109ebc14fd Various docs updates (#3437)
* Various docs updates

* Add mocks page

* Fix make

* WebKit instructions

* Update instructions

* Updates

* Update nodejs compat table

* Document trusted deps

* Tweak trustedDependencies docs

* Document --exact

* Update test docs

* Tweaks

* Boring

* Remove redundant j

* Undo makefile changes

* Undo makefile changes

* Update page title

* Regen

* Undo changes
2023-07-06 13:02:29 -07:00
Ciro Spaciari
95ddfcc437 fix query without slash (#3547) 2023-07-06 12:01:16 -07:00
Jarred Sumner
ee57935260 Fixes #3537 (#3539)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-06 00:06:43 -07:00
Dylan Conway
6bf8f6f9f2 don't unwrap react below version 18.0.0 (#3538)
* don't unwrap react below version 18

* empty string

* also `react-dom`
2023-07-05 22:23:32 -07:00
Ciro Spaciari
8869bac411 fix callbacks on release version (#3531) 2023-07-05 22:22:56 -07:00
Dylan Conway
f61d9ef476 Update websocket_http_client.zig 2023-07-05 12:45:20 -07:00
Jarred Sumner
3aaec120e7 Fixes #3512 (#3526)
* Fixes #3512

* Fix `clearTimeout` and `clearInterval` not cancelling jobs same-tick

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-05 03:46:10 -07:00
Jarred Sumner
c864976da6 Fixes #3515 (#3523)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-05 01:21:35 -07:00
Jarred Sumner
a7f5a91cfb Fixes #3520 (#3522)
* Fixes #3520

* Update html_rewriter.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-05 00:08:59 -07:00
Ciro Spaciari
75816aa3ab add envs on tests (#3518)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-07-05 00:08:49 -07:00
Jarred Sumner
cac7dcdc76 Update build-id 2023-07-04 16:59:33 -07:00
Jarred Sumner
9c374eac96 Fix build determinism issue (thanks to @alexlamsl)
cc @dylan-conway this was the cause
2023-07-04 16:59:03 -07:00
Jarred Sumner
b2e28f133e boop 2023-07-04 16:57:46 -07:00
Ciro Spaciari
3a93ddfab3 use sengrid account on nodemailer test (#3517) 2023-07-04 15:41:37 -07:00
Ciro Spaciari
979e999403 [tls] fix servername (#3513)
* fix servername

* add postgres tls tests

* update test packages

* add basic CRUD test
2023-07-04 15:40:26 -07:00
Ai Hoshino
c2755f770c Add alias for readBigUInt64BE ... (#3514)
* Add alias for `readBigUInt64BE` ...
Close: https://github.com/oven-sh/bun/issues/3338

* add some tests for `readBigUint64BE` alias

* format code
2023-07-04 15:38:44 -07:00
Jarred Sumner
31f7f9e2dc reduce count 2023-07-04 04:15:22 -07:00
Jarred Sumner
491e8f7e00 bump 2023-07-04 04:14:06 -07:00
Jarred Sumner
bb96aa5156 Fix crash 2023-07-04 04:07:35 -07:00
Jarred Sumner
f49a308d2c Create readfile-not-found.mjs 2023-07-04 03:48:10 -07:00
Alex Lam S.L
3d0ffc48cb [install] fix run-time module loading (#3510)
- fix version buffer confusion
- improve workaround to handle cached modules

fixes #3507
2023-07-04 02:09:58 -07:00
Jarred Sumner
bc7b5165be less flaky 2023-07-04 01:51:09 -07:00
Jarred Sumner
a76b07a802 cleanup 2023-07-04 01:18:13 -07:00
Jarred SUmner
33bc507f74 Fix napi 2023-07-04 01:04:18 -07:00
Jarred Sumner
3345a7fc3c Allow zero length WebSocket client & server messages (#3488)
* Allow zero length WebSocket client & server messages

* Add test

* Clean this up a little

* Clean up these tests a little

* Hopefully fix the test failure in release build

* Don't copy into the receive buffer

* Less flaky

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-03 20:53:41 -07:00
Jarred Sumner
b26b0d886c Fix napi bug 2023-07-03 15:57:10 -07:00
Ciro Spaciari
034577c9da [fix] patch fs.watch sym link (#3481)
* oopsie

* add tests

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-07-03 14:08:49 -07:00
Jarred Sumner
424717a973 Fixes #3317 2023-07-03 13:47:37 -07:00
Jarred Sumner
e5f93ddf55 Update lifecycle.md 2023-07-03 13:46:20 -07:00
Jarred Sumner
983039a18a Fixes #3508 2023-07-03 13:16:57 -07:00
Ciro Spaciari
a7a01bd52f [tls] add socket parameter, setServername and ALPNprotocols support (#3457)
* add socket parameter support

* refactor #socket

* add test and more fixs

* some fixes

* bump uws

* handlers fix

* more fixes

* fix node net and node tls tests

* fix duplicate port

* fix deinit on CallbackJobs

* cleanup

* add setImmediate repro

* add test to setImmediate

* this is necessary?

* fix prependOnce on native listener

* try to findout the error on nodemailer CI

* show error message

* Update bun.lockb

* prettier

* Use exact versions of packages

* add alpnProtocol support

* update

* emit error when connect fails on net.Socket

* format

* fix _write and cleanup

* fixup

* fix connect, add alpn test

* fix socket.io

* add socket parameter to TLSSocket

* add TLSSocket socket first parameter

* fixup and _start

* remove flask tests

* fmt

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-03 12:19:50 -07:00
Jarred Sumner
48d726bfd0 Update time.md 2023-07-02 23:48:31 -07:00
Jarred Sumner
12a342b6c0 Update time.md 2023-07-02 23:47:48 -07:00
Jarred Sumner
1206352b4a Update time.md 2023-07-02 23:46:08 -07:00
Jarred Sumner
9da9bac30c Update time.md 2023-07-02 23:18:58 -07:00
Jarred Sumner
cd243f40ee Update time.md 2023-07-02 23:10:50 -07:00
Jarred Sumner
000417731b Add time doc 2023-07-02 23:07:33 -07:00
Jarred Sumner
c77518ff93 Update writing.md 2023-07-02 22:57:24 -07:00
Jarred Sumner
f0a795b568 Stub out useFakeTimers and useRealTimers 2023-07-02 22:42:13 -07:00
Jarred Sumner
aa38e51afb Support mocking new Date() & Date.now() in bun:test (#3501)
* Support changing the time

* Bump WebKit

* Update bun.lockb

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-02 22:09:50 -07:00
dave caruso
c21fadf9bc set content-length 0 in some cases (#3503) 2023-07-02 20:24:15 -07:00
Jarred Sumner
0db31c2b43 Fixes #3499 2023-07-02 20:18:21 -07:00
Jarred Sumner
3a0a423bce Add comment 2023-07-02 20:17:25 -07:00
Jarred Sumner
eb90ce50c3 Use fast path for Base64 in btoa (#3504)
* Use fast path for Base64 in `atob`

* Fix utf16, crash on linux

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-02 20:16:52 -07:00
Jarred Sumner
c3f8593f8c [node:buffer] Implement isUtf8 and isAscii (#3498)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-02 18:06:21 -07:00
dave caruso
4cbda049e9 fix zero length env var (#3496) 2023-07-02 10:12:31 -07:00
Jarred Sumner
69396aae01 Fixes #3495 2023-07-02 10:09:52 -07:00
Jarred Sumner
b05879e9e2 Fixes #3489 (#3490)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-02 01:06:40 -07:00
Jarred Sumner
8001038376 Use exact versions in tests 2023-07-01 22:43:59 -07:00
Jarred Sumner
c7cc618376 Fix leak in fd (#3487)
* Fix file descriptor leak

* Skip unnecessary clone

* Don't break --hot

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-01 21:58:06 -07:00
Jarred Sumner
9fecb3dfb9 Bump 2023-07-01 21:10:55 -07:00
Jarred Sumner
617226e584 Make this test less flaky 2023-07-01 21:10:43 -07:00
Jarred Sumner
c72c82b970 Make this test less flaky 2023-07-01 21:08:26 -07:00
Jarred Sumner
6cae6ebafe Make buffer.toString("base64") 4x faster (#3486)
* Add libbase64

* Add bench

* Update licensing.md

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-01 20:02:50 -07:00
Jarred Sumner
a2cca6e292 Update WebCoreJSBuiltins.cpp 2023-07-01 18:31:38 -07:00
Jarred Sumner
01d3b130a9 Update build-id 2023-07-01 17:44:40 -07:00
Jarred Sumner
af46a8ded1 Make this test less flaky 2023-07-01 17:38:19 -07:00
Jarred Sumner
f00e2be548 Use BunString in SystemError (#3485)
* Use `BunString` in SystemError

* Use Bun::toStringRef when we will de-ref strings

* Move `napi_create_error` to C++ to support `code` being a Symbol potentially

* Update blob.zig

* Make this test less flaky

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-01 17:37:44 -07:00
Jarred Sumner
a4fe433db7 Slight fixup 2023-07-01 17:09:59 -07:00
Jarred Sumner
f3833376e7 small cleanup 2023-07-01 17:07:37 -07:00
Ai Hoshino
4720fa1207 [WIP]Fix calling Buffer.toString with (offset, length, encoding) (#3467)
* Allow `toString` to be called with `(offset, length, encoding)`.
Close: #3085

* handle undefined value

* add tests for buffer.xxxSlice

* fix parameters

* fix offset and length
2023-07-01 17:01:52 -07:00
Jarred Sumner
df10252979 Make HTTP Request struct use 8 bytes less memory (#3483)
* Make HTTP Request struct use 8 bytes less memory

* Update server.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-01 14:40:05 -07:00
Dylan Conway
c033d55c47 skip private class fields (#3484) 2023-07-01 14:38:38 -07:00
Jarred Sumner
c794ea7ea7 Add test 2023-07-01 13:31:12 -07:00
Alex Lam S.L
02f707f231 [jest] fix lifecycle hook execution order (#3461)
* [jest] fix lifecycle hook execution order

* strip `std.debug.assert()` from release build
2023-07-01 11:44:04 -07:00
dave caruso
d356cd5d48 implement perf_hooks.constants (#3476) 2023-06-30 14:58:38 -07:00
Stijn Van Hulle
b83faf8018 fix: export ClientRequest and OutgoingMessage as part of the node:http package (#3470) 2023-06-30 10:04:46 -07:00
Alex Lam S.L
2a73d3c793 [install] handle workspace: specifier correctly (#3474)
fixes #3430
2023-06-30 10:03:53 -07:00
Jarred Sumner
039bbc68ad Add missing "prependListener" function 2023-06-29 21:24:55 -07:00
dave caruso
b9460087e3 Fixes node:http and node:stream so ytdl-core works. (#3452)
* fix crash in readablestate

* make node:https request+get actually use https

* use a native readablestream in IncomingMessage

* tweaks

* fix abort crash

* emit close by default

* remove abort. this isnt a real function

* add validate functions, fixup some other requested changes. not done yet

* Update WebCoreJSBuiltins.cpp

* Update JSReadableState.cpp

* Add some missing exports

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-29 20:36:18 -07:00
Jarred Sumner
c42a00f9df Fixes #3462 (#3465)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-29 20:14:12 -07:00
Dylan Conway
76b9cae259 handle multiple redirects 2023-06-29 17:19:16 -07:00
Jarred Sumner
70a87e1181 Make node:os tmpdir more consistent with Node.js 2023-06-29 16:37:38 -07:00
Dylan Conway
7af757d104 add setters for Agent properties (#3460)
* make `Agent` properties public

* back to private, added setters

* change properties to public
2023-06-29 15:47:00 -07:00
Dylan Conway
9c66fdc703 [bundler] avoid printing unnecessary declarations (#3456)
* skip declarations without values

* tests

* deoptimize cjs when decls are needed
2023-06-29 14:51:24 -07:00
dave caruso
fec0d15c4f cant believe i missed this (#3453) 2023-06-29 08:53:44 -07:00
Jarred Sumner
853e377159 Revert "[jest] fix lifecycle hook execution order (#3447)" (#3455)
This reverts commit 182e8aa139.
2023-06-29 08:30:21 -07:00
Jarred Sumner
8984c81961 Prevent integer overflow 2023-06-28 21:57:31 -07:00
Jarred Sumner
c6f6db95ff Ref the strings 2023-06-28 21:56:45 -07:00
Jarred Sumner
8b2c72300c Another test 2023-06-28 21:56:26 -07:00
Jarred Sumner
8481f2922f Add GC test for errors 2023-06-28 21:45:16 -07:00
Jarred Sumner
68e6fe00a4 Use bun.String for ZigException (#3451)
* Use `bun.String` for `ZigException`

* woopsie

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-28 21:11:06 -07:00
Dylan Conway
3258bed1c0 use main field over module for runtime (#3448)
* use main field over module for runtime

* move flag to `Resolver`

* set `prefer_module_field` in `initWithModuleGraph`
2023-06-28 19:28:53 -07:00
Jarred Sumner
32d9abcc03 Fix bad test 2023-06-28 19:20:41 -07:00
dave caruso
0cee640199 export resolve6 from dns/promises (#3450) 2023-06-28 17:45:18 -07:00
Alex Lam S.L
182e8aa139 [jest] fix lifecycle hook execution order (#3447) 2023-06-28 16:27:15 -07:00
Jarred Sumner
945093ee7e bump! 2023-06-28 16:22:46 -07:00
Jarred Sumner
086ca176be Make these tests do more 2023-06-28 16:19:58 -07:00
Jarred Sumner
292647bd53 Introduce await Bun.file(path).exists() (#3446)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-28 16:09:08 -07:00
Jarred Sumner
42ded70336 [node:http] Stub _implicitHeader fn 2023-06-28 13:55:58 -07:00
Jarred Sumner
3d5573921e Error.prototype.stack gets sourcemapped stacktraces and introduce Error.appendStackTrace (#3441)
* Fix potential crash when reading sourcemapped stack traces

* Format & sourcemap Error.prototype.stack

* prevent double sourcemapping

* Introduce Error.appendStackTrace

* Fix source url

* hide private stack traces in non-debug builds

* fixes #3443

* Bump WebKit

* Fix test failure in vm.test

* Support new() & add test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-28 13:53:09 -07:00
Jarred Sumner
43752ec3f0 Fix assertion failure in escapeHTML with UTF-16 text (#3436)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-28 11:27:31 -07:00
Silas Rech
e6e3d9e368 Fix .randomInt() export (#3438) 2023-06-28 11:27:02 -07:00
Alex Lam S.L
0de5bb22af [install] workaround run-time module loading issue (#3432) 2023-06-28 01:20:59 -07:00
Dylan Conway
f670c0fc18 don't overwrite __esModule 2023-06-27 18:23:56 -07:00
Dylan Conway
09994d6067 add __esModule 2023-06-27 17:34:31 -07:00
Benjamin Ryan
f81d084f5c [bun:sqlite] enable FTS5 on linux build (#3431)
* [bun:sqlite] enable FTS5 on linux build

* prettier
2023-06-27 17:27:06 -07:00
Jarred Sumner
940c9a8185 Fix some checks 2023-06-27 16:16:47 -07:00
Dylan Conway
28d7507a5d add todo comment 2023-06-27 14:55:13 -07:00
Jarred Sumner
4f34d48029 getIfPropertyExists is safer than getDirect (#3391)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-27 13:42:25 -07:00
Dylan Conway
c78aa5a60f fix macros 2023-06-27 13:23:01 -07:00
Revenity
7ba4ae11c9 Update Stric page in Ecosystem (#3399) 2023-06-27 12:37:57 -07:00
Jarred Sumner
5376b5b5d6 Add builtin exports list 2023-06-27 10:29:22 -07:00
Ashcon Partovi
3ec6c9e4fb Fix docker tag on release 2023-06-27 09:10:43 -07:00
Jarred Sumner
2eb885c1d8 Regenerate 2023-06-27 08:24:35 -07:00
Ai Hoshino
1c46d88728 Fix node:util.callbackify (#3428)
* remove the incorrect parameters
Close: https://github.com/oven-sh/bun/issues/3424

* fix error code

* add callbackify tests

* fix function type

* ensure `done` is called when error occurred
2023-06-27 08:23:25 -07:00
Jarred Sumner
d220d9ee5a Update NodeModuleModule.cpp 2023-06-27 08:21:04 -07:00
Jarred Sumner
e77f593b76 Update build-id 2023-06-27 08:14:34 -07:00
Alex Lam S.L
b305309e64 minor build diffs (#3427) 2023-06-27 14:05:59 +03:00
Jarred Sumner
c96f3b303b Fix default export of "module" module 2023-06-26 20:39:15 -07:00
dave caruso
ecb0bd39b6 fix #3412 (#3422) 2023-06-26 19:27:12 -07:00
Dylan Conway
4e4cae0fc3 webpack test and add empty prototype prop to module (#3421) 2023-06-26 19:16:59 -07:00
Jarred Sumner
4be15cff02 Tweak the ramSize setting because /= 1024 is causing CI to fail on arm64 when there's only 8 GB of ram 2023-06-26 19:07:54 -07:00
Jarred Sumner
f839cf1ce3 Update crypto.mjs 2023-06-26 19:07:54 -07:00
Jarred Sumner
1e6a41b5cf change the text from "error" to "warn" 2023-06-26 19:07:54 -07:00
Dylan Conway
1ed1723a2f Update bundle_v2.zig (#3420) 2023-06-26 19:00:55 -07:00
Peter Weinberg
7a0b1656c7 docs: add troubleshooting section to installation page (#3389)
* docs: add troubleshooting section to installation page

* Add note for unzip

* Update msg in install.sh

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-06-26 18:25:33 -07:00
Jarred Sumner
28f27f733b [bun install] Implement --exact flag (#3409)
* [bun install] Implement `--exact` flag

* Rename to --save-exact

* Rename --exact to --save-exact

* Update bun-add.test.ts

* We're going with --exact as the flag name

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-26 15:51:57 -07:00
Jarred Sumner
a5100ad380 Fix .rejects 2023-06-26 15:49:26 -07:00
Silas Rech
16598555f1 .randomInt() support (#3357)
* Add initial .randomInt() fallback

* Add basic .randomInt() test

* Attempt creating a native implementation

* Switch to JSC.wrapWithHasContainer

* Switch to .jsNumberFromUint64(), it seems like using just .jsNumber() causes the number to overflow in some cases

* Regenerate out folder after rebasing
2023-06-26 15:35:48 -07:00
Jarred Sumner
a732999da5 Runtime support for __esModule annotations (#3393)
* Runtime support for `__esModule` annotations

* Ignore `__esModule` annotation when `"type": "module"` is set

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-26 12:49:20 -07:00
Dylan Conway
6d01e6e367 test moved to node-module-module.test.js 2023-06-26 12:09:18 -07:00
Jarred Sumner
50e872fc76 Implement writev & readv (#3419)
* [node:fs] Implement `writev` and `readv`

* writev & readv tests

* cast to const type

* woops

* cast

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-26 11:56:53 -07:00
Alex Lam S.L
318879d174 [install] support trustedDependencies (#3288)
* [install] support trustedDependencies

closes #2073

* use `strings.indexOfChar()`

* use hashes instead of strings

* utilise `inline else`
2023-06-26 11:55:26 -07:00
Dylan Conway
ec3ed67bc9 implement _nodeModulePaths and require.main.paths (#3411)
* tests in progress

* add `require.main.paths`, add every dir up to root

* remove imports
2023-06-26 08:12:37 -07:00
Jarred Sumner
76626ac54b Fix test failures in import.meta (#3403)
* Fix test failures in import.meta

* regenerate

* Use bound functions for `import.meta.require` and `import.meta.require.resolve` and `Module.createRequire`

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-25 19:48:56 -07:00
Jarred Sumner
116bcf4245 Fixes #3334 (#3401)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-25 18:49:16 -07:00
Jarred Sumner
f2285a6d71 Use bun.String in mkdir (#3404)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-25 17:54:55 -07:00
Jarred Sumner
e682ffb61c Update schema.zig 2023-06-25 17:54:21 -07:00
Jarred Sumner
9ebb25427a remove very old stuff 2023-06-25 17:51:24 -07:00
Jarred Sumner
66195ffeed Update WebKit 2023-06-25 17:50:12 -07:00
Brúnó Salomon
662335d81a chore: update lol-html version (#3356)
* chore: update lol-html version

* add tests

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-06-25 16:48:03 -07:00
Tiago Teixeira
d8817c2d32 Add support for install with --frozen-lockfile (#3365)
* Add support for install with --frozen-lockfile

* Add test

* Add test for frozenLockfile in config file
2023-06-25 16:43:39 -07:00
Jarred Sumner
15ac08474e fixup 2023-06-25 16:40:51 -07:00
Jarred Sumner
fdfbb18531 Support reading embedded files in compiled executables (#3405)
* Support reading embedded files in compiled executables

* 💅

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-25 16:32:27 -07:00
Ciro Spaciari
3ed28f2828 [fs.watch] fix reference/deinit (#3396)
* fix js reference

* fix close  oops

* refactor + hasPendingActivity

* fmt

* fix race conditions

* fixup

* add test calling close on error event

* fix close inside close + test

* cleanup
2023-06-25 16:16:25 -07:00
Ai Hoshino
fcf9f0a7ee Fix the parameters of WriteStream constructor. (#3402)
* Fix the parameters of the `WriteStream` constructor.
Close: https://github.com/oven-sh/bun/issues/3395

* test append mode in `createWriteStream`

* fix lint

* wait first stream finished
2023-06-25 16:15:56 -07:00
Alex Lam S.L
33903ea892 [install] fix hang in bun install --production (#3406) 2023-06-26 01:43:58 +03:00
Jarred Sumner
5bd94b8f47 Add process.mainModule 2023-06-25 11:43:54 -07:00
Jarred Sumner
aa5432e162 FIx launch.json cwd 2023-06-25 11:33:13 -07:00
Jarred Sumner
c4c714f10b Speculative fix for regression causing a hang with install --production (#3400)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-25 04:52:43 -07:00
Jarred Sumner
f8abd167d8 Revert "make these strings lazy"
This reverts commit 777f98bd10.
2023-06-25 04:17:07 -07:00
Jarred Sumner
777f98bd10 make these strings lazy 2023-06-25 03:32:10 -07:00
Jarred Sumner
30798c7078 Make timeout longer 2023-06-25 03:32:10 -07:00
Jarred Sumner
bc7719fc28 Reliability bugfix for WebSocket (#3394)
* Rewrite elementLengthLatin1IntoUTF8

* Update SIMDUTF

* Make `elementLengthLatin1IntoUTF8` faster

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-25 02:58:49 -07:00
Jarred Sumner
ff63555143 Rewrite Bun's runtime CommonJS loader (#3379)
* wip changes for CommonJS

* this rewrite is almost complete

* even more code

* wip

* Remove usages of `import.meta.require` from builtins

* Remove usages of require

* Regenerate

* ✂️ builtin rewrite commonjs in printer

* Use lazy custom getters for import.meta

* fixups

* Remove depd

* ugh

* still crashing

* fixup undici

* comment out import.meta.require.resolve temporarily

not a real solution but it stops the crashes

* Redo import.meta.primordials

* Builtins now have a `builtin://` protocol in source origin

* Seems to work?

* Finsih getting rid of primordials

* switcharoo

* No more function

* just one more bug

* Update launch.json

* Implement `require.main`

* ✂️

* Bump WebKit

* Fixup import cycles

* Fixup improt cycles

* export more things

* Implement `createCommonJSModule` builtin

* More exports

* regenerate

* i broke some stuff

* some of these tests work now

* We lost the encoding

* Sort of fix zlib

* Sort of fix util

* Update events.js

* bump

* bump

* bump

* Fix missing export in fs

* fix some bugs with builtin esm modules (stream, worker_threads, events). its not perfect yet.

* fix some other internal module bugs

* oops

* fix some extra require default stuff

* uncomment this file but it crsahes on my machine

* tidy code here

* fixup tls exports

* make simdutf happier

* Add hasPrefix binding

* Add test for `require.main`

* Fix CommonJS evaluation order race condition

* Make node:http load faster

* Add missing exports to tls.js

* Use the getter

* Regenerate builtins

* Fix assertion failure in Bun.write()

* revamp dotEnv parser (#3347)

- fixes `strings.indexOfAny()`
- fixes OOB array access

fixes #411
fixes #2823
fixes #3042

* fix tests for `expect()` (#3384)

- extend test job time-out for `darwin-aarch64`

* `expect().resolves` and `expect().rejects` (#3318)

* Move expect and snapshots to their own files

* expect().resolves and expect().rejects

* Fix promise being added to unhandled rejection list

* Handle timeouts in expect(<promise>)

* wip merge

* Fix merge issue

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>

* fixup min/memcopy (#3388)

* Fix crash in builtins

* Don't attempt to evaluate modules with no source code

* Update WebCoreJSBuiltins.cpp

* Update WebCoreJSBuiltins.cpp

* Update WebCoreJSBuiltins.cpp

* Fix crash

* cleanup

* Fix test

cc @paperdave

* Fixup Undici

* Fix issue in node:http

* Create util-deprecate.mjs

* Fix several bugs

* Use the identifier

* Support error.code in `util.deprecate`

* make the CJs loader slightly more resilient

* Update WebCoreJSBuiltins.cpp

* Fix macros

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Alex Lam S.L <alexlamsl@gmail.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2023-06-24 06:02:16 -07:00
Ciro Spaciari
069b42a7cc [feat] fs.watch (#3249)
* initial support

* add types

* fix comment

* fix types

* bigfix up

* more fixes

* fix some encoding support for watch

* fix rename event

* fixup

* fix latin1

* add fs_events, still failing some tests

* fixuup

* remove unecesary check

* readd tests ops

* this is necessary? just testing CI/CD weird errors

* just use dupe here

* cleanup and fix deinit

* fix zig upgrade
2023-06-23 23:24:34 -07:00
dave caruso
ceec1afec2 Add vi.spyOn and clean up some mock function binding calls (#3376)
* Add vi.spyOn and clean up some binding calls

* add vi.restoreAllMocks

* remove junk file

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-06-23 23:24:05 -07:00
dave caruso
5ae8e5d773 Make node-fallbacks build as esm not cjs / Fix node-fetch (#3377)
* Make node-fallbacks build as esm not cjs.

* fix stuff
2023-06-23 23:23:39 -07:00
Ciro Spaciari
4ff920c915 fixup min/memcopy (#3388) 2023-06-23 18:19:00 -07:00
Ashcon Partovi
217501e180 expect().resolves and expect().rejects (#3318)
* Move expect and snapshots to their own files

* expect().resolves and expect().rejects

* Fix promise being added to unhandled rejection list

* Handle timeouts in expect(<promise>)

* wip merge

* Fix merge issue

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-22 22:27:00 -07:00
Alex Lam S.L
ae4b65c52e fix tests for expect() (#3384)
- extend test job time-out for `darwin-aarch64`
2023-06-22 20:13:26 -07:00
Alex Lam S.L
ca1fe3c602 revamp dotEnv parser (#3347)
- fixes `strings.indexOfAny()`
- fixes OOB array access

fixes #411
fixes #2823
fixes #3042
2023-06-22 17:05:54 -07:00
Jarred Sumner
4a13a53058 CommonJS bun build cannot use import.meta (#3378)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-22 01:06:50 -07:00
Dylan Conway
5fa13625a1 upgrade zig to v0.11.0-dev.3737+9eb008717 (#3374)
* progress

* finish `@memset/@memcpy` update

* Update build.zig

* change `@enumToInt` to `@intFromEnum` and friends

* update zig versions

* it was 1

* add link to issue

* add `compileError` reminder

* fix merge

* format

* upgrade to llvm 16

* Revert "upgrade to llvm 16"

This reverts commit cc930ceb1c.

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-21 23:38:18 -07:00
Jarred Sumner
bfb322d618 Revert "Update Github action runners"
This reverts commit 69f558db8e.
2023-06-21 19:52:53 -07:00
dave caruso
43865a3e29 finish implementing JSMockFunction prototype + lots of expect test organizing (#3304)
* mock tests

* fix mistake

* stuff

* partially implement mock return promises

* lot of housecleaning on jest tests

* document / rename internalFields in jsmockfunction

* finish implementing JSMockFunction prototype

* cleanup

* more progress

* everything is done

* remove demo.test.js

* finish rebase

* requested changes

* fix compile error
2023-06-21 12:59:56 -07:00
Andreas Pfurtscheller
b691212c6e Update module resolution order docs (#3372)
If I'm reading and interpreting [these lines](69f558db8e/src/options.zig (L605-L627)) correct, the module resolution order [in the current docs](https://bun.sh/docs/runtime/modules#resolution) is outdated.

This change will fix the order.
2023-06-21 12:08:05 -07:00
Ashcon Partovi
69f558db8e Update Github action runners 2023-06-21 11:14:41 -07:00
Jarred Sumner
9befbf02f1 Update WebKit 2023-06-20 21:32:19 -07:00
Jarred Sumner
f81c7f10f6 Fix crash with .env files that are exactly 159 bytes long (#3369)
* Fix crash with .env files that are exactly 158 bytes and a newline character

* Update env_loader.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-20 21:17:32 -07:00
Jarred Sumner
b9c950bfb7 Improve error message for error.DependencyLoop (#3368)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-20 19:29:47 -07:00
Dylan Conway
6a1fbef8fd record jsx factory symbols in classic mode (#3360)
* record jsx factory symbols

* merge factory/fragment when more than one part

* update test

* use existing functions, use, `memberListToComponentsIfDifferent`

* missing file

* fix defaults
2023-06-20 19:29:20 -07:00
Dylan Conway
5006435234 enable asymmetric matchers in expect.toEqual, expect.toStrictEqual, and expect.toHaveProperty (#3367)
* add asymmetric matchers to `deepEquals`

* fix comparison of a few jstypes

* clean up and tests

* fix merge

* improve `expect.any` for primitives
2023-06-20 19:06:58 -07:00
Colin McDonnell
adb451eec6 Docs for DOM testing and FileSink (#3330)
* Update websocket docs & jsdoc

* Add info about user-specific data in ws

* Document FileSink

* Docs for happydom test

* Updates
2023-06-20 18:57:37 -07:00
Jarred Sumner
62639081c1 [JSTranspiler] Make scan and scanImports more careful with GC 2023-06-20 18:55:14 -07:00
Jarred Sumner
570ef07170 woops 2023-06-20 18:06:28 -07:00
Jarred Sumner
83d7ec728f Clone SourceOrigin string 2023-06-20 17:12:47 -07:00
Jarred Sumner
9f301e13c5 Cleanup fs.utimesSync (#3363)
* Fix UB in fs.utimesSync when passing a number with an integer greater than i32

* Fix make headers

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-20 00:31:07 -07:00
Jarred Sumner
f1b1dbf5cd prettier 2023-06-20 00:02:14 -07:00
Keyhan Vakil
bdbb637b3d implement more of V8's stack trace API (#3359)
- fix source map positions for getLineNumber / getColumnNumber
- fix return value getting coerced to a string
- implement CallFrame.p.toString
- add tests for getFunction, getThis, isConstructor, isNative, toString,
  getLineNumber, getColumnNumber

still not implemented:
- isPromiseAll/getPromiseIndex
- getEvalOrigin
- getScriptHash
- getPosition
- getEnclosingColumnNumber/getEnclosingLineNumber
- isAsync
- accessing Error.stack should call prepareStackTrace

still broken:
- isEval: often returns false when it should return true
- isToplevel: often returns true when it should return false

Refs: https://v8.dev/docs/stack-trace-api
Refs: v8/src/objects/call-site-info.cc
Fixes: https://github.com/oven-sh/bun/issues/2883
2023-06-19 23:28:40 -07:00
Tiramify (A.K. Daniel)
e9e0e05156 feat(bun/test): Impl. "toBeArray", "toBeArrayOfSize" & "toBeTypeOf" (#3316)
* Implement toBeArray, toBeArrayOfSize, toBeTypeOf

* fix typos/variable names

* Add testcases for regex and dates

* little fix

* i didn't paste that...
2023-06-19 22:39:44 -07:00
Jarred Sumner
7d94a49ef4 Fix bug that breaks bunx prisma init when node is not installed (#3362)
* tweak cjs

* Handle more cases, add a test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-19 22:34:22 -07:00
Jarred Sumner
cbd6d24d34 Move this code up a bit 2023-06-19 00:33:14 -07:00
Jarred Sumner
b951c1f89e Press the secret "use less RAM" button 2023-06-18 23:30:01 -07:00
Jarred Sumner
b78b2a3031 Update esbuild-test.js 2023-06-18 21:57:52 -07:00
Jarred Sumner
7dcf8b2186 Make the esbuild integration test more thorough 2023-06-18 21:57:40 -07:00
Jarred Sumner
8a5b8f1fca Make more tests fail 2023-06-18 21:07:38 -07:00
Jarred Sumner
8ad9e5755d Add missing ucs2 alias 2023-06-18 21:05:05 -07:00
Jarred Sumner
fdb7940c4e Fix a bunch of bugs (#3352)
* Fix a bunch of bugs

* undo that one

* Fix crash in readdir()

* woops

* woops

* Add comment

* ✂️

* Make `readlink()` and `realpath` use much less memory

* Update BunString.cpp

* woopsie

* Unnecessary

* Don't commit these

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-18 10:47:42 -07:00
Alex Lam S.L
873f615358 minor build diffs (#3349) 2023-06-18 03:45:41 -07:00
Ciro Spaciari
b2af1984ed [eventsource] SSE Client (#3074)
* fix flush

* remove logs

* add HTTP/1.1 eventsource

* fix parse spec

* multiple data in one event

* get lastEventId for reconnection

* fix parsing add reconnect

* fix reconnection retry

* add retry option

* move eventsource to builtins

* remove duplicate interface on globals.d.ts

* move test to TS

* fmt

* allow no Content-Length or Transfer Encoding

* udpate builtins

* hardcoded

* merge

* revert /src/out

* updated

* Update .gitignore

* Make the tests fail

* Cleanup EventSource getter

* fixup

* fixup TS

* fmt

* update builtins

* fix tests

* Clear existing timeouts

* Add `ref` and `unref` methods

* Use `super` to make prototype pollution slightly harder

* Reduce test timeout

* Regenerate builtins

* prettier + ref/unref

* Outdated

* forgot to commit this

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-17 20:54:50 -07:00
Tiramify (A.K. Daniel)
065713aeca Add types for toBeOdd & toBeEven (#3344) 2023-06-17 14:05:28 -07:00
Luigi Pinca
68c092aef2 Set the publishToSelf option to true (#3343)
All messages sent by the clients are expected to be received by all
clients. Without the `publishToSelf` option a message is not sent back
to the sender and the benchmark hangs.
2023-06-17 14:05:11 -07:00
Dylan Conway
9b8054ae11 don't remove const if referenced before declaration (#3337) 2023-06-16 21:11:57 -07:00
Jarred Sumner
0591c6b4bb Fix make headers jun 15 edition 2023-06-15 23:00:57 -07:00
Kabir Goel
4a22fcd93c Fix typo in run.md (#3331) 2023-06-15 15:03:46 -07:00
Jarred Sumner
dc06caccaa Tweak CommonJS output (#3320)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-15 01:18:23 -07:00
Ciro Spaciari
e6d4b3a89a [Bun.serve] fix Bun.serve argument check (#3314)
* fixup checks

* throw when tls is not a object also fix socket

* fix error message

* null or undefined on tls option in Bun.serve or sockets should not throw

* add tests

* fix tests and socket validation

* remove unnecessary check

* add listen tests
2023-06-14 19:29:36 -07:00
Jarred Sumner
0f131a976e Update build-id 2023-06-14 08:37:33 -07:00
Jarred Sumner
7f535a20a2 Workaround issue with module.require = 2023-06-14 08:35:51 -07:00
Jarred Sumner
bac7526c03 Make Bun.argv the same as process.argv (#3310)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-14 04:01:28 -07:00
Jarred Sumner
c2a83f87d8 Remove redudant put 2023-06-14 03:25:43 -07:00
Jarred Sumner
333b3f6beb Prepare to support webkit debug build assertions 2023-06-14 03:24:39 -07:00
dave caruso
b7ff3b0745 document Bun.argv in typedefs (#3302) 2023-06-14 01:48:51 -07:00
Colin McDonnell
a1bb79f440 mock type changes (#3305)
* Update mock types and set bun-types@latest in bun init

* Remove mockfn methods from toplevel mock

* Remove comments
2023-06-13 22:28:31 -07:00
xxxhussein
171ba6327d fix TS5096 (#3256) 2023-06-13 17:42:29 -07:00
Jarred Sumner
2ab797ff75 lol 2023-06-13 10:54:51 -07:00
Jarred Sumner
bdb1b7124a Fix crash in CJS (#3294)
* Fix crash in CJS

* Add std.heap.ArenaAllocator

* Use our arena allocator

* Reduce JS parser memory usage and make HMR faster

* Write some comments

* fix test failure & clean up this code

* Update javascript.zig

* make arena usage safer

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-13 09:15:05 -07:00
Jarred Sumner
b93bdbb124 Add test 2023-06-13 07:29:02 -07:00
Alex Lam S.L
c8d06f04d3 workaround quote escape issues for bun run (#3290)
fixes #53
2023-06-13 05:38:10 -07:00
Dylan Conway
067a0235e4 handle unwrapping require in any expression (#3292) 2023-06-12 21:43:45 -07:00
Jarred Sumner
dbb2416542 Make mocks use FunctionPrototype (#3291)
* Make mocks use FunctionPrototype

* Fix static methods

* Fix types

* Update JSMockFunction.cpp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-12 19:55:07 -07:00
dave caruso
51c093e24e typo in readline (#3286) 2023-06-12 07:41:54 -07:00
Keyhan Vakil
50a18b6bac doc: minor fixes (#3278)
* `bun link` only modifies `package.json` when `--save` is passed.
* clang-15 is a separate package from llvm-15.
2023-06-11 09:26:46 -07:00
Keyhan Vakil
9a8d9b5e91 add --save argument to install (#3277) 2023-06-11 07:10:55 -07:00
Jarred Sumner
ef65f3c305 Support using WTF::StringImpl from Zig (#3279)
* Fix `make headers`

* [JS parser] Fix bug with printing non-ascii import paths in ascii mode

* Introduce `bun.String`

* Add test for non-ascii imports & entry points

* Add comment

* Fix build issue

* Support HTTP server

* Make it print the same

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-11 05:26:37 -07:00
Jarred Sumner
02eafd5019 Make cold bun install use 2x less memory (#3271)
* Make cold `bun install` use 2x less memory

In this benchmark: https://github.com/orogene/orogene/blob/main/BENCHMARKS.md

This brings us from around 2.7 GB to 1.2 GB of memory

* Address comments

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-10 15:38:09 -07:00
Luigi Pinca
04cd6a82b8 Fix benchmark (#3276) 2023-06-10 11:39:26 -07:00
Jarred Sumner
a2ec2ea397 Fixes #3250 (#3269)
* Fixes #3250

We must call `EVP_MD_CTX_cleanup` because `EVP_MD_CTX` containers pointers inside to allocated memory

* Fix leak

* Update sha.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-10 02:26:48 -07:00
paperluigis
f51878a8ec Fix wording and code example in docs for Bun.sleepSync (#3270) 2023-06-10 01:03:30 -07:00
Alex Lam S.L
f18423cf45 [install] fix lockfile fallback for life cycle scripts (#3265) 2023-06-09 21:02:37 -07:00
Dylan Conway
68b9731db2 Update writing.md (#3264) 2023-06-09 19:46:29 -07:00
Dylan Conway
76cf465cc2 toMatchObject and some asymmetric matchers (#3260)
* `toMatchObject` progress

* add `expect.stringContaining()`

* add `expect.stringMatching()`

* print asymmetric matchers

* cleanup

* return before printing if constructor value isn't there

* move matcher logic to cpp

* pretty format and tests

* fix formatting for snapshots

* format `stringContaining` and `stringMatching` like jest

* better test

* remove commented tests

* remove old property matcher code

* add types

* make sure all props are matched in arrays

* add `Bun.deepMatch`
2023-06-09 19:26:36 -07:00
Jarred Sumner
0f018ea215 Fixes #3206 (#3262)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-09 18:22:32 -07:00
Colin McDonnell
a8dc41cd9f Fix jest.fn type 2023-06-09 18:08:36 -07:00
Alex Lam S.L
dbcaa02d89 [install] fix life cycle scripts execution (#3235)
[install] fix life cycle scripts execution
- scripts from dependencies did not run during re-installation
- `bun.lockb` now contains data on life cycle scripts
- handle prior lockfile format by reading missing info from every `package.json`
- suppress spurious log output from tests
2023-06-10 03:30:43 +03:00
Colin McDonnell
e6b1574046 Clean up types 2023-06-09 17:23:06 -07:00
Colin McDonnell
5df26a6a9b Improve types for mocks (#3261)
* Add jest.fn to types

* Fix type-tests
2023-06-09 17:10:19 -07:00
Colin McDonnell
fc3331628e Clean up comments in types 2023-06-09 16:45:41 -07:00
Colin McDonnell
0ec70119f2 Add types for mocks 2023-06-09 16:44:29 -07:00
Jarred Sumner
bf518222d4 Implement mocks in bun:test (#3252)
* wip

* wip

* most of the code for mocks in bun:test

* finishing up

* Implement `toHaveBeenCalled` and `toHaveBeenCalledTimes(1)`

* Test

* visit

* results, not returnValues

* exact

* Update jest.zig

* A couple more tests

* Add jest.fn

* support resetting mocks

* Implement spyOn

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-09 16:38:06 -07:00
ytakhs
6565bd89d5 Fix to retain a newline after removing a package (#3231) 2023-06-09 08:42:38 -07:00
Ashcon Partovi
99485bec4c Fix tests that pass but generate annotation 2023-06-09 05:53:23 -07:00
Ashcon Partovi
0eb5103642 Fix missing JSC.markBinding 2023-06-09 05:40:44 -07:00
James Liu
edd03341b1 docs: add missing right parenthesis in example code (#3245)
add missing right parenthesis in example code in `HTTP server` section
2023-06-09 05:20:37 -07:00
Alex Lam S.L
1d2f06b37e replace sudo usage in GitHub Actions (#3254) 2023-06-09 11:33:22 +03:00
dave caruso
870e5ac1dc improve stream types (#3240) 2023-06-07 14:45:14 -07:00
Jarred Sumner
7e296a1adc [breaking][bun:sqlite] .values() returns [] instead of null for queries returning 0 results (#3219)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-06 23:52:23 -07:00
Jarred Sumner
b9a705f84b add buffer label (#3220)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-06 23:51:05 -07:00
Colin McDonnell
d265ed80d2 Docs for Bun.password and ws publish (#3227)
* Update websocket docs & jsdoc

* Document Bun.password

* Update hash encoding docs

* Fix typos

* Add info about user-specific data in ws

* Update outdated websocket jsdoc

* Replace usages of req.url

* Remove log
2023-06-06 23:50:43 -07:00
dave caruso
fa3cfd34cb yeah (#3229) 2023-06-06 23:48:13 -07:00
Colin McDonnell
bcd67c3455 Bun.passwordSync -> Bun.password.{method}Sync (#3228)
* Bun.passwordSync -> Bun.password.{method}Sync

* Update jsdoc

* Updates
2023-06-06 23:44:40 -07:00
Jarred Sumner
ec71e7afe4 Rename bun-link-lld-debug to link 2023-06-05 18:14:44 -07:00
dave caruso
17bca62df1 add a test for lodash-es (#3217)
* add bundling tests for lodash-es

* add isBuffer tests
2023-06-05 17:38:03 -07:00
Jarred Sumner
0c11762c31 [node:vm] Fix crash when new ArrayBuffer() is returned 2023-06-05 17:17:48 -07:00
Dylan Conway
fe7d5357d8 allow v flag in regexp literal (#3213)
* add v to possible regexp flags

* alphabetical
2023-06-05 13:33:02 -07:00
Dylan Conway
568f170e12 [transpiler] Fix new length for raw template contents (#3215)
* use correct length for raw template contents

* tests for raw template contents
2023-06-05 12:55:56 -07:00
Jarred Sumner
c87d65856c [Inspector] Introduce inspector: true in Bun.serve()
This exposes the WebKit inspector debugger protocol over WebSockets at the endpoint `/bun:inspect` when `Bun.serve()`.

To enable, pass:
```js
Bun.serve({inspector: true, development: true, fetch(req){ /* rest of params *... });
```

Both `development` and `inspector` must be true, as this is very security sensitive to expose publicly.
2023-06-05 04:31:13 -07:00
Jarred Sumner
9b996e702e Implement Bun.password and Bun.passwordSync (#3204)
* Implement `Bun.password.{verify, hash}` and `Bun.passwordSync.{verify, hash}`

* flip the booleans

* delete unused

* Add `cost` for `"bcrypt"`, add `"memoryCost"` and `"timeCost'` for argon2, use SHA512

* Update bun.zig

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-04 18:20:04 -07:00
Dylan Conway
2cb1376a93 removeAllListeners return this (#3208)
* return this in `removeAllListeners`

* move `UNUSED_PARAM` for used params
2023-06-04 18:19:41 -07:00
Jarred Sumner
1f3da24fe0 [Transpiler] Fix normalizing \r\n in template string literals (#3209) 2023-06-04 18:07:38 -07:00
Jarred Sumner
c4e31551f3 Update .gitattributes 2023-06-03 17:44:28 -07:00
dave caruso
52d11ce845 Add test case (#3186) 2023-06-03 16:38:49 -07:00
dave caruso
7d8b6d487b make hardcoded -> make esm + document needing bun to build bun (#3188) 2023-06-03 16:38:33 -07:00
Jarred Sumner
583c6d3644 Bump 2023-06-03 16:37:53 -07:00
Ciro Spaciari
aabb0b77ce [tests] prisma tests (#3197) 2023-06-03 15:04:19 -07:00
Jarred Sumner
59d7c47e3f Fix crash with path parse in win32 (#3187)
* Update CommonJSModuleRecord.cpp

* smaller

* [node:path] Fix crash, mark TODO

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-03 00:14:27 -07:00
Dylan Conway
21bc3a9c39 [bundler] fix json imports, undo some todos 2023-06-02 22:44:19 -07:00
dave caruso
cfd73cec81 fixes with hardcoded modules (#3182)
* fixes with hardcoded modules

* add make hardcoded to make dev

* adjust this message

* remove debugging logs

* this

* restore2
2023-06-02 21:36:05 -07:00
Dylan Conway
3e437a6ae0 check package name length in shouldUnwrapRequire() (#3183)
* make sure length is equal

* add and use `indexEqualAny`
2023-06-02 20:45:48 -07:00
Dylan Conway
d8e7436db0 use NODE_ENV for react-jsx or react-jsxdev (#3184) 2023-06-02 20:35:00 -07:00
dave caruso
f798a0cfe8 fix readableStreamToArrayBuffer (#3181)
* fix discord.js again

* remove one of the async hooks warnings

* clarify hardcoded modules docs
2023-06-02 19:03:16 -07:00
Ciro Spaciari
51846d0277 [napi] some fixes for prisma (#3176)
* patch create object, so it can be used on wrap

* cleanup

* cleanup

* dont override napiRef

* make wrap strong ref

* workaround tests

* remove work around
2023-06-02 17:56:16 -07:00
Colin McDonnell
c4f237572d Update macro/test docs (#3180)
* Add test and fix plugin type

* Update docs and config pages
2023-06-02 17:43:51 -07:00
Dylan Conway
e20e695775 continue if import is standalone (#3178) 2023-06-02 17:07:16 -07:00
Jarred Sumner
132ab63a32 Add comment 2023-06-02 16:39:16 -07:00
Ashcon Partovi
bfd315fc72 Support NO_COLOR environment variable (#3055) 2023-06-02 14:24:16 -07:00
Jarred Sumner
72c2123e07 Maybe we don't need to do this anymore? (#3169) 2023-06-02 14:22:39 -07:00
Colin McDonnell
1f7d62bfd5 Support NodeJS.ProcessEnv 2023-06-02 12:49:31 -07:00
Jozef Steinhübl
4d1c900cac types: expose Bun.Env (#3111)
* expose Bun.Env

* export bun.Env

* fix: use import instead namespace access

* fix(child_process): use import

* tests(env): use module instead namespace
2023-06-02 12:48:19 -07:00
Jarred Sumner
97c522517c Fixes #3161 (#3174)
* Fixes #3161

* Fix the error message

* woops

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-02 04:01:25 -07:00
Ashcon Partovi
4c6245b2e5 Add concurrency to workflows, enable cancel-in-progress 2023-06-01 18:38:40 -07:00
Ashcon Partovi
b21a58e564 Fix github annotation when using inspect() (#3166) 2023-06-01 18:25:06 -07:00
dave caruso
4df1d37ddc Bundle and minify .exports.js files. (#3036)
* move all exports.js into src/js

* finalize the sort of this

* and it works

* add test.ts to gitignore

* okay

* convert some to ts just to show

* finish up

* fixup makefile

* minify syntax in dev

* finish rebase

* dont minify all modules

* merge

* finish rebase merge

* flaky test that hangs
2023-06-01 18:16:47 -07:00
Ashcon Partovi
03ffd1c732 Disable typecheck workflow for now 2023-06-01 18:04:45 -07:00
Jarred Sumner
3e84f18cc0 Implement __dirname and __filename, allow direct eval in CommonJS (#3164)
* Implement `__dirname` and `__filename`, allow direct eval in CommonJS

* Fixup dirname and add test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-01 18:04:09 -07:00
Jarred Sumner
42606d6aed Rename ptr to _unsafe_ptr_do_not_use (#3163)
* Rename `ptr` to `_unsafe_ptr_do_not_use`

* Fixup

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-01 18:02:41 -07:00
Derrick Farris
c366b62160 Update macros.md (#3165)
Fix a repeated "for"
2023-06-01 17:25:28 -07:00
dave caruso
42d8b7183c random fixes that help vite/sveltekit (#3140)
* existsSync with invalid paths should return false

* partially support file urls (does not do percent encoding)

* add utf16 support for Path.isAbsoluteString

* Update src/resolver/resolver.zig

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

* fixups

* revert

* prettier format

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-06-01 16:48:37 -07:00
Ciro Spaciari
f9809f0044 [napi] fix thread safe function callback (#3162)
* fixup

* add debug log message to event loop unexpected tag

* fix fmt
2023-06-01 15:19:06 -07:00
dave caruso
4378ef8e97 mark currently known test fails as .todo (#3052)
* start this

* commit

* mark all failing tests as todo

* fasdfad

* bundler tests

* tests

* adjust failing tests to todo

* comment out some more tests

* png as test
2023-06-01 14:37:35 -07:00
dave caruso
2c1694f63b Fix streams breaking on reverted EventEmitter / Make Discord.js work (#2913)
* Revert "Revert "use a lazyily initialized stream for `node:crypto` `createHash` (#2652)""

This reverts commit 613bb4822e.

* Revert "Revert "implement `node:events` in javascript (#2604)""

This reverts commit a4d0a1961a.

* oops

* fix entrypoints stuff

* fix hash copy

* use native events for node streams and crypto

* requested changes

* oops

* make discord.js work

* fix webkit hash

* headers tojson
2023-06-01 14:31:36 -07:00
Jarred Sumner
ae277a0dec Update build-id 2023-06-01 13:58:50 -07:00
Dylan Conway
473b219a37 only add cjs export name if it is assigned (#3159) 2023-06-01 13:57:51 -07:00
Noah Chase
be1833898e fix typo in documentation ("the today" -> "today") (#3160) 2023-06-01 13:34:09 -07:00
Jozef Steinhübl
a64da8f0cb ci: dont run builds in forks (#3156) 2023-06-01 12:35:26 -07:00
Dylan Conway
689434e012 don't rewrite module.exports if assign target is update or replace (#3147)
* don't rewrite `module.exports` if assign target is `update` or `replace`

* missing `is_delete_target`, check de-opt before rewriting
2023-05-31 23:51:32 -07:00
Jarred Sumner
a73a4d1e0b Fix test failure due to cloudflare changing dns ttl 2023-05-31 23:19:32 -07:00
Jarred Sumner
457f325773 slightly clean up this test 2023-05-31 23:18:58 -07:00
Jarred Sumner
5f80681295 [TCP] Ensure we keep the handlers functions alive when an error callback needs to be called
This can cause test failures due to GC'ing the handlers when we are *just* about to call them.
2023-05-31 23:17:18 -07:00
Jarred Sumner
fdcfcce9e7 Clean-up some option parsing in Bun.spawn 2023-05-31 23:15:21 -07:00
Jarred Sumner
1ca70b855c Update launch.json 2023-05-31 23:13:50 -07:00
Ashcon Partovi
e632941c52 Small improvements to bun test (#3071)
* Change status icon for skipped tests from "-" to "»"

* Show file path instead of filename in `bun test`

* Emit collapsable logs when running `bun test` in Github Actions

https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines

* Add fallback for test icons when emojis are not available

* Only check for GITHUB_ACTIONS when running `bun test`

* Emit error annotations when running `bun test` in Github Actions

https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message

* Remove ANSI output from Github annotation, it doesn't work

* Remove outdated code from internal test runner

* Add GithubActionFormatter to handle cases where error name or message is already ANSI

* Fix formatting of test

* Fix #3070

* Implement `bun test --run-todo`

By default, `test.todo()` is no longer run, unless `--run-todo` is specified.

* Fix test that relies on test.todo() being run

* Support vitest-style test options

* Disable GITHUB_ACTION in test harness

* Add types for TestOptions

* Fix bug where test.skip() actually ran

* Implement `test.skipIf()` and `describe.skipIf()`

* Implement `test.runIf()`

* Move DiffFormatter to its own file

* Fix bug where Bun.inspect() would emit a Github annotation

* Introduce `bun test --only`, rename `--run-todo` to `--todo`

* Implement `test.if()`, `describe.if()`, and other test fixes

* Remove unwanted files from last commit

* Fix last reference to --run-todo

* Fix memory issues with printing github actions text

* Update bindings.zig

* Fix bug with `test.only()`

* Remove debug test

* Make the github annotations better

* Improve .vscode/launch.json

* Implement `expect().toBeNil()`

* Remove .only() from test

* Implement toBeBoolean(), toBeTrue(), toBeFalse()

* Add lots of matchers
* toBeNil()
* toBeBoolean()
* toBeTrue()
* toBeFalse()
* toBeNumber()
* toBeInteger()
* toBeFinite()
* toBePositive()
* toBeNegative()
* toBeWithin()
* toBeSymbol()
* toBeFunction()
* toBeDate()
* toBeString()
* toInclude()
* toStartWith()
* toEndWith()

* Fix #3135

* Reduce verbosity of test

* Fix snapshot bug

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-31 23:12:04 -07:00
Colin McDonnell
176fade220 Remove bun-macro-relay and update docs (#3145)
* Update macro docs

* Remove bun-macro-relay
2023-05-31 19:51:08 -07:00
Jarred Sumner
110d0752f3 Add "macro" package.json exports condition 2023-05-31 19:01:59 -07:00
Ciro Spaciari
e24d579a32 isolated version of Path compatible with nodejs (#3143) 2023-05-31 18:20:50 -07:00
Mike Roelens
a7c7128cd7 Fix typo in macro docs (#3144) 2023-05-31 18:15:49 -07:00
Jarred Sumner
4c01454376 Make uploading files with fetch()fast (#3125)
* Make file uploads fast

* Add benchmark

* Update README.md

* defaults

* print

* prettier

* smaller

* fix(path) fix parse behavior (#3134)

* Add macro docs (#3139)

* Add macro doc

* Updates

* Tweaks

* Update doc

* Update macro serialization doc

* Update macro doc

* `--no-macros` flag, disable macros in node_modules

* invert base/filename internally (#3141)

* always false

* Fix broken test

* Add a test sendfile() test with large file

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-05-31 17:20:30 -07:00
Dylan Conway
611f1d0e24 set optional_chain instead of optional_start (#3142) 2023-05-31 16:13:24 -07:00
Ciro Spaciari
52c6609792 invert base/filename internally (#3141) 2023-05-31 15:13:37 -07:00
Jarred Sumner
7057cb1982 --no-macros flag, disable macros in node_modules 2023-05-31 15:05:49 -07:00
Colin McDonnell
68c1568075 Update macro doc 2023-05-31 13:58:38 -07:00
Colin McDonnell
4b34a7ce2a Update macro serialization doc 2023-05-31 13:43:08 -07:00
Colin McDonnell
b284e09ce5 Update doc 2023-05-31 13:35:11 -07:00
Colin McDonnell
8f55f05871 Add macro docs (#3139)
* Add macro doc

* Updates

* Tweaks
2023-05-31 13:34:35 -07:00
Ciro Spaciari
58fcb60831 fix(path) fix parse behavior (#3134) 2023-05-31 12:07:52 -07:00
Jarred Sumner
557aac6a34 Support FormData & file uploads in fetch body (#3123)
* Fixes #2264

* fixup

* Don't leak HTTP headers

* Include the mime type. It's cleaner

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-31 00:43:59 -07:00
Jarred Sumner
0aab11a95d always clone these 2023-05-30 19:39:12 -07:00
Jarred Sumner
7376ae6980 Update modules.md 2023-05-30 15:52:21 -07:00
Jarred Sumner
148c6e7551 Fix wasi 2023-05-30 15:41:27 -07:00
Jarred Sumner
b0c38a3c15 Update ZigGeneratedClasses.h 2023-05-30 13:13:42 -07:00
Jarred Sumner
756e15f6e2 Add another comment 2023-05-30 02:53:28 -07:00
Jarred Sumner
10be26f011 [CommonJS] Handle this better 2023-05-30 02:51:50 -07:00
Jarred Sumner
12a0e2bfdd Fixes #3115 2023-05-30 02:51:27 -07:00
Jarred Sumner
481f916f3f More comments 2023-05-30 00:30:47 -07:00
Jarred Sumner
85565d95d5 Add a comment 2023-05-30 00:26:30 -07:00
Jarred Sumner
fdbf8a5184 Handle Object.defineProperty(module, "exports", {get: getter}) 2023-05-30 00:24:18 -07:00
Jarred Sumner
8e911d38c4 Bump 2023-05-30 00:19:15 -07:00
Jarred Sumner
052df7d48c Cleanup CommonJS changes (#3112)
* Add more GC in test

* Fix handling of functions and re-assignments in CommonJS

* Increase timeout

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-29 21:01:39 -07:00
Jarred Sumner
5990a9528f Rename this file so we know what it is 2023-05-29 19:58:40 -07:00
Jarred Sumner
aa6801d5df Update index.md 2023-05-29 12:22:13 -07:00
Jarred Sumner
d0185925ff Update modules.md 2023-05-29 12:15:33 -07:00
Colin McDonnell
9b6913e1a6 More/better docs for JSX, utils, binary data, streams, hashing, bun test, Bun.serve (#3005)
* WIP

* Updates

* Document deepEquals

* WIP

* Update typeS

* Update TLS docs for Bun.serve

* Update types for tls

* Draft binary data page. Add Streams page.

* Update test runner docs

* Add hashing, flesh out utils

* Grammar

* Update types

* Fix

* Add import.meta docs

* Tee
2023-05-29 11:49:51 -07:00
Jarred Sumner
e2de1f5c13 Natively support CommonJS at runtime (#3104)
* Natively support CommonJS at runtime

* cleanup how getters are handled, add fast path

* more consistent with node

* use * As

* Remove thrown modules on exception

* Handle exception better

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-29 11:23:10 -07:00
Jarred Sumner
2b04ef4fae Convert module.exports = { foo: 'bar'} to ESM in bun build (#3103)
* Convert `module.exports = { foo: 'bar'}` to ESM in `bun build`

* De-opt for `module.exports = {}`

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-28 21:02:51 -07:00
Jarred Sumner
8dfd3dbdbc Add query string to express integration test 2023-05-28 13:30:25 -07:00
Ciro Spaciari
63e2d78e76 [node:net] fix createConnection options passing (#3101)
* fixup createConnection

* fix comment

* fixup comment

* also fix it on tls
2023-05-28 13:20:32 -07:00
Jarred Sumner
1388ec0d60 Fixes #2356 (#3098) 2023-05-27 23:33:47 -07:00
Tiramify (A.K. Daniel)
4ba3ed512a Implement process.env.npm_lifecycle_event (#3097)
* Update run_command.zig

* Update env.test.ts

* Add files via upload

* Update run-process-env.test.ts

* Update env.test.ts

* Update harness.ts
2023-05-27 20:43:08 -07:00
Jarred Sumner
f870f97a94 Fixes #3091 (#3092)
* Fixes #3091

* Update build-id

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-27 00:21:54 -07:00
Jarred Sumner
7094997eec Fix crash in Server.prototype.fetch() helper function
cc @cirospaciari, if you use `mimalloc-debug` it catches things like this
2023-05-26 21:18:31 -07:00
Jarred Sumner
79907fe84c Add more debug safety checks 2023-05-26 21:17:10 -07:00
Ashcon Partovi
1a30b4fe29 Implement expect().toBeEmpty() (#3060)
* Implement `expect().toBeEmpty()`

* Fix formatting on test

* Finish up expect().toBeEmpty()

* Update expect.test.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-26 19:24:20 -07:00
Jarred Sumner
4298f36fc9 fixup 2023-05-26 16:29:44 -07:00
Jarred Sumner
3a0735e164 Pretty formatter for Headers & URLSearchParams (#3081)
* Pretty formatter for `Headers` & `URLSearchParams`

* cleanup

* console.log on Headers, FormData, URLSearchParams will always quote the keys now

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-26 16:28:09 -07:00
Ciro Spaciari
42125b4351 [fetch] change response allocator (#3086)
* change allocator

* cleanup
2023-05-26 15:07:03 -07:00
Jarred Sumner
0f2a79b9c1 Fix crash in test.todo + remove JSC C API usages in bun:test (#3079)
* Fix crash in test.todo

* remove usages of JSC C API in bun:test

* Remove additional JSC-C API usages

* fix `make headers`

* URLSearchParams.length

* FormData length

* URLSearchParams length

* Fix `make headers`

* very fancy length

* Fix bug with exceptions being ignored sometimes

* Add tests for extension toHaveLength

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-26 03:32:28 -07:00
Dylan Conway
62f05ec103 avoid using null value 2023-05-25 23:07:18 -07:00
Jiri Spac
1f7ad0cc37 add a bit more info on Elysia (#3062) 2023-05-25 22:04:07 -07:00
Alex Lam S.L
4c566f56c1 [install] fix .bin linking (#3067)
- causes intermittent `bun install` failures on `bun-types`
2023-05-25 21:58:30 -07:00
Dylan Conway
b395836080 jsx runtime from env (#3076)
* use `NODE_ENV` for jsx mode

* check env after `configureRouter`

* get `NODE_ENV` from `options.production`
2023-05-25 21:39:01 -07:00
Dylan Conway
801881dd7d update jsx test for classic runtime 2023-05-25 20:54:39 -07:00
Jarred Sumner
7b4bba787d prettier 2023-05-25 18:14:01 -07:00
Ciro Spaciari
e95f9c6daa [stream] fix flush (#3073)
* fix flush

* remove logs
2023-05-25 16:41:00 -07:00
Jarred Sumner
50bad43dbe Remove paragraph that has incorrect information in the docs 2023-05-25 16:16:16 -07:00
Dialga
48997eaeba Update sqlite.md (#3063)
fix serialize example
2023-05-25 10:14:29 -07:00
Jarred Sumner
f02561530f Bump 2023-05-24 19:54:00 -07:00
Jarred Sumner
88d9bac5ec Support with { type: "macro"} in bun build (#3059)
* [bun macro] Support `assert { type: "macro" }` and `with {type: "macro"}`

* [bun macro] Pass through input as arguments instead of a JSNode

* Fix hang when loading many entry points simultaneously with macros

* do not clone

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-24 19:37:57 -07:00
Jarred Sumner
63740a382b Load .env.test, set NODE_ENV=test in bun test, load .env.{test,production,development}.local (#3037)
* Support `.env.test` & `.env.{test,production,development}.local`

* Fix bug preventing inlining of process.env.NODE_ENV by default

* Update env_loader.zig

* add env tests

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
2023-05-24 18:52:50 -07:00
Ciro Spaciari
ed1f62ffff [server.fetch] call when using Request object (#3051)
* patch server.fetch

* add tests and fix types
2023-05-24 18:52:13 -07:00
Dylan Conway
4972934189 fix setting jsxImportSource, jsxFactory, and jsxFragmentFactory (#3057)
* default automatic, merge jsx flags from multiple tsconfigs

* use entire package name

* some tests

* more tests
2023-05-24 18:33:28 -07:00
Jarred Sumner
d73bce058a don't do MMD in CI 2023-05-24 18:31:33 -07:00
Ciro Spaciari
10c018df8e [bun:FileSystemRouter] add more validations on parameters (#3053)
* add validations and allow relative path on  dir

* remove unneed things

* add origin/dir validation tests

* remove workaround

* add back relative path resolution
2023-05-24 16:36:20 -07:00
Jarred Sumner
29969bc130 Add comment 2023-05-24 15:45:39 -07:00
Jarred Sumner
1ea74238cd Remove that field 2023-05-24 15:44:22 -07:00
Jarred Sumner
3361814cab Fix string check 2023-05-24 15:44:02 -07:00
Jarred Sumner
cc84c689ea Fixes #3031 (#3041)
* Fixes #3031

* Leave original input in there

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-24 12:02:33 -07:00
Jarred Sumner
b3d5f37598 Implement require.cache (#3045)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-24 12:01:59 -07:00
Alex Lam S.L
31c967206a extend test time-outs (#3048)
- avoid intermittent failures due to network latencies
2023-05-24 08:33:18 -07:00
Ashcon Partovi
c3d402ce47 Implement bun test --timeout (#3040)
You can change the default per-test timeout in `bun test`:
 > bun test --timeout 10

The default timeout is 5000.
2023-05-23 22:33:32 -07:00
Kruithne
d9bdfcf131 Fix incorrect URL in loaders.md (#3025) 2023-05-23 18:08:24 -07:00
Jarred Sumner
6074d4e378 workaround 2023-05-23 18:07:23 -07:00
Jarred Sumner
57d341f390 too noisy 2023-05-23 16:57:02 -07:00
Bill Mill
bf759b62c6 Add pkg-config as a build requirement (#3027)
Without pkg-config, the libarchive build fails in autogen.sh[1]

1: https://github.com/libarchive/libarchive/issues/742
2023-05-23 16:06:35 -07:00
dave caruso
5b0fea7093 fix bun init and update node vm docs (#3014) 2023-05-23 15:02:39 -07:00
Dylan Conway
21002ed405 check if key from exports can be printed as an identifier (#3032)
* check if key can be printed as an identifier

* possibly escape
2023-05-23 14:56:03 -07:00
Ashcon Partovi
2a669a657a Support test.todo() in ecosystem runner 2023-05-23 13:39:58 -07:00
Jarred Sumner
f71eb39b14 [bun:test] Don't schedule the GC aggressively on every file
We already run the GC automatically whenever heap size grows, so this is mostly unnecessary

In one benchmark, this is an 83% performance improvement at a cost of 9% more memory
2023-05-23 00:44:56 -07:00
Jarred Sumner
de185bdc05 Skip failing tests 2023-05-23 00:42:02 -07:00
Jarred Sumner
1e3476ee08 [bun:test] Fix async/done-based test.todo (#3015)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-23 00:40:41 -07:00
Jarred Sumner
5b38c55c3d Support setting a timezone with process.env.TZ and Bun.env.TZ (#3018)
* Support setting a timezone via `process.env.TZ`

* Implement `setTimeZone` in `bun:jsc` module

* [breaking] `bun:test` now defaults to `Etc/UTC` timezone

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-23 00:40:12 -07:00
dave caruso
83e7b9e198 fix extra/ArbitraryModuleNamespaceIdentifiers2 (#3016)
* fix extra/ArbitraryModuleNamespaceIdentifiers2

* remove assert
2023-05-22 20:59:25 -07:00
Jarred Sumner
879fd45ea2 Update .prettierignore 2023-05-22 20:10:00 -07:00
dave caruso
e5501551f4 add some connect test and type changes (#3013) 2023-05-22 19:48:07 -07:00
Ciro Spaciari
e57dcdfcf1 fix marking requestCert (#3012) 2023-05-22 19:44:32 -07:00
Jarred Sumner
5cfa5edd63 [node:http] Fix return type for getHeader() (#3007)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-22 19:44:21 -07:00
dave caruso
fc40c690ea Write out builtins with TypeScript + Minify them (#2999)
* start work drafting how builtins will work

* work on ts builtin

* builtins stuff so far

* builtins

* done for today

* continue work

* working on it

* bindings so far

* well, it builds. doesnt run

* IT RUNS

* still lots of ts errors but it is functional

* sloppy mode
2023-05-22 18:51:05 -07:00
Ciro Spaciari
23d42dc237 443 should default to https when no protocol is informed (#3008) 2023-05-22 17:58:32 -07:00
Jarred Sumner
e869fc092f [node:buffer] Add missing inspect function
cc @paperdave
2023-05-22 13:53:24 -07:00
Jarred Sumner
2a6a5cf6d9 [node:vm] Accept undefined in createContext 2023-05-22 13:53:24 -07:00
Ciro Spaciari
eebf44c709 fixup (#3001) 2023-05-22 13:07:51 -07:00
Jarred Sumner
05e98ed5d1 Skip test 2023-05-22 12:29:22 -07:00
Jarred Sumner
b71fa2b6d7 Skip more tests 2023-05-22 12:29:15 -07:00
Jarred Sumner
82e762fe2f [breaking] ServerWebSocket.publish no longer publishes to self by default
This changes `publishToSelf` to be `false` by default instead of `true`.

This is a breaking change because it means that `ws.publish("foo", "bar")` will exclude `ws` from the list of websockets to broadcast.

We are making this change because many people asked for this and were confused by the status quo - that `w.publish` publishes to self.
2023-05-22 12:29:10 -07:00
Jarred Sumner
a5acf7bfa0 [ServerWebSocket] binaryType now defaults to "nodebuffer"
Previously, this defaulted to "uint8array", so this shouldn't be a breaking change unless you make use of `.slice()` in which case it will now be a reference to the same ArrayBuffer rather than a clone.

The rationale for this change is most usages of Uint8Array on the server need a little more than just the bytes. Many npm packages expect Buffer rather than Uint8Array. Directly returning it for binary websocket messages is faster than creating another one.
2023-05-22 11:46:39 -07:00
Dylan Conway
3de350b24d only merge if kind is var 2023-05-22 11:33:01 -07:00
dave caruso
2e54601a2d document arch linux workaround, see #2664 (#2997) 2023-05-22 10:10:04 -07:00
Jarred Sumner
1f0dfacc0d Fix memory leak in fetch(url) (#2989)
* Fix memory leak in `fetch(url)`

* Bump those numbers up

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-22 10:09:30 -07:00
Jarred Sumner
7e17a91a1c Update WebKit 2023-05-22 10:08:33 -07:00
Jarred Sumner
3cbb1a429c Skip hanging tests 2023-05-21 23:28:02 -07:00
Jarred Sumner
8b3952baf9 Fix test 2023-05-21 21:31:38 -07:00
Jarred Sumner
24e0c269d2 [internal] Even more logging 2023-05-21 21:30:05 -07:00
Jarred Sumner
9f935c4683 [internal] Use HiveArray instead of bespoke memory allocator in Bun.serve()
No performance or memory usage change

Just removing some duplicate code
2023-05-21 21:29:17 -07:00
Jarred Sumner
3c57911b59 Fix assertion failure 2023-05-21 21:27:33 -07:00
Jarred Sumner
1a2a52b3f3 oopsie 2023-05-21 20:13:40 -07:00
Ciro Spaciari
fd21243efd WS send with callback (#2986)
* WS send with callback

* add opts.compress support

* fmt

* compress is the only option we care

* add ws client options

* only change ws client when using blob

* fmt

* fix errors

* fixup

* fixup

* fmt
2023-05-21 19:36:42 -07:00
Jarred Sumner
d90f7c7bf6 [Bun.serve] Support "nodebuffer" binaryType in ServerWebSocket 2023-05-21 19:20:40 -07:00
Jarred Sumner
91c9bd9dcc [WebSocket] Implement "nodebuffer" binaryType 2023-05-21 18:34:00 -07:00
Jarred Sumner
7d682c0fe7 [ws client] Make it a little more type safe 2023-05-21 15:23:02 -07:00
Jarred Sumner
b6007a860e [internal] Add more debug logs for uws 2023-05-21 14:30:36 -07:00
Jarred Sumner
eb3765ef93 [internal] Add a 0 byte to EOF read files as a precaution 2023-05-21 14:30:17 -07:00
Jarred Sumner
b33f20d51b [internal] Make AbortSIgnal usage slightly safer 2023-05-21 14:29:02 -07:00
Jarred Sumner
1e307e7690 Add extra flag just to be sure 2023-05-21 14:28:09 -07:00
Jarred Sumner
6e6d34eca7 [internal] Fix potential missing callbacks in AbortSignal 2023-05-21 14:00:32 -07:00
Jarred Sumner
9834cba762 Add node:vm types 2023-05-21 12:41:15 -07:00
Ciro Spaciari
3870f674f9 fix(tls.connect) fix SNI on tls sockets and also servername (mongodb) (#2934)
* fixes SNI on tls sockets and also servername

* 💅

* 💅

* add support for https and wss

* fix bun types

* support Bun.file on ca, key and cert

* 💅

* add setTimeout (makes fastify run)

* fix httpVersion

* fix WebSocketServer and add listen event

* fix ws exports and http listening

* fix default import

* bump uws

* add nodebuffer compatibility

* fix drain and allow more passing tests to run

* fix enqueud messages

* default to arraybuffer

* fix constructor binaryType

* fmt

* fixup

* skip some tests

* skip more

* skip fault tests

* reuse encoder instance

* fix handshake WS Client

* temporary revert handshake fix

* fix handshake

* disable all socket.io test temp

* fixup

* add back socket.io tests

* use node_fs to read cert, ca and key on server.zig

* throw the error returned by NodeFS

* 💅
2023-05-21 09:50:53 -07:00
Jarred Sumner
12b34c6258 Add watch mode page 2023-05-21 01:29:57 -07:00
Jarred Sumner
34af34db9f Update extending.md 2023-05-21 01:21:13 -07:00
Jarred Sumner
a29ee9f9a2 Update extending.md 2023-05-21 01:20:21 -07:00
Jarred Sumner
7ad1fc4f8f Update extending.md 2023-05-21 01:18:43 -07:00
Jarred Sumner
40ee435a4b More documentation 2023-05-21 01:17:21 -07:00
Jarred Sumner
ae8fc25b58 Update extending.md 2023-05-21 00:57:44 -07:00
Jarred Sumner
ef9555b9e1 Update extending.md 2023-05-21 00:56:13 -07:00
Jarred Sumner
3c2ac63d6e Update extending.md 2023-05-21 00:56:05 -07:00
Jarred Sumner
fdd5d49fe3 Update extending.md 2023-05-21 00:55:03 -07:00
Jarred Sumner
b27f4ceb9c Update extending.md 2023-05-21 00:53:50 -07:00
Jarred Sumner
1888c2df22 Update extending.md 2023-05-21 00:53:00 -07:00
Jarred Sumner
08043c5274 Update extending.md 2023-05-21 00:50:25 -07:00
Jarred Sumner
40de6d8cda Update extending.md 2023-05-21 00:49:55 -07:00
Jarred Sumner
d5c9e5ee79 Add --preload docs 2023-05-21 00:48:25 -07:00
Jarred Sumner
def8824bc2 Upgrade WebKit (#2980)
* [internal] Show the file path to the calling function from JS

* [internal] Make `JSC.NewFunction` more type safe

* Upgrade WebKit

* Finish

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-21 00:20:04 -07:00
Jarred Sumner
5a38c4bc0a Fixes #2976 2023-05-20 23:46:46 -07:00
Jarred Sumner
7a91d40a24 [bun:test] Add tests for --preload with beforeAll, afterAll, afterEach, beforeEach 2023-05-20 23:22:58 -07:00
Jarred Sumner
b16ddd95d9 [bun:test] preload now supports beforeAll, beforeEach, afterAll, afterEach hooks
Towards #198
2023-05-20 23:22:12 -07:00
Jarred Sumner
76e92abc7e Fix missing arg 2023-05-20 22:57:05 -07:00
Jarred Sumner
db062a7c30 [bun:jsc] Rewrite describe -> jscDescribe to not confuse them in autocomplete 2023-05-20 22:56:53 -07:00
Jarred Sumner
5959418605 Bun.inspect gets a max depth of 32 2023-05-20 22:02:09 -07:00
Jarred Sumner
ee40d9c3b4 [bun:test] Make forEachPropertyOrdered behave closer to forEachProperty
When diffing, we were missing some properties due to not calling getters and other types of properties

This led to situations where Bun.deepEquals would report false and then display no difference

This aligns the behavior closer to forEachProperty

cc @dylan-conway please let me know if this is going to break anything
2023-05-20 22:02:09 -07:00
Jarred Sumner
cd28c2cd2b [console.log] Set depth limit to 8
Towards #198
2023-05-20 22:02:09 -07:00
Jarred Sumner
50bb4749af [internal] Make JSC.NewFunction more type safe 2023-05-20 22:02:09 -07:00
Jarred Sumner
ff4df6b600 [internal] Show the file path to the calling function from JS 2023-05-20 22:02:09 -07:00
Degreat
0e97f91f9f Implement test.todo (#2961)
* Implement `test.todo`

* remove skip condition

* Allow callbacks in .todo

* Add descriptive comment

* Log todos

* Include tests in title

* edit test.todo tests

---------

Co-authored-by: dave caruso <me@paperdave.net>
2023-05-20 22:03:55 -04:00
Jarred Sumner
367f3a9c81 [bun:test] Fix bug where indexed properties would print "undefined" in diffs 2023-05-20 17:14:48 -07:00
Jarred Sumner
89e87a9050 [bun:test] Fix bug where indexed properties would print "undefined" in diffs 2023-05-20 17:12:50 -07:00
Jarred Sumner
7cf674a253 Support test timeouts in bun:test (#2969)
* [bun:test] Support timeouts in `test`

* make this test more resilient

* ✂️

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-20 17:04:51 -07:00
Jarred Sumner
e453b0e7c1 smol 2023-05-19 22:41:37 -07:00
e3dio
1973975ce0 fix #2964 (#2965) 2023-05-19 20:44:59 -07:00
Jarred Sumner
4db3d793cf console.log changes (#2966)
* [breaking] Don't quote property names of identifiers in console.log

* Make UTF-16 strings green

* always quote for jest

* update tests

* Update this

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-19 19:50:06 -07:00
Jarred Sumner
0b6a32269f ensure unused variable is not eliminated 2023-05-19 19:36:27 -07:00
Jarred Sumner
a3841a7de9 Fix failing node:vm tests 2023-05-19 19:35:05 -07:00
Ashcon Partovi
386ac374d5 Add tests for node:vm 2023-05-19 18:40:01 -07:00
Dylan Conway
9306103949 make sure key is added to args (#2968) 2023-05-19 18:22:54 -07:00
Jarred Sumner
12d841a3f5 [node:vm] Fix crash in syntax error in runinThisContext 2023-05-19 18:21:42 -07:00
Jarred Sumner
deeccb0dc4 [node:vm] Handle exceptions in runInThisContext and runInContext 2023-05-19 17:08:20 -07:00
Dylan Conway
aa34529b5b resolve rope string for multipart template (#2963)
* resolve rope for multipart template

* fix tests

* clone template part if it is `e_string` and folded

* clone string only

* don't clone data again
2023-05-19 16:04:38 -07:00
e3dio
4101eeabde update docs hot.md (#2954)
* Update hot.md

* Update hot.md
2023-05-19 15:23:24 -07:00
dave caruso
0036c3d8f5 Add tests for --compile tests (#2901)
* add compile test support

* add react ssr test

* add tests

* Fix flaky compile test

@paperdave we can't pass a non-zero port or it will be flaky

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-19 12:18:14 -07:00
Jarred Sumner
bf0f5c9b3d Make node-fetch polyfill better (#2962)
* Make `node-fetch` polyfill better

* fixup

* Test using localhost

* Add comment

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-19 12:12:54 -07:00
Jarred Sumner
9b28d2009d Add snippet for node:vm 2023-05-19 12:12:13 -07:00
Jarred Sumner
f910d791f9 [node:vm] Make vm.runInThisContext 10x faster 2023-05-19 11:18:11 -07:00
Zbyszek Tenerowicz
d6223c7f73 Fix typo (#2959) 2023-05-19 12:53:00 -04:00
Dylan Conway
c3233f1b21 set node_allocator for sourcemap joiner (#2953) 2023-05-18 19:39:31 -07:00
Jarred Sumner
a3e53b025e Make node:vm 12x faster 2023-05-18 19:27:02 -07:00
Jarred Sumner
f862ae4050 [node:vm] Propagate global properties defined on the new context object 2023-05-18 18:45:13 -07:00
Jarred Sumner
958f5f8b99 clang-format 2023-05-18 18:37:53 -07:00
Silver
ac64eb420d Implement node:vm (#2785)
* feat: begin implementing node:vm Script object

* refactor: clean up and address review comments

* refactor: rename Script to VMModuleScript

* fix: expose VMModuleScript.prototype

also oops I forgot to commit the new files last time

* feat(vm): Implement contexts and scripts

* feat(vm): implement globalThis

* feat(vm): expose node:vm module with global helper functions

* refactor(vm): rename VMModuleScript to NodeVMScript

* feat: implement script options

* doc: add TODOs for runIn*Context options
2023-05-18 16:45:18 -07:00
Jarred Sumner
b76974a2a8 Fixes #2924 2023-05-18 14:41:50 -07:00
Jarred Sumner
5bec0252a0 handle when cwd is not writable, attempt to use tmp dir explicitly
Fixes https://github.com/oven-sh/bun/issues/2944
2023-05-18 14:21:19 -07:00
Jarred Sumner
f7f0acbcd3 Bump 2023-05-18 13:41:16 -07:00
Jarred Sumner
f3a1a3bb2b Fixes #2946 (#2949)
* Fixes #2946

* Update string_mutable.zig

* Fixes #2948

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-18 13:27:05 -07:00
Jarred Sumner
755c0d62c4 Fixes #2942 (#2947)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-18 12:35:34 -07:00
Degreat
228ca3269a Implement expect().toBeCloseTo() (#2870) 2023-05-18 11:32:31 -07:00
Dylan Conway
621232c197 use raw template contents for tagged templates (#2937)
* use raw template contents when tagged

* use union for template contents

* pointer to cooked contents

* raw if suffix

* fix and don't skip test
2023-05-18 10:52:34 -07:00
Jarred Sumner
642b3978a6 Fixes #2928 (#2939)
* Fixes #2928

* another case

* Fix console.log with utf-16 string mismatched quotes

* Fix issue with json

* Even more cases

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-18 10:38:50 -07:00
Jarred Sumner
17c258eb34 Update fs.test.ts 2023-05-17 20:51:38 -07:00
Jarred Sumner
aacbef3cf9 Mention setting target to "node" or "bun" when a ResolveMessage occurs for a Node.js builtin 2023-05-17 20:29:35 -07:00
Jarred Sumner
4f7198f780 Fixes https://github.com/oven-sh/bun/issues/2931 2023-05-17 20:19:31 -07:00
Jarred Sumner
21086c3a78 Update benchmarking.md 2023-05-17 18:52:29 -07:00
Jarred Sumner
206b85e5db Support static string values in our class bindings generator 2023-05-17 18:52:23 -07:00
Jarred Sumner
25447426f1 Make BuildError and ResolveError use C++ instead of JSC C API
Fixes memory leak with private data never being cleared
Fixes a case where a ResolveError could actually be a BuildError
2023-05-17 18:51:50 -07:00
Jarred Sumner
67f543daa7 Update json-parse-stringify.mjs 2023-05-17 12:25:19 -07:00
Jarred Sumner
6c847f638f microbenchmark for json.parse / stringify 2023-05-17 12:12:42 -07:00
Jarred Sumner
8d90d79587 Bump 2023-05-17 12:06:43 -07:00
Jarred Sumner
59adc6cb78 Merge branch 'jarred/webkit-upgrade-may-17' 2023-05-17 11:36:24 -07:00
Jarred Sumner
bff465a2a2 Finish bumping 2023-05-17 11:34:37 -07:00
Bryce Kalow
fb7fb0a537 fix: bun-plugin-server-components name (#2919) 2023-05-17 11:04:40 -07:00
dave caruso
f1b16cd36a do not fail bundles on warnings (#2920) 2023-05-17 10:25:56 -07:00
Jarred Sumner
84fd6a514a Do the WebKit upgrade 2023-05-17 09:55:24 -07:00
Dylan Conway
bf1216021e resolve rope before pushing to previous string (#2909) 2023-05-16 17:19:56 -07:00
Harry Yep
2f4162e692 fix: broken link (#2897) 2023-05-16 17:08:45 -07:00
dave caruso
ad20b13985 Fix segfault on passing undefined to bun.build (#2902) 2023-05-16 17:08:00 -07:00
Dylan Conway
1ad8c54c90 fix asset naming output paths (#2904)
* rename to `src_path` and `dest_path`, use `dest_path` for output

* format

* option for compile
2023-05-16 17:07:40 -07:00
Jarred Sumner
78229da760 Bump 2023-05-16 11:44:03 -07:00
Jarred Sumner
3adadffc0e Fixes #2895 2023-05-16 11:43:09 -07:00
Colin McDonnell
366eba78f0 Tweaks to bundler docs (#2867)
* WIP

* Fix typo

* Updates

* Document --compile

* Add bundler benchmark

* Remove esbuild

* Add bench to docs

* Add buttons

* Updates
2023-05-16 10:47:00 -07:00
Jarred Sumner
60bc804c58 Bump 2023-05-16 09:31:04 -07:00
Jarred Sumner
65237b3054 Update run-cjs.test.ts 2023-05-16 08:52:14 -07:00
dave caruso
c842f5bfe3 Fix running commonjs modules as entry point (#2885)
* fix cjs run issue

* use a primordial

* fix behavior

* fix it again

* fix tste
2023-05-16 08:49:35 -07:00
Ciro Spaciari
fe74c948cd feat(WebSocketServer) WebSocketServer wrapper + socket.io initial support (#2880)
* WebSocketServer wrapper + socket.io initial support

* fix up backpressure

* fix up backpressure

* fix http address

* add socket.io tests

* add closing tests

* add connection state recovery tests for socket.io

* add handshake test

* add middeware tests for socket.io

* added socket.io socket middleware tests

* add more socket.io test comment/skip  hang tests

* add pending package for tests

* add server attachment servers for socket.io

* add utility-methods tests for socket.io

* rename

* rename

* add messaging-many socket.io tests

* add namespaces tests to socket.io

* skip some tests

* fmt

* add packages to general package.json
2023-05-16 08:48:17 -07:00
Dylan Conway
9c85483a81 handle printing missing expressions and add tests (#2872)
* handle missing expressions and add tests

* minify missing expression blocks in parser
2023-05-15 21:50:44 -07:00
dave caruso
29572737ab bundler testing (#2886)
* bundler testing

* add requireVarThenExport test

* work towards adding more esbuild tests

* tests

* remove this file
2023-05-15 21:18:52 -07:00
dave caruso
dce4a15e69 Change the debug id suffix to hex encoded "bun!bun!" (#2890) 2023-05-15 21:15:32 -07:00
Colin McDonnell
a52715597a Add plugins for yaml & RSC (#2888)
* WIP

* WIP

* Add yaml plugin

* Publish v0.0.1

* Updates

* Start RSC plugin - not finished

* Add readme

* Updates

* Add shell dirs for a few other plugins
2023-05-15 20:37:03 -07:00
Jarred Sumner
b2a750e186 remove incorrect comment 2023-05-15 10:55:35 -07:00
Jarred Sumner
dd11f02a45 [bun build] builds w/ sourcemaps get 15% faster
parallelize quoting source contents
2023-05-15 08:49:54 -07:00
Jarred Sumner
1088a22802 Add TODO 2023-05-15 06:33:20 -07:00
Jarred Sumner
9076a981e8 Set files with #! as executable 2023-05-15 06:31:21 -07:00
Jarred Sumner
8eaf30c022 [bun build] Automatically set target to bun when a hashbang is provided 2023-05-15 06:30:55 -07:00
Jarred Sumner
0a879be328 [bun build --compile] Avoid creating holes 2023-05-15 05:57:46 -07:00
Jarred Sumner
ddb6de2fe6 [bun build --compile] Add some retry logic for opening the files 2023-05-15 05:57:27 -07:00
Jarred Sumner
8a68f3aa71 Remove unused dockerfile 2023-05-15 05:19:24 -07:00
Jarred Sumner
386eec31ac More error message cleanup 2023-05-15 05:17:15 -07:00
Jarred Sumner
9c19383843 Fix crash when importing a file with an unknown extension 2023-05-15 04:35:59 -07:00
Jarred Sumner
47d2e2cb19 Make bun build --compile a little more resilient, output better errors, and clean up files 2023-05-15 04:35:21 -07:00
Jarred Sumner
4d751db27a More DCE 2023-05-15 02:36:43 -07:00
Jarred Sumner
4ec2ed4f6c Fix broken test 2023-05-15 01:56:59 -07:00
Jarred Sumner
e7e4030299 Fix bug with req.url set incorrectly (#2881)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-15 01:52:51 -07:00
Jarred Sumner
d3a72a1254 Set more things to const 2023-05-15 00:00:13 -07:00
Jarred Sumner
44417e9d1e github actions doesn't like SSH submodules 2023-05-14 23:51:24 -07:00
Jarred Sumner
9acf854f5b Workaround https://github.com/ziglang/zig/issues/15715 2023-05-14 23:38:55 -07:00
Jarred Sumner
8cce69e7c2 wip 2023-05-14 23:14:45 -07:00
Jarred Sumner
a425376c3d Fix process.argv with standalone 2023-05-14 23:09:19 -07:00
Jarred Sumner
c367408233 a little less inline 2023-05-14 21:15:35 -07:00
Jarred Sumner
328d09129a Fix scope chain bug 2023-05-14 20:56:06 -07:00
Ciro Spaciari
e096a03e3e fix(spawn) add Uint8Array support for stdout (#2866)
* add array_buffer support for stdout

* fix comment

* fix param name on baby_list

* keep test names consistent

* add more test cases
2023-05-14 10:22:02 -07:00
Ciro Spaciari
bf9e40d5b4 feat(Timer.refresh) add refresh support on Timer (#2874)
* add refresh support on Timer

* fix this return

* add refresh setTimeout tests

* fix tests and add setInterval test

* use setCached for arguments and callback

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-05-14 10:18:56 -07:00
Jarred Sumner
2a66229b0f fixup 2023-05-14 06:31:17 -07:00
Jarred Sumner
688637d835 fix flags 2023-05-14 06:30:47 -07:00
Jarred Sumner
893f70fee4 Single-file standalone Bun executables (#2879)
* Add LIEF

* Compile LIEF

* Implement support for embedding files on macOS

* proof of concept

* Add zstd

* Implement runtime support

* Move some code around

* Update .gitmodules

* Upgrade zig

https://github.com/ziglang/zig/pull/15278

* leftover

* leftover

* delete dead code

* Fix extname

* Revert "Upgrade zig"

This reverts commit dd968f30bf.

* Revert "leftover"

This reverts commit 7664de7686.

* Revert "leftover"

This reverts commit 498005be06.

* various fixes

* it works!

* leftover

* Make `zig build` a little faster

* give up on code signing support

* Support Linux & macOS

* Finish removing LIEF

* few more

* Add zstd to list of deps

* make it pretty

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-14 06:13:39 -07:00
dave caruso
7f25aa9e08 windows path compatibility (#2869)
* winndows path compatibility

* change * to "star" and fix import

---------

Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
2023-05-12 17:39:28 -03:00
Ciro Spaciari
f48f48795b proper stub for sockets (#2868) 2023-05-12 09:27:17 -07:00
Jarred Sumner
8f3b648602 finish #2864 2023-05-12 08:53:23 -07:00
Dylan Conway
5f897589fc disable sloppy mode block level functions when not bundling (#2864)
* enable only during bundling

* add `willUseNumberRenamer()`
2023-05-12 08:32:24 -07:00
Dylan Conway
4d5d0d075a root bundle option (#2859)
* handle multiple output files and `[dir]`

* get the realpath of `root_dir`

* duplicate output paths

* add `rootdir` to `JSBundler`

* use realpath of input file

* add tests for naming and root

---------

Co-authored-by: Dave Caruso <me@paperdave.net>
2023-05-12 07:33:07 -07:00
Jarred Sumner
c815716899 [bundler] Don't wait on sourcmaps that don't exist 2023-05-12 07:28:56 -07:00
Jarred Sumner
6f0f506e95 [bundler] De-optimize import defaultIdentifier from './foo.cjs' 2023-05-12 07:28:40 -07:00
Jarred Sumner
da10cd6010 [bundler] Empty ESM gets undefined, empty CJS gets {} 2023-05-12 07:27:53 -07:00
Jarred Sumner
a46d3162ae Fix importstar_ts/ReExportTypeOnlyFileES6 2023-05-12 07:27:25 -07:00
Jarred Sumner
02a8f99629 sort more 2023-05-12 07:27:15 -07:00
Jarred Sumner
20f1057a7d Fix a couple tests 2023-05-12 07:27:09 -07:00
Jarred Sumner
f6bbfb16fd Add a couple tests 2023-05-12 07:27:03 -07:00
Jarred Sumner
b5c70814e5 handle errors + sort things 2023-05-12 07:21:57 -07:00
Jarred Sumner
8340b98352 [bundler] Disable export star redirect code size optimization 2023-05-12 07:14:48 -07:00
Jarred Sumner
d2e09ce519 [bundler] Fix export * from ./my-cjs-file.cjs' 2023-05-12 04:11:21 -07:00
Jarred Sumner
1e450dbcab [bundler] Implement export * from code size optimization 2023-05-12 04:11:21 -07:00
Jarred Sumner
231da81528 [bundler] Fix --transpile --outfile 2023-05-12 04:11:21 -07:00
Ciro Spaciari
6070e135e9 fix proxy status return (#2860) 2023-05-12 08:06:17 -03:00
Ciro Spaciari
f8c840aec7 fix large stdout output (#2850)
* fix large stdout output

* remove skip from #2674 for testing

* add big stdout test using spawnSync

* add bunEnv on big stdout test
2023-05-12 08:05:46 -03:00
Jarred Sumner
273ccbc241 [bundler] Fix bug with export default TypeScriptType 2023-05-12 02:02:35 -07:00
Jarred Sumner
3f01e2a519 alphabetize 2023-05-12 01:49:17 -07:00
Jarred Sumner
b0908b7b13 Fix test 2023-05-12 01:49:07 -07:00
Jarred Sumner
5b3e18e028 Fix regression 2023-05-12 01:49:00 -07:00
Jarred Sumner
155110a03a Fix our tree shaking optimization 2023-05-11 23:19:21 -07:00
Jarred Sumner
3bb5c45385 Fix require() on a converted file 2023-05-11 23:18:36 -07:00
Jarred Sumner
e785b0872a Fix tree shaking flag 2023-05-11 23:17:06 -07:00
Jarred Sumner
99cce67d61 enable tree shaking 2023-05-11 21:40:47 -07:00
dave caruso
4381204cdb oops (#2863)
* oops

* oops part 2
2023-05-11 21:25:03 -07:00
Jarred Sumner
0cee7c028a woops 2023-05-11 20:05:46 -07:00
Jarred Sumner
bfcc0b8960 handle module.exports.foo = class {} in the entry point in the runtime
Related to https://github.com/oven-sh/bun/issues/2862, but does not fix it
2023-05-11 20:01:10 -07:00
dave caruso
dfd0f3e252 Allow reading config from within plugins, and partially implement esbuild initialOptions (#2861)
* Implement plugin build.config and initialOptions

* update types

* default initialoptions entrypoints
2023-05-11 22:58:41 -04:00
Jarred Sumner
136b50c746 formatting 2023-05-11 19:31:55 -07:00
Jarred Sumner
5bb42c81e4 give up on this optimization so we can ship 2023-05-11 19:31:39 -07:00
Jarred Sumner
a008e49a40 forgot to commit this 2023-05-11 15:14:43 -07:00
Jarred Sumner
56b8458c62 call stop before emit 2023-05-11 15:10:40 -07:00
Jarred Sumner
7141e19a10 fixup 2023-05-11 15:10:06 -07:00
Jarred Sumner
5c08200b18 [node:http] handle errors generated by fetch 2023-05-11 15:09:30 -07:00
Jarred Sumner
d67bdb7e9b [node:http] Fix close() to accept a callback and implement closeAllConnections 2023-05-11 15:09:14 -07:00
Jarred Sumner
77eb61a1fe Fix OutputKind, add "use client" and "use server" 2023-05-11 15:08:18 -07:00
dave caruso
6a163cf933 bundler tests and improve Bun.build return type (#2833)
* importstar_ts

* tests

* run acorn test suite

* bench tweaks

* test

* bun.build tests very incomplete

* remove dataurl and base64 loaders from tests since they dont work yet

* tests

* stuff

* stuff

* add errors and array of blobs

* work so far

* docs

* requested changes

* fix overwrite docs

* remove this file
2023-05-11 14:42:54 -07:00
Dylan Conway
02cad591f8 fix child process tests (#2584)
* always handle exit on next tick

* emit spawn immediately
2023-05-11 14:39:44 -07:00
Ciro Spaciari
3530cfac68 fix redirect: \'manual\' and setTimeout on node:http request (#2848) 2023-05-11 14:25:21 -07:00
Ciro Spaciari
bc7d0adcf9 fix(fs) mkdtemp and mkdtempSync errors (#2851)
* fix mkdtemp

* fmt

* fix errno
2023-05-11 14:23:33 -07:00
Ciro Spaciari
d032b73b10 add tests for ws.close (#2844)
* add tests for ws.close

* add timeout on ws.close tests
2023-05-11 02:30:48 -07:00
Ciro Spaciari
9c166a1bdf add support for { all: true } option on dns.lookup (#2846) 2023-05-11 02:30:20 -07:00
Jarred Sumner
e125ed2aa3 Report timings for failing tests too 2023-05-11 01:16:46 -07:00
Jarred Sumner
5ffee9477c [bun test] Add timings to successful tests 2023-05-11 00:55:41 -07:00
Degreat
4b79b37a99 Implement describe.skip (#2836)
* Implement describe.skip

* Add more tests to cover hooks
2023-05-10 23:57:30 -07:00
Ciro Spaciari
f9831e1f6f feat(fetch) add redirect: 'error' support (#2845)
* add redirect: 'error' support

* fix typo

* fix typo

* refactor FetchRedirect enum

* fix FetchRedirect

* updated
2023-05-10 23:55:39 -07:00
Dylan Conway
8f4a5903ab make sure vars can be hoisted in catch scope (#2847) 2023-05-10 23:55:27 -07:00
Jarred Sumner
0e5f0940ee serialize 2023-05-10 23:30:30 -07:00
Jarred Sumner
9d3a95ed96 Add version 2023-05-10 23:03:37 -07:00
Jarred Sumner
2abfa84db7 Implement the benchmark snippet runner minus the sqlite serialization step 2023-05-10 22:50:56 -07:00
Dylan Conway
53fe8d61e7 object empty ast 2023-05-10 21:53:38 -07:00
Jarred Sumner
e1c6adc737 Prepare to run these automatically 2023-05-10 21:37:08 -07:00
Jarred Sumner
5e0eedccb0 Fix test failure in scope order verification 2023-05-10 20:07:12 -07:00
Jarred Sumner
06a03df9a6 Fix assertion 2023-05-10 17:59:55 -07:00
Jarred Sumner
ed5dd3fee1 Fix incorrect assertion 2023-05-10 17:50:02 -07:00
Jarred Sumner
96dc0471ff Clean-up 85b4be5f71
- We don't need to make `Bun__fetch` exported in every C++ header file
- We shouldn't return JSObjectRef, its an unnecessary wrapper
- The version of `fetch` on the Bun global should be non-configurable so that it is safe for anyone who wants to use that without a user-modifiable one
2023-05-10 16:55:13 -07:00
Ciro Spaciari
85b4be5f71 fix(fetch) fix fetch inheritance (#2842)
* patch fetch function inheritance

* fmt

* fix reserveCapacity and number of arguments for fetch

* change Bun.fetch to use Fetch.jsFunction

* merge Fetch.jsFunction and Fetch.call

* remove commented code
2023-05-10 16:38:52 -07:00
Ciro Spaciari
643aa27a03 fix closing WS with code and reason (#2843) 2023-05-10 14:37:29 -07:00
Dylan Conway
e7d4f5fb16 use member from parent scope when hoisting (#2840) 2023-05-10 13:12:16 -07:00
Alex Lam S.L
5fd838b9e4 bun add from root folder when call within workspaces (#2841)
- ignore invalid `package.json` from parent directories
- `echo` new lines from `make` targets correctly
2023-05-10 17:22:01 +03:00
Jarred Sumner
5b2c3fe440 clarify the types more 2023-05-10 05:08:22 -07:00
Jarred Sumner
53a198f2f7 Update test 2023-05-10 04:22:03 -07:00
Jarred Sumner
982dc0b441 Implement BuildArtifact 2023-05-10 04:21:53 -07:00
Dylan Conway
1f8c60123d fix catch scope var declarations (#2839)
* use `catch_binding` kind and report errors

* make hash optional
2023-05-09 23:52:40 -07:00
Alex Lam S.L
4ccca13001 [install] operator on root package of workspaces (#2834)
- parse `bunfig.toml` from same directory as `package.json`
- handle `--cwd` correctly

fixes #2592
2023-05-10 08:26:29 +03:00
Jarred Sumner
1e8b9258b2 Expose bindings for Map 2023-05-09 21:47:18 -07:00
Jarred Sumner
c7c5dc1438 Add name property 2023-05-09 21:44:05 -07:00
Jarred Sumner
a5b3056c76 Fix extra semicolon 2023-05-09 21:41:05 -07:00
Jarred Sumner
e8989f9a60 Fix make headers (May 9th 2023 edition) 2023-05-09 21:05:33 -07:00
Jarred Sumner
4346f6afc0 RSC 2023-05-09 20:38:26 -07:00
Dylan Conway
38e72a528d code splitting option 2023-05-09 20:38:02 -07:00
Dylan Conway
eb2510170f resolve rope string before returning (#2838) 2023-05-09 20:33:26 -07:00
Dylan Conway
1d72bbe96c space before label (#2837) 2023-05-09 20:27:20 -07:00
Dylan Conway
a47e2c6021 add WebAssemblyInstance and WebAssemblyGCObject js types (#2835)
* add `WebAssemblyInstance` and `WebAssemblyGCObject`

* update c api
2023-05-09 18:37:50 -07:00
Jarred Sumner
5a18d24a96 Re-run builtins generator 2023-05-09 16:17:42 -07:00
Jarred Sumner
d1dd7a7ebb Add a comment 2023-05-09 15:40:51 -07:00
Jarred Sumner
65eb6db7fa Fix a memory leak in module resolution 2023-05-09 15:29:32 -07:00
Jarred Sumner
ce3c7d2961 bun build --transform should not run the module resolver 2023-05-09 15:27:04 -07:00
Jarred Sumner
ff1edca9ee Fix regression with bun test not recursively scanning the directory tree 2023-05-09 14:56:39 -07:00
Jarred Sumner
ffd48dc7a7 fix tracy i think 2023-05-09 14:32:26 -07:00
Dylan Conway
b3dc14ef0f don't replace with there isn't a star (#2825) 2023-05-09 14:20:46 -07:00
dave caruso
22b801bb89 fix #2820 (#2832) 2023-05-09 14:20:12 -07:00
Dylan Conway
c35518e6d6 Fixes #2807
we will look at the minify tests for uglifyjs too
2023-05-08 23:39:02 -07:00
Dylan Conway
232a25b77f add the class name to the current scope 2023-05-08 23:34:36 -07:00
Dylan Conway
e74207650b Fix bug with float minification 2023-05-08 23:07:14 -07:00
Dylan Conway
aa85d7af92 Fix incorrect fd usage 2023-05-08 22:54:25 -07:00
Jarred Sumner
0b52f9210a Add a couple helpers 2023-05-08 22:36:52 -07:00
Jarred Sumner
69ea6fd54f Fix memory issues with loader and define in JSBundler 2023-05-08 22:35:13 -07:00
Jarred Sumner
73b0d8a51c Make the enum serializer more flexible 2023-05-08 22:34:01 -07:00
Jarred Sumner
b874d0b387 ✂️ dead code 2023-05-08 22:32:04 -07:00
dave caruso
5e366872f6 implement build api define and loaders (#2805)
* parse error logs

* clean up types

* remove --jsx-production. use NODE_ENV instead

* add define to js api

* add loaders to js api

* fixups

* sourcemap

* typo fix

* remove label, comment dir just for now

* test tweaks

* test work

* make optional enums actually optional.
allows `sourcemap: undefined`

* overload host ram test

* string tests

* tests

* test for 2815

* requested changes

* sort this list

* remove this test file now that it passes

* oops

* add --format

* finish ts tests

* doc typos related to define and loader
2023-05-08 21:55:21 -07:00
Jarred Sumner
1a411e201b Add some comments 2023-05-08 21:32:17 -07:00
Jarred Sumner
4a2d89d865 ✂️ some dead code 2023-05-08 21:29:19 -07:00
Jarred Sumner
e422c849d5 Fix bug in Bun.build() where it wouldn't pick up changes to directories on rebuilds (#2824)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-08 21:14:56 -07:00
Ciro Spaciari
c6c21eeba7 added some improvements on server (#2803)
* added some improvements on server

* undo unintended change

* clean data handler before end calls

* refactor

* make ctx.resp nullable

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-05-08 14:10:40 -07:00
Jarred Sumner
14597dbcdc Don't leak file handles 2023-05-08 02:43:17 -07:00
Jarred Sumner
f9d6a61676 [fs] Add an extra byte to files we read 2023-05-08 01:45:10 -07:00
Jarred Sumner
3f895085a0 [fs] More logging 2023-05-08 01:44:50 -07:00
Jarred Sumner
81e4203efe [bundler] Make module resolution single-threaded 2023-05-08 01:44:08 -07:00
Jarred Sumner
db44f41dd0 Possibly fix the linux perf issue 2023-05-07 23:53:45 -07:00
Jarred Sumner
56bd410044 Reduce over-allocation 2023-05-07 23:52:05 -07:00
Jarred Sumner
35685bbc86 Reduce the size of the JS AST to attempt to resolve the linux performance issue 2023-05-07 22:33:59 -07:00
Jarred Sumner
af1cd23b8c Add tracy (#2817)
* Add tracy

* RTLD

* Linux needs LD_PRELOAD

* More tracing

* Inline this

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-07 21:08:32 -07:00
Jarred Sumner
d3ae9ac7ce experiment to try to fix linux bundler perf regression 2023-05-07 01:51:05 -07:00
Jarred Sumner
1fbfaa5ca1 Use dwarf v4 2023-05-07 01:50:20 -07:00
Jarred Sumner
243847f992 Add alignment feature flag 2023-05-07 01:04:38 -07:00
Jarred Sumner
25eecc3e07 Add latin1 identifier fast path 2023-05-06 23:36:37 -07:00
Jarred Sumner
0e1b934e27 Fix overflow 2023-05-06 19:52:46 -07:00
Jarred Sumner
2aa4fba99d 💅 2023-05-06 19:09:14 -07:00
Jarred Sumner
cf4d13dcc0 Fixes #2811 2023-05-06 19:06:52 -07:00
Jarred Sumner
4708835ae6 [minifier] Rewrite equality check logic 2023-05-06 18:23:37 -07:00
Jarred Sumner
8975717bc3 Fix several transpiler tests 2023-05-06 18:20:19 -07:00
Jarred Sumner
5327940132 Fixes https://github.com/oven-sh/bun/issues/2810 2023-05-06 18:16:21 -07:00
Jarred Sumner
54d5f59f09 Cleanup some of the log-related code 2023-05-06 16:32:29 -07:00
Jarred Sumner
46a0a4d984 [Bun.build] Add error when an onResolve plugin returns a namespace which has no loader 2023-05-06 16:32:06 -07:00
Jarred Sumner
70e850bf76 fix crash when there are lots of build errors 2023-05-06 16:31:46 -07:00
Jarred Sumner
d4b35d9ae6 Fix make headers 2023-05-06 13:19:41 -07:00
Jarred Sumner
f523b2187a Fix make headers 2023-05-06 13:19:23 -07:00
Jarred Sumner
41a59d0d03 Fix a memory leak 2023-05-06 13:19:11 -07:00
Jarred Sumner
9c9425bc8c Another .isFile() 2023-05-06 13:18:38 -07:00
Jarred Sumner
01ce690a01 Clone the logs more 2023-05-06 13:18:13 -07:00
Jarred Sumner
1da75791da Use isFile() helper 2023-05-06 12:52:55 -07:00
Jarred Sumner
3bc02e48ca Comment out buchta from docs
The repo is archived, so it should not appear in our docs
2023-05-06 12:41:03 -07:00
Jarred Sumner
9d7ecf7909 [misctools] Add cold jsc start test 2023-05-05 20:01:26 -07:00
Jarred Sumner
31cb49a026 [ci] Fix broken test runner
cc @Electroid we need `@actions/core` to be installed in node_modules
2023-05-05 18:34:43 -07:00
Jarred Sumner
f95a81e05d [napi] Fix crash in napi_create_external_buffer
This impacted LightningCSS when garbage collection ran. cc @devongovett
2023-05-05 17:16:47 -07:00
Jarred Sumner
c3d512f27e Fix valgrind tracking flag 2023-05-05 15:48:27 -07:00
Jarred Sumner
9a09f9f532 Fix bug where the Bun.file() returned by Bun.build() would have an incorrect path 2023-05-05 15:48:26 -07:00
Jarred Sumner
3a01316707 Cleanup how some of the server components stuff works 2023-05-05 15:48:26 -07:00
Kruithne
e00017f7b8 Add missing JSON API to Web APIs page (#2799)
* Add missing JSON API to Web APIs page

Unless I'm missing something obvious, it appears that Bun has the JSON API (`stringify`/`parse`) but is not listed anywhere in the documentation.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON

* Include JSON in global docs
2023-05-05 12:54:54 -07:00
Colin McDonnell
386639a4c5 Start esbuild migration guide. More docs. (#2787)
* Bundler docs updates. Start esbuild migration guide.

* Updates

* Add JS API comp

* Tweaks

* Updates

* Updates

* Updates
2023-05-05 12:53:38 -07:00
Dylan Conway
d9386a68a4 fix source map line offsets (#2791)
* find codepoint at `i`

* fix allocator usage

* missing comment

* switch to `Cursor` iterator
2023-05-04 22:44:02 -07:00
Jarred Sumner
945d069290 Add UNLIKELY 2023-05-04 17:09:59 -07:00
Jarred Sumner
7cb1404511 Revert "Add setNoDelay"
This reverts commit 8b6dd0c7e1.
2023-05-04 17:09:24 -07:00
Jarred Sumner
8e4f777d35 Throw error on non-file url 2023-05-04 17:09:10 -07:00
Jarred Sumner
8b6dd0c7e1 Add setNoDelay 2023-05-04 17:09:10 -07:00
Ashcon Partovi
c43c1b50ff Add no-op for ClientRequest.{setNoDelay,setTimeout} 2023-05-04 16:09:45 -07:00
Ashcon Partovi
1574ac7896 Only checkout test folder for ecosystem tests 2023-05-04 15:55:12 -07:00
Ashcon Partovi
a66137bdce Actually fix the git clone URL 2023-05-04 15:36:56 -07:00
Ashcon Partovi
b2abf82494 Use HTTPS instead of SSH for git clone in ecosystem tests 2023-05-04 15:35:58 -07:00
Ashcon Partovi
d68786909c Fix working directory of GitHub action 2023-05-04 15:33:33 -07:00
Ashcon Partovi
1183dd1a3f Add initial ecosystem tests (#2801)
* Add initial ecosystem tests

* Run ecosystem tests every morning, after canary release
2023-05-04 15:27:12 -07:00
Dylan Conway
8e18229d5d parse and visit catch body scope (#2796) 2023-05-04 08:21:33 -07:00
Jarred Sumner
243dfc177a Fix code splitting for server components 2023-05-03 23:48:18 -07:00
Jarred Sumner
f114e88bee Clean up edgecase causing plugins to be called too many times 2023-05-03 15:35:11 -07:00
Jarred Sumner
2d0eaf9842 Fix broken test 2023-05-03 15:32:15 -07:00
Jarred Sumner
101f0ee6ba re-enable our CJS optimization 2023-05-03 10:35:55 -07:00
Jarred Sumner
9b5caf7467 Implement synthetic default export 2023-05-03 00:55:06 -07:00
Jarred Sumner
b2a50671ab add deoptimization 2023-05-02 23:03:39 -07:00
Dylan Conway
ca776326cf entry_point_kinds only at source_index 2023-05-02 22:16:46 -07:00
Jarred Sumner
1346293619 Add missing function 2023-05-02 22:12:56 -07:00
Jarred Sumner
bc4a8bf595 Small refactor 2023-05-02 22:02:19 -07:00
Jarred Sumner
2bc449656e Visit the runtime 2023-05-02 22:02:19 -07:00
Jarred Sumner
6a74651eb4 Add helper fn 2023-05-02 22:02:19 -07:00
Dylan Conway
755874a9ea Fix checking for dynamic exports (#2792)
* only look at import records for the current source index

* skip `source_index` when it is invalid

* iterate `export_star_records` at `source_index`

* comment
2023-05-02 21:57:57 -07:00
Jarred Sumner
082bc62589 alignment 2023-05-02 19:57:44 -07:00
Jarred Sumner
2250f7a0c0 Add __ulock_wait2 polyfill
cc @kzc
2023-05-02 18:33:03 -07:00
Jarred Sumner
fe52627dea fix spacing 2023-05-02 11:58:24 -07:00
Jarred Sumner
6bdc158e9c Use pretty 2023-05-02 11:58:14 -07:00
Jarred Sumner
7a699c1ac2 Fix a couple spltiting bugs 2023-05-01 22:23:07 -07:00
Jarred Sumner
c5df4e9477 Compress let f; f=123 => let f = 123; 2023-05-01 21:00:51 -07:00
Jarred Sumner
b3c7d0ea23 Small improvement to minifier 2023-05-01 21:00:31 -07:00
Jarred Sumner
1af4e1dce1 Fixes #2783 2023-05-01 16:55:50 -07:00
Jarred Sumner
5d8027cd5a Fix test 2023-05-01 16:55:11 -07:00
Jarred Sumner
69b767fadc Update bundle_v2.zig 2023-05-01 15:24:10 -07:00
Jarred Sumner
44fbd7719e Fix some splitting bugs 2023-05-01 15:04:46 -07:00
Jarred Sumner
0b2422b1f3 Fix another crash 2023-05-01 13:01:30 -07:00
Jarred Sumner
331a3cec8c Fix crash 2023-05-01 12:24:28 -07:00
Revenity
c2a223802b Add StricJS to ecosystem (#2747)
* Create stric.md

* Update nav.ts

* Update stric.md

Add codetabs for ArrowJS

* Update stric.md

* Update stric.md
2023-05-01 10:37:39 -07:00
Ashcon Partovi
c19c522744 Fix error links in markdown summary 2023-05-01 09:01:41 -07:00
Ashcon Partovi
1fc8639177 Condense errors in test runner script 2023-05-01 08:48:40 -07:00
Jarred Sumner
fe57932dfb Add missing type for sqlite (#2764)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-30 23:36:32 -07:00
Will Richards 2
59b3556fab Bun Test matchers even/odd. Also, .toContains fix and truthy (#2754)
* bun test matcher tests for even/odd, few more truthy tests, and fix for contains empty string

* implementation of even/odd matchers

* didn't add the codegen bindings

* linted
2023-04-30 23:36:08 -07:00
Jarred Sumner
8b53b3ed88 FIx esm -> cjs require interop with converted CJS
TODO: make `default` namespace object for these not load the entire wrapper
2023-04-30 23:17:25 -07:00
Jarred Sumner
c0a1c76edb Fix garbled line text in some errors 2023-04-30 23:16:23 -07:00
Jarred Sumner
f26fef1010 Update options.zig 2023-04-30 22:41:07 -07:00
Jarred Sumner
f8b0730231 Fix missing imports in DCE tests 2023-04-30 22:34:23 -07:00
Jarred Sumner
fe14b7244d Fix missing "default" export condition 2023-04-30 22:34:13 -07:00
Dylan Conway
0490bd3d2e Implement source maps (#2770)
* wip

* Begin computing source map tables

* source map progress

* external source maps

* fix merge

* remove `@as` coercion

* inline source maps and output source map shifts

* fix `codeWithSourceMapShifts()` after merge

* remove second call to `findReachableFiles()`

* use `worker.allocator`, remove comment

* don't reuse memory for source and sourceContents

* don't reuse `quote_buf`

* fix writing to stdout

* Add comment

* Don't include a sourcemap if the text was empty

* Make the parser faster

* +16% faster sourcemap generation

@dylan-conway I'll need you to look this over to make sure I didn't mess anything up

Though it currently doesn't generate the offsets in the right order...

* 30% performance improvement to Bun.build()

* Print `debugId` in source maps

cc @mitsuhiko @notzeeg

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-30 22:09:40 -07:00
dave caruso
137dc6e19f test default condition (#2776) 2023-04-30 21:16:32 -07:00
Alex Lam S.L
c05a6744bb [install] handle devDependencies of local folders (#2781)
fixes #2653
2023-05-01 06:41:33 +03:00
Jarred Sumner
f54fbaf3ba prevent crash 2023-04-30 09:50:37 -07:00
Alex Lam S.L
dd03a4f95d [install] handle repeated install of GitHub dependency correctly (#2780)
fixes #2602
2023-04-30 09:45:08 -07:00
Jarred Sumner
4be3548829 add to symbols.txt 2023-04-30 00:55:09 -07:00
Jarred Sumner
c3dc64d468 Fix a load order issue 2023-04-29 21:37:04 -07:00
Jarred Sumner
bd1f9d8370 Fix some runtime issues caused by bundler 2023-04-29 21:14:21 -07:00
Jarred Sumner
0cb090f118 Fix garbled text in errors 2023-04-29 19:42:47 -07:00
Jarred Sumner
5fb014876b Fix plugin namespaces always being set to "flie" 2023-04-29 19:42:38 -07:00
Jarred Sumner
e7ff65ce2c [Transpiler] Fix crash in scanImports when the text is empty 2023-04-29 18:59:22 -07:00
Jarred Sumner
e321e1c5f8 Fix debug mode crash with trailing slash in import specifier 2023-04-29 18:58:43 -07:00
Jarred Sumner
737822b2ba Put transpiler tests in a separate folder 2023-04-29 18:47:52 -07:00
Jarred Sumner
9a929ff873 Update bun.zig 2023-04-29 18:16:57 -07:00
Jarred Sumner
3b6fb37497 Clean up args parsing with --loader 2023-04-29 18:12:55 -07:00
Jarred Sumner
229f5f7770 Export 4 missing napi symbols on macOS 2023-04-29 16:04:08 -07:00
dave caruso
96e113f41c bundler tests: rest of default.test.ts and starting jsx tests (#2765) 2023-04-28 21:08:48 -07:00
Jarred Sumner
bc0c0f7d20 fix several memory issues related to plugins 2023-04-28 18:59:12 -07:00
Jarred Sumner
98583972df cargo cult some code from JSC 2023-04-28 18:57:00 -07:00
Jarred Sumner
994c715700 Fix race condition 2023-04-28 17:46:43 -07:00
Jarred Sumner
e3a0c4e06d Update bun-test.yml 2023-04-28 17:12:01 -07:00
Jarred Sumner
bc43d33be9 move this 2023-04-28 17:10:24 -07:00
Jarred Sumner
73d499ed22 Add a comment 2023-04-28 17:02:12 -07:00
Ashcon Partovi
912ae8d2b5 Improve test runner markdown 2023-04-28 14:58:16 -07:00
Jarred Sumner
26d81fc5ba [resolver] Propagate module type from package.json "exports" when possible 2023-04-28 14:21:18 -07:00
Jarred Sumner
396416a91f Fix crash with invalid input in fetch() 2023-04-28 13:54:22 -07:00
Ciro Spaciari
4515a6373e Improves Body.Value life cycle and Signal life cycle on server.zig (#2752)
* reestruct request body value and signal

* revert react-hello-world

* fix constructInto and test

* fmt

* fix body nullable

* Request can outlive RequestContext

* fmt

* BodyValue is now HiveRef

* hasDecl for Ref and HiveRef

* fix deinit call on Ref/HiveRef

* adds InlineBlob

* fix Bun.inspect when using InlineBlob

* revert InlineBlob

* Fix mimalloc-debug

* Add TODO note

* fix: make node:crypto Hash.copy work correctly (#2761)

This commit will also:
- add a CryptoHasher.copy function
- make CryptoHasher.digest reset the hasher so it can be reused

Resolves #2651

* 💅

* address unicode issue (#2763)

* Fix an oopsie

* Another oopsie

* use inline for

* Fixup

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>

* Request can outlive RequestContext

* fmt

* garantee to have the abort signnal attached to the server before abort the client on bun-server test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Silver <14016168+silversquirl@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-04-28 13:40:44 -07:00
Jarred Sumner
c383638ddd Use global allocator tsconfig.json 2023-04-28 10:35:50 -07:00
Ashcon Partovi
af02b75f79 Use setup-bun instead 2023-04-28 10:13:36 -07:00
Ashcon Partovi
a06e90eec3 Fix path of bun in workflow, try 3 2023-04-28 09:58:56 -07:00
Ashcon Partovi
35d470d98a Fix path of bun in workflow, try 2 2023-04-28 09:54:31 -07:00
Ashcon Partovi
05abe8eabe Fix path of bun in workflow 2023-04-28 09:52:15 -07:00
Ashcon Partovi
48671b77be Use GITHUB_PATH instead of cp 2023-04-28 09:44:44 -07:00
Ashcon Partovi
b7c13f2ccc Maybe fix test runner on macOS 2023-04-28 09:41:36 -07:00
Ashcon Partovi
64b9967fe6 Improve test workflow 2023-04-28 09:35:44 -07:00
Ashcon Partovi
ef894c57cf Fix typo in runner 2023-04-28 09:17:06 -07:00
Ashcon Partovi
5734889cc7 Use bun x instead of bunx 2023-04-28 09:13:14 -07:00
Ashcon Partovi
59daabb6e7 Fix manual test workflow 2023-04-28 09:11:55 -07:00
Ashcon Partovi
36df170348 Use Node.js APIs for test runner 2023-04-28 09:07:48 -07:00
Ashcon Partovi
6cf4cabab1 New test runner with better Github integration 2023-04-28 08:42:25 -07:00
Colin McDonnell
1483d73c3a Bundler docs updates + support for naming string (#2767)
* Bundler docs updates

* Remove comments

* Updates

* Fix bunx usages

* Add info about metafile
2023-04-28 08:35:20 -07:00
Jarred Sumner
52c50e3737 address unicode issue (#2763)
* Fix an oopsie

* Another oopsie

* use inline for

* Fixup

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-27 08:37:37 -07:00
Jarred Sumner
3ee22065f0 💅 2023-04-27 07:51:30 -07:00
Silver
0060e49923 fix: make node:crypto Hash.copy work correctly (#2761)
This commit will also:
- add a CryptoHasher.copy function
- make CryptoHasher.digest reset the hasher so it can be reused

Resolves #2651
2023-04-27 07:45:32 -07:00
Jarred Sumner
87921520e4 Add TODO note 2023-04-27 05:35:11 -07:00
Jarred Sumner
73467a5736 Fix mimalloc-debug 2023-04-27 05:35:11 -07:00
B. Burt
5a8a418ef4 Remove extra word in docs/index.md (#2758) 2023-04-27 04:00:35 -07:00
Jarred Sumner
df59fe2843 Implement outdir in Bun.build 2023-04-27 03:45:49 -07:00
Jarred Sumner
990f53f986 Don't preallocate unless its profitable 2023-04-27 03:45:09 -07:00
Jarred Sumner
9383333799 Add microbenchmark 2023-04-27 03:44:23 -07:00
Jarred Sumner
4558ea712a very slightly faster open() and writeFileSync() (#2759)
* Make open() slightly faster on macOS

* Support using `writeFileSync` from native code

* Add `openat$NOCANCEL` symbol

* fixups for linux

* do benchmark

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-27 03:35:46 -07:00
Jarred Sumner
f1c1f556a3 more esbuild compat 2023-04-26 22:36:56 -07:00
Jarred Sumner
6142f6eb61 Wrap some things in minify_syntax flag 2023-04-26 22:32:48 -07:00
Jarred Sumner
316a75005b Inline spreads of array literals 2023-04-26 22:32:31 -07:00
dave caruso
5b76ee769e bundler tests! (#2741)
* bundler tests!

* tests
2023-04-26 21:57:49 -07:00
Silver
3a203abc10 Use Ninja to build mimalloc and gitignore test/bun.lockb (#2750)
* build: use ninja to build mimalloc

This is both faster than make, and ensures the same generator is
always used, even when CMAKE_GENERATOR exists in the environment.

* chore: gitignore test/bun.lockb
2023-04-26 21:57:25 -07:00
Dylan Conway
75e3546f3a ensure super() is not merged with adjacent statements (#2757)
* ensure `super()` is not merged with adjacent statements

* add TODO
2023-04-26 21:46:35 -07:00
Jarred Sumner
6c6118e210 Fixes #2746 (#2748)
* Fixes #2746

* add test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-26 21:07:40 -07:00
dave caruso
55c05c0a1f fix (#2756) 2023-04-26 20:45:27 -07:00
dave caruso
7d7748f69f docs hotfix (#2755) 2023-04-26 20:27:24 -07:00
Colin McDonnell
8ba13f273c Add bundler documentation (#2753)
* WIP

* WIP

* WIP

* Document API

* Updates

* Polish bundler docs

* Tweaks

* Tweak
2023-04-26 20:07:30 -07:00
Colin McDonnell
68ab71eb13 Basic types for Bun.build (#2713)
* Basic types for Bun.build

* Tweaks

* Updates
2023-04-26 14:54:05 -07:00
Jarred Sumner
ab447e4ff7 Implement file loader in Bun.build (#2745)
* Update bundle_v2.zig

* Implement `file` loader

* Hash in parallel

* Implement `publicPath`

* simplify

* Update bundle_v2.zig

* Implement `#!`

* Remove unnecessary optional

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-26 07:22:29 -07:00
Jarred Sumner
149f097ffd Update outdated help 2023-04-25 22:21:40 -07:00
Jarred Sumner
3e374c0ee4 Fix assertion failure
reproduces if building Three.js 10 times in runtime
2023-04-25 22:21:24 -07:00
Jarred Sumner
f42663ce9a Avoid unnecessary copies 2023-04-25 22:11:15 -07:00
Jarred Sumner
c48f7e2663 Fix error with --jsx-production in runtime 2023-04-25 22:10:59 -07:00
dave caruso
0846a4fa80 bundler tests, testing plugins (#2740)
* add cjs2esm stuff

* tests

* plugin testing
2023-04-25 19:13:39 -07:00
Jarred Sumner
2256d43a32 now it works 2023-04-25 08:19:40 -07:00
Jarred Sumner
947634c9ed typo 2023-04-25 07:57:00 -07:00
Jarred Sumner
126885e1fe Implement onResolve plugins in Bun.build(), support multiple onLoad and onResolve plugins (#2739)
* its 2023

* WIP `onResolve` plugins

* more progress

* it compiles

* Lots of small fixes

* Seems to work excluding entry points

* Update BundlerPluginBuiltins.cpp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-25 07:27:18 -07:00
Jarred Sumner
5353d41014 Fixes #2738 2023-04-25 07:25:00 -07:00
Alex Lam S.L
460563ee89 fix make setup (#2731)
- minor clean-ups
2023-04-25 15:13:57 +03:00
Jarred Sumner
3c4f0920b9 Log HTTP requests and responses by default when log level is debug or verbose 2023-04-25 04:01:26 -07:00
Alex Lam S.L
6e16bb67eb [install] fix bun add on non-aliased dependency (#2728) 2023-04-24 17:56:43 -07:00
Jarred Sumner
e9e7645048 In bun run, rewrite usages of npx to bun x instead of bunx to workaround missing symlink 2023-04-24 17:55:34 -07:00
dave caruso
f2112fc0de Continue bundler tests (#2691)
* start refine + skipping some packagejson tests

* some more tests

* stuff

* tests for minify branch

* pkgjson

* add minify/MergeAdjacentVars

* add test for #2699

* more tests!

* more tests

* finish splitting tests

* all but 2 import star tests are good

* test
2023-04-24 14:12:21 -07:00
Jarred Sumner
923ac39c0b Support plugins in Bun.build (#2720)
* wip

* Implement `onLoad` plugins

* Support exceptions and async `onLoad` plugins

* Fix filtering

* Handle empty files

* Fix JSON loader

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-24 14:11:59 -07:00
Plecra
98209b8e10 Reduce friction for building with npm (#2723)
This was the only dependency on bun that I encountered while building the
project, and the change to the gitignore ensures that it's easy to
make changes after an npm based build
2023-04-24 04:23:38 -07:00
Jarred Sumner
4b24bb464c Make Bun.build more reliable (#2718)
* One possible implementation to make `Bun.build` work better

* Pass allocator in

* Make our temporary buffers a little safer

* rename

* Fix memory corruption in symbol table

* Add support for deferred idle events in ThreadPool

* Free more memory

* Use a global allocator FS cache

* more `inline`

* Make duping keys optional in StringMap

* Close file handles more often

* Update router.zig

* wip possibly delete this commit

* Fix memory issues and reduce memory usage

* > 0.8

* Switch to AsyncIO.Waker and fix memory leak in JSBundleCompletionTask

* We don't need to clone this actually

* Fix error

* Format

* Fixup

* Fixup

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-22 19:44:23 -07:00
Jarred Sumner
7d6b5f5358 Fix minify: true not applying to identifiers 2023-04-21 18:03:27 -07:00
Jarred Sumner
9423693a6e [breaking] In Bun.Transpiler, don't wrap CommonJS modules in export default 2023-04-21 18:03:07 -07:00
Jarred Sumner
8b9462fde5 Add minify option to Bun.Transpiler 2023-04-21 18:02:29 -07:00
Colin McDonnell
caa90ba98e Update TS docs for bun-types changes (#2590)
* Update TS docs for bun-types changes

* Update typescript, remove extends guidance

* Updates

* Tweaks

* Tweaks
2023-04-21 11:35:42 -07:00
Colin McDonnell
55d50565a5 Add tsconfig.json to bun-types (#2587)
* Add tsconfig.json to bun-types. Document 'extends' pattern.

* Updates

* Update bun init to use extends:bun-types

* Update type:module recommendation

* Add note about transpilation. Closes #2553

* Make typescript a peer dep

* Revert changes to docs

* Revert tsconfig extends

* Update readme

* FMC

* Undo changed
2023-04-21 11:34:05 -07:00
Jarred Sumner
dc55e11714 Keep the node crypt otest 2023-04-21 07:25:51 -07:00
Jarred Sumner
613bb4822e Revert "use a lazyily initialized stream for node:crypto createHash (#2652)"
This reverts commit 3a2fd65f20.
2023-04-21 07:18:32 -07:00
Jarred Sumner
a4d0a1961a Revert "implement node:events in javascript (#2604)"
This reverts commit 96a2ed1040.
2023-04-21 07:16:23 -07:00
Jarred Sumner
143ccdbeb6 Fix order 2023-04-21 05:10:03 -07:00
Jarred Sumner
b98f90fc6e Bun.build() partial implementation 2023-04-21 01:04:55 -07:00
Jarred Sumner
281b810664 slightly better minified 2023-04-21 01:04:06 -07:00
Jarred Sumner
ffdac249ae Add comment 2023-04-21 00:52:31 -07:00
Jarred Sumner
541d16f8be Fix bug with merging adjacent vars 2023-04-20 23:57:44 -07:00
Emmanuel Vazquez
b609f9be28 chore(docs): add xcode runtime install to docs (#2706) 2023-04-20 20:03:12 -07:00
Jarred Sumner
b473a0022d Fix whitespace edgecase with export * from 2023-04-20 19:51:20 -07:00
Dylan Conway
94cd68d7a6 append if the previous part is not UTF8 (#2705) 2023-04-20 16:35:01 -07:00
Jarred Sumner
6d5378566a Fix template string folding test
@paperdave --minify-syntax now causes `true` to print as `!0` and `false` to print as `!1`

`undefined` is now `void 0`
2023-04-20 05:44:50 -07:00
Jarred Sumner
c33df9e99f Increase timeouts :( 2023-04-20 05:40:20 -07:00
Jarred Sumner
4dc0364201 Update runner.node.mjs 2023-04-20 05:40:11 -07:00
Jarred Sumner
aa4d47fe2d Improve error message when failing to read a file 2023-04-20 05:30:35 -07:00
Jarred Sumner
3a68ca775f Fix bug with invalid character at the end of comment path 2023-04-20 05:24:29 -07:00
Dylan Conway
d78ecc76c8 Symbol minification (#2695)
* minify

* Update renamer.zig

* --minify-whitespace

* Speed up minification a little

* handle private names

* 5% faster minification

* use helper function

* fix nested scope slots

* `bun build --minify` gets another +8% faster

* print semicolons afterwards

* print semicolon after checking error

* after all error checking

* Delete code for generating legacy bundes

* remove extra whitespace around if statements

* print space before import identifier

* Use `@constCast`

* Make `S.Local#decls` use `BabyList(Decl)`

* Add `fromSlice` helper to `BabyList`

* Remove unnecessary optional chains

* minify `undefined, true, false`

* Another @constCast

* Implement merge adjacent local var

* Support --minify in `bun build --transform`

* skip comments when counting character frequencies

* Don't wrap commonjs with --transform on (unless targeting bun)

* Support --minify in the runtime

* Fix edgecase with import * as

* don't infinite loop

* --trnasform shouldn't mess with require

* Only track comments when minifying

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-20 05:23:12 -07:00
Dylan Conway
9e7bfdec8c with body can be an expression 2023-04-20 01:03:38 -07:00
flakey5
f0dd5b8a43 Fix typo in benchmarking docs (#2702) 2023-04-19 19:16:45 -07:00
Jarred Sumner
ea47ed0ee5 Fix broken autocomplete 2023-04-19 00:01:27 -07:00
Alex Lam S.L
36f9fd607a fix make setup (#2693)
- properly reset `JSC_BASE_DIR` after installing `bun-webkit`
2023-04-19 04:55:00 +03:00
dave caruso
96a2ed1040 implement node:events in javascript (#2604)
* initial event emitter reimplementation

* implement most of node:events. tests passing

* work on emitter

* fix importing node:events

* work on event emitter tests

* event work

* event work

* event stuff and experimenting with a lazy createHash

* cleanup crypto stuff i had on this branch

* finish event stuff up

* fix error monitor

* validate listeners are functions

* changes requested
2023-04-18 14:59:51 -07:00
dave caruso
76deb51c29 clarify file io docs (#2689) 2023-04-18 11:09:41 -07:00
Dylan Conway
5712fbd5b9 use properties length instead of capacity (#2687) 2023-04-18 04:13:04 -07:00
Jarred Sumner
b5b4356d52 Prepare for JavaScript Bundler API 2023-04-18 01:01:48 -07:00
Jarred Sumner
d1de291b2a Fix the extremely annoying ./ requirement in bun build 2023-04-18 01:01:31 -07:00
Jarred Sumner
af96e8fcdd Remove spin loop in bun build 2023-04-17 23:03:58 -07:00
Jarred Sumner
9e1745ee1f Fixes #2676 2023-04-17 20:07:08 -07:00
Jarred Sumner
05cb5bb659 Make bun dev CLI flags only show in --help for bun dev --help
This impacts:

--disable-bun.js
--disable-react-fast-refresh
--bunfile <STR>
--server-bunfile <STR>
--public-dir <STR>
--disable-hmr
--use <STR>
2023-04-17 19:20:39 -07:00
Jarred Sumner
dec5b07782 Fix template string folding bug 2023-04-17 18:01:38 -07:00
Jarred Sumner
b758779c49 Fix missing should_fold_typescript_constant_expressions 2023-04-17 17:33:21 -07:00
Jarred Sumner
3a63fe457d Fix DCE bug with new Foo() when pure without arguments 2023-04-17 17:16:57 -07:00
Dylan Conway
a17624942e make sure with is parsed as a block (#2680) 2023-04-17 15:54:02 -07:00
Dylan Conway
1ce60275d0 fix typescript decorators with index and number keys (#2677)
* handle index property key case

* non-method number property

* tests for property keys
2023-04-17 15:26:18 -07:00
Simon Legner
93a43c8fc1 docs: fix code block (#2662) 2023-04-17 13:01:08 -07:00
Jarred Sumner
bffe5e820b more 2023-04-17 08:01:03 -07:00
Jarred Sumner
983d9428a6 Get axios working (#2673)
* Revive node:http tests

* Fix a couple bugs in node:http

* possibly breaking: use `"browser"` exports condition last

* Make URL validation error better

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-17 07:13:01 -07:00
Jarred Sumner
fc539c278e cleanup 2023-04-17 05:47:20 -07:00
Jarred Sumner
d19005aa76 Fix access of inactive union field 2023-04-17 05:46:44 -07:00
Jarred Sumner
d2c64300f6 Fixup options parsing 2023-04-17 05:46:29 -07:00
Jarred Sumner
4cb739a8c5 enable minify syntax by default in the runtime 2023-04-17 03:56:52 -07:00
Jarred Sumner
01a03bcce4 Prepare for Bun.build 2023-04-17 03:56:38 -07:00
Jarred Sumner
6b758c809f Fix dynamic require() 2023-04-17 03:45:54 -07:00
Jarred Sumner
746940d21e Fixes #2634 2023-04-17 01:20:38 -07:00
Jarred Sumner
07b4b4ced0 Don't record named exports for deoptimized CJS 2023-04-17 01:18:05 -07:00
Jarred Sumner
e624dd6d4d Deoptimize CJS more 2023-04-17 00:54:03 -07:00
Jarred Sumner
ed2f24e409 Update bun.zig 2023-04-17 00:34:54 -07:00
Jarred Sumner
c650b0b848 bun build should write to stdout instead of stderr
@paperdave this probably breaks all your tests
2023-04-17 00:34:49 -07:00
Jarred Sumner
0514f59288 DCE for some global constructor calls 2023-04-17 00:32:21 -07:00
Jarred Sumner
5a8cfd8390 Deoptimize CJS -> ESM transform on computed property access of exports object
Example:
```js
for (var k in constants) {
    exports[k] = constants[k];
}
```
2023-04-17 00:30:40 -07:00
Jarred Sumner
a2d5e7c570 Update bundle_v2.zig 2023-04-16 23:42:45 -07:00
Jarred Sumner
af0a4c5638 Mark builtins as external for node and bun 2023-04-16 22:48:32 -07:00
Jarred Sumner
eec1a07907 Attempt to automatically handle some cyclical import issues with ESM
Fixes https://github.com/kysely-org/kysely/issues/412
2023-04-16 22:20:22 -07:00
Jarred Sumner
30b0d006fe Fix for ReferenceError: Cannot access uninitialized variable. 2023-04-16 21:49:33 -07:00
Jarred Sumner
413ce0c7a5 Add some comments 2023-04-16 21:04:07 -07:00
Jarred Sumner
c916a55ead Lazily wrap 2023-04-16 20:15:47 -07:00
Jarred Sumner
31319c0177 Add temporary fix 2023-04-16 19:31:45 -07:00
Jarred Sumner
255a805e00 Fix some edgecases with CJS -> ESM unwrapping 2023-04-16 19:31:45 -07:00
dave caruso
eff48cd95c more bundler tests (#2670)
* tests!

* run formatters
2023-04-16 18:57:56 -07:00
Jarred Sumner
338565eea4 Fix test 2023-04-16 07:33:30 -07:00
Jozef Steinhübl
264f3b91b6 fix: replace unknown link with bun docs (#2669) 2023-04-16 07:13:08 -07:00
Jarred Sumner
06dab241ef Unwrap, but we broke code splitting 2023-04-16 06:51:07 -07:00
Jarred Sumner
29cacb7da7 Update cli.zig 2023-04-16 01:56:37 -07:00
Jarred Sumner
e05cc8db90 prepare for unwrapping 2023-04-16 01:56:14 -07:00
Jarred Sumner
09357f55f9 Fix bugs with loading jsxDEV when it should be jsx or vice versa 2023-04-16 01:31:01 -07:00
Jarred Sumner
33049fa6fd Rename E.Require -> E.RequireString and E.RequireOrRequireResolve -> E.RequireResolveString 2023-04-16 01:30:01 -07:00
Jarred Sumner
be5d21a4f1 Delete some legacy bundling code 2023-04-15 18:45:29 -07:00
dave caruso
2dc3f4e030 more work on bundler tests (#2667)
* Fix `make dev` reusing old .o file

* more bundler tests

* document capture

* bundler tests

* bundler tests

* bundler tests

* finish up

* remove bad thing to merge on main
2023-04-15 18:28:21 -07:00
Colin McDonnell
1a7c3cdf3b Add .txt loader docs 2023-04-15 11:52:39 -07:00
Will Richards 2
f1f7369897 toBeFalsy expect counter and test scope check (#2661) 2023-04-15 08:52:46 -07:00
Jarred Sumner
4b3c483cd4 Handle more cases in length 2023-04-15 05:17:37 -07:00
Jarred Sumner
df88b998d6 Mostly implement cross-module constant inlining, but disable it
There are some test failures
2023-04-15 05:17:12 -07:00
Jarred Sumner
b687c3ab88 Implement template string folding
@paperdave can you help write tests for this if not already covered?

example:
```js
if (
  `${1}-${2}-${3}-${null}-${undefined}-${true}-${false}` === "1-2-3-null-undefined-true-false"
) {
  if (
    "\uD83D\uDE0B \uD83D\uDCCB \uD83D\uDC4C".length === 8 &&
    "😋📋👌".length === 6
  ) {
    console.log(`such fold. very inline. wow.`);
  }
}
```
2023-04-15 05:15:46 -07:00
Jarred Sumner
d4436f278c Fix failing to log error with --transform 2023-04-15 02:41:32 -07:00
Jarred Sumner
530f5ef82c Add error for assigning to a constant 2023-04-15 02:32:11 -07:00
Jarred Sumner
9e5efe61a3 Add unset function 2023-04-15 02:31:01 -07:00
Jarred Sumner
82b2c5221b Update bun.zig 2023-04-14 23:09:20 -07:00
Jarred Sumner
e977bfb5a7 Implement --transform CLI flag 2023-04-14 23:09:14 -07:00
Jarred Sumner
81e11ae586 Include the error return trace 2023-04-14 23:08:29 -07:00
Jarred Sumner
0d248568f6 Fix string concat 2023-04-14 23:08:17 -07:00
Jarred Sumner
96d522a7db +6 more passing tests 2023-04-14 22:09:48 -07:00
Jarred Sumner
b4989a316b Support importing .txt files as strings (#2660)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-14 17:45:16 -07:00
Jarred Sumner
8b897e1a6b Fix bug with mjs 2023-04-14 04:16:38 -07:00
Kruithne
730074b75d [nit] minor typo in tcp.md (#2657) 2023-04-14 04:00:02 -07:00
Jarred Sumner
f6a4516d66 Upgrade Zig (#2656)
* Upgrade Zig

* Don't add `d` files in github actions

* Revert "Don't add `d` files in github actions"

This reverts commit 446e2dd674.

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-14 03:58:38 -07:00
Jarred Sumner
6c69c2b364 Implement @bun annotation 2023-04-14 03:44:41 -07:00
Jarred Sumner
ba057e50c3 Update bun.zig 2023-04-14 03:12:40 -07:00
Jarred Sumner
1e6dcef0c5 fixup pragma parsing 2023-04-14 03:12:33 -07:00
Jarred Sumner
889462a891 Support @jsx, @jsxRuntime, @jsxImportSource, and @jsxFragment pragmas (#2655)
* Support parsing @pragma comments

* Support `@jsx`, `@jsxRuntime`, `@jsxImportSource`, `@jsxFragment`

* Fix bug where NODE_ENV would be development in certain places and production in others

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-14 01:49:29 -07:00
dave caruso
3a2fd65f20 use a lazyily initialized stream for node:crypto createHash (#2652)
* lazy hash

* finish up crypto stuff

* remove lockfiles

* ok

* add pipe test

* update this lockfile

* remove unrelated crypto benchmark from this file
2023-04-13 21:55:01 -07:00
Colin McDonnell
267a38f6fc Remove Bun.dns docs 2023-04-13 18:32:22 -07:00
Colin McDonnell
011e157cac Docs restructuring (#2638)
* Restructure

* Update nav

* Reorg

* Reshuffle ecosystem pages

* Split up runtime/runtime

* Back to runtime/index

* Fix issue

* Split up runtime/index

* Add Writing Tests page

* Prettier matcher table

* More updates
2023-04-13 18:26:45 -07:00
Jarred Sumner
0cc56e8efc Update default.test.ts 2023-04-13 18:02:49 -07:00
Jarred Sumner
54ef58db48 Fix default/ReExportDefaultExternalES6 2023-04-13 18:00:39 -07:00
Dylan Conway
476ab24081 fix ambiguous import (#2654)
* check all files before

* better error/warning

* update todo
2023-04-13 17:41:07 -07:00
Jarred Sumner
8a2545a172 Fix default/ReExportCommonJSAsES6 2023-04-13 17:00:24 -07:00
Jarred Sumner
e9016415bc Only set is_web_browser_navigation in debug mode server 2023-04-13 16:33:11 -07:00
Dylan Conway
242aa0be12 Update import-meta.test.js 2023-04-13 16:03:11 -07:00
Ciro Spaciari
041231d7ca fix node-net-test hang (#2649)
* fix tests

* fix fmt

* fix fmt
2023-04-13 15:14:58 -07:00
Ciro Spaciari
bee743fd61 fix(server) fixes UAF of uWS headers (#2648)
* fixes UAF of uWS headers

* fix transfer encoding condition
2023-04-13 15:14:34 -07:00
Jarred Sumner
d7a8037899 Fixes #2645 2023-04-13 14:42:35 -07:00
Nilan Marktanner
d226a054ae Update development.md (#2647) 2023-04-13 09:07:44 -07:00
Jarred Sumner
aeb3bb949b Upgrade WebKit (#2643)
* Missing export

* Regenerate builtins

* Fix crash in require()

* Various breaking JSC changes

* hopefully speed up C++ compilation a little

* Skip failing test fo rnow

* Update WebKit

* Add a comment

* Fix error in postinstall

* Update WebKit

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-13 04:11:12 -07:00
Dylan Conway
db15a23a63 import file path and fix disabled browser require (#2642)
* print disabled `require`

* bundle file paths

* update tests
2023-04-13 00:20:59 -07:00
dave caruso
1cc4eb0e3f fix expectBundled precheck (#2641) 2023-04-12 19:30:55 -07:00
Dylan Conway
a03ee18262 fix bundling many entry points (#2640)
* fix going out of bounds when length is over 8

* remove
2023-04-12 19:25:39 -07:00
Ciro Spaciari
108c54134c fix types and add more reliable tests (#2621) 2023-04-12 18:41:40 -07:00
dave caruso
73216b10ce bundler tests (#2635) 2023-04-12 18:41:04 -07:00
Dylan Conway
ff5c522712 bundler bug fixes (#2637)
* append import to outer wrapper prefix

* print space

* require text loader

* import empty esm and cjs

* add text to schema
2023-04-12 18:40:21 -07:00
hiroki osame
14f87156a2 fix(fs): remove readfile (#2630) 2023-04-12 18:40:02 -07:00
Dylan Conway
d8d4abb58e don't increment i if escaped (#2639) 2023-04-12 17:42:56 -07:00
Dylan Conway
4b9b648f8a could include /private/ on macos 2023-04-12 15:22:04 -07:00
dave caruso
519f9aac80 finish refining bundler tests (#2623)
* bundler tests

* test refining, 257/847

* bundler tests, 298/849

* more bundler tests

* finish dce
2023-04-11 18:18:49 -07:00
Ryan Morey
a744f5369d Update development.md (#2625)
* Update development.md

adds the `bash` language specifier to `which clang-15` so that when you click the copy button, it doesn't include the `$`

* Update development.md

* Update development.md

* Update development.md
2023-04-11 13:19:24 -07:00
hiroki osame
14c6023e15 docs: remove dev container section (#2610) 2023-04-11 01:52:54 -07:00
Ciro Spaciari
f91dc8c0d3 always safe deinit socket context (#2611) 2023-04-10 15:05:16 -07:00
Dylan Conway
f4ab79d6bb add original name to list (#2613) 2023-04-10 15:03:27 -07:00
Jarred Sumner
373248ce9c Implement TOML & JSON support in Bun's new bundler (#2609)
* Implement JSON & TOML support in the bundler

* Fix failing to bind namespace imports

* Support namespace exports better

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-10 06:35:41 -07:00
Jarred Sumner
5c37d0f2a5 Parse import attributes
https://github.com/tc39/proposal-import-attributes#import-attributes
2023-04-09 07:49:08 -07:00
Jarred Sumner
7bd6a1f86d Remove usages of void{} in favor of {}
See https://github.com/ziglang/zig/issues/15213
2023-04-09 05:39:05 -07:00
Jarred Sumner
1e717dd941 Add some test coverage for instantiation expressions
Related to #2203
2023-04-09 05:07:44 -07:00
Jarred Sumner
e9d6a4042f Fix another case with instantiation expressions
Related to #2203
2023-04-09 05:07:28 -07:00
Jarred Sumner
c97cb4ec1e Lower for-in variable initializers 2023-04-09 05:07:07 -07:00
Jarred Sumner
21acc50d88 Fixes #2594 (#2600)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-09 03:43:04 -07:00
Jarred Sumner
b34f0da499 Fixes #2599 2023-04-09 03:18:26 -07:00
Jarred Sumner
eb18101d84 Update TypeScript parsing to 5.0 (#2593)
* update syntax

* seems to work, needs tests

* This test wasn't supposed to be added

* Many bugfixes to TypeScript parser

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-09 03:16:11 -07:00
dave caruso
2117723642 Fix callout tag on development docs (#2595)
* fix callout tag on development docs

* add notes on cmakeconfig.h

* Update Makefile
2023-04-08 20:05:05 -07:00
dave caruso
461ae27d31 Rewrite Developer Docs, Improve DX for new users, moving away from Devcontainer (#2588)
* new docs starting point. missing alot of information

* very experimental idea: make setup

* run on ubuntu 20

* builds on ubuntu 20 (wsl) now

* add release instructions

* add valgrind note from jarred/new-bundler branch, just in case it gets lost when rebasing

* changes requested
2023-04-08 02:23:11 -07:00
Jarred Sumner
ba7a8a9cb5 Fix node: prefix when --platform=node 2023-04-07 23:15:19 -07:00
Jarred Sumner
c764543af5 Fix sort 2023-04-07 22:33:33 -07:00
Jarred Sumner
60fc80d4c4 Workaround crash
https://github.com/ziglang/zig/issues/15204
2023-04-07 22:12:19 -07:00
Jarred Sumner
6362414d65 Bun gets a new bundler (#2312)
* alright now just gotta try running it

* fix a gajillion compiler errors

* even more code

* okay i fixed more errors

* wip

* Update launch.json

* Update string_builder.zig

* `fast_debug_build_mode` makes debug build 2x faster

* Update bundle_v2.zig

* more code!

* It bundles!

* Rename `Bun.Transpiler` to `Bun.Bundler`

* `import()` expressions almost work

* wip attempt to get import() expr to work

* Bundle namespace imports

* Attempt to fix the issue with import() unsuccessfully

* consider current working directory when resolving relative paths (#2313)

* consider current working directory when resolving relative paths

fixes #2298

* comment test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>

* support `expect().toThrow(/pattern/)` (#2314)

- fix time-zone-dependent test failure

* fix missing `Blob` error messages on Linux (#2315)

* fix & clean up tests (#2318)

- skip flaky tests when running as `root`
- use `expect().toThrow()`
- clean up temporary files after tests

* feat(tty): add some `tty.WriteStream` methods to `process.{stdout, stderr}` (#2320)

* feat(stdio): add some `tty.WriteStream` methods

* chore(builtins): add process builtin gen'd code

* Fix docker install command

* `bun test` on macOS in GitHub Actions (#2322)

* Fixes #2323

* throw invalid parameter errors in `crypto.scryptSync` (#2331)

* throw invalid parameter errors

* remove comptime, add empty buffer function

* remove error_name comptime

* Add reference documentation for bun:test (#2327)

* Reorganize tests (#2332)

* Fix html-rewriter.test.js

* fix the wrong thing being incremented in hmr example (#2334)

* Add more test harness

* Improve Benchmarking page, small fixes (#2339)

* Improve benchmarking page

* WIP

* Add typescript instructions to hot

* Document preload in Plugins. Fix loader in plugin types.

* Fix typo

* Fix links

* run prettier

* Document openInEditor

* improve `Buffer` compatibility with Node.js (#2341)

* improve `Buffer` compatibility with Node.js

* use `memmove()`
allow `encoding` to be `undefined`

* run `bun test` after macOS builds (#2343)

* "binary" is an alias of "latin1"

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

* More spec compliant `Blob.prototype.type` (#2340)

* Make `Blob.prototype. type` more spec compliant

* Add a few more checks for isNumber()

* Fix `make headers`

* Safer JSValue.isString()

* More tests for blob.slice

* Make `Blob.prototype.type` more spec compliant

* Add isASCII check

* Fix types

* Fix failing type test

* Update blob.zig

* Update blob.zig

* Fix .eql check on empty values

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>

* Fix bug in test runner

* Support `import()` expressions

* Implement `require()`

* clean up bit_set.zig slightly

* Move some things around

* misc cleanup

* Cleanup some things

* Fix a lot of stuff

* Fix `module.exports.fn = fn;` in ESM entry point

* Fix crash due when printing file

* Fix issue with class names

* Fix issue with `export default identifier`

* Update js_parser.zig

* optimization: inline single-property object acceses and arrays

* Fix undefined memory in renamed symbols list

* Handle call target

* wip

* Inline it

* Fix undefined memory issue when reclaiming blocks in ast

* Halt linking on any parse errors

* alias

* Rename `enable_bundling` to `enable_legacy_bundling`

* Workaround anonymous struct literal zig bug

* Use slower approach (without bitset) because it doesn't break after 8 symbols

* Fix incorrectly-renaming statically defined symbols

* Handle more edgecases in our bit_set fork

* Reduce number of allocations for `define`

* Do not rename unbound symbols

* Clean up dot defines a little more

* Make the generated names prettier

* Workaround runtime symbol missing issue

* Fail the build on errors

* Support export * from

* Support `--outfile`

* partially fix renaming

* fanicer symbol renaming impl

* misc, extremely revertible cleanup

* Fix up some bugs with symbol renaming

* formatting

* Update launch.json

* Parse `__PURE__` comments

* clean up simd code for pure comments

* changes to merge

* workaround runtime issue

* Fix issue with `export * as` not propagating correctly

* Make all top-level declarations `var` when bundling

* Fix missing prefix

* Fix assigning to stack copy

* Fix missing runtime symbol

* Fix bug with namespace exports

* Dramatically reduce allocations

* Update launch.json

* Add missing flags

* Update js_parser.zig

* small cleanup

* Make the export name better

* Fix unnecessary `var foo = foo`

* Implement CommonJS -> ESM conversion

* Implement module redirects

* Port esbuild bundler tests for new bundler (#2380)

* started porting esbuild tests

* clean up test names and api before moving on

* port tests using a program i wrote

* replace todo generated comment

* fix generated tests not including some files

* work on tests

* [github web editor] add define, external, inject, minifySyntax, minifyWhitespace options.

* get most of the todo comments out of the way, but expectBundled does not handle most of the cases

* continue working on esbuild tests

* use test.skip for unsupported tests

* Fixups for test runner

* Hoist imports & exports

* Fix test

* Hoist classes

* bundler test refining, 51/835

* Fix runtime require

* bundler test refining, 81/835

* bundler test refining, 93/835

* Make the test work in any timezone

* feat(expect): update toBeInstanceOf (#2396)

* feat: update instanceof binding

* fix: according to PR comments

* Rename `expectObjectTypeCount` to `expectMaxObjectTypeCount`

* Fix socket tests with connection errors (#2403)

* release pending activity with connection error handler

* unref poll_ref

* remove trailing comma

* Organize Dockerfiles for official status

* Remove test Dockerfile

* Remove old Docker workflow

* Feat(test): add toMatch (#2404)

* Fix various fetch/response/request tests (#2416)

* fix most fetch tests, skip a few

* fastGet, toValueGC, and invalid init

* bigint unreachable, range error, log process as process

* remove extra fetch_headers

* remove js_type parameter, check isObject()

* throw invalid mime type error, use enum literal

* switch back to promise rejection

* RangeError pascal case

* Fix several bugs (#2418)

* utf16 codepoint with replacement character

* Fix test failure with `TextEncoder("ascii')`

* Add missing type

* Fix Response.prototype.bodyUsed and Request.prototype.bodyUsed

* Fix bug with scrypt error not clearing

* Update server.zig

* oopsie

* 💅

* docs: Use correct url in the 'Issues' link in README header (#2420)

* Fix crash when rendering error page and the server or network is slow

* [fetch] Make the default body value `null` when unspecified

This is better aligned with the fetch spec

* Make node-net tests less flaky

* [node:net] Fix issue with `listen` callback firing before it's listening

* Always clear timers in node test harness

* Fix out of bounds access

Repro'd in Buffer tests

* Update UWS

cc @cirospaciari

* Make this test more thorough

* Hanging abort test

* 0 length body is a null stream

* Several bug fixes (#2427)

* Fix test

* Fix segfault when unexpected type is passed in `expect().toThrow`

* Fix issues with request constructor

* Don't bother cloning headers when its empty

* woops

* more tests

* fix incorrect test

* Make the fetch error messages better

* Update response.zig

* Fix test that failed on macOS

* Fix test

* Remove extra hash table lookups

* Support running dummy registry directly

cc @alexlamsl

* Update test

* Update test

* fixup

* Workaround crash in test runner

* Fixup test

* Fixup test

* Update os.test.js

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>

* Remove usages of port numbers in tests

* Set -O2 and -fno-rtti

* Remove -g

* Prevent undefined memory access

* [bun test] Implement `--rerun-each` flag to run each test N times

* Reduce number of module scopes created

* add some extra abort checks into streams (#2430)

* add some checks to avoid UAF

* avoid multiple calls to finalize if endFromJS is called more than once

* fix no-op comment

* mark as requested_end on abort

* remove requested_end from abort

* remove unnecessary check (#2432)

* Fix bug with scoped aliased dependencies in bun install on macOS

* remove `addLog`, remove `--prominent-compile-errors`

* Finish the upgrade

* Optional chaining flag

* Implement same_target_becomes_destructuring optimization

* bundler test refining, 109/835

* Reset bindings

* Support multiple entry points

* Implement `--entry-names` flag

* Use a tempdir with a better name

* prettier

* Log file name

* Update js_parser.zig

* Mark all bun builtins as external

* Make resolve errors actually errors

* Update bundler_default.test.ts

* Fix `await import(foo)`

* WIP react server components

* Do more stuff at runtime

* ✂️

* Support automatic JSX imports

* Use a module cache for now

* Update tsconfig.base.json

* Fix ThisOutsideFunctionNotRenamed

* woopsie

* moar cpu

* clamp it

* fixup

* Add a bunch of assertions

* Bun uses automatic runtime by default

* Parse Import Attributes

* Add a note about Valgrind

* Update developing.md

* Fix up code splitting for React Server Components

* Implement client component manifest

* Fix crash with --react-server-components and no client components

* Backport 4d31e3c917

* Update launch.json

* Fix for latest zig

* Workaround bug with ?[]const string

Occasionally saw alignment errors in this code

Workaround https://github.com/ziglang/zig/issues/15085

related: https://github.com/ziglang/zig/pull/15089

* switch to regular slice

* Avoid initializing named_imports and named_exports as undefined

* Reduce usages of `undefined`

* Add more assertions

* --watch wip

* Update javascript.zig

* Possibly fix the race condition

* Faster `do`

* bump allocator

* Reduce the size of `Symbol` slightly

* Alphabetically sort runtime import symbols, for determinism

* Prepare for code splitting

* handle overlapping stdout

* pure

* clean up some things

* Fix bug with `$$typeof`

* Address CommonJS -> ESM hoisting bug

* Support `"use server"` in manifest

* Implement `"use server"`

* Fix importing bun builtins when bundling

* Make `commonjs_to_esm` a feature flag, fix some splitting bugs

* ✂️

* fixme remove this

* Fix crash in longestCommonPath

* Chunking! Just need to do import paths now.

* Import paths work...now trying to figure out how to make runtime symbols work

* add workaround

* Replace `bun bun` with `bun build`

* Fix crash with dual package hazard

* Fix many CommonJS <> ESM interop bugs

* Support package.json `"sideEffects"`

also skip loading unnecessary package.json data in `bun run`

* add a not good --watch implementation

* bundler test refining, 140/831

* remove accidentally committed file

* do not return status code 1 on successful bundles

* bundler test refining, 159/830

* pass exit code to exitOrWatch

* clean up help menu

-remove two spaces to line up bun build
-moved all <r> tags to the end of the text they are colorizing
-moved other colors to the start of the text they colorize
-removed unneeded <r> tags, keeping only one at the start of the block

* importstar is fully ported

* wip

* you can run code in this branch now

* Disable this transform

* organize and document bundler tests

* Fix double import

* Fix sloppy mode function declarations

* Disable our CommonJS transform for now

* add `assertNotPresent` to make splitting cases easier

* Bump!

* Update bun.d.ts

* use import.meta.require in runtime code

* Disable this again

* Fix dirname

* Fix ESM -> CJS wrapper

* 💅

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Alex Lam S.L <alexlamsl@gmail.com>
Co-authored-by: Derrick Farris <mr.dcfarris@gmail.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: pfg <pfg@pfg.pw>
Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: zhiyuan <32867472+zhiyuang@users.noreply.github.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Kamil Ogórek <kamil.ogorek@gmail.com>
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2023-04-07 20:08:01 -07:00
Ashcon Partovi
c0c5f07218 Fix trailing slash bug in upload script 2023-04-07 16:05:47 -07:00
Ashcon Partovi
0a91dd9f71 Fix environment variables in workflow 2023-04-07 15:42:41 -07:00
Ashcon Partovi
bed56ab406 Upload releases to S3 2023-04-07 15:38:38 -07:00
Jake Boone
4978a6b74d Add TSConfig object type to TranspilerOptions interface (#2545) 2023-04-07 15:16:21 -07:00
hiroki osame
35b279a4bb chore: simplify prettier command and cache (#2589) 2023-04-07 09:11:23 -07:00
Colin McDonnell
c8e09f563f FileBlob -> BunFile, add BunFile.lastModified (#2581)
* Improve BunPlugin types

* FileBlob -> BunFile

* Update Bun.env types. Fixes #2481

* Add lastModified to BunFile
2023-04-07 04:03:06 -07:00
Ciro Spaciari
6baedd27bc feat(tls.Server) basic support (cert, key, rejectUnauthorized, requestCert, ca) #2412 (#2552)
* cherry picked

* add StringOrBuffer parameter

* Format and adds types

* update uws

* fix tests

* more types

* fix typing

* add timeouts, clean some stuff

* move tests to describe

* fixes SSL hostname when Host is provided

* cleanup on tests

* change 127.0.0.1 to 0.0.0.0

* try another listening parameter

* test timings and update uws

* remove unnecessary comment

* move listening event around

* always await Bun.connect

* do not fail if the tests already passed when using Bun.connect

* regenerate classes

* undo generated classes

* generate classes

* fix merge

---------

Co-authored-by: cirospaciari <cirospaciari@MiWiFi-RA82-srv.cirospaciari>
2023-04-07 04:02:05 -07:00
Jarred Sumner
5465a3980a Proactively add these to the list 2023-04-06 19:30:50 -07:00
Jarred Sumner
b6bd7e24d7 Bump 2023-04-06 19:30:38 -07:00
dave caruso
e4e81bc49e fix: export constants from fs/promises (#2567)
* fix: export `constants` from `fs/promises`

* fix type tests

* third time's the charm fixing the typedef

* run fmt

* remove injected constant from fs, re-exporting from fs/promises
2023-04-06 15:55:23 -07:00
dave caruso
b8aca35b76 docs: add a section on uninstalling bun (#2560) 2023-04-06 15:12:59 -07:00
Jozef Steinhübl
68670eeb7b docs(cli/bunx): add notice (#2574)
* docs(cli/bunx): add notice bunx alias bun x

* docs: grammar
2023-04-06 15:09:20 -07:00
Dylan Conway
2b170c9d13 Fix toEqual when the second array has extra array holes (#2580)
* iterate through remaining indexes, keep prop identifier

* tests

* format
2023-04-06 14:49:07 -07:00
Zhongwei Yao
1d138057cb Add last modify field "mtime" for FileBlob (#1431) (#2491)
* Add lastModified field for FileBlob (#1431)

lastModified value is epoch timestamp in millisecond unit.

* update according to review comment.
2023-04-06 14:01:49 -07:00
dave caruso
f788519263 bun-types: infer strict Subprocess from Bun.spawn() options, part 2 (#2573) 2023-04-06 13:59:06 -07:00
Dylan Conway
8a73c2a453 cache needs to update, move to another process (#2578) 2023-04-06 13:58:01 -07:00
hiroki osame
21978dabe5 fix(ws): export Server (#2575) 2023-04-06 04:18:17 -07:00
hiroki osame
aa4c4a9b22 docs(CONTRIBUTING): referece development guide (#2576) 2023-04-06 04:18:02 -07:00
dave caruso
569d4940bb rebase (#1501) 2023-04-05 19:15:06 -07:00
Colin McDonnell
4af78c7d5a Update typecheck (#2572)
* Update typecheck

* Test ci

* Test ci

* Prettify files
2023-04-05 18:31:13 -07:00
Jarred Sumner
cfb1c661d5 prepend 2023-04-05 18:29:41 -07:00
Jake Boone
864302a634 Add tests for bun test with preload scripts (#2566)
* Use zsh-compatible syntax in cowsay example

zsh interprets the string !" differently than bash or sh, but we can use single quotes in all of them. See https://unix.stackexchange.com/a/497335/548905.

* Add tests for bun:test with preload scripts

* Look at `stderr` in `bun test --preload` tests
2023-04-05 18:28:41 -07:00
Jarred Sumner
b50f3d3f6f Disable buffering when we clear terminal
hopefully fixes an issue reported in Discord
2023-04-05 18:27:43 -07:00
Jarred Sumner
65d646bc68 Prettier 2023-04-05 18:27:02 -07:00
Ciro Spaciari
d8c467be42 fix(fetch.proxy) fix proxy authentication (#2554)
* fix proxy authentication

* add auth tests

* remove unused
2023-04-05 17:48:18 -07:00
hiroki osame
fd680d6c1d fix: build warnings (#2562) 2023-04-05 17:38:47 -07:00
Lawlzer
f7d0eee0ac In Documentation, move --watch before the script name (#2569)
Related message by Jarred: https://discord.com/channels/876711213126520882/876711213126520885/1093286199369682944
If you put `--watch` after the script name, it will not work.
2023-04-05 15:02:08 -07:00
Dylan Conway
ac092a1e04 fix deepEquals with array holes and accessors (#2557)
* `deepEqual` handles slow array indexes

* another test

* oops

* remove bad test

* compare indexes in non-strict mode

* more tests
2023-04-05 13:39:51 -07:00
hiroki osame
fd5bb6b201 fix: modules to have null prototype (#2561) 2023-04-05 00:31:58 -07:00
Jarred Sumner
d8360ab3cf 🕐 🕑 🕒 2023-04-04 16:50:03 -07:00
Jarred Sumner
a369fc8c89 Implement import.meta.main (#2556)
* Implement `import.meta.main`

* Update main-test-1.js

* Update fs.test.ts

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-04 16:49:33 -07:00
Jarred Sumner
54d6f95f43 Dylan/fix some failing tests (#2544)
* handle `umask()` invalid arguments

* move `bktree-fast` to test root, fix postinstall

* fix fs test

* could be baseline

* handle different timezones

* accidentally deleted tests

* fix hang in `AbortSignal.timeout`

* bring abort tests back

* Revert "bring abort tests back"

This reverts commit 0ff2ad5bf4.

* bunx node-gyp

* bun x

* fix typecheck

* test

* Update inspect.test.js

---------

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-04-04 16:47:57 -07:00
Colin McDonnell
76adc5be8a Add npm benchmark (#2555)
* Add install bench

* Update scripts and readme

* remove lockfiles

* Format bench

* Add dev instructions
2023-04-04 16:26:40 -07:00
Jarred Sumner
f3ab445c3f Use absolute paths more 2023-04-03 18:12:51 -07:00
Jarred Sumner
ae849528b8 Fix test failure 2023-04-03 18:11:14 -07:00
Colin McDonnell
6a66fffd39 Add rfcs under docs dir 2023-04-03 17:06:40 -07:00
Alex Lam S.L
9b0f12883c [install] reduce parallel HTTP requests under heavy load (#2536)
* [install] reduce parallel HTTP requests under heavy load

* make `max_simultaneous_requests` atomic
2023-04-02 22:32:19 -07:00
Jarred Sumner
fcd8b82864 Add stubs for missing node builtins (#2534)
* Stub `node:v8`

* Stub `node:trace_events`

* Stub `node:repl`

* Stub `node:inspector`

* Stub `node:http2`

* Stub `node:diagnostics_channel`

* Stub `node:dgram`

* Stub `node:cluster`

* Link stubs

* cleanup

* Clean up the test

* Implement `node:vm` stub

* Cleanup `v8` module stub

* Add missing `promises` export to node:stream

* Implement `node:stream/promise`

* Implement `node:assert/strict`

* cleanup

* better errors

* Increaase timeout

* Update inspector.exports.js

* Make the version consistent

* Implement `process.binding("constants")`

* Update runner.node.mjs

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-01 21:13:27 -07:00
Jake Boone
63d138b046 Update NodeJS LTS version in run_command.zig (#2533) 2023-04-01 17:49:56 -07:00
Dylan Conway
8904398619 remove debug symbols (#2527) 2023-03-31 19:20:11 -07:00
Alex Lam S.L
685e298146 report timed-out test as failure (#2523) 2023-03-31 07:14:55 -07:00
Alex Lam S.L
74cacffb0c [install] fix stale pointer with tarball URLs (#2520)
* [install] fix stale pointer with tarball URLs

fixes #2512

* `alloc()` & `free()` instead of fixed-size buffer
2023-03-30 21:54:56 -07:00
Alex Lam S.L
977446ef3c [install] fix re-install of git dependency (#2519)
- add tests for re-install of npm alias & GitHub URL
2023-03-30 19:50:23 -07:00
Dylan Conway
1fa7c1f79e Generate dependency files in make bindings (#2510)
* generate dependency files, include in makefile

* move `make webcrypto` to `make bindings`

* update more references to `make webcrypto`

* remove `-lwebcrypto`
2023-03-30 19:34:20 -07:00
Alex Lam S.L
758daa7367 [install] fix re-run of tarball URL from lockfile (#2507) 2023-03-29 20:38:19 -07:00
Adrien Zinger
95cb2b2ac2 Fix date format (#2422) (#2474)
* Fix date format (#2422)

* Add unit tests for #2422
2023-03-29 17:41:11 -07:00
Colin McDonnell
b0e0853360 Update vscode auto save mention 2023-03-29 17:27:13 -07:00
Colin McDonnell
f16995910a Update vscode auto save mention 2023-03-29 17:26:52 -07:00
Colin McDonnell
b2f3dbfd43 Typo 2023-03-29 17:12:06 -07:00
Niles Salter
9f07073074 Fix some lockfile creation issues (#2506) 2023-03-29 17:10:44 -07:00
Colin McDonnell
546f78a49e Update --watch docs 2023-03-29 17:02:16 -07:00
Jarred Sumner
767fdfbb97 Fixes #2499 (#2501)
* Fixes #2499

* This needs to be quoted

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-29 09:37:15 -03:00
Jarred Sumner
f0def8c770 Add doc on watch mode (#2502)
* Add doc on watch mode

* Update hot.md

* Update hot.md

* More words

* Update hot.md

* Update hot.md

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-28 23:26:43 -07:00
Jarred Sumner
786475ff58 bun --watch and bun test --watch (#2500)
* --watch wip

* Upgrade for latest zig

* Implement `bun --watch`

* Implement `bun test --watch`

* Auto restart on crash in --watch

* 🕐 🕑 🕒 🕞

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-28 21:28:35 -07:00
Jarred Sumner
b76384351c More bug fixes (#2486)
* readline_promises test fix

* fix `escapeHTML` for baseline builds

* fs test fixes, use `tmpdir()`

* add paths for `resolve.test.js`

* isError with toString symbol and error prototype

* comment about `toString`

* skip async macro transform

* test cleanup, skip stack format test

* readline undo and redo fix

* capture error from readline keypress

* Update tcp-server.test.ts

* use `removefileat` for recursive rmdir

* use strong for `signal.reason`

* initialize `m_flags`

* directory with file fs test

* recursive option

* import expect

* could be less than

* move abort signal tests to another process

* fix typecheck

---------

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-03-28 18:23:50 -07:00
Alex Lam S.L
0a91490226 [install] support tarball URLs (#2497)
closes #2448
2023-03-28 13:45:00 -07:00
Ashcon Partovi
93585291f9 Sign canary release before Docker release 2023-03-28 12:06:22 -07:00
Ashcon Partovi
de46ad23e5 Fix BUN_VERSION in bun-release 2023-03-28 12:03:25 -07:00
Ashcon Partovi
f455845a0a Fix BUN_VERSION in bun-release-canary 2023-03-28 12:01:06 -07:00
Andres Beltran
d5418052b1 Remove extra 's' on keep (#2498) 2023-03-28 09:37:46 -07:00
Jarred Sumner
cfceb26edd Fix for latest zig (#2495)
* Fix for latest zig

* Revert "Use PATH instead of sudo to install bun for testing (#2460)"

This reverts commit 5fd406ca2f.

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-27 18:22:13 -07:00
Ciro Spaciari
b2d90f07ba fix https default port on http.request (#2490)
* fix https default port on http.request

* Update http.exports.js
2023-03-26 22:45:52 -05:00
Alex Lam S.L
319efe9c7b [install] fix tests (#2488)
- avoid creating spurious directories next to test scripts
2023-03-25 21:51:03 -07:00
Jarred Sumner
52d27659a2 Fixes #2462 (#2463) 2023-03-23 15:49:42 +02:00
Derrick Farris
732c5e7fa9 test(undici): rm external http reqs from tests (#2459)
* test(undici): rm external http reqs from tests

* cleanup(http-test-server): remove finished TODOs

* test(undici): fix server type, remove type:module to fix typings in test dir

* test(undici): make the typings better

* test(undici): fix typo
2023-03-22 21:22:31 -07:00
Josh Soref
5fd406ca2f Use PATH instead of sudo to install bun for testing (#2460) 2023-03-22 21:21:57 -07:00
Dylan Conway
31c2fea74a A couple bug fixes (#2458)
* fix valid status code range

* update path

* highwatermark option

* throw DOMException

* remove extra transpiler output

* more transpiler tests

* comment

* get index not quickly

* replace with `getDirectIndex`

* update abort test

* throw out of range status code

* promisify test fix

* move stdio test instance files

* working crypto tests

* allow duplicate set-cookie headers

* different formatting

* revert, fix will be in different pr

* it is called

* use min buffer size

* fix url tests

* null origin for other protocols

* remove overload

* add very large file test

* await

* coerce to int64

* 64

* no cast

* add todo blob url tests

* use `tryConvertToInt52`
2023-03-22 18:09:51 -07:00
Colin McDonnell
a5f92224b5 Fix types (#2453)
* WIP

* WIP

* WIP

* WIP

* Improve typechecking in type files

* Fix typechecking

* Update

* Update submodule

* CI for typechecking

* Add ci

* Update commands

* Format after build

* Dont use bunx

* Rename job

* Use nodemodules prettier

* Update workflow

* Use symlink

* Debug

* Debug

* Clean up and rename jobs
2023-03-22 15:01:01 -07:00
Jarred Sumner
2bdaa81b1c Upgrade Mimalloc 2023-03-21 23:32:04 -07:00
Jarred Sumner
8b92469d42 Update build-id 2023-03-21 21:52:43 -07:00
Jarred Sumner
5915ab19fe Don't use function from bundler branch 2023-03-21 21:52:11 -07:00
Jarred Sumner
58a5c2a3aa Fix possible crash with export namespace ns { export class F {} } 2023-03-21 21:44:42 -07:00
Joker_
f3a91339fc Update sqlite.md (#2452)
Fix benchmark source pointing to wrong URL.
2023-03-21 18:51:31 -07:00
Igor Shevchenko
54b62aad05 Fix typo (#2446)
- fixed typo in the month name
2023-03-21 10:14:21 -07:00
Ján Gajdoš
15f23d70d6 docs: Buchta Docs Page (#2378)
* Idea: Buchta Docs Page

* Tweaks

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-03-20 21:32:20 -07:00
Colin McDonnell
42eff1d917 Add test-d files for eventemitter 2023-03-20 20:39:57 -07:00
Gaurish Sethia
02e5c5f795 Make event emitter type-safe (#2414)
* Add filePath property on MatchedRoute

* Fix #1880 #851

* Fix #1972 as well

* FMC

* Bump querystring-es3

* fix querystring status

* Fix typos in docs

* Make event-emitter by default type-safe

* Remove Makefile.save

* Resolve merge conflict

* Tweaks

---------

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-03-20 20:32:28 -07:00
John Reilly
2503b3409e docs: update moduleResolution to bundler (#2429)
* docs: update moduleResolution to bundler

* docs: bundler as well

* Updates

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-03-20 19:51:24 -07:00
jq170727
6539f66642 "bun-create" example "postinstall"→"preinstall" (#2441)
"postinstall" is listed twice in the example for the "bun-create" section of package.json.
Based on the context and content of the echo commands I believe the intent is that the
first "postinstall" should be "preinstall".  This change corrects this.
2023-03-20 17:49:55 -07:00
Jackson Kearl
4dd4bab7b9 Support directories in ZSH run completions (#2425)
* Support scripts in dirs in zsh run completions

* add back wasm support
2023-03-20 11:27:39 -07:00
jq170727
035183eb12 Fix example for "bun pm ls" (#2440) 2023-03-20 11:26:22 -07:00
Jarred Sumner
aaef99ab68 Update install.md 2023-03-20 06:20:16 -07:00
Jarred Sumner
1a25af5e3d Implement simple workspaces glob support in bun install (#2435)
* [bun install] Implement `packages/*`-style globs

* Fix incorrect assertion

* 💅

* remove extraneous console.log

* Fix pointer to stack memory

* Add a test with a scoped package name from a glob workspace

* Fixup

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-20 05:57:23 -07:00
Jarred Sumner
343721627e Finish the upgrade 2023-03-19 23:03:08 -07:00
Dylan Conway
6e0e140f2f remove addLog, remove --prominent-compile-errors 2023-03-19 23:03:00 -07:00
Jarred Sumner
0edd8d262d Fix bug with scoped aliased dependencies in bun install on macOS 2023-03-19 20:58:27 -07:00
Ciro Spaciari
76622e41d6 remove unnecessary check (#2432) 2023-03-19 20:09:13 -07:00
Ciro Spaciari
7aa297012b add some extra abort checks into streams (#2430)
* add some checks to avoid UAF

* avoid multiple calls to finalize if endFromJS is called more than once

* fix no-op comment

* mark as requested_end on abort

* remove requested_end from abort
2023-03-19 19:42:45 -07:00
Jarred Sumner
9443cca1bb Reduce number of module scopes created 2023-03-19 19:09:16 -07:00
Jarred Sumner
a83c5c996f [bun test] Implement --rerun-each flag to run each test N times 2023-03-19 19:07:56 -07:00
Jarred Sumner
b053dffca7 Prevent undefined memory access 2023-03-19 19:06:52 -07:00
Jarred Sumner
cb1b881746 Remove -g 2023-03-19 18:11:38 -07:00
Jarred Sumner
9679cdb12c Set -O2 and -fno-rtti 2023-03-19 18:08:46 -07:00
Jarred Sumner
9ce18245d1 Remove usages of port numbers in tests 2023-03-19 16:51:13 -07:00
Jarred Sumner
5a23d17620 Several bug fixes (#2427)
* Fix test

* Fix segfault when unexpected type is passed in `expect().toThrow`

* Fix issues with request constructor

* Don't bother cloning headers when its empty

* woops

* more tests

* fix incorrect test

* Make the fetch error messages better

* Update response.zig

* Fix test that failed on macOS

* Fix test

* Remove extra hash table lookups

* Support running dummy registry directly

cc @alexlamsl

* Update test

* Update test

* fixup

* Workaround crash in test runner

* Fixup test

* Fixup test

* Update os.test.js

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-19 14:08:20 -07:00
Jarred Sumner
8f02ef8294 0 length body is a null stream 2023-03-18 18:03:05 -07:00
Jarred Sumner
e41e884747 Hanging abort test 2023-03-18 17:55:05 -07:00
Jarred Sumner
1b7423412a Make this test more thorough 2023-03-18 16:58:15 -07:00
Jarred Sumner
41c4a66e4a Update UWS
cc @cirospaciari
2023-03-18 16:58:04 -07:00
Jarred Sumner
7216bfe016 Fix out of bounds access
Repro'd in Buffer tests
2023-03-18 16:57:55 -07:00
Jarred Sumner
1c85e94977 Always clear timers in node test harness 2023-03-18 16:36:40 -07:00
Jarred Sumner
25097cd632 [node:net] Fix issue with listen callback firing before it's listening 2023-03-18 16:36:19 -07:00
Jarred Sumner
d9711c64eb Make node-net tests less flaky 2023-03-18 16:35:49 -07:00
Jarred Sumner
96fcecdcc9 [fetch] Make the default body value null when unspecified
This is better aligned with the fetch spec
2023-03-18 16:15:21 -07:00
Jarred Sumner
12c4ed89e3 Fix crash when rendering error page and the server or network is slow 2023-03-18 15:53:19 -07:00
Kamil Ogórek
f1cfa5dfeb docs: Use correct url in the 'Issues' link in README header (#2420) 2023-03-18 03:10:31 -07:00
Dylan Conway
dd9ebe9c50 💅 2023-03-18 00:57:38 -07:00
Dylan Conway
a9c41c67e6 Fix several bugs (#2418)
* utf16 codepoint with replacement character

* Fix test failure with `TextEncoder("ascii')`

* Add missing type

* Fix Response.prototype.bodyUsed and Request.prototype.bodyUsed

* Fix bug with scrypt error not clearing

* Update server.zig

* oopsie
2023-03-18 00:55:05 -07:00
Dylan Conway
1d4cc63154 Fix various fetch/response/request tests (#2416)
* fix most fetch tests, skip a few

* fastGet, toValueGC, and invalid init

* bigint unreachable, range error, log process as process

* remove extra fetch_headers

* remove js_type parameter, check isObject()

* throw invalid mime type error, use enum literal

* switch back to promise rejection

* RangeError pascal case
2023-03-17 17:14:39 -07:00
zhiyuan
c5f2b42649 Feat(test): add toMatch (#2404) 2023-03-17 03:49:41 -07:00
Ashcon Partovi
37293cb26a Remove old Docker workflow 2023-03-16 15:51:54 -07:00
Ashcon Partovi
57255ad565 Remove test Dockerfile 2023-03-16 15:50:28 -07:00
Ashcon Partovi
2dd99a37fd Organize Dockerfiles for official status 2023-03-16 15:49:41 -07:00
Dylan Conway
baf8787fa4 remove trailing comma 2023-03-15 22:06:28 -07:00
Dylan Conway
d5ef247b3b Fix socket tests with connection errors (#2403)
* release pending activity with connection error handler

* unref poll_ref
2023-03-15 22:01:58 -07:00
Jarred Sumner
b66df90b49 Rename expectObjectTypeCount to expectMaxObjectTypeCount 2023-03-15 22:00:53 -07:00
zhiyuan
0befd9ad85 feat(expect): update toBeInstanceOf (#2396)
* feat: update instanceof binding

* fix: according to PR comments
2023-03-15 20:04:55 -07:00
Jarred Sumner
79a05d50ad Make the test work in any timezone 2023-03-15 19:59:09 -07:00
Jarred Sumner
9a5f78fa3b Fixes #2399 2023-03-15 19:18:56 -07:00
Alex Lam S.L
47865fe82a fix gc-related flaky test failures (#2402) 2023-03-15 18:51:22 -07:00
Ashcon Partovi
480567a5af Remove nested tests from harness 2023-03-15 17:45:24 -07:00
Ashcon Partovi
976ef92473 Improve reliability of generated tests 2023-03-15 17:34:23 -07:00
Jarred Sumner
abd34abf08 some test matchers 2023-03-15 16:50:05 -07:00
Dylan Conway
1f811980c3 fix gc import from harness 2023-03-15 16:48:02 -07:00
Jarred Sumner
654ba5b671 Case sensitive 2023-03-15 16:47:40 -07:00
Jarred Sumner
babbfc6404 fix fixture 2023-03-15 16:47:08 -07:00
Jarred Sumner
86891a5d12 ✂️ 2023-03-15 16:43:32 -07:00
Jarred Sumner
9b321c3b06 Make this test more reliable 2023-03-15 16:41:23 -07:00
Jarred Sumner
cb5b08b22e Fix broken import path in test 2023-03-15 15:39:38 -07:00
Dylan Conway
a4741f6fe1 add tsconfig and update path (#2401) 2023-03-15 15:18:31 -07:00
Ciro Spaciari
ac970146b4 allows Bun.serve to listen on IPV6 (#2400) 2023-03-15 14:30:31 -07:00
Alex Lam S.L
acd361855a [install] sanitise against malformed bun.lockb (#2397)
* [install] sanitise against malformed `bun.lockb`

fixes #2392

* fix `prettier` checks in unrelated files
2023-03-15 08:49:52 -07:00
Dylan Conway
b6ec31ba4b don't delete bun-snapshots 2023-03-14 18:33:10 -07:00
Dylan Conway
62acc096f5 test added snapshots in new process 2023-03-14 18:09:36 -07:00
Jarred Sumner
7baaf2065a Update child_process-node.test.js 2023-03-14 18:07:58 -07:00
Dylan Conway
0f434f9457 generate jest snapshots manually 2023-03-14 17:33:32 -07:00
Jarred Sumner
d0522bb6a7 Condense snapshot output 2023-03-14 17:18:09 -07:00
Jarred Sumner
9b066ac6b1 Fix failing test 2023-03-14 17:17:43 -07:00
Dylan Conway
7fcbffa19a calculated class name after name prop 2023-03-14 17:03:52 -07:00
Ashcon Partovi
fc11894235 Skip some more irrelevant tests 2023-03-14 16:52:13 -07:00
Dylan Conway
4792abdb7f Implement toMatchSnapshot() (#2294)
* buggy snapshot

* error output for failed snapshot

* missing first

* hints

* open dir once, better cleanup

* update flag

* truncate on update

* object and class snapshot formatting

* array formatting

* no function name, single item is empty array

* string objects, maps, sets, promise

* avoid using invalid memory

* handle number objects

* handle extending `Number`

* boolean objects

* snapshot tests and test updates

* snapshot format for buffers

* safer snapshot parsing

* property matchers setup

* strings and tests

* generate classes with empty prototype

* optional `propertyMatchers` parameter

* new test folder structure

* strings.eqlLong

* globalObject.throwPretty() and expect.any tests

* add updateSnapshot flag to help

* move snapshot format out of `printErrorlikeObject`

* empty object snapshot format

* separate typed array, remove trailing comma

* use `isCell`, object trailing commas

* handle unicode

* todo for primitive constructors

* switch to `JSC.Node.Syscall.open` and `JSC.Maybe`

* use js parser for snapshot files

* deinit ast, log parse error

* copy/paste most of `exports.ZigConsoleClient`

* remove snapshot option

* remove ordered properties option

* remove snapshot format option from `exports.zig`

* remove extra newlines

* change mode

* update test runner output

* escape backticks faster

* `bunx jest` in temp dir

* remove buffered writer

* add `toMatchSnapshot` to types

* cleanup, switch to `pread`

* cli `--update` flag

* `--update-snapshots`

* remove string object format
2023-03-14 16:50:59 -07:00
Jarred Sumner
76b875e414 Update .prettierignore 2023-03-14 16:42:49 -07:00
Jarred Sumner
eb9e3e9aec Update harness.ts 2023-03-14 16:42:26 -07:00
Ashcon Partovi
851fd039da Ignore irrelevant tests in encoding.test.ts 2023-03-14 16:37:32 -07:00
Jarred Sumner
e1921ff8c5 Fix node test harness 2023-03-14 15:59:55 -07:00
Jarred Sumner
2b5139aa46 Add missing export 2023-03-14 15:58:00 -07:00
Ashcon Partovi
d1d2d842d5 Move tobeInstanceOf() tests to expect.test.ts 2023-03-14 12:19:24 -07:00
Ashcon Partovi
5d89efedec Add tests for AbortSignal, AbortController 2023-03-14 11:54:16 -07:00
Jarred Sumner
80f3bc64ed Fix incorrect test folder 2023-03-14 08:49:03 -07:00
Jarred Sumner
e613b501e2 Fix missing constants export in zlib 2023-03-14 08:49:03 -07:00
zhiyuan
6d50b90070 feat: add toBeInstanceOf matcher in expect (#2389) 2023-03-14 08:30:50 -07:00
Jarred Sumner
27f5012f50 Fix node:https being readonly 2023-03-14 08:16:53 -07:00
Josh Soref
ba994c52b8 Markdown (#2383)
* Fix test/README.md reference

* Apply markdown links
2023-03-14 08:13:47 -07:00
Jarred Sumner
4c38798142 Fix text formatting in .remoteAddress in ServerWebSocket and Socket
Fixes #2387
2023-03-14 07:44:54 -07:00
Ashcon Partovi
f63c26208a Better test coverage for Request and Response 2023-03-13 17:13:24 -07:00
Ciro Spaciari
ac9f8c0e93 feat(net.createServer) and adds socket.connect IPC support (#2337)
* added net.Server

* fix fmt

* fix cast and move test

* fix node-net.tests.ts but breaks server data receive

* fix end and close only emitting when data or pipe was added

* fix socket starting paused

* add echo test

* fix fmt

* fix fmt

* on close if the socket is paused, keep paused until the user resumes it to match node behavior

* resume on connect

* fix getConnections, error on close, make _Handler private and create symbols for SocketServerHandlers

* add path support (IPC)

* fix unix domains support, add connect unix tests

* fix unix socket tests

* emit listening and listening error on next tick

* fix connection flask test

* try fix connect error on macos test

* merge connection and drop tests

* added exclusive option

* fix socket.zig fmt

* fix validation for options and add test for it

* pass prettier fmt
2023-03-13 16:42:35 -07:00
Miles Johnson
8d320d1373 Add install with proto examples. (#2361) 2023-03-13 13:47:57 -07:00
dave caruso
21f9fc828f fix require.resolve with an empty options object #2370 (#2371)
* fix #2370 and import-meta test

* edit test to not allow transpiler optimization
2023-03-12 03:43:32 -07:00
Nicholas
8c91278a00 Update comparison matchers compatibility in docs (#2366) 2023-03-11 08:33:46 -08:00
Haris Sulaiman
d61e90d558 Update file-system-router.md (#2365) 2023-03-11 01:28:33 -08:00
noahmarro
a4fdc1e0d5 removed JSON trailing comma (#2364) 2023-03-11 00:13:00 -08:00
Fran Zekan
cc7d2cf343 Fix link in globals.md (#2362) 2023-03-10 16:47:33 -08:00
Ashcon Partovi
d7e067902f Add more tests for Headers 2023-03-09 12:34:11 -08:00
Ashcon Partovi
c5e76f8bfe Remove websocket test because it's not substantial 2023-03-08 15:37:42 -08:00
Ashcon Partovi
ebb42bb67b Add so many more tests, it's not even funny 2023-03-08 15:36:16 -08:00
Derrick Farris
42edcaae8c fix(node:child_process): fix missing primordial StringPrototypeSlice (#2352) 2023-03-08 14:04:21 -08:00
Ashcon Partovi
ab02ab25b1 Improve test harness 2023-03-08 11:38:09 -08:00
buu
deb7a2b192 docs(react): add the missing props.message to <Component /> (#2347) 2023-03-08 08:16:06 -08:00
Jarred Sumner
0fd9b2421e Fix bug in test runner 2023-03-08 00:18:52 -08:00
Jarred Sumner
f22336b5b5 More spec compliant Blob.prototype.type (#2340)
* Make `Blob.prototype. type` more spec compliant

* Add a few more checks for isNumber()

* Fix `make headers`

* Safer JSValue.isString()

* More tests for blob.slice

* Make `Blob.prototype.type` more spec compliant

* Add isASCII check

* Fix types

* Fix failing type test

* Update blob.zig

* Update blob.zig

* Fix .eql check on empty values

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-08 00:18:14 -08:00
Jarred Sumner
e16053c39e "binary" is an alias of "latin1"
Fixes https://github.com/oven-sh/bun/issues/2110
2023-03-07 22:59:29 -08:00
Alex Lam S.L
e389b6ef19 run bun test after macOS builds (#2343) 2023-03-07 22:30:53 -08:00
Alex Lam S.L
28346e4a39 improve Buffer compatibility with Node.js (#2341)
* improve `Buffer` compatibility with Node.js

* use `memmove()`
allow `encoding` to be `undefined`
2023-03-07 22:29:29 -08:00
Colin McDonnell
95b59ea0ef Document openInEditor 2023-03-07 21:05:44 -08:00
Jarred Sumner
24e90726fd run prettier 2023-03-07 18:44:12 -08:00
Colin McDonnell
cac4012a7e Fix links 2023-03-07 18:43:15 -08:00
Colin McDonnell
6505e5c3a4 Fix typo 2023-03-07 18:07:53 -08:00
Colin McDonnell
9bf4d9b8a2 Improve Benchmarking page, small fixes (#2339)
* Improve benchmarking page

* WIP

* Add typescript instructions to hot

* Document preload in Plugins. Fix loader in plugin types.
2023-03-07 17:44:05 -08:00
Ashcon Partovi
1d2b0bbc98 Add more test harness 2023-03-07 17:02:43 -08:00
pfg
45ddf321b1 fix the wrong thing being incremented in hmr example (#2334) 2023-03-07 13:11:54 -08:00
Ashcon Partovi
e84ff1d8b7 Fix html-rewriter.test.js 2023-03-07 12:28:16 -08:00
Ashcon Partovi
f7e4eb8369 Reorganize tests (#2332) 2023-03-07 12:22:34 -08:00
Ashcon Partovi
36275a44ce Add reference documentation for bun:test (#2327) 2023-03-06 22:50:11 -08:00
Dylan Conway
68e58605b6 throw invalid parameter errors in crypto.scryptSync (#2331)
* throw invalid parameter errors

* remove comptime, add empty buffer function

* remove error_name comptime
2023-03-06 20:00:50 -08:00
Jarred Sumner
0a9cb0e13a Fixes #2323 2023-03-06 19:22:52 -08:00
Alex Lam S.L
b211fb1298 bun test on macOS in GitHub Actions (#2322) 2023-03-06 15:22:42 -08:00
Ashcon Partovi
7f715e15cc Fix docker install command 2023-03-06 14:05:43 -08:00
Derrick Farris
a512bdad8d feat(tty): add some tty.WriteStream methods to process.{stdout, stderr} (#2320)
* feat(stdio): add some `tty.WriteStream` methods

* chore(builtins): add process builtin gen'd code
2023-03-06 13:09:52 -08:00
Alex Lam S.L
3e1d368a27 fix & clean up tests (#2318)
- skip flaky tests when running as `root`
- use `expect().toThrow()`
- clean up temporary files after tests
2023-03-06 12:09:44 -08:00
Alex Lam S.L
993fed51c1 fix missing Blob error messages on Linux (#2315) 2023-03-05 22:45:27 -08:00
Alex Lam S.L
d4bd156d9d support expect().toThrow(/pattern/) (#2314)
- fix time-zone-dependent test failure
2023-03-06 03:33:38 +02:00
Alex Lam S.L
c7bfb3aa3a consider current working directory when resolving relative paths (#2313)
* consider current working directory when resolving relative paths

fixes #2298

* comment test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-05 08:54:00 -08:00
Jarred Sumner
7273713158 Update out of date doc 2023-03-05 08:31:56 -08:00
Alex Lam S.L
67422785cc [install] fix connection error detection (#2307) 2023-03-05 08:09:17 -08:00
Jarred Sumner
42f6b35a5b Test action comment (#2310)
* test

* Update bun-linux-build.yml

* fixup

* Update bun-linux-build.yml

* Use outputs

* set id

* Update bun-linux-build.yml

* Update runner.node.mjs

* Update runner.node.mjs

* wip (will revert)

* Update runner.node.mjs

* Update runner.node.mjs

* Update runner.node.mjs

* Update runner.node.mjs

* Update bun-linux-build.yml

* Update bun-linux-build.yml

* works well enough for now

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-05 00:21:00 -08:00
Jarred Sumner
665486dab8 Run tests 2023-03-04 19:22:20 -08:00
Jarred Sumner
a7cdd49244 Artifact version 2023-03-04 19:01:42 -08:00
Jarred Sumner
0b4e7179b5 dump failing tests to disk 2023-03-04 18:58:10 -08:00
Jarred Sumner
c34b92d16b Update runner.node.mjs 2023-03-04 18:39:40 -08:00
Jarred Sumner
339b811b48 Update runner.node.mjs 2023-03-04 18:36:14 -08:00
Jarred Sumner
adf8bae23c Update runner.node.mjs 2023-03-04 18:32:27 -08:00
Jarred Sumner
03997086ea Update runner.node.mjs 2023-03-04 18:22:48 -08:00
Jarred Sumner
cbfe17d95a Update runner.node.mjs 2023-03-04 18:18:15 -08:00
Jarred Sumner
f915abf3be Update run-test-manually.yml 2023-03-04 18:15:35 -08:00
Jarred Sumner
c6b0e45a52 Update run-test-manually.yml 2023-03-04 18:14:25 -08:00
Jarred Sumner
571ba8ef3f Add node runner 2023-03-04 18:11:54 -08:00
Jarred Sumner
9963e1c3d8 Update runner.ts 2023-03-04 17:52:13 -08:00
Jarred Sumner
9e2f6ef1be chdir 2023-03-04 17:45:50 -08:00
Jarred Sumner
1843a37ebb oops 2023-03-04 17:38:44 -08:00
Jarred Sumner
f333a0c243 Update run-test-manually.yml 2023-03-04 17:35:18 -08:00
Jarred Sumner
ffdc8a19d1 fixup 2023-03-04 17:31:59 -08:00
Jarred Sumner
c1c8d6356f Update run-test-manually.yml 2023-03-04 17:26:24 -08:00
Jarred Sumner
7a8a887d4b Update run-test-manually.yml 2023-03-04 17:25:42 -08:00
Jarred Sumner
5ca4778746 Update run-test-manually.yml 2023-03-04 17:24:41 -08:00
Jarred Sumner
28b80e6433 Update run-test-manually.yml 2023-03-04 17:23:09 -08:00
Jarred Sumner
dcc46b2862 Rename packages/bun-test to packages/bun-internal-test 2023-03-04 17:21:25 -08:00
Jarred Sumner
e4bd4d134d Update run-test-manually.yml 2023-03-04 17:18:39 -08:00
Jarred Sumner
cfa21dc9d0 Update run-test-manually.yml 2023-03-04 17:18:15 -08:00
Jarred Sumner
7dde3d4974 Update run-test-manually.yml 2023-03-04 17:17:18 -08:00
Jarred Sumner
5c6cbb0283 Update run-test-manually.yml 2023-03-04 17:16:30 -08:00
Jarred Sumner
6a1667a5f4 Add a manual test running action 2023-03-04 17:15:54 -08:00
Jarred Sumner
d77bd35556 Delete broken CI action 2023-03-04 17:01:36 -08:00
aab
ddb6624ad1 docs: Fix invalid default port on bun-types docs (#2300) 2023-03-04 06:01:39 -08:00
aab
0eeac32ef4 docs(websocket): change server port on example to default port (#2301)
Current example will fail without explicitly configure the server to use port 8080. Hence, replacing it with default port (3000).
2023-03-04 06:01:04 -08:00
Alex Lam S.L
31447fdc19 [install] use latest tagged version if in range (#2302) 2023-03-04 06:00:38 -08:00
Fran Zekan
8e1d2a5af9 fix(bunx): can't resolve executable for scoped packages (#2293)
Fixes #2292
2023-03-04 14:56:25 +02:00
Derrick Farris
3626845051 fix(node:http): match Node headers casing (lowercase only) (#2288)
* fix(node:http): match Node headers casing (lowercase only)

* fix(JSFetchHeaders): `WTFMove` the ascii string
2023-03-03 21:08:26 -08:00
Jarred Sumner
d8d23f2594 Update Dockerfile 2023-03-03 19:03:47 -08:00
Jarred Sumner
122e6a8860 Update bindings.zig 2023-03-03 18:59:20 -08:00
Jarred Sumner
9f132ea241 BigInt64Array and BigUint64Array are typed arrays too
Fixes #2296
2023-03-03 18:51:52 -08:00
Fran Zekan
7c367ff687 fix(bunx): Show usage when calling bunx without arguments (#2295)
* Make sure to return a helpful error message if no args are passed to bunx

* Add tests for bunx without args
2023-03-03 17:49:32 -08:00
Colin McDonnell
0f8f484e21 Improve types for node:http (#2284)
* Document node:http

* Fix test

* Fix default

* Fix default
2023-03-03 14:24:12 -08:00
Hannes Käufler
7e5dddd2fa Fix broken async test example (#2291) 2023-03-03 12:41:36 -08:00
Jarred Sumner
838b37eed0 Update react-dom-render.bun.js 2023-03-03 04:45:33 -08:00
Jarred Sumner
1f10e25bd9 react-dom/server@next 2023-03-03 04:26:30 -08:00
zhiyuan
18178b4e48 Fix http server req url (#2285)
* fix: http url add search query

* fix: add tests
2023-03-03 02:45:34 -08:00
aab
3456831b82 docs: Fix variable name in transpiler API docs (#2281) 2023-03-02 21:49:12 -08:00
zhiyuan
6a1701fedd Fix update zls version in devcontainer (#2280)
* fix: update zls version for new zig

* fix: rm outdated vscode extension

---------

Co-authored-by: Zhiyuan Guo <zhiyuan.guo@shopee.com>
2023-03-02 19:53:37 -08:00
Jarred Sumner
3318ccfb4a Update Makefile 2023-03-02 19:11:41 -08:00
Jarred Sumner
9388b3f825 Add a zig fmt action (#2277)
* Add a zig fmt action

* add failing file

* Setup prettier better

* Update prettier-fmt.yml

* Fail on error

* Update prettier-fmt.yml

* boop

* boop2

* tar.gz

* Update zig-fmt.yml

* Update zig-fmt.yml

* Update zig-fmt.yml

* Update zig-fmt.yml

* Update zig-fmt.yml

* boop

* Update prettier-fmt.yml

* tag

* newlines

* multiline

* fixup

* Update zig-fmt.yml

* update it

* fixup

* both

* w

* Update prettier-fmt.yml

* prettier all the things

* Update package.json

* zig fmt

*  

* bump

* .

* quotes

* fix prettier ignore

* once more

* Update prettier-fmt.yml

* Update fallback.ts

* consistentcy

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-02 19:02:10 -08:00
Colin McDonnell
b469e50351 Add fs/promises tests and migrate fs.test.js to TypeScript (#2279) 2023-03-02 17:36:47 -08:00
Ciro Spaciari
27c3579118 fix(os.tmpdir()) strip trailing slash on *unix machines (#2276)
* fix(os.tmpdir()) strip trailing slash on *unix machines

* make use of strings.withoutTrailingSlash(dir);
2023-03-02 17:33:25 -08:00
Colin McDonnell
3852a52601 Add separate bun-types release CI (#2275)
* Release on every commit

* Remove bun-types publish from bun-release-canary

* Undo formatting changes
2023-03-02 15:34:36 -08:00
Jarred Sumner
1ba007831d Ensure prettier knows where to look 2023-03-02 15:12:00 -08:00
Alex Lam S.L
c0a49e405e add tests for scoped dependency aliasing (#2271) 2023-03-02 13:30:20 -08:00
Ciro Spaciari
78762e8305 fix tmp dir in fetch.tests.js (#2270) 2023-03-02 12:54:59 -08:00
u9g
57fcf8f9ba Remake typings for FFI dlopen/linkSymbols + introduce Pointer type (#2227)
* Give dlopen & linkSymbols typings for exported functions

* Fix lookup table

* Fully change over to Pointer + fix examples

* add back header for typings

* Fix tsc errors

* Run formatter on ffi.d.ts

* Revert args/return type change

* Add type tests for ffi

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-03-02 12:24:43 -08:00
Ciro Spaciari
c81043bf5e put AbortSignal in WebCore namespace (#2267) 2023-03-02 11:49:32 -08:00
Ciro Spaciari
156c1d4bec only free sink after promises solves (#2268) 2023-03-02 11:48:11 -08:00
Justin Whear
20930849ce Fix Bun.sleepSync to actually use milliseconds (#2242)
* Fix Bun.sleep/sleepSync to actually use milliseconds

`Bun.sleepSync` was accidentally treating its argument as seconds rather than milliseconds as the docs stated.  This is a breaking change in that the function now behaves as documented.  Fixed relevant tests.

* sleepSync: add more argument checking, tests
2023-03-02 09:00:20 -08:00
Derrick Farris
efdf647460 fix(bindings): mark JSCInitialize (#2265) 2023-03-01 22:41:20 -08:00
Colin McDonnell
167de9091a Add page descriptions (#2260)
* Add page descriptions

* Update bun install

* Description tweaks

* Tweaks
2023-03-01 21:45:49 -08:00
Ciro Spaciari
1be834b073 fix bun server segfault with abortsignal (#2261)
* removed redundant tests, fixed server segfault

* fix onRejectStream, safer unassign signal

* fix abort Bun.serve signal.addEventListener on async

* move ctx.signal null check up

* keep original behavior of streams onAborted
2023-03-01 21:40:11 -08:00
Derrick Farris
b9137dbdc8 fix(node:http): match Node http.request() GET/HEAD w/ body (#2262) 2023-03-01 21:28:21 -08:00
Jarred Sumner
706a3e8169 Add a test for https request in node:http 2023-03-01 19:31:16 -08:00
Derrick Farris
7c81d97684 fix(node:http/https): fix passing URL objs to http.request(#2253) (#2258)
* fix(node:http/https): fix passing `URL` objs to `http.request`(#2253)

* fix(node:http): hoist debug env var

* fix(node:http): make body `undefined` when falsy
2023-03-01 18:11:38 -08:00
Jarred Sumner
6bc075e377 Revert "Update clap (#2238)"
This reverts commit 7b9a17f9d7.
2023-03-01 16:17:47 -08:00
Jarred Sumner
ba0706939d Revert "Add -D, --dev flags for bun install (#2240)"
This reverts commit ec20fae57f.
2023-03-01 16:15:55 -08:00
Ashcon Partovi
6e512eda0d Use GitHub action ID instead of SHA for test workflow 2023-03-01 16:07:27 -08:00
Ciro Spaciari
1227a7b995 avoids segfault after aborted onReject in Bun.serve streams (#2256)
* avoids segfault after aborted on reject

* silence err on handleRejectStream after aborted
2023-03-01 15:47:04 -08:00
Ashcon Partovi
ef56961007 Run tests in CI for bun-linux-aarch64 2023-03-01 14:31:56 -08:00
Jarred Sumner
ff51a253e2 Revert spawnSync change
cc @FireTheFox
2023-03-01 14:12:59 -08:00
Jarred Sumner
ee6f54180a Update bindings.zig 2023-03-01 14:12:59 -08:00
Ciro Spaciari
cf8568ccff fix deinit behavior when connection is aborted using ResponseStream and abort event behavior (#2252)
* fix deinit behavior when connection is aborted using ResponseStream

* fix abort handling on stream, and get better tests

* avoid segfault by trying to deinit 2x when aborted

* make tests more reliable

* more reliable onResolveStream after aborted

* add test case for not firing the abort signal
2023-03-01 13:15:52 -08:00
Ciro Spaciari
56ca48ece8 fix Bun.file.arrayBuffer() segmentation fault on empty file #2248 (#2249)
* fix Bun.file.arrayBuffer() segmentation fault on empty file #2248

* cleanner this.iotask check
2023-03-01 13:07:21 -08:00
Colin McDonnell
530cf4caf8 Fix async in sqlite 2023-03-01 12:27:14 -08:00
Justin Whear
9a7333dd5e Forces a specific libdir for c-ares (#2241)
The c-ares build expects lib/libcares.a to exist after cmake, but on my system it was being generated in lib64.  This simply sets the cmake variable so that the target ends up where we expect.
2023-02-28 23:35:04 -08:00
Jarred Sumner
88b5cda109 Make Bun.gc(true) more aggressive 2023-02-28 21:56:28 -08:00
Jarred Sumner
45704a55dc Expose JSC::Options via BUN_JSC_ prefix
Example usage:

BUN_JSC_logGC=1 bun file.js
2023-02-28 21:56:28 -08:00
Jarred Sumner
714b8d10e0 fixup 2023-02-28 21:56:28 -08:00
Colin McDonnell
931f23d360 Fix typecheck 2023-02-28 19:47:46 -08:00
Derrick Farris
1da8045ce4 Fix incorrect Bun version in docs (#2236) 2023-02-28 17:55:18 -08:00
Ciro Spaciari
e512be8c18 just some comments fix (#2237) 2023-02-28 16:56:12 -08:00
Justin Whear
ec20fae57f Add -D, --dev flags for bun install (#2240)
* remove vendored clap

* Update to latest zig-clap

Major changes:
* Instead of vendoring zig-clap and adding changes, this uses Hejsil/zig-clap directly as a submodule
* `cli.zig` and related files have been updated to use new API (no more `flag()` or `option()`)
* A workaround for the Run and Auto commands has been implemented that allows us to use the official upstream

Minor change:
* `-i` now has the long option `--install-fallback`; I didn't spend much time thinking about this name, so suggestions weclome.

* add --development and --optional to bun install

* Add support for `-D`, `--dev` in bun install, fix `--save`
2023-02-28 16:39:06 -08:00
Colin McDonnell
fd19d01583 Document punning 2023-02-28 16:10:51 -08:00
Colin McDonnell
1826abbc65 Add deploy hook workflow 2023-02-28 15:52:15 -08:00
Justin Whear
7b9a17f9d7 Update clap (#2238)
* remove vendored clap

* Update to latest zig-clap

Major changes:
* Instead of vendoring zig-clap and adding changes, this uses Hejsil/zig-clap directly as a submodule
* `cli.zig` and related files have been updated to use new API (no more `flag()` or `option()`)
* A workaround for the Run and Auto commands has been implemented that allows us to use the official upstream

Minor change:
* `-i` now has the long option `--install-fallback`; I didn't spend much time thinking about this name, so suggestions weclome.

* deinit jsBundleArgs
2023-02-28 13:49:05 -08:00
Jarred Sumner
bd91aa8c25 Don't tick the event loop in spawnSync 2023-02-28 00:12:32 -08:00
Jarred Sumner
31389b4906 Make response.body null only when user explicitly passes null/undefined 2023-02-28 00:12:32 -08:00
Jarred Sumner
d93d1013a6 Add back the tests 2023-02-28 00:12:32 -08:00
Jarred Sumner
12d6db0cad Add explicit Null tag to Body
This reverts commit e538bb31ad.
2023-02-28 00:12:32 -08:00
Jarred Sumner
ec7929b251 Implement preload support (like node -r except in a config file) (#2231)
* Update Makefile

* Introduce `preload`

* Add a test

* Support entry points

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-02-28 00:01:21 -08:00
maor-benami
590219966e Update file-io.md (#2230)
should `notreal.type` reflect the overridden value?
2023-02-27 21:08:27 -08:00
maor-benami
0a340d1920 Update file-io.md (#2229)
duplicated word
2023-02-27 21:07:35 -08:00
Jarred Sumner
56488d54d0 Add some more functions to sha bench 2023-02-27 18:30:42 -08:00
Derrick Farris
ae35f17a99 fix(bun:sqlite): fix sqliteDb.run(' ') throwing not an error (#2226) 2023-02-27 18:29:00 -08:00
Ciro Spaciari
062b5565a7 use abort signal on http.ClientRequest (#2222)
* use abort signal on http.ClientRequest

* fix edge case and add test
2023-02-27 20:28:42 -06:00
Ciro Spaciari
4b62745754 add signal on http.Server.listen (#2223)
* add signal on http.Server.listen

* actual call close instead of just stopping the server
2023-02-27 16:24:59 -08:00
Ciro Spaciari
0afb1693d3 fix(fetch.signal) capture socket and shutdown on abort signal (#2143)
* capture socket and shutdown on abort signal

* queue shutdown tasks

* little cleanup

* change shutdown strategy

* use fetchSwapRemove on fetch shutdown

* use fetchSwapRemove on fetch shutdown

* fix formatting, remove unused property
2023-02-27 16:10:03 -08:00
Gaurish Sethia
7a4ac03338 Update module statuses in docs (#2219)
* Add filePath property on MatchedRoute

* Fix #1880 #851

* Fix #1972 as well

* FMC

* Bump querystring-es3

* fix querystring status

* Fix typos in docs

---------

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-02-27 16:08:01 -08:00
Tamas Sule
630d2314b6 Bundler uses incorrect port when dev server is listening on non-default port #1885 (#2191) 2023-02-27 16:06:28 -08:00
Justin Whear
18cce50390 Feat/os.network interfaces (#2142) 2023-02-27 09:58:45 -08:00
Alex Lam S.L
c8be1e9a5d resolve duplicated dependency correctly (#2213) 2023-02-27 09:36:17 -08:00
Rodo Abad
f420e81e85 docs(configuration): update misleading comment (#2205)
The comment was for peer dependencies and not dev dependencies.
2023-02-26 16:37:32 -08:00
Jarred Sumner
5d296f6228 Don't parse shasum twice 2023-02-26 14:53:32 -08:00
Alex Lam S.L
16898a23e6 fix ANSI escape codes piped from stdout to file (#2202) 2023-02-26 12:14:51 -08:00
Jarred Sumner
a55ca48797 Update emitter.mjs 2023-02-26 00:51:42 -08:00
Jarred Sumner
94abc87d6e Add callback to bench 2023-02-26 00:51:42 -08:00
cunzaizhuyi
f89c4c3a0d Update hot.md (#2198) 2023-02-26 00:23:58 -08:00
Jarred Sumner
451ccfd5ef Update bun.zig 2023-02-25 19:06:11 -08:00
Jarred Sumner
2dd484c180 Add more assertions 2023-02-25 18:48:59 -08:00
Jarred Sumner
58685638e2 Use libc memmove 2023-02-25 18:41:37 -08:00
Jarred Sumner
693be3d1c2 Faster eqlCaseInsensitiveASCII 2023-02-25 18:23:01 -08:00
Jarred Sumner
8ba65a4f0b Fixes #2194 (most likely) 2023-02-25 18:23:01 -08:00
Derrick Farris
4149b95543 Update node:http compatibility (#2184) 2023-02-25 16:37:39 -08:00
Alex Lam S.L
38314c02f2 improve bun pm ls (#2192) 2023-02-25 16:37:04 -08:00
Jarred Sumner
f58728ccc7 Call BoringSSL.load() in more places 2023-02-25 15:15:10 -08:00
Jarred Sumner
eb94e5b990 Use mimalloc heap for BoringSSL 2023-02-25 15:01:52 -08:00
Ryan Morey
d4dfb79b72 Fix broken link in developing.md (#2188)
* Fix broken link in developing.md

* Update developing.md
2023-02-25 12:25:16 -06:00
Florian Dreier
45f4353453 fix: Broken link to Node.js support status page (#2183)
Co-authored-by: Derrick Farris <mr.dcfarris@gmail.com>
2023-02-25 10:57:26 -06:00
Charlie Marsh
735d48190d Replace docs/runtime/nodejs with docs/ecosystem/nodejs (#2185)
* Replace docs/runtime/nodejs with docs/ecosystem/nodejs

* Replace a few more usages
2023-02-25 10:54:29 -06:00
Raxit Majithiya
a819e3b723 docs: Fix the link to Node.js ecosystem (#2181) 2023-02-25 09:49:44 -06:00
Tommaso A
8e09b1afff docs: improved language in yaml loader example (#2172)
* docs: improved language in yaml loader example

* docs(api/http): fix typo

* docs(api/spawn): fix typo

* docs(api/transpiler): fix typo
2023-02-25 09:47:11 -06:00
Akash Joshi
cf7a09c0d3 Update index.md (#2182) 2023-02-25 09:45:26 -06:00
Fernando Daciuk
0d5d3e5dfc docs: fix typo in install.md file (#2179) 2023-02-25 04:33:21 -08:00
Jarred Sumner
a931e21f49 make emitter bench work in node 2023-02-25 04:28:23 -08:00
Jarred Sumner
8f67cf75ee Bump WebKit 2023-02-25 04:28:04 -08:00
Jarred Sumner
0a7309c8f2 slight performance improvement to EventEmitter 2023-02-25 03:34:41 -08:00
Jarred Sumner
e6f33d9a52 make the test faster 2023-02-25 03:34:41 -08:00
John Reilly
e38cb9aa6a docs: consistent indentation for post install commands (#2175) 2023-02-25 02:45:48 -08:00
Flo
9b66e03a9b Fix sqlite.md .serialize typo (#2178) 2023-02-25 02:45:27 -08:00
Damian Stasik
31627530b9 docs: use proper CSS property in React examples (#2177) 2023-02-25 02:45:12 -08:00
Brett Bloxom
ae62825319 Docs: Fixes broken link in express docs (#2173)
Fixes broken internal link to nodejs compatability information.
2023-02-25 02:44:58 -08:00
Derrick Farris
1e6faa3815 Update hono.md (#2171) 2023-02-25 02:44:03 -08:00
Dylan Conway
40ebc994f9 remove parameters 2023-02-24 19:12:04 -08:00
Colin McDonnell
1e1b45b4d9 Tweak readme 2023-02-24 18:55:11 -08:00
Colin McDonnell
39fa458895 Fix indents 2023-02-24 18:50:48 -08:00
Colin McDonnell
a6a0ccf6f0 Rearrange ecosystem 2023-02-24 18:03:52 -08:00
Colin McDonnell
0ecd773081 Docs (#2170)
* Add hono and elysia

* Update elysia and add coming soon

* Fix typo

* Add back awesome
2023-02-24 17:48:49 -08:00
Colin McDonnell
c72c2c2338 Fixes (#2168) 2023-02-24 16:40:08 -08:00
Colin McDonnell
1836250542 Docs tweaks (#2160)
* Tweaks

* Add ecosystem. Add bunx. Flesh out install.

* Tweaks

* Add TS to installation

* Tweaks

* New readme

* Write new readme

* Tweak

* Center header

* Bun

* tweaks

* No dollar sign

* Fix links

* Update

* Tweak
2023-02-24 16:33:53 -08:00
Dylan Conway
1d85b5efa8 wiptest -> test 2023-02-24 16:32:04 -08:00
Charlie Marsh
7455f385ec Add missing "that" in modules.md (#2167) 2023-02-24 15:47:04 -08:00
Derrick Farris
4c4da4aae2 fix(zig-build): disable stack probing when building other objs too (#2165) 2023-02-24 15:37:45 -08:00
Charlie Marsh
3264ca991e Fix typo in developing.md (#2166)
* Fix typo in `developing.md`

* Apply suggestions from code review

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

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-02-24 15:36:12 -08:00
Jarred Sumner
599f63c204 Support macOS 10.15
Fixes #1266
Fixes #1323
Fixes #2154
2023-02-24 15:07:27 -08:00
Alex Lam S.L
26df7ca892 fix compiler_rt linking failure on x86_64 (#2163)
- minor code tweaks
2023-02-24 14:51:20 -08:00
Ciro Spaciari
d33a53deb0 fix(dns) Fix resolve4 and resolve6 behavior (#2144)
* fix https://github.com/oven-sh/bun/issues/2098

* fix last promisifyResolve call

* avoid some functions alloc on dns.exports
2023-02-24 13:56:41 -08:00
Justin Whear
6d5f0167c5 Fix lol_html_rewriter_builder_add_document_content_handlers binding (#2161)
The `lol_html_rewriter_builder_add_document_content_handlers` does not return a
 status code and always succeeds; errors are reported on subsequent calls to `write` or `end`.

Fixes #2024
2023-02-24 13:53:18 -08:00
Dylan Conway
f290b049e8 formatting 2023-02-24 13:34:28 -08:00
Justin Whear
f0e5d54579 Implement os.cpus for Darwin (OS X) (#2115)
* adding experimental Mac implementation os os.cpus

* Simplify cpus interfaces

* remove support for osx 10

* Refactor os.cpus implementation

This commit substantially refactors how the Linux and Darwin implementations of
 `os.cpus`.  The goal is to avoid unnecessary copying and allow broader latitude
 in responding to errors per implementation.

* improved comments

* ensure no buffer overrun

* use PROCESSOR_CPU_LOAD_INFO_COUNT; not sure if this is correct

* oh teh noes

* use sliceTo instead of span

* cpu_ticks are uints
2023-02-24 14:24:04 -06:00
Ciro Spaciari
1c531472c9 fix(body) Make Request/Reponse empty body to be null (#2156)
* make empty nullable

* revert mistake change
2023-02-24 12:22:14 -08:00
Derrick Farris
dc8e845049 fix(zig-build): disable stack probing on x86_64 so no compiler_rt required (#2159) 2023-02-24 12:20:05 -08:00
Ashcon Partovi
08308e2287 Update docs issue template 2023-02-24 09:57:39 -08:00
Jake Boone
f366231bff [docs] Minor syntax correction in test.md (#2153) 2023-02-24 09:56:18 -08:00
Alex Lam S.L
e887a064fb prefer bun.copy() over std.mem.copy() (#2152) 2023-02-24 05:53:26 -08:00
Jarred Sumner
6e4908e517 Update build-id 2023-02-24 00:20:50 -08:00
Dylan Conway
3f04f8d0a6 Upgrade Zig (#2151)
* fixup

* Upgrade Zig

* Remove bad assertion

* strings

* bump

* mode -> optimize

* optimize

* Linux build

* Update bindgen.zig
2023-02-23 23:57:19 -08:00
Ashcon Partovi
b5bdde28ed Fix release workflow 2023-02-23 17:58:56 -08:00
Colin McDonnell
f54300578b Add documentation (#2148)
* Add documentation

* Tweaks

* Fixes

* Rearrange

* Update
2023-02-23 17:13:30 -08:00
Alex Lam S.L
5929daeeae fix illegal memory reference in bun link (#2147) 2023-02-23 16:37:08 -08:00
Jarred Sumner
4122cb0b19 Update ZigGlobalObject.cpp 2023-02-23 16:33:51 -08:00
N0N1m3
e6e4e6b577 Update README.md (#2145) 2023-02-23 14:13:37 -08:00
Ashcon Partovi
dc634d3b30 Use newer version of setup-bun 2023-02-23 10:10:36 -08:00
Ashcon Partovi
2c795e6a3c bun-lambda: Fix 502 when handler name was 'fetch' 2023-02-23 09:54:22 -08:00
Jarred Sumner
17f1649c87 Fix flaky tests 2023-02-22 23:00:55 -08:00
B. Burt
93778a66d8 Update README.md (#2138) 2023-02-23 00:37:59 -06:00
Dylan Conway
9024125d41 uninstall 2023-02-22 21:54:48 -08:00
Derrick Farris
e687a1cf0c feat(undici): add undici.request (#2136)
* wip(undici): get basic requests working

* wip(undici): implement most request params, add tests

* fix(undici): get tests passing for `undici.request`

* test(undici): test headers in `undici.request`
2023-02-22 21:54:05 -08:00
Jarred Sumner
1d592a9489 Add leaky test 2023-02-22 21:50:39 -08:00
Jarred Sumner
17efd52ba3 Add a request.signal test with Bun.serve 2023-02-22 21:50:39 -08:00
Dylan Conway
0cf08c7e7b fix string diff extra newline 2023-02-22 21:35:44 -08:00
Jarred Sumner
0143eccb27 Fix flaky request.signal implementation 2023-02-22 21:29:43 -08:00
Jarred Sumner
583b29632c Make the tests run 2023-02-22 20:35:14 -08:00
Jarred Sumner
16ea1753b4 Fix missing ref() in lazily created signal 2023-02-22 20:16:08 -08:00
Ciro Spaciari
24d624b176 feat(Request.signal) Initial support for signal in Request + fetch and Request + Bun.serve (#2097)
* add fetch abort signal

* get aborted (still segfaults)

* bidings.zig u0 error

* still GC/memory error

* fix start crash

* fix AbortSignal fromJS

* change fromJS to obj.as

* addAbortSignalEventListenner

* handle abort types, and add tests

* fix tests

* add custom reason test

* merge 2 substring methods, use MAKE_STATIC_STRING_IMPL

* fix create AbortError and TimeoutError, move globalThis and exception creation to main thread

* fix tests and rebuild headers

* no need to check with substring reason is already an exception

* no need to check with substring reason is already an exception

* fix dumb error inverting conditions for check reason

* fix custom reason behavior

* Request signal

* remove package-lock.json

* Remove JSC.Strong from Request signal

* fix globals for fetch abort signal

* more tests, clone signal crashs

* fix AbortSignal.toJS

* fix toJS bidings for AbortSignal

* add streaming tests

* fix abortion before connecting

* fix tests and segfault

* add fetch testing abort after finish

* fix signal handler cleanup

* support signal event Bun.serve

* pull tests (failing)

* remove unsupported test

* formating

* fix server Request.signal, fix cleanNativeBindings

* add direct tests

* more pull tests

* fix stream tests

* fix fetch, pending onAborted fix in HTTPServerWritable

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-02-22 19:27:25 -08:00
Dylan Conway
9c5f02e120 newlines for array diff 2023-02-22 19:25:17 -08:00
Jarred Sumner
2a1558e4d6 [breaking] Return Node.js Timeout objects in setTimeout, setInterval, and setImmediate
Fixes #2129 #880
2023-02-22 19:07:27 -08:00
Jarred Sumner
0911bd3af2 Support well known symobls in prototypes for generated classes 2023-02-22 19:04:54 -08:00
Colin McDonnell
9f53a2210c Various type fixes (#2135)
* Simplify serve() types

* Remove baseURI

* Add Bun.serve type tests

* Number env vars

* Make loader optional

* FSRouter doesn't support URL

* Update sqlite types

* Bench

---------

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2023-02-22 17:45:22 -08:00
Dylan Conway
575291a301 format options with quote strings (#2134) 2023-02-22 15:46:56 -08:00
Jarred Sumner
ac3973016f Fixes #2121 in runtime, but not in tests 2023-02-22 15:29:09 -08:00
Andrea Giammarchi
9b5ddef598 Fix glibc error in alpine Docker image (#2126)
There's an override error with latest alpine and various versions of glibc (including 2.35): https://github.com/sgerrand/alpine-pkg-glibc/issues/185

This MR proposes a workaround (tested on fly.io - it works) so that it's possible to have bun usable with minimal linux dependencies.
2023-02-22 14:26:21 -08:00
Dylan Conway
424045835c wiptest -> test (#2131)
* +/- for object diff, quote more strings

* wiptest -> test

* quote strings fix
2023-02-22 13:55:42 -08:00
Derrick Farris
e8c9c644ca fix(child_process): import from primordials (#2132) 2023-02-22 12:51:17 -08:00
Jarred Sumner
629be18867 Update recommended extensions 2023-02-22 12:44:50 -08:00
Derrick Farris
9be68ac235 fix(child_process): match Node's promisified exec fn (#2128) 2023-02-22 12:39:40 -08:00
Ashcon Partovi
ee60a5c55c Add runtime layer for Bun on AWS Lambda (#2009) 2023-02-22 10:34:16 -08:00
Alex Lam S.L
2dc85c4e45 [install] support SCP-style git dependencies (#2124)
- try HTTPS first before SSH
- improve package name resolution
- improve report messages

fixes #2119
2023-02-21 19:32:35 -08:00
Dylan Conway
88c238dc5c isRegExp() without cpp 2023-02-21 12:18:24 -08:00
Dylan Conway
12b2ad7363 add diffz 2023-02-21 11:52:41 -08:00
Dylan Conway
d786dd6c0b Update test runner output with colors and diffs (#2122)
* add zig-diff

* move diff functions

* toHaveProperty diff for objects

* use formatter

* format labels

* move work to format, diff when it makes sense

* remove comptime, dim equal slices

* order before diff

* line diffs

* add diffz

* switch to diffz

* add `diffLines()` function

* small `prettyFmt()` bug fix

* test runner color output

* update `toBe()` error output

* fix test

* diff method, fix crash

* fix link test

* remove `isRegex`
2023-02-21 11:47:13 -08:00
Derrick Farris
e21796acf5 Add mention of bunx --bun to README (#2114)
* readme(bunx): add info about `bun --bun x`

* chore(formatting): add extension for formatting markdown to avoid a bunch of diffs

* chore(formatting): fix JS formatting in README
2023-02-20 16:46:26 -08:00
Craigory Coppola
f6705a73c7 docs(bunx): add initial documentation to readme (#2106) 2023-02-20 09:08:31 -06:00
Mathias Lafeldt
8bcf64c881 Fix Deno SQLite benchmark (#2112)
Deno has removed direct access to Deno.core:

https://deno.com/blog/v1.30#removal-of-internal-denocore

As a result, a newer version of sqlite3 is required:

https://deno.land/x/sqlite3@0.8.0/src/util.ts?source#L19
2023-02-20 08:52:33 -06:00
Jarred Sumner
bcb7be4909 fixup double export 2023-02-19 19:04:29 -08:00
Jarred Sumner
c006a7f054 Fixes #2108 2023-02-19 16:50:13 -08:00
Micha Reiser
8aa6ee5332 fix: Print URL as object in (#2104) 2023-02-18 15:44:29 -08:00
Carter Snook
963bb54e87 feat(node/os): implement os.machine() (#1378)
* feat(node/os): implement 'os.machine()'

---------

Co-authored-by: Justin Whear <justin.whear+github@gmail.com>
2023-02-18 13:54:59 -08:00
Jarred Sumner
8ff1ff16a5 Update fs.test.js 2023-02-17 22:28:28 -08:00
Alex Lam S.L
7285b9cf75 update bun.lockbs (#2101) 2023-02-17 22:07:02 -08:00
Jarred Sumner
7416672e93 Fix edgecase in some arg parsing in fs module 2023-02-17 22:03:22 -08:00
Jarred Sumner
fa10631c2f use map 2023-02-17 22:00:44 -08:00
Jarred Sumner
1106c8e2f2 More correct filesystem flags parsing 2023-02-17 21:41:58 -08:00
Jarred Sumner
20d9483cd0 Fix issue with express body-parser introduced by our async_hooks polyfill 2023-02-17 18:05:41 -08:00
Jarred Sumner
155e3706b1 Merge branch 'main' of github.com:oven-sh/bun 2023-02-17 17:30:51 -08:00
Jarred Sumner
44cdb1ec8e Fix a couple flaky tests 2023-02-17 17:30:29 -08:00
Alex Lam S.L
d406ca6328 use bun.logger instead of bun.Output (#2099) 2023-02-17 17:06:01 -08:00
Jarred Sumner
e542d9b4ed Fix flaky test 2023-02-17 17:02:55 -08:00
Justin Whear
fb313f210a Fix #1602 (#2066)
* initial test case

* fix segfault from JSObjectMakeDeferredPromise

* pass exceptions through from FetchHeader.createFromJS

* not resolved, but getting close

* implement review suggestions

* fix exception check, tests

* Change how header filtering is accomplished

Previously the FetchHeaders implementation relied on converting names and values
 to IDLByteString to catch non-ASCII data, though not always reliably.  This
 resulted in message-less TypeErrors when headers contained invalid characters.
This commit shifts everything to IDLDOMString for the conversion and relies on
 the actual error checking in FetchHeaders.canWriteHeader, resulting in nicer
 error messages.

To ensure that all headers are written as ASCII/UTF8 rather than UTF16, the
 copyTo bindings function checks the encoding and converts if necessary.

* wrapping up FetchHeader fixes

* since utf8 allocates only do so when needed

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

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

* WebCore__FetchHeaders__has should return on exception path

* strip out log calls from test

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-02-17 15:54:05 -08:00
Alex Lam S.L
c60d7db178 [install] support git dependencies (#2094) 2023-02-17 14:48:57 -08:00
Justin Whear
d37daeb76a Fix #2005 (#2096) 2023-02-17 14:48:10 -08:00
Alex Lam S.L
79f7d29d03 allow bun add of packages with capital letters (#2095) 2023-02-17 14:46:07 -08:00
Jarred Sumner
56b75dbac3 faster Buffer.byteLength("latin1") 2023-02-16 17:17:29 -08:00
Jarred Sumner
5007c6b218 Support yarn-like "workspaces"."packages": string[] (#2086)
* [workspaces] Support yarn-like `"workspaces"."packages": string[]`

* Add a test

* ✂️

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-02-16 15:06:35 -08:00
Justin Whear
d95404fd7a Implement machine for Linux (#2088) 2023-02-16 15:05:15 -08:00
Justin Whear
7762f3fad7 Fix #1516 (#2089)
`FileSystemFlags.fromJS` was hardcoded to return O_RDONLY when the flag value
 was null or undefined and this caused breakage when used with write functions.
Updated the function to take a `default` argument so that the caller can specify
 a sane default for their use.
2023-02-16 14:01:07 -08:00
Jarred Sumner
e7cd45d0fa Update globals.d.ts 2023-02-16 03:18:01 -08:00
Jarred Sumner
0e688d62f9 Add missing type definition 2023-02-16 03:11:40 -08:00
Jarred Sumner
ce01a31e94 [napi] Fix crash in creating arrays > 8 elements long 2023-02-16 03:11:22 -08:00
Luke Deen Taylor
37fafc208f Clarify and clean up macOS build process (#2087)
* Add missing steps to macOS build

* Remove codesigning step from make dev

ref: https://discord.com/channels/876711213126520882/888839314056839309/1075681626127872030
2023-02-16 00:01:41 -08:00
Jarred Sumner
88a8aa4797 Don't crash on null version string 2023-02-15 19:57:59 -08:00
Jarred Sumner
610eb06ddc Add disabled optimization 2023-02-15 19:31:14 -08:00
Jarred Sumner
49cd122bda Add more logging to napi 2023-02-15 18:08:31 -08:00
Jarred Sumner
1125728097 Incorrect implementation of napi_create_threadsafe_function 2023-02-15 18:08:31 -08:00
Ciro Spaciari
597053ea91 feat(fetch) AbortSignal (#2019)
* add fetch abort signal

* get aborted (still segfaults)

* bidings.zig u0 error

* still GC/memory error

* fix start crash

* fix AbortSignal fromJS

* change fromJS to obj.as

* addAbortSignalEventListenner

* handle abort types, and add tests

* fix tests

* add custom reason test

* merge 2 substring methods, use MAKE_STATIC_STRING_IMPL

* fix create AbortError and TimeoutError, move globalThis and exception creation to main thread

* fix tests and rebuild headers

* no need to check with substring reason is already an exception

* no need to check with substring reason is already an exception

* fix dumb error inverting conditions for check reason

* fix custom reason behavior
2023-02-15 14:20:40 -08:00
Derrick Farris
1c221d33b0 fix(webcrypto): fix ed25519 CryptoKey.algorithm (#2082) 2023-02-15 13:48:11 -08:00
Justin Whear
e67b4e73b5 Fix 2063 (#2079) 2023-02-15 12:58:53 -08:00
Jarred Sumner
95e727162b Make sure we test * in tesconfig
Fixes #540
2023-02-15 03:53:33 -08:00
Jarred Sumner
e860e12be5 don't return an error there 2023-02-15 03:28:35 -08:00
Jarred Sumner
ad0bee532c Fix cast 2023-02-15 03:18:54 -08:00
Jarred Sumner
c7d16d2ed5 ensure we allocate for > 6 arguments 2023-02-15 02:51:44 -08:00
Jarred Sumner
d150a73b9b Update async_hooks.exports.js 2023-02-15 01:41:28 -08:00
Jarred Sumner
0d7cea69c2 workaround prisma's usage of eval("__dirname") 2023-02-15 01:35:02 -08:00
Jarred Sumner
c83eaf09b9 some cleanup 2023-02-15 00:36:18 -08:00
Jarred Sumner
4320108add ED25519 WebCrypto (#1971)
* ed25519

* Register the algorithm

* try this?

* fix(webcrypto): fix ed25519 keypair gen (#1985)

* fix: import and export ed25519 (#2004)

* fix(webcrypto): allow import and export ed25519

* fix(webcrypto): copy exportkey

* fix(webcrypto): fix use after stack free

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Derrick Farris <mr.dcfarris@gmail.com>
2023-02-15 02:11:48 -06:00
Jarred Sumner
d91052516e Fix up async_hooks polyfill 2023-02-14 23:58:05 -08:00
Jarred Sumner
c6ee401bf4 Add temporary polyfill for async_hooks 2023-02-14 23:37:25 -08:00
Jarred Sumner
f19e3d66cb 😷 async_hooks 2023-02-14 22:29:10 -08:00
Alex Lam S.L
e63e3a0ca7 [install] link network-delayed .bin scripts correctly (#2076) 2023-02-14 22:25:50 -08:00
Jarred Sumner
5598ea69f2 don't break esbuild 2023-02-14 22:24:11 -08:00
Jarred Sumner
4dc6bf1b09 Add workaround for tls and worker_threads 2023-02-14 21:56:49 -08:00
Alex Lam S.L
7597e4ad2a [install] improve package.json validation (#2074)
- report error and exit gracefully instead of crashing
2023-02-14 18:04:06 -08:00
Derrick Farris
a80981c966 [WIP] fix(node:fs): export fs.ReadStream and fs.WriteStream (#1798)
* fix(node:fs): export fs.WriteStream and fs.ReadStream

* test(node:fs): add tests for fs.ReadStream and fs.WriteStream

* test(node:fs): prevent opening fd w/o closing

* fix(node:fs): hack ESM export for fs streams to keep lazy loading

* fix(node:fs): = -> ===, fix hasInstance comparison

* test(node:fs): add test that actually checks that re-exported streams work

* fix(fs): eagerly load our slow lazy fns (thanks esm)

* fix(fs): employ @alexlamsl 's constructor w/o new trick on Read/WriteStream
2023-02-14 15:54:50 -08:00
Eric Zhang
6e1a52691a Reject with error when invalid fetch() body (#2047)
* Reject with error when invalid fetch() body

Resolves #2014

* Make sure the test actually throws an exception

* Update fetch error paths to return TypeErrors
2023-02-14 15:43:18 -08:00
Derrick Farris
ef75cd4658 fix(FormData): make String explicit, thanks @dylan-conway (#2065) 2023-02-13 13:04:54 -05:00
Derrick Farris
af3f42e630 fix(FormData): add string literal operator (#2064) 2023-02-13 09:42:49 -08:00
Jarred Sumner
37186f4b0a Add pretty printer for FormData 2023-02-13 04:37:23 -08:00
Michał Warda
f310d7414b Add dynamic port assigning to Bun.serve (#2062) 2023-02-13 03:08:11 -08:00
Derrick Farris
739de2c9cd feat(napi): add napi_get_value_bigint_words (#2061)
* feat(napi): add `napi_get_value_bigint_words`

* fix(napi): handle `napi_get_value_bigint_words` arr too small
2023-02-13 03:07:18 -08:00
Jarred Sumner
0db8cdf4e9 Fixes https://github.com/oven-sh/bun/issues/1456 2023-02-13 03:05:26 -08:00
Jarred Sumner
246db4fed0 Add FormData bench snippet 2023-02-13 01:36:43 -08:00
Jarred Sumner
aa0762e466 Implement FormData (#2051)
* Backport std::forward change

* Implement `FormData`

* Fix io_darwin headers issue

* Implement `Blob` support in FormData

* Add test for file upload

* Fix bug with Blob not reading Content-Type

* Finish implementing FormData

* Add FormData to types

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-02-13 00:50:15 -08:00
Alex Lam S.L
cdbc620104 [install] support git://github.com/ dependencies (#2059) 2023-02-12 14:44:39 -08:00
Ashcon Partovi
bb2aaa36fb Add release signing to release workflow 2023-02-12 13:10:10 -08:00
Jarred Sumner
f4f88701c5 prettier + stop server 2023-02-12 04:41:18 -08:00
Michał Warda
cc214baacf Return server on listen (#2057) 2023-02-12 04:37:28 -08:00
Jarred Sumner
83473c60df Set require("module").globalPaths to empty array
https://github.com/oven-sh/bun/issues/1641#issuecomment-1427017442
2023-02-12 04:35:52 -08:00
Alex Lam S.L
8b4e58f3d2 fix string corruption in FS entry cache (#2055) 2023-02-11 21:35:33 -08:00
Alex Lam S.L
30e82c5df4 fix segfault during non-install script execution (#2045) 2023-02-11 20:40:18 -08:00
Derrick Farris
9eba1e0e3f [WIP] feat(napi): add napi-fatal-exception (#2054)
* feat(napi): add `napi-fatal-exception`

* fix(napi): fatal_exception - add symbol to list, don't optimize away
2023-02-11 20:20:25 -08:00
Jarred Sumner
675529bd0c Fixes https://github.com/oven-sh/bun/issues/2052 2023-02-11 18:11:09 -08:00
Jarred Sumner
5528c0fa47 Backport std::forward change 2023-02-11 17:31:16 -08:00
Justin Whear
c208c4e319 Fix #631: bun add throwing JSON lexer bug (#2041)
* add double-backslash to list of control chars

* update test

* stderr as string
2023-02-10 19:05:32 -08:00
Eric Zhang
10650cced2 Fix PATH setup in macOS setup instructions (#2044)
Very minor! I was just going through the setup instructions and had a bit of a double take.
2023-02-10 15:16:51 -08:00
Jarred Sumner
8466e60e3a update to simdutf 3.2.0
thanks @lemire
2023-02-10 15:02:30 -08:00
Derrick Farris
b1aac9ff6d fix(string_immutable): fix toUTF16Alloc for bindgen w/ use_simdutf = false (#2042) 2023-02-10 13:12:14 -08:00
Ashcon Partovi
ed2e0e1617 Add bun-ecosystem for running tests on npm packages 2023-02-10 09:47:59 -08:00
Alex Lam S.L
09585c4b24 [install] fix duplicate check on peerDependencies (#2039)
fixes #2037
2023-02-10 09:23:40 -08:00
Alex Lam S.L
5181aa54e2 drop ASCII double-scan and other minor clean-ups (#2038) 2023-02-10 09:22:24 -08:00
Jarred Sumner
995880a7ef Enable https://github.com/tc39/proposal-set-methods 2023-02-10 00:27:06 -08:00
Jarred Sumner
941c6ed814 Upgrade WebKit 2023-02-09 21:28:50 -08:00
Alex Lam S.L
6052a3edbd fix assertion failure (#2033) 2023-02-09 21:20:11 -08:00
Alex Lam S.L
6fd7c1921e [install] fix flaky tests (#2032) 2023-02-09 20:35:58 -08:00
Alex Lam S.L
119120d21c [simdutf] workaround validation OOB access (#2031) 2023-02-09 20:26:23 -08:00
Jarred Sumner
4bedd3833d Workaround https://github.com/simdutf/simdutf/issues/213 2023-02-09 19:06:20 -08:00
Alex Lam S.L
2abfa8abd2 [streams] fix byte accounting (#2029)
fixes #1939
2023-02-09 17:04:36 -08:00
Jarred Sumner
ad9d4fb0c4 Add a note about builtins 2023-02-09 14:09:50 -08:00
Jarred Sumner
523b112945 [bun:test] Auto-import jest globals in test files 2023-02-09 00:30:40 -08:00
Jarred Sumner
8aa29040e6 move some code around 2023-02-08 23:09:24 -08:00
Jarred Sumner
a2afb252bf Update CONTRIBUTING.md 2023-02-08 21:46:53 -08:00
Jarred Sumner
abb89f489f Create CONTRIBUTING.md 2023-02-08 20:47:11 -08:00
Jarred Sumner
ddec9e0bf6 handle more cases with util.isError 2023-02-08 17:18:02 -08:00
Jarred Sumner
4962bea4fc cleanup util.test 2023-02-08 17:17:40 -08:00
Alex Lam S.L
f31330d3e2 [install] pick latest tagged version by default (#2016)
* [install] pick `latest` tagged version by default

fixes #1993

* update `package.json` the same way as `npm
2023-02-08 16:28:29 -08:00
Ashcon Partovi
ee8ccca605 Remove test run workflow, for now 2023-02-08 16:11:24 -08:00
Dylan Conway
6fdbb25f9a utf16 to utf8 conversion validation (#2001)
* use replacement character for invalid surrogate pairs

* return index of non-ascii

* non-allocating case

* edge cases

* function rename

* oops

* get length once, index counter
2023-02-08 14:42:10 -08:00
RobViren
b8c0554839 Fix minor version bug for README.md (#2013)
Addresses issue #2012 and corrects the minor version to the current minor version
2023-02-08 14:39:57 -08:00
Alex Lam S.L
18807cef03 [install] assorted fixes & improvements (#2011)
- take `peerDependencies` into account during package placement
- do not recursively resolve `workspaces` (matches `npm`)
- link binaries to non-root packages correctly
- prune empty nodes during dependency tree construction
- support non-standard `workspace:` specifier
2023-02-08 14:37:14 -08:00
Ashcon Partovi
cbc28afd51 Fix 'MissingPackageJSON' in Dockerfile
Closes #2008
2023-02-07 14:33:22 -08:00
Jarred Sumner
7886bce8c8 cleanup 2023-02-07 10:51:55 -08:00
Ashcon Partovi
7cd26232b1 Update docker image in README 2023-02-07 08:46:09 -08:00
Ashcon Partovi
a0b0cd6844 Fix bugs with release script 2023-02-07 04:47:36 -08:00
Jarred Sumner
52f9c3d05e set the type 2023-02-06 23:27:18 -08:00
Jarred Sumner
f947987a2c default not configurable 2023-02-06 23:19:12 -08:00
Jarred Sumner
30106c4f54 Fix failing test in debug mode 2023-02-06 23:19:05 -08:00
Jarred Sumner
34b2d7fe57 Mark things as DontDelete 2023-02-06 23:15:32 -08:00
Jarred Sumner
153834cf5c Throw on process.binding 2023-02-06 23:15:23 -08:00
Jarred Sumner
6aea31f4fc cleanup 2023-02-06 22:41:44 -08:00
Jarred Sumner
0fd144993c Fix test failing on macOS 2023-02-06 22:41:37 -08:00
Jarred Sumner
6699fe14e7 minor cleanup 2023-02-06 22:32:10 -08:00
Jarred Sumner
add7b1101e Add bounds check 2023-02-06 22:29:24 -08:00
Alex Lam S.L
5a19f8434b [WIP] fix corner cases with aliases dependencies (#2000)
* fix corner cases with aliases dependencies

* in-memory convert legacy `bun.lockb`
2023-02-06 22:24:34 -08:00
Jarred Sumner
d5f3bb1c74 Update text-decoder.mjs 2023-02-06 22:13:05 -08:00
Colin McDonnell
08e33fbd42 Fix gaps in types (#2003)
* Add type for clearImmediate

* Expose Crypto class

* Add types for CustomEvent

* Add types for module and exports

* Add types for global

* Add types for DOMException

* Add types for WebAssembly

* Update formatting

* Fix clearTimeout

* Fix formatting

* Update formatting

* Remove log

---------

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2023-02-06 21:36:36 -08:00
Jarred Sumner
7ddbbc53b4 Make Stat functions fast 2023-02-06 21:18:58 -08:00
Jarred Sumner
85611272c6 bump 2023-02-06 20:35:59 -08:00
Jarred Sumner
c40912b8dc formatting 2023-02-06 20:28:59 -08:00
Jarred Sumner
77974f2a6e tweaks to generator 2023-02-06 19:27:21 -08:00
Jarred Sumner
ed72bee373 Mark some things as not configurable 2023-02-06 19:27:16 -08:00
Jarred Sumner
05f3a22cba Use new bindings for Stat
Fixes #1999
2023-02-06 18:40:52 -08:00
Jarred Sumner
f5df1044d4 Fix build 2023-02-06 18:39:03 -08:00
Jarred Sumner
4329f6ad16 Backport https://github.com/WebKit/WebKit/pull/9713 2023-02-06 14:21:25 -08:00
Michał Warda
fd4668d97c Expose Dirent and Stats (#1998)
* Expose dirent and stats

* Expose Dirent and Stats inside fs

* Add tests for Dirent and Stats exposing

* Automatically generate bindings
2023-02-06 14:15:20 -08:00
Ciro Spaciari
8c4ed963ec fix(uWS:capi) uws_req_set_yield typo and uws_res_override_write_offset (#1996) 2023-02-06 12:59:04 -08:00
Colin McDonnell
e7f9ce47f4 Add types for node:console and node:perf_hooks (#1982)
* Add types for node:console and node:perf_hooks

* Add types for util/types

---------

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2023-02-06 12:57:19 -08:00
Dylan Conway
98022bec1e mark binding 2023-02-06 12:23:59 -08:00
Cheng Shao
397f559e77 Fix URL of wasi-js (#1997) 2023-02-06 11:35:01 -08:00
Jarred Sumner
ca2e708be1 speed it up a little more 2023-02-05 07:07:35 -08:00
Jarred Sumner
8649136845 substringSharingImpl allocates, do not use 2023-02-05 06:17:21 -08:00
Jarred Sumner
e8fe6dd2f8 Faster Buffer.toString("ascii") 2023-02-05 04:14:16 -08:00
Gaurish Sethia
df126b2f3b Bump querystring-es3 (#1988)
* Add filePath property on MatchedRoute

* Fix #1880 #851

* Fix #1972 as well

* FMC

* Bump querystring-es3

---------

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-02-04 23:15:42 -08:00
Jarred Sumner
7d3a2ca382 Add isDeepStructEqual to node:util 2023-02-04 00:34:03 -08:00
Jarred Sumner
b7c96bfaae Fixes #1978 2023-02-03 22:29:32 -08:00
Justin Whear
a2fd20e5c0 Implement os.cpus() for Linux (#1977)
* Implement os.cpus() for Linux

`os.cpus()` currently returns an empty array for all platforms.  This PR implements full functionality for Linux and has been tested on x86-64.  Other OSes will continue to return an empty array.

Note that Linux on Arm64 may report the CPU model differently; if this is the case the CPU model will currently be reported as "unknown".  As I do not have Arm64 hardware to verify and develop against, a todo has been left in the code.

* resolve issues from review
2023-02-03 18:13:33 -08:00
Jarred Sumner
de613baf81 Support passing Date to Bun.sleep 2023-02-03 17:25:25 -08:00
Jarred Sumner
4590e2b83a Add test for propagating exception 2023-02-03 17:04:47 -08:00
Jarred Sumner
2758e0cab9 Add missing crypto export
Fixes #1984
2023-02-03 16:39:16 -08:00
Jarred Sumner
7d386bf1f1 Introduce await Bun.sleep(ms) 2023-02-03 16:39:16 -08:00
Ashcon Partovi
164cd774f7 Fix types for Array.fromAsync 2023-02-03 16:29:03 -08:00
Gaurish Sethia
6469649f64 Fix/Update Typescript types (#1972)
* Add filePath property on MatchedRoute

* Fix #1880 #851

* Fix #1972 as well

* FMC

---------

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-02-03 14:53:18 -08:00
Jarred Sumner
06d073003d fix require("perf_hooks") 2023-02-03 14:39:07 -08:00
Jarred Sumner
50f1dd61a6 allow other ArrayBufferView in Buffer functions 2023-02-03 14:39:07 -08:00
Jarred Sumner
c64d7933a1 Make it less flaky 2023-02-03 14:39:07 -08:00
Ashcon Partovi
b289b51894 Run tests on pull requests 2023-02-03 11:55:15 -08:00
Ashcon Partovi
17ad8005c7 Run tests on push 2023-02-03 11:54:31 -08:00
Dylan Conway
f572305013 another 2023-02-03 11:50:23 -08:00
Dylan Conway
17b4e5ce08 integers overflowing 2023-02-03 11:47:21 -08:00
Ashcon Partovi
3933ccab3b Attempt to debug annotations 2 2023-02-03 11:35:24 -08:00
Ashcon Partovi
92255d56c8 Attempt to debug annotations 2023-02-03 11:32:01 -08:00
Ashcon Partovi
ba076b0a2b Fix console output in bun wiptest 2023-02-03 11:23:55 -08:00
Ashcon Partovi
10600c4abd Use GitHub action SDK 2023-02-03 11:18:44 -08:00
Ashcon Partovi
d16dffa2b4 Add workflow for bun wiptest 2023-02-03 11:01:22 -08:00
Alex Lam S.L
65e0d10ee0 prettier deltas (#1973) 2023-02-02 17:29:28 -08:00
Colin McDonnell
742368f03a Update/fix types (#1955)
* WIP

* Update types

* Spacing

---------

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2023-02-02 17:29:10 -08:00
Dylan Conway
242dcea2fe match formatting 2023-02-02 16:15:12 -08:00
Jarred Sumner
198322073d Update string_immutable.zig 2023-02-02 15:58:10 -08:00
Jarred Sumner
b12762af6c Fix stack overflow when console.log'ing strings 2023-02-02 15:56:16 -08:00
Ashcon Partovi
440a21eb1d Add bun-test to run bun wiptest 2023-02-02 11:57:36 -08:00
Jarred Sumner
2bc4858346 export more 2023-02-02 01:34:41 -08:00
Jarred Sumner
26d15cf542 Update build-id 2023-02-02 01:32:39 -08:00
Derrick Farris
8361513acf feat: add http.request (#1959)
* fix(node-test-helpers): make sure to call done with any Errors thrown from wrapped fn

* feat(node:http): add http.request, patch some missing apis for IncomingRequest, etc.

* fix(node:http): FakeSocket -> Socket

* refactor(node:http): only save type from IncomingMessage.options for now

* fix(node:http): remove unnecessary check for UInt8Array

* perf(node:http): globalThis.fetch -> var fetch = Bun.fetch

* todo(node:http): add notes about handling abort/timeout w/ AbortSignal

* refactor(node:http): standardize on FakeSocket and this.#fakeSocket

* fix(node:http): fix headers getter

* fix(node:http): remove _headers

* perf(node:http): make http headers lazy

* fix(node:http): return bool from keepSocketAlive
2023-02-01 19:22:29 -08:00
Dylan Conway
19eca76498 change file extension 2023-02-01 19:06:56 -08:00
Dylan Conway
3c23f9ad57 fix text encoding for utf8 (#1967)
* use character

* replacement character

* also test encoding decoded points

* increase length by 1
2023-02-01 18:48:09 -08:00
Alex Lam S.L
76f3c9c07b resolve duplicate npm dependencies correctly (#1970)
* resolve duplicate npm dependencies correctly

fixes #1952

* modify the correct reference
2023-02-01 18:13:25 -08:00
Ashcon Partovi
3a3bf33335 Stop releasing bun:0 for docker 2023-02-01 15:01:12 -08:00
Ashcon Partovi
69ee87d8e2 Add script to calculate semver for release 2023-02-01 14:53:57 -08:00
Ashcon Partovi
6d0fff4fab Fix version in bun-types canary release 2023-02-01 14:16:48 -08:00
Ashcon Partovi
f7a93fe294 Add bun-types release to canary workflow 2023-02-01 14:13:39 -08:00
Ashcon Partovi
02fc87ea29 Fix bad tag in npm publish 2023-02-01 14:03:00 -08:00
Ashcon Partovi
7f853af6f0 Add bun-types release to workflow 2023-02-01 14:00:31 -08:00
Ashcon Partovi
04309431bb Tweak commit message for robobun 2023-02-01 13:37:36 -08:00
Ashcon Partovi
fc712ead2f Add GPG key to release 2023-02-01 13:28:30 -08:00
Ashcon Partovi
e7f2d34c44 Maybe fix permissions with Homebrew 2023-02-01 12:02:43 -08:00
Ashcon Partovi
0c3e55132c Update homebrew release action 2023-02-01 11:33:08 -08:00
Ashcon Partovi
c69bbbd24f Update trustdb in Docker image 2023-02-01 11:24:12 -08:00
Ashcon Partovi
c0bfdebbd9 Fix grouping for Docker tag 2023-02-01 11:02:39 -08:00
Ashcon Partovi
9c27b5d17f Fix getting SHA for canary 2023-02-01 10:56:08 -08:00
Ashcon Partovi
9973df028b Fix missing dependency from release script 2023-02-01 10:44:19 -08:00
Ashcon Partovi
a0be199b4f Add morningly workflow to release to canary 2023-02-01 10:42:04 -08:00
Ashcon Partovi
73d6c888b9 Add bun-release package 2023-02-01 10:28:01 -08:00
Gaurish Sethia
661fca9cde Add filePath property on MatchedRoute (#1964) 2023-02-01 05:10:48 -08:00
Jarred Sumner
b0803298f9 Update javascript_core_c_api.zig 2023-02-01 00:52:45 -08:00
Jarred Sumner
6318017f84 Update module_loader.zig 2023-02-01 00:52:45 -08:00
Colin McDonnell
696d4b6267 Add target for printing version in makefile (#1957)
* Add get-*

* Add print-version target

* Webkit

---------

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2023-01-31 20:35:12 -08:00
Jarred Sumner
cc4326cd82 Re-run prettier after changes 2023-01-31 17:55:16 -08:00
Jarred Sumner
c57b37d29f Handle invalid input in clear* timer 2023-01-31 17:52:17 -08:00
Jarred Sumner
b09896f06e mostly fix node:timers 2023-01-31 17:51:36 -08:00
Jarred Sumner
b7816f3175 Fixes fs.constants 2023-01-31 17:20:48 -08:00
Jarred Sumner
0dfde6f8c7 misc wasi fixes + prettier 2023-01-31 15:17:39 -08:00
Jarred Sumner
0788bc1d94 Fixes #1958 2023-01-31 15:05:52 -08:00
Jarred Sumner
28a7f27633 Remove validateion 2023-01-31 15:05:52 -08:00
Jarred Sumner
b2daf3c982 Update build-id 2023-01-31 13:32:24 -08:00
Alex Lam S.L
9598868b57 [bun add] various fixes (#1953) 2023-01-31 13:05:41 -08:00
Devin Rhode
79b32f80fa Use proper casing for tsconfig values (#1644)
See: https://share.cleanshot.com/gcB3gbXJz6RQk5tx559n
2023-01-31 12:22:50 -08:00
Jarred Sumner
4bfdad2981 Fix missing *ms getters in Stat
Related to #1949
2023-01-31 03:04:59 -08:00
Jarred Sumner
3ddd8b2fa5 Fixes #1949 2023-01-31 02:15:00 -08:00
Jarred Sumner
da598a3f37 Update build-id 2023-01-30 23:13:14 -08:00
Jarred Sumner
ad3295668f Fix crash in bun install <package-name> (#1947)
* Fix crash in `bun install <package-name>` when <package-name> already exists

* Prettier

* Add test

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-01-30 23:12:41 -08:00
Jarred Sumner
f9fd7e9d08 Fixes #1928 2023-01-30 17:39:52 -08:00
Jarred Sumner
8b8bd6a405 remove log that appears in production 2023-01-30 16:14:23 -08:00
Ciro Spaciari
aa10799d8a fix utf16le fill and utf8 partial write of utf16 (#1943) 2023-01-30 12:21:23 -08:00
Alex Lam S.L
ec2c16fefa fix assert() crash (#1941) 2023-01-30 12:20:29 -08:00
Alex Lam S.L
c11bb93552 report invalid input file as test failure (#1938)
fixes #1935
2023-01-30 01:55:32 -08:00
Alex Lam S.L
5c30983d5d [bunx] fix version parsing (#1937) 2023-01-30 00:33:13 -08:00
Jarred Sumner
c9ca729493 Update buffer-create.mjs 2023-01-29 22:59:16 -08:00
Jarred Sumner
9cd9df698a Update child_process-node.test.js 2023-01-29 22:42:03 -08:00
Jarred Sumner
57edf3d91f Skip flaky test 2023-01-29 22:36:29 -08:00
Jarred Sumner
f9b14dc87b Fix flaky websocket test
cc @dylan-conway, the tests should be able to run when cwd is not the test folder
2023-01-29 22:36:24 -08:00
Jarred Sumner
a9bdc0fd44 Add check in test 2023-01-29 22:35:32 -08:00
Jarred Sumner
703bee976b [breaking] Add binaryType option to Bun.connect & Bun.listen
This is a breaking change because the default is `Buffer`, but previously the default was `Uint8Array`. While `Buffer` is a subclass of `Uint8Array`, it still technically is a breaking change because `slice` in `Uint8Array` is not semantically identical to `slice` in `Buffer`

cc @colinhacks, the .d.ts changes I made here aren't great.
2023-01-29 22:33:37 -08:00
Jarred Sumner
eb5105aa09 Update buffer.test.js 2023-01-29 21:27:52 -08:00
Jarred Sumner
552a1940eb [buffer] More passing Node.js tests 2023-01-29 21:27:42 -08:00
Jarred Sumner
98becc3538 Add another latin1 test 2023-01-29 21:23:10 -08:00
Jarred Sumner
49d8316922 Make this more careful 2023-01-29 19:01:47 -08:00
Jarred Sumner
7a496fa41a Fixes #1915 2023-01-29 19:01:39 -08:00
Jarred Sumner
4211f733d1 cleanup 2023-01-29 18:59:14 -08:00
Jarred Sumner
44eec0c5bb Fixes #1933 2023-01-29 16:29:39 -08:00
Agnieszka Stec
ac64d87a1c Update README.md (#1934)
Hi, just caught 2 small typos in Readme
2023-01-29 14:58:26 -08:00
Jarred Sumner
8e52e36846 [buffer] Buffer.byteLength passes Node.js tests 2023-01-29 03:45:58 -08:00
Jarred Sumner
348e72356b Bump WebKit 2023-01-29 01:26:16 -08:00
Jarred Sumner
035d31904a Make the build less flaky 2023-01-29 00:25:10 -08:00
Jarred Sumner
192629c8ca Fix bug in fs.openSync 2023-01-29 00:10:46 -08:00
Jarred Sumner
75181ea1f3 Add helper 2023-01-29 00:10:46 -08:00
Alex Lam S.L
d9c1a18776 [bun add] fix more corner cases (#1930) 2023-01-28 23:54:47 -08:00
Jarred Sumner
f087388ebc Support running WASI (WebAssembly) files using bun run (#1929)
* another micro bench

* Support running WASI

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-01-28 23:23:26 -08:00
Alex Lam S.L
48eb0c12ab parse git+https://github.com/ as GitHub URLs (#1926)
fixes #1921
2023-01-28 22:14:07 -08:00
Alex Lam S.L
fe389ad5ab normalise bun add package specifiers (#1924)
- fix invalid buffer references

fixes #1920
2023-01-28 21:30:46 -08:00
Alex Lam S.L
97b637a0bc fix corner cases with aliased dependencies (#1927) 2023-01-28 15:49:30 -08:00
u9g
7e9c88aa41 Fix if condition always being true (#1923) 2023-01-28 14:07:57 -08:00
Alex Lam S.L
07258bd559 [WIP] append GitHub package after fully parsed (#1911) 2023-01-28 07:05:28 -08:00
Jarred Sumner
0646efbf30 fix broken build
this breaks the build

@Electroid feel free to re-enable once it works
2023-01-28 05:47:22 -08:00
Jarred Sumner
517bdbdd0c Update bun-linux-build.yml 2023-01-28 05:03:00 -08:00
Jarred Sumner
7f8be29f25 [buffer] Use jsDynamicCast 2023-01-28 04:06:35 -08:00
Jarred Sumner
7db4b90837 commit failing tests 2023-01-28 04:03:45 -08:00
Jarred Sumner
cd48346ca8 use wrapper 2023-01-28 04:03:33 -08:00
Jarred Sumner
1b6a99636d [buffer] Do not throw in getters 2023-01-28 03:52:47 -08:00
Jarred Sumner
188c1f1f75 [buffer] Use length instead of byteLength for non-uint8array and non-arraybuffer 2023-01-28 03:50:32 -08:00
Jarred Sumner
812490e4a4 [buffer] Add missing offset property 2023-01-28 03:49:57 -08:00
Jarred Sumner
128a293901 Make the parser error in bun install look better 2023-01-28 01:09:42 -08:00
Jarred Sumner
6557df2912 Fixes #1913 2023-01-28 01:00:26 -08:00
Jarred Sumner
aff91436c0 Buffer.from doesn't need to be the Buffer constructor 2023-01-27 22:55:46 -08:00
Jarred Sumner
8075158639 Make Bun.dns lazy 2023-01-27 21:58:33 -08:00
Jarred Sumner
2757dc5e1b prettier 2023-01-27 21:56:48 -08:00
Jarred Sumner
cd90342a76 Fix flakiness 2023-01-27 21:56:34 -08:00
Jarred Sumner
8d622ad541 Fixes #1904 2023-01-27 21:39:40 -08:00
Ashcon Partovi
ed5bcf17fc Fix incorrect docker image 2023-01-27 21:21:26 -08:00
Ashcon Partovi
9e46ca19d8 Maybe fix path issue with Docker action 2023-01-27 21:09:12 -08:00
Ashcon Partovi
866646a98e Fix latest later... 2023-01-27 21:00:19 -08:00
Ashcon Partovi
4118c3d0a6 Fix invalid expression, 2nd attempt 2023-01-27 20:56:59 -08:00
Ashcon Partovi
6029a57d0b Fix invalid expression 2023-01-27 20:55:15 -08:00
Ashcon Partovi
309b741aa1 Tweak release scripts 2023-01-27 20:53:09 -08:00
Dylan Conway
d90a00857b fix sentinel mismatches 2023-01-27 20:41:15 -08:00
Ashcon Partovi
5ab2c8e4d6 Remove 'id' from each job 2023-01-27 20:39:02 -08:00
Ashcon Partovi
c194f15418 Fixup docker release 2023-01-27 20:36:13 -08:00
Ashcon Partovi
3be8a4733a Create unified release workflow 2023-01-27 20:31:18 -08:00
Jarred Sumner
3243936d3e less flaky macOS build 2023-01-27 20:25:44 -08:00
Dylan Conway
ec1ba91c38 fix import 2023-01-27 20:00:21 -08:00
Dylan Conway
ea55ef504b ensure name is allocated with toSliceClone (#1917)
* ensure name is allocated with `toSliceClone`

* shorten toSliceClone
2023-01-27 19:38:40 -08:00
Ashcon Partovi
34b643e654 Enable release signing 2023-01-27 19:14:14 -08:00
Jarred Sumner
2e1c7f5597 sentinel 2023-01-27 15:27:04 -08:00
Jarred Sumner
6cccc0d26c Update uws 2023-01-27 15:27:04 -08:00
Dylan Conway
0147647e06 fix sentinel slice 2023-01-27 14:49:12 -08:00
Jarred Sumner
ec010e4930 Update buffer.test.js 2023-01-27 14:47:13 -08:00
Dylan Conway
41af4b43e2 more websocket ref/deref tests 2023-01-27 14:22:03 -08:00
Ciro Spaciari
c1d05cf623 fix(Express.js) Express.js try to use function as hostname (#1914) 2023-01-27 13:33:53 -08:00
Jarred Sumner
724f23c19f Update watcher.zig 2023-01-27 03:54:30 -08:00
Jarred Sumner
ddca89f425 🪦 2023-01-27 03:53:01 -08:00
Jarred Sumner
805e87eeb6 Add a comment 2023-01-27 03:29:53 -08:00
Jarred SUmner
8dc1140f43 Fixup 2023-01-27 02:10:30 -08:00
Jarred Sumner
b136125bb0 [[bun hot]] More reliability improvements to macOS watcher 2023-01-27 01:56:07 -08:00
Jarred Sumner
1da7f5fe5d [bun --hot] Report exceptions in reloaded modules 2023-01-27 00:21:04 -08:00
Jarred Sumner
655c19b07c More reliable bun --hot on macOS 2023-01-27 00:15:56 -08:00
Jarred SUmner
ed5bcfc76b Another test 2023-01-26 23:21:10 -08:00
Jarred SUmner
421588d631 More reliable bun --hot on Linux 2023-01-26 23:04:37 -08:00
Jarred SUmner
915b46768c Remove usages of assumeSentinel 2023-01-26 23:04:37 -08:00
Jarred Sumner
7169bbbb9c Fixes #1907 2023-01-26 19:18:35 -08:00
Ciro Spaciari
6d06606135 Implement all pending resolve methods in DNS (#1903)
* initial steps to create generic resolve

* add soa

* add naptr

* add naptr

* add mx and fix naptr

* add resolve caa

* fix Caa test

* fix toJS from caa

* add resolveNs

* add resolvePtr

* fix resolvePtr test

* add resolveCname

* add resolve rrtype options (still missing ANY)

* fix Naptr

* fix drainPendingCares
2023-01-26 18:36:53 -08:00
Dylan Conway
44c6ce11c4 fix websocket hang (#1910)
* ref and deref, and some tests

* subprocess file

* remove deref

* use flag in test
2023-01-26 18:26:05 -08:00
Ciro Spaciari
b32b0b8736 fix large packages receive for WS client (#1909) 2023-01-26 15:08:34 -08:00
Jarred SUmner
fbe45fcb03 Fix branching on undefined 2023-01-26 05:20:53 -08:00
Jarred SUmner
2c23d8736f valgrind 2023-01-26 04:45:24 -08:00
Jarred SUmner
f14032e4b4 zig changes 2023-01-26 04:43:57 -08:00
Jarred Sumner
d912214719 Upgrade Mimalloc 2023-01-26 04:03:36 -08:00
Jarred Sumner
6c9e7de824 copy paste is harder to mess up than C macros 2023-01-26 04:02:21 -08:00
Alex Lam S.L
f8f989f667 parse package-spec from CLI correctly (#1895)
* parse package-spec from CLI correctly

fixes #861

* copy separately for `UpdateRequest.name`

fix GItHub URL reporting in results

update tests to reflect latest code changes

* better fix for GitHub URL display issue
2023-01-26 01:06:51 -08:00
Jarred Sumner
781df80a90 [bun install] Support verifying GitHub dependencies 2023-01-25 17:26:49 -08:00
Jarred Sumner
b26ff0074d [bun install] Include the resolved version for github dependencies in the hash 2023-01-25 17:26:09 -08:00
Jarred Sumner
0a8e42a4ba [bun install] For github dependencies, write a .bun-tag to mark the revision 2023-01-25 17:25:19 -08:00
Jarred Sumner
b767f9a99a Add a test 2023-01-25 13:43:23 -08:00
Jarred Sumner
f61ee1ed42 Fixes #1902 2023-01-25 13:42:31 -08:00
Jarred Sumner
a8743f0a34 Fix "failed to resolve" 2023-01-25 02:21:40 -08:00
Jarred Sumner
468226fc90 be more careful 2023-01-25 01:52:04 -08:00
Jarred Sumner
9cb1ec2c58 Undo 2023-01-25 01:10:15 -08:00
Jarred Sumner
0f2c9c9ff3 Fix "failed to resolve" bug 🫠 2023-01-25 01:09:42 -08:00
Jarred Sumner
ed2a57fcc9 Add log 2023-01-25 01:09:05 -08:00
Jarred Sumner
81b6878e1a Add assertion 2023-01-24 23:54:42 -08:00
Jarred Sumner
325ffd70e1 one less alloc 2023-01-24 23:53:03 -08:00
Jarred Sumner
d4ce045f9e More careful about the lifetime of alias 2023-01-24 23:51:48 -08:00
Jarred Sumner
7f65875406 Update base.zig 2023-01-24 23:51:02 -08:00
Jarred Sumner
ce38365106 assert defined in development 2023-01-24 23:50:35 -08:00
Jarred Sumner
a3cc911e7a get cache key for github in one pass 2023-01-24 22:27:06 -08:00
Sean Scally
ac7aff1b47 Add FileSystemRouter + React example (#1894) 2023-01-24 19:09:39 -08:00
Ashcon Partovi
d714df48f9 Add npm install -g bun to README 2023-01-24 12:42:37 -08:00
Ashcon Partovi
fb1902448e Add bunx to bin for npm installer 2023-01-24 12:04:35 -08:00
Alex Lam S.L
f43b675200 support GitHub URLs as dependencies (#1875) 2023-01-24 11:57:25 -08:00
Alex Lam S.L
e47fe2ca00 support bun link of scoped packages (#1892) 2023-01-24 11:52:47 -08:00
Ashcon Partovi
2edbf4d0ec Iterate on canary version again 2023-01-24 11:17:08 -08:00
Ashcon Partovi
645b7271f9 npm does not accept '+build' in releases :( 2023-01-24 10:31:04 -08:00
Ashcon Partovi
77c72b3193 Fix detection of canary 2023-01-24 10:06:58 -08:00
Ashcon Partovi
34f97be86a Copy .npmrc to each package 2023-01-24 09:59:58 -08:00
Ashcon Partovi
2ffe77140e Maybe fix .npmrc 2023-01-24 09:38:44 -08:00
Jarred Sumner
be79f6e893 Add failing test 2023-01-24 04:08:24 -08:00
Jarred Sumner
bb5119f7eb Add simple test for bun --hot 2023-01-24 03:30:27 -08:00
Jarred Sumner
6f682c6369 Use more specific function 2023-01-24 03:03:57 -08:00
Jarred Sumner
05b1ce39d2 Faster string length in napi 2023-01-24 03:03:44 -08:00
Jarred Sumner
6cf87d022f [napi] Clean up some string handling code 2023-01-24 02:59:51 -08:00
Jarred Sumner
6c3842f67d Update text-decoder.test.js 2023-01-24 02:31:53 -08:00
Jarred Sumner
63403741ff flaky 2023-01-24 02:31:45 -08:00
Jarred Sumner
66643a5b57 Try resolving against the path without the .js extension 2023-01-24 02:22:16 -08:00
Jarred Sumner
e2f709b2a5 Always allow importing ${package}/package.json 2023-01-24 02:21:43 -08:00
Jarred Sumner
4ea104f5bd Fix canary bug 2023-01-24 00:57:03 -08:00
Jarred Sumner
0fe7f7b6f0 Update README.md 2023-01-24 00:56:39 -08:00
Jarred Sumner
566a2c668b Sort families 2023-01-24 00:14:59 -08:00
Jarred Sumner
ad692495a1 Update class-definitions.ts 2023-01-24 00:14:59 -08:00
Jarred Sumner
2c31beda75 Fixes #1887 2023-01-24 00:14:59 -08:00
Ashcon Partovi
cd684fdad0 Tweak semver for canary again 2023-01-23 23:38:38 -08:00
Ashcon Partovi
ad40eec079 Fix ordering of github action command 2023-01-23 23:10:16 -08:00
Jarred Sumner
90d62ecc24 Add DOMJIT test 2023-01-23 23:08:31 -08:00
Ashcon Partovi
cab1f860e4 npm install bun (#1874)
* Add bun-npm package to publish and install Bun via npm

* Add newlines to patchJson

* Update version to latest release

* Tweak semver for canary

* Use GITHUB_TOKEN

* Prevent bun from being run in slow mode
2023-01-23 23:06:13 -08:00
Jarred Sumner
7ca867f7c8 3x faster Buffer.isBuffer 2023-01-23 22:34:04 -08:00
Jarred Sumner
fe03e90d80 Update build-id 2023-01-23 19:05:41 -08:00
Jarred Sumner
f992942391 Make Object.prototype.toString.call(new Buffer(0)) consistent with Node.js 2023-01-23 18:51:04 -08:00
Jarred Sumner
7420cb1d73 fix test failure in aarch64 and add test for simd code path 2023-01-23 18:03:48 -08:00
Dylan Conway
73961a1494 missing test 2023-01-23 17:39:40 -08:00
Jarred Sumner
d7b5e4b901 Update uws 2023-01-23 16:51:52 -08:00
Jarred Sumner
efc024cfc4 clean up deps 2023-01-23 16:51:48 -08:00
Ciro Spaciari
b3533fb3a8 fix(Buffer) Fix arguments in buffer.write, fix size returned from buffer.write for utf16, fix size calc for base64, fix calc for hex byte size (#1881)
* fix buffer write when more than 2 args are passed

* fix encoding parameter

* better buffer write tests

* fix ucs2/utf8 len return

* fix base64 size in Buffer write

* fix hex encoding size

* actual fix base64

* actual fix base64

* fix segfault

* add fill parameter in Buffer.alloc

* use createUnitialized when alloc have fill parameter, use RETURN_IF_EXCEPTION when static casting

* fix utf16le, ucs2 copying in Buffer write
2023-01-23 16:48:52 -08:00
Dylan Conway
79c0b614ee fix child process node test hang (#1884)
* fix test hang from skipped tests

* add error target
2023-01-23 15:59:45 -08:00
Dylan Conway
f5cda8ff18 fix constructor statement order (#1883)
* leave super alone

* more tests
2023-01-23 15:57:47 -08:00
Jarred Sumner
4570ff7780 [napi] Support defining properties with symbol as names 2023-01-23 15:09:23 -08:00
Jarred Sumner
aa456805dd [napi] Handle missing description in napi_create_symbol 2023-01-23 15:09:18 -08:00
Ciro Spaciari
efd33c398f enhancement(fetch): Merge parameters from request parameter with the second parameter for fetch, move verbose and proxy options to second parameter, add non-TLS tests for fetch (#1862)
* initial steps for proxy-server

* added http_proxy in fetch, move 3rd argument to 3nd argument options, add some non-TLS proxy tests

* some changes

* use only 1 buffer for url+proxy, merge headers on fetch

* initial steps

* change back to override headers instead of merging in fetch

* fix build response.zig

* fix conditional in merged headers on fetch

* updated with main and make proxy disabled if null is passed

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-01-23 14:38:40 -08:00
Jarred Sumner
9a2b586337 Update bench 2023-01-23 05:22:03 -08:00
Jarred Sumner
df999306c0 ✂️ duplicate code 2023-01-23 05:05:54 -08:00
Jarred Sumner
45296570ce Fix crash in DOMJIT call with empty input 2023-01-23 04:58:42 -08:00
Jarred Sumner
f9306ff815 Update transpiler.zig 2023-01-23 04:09:28 -08:00
Jarred Sumner
c530ead1e0 Add a comment 2023-01-23 04:06:01 -08:00
Jarred Sumner
f6227bf6dd Upgrade Bun.Transpiler to use new bindings 2023-01-23 04:03:01 -08:00
Jarred Sumner
4f84c6bc34 Prepare for plugins 2023-01-23 04:02:06 -08:00
Jarred Sumner
d141783ebd Sort the generated classes list 2023-01-23 04:01:45 -08:00
Jarred Sumner
d4ef935478 [bindings] Add custom field to enable writing one-off C++ in the zig class 2023-01-23 04:01:36 -08:00
Jarred Sumner
bf68df0070 fix unrefOnNextTick 2023-01-22 21:22:46 -08:00
Jarred Sumner
407088f6ab Add tests for async failure 2023-01-22 20:49:21 -08:00
Jarred Sumner
2cce810190 Add a test for zlib (thanks @jiaz) 2023-01-22 19:54:42 -08:00
Jarred Sumner
eaea08ea45 Add one gc test for eventemitter 2023-01-22 19:53:59 -08:00
Jarred Sumner
4dfc09018f [EventEmitter] Preserve this in event emitter callbacks 2023-01-22 19:52:51 -08:00
Jarred Sumner
771db64cbe [bun:sqlite] cleanup run 2023-01-22 19:35:32 -08:00
Jarred Sumner
c6b941d803 Add some more emitters to the benchmark 2023-01-22 19:11:04 -08:00
Jarred Sumner
3492248697 Fixes #1366 2023-01-22 19:09:52 -08:00
Jarred Sumner
bc7192dca1 Add extremely slow node:zlib polyfill 2023-01-22 15:34:21 -08:00
Jarred Sumner
188f472ed2 Update http.exports.js 2023-01-22 14:58:57 -08:00
Jarred Sumner
befd97a891 [node:http] Add address() and fix callback / options parsing 2023-01-22 14:58:22 -08:00
Ciro Spaciari
481dbf7c6e feat(dns) resolveSrv (#1870)
* initial steps

* in-progress resolveSrv support

* fix memory leak and ZigGlobalObject

* promise.resolve + fix priority and weight mistake

* fix node dns export

* little better test

* add poll_ref to keep alive loop in callback for resolveSrv and lookup

* add test for error case in resolveSrc

* fix Bun.dns.resolveSrv type
2023-01-22 14:31:08 -08:00
Jarred Sumner
8d692f1511 Update Makefile 2023-01-22 14:20:44 -08:00
Jarred Sumner
c08b546728 Allow very old CPUs to use Bun (~2008) 2023-01-22 14:20:25 -08:00
Jarred Sumner
fefa4a1623 Add a test for require with a query string 2023-01-22 03:24:42 -08:00
Jarred Sumner
043e408b15 cleanup execArgv a little 2023-01-22 03:24:32 -08:00
Jarred Sumner
9f6658b981 stub out process.stdin.setRawMode 2023-01-22 02:40:18 -08:00
Jarred Sumner
5ce2b8e604 Implement process.execArgv 2023-01-21 23:52:51 -08:00
Jarred Sumner
ee9893c4e1 Zig stdlib change 2023-01-21 23:13:19 -08:00
Jarred Sumner
8b0e2efd6e Bump zig 2023-01-21 23:13:04 -08:00
Jarred Sumner
4d1e977399 Update uws 2023-01-21 23:12:30 -08:00
Jarred Sumner
0ee13892fd Update buffer-create.mjs 2023-01-21 23:11:55 -08:00
Jarred Sumner
99d2d6e607 Support query string parameters in module resolution 2023-01-21 23:11:31 -08:00
Jarred Sumner
a2cfdf0e1c Refactor new Buffer to pass Node.js tests 2023-01-21 23:03:43 -08:00
Jarred Sumner
29a576a167 [Buffer] Add deprecated parent property 2023-01-21 22:55:56 -08:00
Jarred Sumner
6424ce6397 Update .gitignore 2023-01-21 20:54:31 -08:00
Jarred Sumner
fdb9472f88 Fix make headers 2023-01-21 19:42:21 -08:00
Jarred Sumner
17bde9bc86 Fix test failure due to UB 2023-01-21 15:36:51 -08:00
Alex Lam S.L
fd29d05c6a minor clean-ups (#1869)
- use `Lockfile.str()` more
- allow `child-process-stdio.test.js` to run with `bun-debug`
2023-01-21 14:02:22 -08:00
Jarred Sumner
f475802206 Update module_loader.zig 2023-01-21 13:14:02 -08:00
Alex Lam S.L
f0fa760479 [semver] parse ^ & ~ expressions correctly (#1854)
* [semver] parse `^` & `~` expressions correctly

* handle semver ranges correctly against build tags
2023-01-21 04:16:26 -08:00
Jarred Sumner
24e8aa105f Remove UB with semver.String
Thanks @MasterQ32
2023-01-21 04:11:57 -08:00
Jarred Sumner
ed421855d7 [buffer] Add faster path for Uint8Array 2023-01-21 04:06:06 -08:00
Jarred Sumner
627da44527 Handle string subclasses and new String() in new Buffer 2023-01-21 03:14:00 -08:00
Jarred Sumner
9955b74622 Make Buffer.alloc* 3ns faster 2023-01-21 03:13:45 -08:00
Jarred Sumner
d955bfe50f [buffer] Make Buffer.from pass more tests 2023-01-21 03:12:59 -08:00
Dylan Conway
b8648adf87 constructor parameter properties in class expressions (#1867) 2023-01-20 16:24:40 -08:00
Jarred Sumner
ff6fb587f6 Update transpiler.test.js 2023-01-20 04:12:03 -08:00
Jarred Sumner
e361ed4451 Update transpiler.test.js 2023-01-20 04:11:47 -08:00
Dylan Conway
42e9f6e0b1 push super before generated statements (#1856) 2023-01-20 03:25:21 -08:00
Jarred Sumner
e3ed905b0a Clear the errors 2023-01-20 02:19:23 -08:00
Jarred Sumner
224312c014 one less hash table 2023-01-20 02:19:14 -08:00
Jarred Sumner
bdf792adbc Add another test 2023-01-20 00:20:33 -08:00
Jarred Sumner
3c6616a23d fix hanging test 2023-01-20 00:07:11 -08:00
Jarred Sumner
ff7e984f0a Further cleanup buffer encoding 2023-01-20 00:06:46 -08:00
Jarred Sumner
3a100af876 Fixes #1855 2023-01-20 00:06:27 -08:00
Jarred Sumner
7d7b535014 Fix assertion failure with boringssl messages 2023-01-20 00:05:48 -08:00
Jarred Sumner
a98b1751a6 Revert "ignore sighup"
This reverts commit 03ab4be9ee.
2023-01-19 23:59:20 -08:00
Jarred Sumner
03ab4be9ee ignore sighup 2023-01-19 23:56:49 -08:00
Jarred Sumner
f993975ae6 make this code easier to read 2023-01-19 21:00:53 -08:00
Jarred Sumner
53f7bd32d8 Update types.zig 2023-01-19 20:34:06 -08:00
Jarred Sumner
784496b773 Bump 2023-01-19 20:32:38 -08:00
Jarred Sumner
4c0b0e2e8e Fix buffer encoding bug 2023-01-19 20:28:34 -08:00
Alex Lam S.L
bab7e63d7c use String.from() (#1850) 2023-01-19 19:26:10 -08:00
Jarred Sumner
3511a4b5be Bump zig 2023-01-19 19:09:25 -08:00
Jarred Sumner
e485f7bb51 make it packed 2023-01-19 19:05:29 -08:00
Jarred Sumner
795cde6d62 Bugfixes to install (#1848) 2023-01-20 04:55:22 +02:00
Alex Lam S.L
9dfbf57397 repopulate alias_map correctly (#1847) 2023-01-19 16:24:56 -08:00
Jarred Sumner
e04fe64a82 Add a comment 2023-01-19 16:19:15 -08:00
Jarred Sumner
495c70053f Add a debug safety check for UAF in AST nodes 2023-01-19 16:14:56 -08:00
Jarred Sumner
9bcd4952ce Fix UAF when opening workspaces 2023-01-19 16:14:40 -08:00
Jarred Sumner
8745f10cd3 Improve error message when a workspace is not found 2023-01-19 15:48:03 -08:00
Volodymyr Palamar
ac0dab3679 Create new example http-file-extended.ts (#1827)
New code sample with http Range and ETag support
Some code is taken from here https://github.com/gornostay25/svelte-adapter-bun/blob/master/src/sirv.js
2023-01-19 10:35:55 -08:00
Ciro Spaciari
01c97e4033 fix(fetch:HTTP_PROXY) fix support for HTTP_PROXY/HTTPS_PROXY and NO_PROXY in fetch instances (#1844)
* fix response.zig fetch

* use VM bundler env instead of DotEnv.instance

* remove unnecessary import
2023-01-19 10:34:32 -08:00
Alex Lam S.L
cd5f2ab11f parse dependency specifier correctly (#1840) 2023-01-19 06:39:01 -08:00
Alex Lam S.L
61736966ad fix stale references upon Lockfile tree cloning (#1845) 2023-01-19 06:38:08 -08:00
Alex Lam S.L
8bdcded5c1 fix memory reference issues (#1841) 2023-01-19 00:53:01 -08:00
Alex Lam S.L
c0ec61cf16 support npm dependency aliasing (#1837)
* support npm dependency aliasing

* fix variable name
2023-01-18 20:11:52 -08:00
Alex Lam S.L
d4e323b997 add fs.rmdir & friends (#1838) 2023-01-18 19:56:34 -08:00
Jarred Sumner
58cbd6b211 Regenerate lockb 2023-01-18 16:51:18 -08:00
Colin McDonnell
d8d148e3bb Fix/simplify bun-types release (#1836)
* Simplify types release

* Further simplify

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2023-01-18 16:22:01 -08:00
Jarred Sumner
311185f6d6 Add a test for #1831 2023-01-18 15:00:00 -08:00
Jarred Sumner
7012d2fb74 Fixes #1831 2023-01-18 14:59:39 -08:00
Jarred Sumner
2db04ef9d9 Fix crash with invalid arguments in readdir() 2023-01-18 01:16:13 -08:00
Jarred Sumner
4cb6a34432 Don't report end() because it is inherently flaky 2023-01-18 00:28:53 -08:00
Jarred Sumner
2016e8a0af micro-optimize loading process environment variables 2023-01-18 00:28:19 -08:00
Jarred Sumner
0759530118 opposite 2023-01-18 00:24:52 -08:00
Jarred Sumner
5ed46913c4 Update node-net.test.ts 2023-01-18 00:17:11 -08:00
Jarred Sumner
bd5b90fbf1 Fix lifetime issue in require.resolve 2023-01-17 23:41:17 -08:00
Colin McDonnell
bba4054da3 Use canary in CI (#1823)
* Use canary in CI

* Only publish canary when types change

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2023-01-17 23:06:26 -08:00
华晨
d16951422b remove redundant allowSyntheticDefaultImports (#1802) 2023-01-17 21:01:55 -08:00
Jarred Sumner
e0eeb1c07e workaround lifetime issue 2023-01-17 20:10:19 -08:00
Ashcon Partovi
216e872801 Add Bun.dns to the README 2023-01-17 18:17:12 -08:00
Ashcon Partovi
6fbf437f50 Fix Bun.dns examples to use array instead of single result 2023-01-17 18:12:49 -08:00
Ciro Spaciari
c00fadab9e feat(cli): Support HTTPS_PROXY, HTTP_PROXY, and NO_PROXY #1440 (#1814)
* WIP: http_proxy implemented, first steps for https_proxy #1440

* add HTTP_PROXY support to upgrade_command and WIP: tunneling

* WIP async handshake, stuck on WANT_READ, try to defer  + check

* create and upgrade with proxy working, TLS and non-TLS to proxy TLS working

* bun install/upgrade/create working with http(s)_proxy #1440

* add NO_PROXY support #1440

* remove commented code and add TODO

* fix getHttpProxy no_proxy

* fix formatting

* refactor catch and getHttpProxy, fix empty strngs in env for proxy

* allow optimization for handleResponseBody
2023-01-17 17:47:01 -08:00
Jarred Sumner
9b260fb18b Allow error instance in process.emitWarning 2023-01-17 17:11:08 -08:00
Colin McDonnell
b931c19ba3 Add types for readline, tls, net (#1817)
* Add readline, tls, net types

* Remove unimplemented methods

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2023-01-17 16:49:18 -08:00
Jarred Sumner
9e403fc8bf cleanup error message 2023-01-17 16:47:45 -08:00
Jarred Sumner
fd0edd7aa0 [process] Implement process.emitWarning 2023-01-17 16:29:08 -08:00
Jarred Sumner
848658c533 [test] Add helper for bun env 2023-01-17 16:28:49 -08:00
Jarred Sumner
37d2a98331 Update logger.zig 2023-01-17 16:27:52 -08:00
Jarred Sumner
58d1ab02bd [canary] Fix missing .env log 2023-01-17 16:27:48 -08:00
Jarred Sumner
9f0d402a7d [EventEmitter] Fix emitter.off("eventName") 2023-01-17 16:27:21 -08:00
Jarred Sumner
f927567b9f bun install tests shouldn't fail due to terminal colors 2023-01-17 16:00:21 -08:00
Derrick Farris
94ea41a60b fix(readline/promises): new Interface() -> new PromisesInterface() (#1818) 2023-01-17 15:45:15 -08:00
Dylan Conway
8235e59a7f set available 2023-01-17 15:36:19 -08:00
Jarred Sumner
8924c521ba // flaky 2023-01-17 14:00:10 -08:00
Jarred Sumner
69875d86cd Fix console.log printing multiple properties 2023-01-17 13:44:13 -08:00
Jarred Sumner
5bdc923838 dont export twice 2023-01-17 12:53:28 -08:00
Jarred Sumner
25a2962186 Expose tls.connect 2023-01-17 12:52:49 -08:00
Jarred Sumner
c943dbadef Update crypto-hasher.mjs 2023-01-17 12:52:33 -08:00
Jarred Sumner
aacaa9b85d Bun v0.5.0 2023-01-17 00:43:56 -08:00
Jarred Sumner
74992f6f34 make node-redis work 2023-01-17 00:09:04 -08:00
Dylan Conway
12b8416b64 send and disconnect 2023-01-16 23:44:09 -08:00
Jarred Sumner
8a5ff676ea Bump zig 2023-01-16 23:21:52 -08:00
Jarred Sumner
f660f8d22f Make sure the socket keeps the process alive 2023-01-16 21:43:48 -08:00
Jarred Sumner
38cc947621 Don't need to skip these now 2023-01-16 21:42:52 -08:00
Jarred Sumner
0546aa4fd5 Make entire test line dim 2023-01-16 21:37:12 -08:00
Jarred Sumner
b8b7ad4982 [bun:test] Fix dim, fix missing space 2023-01-16 21:35:19 -08:00
Dylan Conway
d21119b347 remove onClose 2023-01-16 21:20:54 -08:00
Jarred Sumner
d3de366c67 Fix some reliability issues with net.connect and Bun.connect on macOS 2023-01-16 21:14:38 -08:00
Jarred Sumner
a1b581621c guess we'll check if it's defined 2023-01-16 20:33:31 -08:00
Jarred Sumner
274ae5de1b [bun install] Make it print workspace: instead of workspace:// 2023-01-16 18:57:04 -08:00
Jarred Sumner
74b0a1939d Fixes https://github.com/oven-sh/bun/issues/1654 2023-01-16 17:48:35 -08:00
Jarred Sumner
6f432e8b7d Remove assertion 2023-01-16 17:38:04 -08:00
Jarred Sumner
a5f7a23307 Update node-dns.exports.js 2023-01-16 17:12:23 -08:00
Jarred Sumner
88a8614abc [node:dns/promises] Fix missing import 2023-01-16 17:11:00 -08:00
Jarred Sumner
b23327c283 [node] Add process.config 2023-01-16 16:47:08 -08:00
Jarred Sumner
c83d56c75d Update c-bindings.cpp 2023-01-16 16:30:33 -08:00
Jarred Sumner
7dd28bbdd9 Fix which returning directories sometimes 2023-01-16 16:28:02 -08:00
Jarred Sumner
d54e23ca33 [napi] Fix potential crash in napi_create_buffer_copy, napi_create_buffer 2023-01-16 15:48:14 -08:00
Jarred Sumner
02f0212cbd [napi] Don't assume function exists
Fixes https://github.com/oven-sh/bun/issues/1808
2023-01-16 15:47:44 -08:00
Jarred Sumner
3484502839 [JS Parser] Don't inline rope strings 2023-01-16 15:21:11 -08:00
Jarred Sumner
a345efd270 Fix getFdPath when /proc/fd is not mounted 2023-01-16 13:59:52 -08:00
Jarred Sumner
30bfb31bce wip 2023-01-16 12:59:48 -08:00
Jarred Sumner
eef0e8c6bf Fix incorrect type 2023-01-16 12:56:16 -08:00
Jarred Sumner
4648131c41 Add missing buffer module exports 2023-01-16 12:49:57 -08:00
Colin McDonnell
b0702ce7b1 Publish bun-types@canary (#1767)
* Publish bun-types@canary

* Get version from bun cli

* Get version from bun cli

* Fixes

* Fixes

* Fixes

* Finalize

* Update names

* Add token

* Remove dryrun

* Switch setup-bun

* Test noncanary publish

* Fix path for GPR

* Use latest

* Remove testing code

* Remove dry run

* Fix paths

* Update bun-types links

* Verbose logging

* Ignore lockfile

* Run install in root

* Remove debug code

* Remove debug code

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
2023-01-16 11:58:57 -08:00
Jarred Sumner
ff3f5aa154 Don't open non-blocking on Linux 2023-01-16 11:22:54 -08:00
Jarred Sumner
91bcfa9cb4 Clean up the test 2023-01-16 11:22:54 -08:00
Jarred Sumner
cf5f9df211 Use a reusable symbol 2023-01-16 11:22:54 -08:00
Alex Lam S.L
9eb4a4ff3a [Response] reject HTTP status code correctly (#1800) 2023-01-15 03:21:34 -08:00
Alex Lam S.L
7932a55870 fix handler reset in Server.reload() (#1801) 2023-01-15 03:19:37 -08:00
Alex Lam S.L
893ec2fb45 fix life-cycle script execution (#1799)
- change current working directory for workspaces
- add `node_modules/.bin` to `PATH` before running
2023-01-14 21:37:16 -08:00
Alex Lam S.L
136014b13a fix bugs (#1795)
- segfault reading stacktrace from `fs/promises` rejections
- `Promise` rejection within `describe()` ends testing abruptly
- `FSSink.write()` incorrectly handles `objectMode`
- `FSSink.write()` throws wrong error codes
2023-01-14 16:50:55 -08:00
Jarred Sumner
d01ec47529 Fixes #1794 2023-01-14 16:37:16 -08:00
Alex Lam S.L
7fa023b8b5 support installation of NPM workspaces (#1764) 2023-01-14 07:14:48 -08:00
Jarred Sumner
aa9e56edfe [bun:test] Always dim skip 2023-01-13 13:13:01 -08:00
Jarred Sumner
88ffdc5fec [TypeScript transpiler] Fix bug with export default class implements 2023-01-13 12:48:10 -08:00
Jarred Sumner
fab42148e4 Skip failing tests 2023-01-13 11:58:44 -08:00
Jarred Sumner
cce380ec37 Fix broken test helper 2023-01-13 11:57:22 -08:00
Jarred SUmner
828fd0cfea Fix debug mode crash 2023-01-13 11:55:46 -08:00
Jarred SUmner
168bb1427f move more things 2023-01-13 11:38:16 -08:00
Jarred SUmner
996ef44c02 Split some things into more files and use bun namespace instead of import more 2023-01-13 11:27:16 -08:00
Jarred Sumner
734b5b89da Add closeActiveConnections option to types 2023-01-12 19:38:27 -08:00
Jarred Sumner
490814aa35 Update serve.test.ts 2023-01-12 19:38:27 -08:00
Jarred Sumner
ffa8913e54 Update tcp-server.test.ts 2023-01-12 19:38:27 -08:00
Jarred Sumner
73e9cd8e06 [Bun.listen] Add flag to close all connections 2023-01-12 19:38:27 -08:00
Jarred Sumner
62cab3c719 [Bun.serve] Add flag to close all connections 2023-01-12 19:38:27 -08:00
Jarred Sumner
d4f1d29393 Fix https websockets 2023-01-12 19:38:27 -08:00
Jarred Sumner
2eac47a123 Upgrade uSockets 2023-01-12 19:38:27 -08:00
Dylan Conway
32f8cb31be set remaining indexes (#1785) 2023-01-12 18:44:45 -08:00
Dylan Conway
297732bbb3 0 initialize remaining indexes in array (#1783)
* 0 initialize remaining indexes in array

* switch to memset
2023-01-12 17:53:58 -08:00
Jarred Sumner
90be254373 fix missing error page 2023-01-12 16:26:25 -08:00
Jarred Sumner
034dd3d03d make the test more resilient 2023-01-12 16:06:28 -08:00
Jarred Sumner
0384d3c558 less flaky 2023-01-12 15:37:03 -08:00
Dylan Conway
00773e15f1 reset string decoder on end (#1782) 2023-01-12 15:13:05 -08:00
Jarred Sumner
126809f20c Add missing type 2023-01-12 15:08:32 -08:00
Dylan Conway
fbe3f5dfb3 pointer type 2023-01-12 13:59:27 -08:00
Jarred Sumner
29b4c84b8c woops 2023-01-12 13:28:10 -08:00
Jarred Sumner
38f9bb96df use .skip() for failing test 2023-01-12 13:20:10 -08:00
Jarred Sumner
6e0ec3248f Add c-ares to make clean 2023-01-12 13:11:05 -08:00
Jarred Sumner
35d0cf910d Uncomment flaky test 2023-01-12 13:11:05 -08:00
Jarred Sumner
5cb84231b2 Reduce amount of cloning 2023-01-12 13:11:05 -08:00
Jarred Sumner
bbd4504954 Add a couple more tests for errors with Bun.file() 2023-01-12 13:11:05 -08:00
Jarred Sumner
a0b44e9873 more careful 2023-01-12 13:11:05 -08:00
Jarred Sumner
90c395bdac Update inspect.test.js 2023-01-12 13:11:05 -08:00
Jarred Sumner
c2b7cadd4f [bindings] Make isObject align with JSC::isObjectType 2023-01-12 13:11:05 -08:00
Jarred Sumner
1a4685213b [bun:test] Support async in expect(async () => { await 1; }).toThrow() 2023-01-12 13:11:05 -08:00
Ethan Burrell
76e6a178e3 fix(bun-test): test title in results (#1753)
* fix(bun-test): test title in results

* missed case

* clean up import

* respond to reviews
2023-01-12 12:49:36 -08:00
Jarred Sumner
bb5efb67ab Update socket.test.ts 2023-01-12 12:08:11 -08:00
Jarred Sumner
4bac561184 missing 2023-01-12 12:07:52 -08:00
Jarred Sumner
edf9757650 Fixes #1772 2023-01-12 10:14:35 -08:00
Jarred Sumner
e65def0f82 Remove extra wrapper 2023-01-11 20:21:41 -08:00
Jarred Sumner
7970704222 end callback 2023-01-11 20:21:41 -08:00
Jarred Sumner
ced3226ffb Update ImportMetaObject.cpp 2023-01-11 20:21:41 -08:00
Jarred SUmner
1c20e05d70 [Bun.serve] Introduce publishToSelf boolean on websocket: {} config object 2023-01-11 17:14:07 -08:00
Colin McDonnell
4969f068f6 Types update (#1761)
* Fix type tests

* Add dns types

* Add node:net types

* Make process.exit return never

* Make ArrayBufferView tighter

* Add types for node:dns

* Remove docs

* Use latest

* Fix CI

* Fix CI

* Stop double trigger

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

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

* Update resolver.zig

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

* Initial incorporation of feedback

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

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

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

* test(helpers): add deepStrictEqual helper

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

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

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

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

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

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

* feat(assert): add assert.match

* test(readline): uncomment more tests

* fix(readline): MaxCeil -> MathCeil 🤦

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

* fix(readline): temp fix for circular dependency

* cleanup(readline): remove console.log

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

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

* perf(readline): lazy load isWritable

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

* Add c-ares

* lookup

* make

* Implement dns.lookup

* Create c-ares

* wip

* normalize

* repro

* Revert "repro"

This reverts commit 8b93e0c295b335b8882a9601da47720348549beb.

* Implement macOS `getaddrinfo_async_start`

* embiggen

* Update string_immutable.zig

* Update Makefile

* alright

* Update .gitignore

* Add types

* more ccache

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update bun.d.ts

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

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

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

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

* Update net.exports.js

* Make it less observable

* Update net.exports.js

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

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

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

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

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

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

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

* builtins and some trivial ones

* Most of them

* more

* more!

* More Progress

* wip

* Update tagged_pointer.zig

* Update http_client_async.zig

* Most of the iterable dir changes

* alright

* Remove usages of deprecated formatters

* 📷

* fmt

* Update shimmer.zig

* wip

* wip

* wip

* progress

* more

* Latest

* stuck on error

* latest

* workaround stage2

* wip

* Update string_immutable.zig

* wip

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

* Fix build errors

* Fixup most of the test failures

* Fix `make headers`

* Fix "outside package path" error

* Fixup aligned alloc

* Add missing file

* linux

* More linux fixes

* use latest peechy

* Fix transpiler test failure

* Forgot about these

* Fixup test failure

* Update node-timers.test.ts

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

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

* Update http.exports.js

* Make this test less flaky

* fix hashes

* Fix hex formatting and zls issues

* Download zig version

* Update Dockerfile

* Update Dockerfile

* Update uws

* Update Dockerfile

* Set llvm version

* Update README.md

* Update uws

* Update Dockerfile

* Update io_linux.zig

* Update bun.zig

* Log output

* workaround strange @cInclude error

* Make ffi tests better

* Don't use cImport

* Update c.zig

* Update c-bindings.cpp

* call setOutputDir

* Update Dockerfile

* Use a longer name

* latest

* Update serve.test.ts

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

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

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

* copy cleanup

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

* Delete oniguruma

* Delete Oniguruma

* Make this test less flaky

* ✂️

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

* cleanup(readable): remove unnecessary _construct methods

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

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

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

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

* fix(stream): another debug fix

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

fixes #1601

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

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

* Add prettier

* Add ArrayBuffer types

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

* Improve types, add test files for types

* Update type tests

* Fix typo

* Add stdio

* Stdio types

* Use latest setup-bun

* Update action

* Update action

* Update action

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

* Add missing deepEquals() type to Bun

* fix missing glibc symbols

* Fix missing symbol issues

* Try this

* Update glibc-versions-hack.cpp

* Update glibc-versions-hack.cpp

* Update glibc-versions-hack.cpp

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

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

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

* cleanup(child_process): remove debug id

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

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

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

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

* toBeGreaterThanOrEqual and tests

* toBeLessThan and toBeLessThanOrEqual with tests

* expect types

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

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

* test(NodeTestHelpers): fix test names

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

* test(NodeTestHelpers): remove stray console.log

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

* test(process.stdio): rename test

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

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

* fix(child_process): check isCallable on promise

* fix: get stdio streams mostly working (mostly)

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

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

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

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

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

* debug(streams): add more debug log

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

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

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

* rebase Remove some dead bindings code

* remove debugging test

* canGetIndexQuickly for array holes

* isStrict template

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

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

* Update Dockerfile.devcontainer

* Update async-overhead.mjs

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

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

* Add SIMDUTF

* More micro bench snippets

* Update .gitattributes

* Update .gitattributes

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

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

* wip

* Fix bug with stdin

* zig fmt

* seems to work!

* Update streams.test.js

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

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

* Remove unnecessary function parameter path

* Add loadPackageImports function to match esbuild

* Add support for pattern trailer import syntax

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

* cleanup tests

* cleanup comments

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

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

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

* toContain and toBeTruthy

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

* markBindings

* remove toHaveProperty, undo ignore webkit, more tests

* undo ignore webkit

* remove bad tests

* check if length property exists for toHaveLength()

* fix call signature

* handle argument that is not an integer

* getLengthOfArray returns u64

* switch to truncate

* toHaveLength() edge cases

* add toBooleanSlow()

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

`test` is an alias of `it`

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

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

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

* Handle unregistered

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

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

* fix(child_process): fix ArrayBufferIsView call

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

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

* Improve typing

* Fix types in tests

* Fix dts tests

* Run formatter

* Fix all type errors

* Add strict mode, fix type errors

* Add ffi changes

* Move workflows to root

* Add workflows

* Remove labeler

* Add child_process types

* Fix synthetic defaults issue

* Remove docs

* Move scripts

* Run prettier

* Include examples in typechecking

* captureStackTrace types

* moved captureStackTrace types to globals

* Address reviews

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

* fix callsite methods, stack formatting or undefined

* isNative, tests for callsite methods

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

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

* template and macros for visitchildren

* static strings, handle infinity and clamp stacktracelimit

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

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

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

* WIP

* Update README.md

* Update README.md

* wip

* Support running scripts without package.json

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

* WIP

* wip

* Update headers-handwritten.h

* WIP

* Build fixes

* Fix UAF

* Update install.zig

* Must call .allocate()

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

* Support progress bar

* Extend the timestamp for package staleness checks to 1 day

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

* Fix crash

* Support line text manually being set on an Error instance

* Add a few more fields for error messages

* Fix bug when counting 8 character strings in string builder

* Implement error handling for automatic package installs!

* Fix crash

* Make it say module when there's a slash

* Update module_loader.zig

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

* Remove unused field

* Update README.md

* Update README.md

* Update README.md

* Update README.md

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

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

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

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

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

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

* cleanup(child_process): remove dead refs

* fix(child_process): fix stdio

* fix(child_process): change stdio to bunStdio

* test(child_process): uncomment timeout test

* test(child_process): fix hanging tests

* test(child_process): remove stray console.log

* test(child_process): fix cwd test for linux

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

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

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

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

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

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

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

* decorator factories test

* parameter decorator test

* test for decorators with constructor parameter properties

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

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

* Make these tests better

* Move this to dependencies so the .a files upload

* Fixup

* temporary fix

* Limit concurrency for MacOS Object actions

* try againn

* againn

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

cc @Electroid @colinhacks

* Update server.zig

* Prefer `BUN_PORT` over `PORT`

* Fix typo in homebrew action

* Run homebrew action when release is edited

* Check published_at instead of draft in GitHub action

* Implement `process.release`

* Add missing dependencies to `make devcontainer`

* Allow overriding node polyfills via `BUN_OVERRIDE_MODULE_PATH`

* Add a stub for io_darwin on linux

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

* Add missing `break`

* Download more RAM

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

* feat(core): optimize zig slice

* address concerns

* Remove webcrypto from vendor-without-check

* Update default tsconfig (#1418)

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

* Enable `BUN_OVERRIDE_MODULE_PATH` in `bun wiptest`

* Upgrade WebKit

* space

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

* Remove ✂️ function

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

* Updating libuwebsockets C API (#1423)

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

* tests and formatting

* fix for ^ in character class

* formatting

* test for repeated match and exec calls

* create oniguruma regex for each exec/test

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

* oops

* call onig_initialize once

* fix incorrect escaping, removed unnecessary oniguruma settings

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

* free regex object before returns

* force gc for some tests

* Update React fizz server (#1432)

* Update fizz server

* Use production build

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

* more decorator tests

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

* fix createWriteStream (#1433)

* fix createWriteStream

* remove comment

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

* Update build documentation for dev containers

* Add devcontainer-rebuild make target

* Add make devcontainer-sh target

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

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

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

* Fix #1410

woops

* await on DOMContentLoaded for elements instead of setup function

* avoid lowering class if no decorators

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

* Add devcontainer-rebuild make target

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

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

* Use production build

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

* fix for ^ in character class

* formatting

* test for repeated match and exec calls

* create oniguruma regex for each exec/test

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

* oops

* call onig_initialize once

* fix incorrect escaping, removed unnecessary oniguruma settings

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

* free regex object before returns

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

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

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

* Wip

* Add snippet for StringDecoder

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

* Add a tcp echo server test

* Some docs

* Update README.md

* Fix build

* Update README.md

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

* non extended strings used for toString() and source

* add hasIndices flags

* more tests for lookbehinds, unicode, and hex characters

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

* fix adding characters out of bounds

* backslash in character class

* compile() returns object

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

* Duplicate symbols

* Update c_cpp_properties.json

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

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

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

* tests for args

* file name change

* switch to stdout.writer, use JSON for parsing

* bun-debug or bun

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

* pcre2 regex boilerplate

* tests for pcre2 regex

* flag validation, getters, construct and compile mostly working

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

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

* remove lib link

* add destructor to PCRE2RegExp

* header include

* removed ternary

* switched to oniguruma for regex library

* revert sql changes

* fix indices flag, add tests

* revert settings

* working error messages

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

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

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

* fix: generate class script

* fix: sync codegen

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

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

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

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

* Add License header from node

* Add tests to complete existing promisify parity with node

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

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

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

That was incorrect.

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

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

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

* fix: minor fix and add more test

* [env loader] Improve nested value parsing performance

remove unnecessary branching

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

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

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

* It mostly works!

* Support `bun install`

* Support `bun create`

* Support chunked transfer encoding

* Handle Keep Alive when redirecting to a different domain

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

* fix upon reviews

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

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

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

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

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

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

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

* Add native ReadableState

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

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

* add tildify

* chore: make requested changes

* fix: add equals true

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

* fix: $XDG_CONFIG_HOME can be undefined

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

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

* Fix the bugs

* Implement `"object"` loader

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

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

* fix upon reviews

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

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

* Reduce CPU usage of idling

* Add another implementation

* Add benchmark

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

* Update src/resolver/resolver.zig

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

* wip review fixes

* fix style

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

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

* New WebKit

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

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

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

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

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

* add native BufferList

* use RopeBuilder

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

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

* feat: implement EOL

* feat: implement EOL

* feat: implement arch function

* feat: implement homedir function

* add comptime to homedir if

* feat: add platform function

* feat: implement type function

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

* chore: make requested changes

* fix: change toValueGC into toValue in arch function

* add EOL, devNull constant variables

* fix: store only string

* feat: add tests

* feat: add endianness

* ususe toValue for devNull & EOL

* feat: implement endianness & fix release

* revert javascript.zig fix

* feat: implement tmpdir

* feat: implement totalmem, freemem, uptime

* feat: loadavg

* feat: implement version

* feat: add userInfo

* feat: implement totalmem for macos

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

* feat: finish userInfo implementation

* feat: implement cpus, not done

* feat: finish getPriority implementation & stats cpus()

* feat: implement setPriority

* reemove test.c

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

* feat: implement signals, errno

* updated cpus function, stilldoesnt work

* increase object length

* feat: add t more ests

* feat: add cpus()

* remov some files

* fix: handle empty array

* started working on interface addresses (in C)

ill use C++ after it work

* fix interface_addresses

* Improved getCpuInfo code, decreased ram usage, increased speed

* getCpuTime optimizations

* started working on networkInterfaces

* feat: networkInterfaces implementation

* delete unnecessary files

* add benchs & fix code

* add tests

* add missing benchs

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

* remove hardcoded constants

* feat: implement errno constants

* fix getWindowsErrorConstant

* feat: add signal constants

* feat: implement priority constants

* remove duplications

* fix: change value to ?i16

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

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

* feat: add dlopen constants

* change functions to private

* feat: add UV_UDP_REUSEADDR

* fix typo

* simplify functions

* rename functions in bindings

* feat: implement loadavg for darwin

* feat: implement system uptime

* feat: implement get free memory for darwin

* fix system memory bindings

* feat: implement network interfaces for darwin

* code cleanup

* feat: support for macos version & release

* some fixes

* MacOS support for CpuInfo

* Fixed minor mistake in getCpuInfo_B

* Delete test.zig

* Update c_cpp_properties.json

* Update tasks.json

* feat: implement scopeid

* feat: implement cidr 🚀

* remove unnecesarry changes

* remove unnecesarry changes

* chore: requested changes

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

* chore: requested changes

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

* chore: requested changes

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

* chore: requested changes

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

* chore: requested changes

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

* chore: requested changes

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

* chore: requested changes

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

* fix: import string

* fix: change IPV6 to IPv6

* fix some things

* chore: make requested changes

* revert: launch.json

* fix test

* Fixed few memory leaks

* testing

* again

* added len

* another test

* improved parsing

* added small check

* Bonk

* FINISH 🚀🚀🚀🚀🚀🚀

* Update tasks.json

* NetworkInterface test

* FINISH 🚀🚀🚀

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

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

Code

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

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

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

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

* add listeners, listenerCount and eventNames

* add global functions

* add Object to EventEmitter conversion

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

* use memmem

* use int64_t

* fix upon reviews
2022-08-20 00:17:17 -07:00
Zilin Zhu
b1bc549cf7 fix buffer.slice(0, 0) (#1114) 2022-08-19 23:25:10 -07:00
Zilin Zhu
8cf57eb582 fix buffer.copy (#1113) 2022-08-19 23:13:38 -07:00
Jarred Sumner
aa404ded34 Update build-id 2022-08-19 05:06:11 -07:00
Jarred Sumner
eee5046b82 Make React SSR up to 3x faster 2022-08-19 04:47:55 -07:00
Jarred Sumner
9222a5d376 2x faster Bun.serve with async function handlers 2022-08-19 03:51:01 -07:00
Jarred Sumner
0a0f8ff41c Update bun init test 2022-08-19 00:35:26 -07:00
Jarred Sumner
fe7180bc74 Synchronously dispatch close event 2022-08-18 23:49:14 -07:00
Jarred Sumner
bdf733973c Fix memory leak in WebSocket 2022-08-18 23:41:33 -07:00
Jarred Sumner
0f45386673 Make Request, Response and TextDecoder not read-only 2022-08-18 23:21:52 -07:00
Jarred Sumner
88d2a97670 Update build-id 2022-08-18 21:17:38 -07:00
Jarred Sumner
922c361f6a un-delete some code 2022-08-18 21:14:52 -07:00
Jarred Sumner
0e4db0b28f Add string support to Buffer.fill 2022-08-18 21:09:26 -07:00
Jarred Sumner
d150a2f4dd [node compat] Fix issue with Buffer.compare when called on the constructor 2022-08-18 19:34:28 -07:00
Jarred Sumner
5eeb704f25 Fix console.log printing [native code] for too many things 2022-08-18 19:23:45 -07:00
Jarred Sumner
e3c2a95e5f Faster TextDecoder 2022-08-18 19:06:29 -07:00
Jarred Sumner
e45ddc086f Fix Next.js regression 2022-08-18 19:05:37 -07:00
Jarred Sumner
51ced7d3e3 Fix bun:wrap not loading 2022-08-18 19:05:07 -07:00
36838 changed files with 1634492 additions and 254113 deletions

170
.buildkite/Dockerfile Normal file
View File

@@ -0,0 +1,170 @@
ARG LLVM_VERSION="18"
ARG REPORTED_LLVM_VERSION="18.1.8"
ARG OLD_BUN_VERSION="1.1.38"
ARG DEFAULT_CFLAGS="-mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -ffunction-sections -fdata-sections -faddrsig -fno-unwind-tables -fno-asynchronous-unwind-tables"
ARG DEFAULT_CXXFLAGS="-flto=full -fwhole-program-vtables -fforce-emit-vtables"
ARG BUILDKITE_AGENT_TAGS="queue=linux,os=linux,arch=${TARGETARCH}"
FROM --platform=$BUILDPLATFORM ubuntu:20.04 as base-arm64
FROM --platform=$BUILDPLATFORM ubuntu:18.04 as base-amd64
FROM base-$TARGETARCH as base
ARG LLVM_VERSION
ARG OLD_BUN_VERSION
ARG TARGETARCH
ARG DEFAULT_CXXFLAGS
ARG DEFAULT_CFLAGS
ARG REPORTED_LLVM_VERSION
ENV DEBIAN_FRONTEND=noninteractive \
CI=true \
DOCKER=true
RUN echo "Acquire::Queue-Mode \"host\";" > /etc/apt/apt.conf.d/99-apt-queue-mode.conf \
&& echo "Acquire::Timeout \"120\";" >> /etc/apt/apt.conf.d/99-apt-timeout.conf \
&& echo "Acquire::Retries \"3\";" >> /etc/apt/apt.conf.d/99-apt-retries.conf \
&& echo "APT::Install-Recommends \"false\";" >> /etc/apt/apt.conf.d/99-apt-install-recommends.conf \
&& echo "APT::Install-Suggests \"false\";" >> /etc/apt/apt.conf.d/99-apt-install-suggests.conf
RUN apt-get update && apt-get install -y --no-install-recommends \
wget curl git python3 python3-pip ninja-build \
software-properties-common apt-transport-https \
ca-certificates gnupg lsb-release unzip \
libxml2-dev ruby ruby-dev bison gawk perl make golang \
&& add-apt-repository ppa:ubuntu-toolchain-r/test \
&& apt-get update \
&& apt-get install -y gcc-13 g++-13 libgcc-13-dev libstdc++-13-dev \
libasan6 libubsan1 libatomic1 libtsan0 liblsan0 \
libgfortran5 libc6-dev \
&& wget https://apt.llvm.org/llvm.sh \
&& chmod +x llvm.sh \
&& ./llvm.sh ${LLVM_VERSION} all \
&& rm llvm.sh
RUN --mount=type=tmpfs,target=/tmp \
cmake_version="3.30.5" && \
if [ "$TARGETARCH" = "arm64" ]; then \
cmake_url="https://github.com/Kitware/CMake/releases/download/v${cmake_version}/cmake-${cmake_version}-linux-aarch64.sh"; \
else \
cmake_url="https://github.com/Kitware/CMake/releases/download/v${cmake_version}/cmake-${cmake_version}-linux-x86_64.sh"; \
fi && \
wget -O /tmp/cmake.sh "$cmake_url" && \
sh /tmp/cmake.sh --skip-license --prefix=/usr
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 130 \
--slave /usr/bin/g++ g++ /usr/bin/g++-13 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-13 \
--slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-13 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-13
RUN echo "ARCH_PATH=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64-linux-gnu" || echo "x86_64-linux-gnu")" >> /etc/environment \
&& echo "BUN_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "x64")" >> /etc/environment
ENV LD_LIBRARY_PATH=/usr/lib/gcc/${ARCH_PATH}/13:/usr/lib/${ARCH_PATH} \
LIBRARY_PATH=/usr/lib/gcc/${ARCH_PATH}/13:/usr/lib/${ARCH_PATH} \
CPLUS_INCLUDE_PATH=/usr/include/c++/13:/usr/include/${ARCH_PATH}/c++/13 \
C_INCLUDE_PATH=/usr/lib/gcc/${ARCH_PATH}/13/include \
CFLAGS=${DEFAULT_CFLAGS} \
CXXFLAGS="${DEFAULT_CFLAGS} ${DEFAULT_CXXFLAGS}"
RUN if [ "$TARGETARCH" = "arm64" ]; then \
export ARCH_PATH="aarch64-linux-gnu"; \
else \
export ARCH_PATH="x86_64-linux-gnu"; \
fi \
&& mkdir -p /usr/lib/gcc/${ARCH_PATH}/13 \
&& ln -sf /usr/lib/${ARCH_PATH}/libstdc++.so.6 /usr/lib/gcc/${ARCH_PATH}/13/ \
&& echo "/usr/lib/gcc/${ARCH_PATH}/13" > /etc/ld.so.conf.d/gcc-13.conf \
&& echo "/usr/lib/${ARCH_PATH}" >> /etc/ld.so.conf.d/gcc-13.conf \
&& ldconfig
RUN for f in /usr/lib/llvm-${LLVM_VERSION}/bin/*; do ln -sf "$f" /usr/bin; done \
&& ln -sf /usr/bin/clang-${LLVM_VERSION} /usr/bin/clang \
&& ln -sf /usr/bin/clang++-${LLVM_VERSION} /usr/bin/clang++ \
&& ln -sf /usr/bin/lld-${LLVM_VERSION} /usr/bin/lld \
&& ln -sf /usr/bin/lldb-${LLVM_VERSION} /usr/bin/lldb \
&& ln -sf /usr/bin/clangd-${LLVM_VERSION} /usr/bin/clangd \
&& ln -sf /usr/bin/llvm-ar-${LLVM_VERSION} /usr/bin/llvm-ar \
&& ln -sf /usr/bin/ld.lld /usr/bin/ld \
&& ln -sf /usr/bin/clang /usr/bin/cc \
&& ln -sf /usr/bin/clang++ /usr/bin/c++
ENV CC="clang" \
CXX="clang++" \
AR="llvm-ar-${LLVM_VERSION}" \
RANLIB="llvm-ranlib-${LLVM_VERSION}" \
LD="lld-${LLVM_VERSION}"
RUN --mount=type=tmpfs,target=/tmp \
bash -c '\
set -euxo pipefail && \
source /etc/environment && \
echo "Downloading bun-v${OLD_BUN_VERSION}/bun-linux-$BUN_ARCH.zip from https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/bun-v${OLD_BUN_VERSION}/bun-linux-$BUN_ARCH.zip" && \
curl -fsSL https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/bun-v${OLD_BUN_VERSION}/bun-linux-$BUN_ARCH.zip -o /tmp/bun.zip && \
unzip /tmp/bun.zip -d /tmp/bun && \
mv /tmp/bun/*/bun /usr/bin/bun && \
chmod +x /usr/bin/bun'
ENV LLVM_VERSION=${REPORTED_LLVM_VERSION}
WORKDIR /workspace
FROM --platform=$BUILDPLATFORM base as buildkite
ARG BUILDKITE_AGENT_TAGS
# Install Rust nightly
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& export PATH=$HOME/.cargo/bin:$PATH \
&& rustup install nightly \
&& rustup default nightly
RUN ARCH=$(if [ "$TARGETARCH" = "arm64" ]; then echo "arm64"; else echo "amd64"; fi) && \
echo "Downloading buildkite" && \
curl -fsSL "https://github.com/buildkite/agent/releases/download/v3.87.0/buildkite-agent-linux-${ARCH}-3.87.0.tar.gz" -o /tmp/buildkite-agent.tar.gz && \
mkdir -p /tmp/buildkite-agent && \
tar -xzf /tmp/buildkite-agent.tar.gz -C /tmp/buildkite-agent && \
mv /tmp/buildkite-agent/buildkite-agent /usr/bin/buildkite-agent
RUN mkdir -p /var/cache/buildkite-agent /var/log/buildkite-agent /var/run/buildkite-agent /etc/buildkite-agent /var/lib/buildkite-agent/cache/bun
COPY ../*/agent.mjs /var/bun/scripts/
ENV BUN_INSTALL_CACHE=/var/lib/buildkite-agent/cache/bun
ENV BUILDKITE_AGENT_TAGS=${BUILDKITE_AGENT_TAGS}
WORKDIR /var/bun/scripts
ENV PATH=/root/.cargo/bin:$PATH
CMD ["bun", "/var/bun/scripts/agent.mjs", "start"]
FROM --platform=$BUILDPLATFORM base as bun-build-linux-local
ARG LLVM_VERSION
WORKDIR /workspace/bun
COPY . /workspace/bun
# Install Rust nightly
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& export PATH=$HOME/.cargo/bin:$PATH \
&& rustup install nightly \
&& rustup default nightly
ENV PATH=/root/.cargo/bin:$PATH
ENV LLVM_VERSION=${REPORTED_LLVM_VERSION}
RUN --mount=type=tmpfs,target=/workspace/bun/build \
ls -la \
&& bun run build:release \
&& mkdir -p /target \
&& cp -r /workspace/bun/build/release/bun /target/bun

View File

@@ -0,0 +1,122 @@
#!/usr/bin/env bash
set -euo pipefail
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "error: must run as root"
exit 1
fi
# Check OS compatibility
if ! command -v dnf &> /dev/null; then
echo "error: this script requires dnf (RHEL/Fedora/CentOS)"
exit 1
fi
# Ensure /tmp/agent.mjs, /tmp/Dockerfile are present
if [ ! -f /tmp/agent.mjs ] || [ ! -f /tmp/Dockerfile ]; then
# Print each missing file
if [ ! -f /tmp/agent.mjs ]; then
echo "error: /tmp/agent.mjs is missing"
fi
if [ ! -f /tmp/Dockerfile ]; then
echo "error: /tmp/Dockerfile is missing"
fi
exit 1
fi
# Install Docker
dnf update -y
dnf install -y docker
systemctl enable docker
systemctl start docker || {
echo "error: failed to start Docker"
exit 1
}
# Create builder
docker buildx create --name builder --driver docker-container --bootstrap --use || {
echo "error: failed to create Docker buildx builder"
exit 1
}
# Set up Docker to start on boot
cat << 'EOF' > /etc/systemd/system/buildkite-agent.service
[Unit]
Description=Buildkite Docker Container
After=docker.service network-online.target
Requires=docker.service network-online.target
[Service]
TimeoutStartSec=0
Restart=always
RestartSec=5
ExecStartPre=-/usr/bin/docker stop buildkite
ExecStartPre=-/usr/bin/docker rm buildkite
ExecStart=/usr/bin/docker run \
--name buildkite \
--restart=unless-stopped \
--network host \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp:/tmp \
buildkite:latest
[Install]
WantedBy=multi-user.target
EOF
echo "Building Buildkite image"
# Clean up any previous build artifacts
rm -rf /tmp/fakebun
mkdir -p /tmp/fakebun/scripts /tmp/fakebun/.buildkite
# Copy required files
cp /tmp/agent.mjs /tmp/fakebun/scripts/ || {
echo "error: failed to copy agent.mjs"
exit 1
}
cp /tmp/Dockerfile /tmp/fakebun/.buildkite/Dockerfile || {
echo "error: failed to copy Dockerfile"
exit 1
}
cd /tmp/fakebun || {
echo "error: failed to change directory"
exit 1
}
# Build the Buildkite image
docker buildx build \
--platform $(uname -m | sed 's/aarch64/linux\/arm64/;s/x86_64/linux\/amd64/') \
--tag buildkite:latest \
--target buildkite \
-f .buildkite/Dockerfile \
--load \
. || {
echo "error: Docker build failed"
exit 1
}
# Create container to ensure image is cached in AMI
docker container create \
--name buildkite \
--restart=unless-stopped \
buildkite:latest || {
echo "error: failed to create buildkite container"
exit 1
}
# Reload systemd to pick up new service
systemctl daemon-reload
# Enable the service, but don't start it yet
systemctl enable buildkite-agent || {
echo "error: failed to enable buildkite-agent service"
exit 1
}
echo "Bootstrap complete"
echo "To start the Buildkite agent, run: "
echo " systemctl start buildkite-agent"

16
.buildkite/bootstrap.yml Normal file
View File

@@ -0,0 +1,16 @@
# Uploads the latest CI workflow to Buildkite.
# https://buildkite.com/docs/pipelines/defining-steps
#
# Changes to this file must be manually edited here:
# https://buildkite.com/bun/bun/settings/steps
steps:
- if: "build.pull_request.repository.fork"
block: ":eyes:"
prompt: "Did you review the PR?"
blocked_state: "running"
- label: ":pipeline:"
agents:
queue: "build-darwin"
command:
- "node .buildkite/ci.mjs"

1156
.buildkite/ci.mjs Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,241 @@
#!/bin/bash
set -eo pipefail
function assert_main() {
if [ -z "$BUILDKITE_REPO" ]; then
echo "error: Cannot find repository for this build"
exit 1
fi
if [ -z "$BUILDKITE_COMMIT" ]; then
echo "error: Cannot find commit for this build"
exit 1
fi
if [ -n "$BUILDKITE_PULL_REQUEST_REPO" ] && [ "$BUILDKITE_REPO" != "$BUILDKITE_PULL_REQUEST_REPO" ]; then
echo "error: Cannot upload release from a fork"
exit 1
fi
if [ "$BUILDKITE_PULL_REQUEST" != "false" ]; then
echo "error: Cannot upload release from a pull request"
exit 1
fi
if [ "$BUILDKITE_BRANCH" != "main" ]; then
echo "error: Cannot upload release from a branch other than main"
exit 1
fi
}
function assert_buildkite_agent() {
if ! command -v "buildkite-agent" &> /dev/null; then
echo "error: Cannot find buildkite-agent, please install it:"
echo "https://buildkite.com/docs/agent/v3/install"
exit 1
fi
}
function assert_github() {
assert_command "gh" "gh" "https://github.com/cli/cli#installation"
assert_buildkite_secret "GITHUB_TOKEN"
# gh expects the token in $GH_TOKEN
export GH_TOKEN="$GITHUB_TOKEN"
}
function assert_aws() {
assert_command "aws" "awscli" "https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html"
for secret in "AWS_ACCESS_KEY_ID" "AWS_SECRET_ACCESS_KEY" "AWS_ENDPOINT"; do
assert_buildkite_secret "$secret"
done
assert_buildkite_secret "AWS_BUCKET" --skip-redaction
}
function assert_sentry() {
assert_command "sentry-cli" "getsentry/tools/sentry-cli" "https://docs.sentry.io/cli/installation/"
for secret in "SENTRY_AUTH_TOKEN" "SENTRY_ORG" "SENTRY_PROJECT"; do
assert_buildkite_secret "$secret"
done
}
function run_command() {
set -x
"$@"
{ set +x; } 2>/dev/null
}
function assert_command() {
local command="$1"
local package="$2"
local help_url="$3"
if ! command -v "$command" &> /dev/null; then
echo "warning: $command is not installed, installing..."
if command -v brew &> /dev/null; then
HOMEBREW_NO_AUTO_UPDATE=1 run_command brew install "$package"
else
echo "error: Cannot install $command, please install it"
if [ -n "$help_url" ]; then
echo ""
echo "hint: See $help_url for help"
fi
exit 1
fi
fi
}
function assert_buildkite_secret() {
local key="$1"
local value=$(buildkite-agent secret get "$key" ${@:2})
if [ -z "$value" ]; then
echo "error: Cannot find $key secret"
echo ""
echo "hint: Create a secret named $key with a value:"
echo "https://buildkite.com/docs/pipelines/buildkite-secrets"
exit 1
fi
export "$key"="$value"
}
function release_tag() {
local version="$1"
if [ "$version" == "canary" ]; then
echo "canary"
else
echo "bun-v$version"
fi
}
function create_sentry_release() {
local version="$1"
local release="$version"
if [ "$version" == "canary" ]; then
release="$BUILDKITE_COMMIT-canary"
fi
run_command sentry-cli releases new "$release" --finalize
run_command sentry-cli releases set-commits "$release" --auto --ignore-missing
if [ "$version" == "canary" ]; then
run_command sentry-cli deploys new --env="canary" --release="$release"
fi
}
function download_buildkite_artifact() {
local name="$1"
local dir="$2"
if [ -z "$dir" ]; then
dir="."
fi
run_command buildkite-agent artifact download "$name" "$dir"
if [ ! -f "$dir/$name" ]; then
echo "error: Cannot find Buildkite artifact: $name"
exit 1
fi
}
function upload_github_asset() {
local version="$1"
local tag="$(release_tag "$version")"
local file="$2"
run_command gh release upload "$tag" "$file" --clobber --repo "$BUILDKITE_REPO"
# Sometimes the upload fails, maybe this is a race condition in the gh CLI?
while [ "$(gh release view "$tag" --repo "$BUILDKITE_REPO" | grep -c "$file")" -eq 0 ]; do
echo "warn: Uploading $file to $tag failed, retrying..."
sleep "$((RANDOM % 5 + 1))"
run_command gh release upload "$tag" "$file" --clobber --repo "$BUILDKITE_REPO"
done
}
function update_github_release() {
local version="$1"
local tag="$(release_tag "$version")"
if [ "$tag" == "canary" ]; then
sleep 5 # There is possibly a race condition where this overwrites artifacts?
run_command gh release edit "$tag" --repo "$BUILDKITE_REPO" \
--notes "This release of Bun corresponds to the commit: $BUILDKITE_COMMIT"
fi
}
function upload_s3_file() {
local folder="$1"
local file="$2"
run_command aws --endpoint-url="$AWS_ENDPOINT" s3 cp "$file" "s3://$AWS_BUCKET/$folder/$file"
}
function send_bench_webhook() {
if [ -z "$BENCHMARK_URL" ]; then
echo "error: \$BENCHMARK_URL is not set"
# exit 1 # TODO: this isn't live yet
return
fi
local tag="$1"
local commit="$BUILDKITE_COMMIT"
local artifact_path="${commit}"
if [ "$tag" == "canary" ]; then
artifact_path="${commit}-canary"
fi
local artifact_url="https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/$artifact_path/bun-linux-x64.zip"
local webhook_url="$BENCHMARK_URL?tag=$tag&commit=$commit&artifact_url=$artifact_url"
curl -X POST "$webhook_url"
}
function create_release() {
assert_main
assert_buildkite_agent
assert_github
assert_aws
assert_sentry
local tag="$1" # 'canary' or 'x.y.z'
local artifacts=(
bun-darwin-aarch64.zip
bun-darwin-aarch64-profile.zip
bun-linux-aarch64.zip
bun-linux-aarch64-profile.zip
bun-linux-x64.zip
bun-linux-x64-profile.zip
bun-linux-x64-baseline.zip
bun-linux-x64-baseline-profile.zip
bun-linux-aarch64-musl.zip
bun-linux-aarch64-musl-profile.zip
bun-linux-x64-musl.zip
bun-linux-x64-musl-profile.zip
bun-linux-x64-musl-baseline.zip
bun-linux-x64-musl-baseline-profile.zip
bun-windows-x64.zip
bun-windows-x64-profile.zip
bun-windows-x64-baseline.zip
bun-windows-x64-baseline-profile.zip
)
function upload_artifact() {
local artifact="$1"
download_buildkite_artifact "$artifact"
if [ "$tag" == "canary" ]; then
upload_s3_file "releases/$BUILDKITE_COMMIT-canary" "$artifact" &
else
upload_s3_file "releases/$BUILDKITE_COMMIT" "$artifact" &
fi
upload_s3_file "releases/$tag" "$artifact" &
upload_github_asset "$tag" "$artifact" &
wait
}
for artifact in "${artifacts[@]}"; do
upload_artifact "$artifact"
done
update_github_release "$tag"
create_sentry_release "$tag"
send_bench_webhook "$tag"
}
function assert_canary() {
if [ -z "$CANARY" ] || [ "$CANARY" == "0" ]; then
echo "warn: Skipping release because this is not a canary build"
exit 0
fi
}
assert_canary
create_release "canary"

9
.clang-tidy Normal file
View File

@@ -0,0 +1,9 @@
WarningsAsErrors: "*"
FormatStyle: webkit
Checks: >
-*,
clang-analyzer-*,
-clang-analyzer-optin.core.EnumCastOutOfRange
-clang-analyzer-webkit.UncountedLambdaCapturesChecker
-clang-analyzer-optin.core.EnumCastOutOfRange
-clang-analyzer-webkit.RefCntblBaseVirtualDtor

8
.clangd Normal file
View File

@@ -0,0 +1,8 @@
Index:
Background: Skip # Disable slow background indexing of these files.
CompileFlags:
CompilationDatabase: build/debug
Diagnostics:
UnusedIncludes: None

7
.cursorignore Normal file
View File

@@ -0,0 +1,7 @@
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
bench
vendor
*-fixture.{js,ts}
zig-cache
packages/bun-uws/fuzzing
build

View File

@@ -1,27 +0,0 @@
# Bun's Dev Container
To get started, login to GitHub and clone bun's GitHub repo into `/workspaces/bun`
# First time setup
```bash
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

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

View File

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

View File

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

View File

@@ -1,16 +0,0 @@
#!/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 "# First time setup"
echo "gh auth login"
echo "gh repo clone oven-sh/bun . -- --depth=1 --progress -j8"
echo ""
echo "# Compile bun dependencies (zig is already compiled)"
echo "make devcontainer"
echo ""
echo "# Build bun for development"
echo "make dev"
echo ""
echo "# Run bun"
echo "bun-debug"

View File

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

View File

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

View File

@@ -1,7 +0,0 @@
#!/bin/bash
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,9 +0,0 @@
{
"folders": [
{
// Source code
"name": "bun",
"path": "bun"
},
]
}

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,17 +1,21 @@
node_modules
**/node_modules
src/bun.js/WebKit/LayoutTests
zig-out
zig-build
**/*.o
**/*.a
examples
**/*.o
**/.next
.git
src/bun.js/WebKit
**/CMakeCache.txt
**/node_modules
.git
examples
node_modules
packages/**/bun
packages/**/bun-profile
zig-cache
src/bun.js/WebKit
src/bun.js/WebKit/LayoutTests
zig-build
.zig-cache
zig-out
build
vendor
node_modules
*.trace
packages/bun-uws/fuzzing

8
.editorconfig Normal file
View File

@@ -0,0 +1,8 @@
# https://EditorConfig.org
root = true
[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf

49
.gitattributes vendored
View File

@@ -1,8 +1,53 @@
*.css text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.js text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.jsx text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.tsx text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.ts text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.c text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.cpp text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.cc text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.yml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.toml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.zig text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.rs text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.h text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.json text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.lock text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.map text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.md text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.mjs text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.mts text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.lockb binary diff=lockb
.vscode/launch.json linguist-generated
src/api/schema.d.ts linguist-generated
fixture.*.c linguist-generated
src/api/schema.js linguist-generated
*-fixture* linguist-generated
src/bun.js/bindings/ZigGeneratedCode.h linguist-generated
src/bun.js/bindings/ZigGeneratedCode.cpp linguist-generated
src/bun.js/bindings/headers.h linguist-generated
src/bun.js/bindings/headers.zig linguist-generated
packages/bun-uws/fuzzing/seed-corpus/**/* linguist-generated
src/bun.js/bindings/sqlite/sqlite3.c linguist-vendored
src/bun.js/bindings/sqlite/sqlite3_local.h linguist-vendored
*.lockb binary diff=lockb
*.zig text eol=lf
src/bun.js/bindings/simdutf.cpp linguist-vendored
src/bun.js/bindings/simdutf.h linguist-vendored
docs/**/* linguist-documentation
# Don't count tests in the language stats - https://github.com/github-linguist/linguist/blob/master/docs/overrides.md
test/**/* linguist-documentation
bench/**/* linguist-documentation
examples/**/* linguist-documentation
vendor/*.c linguist-vendored
vendor/brotli/** linguist-vendored
test/js/node/test/fixtures linguist-vendored
test/js/node/test/common linguist-vendored
test/js/bun/css/files linguist-vendored

View File

@@ -1,44 +0,0 @@
name: 🐛 Bug report
description: Create a report to help us improve
labels: [bug, need repro]
body:
- type: markdown
attributes:
value: |
Thank you for reporting an issue.
This issue tracker is for bugs and issues found within bun.
If you require more general support please reach out to our [discord server](https://bun.sh/discord).
Please fill in as much of the following form as you're able.
- type: input
attributes:
label: Version
description: Output of `bun -v`
- type: input
attributes:
label: Platform
description: |
UNIX: output of `uname -a`
Windows: output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in PowerShell console
- type: textarea
attributes:
label: What steps will reproduce the bug?
description: Enter details about your bug, preferably a simple code snippet that can be run using `bun` directly without installing third-party dependencies.
- 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 textual output instead of screenshots.
- type: textarea
attributes:
label: What do you see instead?
description: If possible, please provide textual output instead of screenshots.
validations:
required: true
- type: textarea
attributes:
label: Additional information
description: Tell us anything else you think we should know.

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

@@ -0,0 +1,47 @@
name: 🐛 Bug Report
description: Report an issue that should be fixed
labels:
- bug
- needs triage
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.
Make sure you are running the [latest](https://bun.sh/docs/installation#upgrading) version of Bun.
The bug you are experiencing may already have been fixed.
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 --revision`
- type: input
attributes:
label: What platform is your computer?
description: |
For MacOS and Linux: copy the output of `uname -mprs`
For Windows: copy the output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in the PowerShell console
- type: textarea
attributes:
label: What steps can reproduce the bug?
description: Explain the bug and provide a code snippet that can reproduce it.
validations:
required: true
- type: textarea
attributes:
label: What is the expected behavior?
description: If possible, please provide text instead of a screenshot.
- type: textarea
attributes:
label: What do you see instead?
description: If possible, please provide text instead of a screenshot.
- type: textarea
attributes:
label: Additional information
description: Is there anything else you think we should know?

View File

@@ -1,25 +0,0 @@
name: 🚀 Feature request
description: Suggest an idea for this project
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Thank you for suggesting an idea to make bun better.
Please fill in as much of the following form as you're able.
For more information on development, please reach out to our [discord server](https://bun.sh/discord).
- type: textarea
attributes:
label: What is the problem this feature will 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

@@ -1,18 +0,0 @@
name: 📗 Open an issue regarding the bun docs
description: Let us know about any problematic documentations
labels: [documentation]
body:
- type: markdown
attributes:
value: |
Thank you for wanting to make bun better!
Please fill in as much of the following form as you're able.
- type: input
attributes:
label: Affected URL(s)
- type: textarea
attributes:
label: Description of the problem
validations:
required: true

View File

@@ -0,0 +1,45 @@
name: 🇹 TypeScript Type Bug Report
description: Report an issue with TypeScript types
labels: [bug, types]
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.
Make sure you are running the [latest](https://bun.sh/docs/installation#upgrading) version of Bun.
The bug you are experiencing may already have been fixed.
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 --revision`
- type: input
attributes:
label: What platform is your computer?
description: |
For MacOS and Linux: copy the output of `uname -mprs`
For Windows: copy the output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in the PowerShell console
- type: textarea
attributes:
label: What steps can reproduce the bug?
description: Explain the bug and provide a code snippet that can reproduce it.
validations:
required: true
- type: textarea
attributes:
label: What is the expected behavior?
description: If possible, please provide text instead of a screenshot.
- type: textarea
attributes:
label: What do you see instead?
description: If possible, please provide text instead of a screenshot.
- type: textarea
attributes:
label: Additional information
description: Is there anything else you think we should know?

View File

@@ -0,0 +1,24 @@
name: 🚀 Feature Request
description: Suggest an idea, feature, or enhancement
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Thank you for submitting an idea. It helps make Bun better.
If you want to discuss Bun, or learn how others are using Bun, please
join our [Discord](https://discord.gg/CXdq2DP29u) server, where you can share in the [`#feedback`](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?

29
.github/ISSUE_TEMPLATE/5-docs-issue.yml vendored Normal file
View File

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

View File

@@ -0,0 +1,27 @@
name: Prefilled crash report
description: Report a crash in Bun
labels:
- crash
body:
- type: markdown
attributes:
value: |
**Thank you so much** for submitting a crash report. You're helping us make Bun more reliable for everyone!
- type: textarea
id: code
attributes:
label: How can we reproduce the crash?
description: Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository, [Replit](https://replit.com/@replit/Bun) or [CodeSandbox](https://codesandbox.io/templates/bun)
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be
automatically formatted into code, so no need for backticks.
render: shell
- type: textarea
id: remapped_trace
attributes:
label: Stack Trace (bun.report)
validations:
required: true

View File

@@ -0,0 +1,34 @@
name: bun install crash report
description: Report a crash in bun install
labels:
- npm
- crash
body:
- type: markdown
attributes:
value: |
**Thank you so much** for submitting a crash report. You're helping us make Bun more reliable for everyone!
- type: textarea
id: package_json
attributes:
label: "`package.json` file"
description: "Can you upload your `package.json` file? This helps us reproduce the crash."
render: json
- type: textarea
id: repro
attributes:
label: How can we reproduce the crash?
description: Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository, [Replit](https://replit.com/@replit/Bun) or [CodeSandbox](https://codesandbox.io/templates/bun)
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be
automatically formatted into code, so no need for backticks.
render: shell
- type: textarea
id: remapped_trace
attributes:
label: Stack Trace (bun.report)
validations:
required: true

View File

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

43
.github/actions/bump/action.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Bump version
description: Bump the version of Bun
inputs:
version:
description: The most recent version of Bun.
required: true
type: string
token:
description: The GitHub token to use for creating a pull request.
required: true
type: string
default: ${{ github.token }}
runs:
using: composite
steps:
- name: Run Bump
shell: bash
id: bump
run: |
set -euo pipefail
MESSAGE=$(bun ./scripts/bump.ts patch --last-version=${{ inputs.version }})
LATEST=$(cat LATEST)
echo "version=$LATEST" >> $GITHUB_OUTPUT
echo "message=$MESSAGE" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
add-paths: |
CMakeLists.txt
LATEST
token: ${{ inputs.token }}
commit-message: Bump version to ${{ steps.bump.outputs.version }}
title: Bump to ${{ steps.bump.outputs.version }}
delete-branch: true
branch: github-actions/bump-version-${{ steps.bump.outputs.version }}--${{ github.run_id }}
body: |
## What does this PR do?
${{ steps.bump.outputs.message }}
Auto-bumped by [this workflow](https://github.com/oven-sh/bun/actions/workflows/release.yml)

51
.github/actions/setup-bun/action.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: Setup Bun
description: An internal version of the 'oven-sh/setup-bun' action.
inputs:
bun-version:
type: string
description: "The version of bun to install: 'latest', 'canary', 'bun-v1.0.0', etc."
default: latest
required: false
baseline:
type: boolean
description: "Whether to use the baseline version of bun."
default: false
required: false
download-url:
type: string
description: "The base URL to download bun from."
default: "https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases"
required: false
runs:
using: composite
steps:
- name: Setup Bun
shell: bash
run: |
case "$(uname -s)" in
Linux*) os=linux;;
Darwin*) os=darwin;;
*) os=windows;;
esac
case "$(uname -m)" in
arm64 | aarch64) arch=aarch64;;
*) arch=x64;;
esac
case "${{ inputs.baseline }}" in
true | 1) target="bun-${os}-${arch}-baseline";;
*) target="bun-${os}-${arch}";;
esac
case "${{ inputs.bun-version }}" in
latest) release="latest";;
canary) release="canary";;
*) release="bun-v${{ inputs.bun-version }}";;
esac
curl -LO "${{ inputs.download-url }}/${release}/${target}.zip" --retry 5
unzip ${target}.zip
mkdir -p ${{ runner.temp }}/.bun/bin
mv ${target}/bun* ${{ runner.temp }}/.bun/bin/
chmod +x ${{ runner.temp }}/.bun/bin/*
ln -fs ${{ runner.temp }}/.bun/bin/bun ${{ runner.temp }}/.bun/bin/bunx
echo "${{ runner.temp }}/.bun/bin" >> ${GITHUB_PATH}

52
.github/labeler.yml vendored
View File

@@ -1,52 +0,0 @@
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/**/*

64
.github/labels.yml vendored
View File

@@ -1,64 +0,0 @@
- 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: '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'

50
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,50 @@
### What does this PR do?
<!-- **Please explain what your changes do**, example: -->
<!--
This adds a new flag --bail to bun test. When set, it will stop running tests after the first failure. This is useful for CI environments where you want to fail fast.
-->
- [ ] Documentation or TypeScript types (it's okay to leave the rest blank in this case)
- [ ] Code changes
### How did you verify your code works?
<!-- **For code changes, please include automated tests**. Feel free to uncomment the line below -->
<!-- I wrote automated tests -->
<!-- If JavaScript/TypeScript modules or builtins changed:
- [ ] I included a test for the new code, or existing tests cover it
- [ ] I ran my tests locally and they pass (`bun-debug test test-file-name.test`)
-->
<!-- If Zig files changed:
- [ ] I checked the lifetime of memory allocated to verify it's (1) freed and (2) only freed when it should be
- [ ] I included a test for the new code, or an existing test covers it
- [ ] JSValue used outside outside of the stack is either wrapped in a JSC.Strong or is JSValueProtect'ed
- [ ] I wrote TypeScript/JavaScript tests and they pass locally (`bun-debug test test-file-name.test`)
-->
<!-- If new methods, getters, or setters were added to a publicly exposed class:
- [ ] I added TypeScript types for the new methods, getters, or setters
-->
<!-- If dependencies in tests changed:
- [ ] I made sure that specific versions of dependencies are used instead of ranged or tagged versions
-->
<!-- If a new builtin ESM/CJS module was added:
- [ ] I updated Aliases in `module_loader.zig` to include the new module
- [ ] I added a test that imports the module
- [ ] I added a test that require() the module
-->

View File

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

View File

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

View File

@@ -1,46 +0,0 @@
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 }}

View File

@@ -1,143 +0,0 @@
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/aug12-2/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/aug12-2/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/aug12-2/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=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.build_arch}}
cache-to: type=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.build_arch}},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

View File

@@ -1,353 +0,0 @@
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=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.arch}}-macos
cache-to: type=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.arch}}-macos,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/aug12-2/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/aug12-2/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/aug12-2/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/aug12-2/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/aug12-2/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
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/aug12-2/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/aug12-2/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/aug12-2/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 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,350 +0,0 @@
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=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.arch}}-macos-baseline
cache-to: type=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.arch}}-macos-baseline,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/aug12-2/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/aug12-2/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/aug12-2/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/aug12-2/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/aug12-2/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 $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
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/aug12-2/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/aug12-2/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/aug12-2/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 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,352 +0,0 @@
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
tags: ghcr.io/oven-sh/bun-obj:${{github.sha}}-${{matrix.cpu}}-${{matrix.arch}}-macos
cache-from: type=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.arch}}-macos
cache-to: type=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.arch}}-macos,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/aug12-2/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/aug12-2/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/aug12-2/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/aug12-2/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/aug12-2/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 $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
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/aug12-2/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/aug12-2/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/aug12-2/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 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

41
.github/workflows/clang-format.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: clang-format
permissions:
contents: write
on:
workflow_call:
workflow_dispatch:
pull_request:
merge_group:
env:
BUN_VERSION: "1.1.27"
LLVM_VERSION: "18.1.8"
LLVM_VERSION_MAJOR: "18"
jobs:
clang-format:
name: clang-format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Install LLVM
run: |
curl -fsSL https://apt.llvm.org/llvm.sh | sudo bash -s -- ${{ env.LLVM_VERSION_MAJOR }} all
- name: Clang Format
env:
LLVM_VERSION: ${{ env.LLVM_VERSION }}
run: |
bun run clang-format
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "`bun run clang-format`"

41
.github/workflows/clang-tidy.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: clang-tidy
permissions:
contents: write
on:
workflow_call:
workflow_dispatch:
pull_request:
merge_group:
env:
BUN_VERSION: "1.1.27"
LLVM_VERSION: "18.1.8"
LLVM_VERSION_MAJOR: "18"
jobs:
clang-tidy:
name: clang-tidy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Install LLVM
run: |
curl -fsSL https://apt.llvm.org/llvm.sh | sudo bash -s -- ${{ env.LLVM_VERSION_MAJOR }} all
- name: Clang Tidy
env:
LLVM_VERSION: ${{ env.LLVM_VERSION }}
run: |
bun run clang-tidy:diff
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "`bun run clang-tidy`"

85
.github/workflows/comment-lint.yml vendored Normal file
View File

@@ -0,0 +1,85 @@
name: C++ Linter comment
permissions:
actions: read
pull-requests: write
on:
workflow_run:
workflows:
- lint-cpp
types:
- completed
jobs:
comment-lint:
if: ${{ github.repository_owner == 'oven-sh' }}
name: Comment
runs-on: ubuntu-latest
steps:
- name: Download Comment
uses: actions/download-artifact@v4
with:
name: format.log
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
- name: PR Number
uses: actions/download-artifact@v4
with:
name: pr-number.txt
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
- name: Did Fail
uses: actions/download-artifact@v4
with:
name: did_fail.txt
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
- name: Setup Environment
id: env
shell: bash
run: |
# Copy to outputs
echo "pr-number=$(cat pr-number.txt)" >> $GITHUB_OUTPUT
{
echo 'text_output<<EOF'
cat format.log
echo EOF
} >> "$GITHUB_OUTPUT"
echo "did_fail=$(cat did_fail.txt)" >> $GITHUB_OUTPUT
- name: Find Comment
id: comment
uses: peter-evans/find-comment@v3
with:
issue-number: ${{ steps.env.outputs.pr-number }}
comment-author: github-actions[bot]
body-includes: <!-- generated-comment lint-cpp-workflow=${{ github.workflow }} -->
- name: Update Comment
uses: peter-evans/create-or-update-comment@v4
if: steps.env.outputs.did_fail != '0'
with:
comment-id: ${{ steps.comment.outputs.comment-id }}
issue-number: ${{ steps.env.outputs.pr-number }}
body: |
@${{ github.actor }}, `clang-tidy` had something to share with you about your code:
```cpp
${{ steps.env.outputs.text_output }}
```
Commit: ${{ github.event.workflow_run.head_sha || github.sha }}
<!-- generated-comment lint-cpp-workflow=${{ github.workflow }} -->
edit-mode: replace
- name: Update Previous Comment
uses: peter-evans/create-or-update-comment@v4
if: steps.env.outputs.did_fail == '0' && steps.comment.outputs.comment-id != ''
with:
comment-id: ${{ steps.comment.outputs.comment-id }}
issue-number: ${{ steps.env.outputs.pr-number }}
body: |
clang-tidy nits are fixed! Thank you.
<!-- generated-comment lint-cpp-workflow=${{ github.workflow }} -->
edit-mode: replace

21
.github/workflows/docs.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Docs
on:
push:
paths:
- "docs/**"
- "CONTRIBUTING.md"
branches:
- main
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'oven-sh' }}
steps:
# redeploy Vercel site when a file in `docs` changes
# using VERCEL_DEPLOY_HOOK environment variable
- name: Trigger Webhook
run: |
curl -v ${{ secrets.VERCEL_DEPLOY_HOOK }}

View File

@@ -1,24 +0,0 @@
name: Label Sync
on:
schedule:
- cron: '0 0 * * *'
push:
branches:
- main
paths:
- '.github/labels.yml'
workflow_dispatch:
jobs:
label-sync:
name: Label sync
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Sync labels
uses: crazy-max/ghaction-github-labeler@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

171
.github/workflows/labeled.yml vendored Normal file
View File

@@ -0,0 +1,171 @@
name: Issue Labeled
env:
BUN_VERSION: 1.1.13
on:
issues:
types: [labeled]
jobs:
# on-bug:
# runs-on: ubuntu-latest
# if: github.event.label.name == 'bug' || github.event.label.name == 'crash'
# permissions:
# issues: write
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# sparse-checkout: |
# scripts
# .github
# CMakeLists.txt
# - name: Setup Bun
# uses: ./.github/actions/setup-bun
# with:
# bun-version: "1.1.24"
# - name: "categorize bug"
# id: add-labels
# env:
# GITHUB_ISSUE_BODY: ${{ github.event.issue.body }}
# GITHUB_ISSUE_TITLE: ${{ github.event.issue.title }}
# ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
# shell: bash
# run: |
# echo '{"dependencies": { "@anthropic-ai/sdk": "latest" }}' > scripts/package.json && bun install --cwd=./scripts
# LABELS=$(bun scripts/label-issue.ts)
# echo "labels=$LABELS" >> $GITHUB_OUTPUT
# - name: Add labels
# uses: actions-cool/issues-helper@v3
# if: steps.add-labels.outputs.labels != ''
# with:
# actions: "add-labels"
# token: ${{ secrets.GITHUB_TOKEN }}
# issue-number: ${{ github.event.issue.number }}
# labels: ${{ steps.add-labels.outputs.labels }}
on-labeled:
runs-on: ubuntu-latest
if: github.event.label.name == 'crash' || github.event.label.name == 'needs repro'
permissions:
issues: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
scripts
.github
CMakeLists.txt
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: "1.1.13"
- name: "add platform and command label"
id: add-labels
if: github.event.label.name == 'crash'
env:
GITHUB_ISSUE_BODY: ${{ github.event.issue.body }}
GITHUB_ISSUE_TITLE: ${{ github.event.issue.title }}
shell: bash
run: |
LABELS=$(bun scripts/read-issue.ts)
echo "labels=$LABELS" >> $GITHUB_OUTPUT
bun scripts/is-outdated.ts
if [[ -f "is-outdated.txt" ]]; then
echo "is-outdated=true" >> $GITHUB_OUTPUT
fi
if [[ -f "outdated.txt" ]]; then
echo "oudated=$(cat outdated.txt)" >> $GITHUB_OUTPUT
fi
echo "latest=$(cat LATEST)" >> $GITHUB_OUTPUT
rm -rf is-outdated.txt outdated.txt latest.txt
- name: Generate comment text with Sentry Link
if: github.event.label.name == 'crash'
# ignore if fail
continue-on-error: true
id: generate-comment-text
env:
GITHUB_ISSUE_BODY: ${{ github.event.issue.body }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_EVENTS_SECRET }}
shell: bash
run: |
bun scripts/associate-issue-with-sentry.ts
if [[ -f "sentry-link.txt" ]]; then
echo "sentry-link=$(cat sentry-link.txt)" >> $GITHUB_OUTPUT
fi
if [[ -f "sentry-id.txt" ]]; then
echo "sentry-id=$(cat sentry-id.txt)" >> $GITHUB_OUTPUT
fi
- name: Add labels
uses: actions-cool/issues-helper@v3
if: github.event.label.name == 'crash'
with:
actions: "add-labels"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: ${{ steps.add-labels.outputs.labels }}
- name: Comment outdated
if: steps.add-labels.outputs.is-outdated == 'true' && github.event.label.name == 'crash' && steps.generate-comment-text.outputs.sentry-link == ''
uses: actions-cool/issues-helper@v3
with:
actions: "create-comment"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
@${{ github.event.issue.user.login }}, the latest version of Bun is v${{ steps.add-labels.outputs.latest }}, but this crash was reported on Bun v${{ steps.add-labels.outputs.oudated }}.
Are you able to reproduce this crash on the latest version of Bun?
```sh
bun upgrade
```
- name: Comment with Sentry Link and outdated version
if: steps.generate-comment-text.outputs.sentry-link != '' && github.event.label.name == 'crash' && steps.add-labels.outputs.is-outdated == 'true'
uses: actions-cool/issues-helper@v3
with:
actions: "create-comment"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
@${{ github.event.issue.user.login }}, thank you for reporting this crash. The latest version of Bun is v${{ steps.add-labels.outputs.latest }}, but this crash was reported on Bun v${{ steps.add-labels.outputs.oudated }}.
Are you able to reproduce this crash on the latest version of Bun?
```sh
bun upgrade
```
For Bun's internal tracking, this issue is [${{ steps.generate-comment-text.outputs.sentry-id }}](${{ steps.generate-comment-text.outputs.sentry-link }}).
<!-- sentry-id: ${{ steps.generate-comment-text.outputs.sentry-id }} -->
<!-- sentry-link: ${{ steps.generate-comment-text.outputs.sentry-link }} -->
- name: Comment with Sentry Link
if: steps.generate-comment-text.outputs.sentry-link != '' && github.event.label.name == 'crash' && steps.add-labels.outputs.is-outdated != 'true'
uses: actions-cool/issues-helper@v3
with:
actions: "create-comment"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Thank you for reporting this crash.
For Bun's internal tracking, this issue is [${{ steps.generate-comment-text.outputs.sentry-id }}](${{ steps.generate-comment-text.outputs.sentry-link }}).
<!-- sentry-id: ${{ steps.generate-comment-text.outputs.sentry-id }} -->
<!-- sentry-link: ${{ steps.generate-comment-text.outputs.sentry-link }} -->
- name: Comment needs repro
if: github.event.label.name == 'needs repro'
uses: actions-cool/issues-helper@v3
with:
actions: "create-comment"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository, [Replit](https://replit.com/@replit/Bun), [CodeSandbox](https://codesandbox.io/templates/bun), or provide a bulleted list of commands to run that reproduce this issue. Issues marked with `needs repro` will be closed if they have no activity within 3 days.

View File

@@ -1,14 +0,0 @@
name: 'Labeler'
on:
pull_request_target:
jobs:
labeler:
runs-on: ubuntu-latest
steps:
- name: Label PR
uses: actions/labeler@v4
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
sync-labels: true

View File

@@ -0,0 +1,89 @@
name: Comment on updated submodule
on:
pull_request_target:
paths:
- "src/generated_versions_list.zig"
- ".github/workflows/on-submodule-update.yml"
jobs:
comment:
name: Comment
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'oven-sh' }}
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Checkout current
uses: actions/checkout@v4
with:
sparse-checkout: |
src
- name: Hash generated versions list
id: hash
run: |
echo "hash=$(sha256sum src/generated_versions_list.zig | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
- name: Checkout base
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
sparse-checkout: |
src
- name: Hash base
id: base
run: |
echo "base=$(sha256sum src/generated_versions_list.zig | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
- name: Compare
id: compare
run: |
if [ "${{ steps.hash.outputs.hash }}" != "${{ steps.base.outputs.base }}" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Find Comment
id: comment
uses: peter-evans/find-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: github-actions[bot]
body-includes: <!-- generated-comment submodule-updated -->
- name: Write Warning Comment
uses: peter-evans/create-or-update-comment@v4
if: steps.compare.outputs.changed == 'true'
with:
comment-id: ${{ steps.comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
⚠️ **Warning:** @${{ github.actor }}, this PR has changes to submodule versions.
If this change was intentional, please ignore this message. If not, please undo changes to submodules and rebase your branch.
<!-- generated-comment submodule-updated -->
- name: Add labels
uses: actions-cool/issues-helper@v3
if: steps.compare.outputs.changed == 'true'
with:
actions: "add-labels"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
labels: "changed-submodules"
- name: Remove labels
uses: actions-cool/issues-helper@v3
if: steps.compare.outputs.changed == 'false'
with:
actions: "remove-labels"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
labels: "changed-submodules"
- name: Delete outdated comment
uses: actions-cool/issues-helper@v3
if: steps.compare.outputs.changed == 'false' && steps.comment.outputs.comment-id != ''
with:
actions: "delete-comment"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.comment.outputs.comment-id }}

37
.github/workflows/prettier-format.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: prettier-format
permissions:
contents: write
on:
workflow_call:
workflow_dispatch:
pull_request:
merge_group:
env:
BUN_VERSION: "1.1.27"
jobs:
prettier-format:
name: prettier-format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Setup Dependencies
run: |
bun install
- name: Prettier Format
run: |
bun run prettier:diff
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "`bun run prettier:extra`"

318
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,318 @@
# TODO: Move this to bash scripts intead of Github Actions
# so it can be run from Buildkite, see: .buildkite/scripts/release.sh
name: Release
concurrency: release
env:
BUN_VERSION: ${{ github.event.inputs.tag || github.event.release.tag_name || 'canary' }}
BUN_LATEST: ${{ (github.event.inputs.is-latest || github.event.release.tag_name) && 'true' || 'false' }}
on:
release:
types:
- published
schedule:
- cron: "0 14 * * *" # every day at 6am PST
workflow_dispatch:
inputs:
is-latest:
description: Is this the latest release?
type: boolean
default: false
tag:
type: string
description: What is the release tag? (e.g. "1.0.2", "canary")
required: true
use-docker:
description: Should Docker images be released?
type: boolean
default: false
use-npm:
description: Should npm packages be published?
type: boolean
default: false
use-homebrew:
description: Should binaries be released to Homebrew?
type: boolean
default: false
use-s3:
description: Should binaries be uploaded to S3?
type: boolean
default: false
use-types:
description: Should types be released to npm?
type: boolean
default: false
jobs:
sign:
name: Sign Release
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'oven-sh' }}
permissions:
contents: write
defaults:
run:
working-directory: packages/bun-release
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup GPG
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: "1.1.20"
- name: Install Dependencies
run: bun install
- name: Sign Release
run: |
echo "$GPG_PASSPHRASE" | bun upload-assets -- "${{ env.BUN_VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
npm:
name: Release to NPM
runs-on: ubuntu-latest
needs: sign
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.use-npm == 'true' }}
permissions:
contents: read
defaults:
run:
working-directory: packages/bun-release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# To workaround issue
ref: main
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: "1.1.20"
- name: Install Dependencies
run: bun install
- name: Release
run: bun upload-npm -- "${{ env.BUN_VERSION }}" publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
npm-types:
name: Release types to NPM
runs-on: ubuntu-latest
needs: sign
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.use-types == 'true' }}
permissions:
contents: read
defaults:
run:
working-directory: packages/bun-types
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: latest
- name: Setup Bun
if: ${{ env.BUN_VERSION != 'canary' }}
uses: ./.github/actions/setup-bun
with:
bun-version: "1.1.20"
- name: Setup Bun
if: ${{ env.BUN_VERSION == 'canary' }}
uses: ./.github/actions/setup-bun
with:
bun-version: "canary" # Must be 'canary' so tag is correct
- name: Install Dependencies
run: bun install
- name: Setup Tag
if: ${{ env.BUN_VERSION == 'canary' }}
run: |
VERSION=$(bun --version)
TAG="${VERSION}-canary.$(date +'%Y%m%dT%H%M%S')"
echo "Setup tag: ${TAG}"
echo "TAG=${TAG}" >> ${GITHUB_ENV}
- name: Build
run: bun run build
env:
BUN_VERSION: ${{ env.TAG || env.BUN_VERSION }}
- name: Release (canary)
if: ${{ env.BUN_VERSION == 'canary' }}
uses: JS-DevTools/npm-publish@v1
with:
package: packages/bun-types/package.json
token: ${{ secrets.NPM_TOKEN }}
tag: canary
- name: Release (latest)
if: ${{ env.BUN_LATEST == 'true' }}
uses: JS-DevTools/npm-publish@v1
with:
package: packages/bun-types/package.json
token: ${{ secrets.NPM_TOKEN }}
docker:
name: Release to Dockerhub
runs-on: ubuntu-latest
needs: sign
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.use-docker == 'true' }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- variant: debian
suffix: ""
- variant: debian
suffix: -debian
- variant: slim
suffix: -slim
dir: debian-slim
- variant: alpine
suffix: -alpine
- variant: distroless
suffix: -distroless
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Docker emulator
uses: docker/setup-qemu-action@v2
- id: buildx
name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- id: metadata
name: Setup Docker metadata
uses: docker/metadata-action@v4
with:
images: oven/bun
flavor: |
latest=false
tags: |
type=raw,value=latest,enable=${{ env.BUN_LATEST == 'true' && matrix.suffix == '' }}
type=raw,value=${{ matrix.variant }},enable=${{ env.BUN_LATEST == 'true' }}
type=match,pattern=(bun-v)?(canary|\d+.\d+.\d+),group=2,value=${{ env.BUN_VERSION }},suffix=${{ matrix.suffix }}
type=match,pattern=(bun-v)?(canary|\d+.\d+),group=2,value=${{ env.BUN_VERSION }},suffix=${{ matrix.suffix }}
type=match,pattern=(bun-v)?(canary|\d+),group=2,value=${{ env.BUN_VERSION }},suffix=${{ matrix.suffix }}
- name: Login to Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Docker
uses: docker/build-push-action@v5
with:
context: ./dockerhub/${{ matrix.dir || matrix.variant }}
platforms: linux/amd64,linux/arm64
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
build-args: |
BUN_VERSION=${{ env.BUN_VERSION }}
homebrew:
name: Release to Homebrew
runs-on: ubuntu-latest
needs: sign
permissions:
contents: read
if: ${{ github.event_name == 'release' || github.event.inputs.use-homebrew == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: oven-sh/homebrew-bun
token: ${{ secrets.ROBOBUN_TOKEN }}
- id: gpg
name: Setup GPG
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.6"
- name: Update Tap
run: ruby scripts/release.rb "${{ env.BUN_VERSION }}"
- name: Commit Tap
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_options: --gpg-sign=${{ steps.gpg.outputs.keyid }}
commit_message: Release ${{ env.BUN_VERSION }}
commit_user_name: robobun
commit_user_email: robobun@oven.sh
commit_author: robobun <robobun@oven.sh>
s3:
name: Upload to S3
runs-on: ubuntu-latest
needs: sign
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.use-s3 == 'true' }}
permissions:
contents: read
defaults:
run:
working-directory: packages/bun-release
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: "1.1.20"
- name: Install Dependencies
run: bun install
- name: Release
run: bun upload-s3 -- "${{ env.BUN_VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
AWS_ENDPOINT: ${{ secrets.AWS_ENDPOINT }}
AWS_BUCKET: bun
notify-sentry:
name: Notify Sentry
runs-on: ubuntu-latest
needs: s3
steps:
- name: Notify Sentry
uses: getsentry/action-release@v1.7.0
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
ignore_missing: true
ignore_empty: true
version: ${{ env.BUN_VERSION }}
environment: production
bump:
name: "Bump version"
runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' }}
permissions:
pull-requests: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
if: ${{ env.BUN_LATEST == 'true' }}
- name: Setup Bun
uses: ./.github/actions/setup-bun
if: ${{ env.BUN_LATEST == 'true' }}
with:
bun-version: "1.1.12"
- name: Bump version
uses: ./.github/actions/bump
if: ${{ env.BUN_LATEST == 'true' }}
with:
version: ${{ env.BUN_VERSION }}
token: ${{ github.token }}

32
.github/workflows/run-lint.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Lint
permissions:
contents: read
env:
LLVM_VERSION: 16
on:
workflow_call:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
outputs:
text_output: ${{ steps.lint.outputs.text_output }}
json_output: ${{ steps.lint.outputs.json_output }}
count: ${{ steps.lint.outputs.count }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: "1.1.3"
- name: Install Dependencies
run: |
bun --cwd=packages/bun-internal-test install
- name: Lint
id: lint
run: |
bun packages/bun-internal-test/src/linter.ts

30
.github/workflows/stale.yaml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Close inactive issues
on:
# schedule:
# - cron: "15 * * * *"
workflow_dispatch:
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
days-before-issue-close: 5
any-of-issue-labels: "needs repro,waiting-for-author"
exempt-issue-labels: "neverstale"
exempt-pr-labels: "neverstale"
remove-stale-when-updated: true
stale-issue-label: "stale"
stale-pr-label: "stale"
stale-issue-message: "This issue is stale and may be closed due to inactivity. If you're still running into this, please leave a comment."
close-issue-message: "This issue was closed because it has been inactive for 5 days since being marked as stale."
days-before-pr-stale: 30
days-before-pr-close: 14
stale-pr-message: "This pull request is stale and may be closed due to inactivity."
close-pr-message: "This pull request has been closed due to inactivity."
repo-token: ${{ github.token }}
operations-per-run: 1000

29
.github/workflows/test-bump.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: Test Bump version
on:
workflow_dispatch:
inputs:
version:
type: string
description: What is the release tag? (e.g. "1.0.2", "canary")
required: true
jobs:
bump:
name: "Bump version"
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: "1.1.12"
- name: Bump version
uses: ./.github/actions/bump
with:
version: ${{ inputs.version }}
token: ${{ github.token }}

92
.github/workflows/update-cares.yml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: Update c-ares
on:
schedule:
- cron: "0 4 * * 0"
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Check c-ares version
id: check-version
run: |
set -euo pipefail
# Extract the commit hash from the line after COMMIT
CURRENT_VERSION=$(awk '/[[:space:]]*COMMIT[[:space:]]*$/{getline; gsub(/^[[:space:]]+|[[:space:]]+$/,"",$0); print}' cmake/targets/BuildCares.cmake)
if [ -z "$CURRENT_VERSION" ]; then
echo "Error: Could not find COMMIT line in BuildCares.cmake"
exit 1
fi
# Validate that it looks like a git hash
if ! [[ $CURRENT_VERSION =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid git hash format in BuildCares.cmake"
echo "Found: $CURRENT_VERSION"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/c-ares/c-ares/releases/latest)
if [ -z "$LATEST_RELEASE" ]; then
echo "Error: Failed to fetch latest release from GitHub API"
exit 1
fi
LATEST_TAG=$(echo "$LATEST_RELEASE" | jq -r '.tag_name')
if [ -z "$LATEST_TAG" ] || [ "$LATEST_TAG" = "null" ]; then
echo "Error: Could not extract tag name from GitHub API response"
exit 1
fi
LATEST_SHA=$(curl -sL "https://api.github.com/repos/c-ares/c-ares/git/ref/tags/$LATEST_TAG" | jq -r '.object.sha')
if [ -z "$LATEST_SHA" ] || [ "$LATEST_SHA" = "null" ]; then
echo "Error: Could not fetch SHA for tag $LATEST_TAG"
exit 1
fi
if ! [[ $LATEST_SHA =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid SHA format received from GitHub"
echo "Found: $LATEST_SHA"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "latest=$LATEST_SHA" >> $GITHUB_OUTPUT
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
- name: Update version if needed
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
run: |
set -euo pipefail
# Handle multi-line format where COMMIT and its value are on separate lines
sed -i -E '/[[:space:]]*COMMIT[[:space:]]*$/{n;s/[[:space:]]*([0-9a-f]+)[[:space:]]*$/ ${{ steps.check-version.outputs.latest }}/}' cmake/targets/BuildCares.cmake
- name: Create Pull Request
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
cmake/targets/BuildCares.cmake
commit-message: "deps: update c-ares to ${{ steps.check-version.outputs.tag }} (${{ steps.check-version.outputs.latest }})"
title: "deps: update c-ares to ${{ steps.check-version.outputs.tag }}"
delete-branch: true
branch: deps/update-cares-${{ github.run_number }}
body: |
## What does this PR do?
Updates c-ares to version ${{ steps.check-version.outputs.tag }}
Auto-updated by [this workflow](https://github.com/oven-sh/bun/actions/workflows/update-cares.yml)

92
.github/workflows/update-libarchive.yml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: Update libarchive
on:
schedule:
- cron: "0 3 * * 0"
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Check libarchive version
id: check-version
run: |
set -euo pipefail
# Extract the commit hash from the line after COMMIT
CURRENT_VERSION=$(awk '/[[:space:]]*COMMIT[[:space:]]*$/{getline; gsub(/^[[:space:]]+|[[:space:]]+$/,"",$0); print}' cmake/targets/BuildLibArchive.cmake)
if [ -z "$CURRENT_VERSION" ]; then
echo "Error: Could not find COMMIT line in BuildLibArchive.cmake"
exit 1
fi
# Validate that it looks like a git hash
if ! [[ $CURRENT_VERSION =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid git hash format in BuildLibArchive.cmake"
echo "Found: $CURRENT_VERSION"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/libarchive/libarchive/releases/latest)
if [ -z "$LATEST_RELEASE" ]; then
echo "Error: Failed to fetch latest release from GitHub API"
exit 1
fi
LATEST_TAG=$(echo "$LATEST_RELEASE" | jq -r '.tag_name')
if [ -z "$LATEST_TAG" ] || [ "$LATEST_TAG" = "null" ]; then
echo "Error: Could not extract tag name from GitHub API response"
exit 1
fi
LATEST_SHA=$(curl -sL "https://api.github.com/repos/libarchive/libarchive/git/ref/tags/$LATEST_TAG" | jq -r '.object.sha')
if [ -z "$LATEST_SHA" ] || [ "$LATEST_SHA" = "null" ]; then
echo "Error: Could not fetch SHA for tag $LATEST_TAG"
exit 1
fi
if ! [[ $LATEST_SHA =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid SHA format received from GitHub"
echo "Found: $LATEST_SHA"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "latest=$LATEST_SHA" >> $GITHUB_OUTPUT
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
- name: Update version if needed
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
run: |
set -euo pipefail
# Handle multi-line format where COMMIT and its value are on separate lines
sed -i -E '/[[:space:]]*COMMIT[[:space:]]*$/{n;s/[[:space:]]*([0-9a-f]+)[[:space:]]*$/ ${{ steps.check-version.outputs.latest }}/}' cmake/targets/BuildLibArchive.cmake
- name: Create Pull Request
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
cmake/targets/BuildLibArchive.cmake
commit-message: "deps: update libarchive to ${{ steps.check-version.outputs.tag }} (${{ steps.check-version.outputs.latest }})"
title: "deps: update libarchive to ${{ steps.check-version.outputs.tag }}"
delete-branch: true
branch: deps/update-libarchive-${{ github.run_number }}
body: |
## What does this PR do?
Updates libarchive to version ${{ steps.check-version.outputs.tag }}
Auto-updated by [this workflow](https://github.com/oven-sh/bun/actions/workflows/update-libarchive.yml)

92
.github/workflows/update-libdeflate.yml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: Update libdeflate
on:
schedule:
- cron: "0 2 * * 0"
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Check libdeflate version
id: check-version
run: |
set -euo pipefail
# Extract the commit hash from the line after COMMIT
CURRENT_VERSION=$(awk '/[[:space:]]*COMMIT[[:space:]]*$/{getline; gsub(/^[[:space:]]+|[[:space:]]+$/,"",$0); print}' cmake/targets/BuildLibDeflate.cmake)
if [ -z "$CURRENT_VERSION" ]; then
echo "Error: Could not find COMMIT line in BuildLibDeflate.cmake"
exit 1
fi
# Validate that it looks like a git hash
if ! [[ $CURRENT_VERSION =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid git hash format in BuildLibDeflate.cmake"
echo "Found: $CURRENT_VERSION"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/ebiggers/libdeflate/releases/latest)
if [ -z "$LATEST_RELEASE" ]; then
echo "Error: Failed to fetch latest release from GitHub API"
exit 1
fi
LATEST_TAG=$(echo "$LATEST_RELEASE" | jq -r '.tag_name')
if [ -z "$LATEST_TAG" ] || [ "$LATEST_TAG" = "null" ]; then
echo "Error: Could not extract tag name from GitHub API response"
exit 1
fi
LATEST_SHA=$(curl -sL "https://api.github.com/repos/ebiggers/libdeflate/git/ref/tags/$LATEST_TAG" | jq -r '.object.sha')
if [ -z "$LATEST_SHA" ] || [ "$LATEST_SHA" = "null" ]; then
echo "Error: Could not fetch SHA for tag $LATEST_TAG"
exit 1
fi
if ! [[ $LATEST_SHA =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid SHA format received from GitHub"
echo "Found: $LATEST_SHA"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "latest=$LATEST_SHA" >> $GITHUB_OUTPUT
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
- name: Update version if needed
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
run: |
set -euo pipefail
# Handle multi-line format where COMMIT and its value are on separate lines
sed -i -E '/[[:space:]]*COMMIT[[:space:]]*$/{n;s/[[:space:]]*([0-9a-f]+)[[:space:]]*$/ ${{ steps.check-version.outputs.latest }}/}' cmake/targets/BuildLibDeflate.cmake
- name: Create Pull Request
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
cmake/targets/BuildLibDeflate.cmake
commit-message: "deps: update libdeflate to ${{ steps.check-version.outputs.tag }} (${{ steps.check-version.outputs.latest }})"
title: "deps: update libdeflate to ${{ steps.check-version.outputs.tag }}"
delete-branch: true
branch: deps/update-libdeflate-${{ github.run_number }}
body: |
## What does this PR do?
Updates libdeflate to version ${{ steps.check-version.outputs.tag }}
Auto-updated by [this workflow](https://github.com/oven-sh/bun/actions/workflows/update-libdeflate.yml)

92
.github/workflows/update-lolhtml.yml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: Update lolhtml
on:
schedule:
- cron: "0 1 * * 0"
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Check lolhtml version
id: check-version
run: |
set -euo pipefail
# Extract the commit hash from the line after COMMIT
CURRENT_VERSION=$(awk '/[[:space:]]*COMMIT[[:space:]]*$/{getline; gsub(/^[[:space:]]+|[[:space:]]+$/,"",$0); print}' cmake/targets/BuildLolHtml.cmake)
if [ -z "$CURRENT_VERSION" ]; then
echo "Error: Could not find COMMIT line in BuildLolHtml.cmake"
exit 1
fi
# Validate that it looks like a git hash
if ! [[ $CURRENT_VERSION =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid git hash format in BuildLolHtml.cmake"
echo "Found: $CURRENT_VERSION"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/cloudflare/lol-html/releases/latest)
if [ -z "$LATEST_RELEASE" ]; then
echo "Error: Failed to fetch latest release from GitHub API"
exit 1
fi
LATEST_TAG=$(echo "$LATEST_RELEASE" | jq -r '.tag_name')
if [ -z "$LATEST_TAG" ] || [ "$LATEST_TAG" = "null" ]; then
echo "Error: Could not extract tag name from GitHub API response"
exit 1
fi
LATEST_SHA=$(curl -sL "https://api.github.com/repos/cloudflare/lol-html/git/ref/tags/$LATEST_TAG" | jq -r '.object.sha')
if [ -z "$LATEST_SHA" ] || [ "$LATEST_SHA" = "null" ]; then
echo "Error: Could not fetch SHA for tag $LATEST_TAG"
exit 1
fi
if ! [[ $LATEST_SHA =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid SHA format received from GitHub"
echo "Found: $LATEST_SHA"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "latest=$LATEST_SHA" >> $GITHUB_OUTPUT
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
- name: Update version if needed
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
run: |
set -euo pipefail
# Handle multi-line format where COMMIT and its value are on separate lines
sed -i -E '/[[:space:]]*COMMIT[[:space:]]*$/{n;s/[[:space:]]*([0-9a-f]+)[[:space:]]*$/ ${{ steps.check-version.outputs.latest }}/}' cmake/targets/BuildLolHtml.cmake
- name: Create Pull Request
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
cmake/targets/BuildLolHtml.cmake
commit-message: "deps: update lolhtml to ${{ steps.check-version.outputs.tag }} (${{ steps.check-version.outputs.latest }})"
title: "deps: update lolhtml to ${{ steps.check-version.outputs.tag }}"
delete-branch: true
branch: deps/update-lolhtml-${{ github.run_number }}
body: |
## What does this PR do?
Updates lolhtml to version ${{ steps.check-version.outputs.tag }}
Auto-updated by [this workflow](https://github.com/oven-sh/bun/actions/workflows/update-lolhtml.yml)

92
.github/workflows/update-lshpack.yml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: Update lshpack
on:
schedule:
- cron: "0 5 * * 0"
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Check lshpack version
id: check-version
run: |
set -euo pipefail
# Extract the commit hash from the line after COMMIT
CURRENT_VERSION=$(awk '/[[:space:]]*COMMIT[[:space:]]*$/{getline; gsub(/^[[:space:]]+|[[:space:]]+$/,"",$0); print}' cmake/targets/BuildLshpack.cmake)
if [ -z "$CURRENT_VERSION" ]; then
echo "Error: Could not find COMMIT line in BuildLshpack.cmake"
exit 1
fi
# Validate that it looks like a git hash
if ! [[ $CURRENT_VERSION =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid git hash format in BuildLshpack.cmake"
echo "Found: $CURRENT_VERSION"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/litespeedtech/ls-hpack/releases/latest)
if [ -z "$LATEST_RELEASE" ]; then
echo "Error: Failed to fetch latest release from GitHub API"
exit 1
fi
LATEST_TAG=$(echo "$LATEST_RELEASE" | jq -r '.tag_name')
if [ -z "$LATEST_TAG" ] || [ "$LATEST_TAG" = "null" ]; then
echo "Error: Could not extract tag name from GitHub API response"
exit 1
fi
LATEST_SHA=$(curl -sL "https://api.github.com/repos/litespeedtech/ls-hpack/git/ref/tags/$LATEST_TAG" | jq -r '.object.sha')
if [ -z "$LATEST_SHA" ] || [ "$LATEST_SHA" = "null" ]; then
echo "Error: Could not fetch SHA for tag $LATEST_TAG"
exit 1
fi
if ! [[ $LATEST_SHA =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid SHA format received from GitHub"
echo "Found: $LATEST_SHA"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "latest=$LATEST_SHA" >> $GITHUB_OUTPUT
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
- name: Update version if needed
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
run: |
set -euo pipefail
# Handle multi-line format where COMMIT and its value are on separate lines
sed -i -E '/[[:space:]]*COMMIT[[:space:]]*$/{n;s/[[:space:]]*([0-9a-f]+)[[:space:]]*$/ ${{ steps.check-version.outputs.latest }}/}' cmake/targets/BuildLshpack.cmake
- name: Create Pull Request
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
cmake/targets/BuildLshpack.cmake
commit-message: "deps: update lshpack to ${{ steps.check-version.outputs.tag }} (${{ steps.check-version.outputs.latest }})"
title: "deps: update lshpack to ${{ steps.check-version.outputs.tag }}"
delete-branch: true
branch: deps/update-lshpack-${{ github.run_number }}
body: |
## What does this PR do?
Updates lshpack to version ${{ steps.check-version.outputs.tag }}
Auto-updated by [this workflow](https://github.com/oven-sh/bun/actions/workflows/update-lshpack.yml)

109
.github/workflows/update-sqlite3.yml vendored Normal file
View File

@@ -0,0 +1,109 @@
name: Update SQLite3
on:
schedule:
- cron: "0 6 * * 0" # Run weekly
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Check SQLite version
id: check-version
run: |
set -euo pipefail
# Get current version from the header file using SQLITE_VERSION_NUMBER
CURRENT_VERSION_NUM=$(grep -o '#define SQLITE_VERSION_NUMBER [0-9]\+' src/bun.js/bindings/sqlite/sqlite3_local.h | awk '{print $3}' | tr -d '\n\r')
if [ -z "$CURRENT_VERSION_NUM" ]; then
echo "Error: Could not find SQLITE_VERSION_NUMBER in sqlite3_local.h"
exit 1
fi
# Convert numeric version to semantic version for display
CURRENT_MAJOR=$((CURRENT_VERSION_NUM / 1000000))
CURRENT_MINOR=$((($CURRENT_VERSION_NUM / 1000) % 1000))
CURRENT_PATCH=$((CURRENT_VERSION_NUM % 1000))
CURRENT_VERSION="$CURRENT_MAJOR.$CURRENT_MINOR.$CURRENT_PATCH"
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
echo "current_num=$CURRENT_VERSION_NUM" >> $GITHUB_OUTPUT
# Fetch SQLite download page
DOWNLOAD_PAGE=$(curl -sL https://sqlite.org/download.html)
if [ -z "$DOWNLOAD_PAGE" ]; then
echo "Error: Failed to fetch SQLite download page"
exit 1
fi
# Extract latest version and year from the amalgamation link
LATEST_INFO=$(echo "$DOWNLOAD_PAGE" | grep -o 'sqlite-amalgamation-[0-9]\{7\}.zip' | head -n1)
LATEST_YEAR=$(echo "$DOWNLOAD_PAGE" | grep -o '[0-9]\{4\}/sqlite-amalgamation-[0-9]\{7\}.zip' | head -n1 | cut -d'/' -f1 | tr -d '\n\r')
LATEST_VERSION_NUM=$(echo "$LATEST_INFO" | grep -o '[0-9]\{7\}' | tr -d '\n\r')
if [ -z "$LATEST_VERSION_NUM" ] || [ -z "$LATEST_YEAR" ]; then
echo "Error: Could not extract latest version info"
exit 1
fi
# Convert numeric version to semantic version for display
LATEST_MAJOR=$((10#$LATEST_VERSION_NUM / 1000000))
LATEST_MINOR=$((($LATEST_VERSION_NUM / 1000) % 1000))
LATEST_PATCH=$((10#$LATEST_VERSION_NUM % 1000))
LATEST_VERSION="$LATEST_MAJOR.$LATEST_MINOR.$LATEST_PATCH"
echo "latest=$LATEST_VERSION" >> $GITHUB_OUTPUT
echo "latest_year=$LATEST_YEAR" >> $GITHUB_OUTPUT
echo "latest_num=$LATEST_VERSION_NUM" >> $GITHUB_OUTPUT
# Debug output
echo "Current version: $CURRENT_VERSION ($CURRENT_VERSION_NUM)"
echo "Latest version: $LATEST_VERSION ($LATEST_VERSION_NUM)"
- name: Update SQLite if needed
if: success() && steps.check-version.outputs.current_num < steps.check-version.outputs.latest_num
run: |
set -euo pipefail
TEMP_DIR=$(mktemp -d)
cd $TEMP_DIR
echo "Downloading from: https://sqlite.org/${{ steps.check-version.outputs.latest_year }}/sqlite-amalgamation-${{ steps.check-version.outputs.latest_num }}.zip"
# Download and extract latest version
wget "https://sqlite.org/${{ steps.check-version.outputs.latest_year }}/sqlite-amalgamation-${{ steps.check-version.outputs.latest_num }}.zip"
unzip "sqlite-amalgamation-${{ steps.check-version.outputs.latest_num }}.zip"
cd "sqlite-amalgamation-${{ steps.check-version.outputs.latest_num }}"
# Add header comment and copy files
echo "// clang-format off" > $GITHUB_WORKSPACE/src/bun.js/bindings/sqlite/sqlite3.c
cat sqlite3.c >> $GITHUB_WORKSPACE/src/bun.js/bindings/sqlite/sqlite3.c
echo "// clang-format off" > $GITHUB_WORKSPACE/src/bun.js/bindings/sqlite/sqlite3_local.h
cat sqlite3.h >> $GITHUB_WORKSPACE/src/bun.js/bindings/sqlite/sqlite3_local.h
- name: Create Pull Request
if: success() && steps.check-version.outputs.current_num < steps.check-version.outputs.latest_num
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
src/bun.js/bindings/sqlite/sqlite3.c
src/bun.js/bindings/sqlite/sqlite3_local.h
commit-message: "deps: update sqlite to ${{ steps.check-version.outputs.latest }}"
title: "deps: update sqlite to ${{ steps.check-version.outputs.latest }}"
delete-branch: true
branch: deps/update-sqlite-${{ steps.check-version.outputs.latest }}
body: |
## What does this PR do?
Updates SQLite to version ${{ steps.check-version.outputs.latest }}
Auto-updated by [this workflow](https://github.com/oven-sh/bun/actions/workflows/update-sqlite3.yml)

34
.github/workflows/zig-format.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: zig-format
permissions:
contents: write
on:
workflow_call:
workflow_dispatch:
pull_request:
merge_group:
env:
BUN_VERSION: "1.1.27"
jobs:
zig-format:
name: zig-format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Zig Format
run: |
bun run zig-format:diff
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "`bun run zig-format`"

248
.gitignore vendored
View File

@@ -1,105 +1,181 @@
.DS_Store
zig-cache
*.wasm
*.o
*.a
profile.json
node_modules
.env
.envrc
.eslintcache
.idea
.next
.ninja_deps
.ninja_log
.npm
.npm.gz
.parcel-cache
.swcrc
yarn.lock
dist
*.tmp
.trace
.uuid
.vs
.vscode/clang*
.vscode/cpp*
.zig-cache
*.a
*.bc
*.big
*.blob
*.bun
*.crash
*.database
*.db
*.dmg
*.dSYM
*.generated.ts
*.jsb
*.lib
*.log
*.o
*.out.js
*.out.refresh.js
/package-lock.json
build
*.pdb
*.sqlite
*.tmp
*.trace
*.wat
zig-out
pnpm-lock.yaml
README.md.template
src/deps/zig-clap/example
src/deps/zig-clap/README.md
src/deps/zig-clap/.github
src/deps/zig-clap/.gitattributes
out
outdir
.trace
*.zip
**/.verdaccio-db.json
**/*.dir
**/*.pdb
**/*.sln*
**/*.vcxproj*
**/package-lock.json
/.cache
/.webkit-cache
/build-*/
/bun-webkit
/kcov-out
/test-report.json
/test-report.md
/test.js
/test.ts
/test.zig
/testdir
build
build.ninja
bun-binary
bun-mimalloc
bun-nomimalloc
bun-singlehtreaded
bun-test-scratch
bun-zigld
cmake_install.cmake
CMakeCache.txt
CMakeFiles
cold-jsc-start
cold-jsc-start.d
compile_commands.json
cover
coverage
coverv
*.trace
github
out.*
out
.parcel-cache
dist
esbuilddir
*.bun
parceldist
esbuilddir
outdir/
outcss
.next
txt.js
.idea
.vscode/cpp*
node_modules_*
*.jsb
*.zip
bun-zigld
bun-singlehtreaded
bun-nomimalloc
bun-mimalloc
examples/lotta-modules/bun-yday
examples/lotta-modules/bun-old
examples/lotta-modules/bun-nofscache
src/node-fallbacks/out/*
src/node-fallbacks/node_modules
sign.json
release/
*.dmg
sign.*.json
packages/debug-*
packages/bun-cli/postinstall.js
examples/lotta-modules/bun-old
examples/lotta-modules/bun-yday
failing-tests.txt
github
make-dev-stats.csv
misctools/fetch
misctools/machbench
misctools/sha
myscript.sh
node_modules
node_modules_*
out
out.*
outcss
outdir
outdir/
packages/*/*.wasm
packages/bun-*/*.o
packages/bun-*/bun
packages/bun-*/bun-profile
packages/bun-*/debug-bun
packages/bun-*/*.o
packages/bun-cli/postinstall.js
packages/bun-cli/bin/*
bun-test-scratch
misctools/fetch
src/deps/libiconv
src/deps/openssl
src/tests.zig
*.blob
src/deps/s2n-tls
.npm
.npm.gz
bun-binary
src/deps/PLCrashReporter/
*.dSYM
*.crash
misctools/sha
packages/bun-wasm/*.mjs
packages/bun-cli/postinstall.js
packages/bun-wasm/*.cjs
packages/bun-wasm/*.map
packages/bun-wasm/*.js
packages/bun-wasm/*.d.cts
packages/bun-wasm/*.d.mts
packages/bun-wasm/*.d.ts
*.bc
packages/bun-wasm/*.js
packages/bun-wasm/*.map
packages/bun-wasm/*.mjs
packages/debug-*
parceldist
pnpm-lock.yaml
profile.json
README.md.template
release/
scripts/env.local
sign.*.json
sign.json
src/bake/generated.ts
src/generated_enum_extractor.zig
src/bun.js/bindings-obj
src/bun.js/bindings/GeneratedJS2Native.zig
src/bun.js/bindings/GeneratedBindings.zig
src/bun.js/debug-bindings-obj
src/deps/zig-clap/.gitattributes
src/deps/zig-clap/.github
src/deps/zig-clap/example
src/deps/zig-clap/README.md
src/fallback.version
src/js/out/DebugPath.h
src/js/out/functions*
src/js/out/modules*
src/js/out/tmp
src/node-fallbacks/node_modules
src/node-fallbacks/out/*
src/runtime.version
*.sqlite
*.database
*.db
src/tests.zig
test.txt
test/js/bun/glob/fixtures
test/node.js/upstream
tsconfig.tsbuildinfo
txt.js
x64
yarn.lock
zig-cache
zig-out
test/node.js/upstream
.zig-cache
scripts/env.local
*.generated.ts
src/bake/generated.ts
test/cli/install/registry/packages/publish-pkg-*
test/cli/install/registry/packages/@secret/publish-pkg-8
test/js/third_party/prisma/prisma/sqlite/dev.db-journal
# Dependencies
/vendor
# Dependencies (before CMake)
# These can be removed in the far future
/src/bun.js/WebKit
/src/deps/boringssl
/src/deps/brotli
/src/deps/c*ares
/src/deps/libarchive
/src/deps/libdeflate
/src/deps/libuv
/src/deps/lol*html
/src/deps/ls*hpack
/src/deps/mimalloc
/src/deps/picohttpparser
/src/deps/tinycc
/src/deps/WebKit
/src/deps/zig
/src/deps/zlib
/src/deps/zstd
# Generated files
.buildkite/ci.yml
*.sock
scratch*.{js,ts,tsx,cjs,mjs}

71
.gitmodules vendored
View File

@@ -1,71 +0,0 @@
[submodule "src/deps/picohttpparser"]
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/bun.js/WebKit
url = https://github.com/Jarred-Sumner/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
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/zlib"]
path = src/deps/zlib
url = https://github.com/cloudflare/zlib.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/libarchive"]
path = src/deps/libarchive
url = https://github.com/libarchive/libarchive.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/boringssl"]
path = src/deps/boringssl
url = https://github.com/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
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/lol-html"]
path = src/deps/lol-html
url = https://github.com/cloudflare/lol-html
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/uws"]
path = src/deps/uws
url = https://github.com/Jarred-Sumner/uWebSockets
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = true
[submodule "src/deps/tinycc"]
path = src/deps/tinycc
url = https://github.com/Jarred-Sumner/tinycc.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false

4
.lldbinit Normal file
View File

@@ -0,0 +1,4 @@
# command script import vendor/zig/tools/lldb_pretty_printers.py
command script import vendor/WebKit/Tools/lldb/lldb_webkit.py
# type summary add --summary-string "${var} | inner=${var[0-30]}, source=${var[33-64]}, tag=${var[31-32]}" "unsigned long"

9
.prettierignore Normal file
View File

@@ -0,0 +1,9 @@
src/bun.js/WebKit
vendor
test/snapshots
test/js/deno
test/node.js
src/react-refresh.js
*.min.js
test/snippets
test/js/node/test

24
.prettierrc Normal file
View File

@@ -0,0 +1,24 @@
{
"arrowParens": "avoid",
"printWidth": 120,
"trailingComma": "all",
"useTabs": false,
"quoteProps": "preserve",
"overrides": [
{
"files": [".vscode/*.json"],
"options": {
"parser": "jsonc",
"quoteProps": "preserve",
"singleQuote": false,
"trailingComma": "all"
}
},
{
"files": ["*.md"],
"options": {
"printWidth": 80
}
}
]
}

View File

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

View File

@@ -1,28 +1,39 @@
{
"configurations": [
{
"name": "Mac",
"name": "Debug",
"forcedInclude": ["${workspaceFolder}/src/bun.js/bindings/root.h"],
"compileCommands": "${workspaceFolder}/build/debug/compile_commands.json",
"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/bun.js/WebKit/WebKitBuild/Release/ICU/Headers/"
"${workspaceFolder}/build/bun-webkit/include",
"${workspaceFolder}/build/debug/codegen",
"${workspaceFolder}/src/bun.js/bindings/",
"${workspaceFolder}/src/bun.js/bindings/webcore/",
"${workspaceFolder}/src/bun.js/bindings/sqlite/",
"${workspaceFolder}/src/bun.js/bindings/webcrypto/",
"${workspaceFolder}/src/bun.js/modules/",
"${workspaceFolder}/src/js/builtins/",
"${workspaceFolder}/vendor/boringssl/include/",
"${workspaceFolder}/vendor",
"${workspaceFolder}/src/napi/*",
"${workspaceFolder}/packages/bun-usockets/src",
"${workspaceFolder}/packages/",
],
"browse": {
"path": [
"${workspaceFolder}/src/bun.js/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/bun.js/WebKit/WebKitBuild/Release/ICU/Headers/"
"${workspaceFolder}/build/bun-webkit/include",
"${workspaceFolder}/src/bun.js/bindings",
"${workspaceFolder}/src/napi/*",
"${workspaceFolder}/src/js/builtins/*",
"${workspaceFolder}/src/bun.js/modules/*",
"${workspaceFolder}/vendor/*",
"${workspaceFolder}/vendor/boringssl/include/*",
"${workspaceFolder}/packages/bun-usockets/*",
"${workspaceFolder}/packages/bun-uws/*",
"${workspaceFolder}/src/napi/*",
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ".vscode/cppdb"
"databaseFilename": ".vscode/cppdb",
},
"defines": [
"STATICALLY_LINKED_WITH_JavaScriptCore=1",
@@ -32,15 +43,78 @@
"ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS=0",
"BUILDING_JSCONLY__",
"USE_FOUNDATION=1",
"ASSERT_ENABLED=0",
"DU_DISABLE_RENAMING=1"
"ASSERT_ENABLED=1",
"DU_DISABLE_RENAMING=1",
],
"macFrameworkPath": [],
"compilerPath": "/usr/local/opt/llvm/bin/clang",
"compilerPath": "${workspaceFolder}/.vscode/clang++",
"cStandard": "c17",
"cppStandard": "c++11",
"intelliSenseMode": "macos-clang-x64"
}
"cppStandard": "c++20",
},
{
"name": "BunWithJSCDebug",
"forcedInclude": ["${workspaceFolder}/src/bun.js/bindings/root.h"],
"includePath": [
"${workspaceFolder}/build/debug/codegen",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/ICU/Headers/",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/JavaScriptCore/PrivateHeaders/",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/WTF/Headers",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/bmalloc/Headers/",
"${workspaceFolder}/src/bun.js/bindings/",
"${workspaceFolder}/src/bun.js/bindings/webcore/",
"${workspaceFolder}/src/bun.js/bindings/sqlite/",
"${workspaceFolder}/src/bun.js/bindings/webcrypto/",
"${workspaceFolder}/src/bun.js/modules/",
"${workspaceFolder}/src/js/builtins/",
"${workspaceFolder}/src/js/out",
"${workspaceFolder}/vendor/boringssl/include/",
"${workspaceFolder}/vendor",
"${workspaceFolder}/src/napi/*",
"${workspaceFolder}/packages/bun-usockets/src",
"${workspaceFolder}/packages/",
],
"browse": {
"path": [
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/ICU/Headers/",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/JavaScriptCore/PrivateHeaders/**",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/WTF/Headers/**",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/bmalloc/Headers/**",
"${workspaceFolder}/src/bun.js/bindings/*",
"${workspaceFolder}/src/bun.js/bindings/*",
"${workspaceFolder}/src/napi/*",
"${workspaceFolder}/src/bun.js/bindings/sqlite/",
"${workspaceFolder}/src/bun.js/bindings/webcrypto/",
"${workspaceFolder}/src/bun.js/bindings/webcore/",
"${workspaceFolder}/src/js/builtins/*",
"${workspaceFolder}/src/js/out/*",
"${workspaceFolder}/src/bun.js/modules/*",
"${workspaceFolder}/vendor",
"${workspaceFolder}/vendor/boringssl/include/",
"${workspaceFolder}/packages/bun-usockets/",
"${workspaceFolder}/packages/bun-uws/",
"${workspaceFolder}/src/napi",
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ".vscode/cppdb_debug",
},
"defines": [
"STATICALLY_LINKED_WITH_JavaScriptCore=1",
"STATICALLY_LINKED_WITH_WTF=1",
"BUILDING_WITH_CMAKE=1",
"NOMINMAX",
"ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS=0",
"BUILDING_JSCONLY__",
"USE_FOUNDATION=1",
"ASSERT_ENABLED=1",
"DU_DISABLE_RENAMING=1",
],
"macFrameworkPath": [],
"compilerPath": "${workspaceFolder}/.vscode/clang++",
"cStandard": "c17",
"cppStandard": "c++20",
},
],
"version": 4
"version": 4,
}

View File

@@ -1,8 +1,33 @@
{
"recommendations": [
"AugusteRame.zls-vscode",
"esbenp.prettier-vscode",
// Zig
"ziglang.vscode-zig",
// C/C++
"clang.clangd",
"ms-vscode.cmake-tools",
"xaver.clang-format",
"vadimcn.vscode-lldb"
]
"vadimcn.vscode-lldb",
// JavaScript
"oven.bun-vscode",
"esbenp.prettier-vscode",
// TypeScript
"better-ts-errors.better-ts-errors",
"MylesMurphy.prettify-ts",
// Markdown
"bierner.markdown-preview-github-styles",
"bierner.markdown-emoji",
"bierner.emojisense",
"bierner.markdown-checkbox",
"bierner.jsdoc-markdown-highlighting",
// TOML
"tamasfe.even-better-toml",
// Other
"bierner.comment-tagged-templates",
],
}

1194
.vscode/launch.json generated vendored

File diff suppressed because it is too large Load Diff

284
.vscode/settings.json vendored
View File

@@ -1,38 +1,128 @@
{
"git.autoRepositoryDetection": "openEditors",
// Editor
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
// Search
"search.quickOpen.includeSymbols": false,
"search.seedWithNearestWord": true,
"search.smartCase": true,
"search.exclude": {},
"search.exclude": {
"node_modules": true,
".git": true,
"vendor/*/**": true,
"test/node.js/upstream": true,
// This will fill up your whole search history.
"test/js/node/test/fixtures": true,
"test/js/node/test/common": true,
},
"search.followSymlinks": false,
"search.useIgnoreFiles": true,
"zig.buildOnSave": false,
"[zig]": {
"editor.tabSize": 4,
"editor.useTabStops": false,
"editor.defaultFormatter": "AugusteRame.zls-vscode",
"editor.formatOnSave": true
},
"[ts]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[js]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[jsx]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[tsx]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"zig.beforeDebugCmd": "make build-unit ${file} ${filter} ${bin}",
"zig.testCmd": "make test ${file} ${filter} ${bin}",
// Git
"git.autoRepositoryDetection": "openEditors",
"git.ignoreSubmodules": true,
"git.ignoreLimitWarning": true,
// Zig
"zig.initialSetupDone": true,
"zig.buildOption": "build",
"zig.zls.zigLibPath": "${workspaceFolder}/vendor/zig/lib",
"zig.buildArgs": ["-Dgenerated-code=./build/debug/codegen"],
"zig.zls.buildOnSaveStep": "check",
// "zig.zls.enableBuildOnSave": true,
// "zig.buildOnSave": true,
"zig.buildFilePath": "${workspaceFolder}/build.zig",
"zig.path": "${workspaceFolder}/vendor/zig/zig.exe",
"zig.formattingProvider": "zls",
"zig.zls.enableInlayHints": false,
"[zig]": {
"editor.tabSize": 4,
"editor.useTabStops": false,
"editor.defaultFormatter": "ziglang.vscode-zig",
},
// lldb
"lldb.launch.initCommands": ["command source ${workspaceFolder}/.lldbinit"],
"lldb.verboseLogging": false,
// C++
"cmake.configureOnOpen": false,
"C_Cpp.errorSquiggles": "enabled",
"[cpp]": {
"editor.tabSize": 4,
"editor.defaultFormatter": "xaver.clang-format",
},
"[c]": {
"editor.tabSize": 4,
"editor.defaultFormatter": "xaver.clang-format",
},
"[h]": {
"editor.tabSize": 4,
"editor.defaultFormatter": "xaver.clang-format",
},
// JavaScript
"prettier.enable": true,
"prettier.configPath": ".prettierrc",
"eslint.workingDirectories": ["${workspaceFolder}/packages/bun-types"],
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"prettier.prettierPath": "./node_modules/prettier",
// TypeScript
"typescript.tsdk": "node_modules/typescript/lib",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
// JSON
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
// Markdown
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.unicodeHighlight.ambiguousCharacters": true,
"editor.unicodeHighlight.invisibleCharacters": true,
"diffEditor.ignoreTrimWhitespace": false,
"editor.wordWrap": "on",
"editor.quickSuggestions": {
"comments": "off",
"strings": "off",
"other": "off",
},
},
// TOML
"[toml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
// YAML
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
// Docker
"[dockerfile]": {
"editor.formatOnSave": false,
},
// Files
"files.exclude": {
"**/.git": true,
"**/.svn": true,
@@ -42,129 +132,33 @@
"**/Thumbs.db": true,
"**/*.xcworkspacedata": true,
"**/*.xcscheme": true,
"**/*.pem": true,
"**/*.xcodeproj": true,
"packages/bun-types/*.d.ts": true,
"**/*.i": true,
"test/snapshots": true,
"test/snapshots-no-hmr": true,
"src/bun.js/WebKit": true,
"src/deps/libarchive": true,
"src/deps/mimalloc": true,
"src/deps/s2n-tls": true,
"src/deps/boringssl": true,
"src/deps/openssl": true,
"src/deps/uws": true,
"src/deps/zlib": true,
"src/deps/lol-html": true,
"test/snippets/package-json-exports/_node_modules_copy": true
},
"C_Cpp.files.exclude": {
"**/.vscode": 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"
},
"[h]": {
"editor.defaultFormatter": "xaver.clang-format"
},
"[c]": {
"editor.defaultFormatter": "xaver.clang-format"
// uws WebSocket.cpp conflicts with webcore WebSocket.cpp
"packages/bun-uws/fuzzing": true,
},
"files.associations": {
"*.idl": "cpp",
"memory": "cpp",
"iostream": "cpp",
"algorithm": "cpp",
"random": "cpp",
"ios": "cpp",
"filesystem": "cpp",
"__locale": "cpp",
"type_traits": "cpp",
"__mutex_base": "cpp",
"__string": "cpp",
"string": "cpp",
"string_view": "cpp",
"typeinfo": "cpp",
"__config": "cpp",
"__nullptr": "cpp",
"exception": "cpp",
"__bit_reference": "cpp",
"atomic": "cpp",
"utility": "cpp",
"sstream": "cpp",
"__functional_base": "cpp",
"new": "cpp",
"__debug": "cpp",
"__errc": "cpp",
"__hash_table": "cpp",
"__node_handle": "cpp",
"__split_buffer": "cpp",
"__threading_support": "cpp",
"__tuple": "cpp",
"array": "cpp",
"bit": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"fstream": "cpp",
"functional": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"locale": "cpp",
"mutex": "cpp",
"optional": "cpp",
"ostream": "cpp",
"ratio": "cpp",
"stack": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"system_error": "cpp",
"thread": "cpp",
"tuple": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"__bits": "cpp",
"__tree": "cpp",
"map": "cpp",
"numeric": "cpp",
"set": "cpp",
"__memory": "cpp",
"memory_resource": "cpp"
},
"cmake.configureOnOpen": false
"C_Cpp.files.exclude": {
"**/.vscode": true,
"WebKit/JSTests": true,
"WebKit/Tools": true,
"WebKit/WebDriverTests": true,
"WebKit/WebKit.xcworkspace": true,
"WebKit/WebKitLibraries": true,
"WebKit/Websites": true,
"WebKit/resources": true,
"WebKit/LayoutTests": true,
"WebKit/ManualTests": true,
"WebKit/PerformanceTests": true,
"WebKit/WebKitLegacy": true,
"WebKit/WebCore": true,
"WebKit/WebDriver": true,
"WebKit/WebKitBuild": true,
"WebKit/WebInspectorUI": true,
},
"git.detectSubmodules": false,
}

77
.vscode/tasks.json vendored
View File

@@ -2,33 +2,58 @@
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "process",
"command": "zig",
"args": ["build"],
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false
},
"label": "Build Bun",
"type": "shell",
"command": "bun run build",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "run",
"type": "process",
"command": "zig",
"args": ["run", "${file}"],
"group": "build",
"isDefault": true,
},
"problemMatcher": [
{
"owner": "zig",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": [
{
"regexp": "^(.+?):(\\d+):(\\d+): (error|warning|note): (.+)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5,
},
{
"regexp": "^\\s+(.+)$",
"message": 1,
"loop": true,
},
],
},
{
"owner": "clang",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": [
{
"regexp": "^([^:]+):(\\d+):(\\d+):\\s+(warning|error|note|remark):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5,
},
{
"regexp": "^\\s*(.*)$",
"message": 1,
"loop": true,
},
],
},
],
"presentation": {
"showReuseMessage": false,
"clear": true
}
}
]
"reveal": "always",
"panel": "shared",
"clear": true,
},
},
],
}

51
CMakeLists.txt Normal file
View File

@@ -0,0 +1,51 @@
cmake_minimum_required(VERSION 3.24)
message(STATUS "Configuring Bun")
list(APPEND CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/cmake
${CMAKE_SOURCE_DIR}/cmake/targets
${CMAKE_SOURCE_DIR}/cmake/tools
${CMAKE_SOURCE_DIR}/cmake/analysis
${CMAKE_SOURCE_DIR}/cmake/scripts
)
include(Policies)
include(Globals)
# --- Compilers ---
if(CMAKE_HOST_APPLE)
include(SetupMacSDK)
endif()
include(SetupLLVM)
include(SetupCcache)
# --- Project ---
parse_package_json(VERSION_VARIABLE DEFAULT_VERSION)
optionx(VERSION STRING "The version of Bun" DEFAULT ${DEFAULT_VERSION})
project(Bun VERSION ${VERSION})
include(Options)
include(CompilerFlags)
# --- Tools ---
include(SetupGit)
include(SetupBuildkite)
include(SetupBun)
include(SetupEsbuild)
include(SetupZig)
include(SetupRust)
# --- Targets ---
include(BuildBun)
# --- Analysis ---
if(ENABLE_ANALYSIS)
include(RunClangFormat)
include(RunClangTidy)
include(RunZigFormat)
include(RunPrettier)
endif()

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).

306
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,306 @@
Configuring a development environment for Bun can take 10-30 minutes depending on your internet connection and computer speed. You will need ~10GB of free disk space for the repository and build artifacts.
If you are using Windows, please refer to [this guide](/docs/project/building-windows.md)
## Install Dependencies
Using your system's package manager, install Bun's dependencies:
{% codetabs group="os" %}
```bash#macOS (Homebrew)
$ brew install automake ccache cmake coreutils gnu-sed go icu4c libiconv libtool ninja pkg-config rust ruby
```
```bash#Ubuntu/Debian
$ sudo apt install curl wget lsb-release software-properties-common cargo ccache cmake git golang libtool ninja-build pkg-config rustc ruby-full xz-utils
```
```bash#Arch
$ sudo pacman -S base-devel ccache cmake git go libiconv libtool make ninja pkg-config python rust sed unzip ruby
```
```bash#Fedora
$ sudo dnf install cargo ccache cmake git golang libtool ninja-build pkg-config rustc ruby libatomic-static libstdc++-static sed unzip which libicu-devel 'perl(Math::BigInt)'
```
```bash#openSUSE Tumbleweed
$ sudo zypper install go cmake ninja automake git icu rustup && rustup toolchain install stable
```
{% /codetabs %}
> **Note**: The Zig compiler is automatically installed and updated by the build scripts. Manual installation is not required.
Before starting, you will need to already have a release build of Bun installed, as we use our bundler to transpile and minify our code, as well as for code generation scripts.
{% codetabs %}
```bash#Native
$ curl -fsSL https://bun.sh/install | bash
```
```bash#npm
$ npm install -g bun
```
```bash#Homebrew
$ brew tap oven-sh/bun
$ brew install bun
```
{% /codetabs %}
## Install LLVM
Bun requires LLVM 18 (`clang` is part of LLVM). This version requirement is to match WebKit (precompiled), as mismatching versions will cause memory allocation failures at runtime. In most cases, you can install LLVM through your system package manager:
{% codetabs group="os" %}
```bash#macOS (Homebrew)
$ brew install llvm@18
```
```bash#Ubuntu/Debian
$ # LLVM has an automatic installation script that is compatible with all versions of Ubuntu
$ wget https://apt.llvm.org/llvm.sh -O - | sudo bash -s -- 16 all
```
```bash#Arch
$ sudo pacman -S llvm clang lld
```
```bash#Fedora
$ sudo dnf install 'dnf-command(copr)'
$ sudo dnf copr enable -y @fedora-llvm-team/llvm17
$ sudo dnf install llvm16 clang16 lld16-devel
```
```bash#openSUSE Tumbleweed
$ sudo zypper install clang16 lld16 llvm16
```
{% /codetabs %}
If none of the above solutions apply, you will have to install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.6).
Make sure Clang/LLVM 18 is in your path:
```bash
$ which clang-16
```
If not, run this to manually add it:
{% codetabs group="os" %}
```bash#macOS (Homebrew)
# use fish_add_path if you're using fish
# use path+="$(brew --prefix llvm@16)/bin" if you are using zsh
$ export PATH="$(brew --prefix llvm@16)/bin:$PATH"
```
```bash#Arch
# use fish_add_path if you're using fish
$ export PATH="$PATH:/usr/lib/llvm16/bin"
```
{% /codetabs %}
> ⚠️ Ubuntu distributions (<= 20.04) may require installation of the C++ standard library independently. See the [troubleshooting section](#span-file-not-found-on-ubuntu) for more information.
## Building Bun
After cloning the repository, run the following command to build. This may take a while as it will clone submodules and build dependencies.
```bash
$ bun run build
```
The binary will be located at `./build/debug/bun-debug`. It is recommended to add this to your `$PATH`. To verify the build worked, let's print the version number on the development build of Bun.
```bash
$ build/debug/bun-debug --version
x.y.z_debug
```
## VSCode
VSCode is the recommended IDE for working on Bun, as it has been configured. Once opening, you can run `Extensions: Show Recommended Extensions` to install the recommended extensions for Zig and C++. ZLS is automatically configured.
If you use a different editor, make sure that you tell ZLS to use the automatically installed Zig compiler, which is located at `./vendor/zig/zig.exe`. The filename is `zig.exe` so that it works as expected on Windows, but it still works on macOS/Linux (it just has a surprising file extension).
We recommend adding `./build/debug` to your `$PATH` so that you can run `bun-debug` in your terminal:
```sh
$ bun-debug
```
## Code generation scripts
Several code generation scripts are used during Bun's build process. These are run automatically when changes are made to certain files.
In particular, these are:
- `./src/codegen/generate-jssink.ts` -- Generates `build/debug/codegen/JSSink.cpp`, `build/debug/codegen/JSSink.h` which implement various classes for interfacing with `ReadableStream`. This is internally how `FileSink`, `ArrayBufferSink`, `"type": "direct"` streams and other code related to streams works.
- `./src/codegen/generate-classes.ts` -- Generates `build/debug/codegen/ZigGeneratedClasses*`, which generates Zig & C++ bindings for JavaScriptCore classes implemented in Zig. In `**/*.classes.ts` files, we define the interfaces for various classes, methods, prototypes, getters/setters etc which the code generator reads to generate boilerplate code implementing the JavaScript objects in C++ and wiring them up to Zig
- `./src/codegen/bundle-modules.ts` -- Bundles built-in modules like `node:fs`, `bun:ffi` into files we can include in the final binary. In development, these can be reloaded without rebuilding Zig (you still need to run `bun run build`, but it re-reads the transpiled files from disk afterwards). In release builds, these are embedded into the binary.
- `./src/codegen/bundle-functions.ts` -- Bundles globally-accessible functions implemented in JavaScript/TypeScript like `ReadableStream`, `WritableStream`, and a handful more. These are used similarly to the builtin modules, but the output more closely aligns with what WebKit/Safari does for Safari's built-in functions so that we can copy-paste the implementations from WebKit as a starting point.
## Modifying ESM modules
Certain modules like `node:fs`, `node:stream`, `bun:sqlite`, and `ws` are implemented in JavaScript. These live in `src/js/{node,bun,thirdparty}` files and are pre-bundled using Bun.
## Release build
To compile a release build of Bun, run:
```bash
$ bun run build:release
```
The binary will be located at `./build/release/bun` and `./build/release/bun-profile`.
### Download release build from pull requests
To save you time spent building a release build locally, we provide a way to run release builds from pull requests. This is useful for manully testing changes in a release build before they are merged.
To run a release build from a pull request, you can use the `bun-pr` npm package:
```sh
bunx bun-pr <pr-number>
bunx bun-pr <branch-name>
bunx bun-pr "https://github.com/oven-sh/bun/pull/1234566"
```
This will download the release build from the pull request and add it to `$PATH` as `bun-${pr-number}`. You can then run the build with `bun-${pr-number}`.
```sh
bun-1234566 --version
```
This works by downloading the release build from the GitHub Actions artifacts on the linked pull request. You may need the `gh` CLI installed to authenticate with GitHub.
## Valgrind
On Linux, valgrind can help find memory issues.
Keep in mind:
- JavaScriptCore doesn't support valgrind. It will report spurious errors.
- Valgrind is slow
- Mimalloc will sometimes cause spurious errors when debug build is enabled
You'll need a very recent version of Valgrind due to DWARF 5 debug symbols. You may need to manually compile Valgrind instead of using it from your Linux package manager.
`--fair-sched=try` is necessary if running multithreaded code in Bun (such as the bundler). Otherwise it will hang.
```bash
$ valgrind --fair-sched=try --track-origins=yes bun-debug <args>
```
## Building WebKit locally + Debug mode of JSC
WebKit is not cloned by default (to save time and disk space). To clone and build WebKit locally, run:
```bash
# Clone WebKit into ./vendor/WebKit
$ git clone https://github.com/oven-sh/WebKit vendor/WebKit
# Make a debug build of JSC. This will output build artifacts in ./vendor/WebKit/WebKitBuild/Debug
# Optionally, you can use `make jsc` for a release build
$ make jsc-debug
# Build bun with the local JSC build
$ bun run build:local
```
Note that the WebKit folder, including build artifacts, is 8GB+ in size.
If you are using a JSC debug build and using VScode, make sure to run the `C/C++: Select a Configuration` command to configure intellisense to find the debug headers.
## Troubleshooting
### 'span' file not found on Ubuntu
> ⚠️ Please note that the instructions below are specific to issues occurring on Ubuntu. It is unlikely that the same issues will occur on other Linux distributions.
The Clang compiler typically uses the `libstdc++` C++ standard library by default. `libstdc++` is the default C++ Standard Library implementation provided by the GNU Compiler Collection (GCC). While Clang may link against the `libc++` library, this requires explicitly providing the `-stdlib` flag when running Clang.
Bun relies on C++20 features like `std::span`, which are not available in GCC versions lower than 11. GCC 10 doesn't have all of the C++20 features implemented. As a result, running `make setup` may fail with the following error:
```
fatal error: 'span' file not found
#include <span>
^~~~~~
```
The issue may manifest when initially running `bun setup` as Clang being unable to compile a simple program:
```
The C++ compiler
"/usr/bin/clang++-16"
is not able to compile a simple test program.
```
To fix the error, we need to update the GCC version to 11. To do this, we'll need to check if the latest version is available in the distribution's official repositories or use a third-party repository that provides GCC 11 packages. Here are general steps:
```bash
$ sudo apt update
$ sudo apt install gcc-11 g++-11
# If the above command fails with `Unable to locate package gcc-11` we need
# to add the APT repository
$ sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
# Now run `apt install` again
$ sudo apt install gcc-11 g++-11
```
Now, we need to set GCC 11 as the default compiler:
```bash
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
```
### libarchive
If you see an error on macOS when compiling `libarchive`, run:
```bash
$ brew install pkg-config
```
### macOS `library not found for -lSystem`
If you see this error when compiling, run:
```bash
$ xcode-select --install
```
### Cannot find `libatomic.a`
Bun defaults to linking `libatomic` statically, as not all systems have it. If you are building on a distro that does not have a static libatomic available, you can run the following command to enable dynamic linking:
```bash
$ bun run build -DUSE_STATIC_LIBATOMIC=OFF
```
The built version of Bun may not work on other systems if compiled this way.
### ccache conflicts with building TinyCC on macOS
If you run into issues with `ccache` when building TinyCC, try reinstalling ccache
```bash
brew uninstall ccache
brew install ccache
```
## Using bun-debug
- Disable logging: `BUN_DEBUG_QUIET_LOGS=1 bun-debug ...` (to disable all debug logging)
- Enable logging for a specific zig scope: `BUN_DEBUG_EventLoop=1 bun-debug ...` (to allow `std.log.scoped(.EventLoop)`)
- Bun transpiles every file it runs, to see the actual executed source in a debug build find it in `/tmp/bun-debug-src/...path/to/file`, for example the transpiled version of `/home/bun/index.ts` would be in `/tmp/bun-debug-src/home/bun/index.ts`

View File

@@ -1,621 +0,0 @@
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
ARG CPU_TARGET=native
ARG ARCH=x86_64
ARG 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.1
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 export PATH=$PATH:$HOME/.cargo/bin && export CC=$(which clang-13) && cd ${BUN_DIR} && \
make lolhtml && rm -rf src/deps/lol-html Makefile
FROM bun-base as mimalloc
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/mimalloc ${BUN_DIR}/src/deps/mimalloc
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
RUN cd ${BUN_DIR} && \
make mimalloc && rm -rf src/deps/mimalloc Makefile
FROM bun-base as zlib
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/zlib ${BUN_DIR}/src/deps/zlib
WORKDIR $BUN_DIR
RUN cd $BUN_DIR && \
make zlib && rm -rf src/deps/zlib Makefile
FROM bun-base as libarchive
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
RUN install_packages autoconf automake libtool pkg-config
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/libarchive ${BUN_DIR}/src/deps/libarchive
WORKDIR $BUN_DIR
RUN make libarchive && rm -rf src/deps/libarchive Makefile
FROM bun-base as tinycc
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
RUN install_packages libtcc-dev && cp /usr/lib/$(uname -m)-linux-gnu/libtcc.a ${BUN_DEPS_OUT_DIR}
FROM bun-base as 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
WORKDIR $BUN_DIR
RUN cd $BUN_DIR && \
make libbacktrace && rm -rf src/deps/libbacktrace Makefile
FROM bun-base as boringssl
RUN install_packages golang
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/boringssl ${BUN_DIR}/src/deps/boringssl
WORKDIR $BUN_DIR
RUN make boringssl && rm -rf src/deps/boringssl Makefile
FROM bun-base as base64
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/base64 ${BUN_DIR}/src/base64
WORKDIR $BUN_DIR
RUN make base64 && rm -rf src/base64 Makefile
FROM bun-base as uws
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/uws ${BUN_DIR}/src/deps/uws
COPY src/deps/zlib ${BUN_DIR}/src/deps/zlib
COPY src/deps/boringssl/include ${BUN_DIR}/src/deps/boringssl/include
COPY src/deps/libuwsockets.cpp ${BUN_DIR}/src/deps/libuwsockets.cpp
COPY src/deps/_libusockets.h ${BUN_DIR}/src/deps/_libusockets.h
WORKDIR $BUN_DIR
RUN cd $BUN_DIR && \
make uws && rm -rf src/deps/uws Makefile
FROM bun-base as picohttp
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/picohttpparser ${BUN_DIR}/src/deps/picohttpparser
COPY src/deps/*.c ${BUN_DIR}/src/deps/
COPY src/deps/*.h ${BUN_DIR}/src/deps/
WORKDIR $BUN_DIR
RUN cd $BUN_DIR && \
make picohttp
FROM bun-base-with-zig-and-webkit as identifier_cache
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
WORKDIR $BUN_DIR
COPY Makefile ${BUN_DIR}/Makefile
COPY src/js_lexer/identifier_data.zig ${BUN_DIR}/src/js_lexer/identifier_data.zig
COPY src/js_lexer/identifier_cache.zig ${BUN_DIR}/src/js_lexer/identifier_cache.zig
RUN cd $BUN_DIR && \
make identifier-cache && rm -rf zig-cache Makefile
FROM bun-base-with-zig-and-webkit as node_fallbacks
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
WORKDIR $BUN_DIR
COPY Makefile ${BUN_DIR}/Makefile
COPY src/node-fallbacks ${BUN_DIR}/src/node-fallbacks
RUN cd $BUN_DIR && \
make node-fallbacks && rm -rf src/node-fallbacks/node_modules Makefile
FROM bun-base-with-zig-and-webkit as prepare_release
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
WORKDIR $BUN_DIR
COPY ./src ${BUN_DIR}/src
COPY ./build.zig ${BUN_DIR}/build.zig
COPY ./completions ${BUN_DIR}/completions
COPY ./packages ${BUN_DIR}/packages
COPY ./build-id ${BUN_DIR}/build-id
COPY ./package.json ${BUN_DIR}/package.json
COPY ./misctools ${BUN_DIR}/misctools
COPY Makefile ${BUN_DIR}/Makefile
FROM prepare_release as compile_release_obj
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
WORKDIR $BUN_DIR
ENV JSC_BASE_DIR=${WEBKIT_DIR}
ENV LIB_ICU_PATH=${WEBKIT_DIR}/lib
ARG ARCH
ARG TRIPLET
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
ARG GIT_SHA
ARG BUN_BASE_VERSION
ENV BUN_BASE_VERSION=${BUN_BASE_VERSION}
ENV GIT_SHA=${GIT_SHA}
COPY --from=identifier_cache ${BUN_DIR}/src/js_lexer/*.blob ${BUN_DIR}/src/js_lexer/
COPY --from=node_fallbacks ${BUN_DIR}/src/node-fallbacks/out ${BUN_DIR}/src/node-fallbacks/out
COPY ./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 && \
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=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}/
RUN cd $BUN_DIR && mkdir -p src/bun.js/bindings-obj && rm -rf $HOME/.cache zig-cache && mkdir -p $BUN_RELEASE_DIR && \
make release-bindings -j10 && 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 /
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=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=sqlite ${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/
RUN cd $BUN_DIR && mkdir -p ${BUN_RELEASE_DIR} && make bun-relink copy-to-bun-release-dir && \
rm -rf $HOME/.cache zig-cache misctools package.json build-id completions build.zig $(BUN_DIR)/packages
FROM scratch as artifact
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
COPY --from=build_release ${BUN_RELEASE_DIR}/bun /bun
COPY --from=build_release ${BUN_RELEASE_DIR}/bun-profile /bun-profile
COPY --from=build_release ${BUN_DEPS_OUT_DIR}/* /bun-dependencies
COPY --from=build_release_obj /*.o /bun-obj
FROM prepare_release as build_unit
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG ZIG_PATH
# Directory extracts to "bun-webkit"
ARG WEBKIT_DIR
ARG BUN_RELEASE_DIR
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
WORKDIR $BUN_DIR
ENV PATH "$ZIG_PATH:$PATH"
ENV LIB_ICU_PATH "${WEBKIT_DIR}/lib"
CMD make headers \
api \
analytics \
bun_error \
fallback_decoder \
bindings -j10 && \
make \
run-all-unit-tests
# FROM bun-test-base as test_base
# ARG DEBIAN_FRONTEND=noninteractive
# ARG GITHUB_WORKSPACE=/build
# ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
# # Directory extracts to "bun-webkit"
# ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
# ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
# ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
# ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
# ARG BUILDARCH=amd64
# RUN groupadd -r chromium && useradd -d ${BUN_DIR} -M -r -g chromium -G audio,video chromium \
# && mkdir -p /home/chromium/Downloads && chown -R chromium:chromium /home/chromium
# USER chromium
# WORKDIR $BUN_DIR
# ENV NPM_CLIENT bun
# ENV PATH "${BUN_DIR}/packages/bun-linux-x64:${BUN_DIR}/packages/bun-linux-aarch64:$PATH"
# ENV CI 1
# ENV BROWSER_EXECUTABLE /usr/bin/chromium
# COPY ./test ${BUN_DIR}/test
# COPY Makefile ${BUN_DIR}/Makefile
# COPY package.json ${BUN_DIR}/package.json
# COPY .docker/run-test.sh ${BUN_DIR}/run-test.sh
# COPY ./bun.lockb ${BUN_DIR}/bun.lockb
# # # We don't want to worry about architecture differences in this image
# COPY --from=release /opt/bun/bin/bun ${BUN_DIR}/packages/bun-linux-aarch64/bun
# COPY --from=release /opt/bun/bin/bun ${BUN_DIR}/packages/bun-linux-x64/bun
# USER root
# RUN chgrp -R chromium ${BUN_DIR} && chmod g+rwx ${BUN_DIR} && chown -R chromium:chromium ${BUN_DIR}
# USER chromium
# CMD [ "bash", "run-test.sh" ]
# FROM release

View File

@@ -1,115 +0,0 @@
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
FROM --platform=linux/${BUILDARCH} ubuntu:20.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
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 "${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
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/aug12-2/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

1
LATEST Normal file
View File

@@ -0,0 +1 @@
1.1.41

73
LICENSE.md Normal file
View File

@@ -0,0 +1,73 @@
Bun itself is MIT-licensed.
## JavaScriptCore
Bun statically links JavaScriptCore (and WebKit) which is LGPL-2 licensed. WebCore files from WebKit are also licensed under LGPL2. Per LGPL2:
> (1) If you statically link against an LGPLd library, you must also provide your application in an object (not necessarily source) format, so that a user has the opportunity to modify the library and relink the application.
You can find the patched version of WebKit used by Bun here: <https://github.com/oven-sh/webkit>. If you would like to relink Bun with changes:
- `git submodule update --init --recursive`
- `make jsc`
- `zig build`
This compiles JavaScriptCore, compiles Buns `.cpp` bindings for JavaScriptCore (which are the object files using JavaScriptCore) and outputs a new `bun` binary with your changes.
## Linked libraries
Bun statically links these libraries:
| Library | License |
|---------|---------|
| [`boringssl`](https://boringssl.googlesource.com/boringssl/) | [several licenses](https://boringssl.googlesource.com/boringssl/+/refs/heads/master/LICENSE) |
| [`brotli`](https://github.com/google/brotli) | MIT |
| [`libarchive`](https://github.com/libarchive/libarchive) | [several licenses](https://github.com/libarchive/libarchive/blob/master/COPYING) |
| [`lol-html`](https://github.com/cloudflare/lol-html/tree/master/c-api) | BSD 3-Clause |
| [`mimalloc`](https://github.com/microsoft/mimalloc) | MIT |
| [`picohttp`](https://github.com/h2o/picohttpparser) | dual-licensed under the Perl License or the MIT License |
| [`zstd`](https://github.com/facebook/zstd) | dual-licensed under the BSD License or GPLv2 license |
| [`simdutf`](https://github.com/simdutf/simdutf) | Apache 2.0 |
| [`tinycc`](https://github.com/tinycc/tinycc) | LGPL v2.1 |
| [`uSockets`](https://github.com/uNetworking/uSockets) | Apache 2.0 |
| [`zlib-cloudflare`](https://github.com/cloudflare/zlib) | zlib |
| [`c-ares`](https://github.com/c-ares/c-ares) | MIT licensed |
| [`libicu`](https://github.com/unicode-org/icu) 72 | [license here](https://github.com/unicode-org/icu/blob/main/icu4c/LICENSE) |
| [`libbase64`](https://github.com/aklomp/base64/blob/master/LICENSE) | BSD 2-Clause |
| [`libuv`](https://github.com/libuv/libuv) (on Windows) | MIT |
| [`libdeflate`](https://github.com/ebiggers/libdeflate) | MIT |
| A fork of [`uWebsockets`](https://github.com/jarred-sumner/uwebsockets) | Apache 2.0 licensed |
| Parts of [Tigerbeetle's IO code](https://github.com/tigerbeetle/tigerbeetle/blob/532c8b70b9142c17e07737ab6d3da68d7500cbca/src/io/windows.zig#L1) | Apache 2.0 licensed |
## Polyfills
For compatibility reasons, the following packages are embedded into Bun's binary and injected if imported.
| Package | License |
|---------|---------|
| [`assert`](https://npmjs.com/package/assert) | MIT |
| [`browserify-zlib`](https://npmjs.com/package/browserify-zlib) | MIT |
| [`buffer`](https://npmjs.com/package/buffer) | MIT |
| [`constants-browserify`](https://npmjs.com/package/constants-browserify) | MIT |
| [`crypto-browserify`](https://npmjs.com/package/crypto-browserify) | MIT |
| [`domain-browser`](https://npmjs.com/package/domain-browser) | MIT |
| [`events`](https://npmjs.com/package/events) | MIT |
| [`https-browserify`](https://npmjs.com/package/https-browserify) | MIT |
| [`os-browserify`](https://npmjs.com/package/os-browserify) | MIT |
| [`path-browserify`](https://npmjs.com/package/path-browserify) | MIT |
| [`process`](https://npmjs.com/package/process) | MIT |
| [`punycode`](https://npmjs.com/package/punycode) | MIT |
| [`querystring-es3`](https://npmjs.com/package/querystring-es3) | MIT |
| [`stream-browserify`](https://npmjs.com/package/stream-browserify) | MIT |
| [`stream-http`](https://npmjs.com/package/stream-http) | MIT |
| [`string_decoder`](https://npmjs.com/package/string_decoder) | MIT |
| [`timers-browserify`](https://npmjs.com/package/timers-browserify) | MIT |
| [`tty-browserify`](https://npmjs.com/package/tty-browserify) | MIT |
| [`url`](https://npmjs.com/package/url) | MIT |
| [`util`](https://npmjs.com/package/util) | MIT |
| [`vm-browserify`](https://npmjs.com/package/vm-browserify) | MIT |
## Additional credits
- Bun's JS transpiler, CSS lexer, and Node.js module resolver source code is a Zig port of [@evanw](https://github.com/evanw)s [esbuild](https://github.com/evanw/esbuild) project.
- Credit to [@kipply](https://github.com/kipply) for the name "Bun"!

1107
Makefile

File diff suppressed because it is too large Load Diff

3839
README.md

File diff suppressed because it is too large Load Diff

12
SECURITY.md Normal file
View File

@@ -0,0 +1,12 @@
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| 1.x.x | :white_check_mark: |
## Reporting a Vulnerability
Report any discovered vulnerabilities to the Bun team by emailing `security@bun.sh`. Your report will acknowledged within 5 days, and a team member will be assigned as the primary handler. To the greatest extent possible, the security team will endeavor to keep you informed of the progress being made towards a fix and full announcement, and may ask for additional information or guidance surrounding the reported issue.

View File

@@ -0,0 +1,30 @@
// https://github.com/nodejs/node/issues/34493
import { AsyncLocalStorage } from "async_hooks";
const asyncLocalStorage = new AsyncLocalStorage();
// let fn = () => Promise.resolve(2).then(() => new Promise(resolve => queueMicrotask(resolve)));
let fn = () => /test/.test("test");
let runWithExpiry = async (expiry, fn) => {
let iterations = 0;
while (Date.now() < expiry) {
await fn();
iterations++;
}
return iterations;
};
console.log(`Performed ${await runWithExpiry(Date.now() + 1000, fn)} iterations to warmup`);
let withAls;
await asyncLocalStorage.run(123, async () => {
withAls = await runWithExpiry(Date.now() + 45000, fn);
console.log(`Performed ${withAls} iterations (with ALS enabled)`);
});
asyncLocalStorage.disable();
let withoutAls = await runWithExpiry(Date.now() + 45000, fn);
console.log(`Performed ${withoutAls} iterations (with ALS disabled)`);
console.log("ALS penalty: " + Math.round((1 - withAls / withoutAls) * 10000) / 100 + "%");

View File

@@ -1,4 +1,4 @@
import { run, bench } from "mitata";
import { bench, run } from "../runner.mjs";
bench("sync", () => {});
bench("async", async () => {});

View File

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

View File

@@ -1,4 +1,4 @@
import { run, bench } from "mitata";
import { bench, run } from "../runner.mjs";
bench("sync", () => {});
bench("async", async () => {});

View File

@@ -3,9 +3,9 @@
"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": "bun bun.js",
"bench:node": "node node.mjs",
"bench:deno": "deno run -A --unstable deno.js",
"bench": "bun run bench:bun && bun run bench:node && bun run bench:deno"
}
}

BIN
bench/bun.lockb Executable file

Binary file not shown.

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