diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index 1d0e59d05f..be3d5ef659 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -1,10 +1,10 @@
{
"recommendations": [
"ziglang.vscode-zig",
- "esbenp.prettier-vscode",
+ "biomejs.biome",
"xaver.clang-format",
"vadimcn.vscode-lldb",
"bierner.comment-tagged-templates",
- "ms-vscode.cpptools"
+ "clangd.clangd"
]
}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 9c6353d860..494c758e0c 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -23,26 +23,26 @@
"editor.defaultFormatter": "ziglang.vscode-zig"
},
"[ts]": {
- "editor.defaultFormatter": "esbenp.prettier-vscode"
+ "editor.defaultFormatter": "biomejs.biome"
},
"[js]": {
- "editor.defaultFormatter": "esbenp.prettier-vscode"
+ "editor.defaultFormatter": "biomejs.biome"
},
"zig.zls.enableInlayHints": false,
"zig.path": "${workspaceFolder}/.cache/zig/zig.exe",
"git.ignoreSubmodules": true,
"[jsx]": {
- "editor.defaultFormatter": "esbenp.prettier-vscode"
+ "editor.defaultFormatter": "biomejs.biome"
},
"[tsx]": {
- "editor.defaultFormatter": "esbenp.prettier-vscode"
+ "editor.defaultFormatter": "biomejs.biome"
},
"[yaml]": {},
"[markdown]": {
"editor.unicodeHighlight.ambiguousCharacters": false,
"editor.unicodeHighlight.invisibleCharacters": false,
"diffEditor.ignoreTrimWhitespace": false,
- "editor.defaultFormatter": "esbenp.prettier-vscode",
+ "editor.defaultFormatter": "biomejs.biome",
"editor.wordWrap": "on",
"editor.quickSuggestions": {
"comments": "off",
diff --git a/bench/hot-module-reloading/css-stress-test/timings/bun-cli@0.0.34.32ms.darwin-x64.json b/bench/hot-module-reloading/css-stress-test/timings/bun-cli@0.0.34.32ms.darwin-x64.json
index fab91228c3..0ad21cc65c 100644
--- a/bench/hot-module-reloading/css-stress-test/timings/bun-cli@0.0.34.32ms.darwin-x64.json
+++ b/bench/hot-module-reloading/css-stress-test/timings/bun-cli@0.0.34.32ms.darwin-x64.json
@@ -7,280 +7,166 @@
"version": "0.0.34"
},
"timestamps": [
- 16336202536562, 16336202536908, 16336202537294, 16336202537705,
- 16336202538114, 16336202538534, 16336202538941, 16336202539323,
- 16336202539742, 16336202540159, 16336202540877, 16336202541310,
- 16336202541749, 16336202542159, 16336202542565, 16336202542996,
- 16336202543333, 16336202543761, 16336202544159, 16336202544534,
- 16336202544944, 16336202545345, 16336202545744, 16336202546159,
- 16336202546573, 16336202546986, 16336202547399, 16336202547781,
- 16336202548202, 16336202548564, 16336202548949, 16336202549329,
- 16336202549762, 16336202550168, 16336202550534, 16336202550887,
- 16336202551305, 16336202551659, 16336202552060, 16336202552449,
- 16336202552854, 16336202553270, 16336202553609, 16336202554034,
- 16336202554437, 16336202554783, 16336202555191, 16336202555623,
- 16336202556034, 16336202556449, 16336202556890, 16336202557283,
- 16336202557669, 16336202558084, 16336202558496, 16336202558863,
- 16336202559271, 16336202559659, 16336202560051, 16336202560452,
- 16336202560873, 16336202561290, 16336202561659, 16336202562035,
- 16336202562440, 16336202562862, 16336202563284, 16336202563659,
- 16336202564034, 16336202564444, 16336202564853, 16336202565245,
- 16336202565659, 16336202566034, 16336202566455, 16336202566873,
- 16336202567284, 16336202567659, 16336202568034, 16336202568386,
- 16336202568790, 16336202569204, 16336202569620, 16336202570384,
- 16336202570768, 16336202571188, 16336202571551, 16336202572327,
- 16336202572717, 16336202573116, 16336202573541, 16336202573959,
- 16336202574319, 16336202574682, 16336202575040, 16336202575375,
- 16336202577001, 16336202577342, 16336202577680, 16336202578066,
- 16336202578451, 16336202579166, 16336202579534, 16336202579960,
- 16336202580370, 16336202580789, 16336202581159, 16336202581576,
- 16336202581949, 16336202582294, 16336202583087, 16336202583496,
- 16336202583858, 16336202584203, 16336202584606, 16336202585034,
- 16336202585386, 16336202585788, 16336202586211, 16336202586604,
- 16336202587034, 16336202587459, 16336202587869, 16336202588295,
- 16336202588668, 16336202589092, 16336202589452, 16336202589831,
- 16336202590197, 16336202590608, 16336202591034, 16336202591460,
- 16336202591880, 16336202592295, 16336202592727, 16336202593172,
- 16336202593567, 16336202593994, 16336202594397, 16336202594795,
- 16336202595224, 16336202595659, 16336202596058, 16336202596463,
- 16336202596890, 16336202597322, 16336202597732, 16336202598159,
- 16336202598534, 16336202598951, 16336202599365, 16336202599785,
- 16336202600159, 16336202600593, 16336202601005, 16336202601402,
- 16336202601807, 16336202602214, 16336202602556, 16336202602895,
- 16336202603307, 16336202603661, 16336202604075, 16336202604491,
- 16336202604853, 16336202605268, 16336202605670, 16336202606034,
- 16336202606393, 16336202606748, 16336202607170, 16336202607568,
- 16336202607982, 16336202608411, 16336202608836, 16336202609197,
- 16336202609596, 16336202609965, 16336202610333, 16336202610740,
- 16336202611159, 16336202611573, 16336202611975, 16336202612317,
- 16336202612691, 16336202613060, 16336202613474, 16336202613903,
- 16336202614341, 16336202614707, 16336202615094, 16336202615534,
- 16336202615883, 16336202616296, 16336202616671, 16336202617034,
- 16336202617391, 16336202617727, 16336202618159, 16336202618534,
- 16336202618937, 16336202619360, 16336202619770, 16336202620179,
- 16336202620716, 16336202621143, 16336202621534, 16336202622303,
- 16336202622659, 16336202623085, 16336202623498, 16336202623850,
- 16336202624220, 16336202624606, 16336202625034, 16336202625387,
- 16336202625805, 16336202626210, 16336202626599, 16336202627034,
- 16336202627386, 16336202627748, 16336202628159, 16336202628534,
- 16336202628954, 16336202629373, 16336202629809, 16336202630197,
- 16336202630535, 16336202630916, 16336202631290, 16336202631666,
- 16336202632034, 16336202632369, 16336202633152, 16336202633534,
- 16336202633883, 16336202634309, 16336202634717, 16336202635106,
- 16336202635871, 16336202636253, 16336202636671, 16336202637070,
- 16336202637434, 16336202637798, 16336202638184, 16336202638539,
- 16336202638938, 16336202639307, 16336202639666, 16336202640095,
- 16336202640534, 16336202640962, 16336202641307, 16336202641659,
- 16336202642087, 16336202642521, 16336202642886, 16336202643309,
- 16336202643662, 16336202644067, 16336202644491, 16336202644853,
- 16336202645226, 16336202645659, 16336202646074, 16336202646497,
- 16336202646890, 16336202647311, 16336202647749, 16336202648169,
- 16336202648976, 16336202649378, 16336202649810, 16336202650165,
- 16336202650534, 16336202650875, 16336202651250, 16336202651659,
- 16336202652093, 16336202652516, 16336202652921, 16336202653332,
- 16336202653722, 16336202654142, 16336202654534, 16336202654880,
- 16336202655221, 16336202655562, 16336202655997, 16336202656378,
- 16336202656811, 16336202657161, 16336202657588, 16336202657944,
- 16336202658360, 16336202658708, 16336202659089, 16336202659428,
- 16336202659849, 16336202660273, 16336202660685, 16336202661105,
- 16336202661534, 16336202661873, 16336202662228, 16336202662658,
- 16336202663438, 16336202663843, 16336202664219, 16336202664646,
- 16336202665050, 16336202665487, 16336202665838, 16336202666211,
- 16336202666573, 16336202666927, 16336202667334, 16336202667746,
- 16336202668158, 16336202668563, 16336202668980, 16336202669406,
- 16336202669753, 16336202670192, 16336202670554, 16336202670903,
- 16336202671324, 16336202671734, 16336202672159, 16336202672573,
- 16336202672982, 16336202673346, 16336202673680, 16336202674087,
- 16336202674499, 16336202674909, 16336202675260, 16336202676110,
- 16336202676535, 16336202676913, 16336202677312, 16336202677658,
- 16336202678044, 16336202678413, 16336202678793, 16336202679208,
- 16336202679604, 16336202680034, 16336202680385, 16336202680799,
- 16336202681213, 16336202681595, 16336202682004, 16336202682346,
- 16336202682726, 16336202683158, 16336202683586, 16336202683990,
- 16336202684323, 16336202684742, 16336202685175, 16336202685578,
- 16336202685979, 16336202686805, 16336202687206, 16336202687614,
- 16336202688038, 16336202688473, 16336202688848, 16336202689221,
- 16336202689559, 16336202689971, 16336202690368, 16336202690776,
- 16336202691159, 16336202691585, 16336202692010, 16336202692373,
- 16336202692780, 16336202693179, 16336202693580, 16336202693991,
- 16336202694324, 16336202694727, 16336202695159, 16336202695588,
- 16336202695991, 16336202696335, 16336202697160, 16336202697542,
- 16336202697929, 16336202698323, 16336202698674, 16336202699060,
- 16336202699492, 16336202699835, 16336202700238, 16336202700658,
- 16336202701059, 16336202701420, 16336202701815, 16336202702229,
- 16336202702659, 16336202703857, 16336202704256, 16336202704659,
- 16336202705497, 16336202706309, 16336202706660, 16336202707085,
- 16336202707511, 16336202707866, 16336202708210, 16336202708552,
- 16336202708925, 16336202709287, 16336202709670, 16336202710045,
- 16336202710402, 16336202710802, 16336202711167, 16336202711533,
- 16336202712249, 16336202712660, 16336202713088, 16336202713519,
- 16336202713936, 16336202714355, 16336202714740, 16336202715160,
- 16336202715533, 16336202715878, 16336202716290, 16336202716708,
- 16336202717102, 16336202718290, 16336202718699, 16336202719052,
- 16336202719388, 16336202719808, 16336202720225, 16336202720659,
- 16336202721052, 16336202721414, 16336202721828, 16336202722925,
- 16336202723664, 16336202724063, 16336202724405, 16336202726003,
- 16336202726736, 16336202727158, 16336202727543, 16336202727930,
- 16336202728336, 16336202728703, 16336202729061, 16336202729483,
- 16336202729832, 16336202730222, 16336202730659, 16336202731084,
- 16336202731500, 16336202731911, 16336202732326, 16336202733158,
- 16336202733585, 16336202734001, 16336202734691, 16336202735042,
- 16336202735442, 16336202735863, 16336202736255, 16336202736671,
- 16336202737043, 16336202737884, 16336202738671, 16336202739110,
- 16336202739533, 16336202739886, 16336202740283, 16336202740706,
- 16336202741143, 16336202741534, 16336202741942, 16336202742352,
- 16336202742697, 16336202743103, 16336202743940, 16336202745172,
- 16336202745542, 16336202745937, 16336202746339, 16336202746758,
- 16336202747531, 16336202747877, 16336202748232, 16336202748658,
- 16336202749055, 16336202749468, 16336202749859, 16336202750416,
- 16336202750839, 16336202751178, 16336202751572, 16336202752002,
- 16336202752419, 16336202753269, 16336202753678, 16336202754086,
- 16336202754432, 16336202754835, 16336202755260, 16336202755683,
- 16336202756059, 16336202756402, 16336202756837, 16336202758084,
- 16336202758507, 16336202758879, 16336202759270, 16336202759674,
- 16336202760044, 16336202760400, 16336202760801, 16336202761659,
- 16336202762053, 16336202762397, 16336202763199, 16336202763547,
- 16336202763948, 16336202764714, 16336202765113, 16336202765947,
- 16336202766329, 16336202766664, 16336202767085, 16336202768233,
- 16336202769056, 16336202769758, 16336202770178, 16336202770585,
- 16336202770929, 16336202771325, 16336202772158, 16336202772594,
- 16336202773033, 16336202773403, 16336202773801, 16336202774179,
- 16336202774555, 16336202774989, 16336202775393, 16336202775809,
- 16336202776209, 16336202776618, 16336202777033, 16336202777421,
- 16336202777845, 16336202778246, 16336202778658, 16336202779055,
- 16336202779411, 16336202779761, 16336202780175, 16336202780594,
- 16336202781002, 16336202781848, 16336202782658, 16336202783033,
- 16336202783857, 16336202784211, 16336202784557, 16336202784972,
- 16336202785377, 16336202785810, 16336202786172, 16336202786934,
- 16336202787343, 16336202787765, 16336202788201, 16336202788563,
- 16336202788970, 16336202789329, 16336202789672, 16336202790055,
- 16336202790456, 16336202790802, 16336202791580, 16336202791920,
- 16336202792326, 16336202793158, 16336202793953, 16336202794368,
- 16336202795187, 16336202795622, 16336202796033, 16336202796393,
- 16336202796777, 16336202797173, 16336202797540, 16336202797975,
- 16336202798317, 16336202798739, 16336202799158, 16336202799567,
- 16336202799966, 16336202800378, 16336202800803, 16336202801232,
- 16336202801658, 16336202802033, 16336202802374, 16336202802759,
- 16336202803158, 16336202803533, 16336202803947, 16336202804354,
- 16336202804729, 16336202805158, 16336202805534, 16336202805950,
- 16336202806390, 16336202806805, 16336202807219, 16336202807643,
- 16336202808033, 16336202808377, 16336202808790, 16336202809211,
- 16336202809560, 16336202809920, 16336202810355, 16336202810758,
- 16336202811187, 16336202811596, 16336202811943, 16336202812348,
- 16336202812710, 16336202813060, 16336202813398, 16336202813791,
- 16336202814158, 16336202814533, 16336202814878, 16336202815246,
- 16336202815658, 16336202816079, 16336202816851, 16336202817202,
- 16336202817540, 16336202817905, 16336202818244, 16336202818663,
- 16336202819068, 16336202819418, 16336202819777, 16336202820193,
- 16336202820599, 16336202821033, 16336202821395, 16336202821745,
- 16336202822158, 16336202822590, 16336202822996, 16336202823396,
- 16336202823804, 16336202824210, 16336202824581, 16336202824991,
- 16336202825406, 16336202825806, 16336202826210, 16336202826598,
- 16336202827033, 16336202827446, 16336202827839, 16336202828201,
- 16336202828577, 16336202828968, 16336202829362, 16336202829709,
- 16336202830096, 16336202830533, 16336202830917, 16336202831290,
- 16336202831699, 16336202832035, 16336202832406, 16336202832804,
- 16336202833200, 16336202833604, 16336202834033, 16336202834386,
- 16336202834759, 16336202835190, 16336202835621, 16336202836033,
- 16336202836405, 16336202837191, 16336202837613, 16336202838033,
- 16336202838374, 16336202838798, 16336202839200, 16336202839603,
- 16336202840034, 16336202840389, 16336202840783, 16336202841200,
- 16336202841617, 16336202842034, 16336202842390, 16336202842737,
- 16336202843158, 16336202843585, 16336202843923, 16336202844313,
- 16336202844724, 16336202845158, 16336202845576, 16336202845939,
- 16336202846368, 16336202846728, 16336202847158, 16336202847568,
- 16336202847911, 16336202848291, 16336202848695, 16336202849103,
- 16336202849533, 16336202849942, 16336202850368, 16336202850747,
- 16336202851158, 16336202851549, 16336202851978, 16336202852383,
- 16336202852725, 16336202853158, 16336202853554, 16336202853961,
- 16336202854308, 16336202854704, 16336202855060, 16336202855418,
- 16336202855776, 16336202856203, 16336202856617, 16336202857036,
- 16336202857455, 16336202857884, 16336202858262, 16336202858658,
- 16336202859071, 16336202859847, 16336202860237, 16336202860658,
- 16336202861037, 16336202861452, 16336202861869, 16336202862218,
- 16336202862590, 16336202863001, 16336202863422, 16336202863857,
- 16336202864219, 16336202864658, 16336202865047, 16336202865404,
- 16336202865789, 16336202866210, 16336202866624, 16336202867033,
- 16336202867380, 16336202867797, 16336202868227, 16336202868658,
- 16336202869083, 16336202869500, 16336202869906, 16336202870246,
- 16336202870658, 16336202871086, 16336202871441, 16336202871820,
- 16336202872204, 16336202872546, 16336202872943, 16336202873380,
- 16336202873811, 16336202874213, 16336202874566, 16336202874918,
- 16336202875261, 16336202875655, 16336202876047, 16336202876771,
- 16336202877202, 16336202877612, 16336202878033, 16336202878412,
- 16336202878846, 16336202879241, 16336202879658, 16336202880072,
- 16336202880508, 16336202880901, 16336202881308, 16336202881725,
- 16336202882158, 16336202882579, 16336202882945, 16336202883286,
- 16336202883657, 16336202884048, 16336202884404, 16336202884752,
- 16336202885158, 16336202885533, 16336202885938, 16336202886364,
- 16336202886759, 16336202887175, 16336202887585, 16336202887929,
- 16336202888345, 16336202888743, 16336202889157, 16336202889570,
- 16336202889970, 16336202890382, 16336202890761, 16336202891187,
- 16336202891600, 16336202892033, 16336202892454, 16336202892794,
- 16336202893178, 16336202893533, 16336202893903, 16336202894264,
- 16336202894668, 16336202895049, 16336202895400, 16336202895774,
- 16336202896157, 16336202896537, 16336202896883, 16336202897232,
- 16336202897658, 16336202898065, 16336202898493, 16336202898884,
- 16336202899251, 16336202899673, 16336202900047, 16336202900467,
- 16336202900883, 16336202901300, 16336202901676, 16336202902068,
- 16336202902479, 16336202902902, 16336202903260, 16336202903675,
- 16336202904094, 16336202904476, 16336202904824, 16336202905158,
- 16336202905533, 16336202905934, 16336202906289, 16336202906717,
- 16336202907158, 16336202907547, 16336202907904, 16336202908294,
- 16336202908717, 16336202909157, 16336202909582, 16336202910005,
- 16336202910399, 16336202910800, 16336202911220, 16336202911657,
- 16336202912064, 16336202912405, 16336202912779, 16336202913158,
- 16336202913553, 16336202913966, 16336202914376, 16336202914719,
- 16336202915091, 16336202915515, 16336202915887, 16336202916293,
- 16336202916649, 16336202917438, 16336202917869, 16336202918221,
- 16336202919053, 16336202919425, 16336202919833, 16336202920234,
- 16336202920658, 16336202921033, 16336202921433, 16336202921801,
- 16336202922161, 16336202922589, 16336202923017, 16336202923418,
- 16336202923804, 16336202924199, 16336202924593, 16336202925033,
- 16336202925449, 16336202925818, 16336202926223, 16336202926662,
- 16336202927431, 16336202927812, 16336202928227, 16336202928658,
- 16336202929061, 16336202929473, 16336202929891, 16336202930241,
- 16336202930657, 16336202931057, 16336202931396, 16336202931811,
- 16336202932225, 16336202932657, 16336202933058, 16336202933445,
- 16336202933790, 16336202934157, 16336202934562, 16336202934988,
- 16336202935391, 16336202935777, 16336202936160, 16336202936562,
- 16336202936986, 16336202937396, 16336202937751, 16336202938158,
- 16336202938578, 16336202938985, 16336202939396, 16336202939752,
- 16336202940157, 16336202940585
+ 16336202536562, 16336202536908, 16336202537294, 16336202537705, 16336202538114, 16336202538534, 16336202538941,
+ 16336202539323, 16336202539742, 16336202540159, 16336202540877, 16336202541310, 16336202541749, 16336202542159,
+ 16336202542565, 16336202542996, 16336202543333, 16336202543761, 16336202544159, 16336202544534, 16336202544944,
+ 16336202545345, 16336202545744, 16336202546159, 16336202546573, 16336202546986, 16336202547399, 16336202547781,
+ 16336202548202, 16336202548564, 16336202548949, 16336202549329, 16336202549762, 16336202550168, 16336202550534,
+ 16336202550887, 16336202551305, 16336202551659, 16336202552060, 16336202552449, 16336202552854, 16336202553270,
+ 16336202553609, 16336202554034, 16336202554437, 16336202554783, 16336202555191, 16336202555623, 16336202556034,
+ 16336202556449, 16336202556890, 16336202557283, 16336202557669, 16336202558084, 16336202558496, 16336202558863,
+ 16336202559271, 16336202559659, 16336202560051, 16336202560452, 16336202560873, 16336202561290, 16336202561659,
+ 16336202562035, 16336202562440, 16336202562862, 16336202563284, 16336202563659, 16336202564034, 16336202564444,
+ 16336202564853, 16336202565245, 16336202565659, 16336202566034, 16336202566455, 16336202566873, 16336202567284,
+ 16336202567659, 16336202568034, 16336202568386, 16336202568790, 16336202569204, 16336202569620, 16336202570384,
+ 16336202570768, 16336202571188, 16336202571551, 16336202572327, 16336202572717, 16336202573116, 16336202573541,
+ 16336202573959, 16336202574319, 16336202574682, 16336202575040, 16336202575375, 16336202577001, 16336202577342,
+ 16336202577680, 16336202578066, 16336202578451, 16336202579166, 16336202579534, 16336202579960, 16336202580370,
+ 16336202580789, 16336202581159, 16336202581576, 16336202581949, 16336202582294, 16336202583087, 16336202583496,
+ 16336202583858, 16336202584203, 16336202584606, 16336202585034, 16336202585386, 16336202585788, 16336202586211,
+ 16336202586604, 16336202587034, 16336202587459, 16336202587869, 16336202588295, 16336202588668, 16336202589092,
+ 16336202589452, 16336202589831, 16336202590197, 16336202590608, 16336202591034, 16336202591460, 16336202591880,
+ 16336202592295, 16336202592727, 16336202593172, 16336202593567, 16336202593994, 16336202594397, 16336202594795,
+ 16336202595224, 16336202595659, 16336202596058, 16336202596463, 16336202596890, 16336202597322, 16336202597732,
+ 16336202598159, 16336202598534, 16336202598951, 16336202599365, 16336202599785, 16336202600159, 16336202600593,
+ 16336202601005, 16336202601402, 16336202601807, 16336202602214, 16336202602556, 16336202602895, 16336202603307,
+ 16336202603661, 16336202604075, 16336202604491, 16336202604853, 16336202605268, 16336202605670, 16336202606034,
+ 16336202606393, 16336202606748, 16336202607170, 16336202607568, 16336202607982, 16336202608411, 16336202608836,
+ 16336202609197, 16336202609596, 16336202609965, 16336202610333, 16336202610740, 16336202611159, 16336202611573,
+ 16336202611975, 16336202612317, 16336202612691, 16336202613060, 16336202613474, 16336202613903, 16336202614341,
+ 16336202614707, 16336202615094, 16336202615534, 16336202615883, 16336202616296, 16336202616671, 16336202617034,
+ 16336202617391, 16336202617727, 16336202618159, 16336202618534, 16336202618937, 16336202619360, 16336202619770,
+ 16336202620179, 16336202620716, 16336202621143, 16336202621534, 16336202622303, 16336202622659, 16336202623085,
+ 16336202623498, 16336202623850, 16336202624220, 16336202624606, 16336202625034, 16336202625387, 16336202625805,
+ 16336202626210, 16336202626599, 16336202627034, 16336202627386, 16336202627748, 16336202628159, 16336202628534,
+ 16336202628954, 16336202629373, 16336202629809, 16336202630197, 16336202630535, 16336202630916, 16336202631290,
+ 16336202631666, 16336202632034, 16336202632369, 16336202633152, 16336202633534, 16336202633883, 16336202634309,
+ 16336202634717, 16336202635106, 16336202635871, 16336202636253, 16336202636671, 16336202637070, 16336202637434,
+ 16336202637798, 16336202638184, 16336202638539, 16336202638938, 16336202639307, 16336202639666, 16336202640095,
+ 16336202640534, 16336202640962, 16336202641307, 16336202641659, 16336202642087, 16336202642521, 16336202642886,
+ 16336202643309, 16336202643662, 16336202644067, 16336202644491, 16336202644853, 16336202645226, 16336202645659,
+ 16336202646074, 16336202646497, 16336202646890, 16336202647311, 16336202647749, 16336202648169, 16336202648976,
+ 16336202649378, 16336202649810, 16336202650165, 16336202650534, 16336202650875, 16336202651250, 16336202651659,
+ 16336202652093, 16336202652516, 16336202652921, 16336202653332, 16336202653722, 16336202654142, 16336202654534,
+ 16336202654880, 16336202655221, 16336202655562, 16336202655997, 16336202656378, 16336202656811, 16336202657161,
+ 16336202657588, 16336202657944, 16336202658360, 16336202658708, 16336202659089, 16336202659428, 16336202659849,
+ 16336202660273, 16336202660685, 16336202661105, 16336202661534, 16336202661873, 16336202662228, 16336202662658,
+ 16336202663438, 16336202663843, 16336202664219, 16336202664646, 16336202665050, 16336202665487, 16336202665838,
+ 16336202666211, 16336202666573, 16336202666927, 16336202667334, 16336202667746, 16336202668158, 16336202668563,
+ 16336202668980, 16336202669406, 16336202669753, 16336202670192, 16336202670554, 16336202670903, 16336202671324,
+ 16336202671734, 16336202672159, 16336202672573, 16336202672982, 16336202673346, 16336202673680, 16336202674087,
+ 16336202674499, 16336202674909, 16336202675260, 16336202676110, 16336202676535, 16336202676913, 16336202677312,
+ 16336202677658, 16336202678044, 16336202678413, 16336202678793, 16336202679208, 16336202679604, 16336202680034,
+ 16336202680385, 16336202680799, 16336202681213, 16336202681595, 16336202682004, 16336202682346, 16336202682726,
+ 16336202683158, 16336202683586, 16336202683990, 16336202684323, 16336202684742, 16336202685175, 16336202685578,
+ 16336202685979, 16336202686805, 16336202687206, 16336202687614, 16336202688038, 16336202688473, 16336202688848,
+ 16336202689221, 16336202689559, 16336202689971, 16336202690368, 16336202690776, 16336202691159, 16336202691585,
+ 16336202692010, 16336202692373, 16336202692780, 16336202693179, 16336202693580, 16336202693991, 16336202694324,
+ 16336202694727, 16336202695159, 16336202695588, 16336202695991, 16336202696335, 16336202697160, 16336202697542,
+ 16336202697929, 16336202698323, 16336202698674, 16336202699060, 16336202699492, 16336202699835, 16336202700238,
+ 16336202700658, 16336202701059, 16336202701420, 16336202701815, 16336202702229, 16336202702659, 16336202703857,
+ 16336202704256, 16336202704659, 16336202705497, 16336202706309, 16336202706660, 16336202707085, 16336202707511,
+ 16336202707866, 16336202708210, 16336202708552, 16336202708925, 16336202709287, 16336202709670, 16336202710045,
+ 16336202710402, 16336202710802, 16336202711167, 16336202711533, 16336202712249, 16336202712660, 16336202713088,
+ 16336202713519, 16336202713936, 16336202714355, 16336202714740, 16336202715160, 16336202715533, 16336202715878,
+ 16336202716290, 16336202716708, 16336202717102, 16336202718290, 16336202718699, 16336202719052, 16336202719388,
+ 16336202719808, 16336202720225, 16336202720659, 16336202721052, 16336202721414, 16336202721828, 16336202722925,
+ 16336202723664, 16336202724063, 16336202724405, 16336202726003, 16336202726736, 16336202727158, 16336202727543,
+ 16336202727930, 16336202728336, 16336202728703, 16336202729061, 16336202729483, 16336202729832, 16336202730222,
+ 16336202730659, 16336202731084, 16336202731500, 16336202731911, 16336202732326, 16336202733158, 16336202733585,
+ 16336202734001, 16336202734691, 16336202735042, 16336202735442, 16336202735863, 16336202736255, 16336202736671,
+ 16336202737043, 16336202737884, 16336202738671, 16336202739110, 16336202739533, 16336202739886, 16336202740283,
+ 16336202740706, 16336202741143, 16336202741534, 16336202741942, 16336202742352, 16336202742697, 16336202743103,
+ 16336202743940, 16336202745172, 16336202745542, 16336202745937, 16336202746339, 16336202746758, 16336202747531,
+ 16336202747877, 16336202748232, 16336202748658, 16336202749055, 16336202749468, 16336202749859, 16336202750416,
+ 16336202750839, 16336202751178, 16336202751572, 16336202752002, 16336202752419, 16336202753269, 16336202753678,
+ 16336202754086, 16336202754432, 16336202754835, 16336202755260, 16336202755683, 16336202756059, 16336202756402,
+ 16336202756837, 16336202758084, 16336202758507, 16336202758879, 16336202759270, 16336202759674, 16336202760044,
+ 16336202760400, 16336202760801, 16336202761659, 16336202762053, 16336202762397, 16336202763199, 16336202763547,
+ 16336202763948, 16336202764714, 16336202765113, 16336202765947, 16336202766329, 16336202766664, 16336202767085,
+ 16336202768233, 16336202769056, 16336202769758, 16336202770178, 16336202770585, 16336202770929, 16336202771325,
+ 16336202772158, 16336202772594, 16336202773033, 16336202773403, 16336202773801, 16336202774179, 16336202774555,
+ 16336202774989, 16336202775393, 16336202775809, 16336202776209, 16336202776618, 16336202777033, 16336202777421,
+ 16336202777845, 16336202778246, 16336202778658, 16336202779055, 16336202779411, 16336202779761, 16336202780175,
+ 16336202780594, 16336202781002, 16336202781848, 16336202782658, 16336202783033, 16336202783857, 16336202784211,
+ 16336202784557, 16336202784972, 16336202785377, 16336202785810, 16336202786172, 16336202786934, 16336202787343,
+ 16336202787765, 16336202788201, 16336202788563, 16336202788970, 16336202789329, 16336202789672, 16336202790055,
+ 16336202790456, 16336202790802, 16336202791580, 16336202791920, 16336202792326, 16336202793158, 16336202793953,
+ 16336202794368, 16336202795187, 16336202795622, 16336202796033, 16336202796393, 16336202796777, 16336202797173,
+ 16336202797540, 16336202797975, 16336202798317, 16336202798739, 16336202799158, 16336202799567, 16336202799966,
+ 16336202800378, 16336202800803, 16336202801232, 16336202801658, 16336202802033, 16336202802374, 16336202802759,
+ 16336202803158, 16336202803533, 16336202803947, 16336202804354, 16336202804729, 16336202805158, 16336202805534,
+ 16336202805950, 16336202806390, 16336202806805, 16336202807219, 16336202807643, 16336202808033, 16336202808377,
+ 16336202808790, 16336202809211, 16336202809560, 16336202809920, 16336202810355, 16336202810758, 16336202811187,
+ 16336202811596, 16336202811943, 16336202812348, 16336202812710, 16336202813060, 16336202813398, 16336202813791,
+ 16336202814158, 16336202814533, 16336202814878, 16336202815246, 16336202815658, 16336202816079, 16336202816851,
+ 16336202817202, 16336202817540, 16336202817905, 16336202818244, 16336202818663, 16336202819068, 16336202819418,
+ 16336202819777, 16336202820193, 16336202820599, 16336202821033, 16336202821395, 16336202821745, 16336202822158,
+ 16336202822590, 16336202822996, 16336202823396, 16336202823804, 16336202824210, 16336202824581, 16336202824991,
+ 16336202825406, 16336202825806, 16336202826210, 16336202826598, 16336202827033, 16336202827446, 16336202827839,
+ 16336202828201, 16336202828577, 16336202828968, 16336202829362, 16336202829709, 16336202830096, 16336202830533,
+ 16336202830917, 16336202831290, 16336202831699, 16336202832035, 16336202832406, 16336202832804, 16336202833200,
+ 16336202833604, 16336202834033, 16336202834386, 16336202834759, 16336202835190, 16336202835621, 16336202836033,
+ 16336202836405, 16336202837191, 16336202837613, 16336202838033, 16336202838374, 16336202838798, 16336202839200,
+ 16336202839603, 16336202840034, 16336202840389, 16336202840783, 16336202841200, 16336202841617, 16336202842034,
+ 16336202842390, 16336202842737, 16336202843158, 16336202843585, 16336202843923, 16336202844313, 16336202844724,
+ 16336202845158, 16336202845576, 16336202845939, 16336202846368, 16336202846728, 16336202847158, 16336202847568,
+ 16336202847911, 16336202848291, 16336202848695, 16336202849103, 16336202849533, 16336202849942, 16336202850368,
+ 16336202850747, 16336202851158, 16336202851549, 16336202851978, 16336202852383, 16336202852725, 16336202853158,
+ 16336202853554, 16336202853961, 16336202854308, 16336202854704, 16336202855060, 16336202855418, 16336202855776,
+ 16336202856203, 16336202856617, 16336202857036, 16336202857455, 16336202857884, 16336202858262, 16336202858658,
+ 16336202859071, 16336202859847, 16336202860237, 16336202860658, 16336202861037, 16336202861452, 16336202861869,
+ 16336202862218, 16336202862590, 16336202863001, 16336202863422, 16336202863857, 16336202864219, 16336202864658,
+ 16336202865047, 16336202865404, 16336202865789, 16336202866210, 16336202866624, 16336202867033, 16336202867380,
+ 16336202867797, 16336202868227, 16336202868658, 16336202869083, 16336202869500, 16336202869906, 16336202870246,
+ 16336202870658, 16336202871086, 16336202871441, 16336202871820, 16336202872204, 16336202872546, 16336202872943,
+ 16336202873380, 16336202873811, 16336202874213, 16336202874566, 16336202874918, 16336202875261, 16336202875655,
+ 16336202876047, 16336202876771, 16336202877202, 16336202877612, 16336202878033, 16336202878412, 16336202878846,
+ 16336202879241, 16336202879658, 16336202880072, 16336202880508, 16336202880901, 16336202881308, 16336202881725,
+ 16336202882158, 16336202882579, 16336202882945, 16336202883286, 16336202883657, 16336202884048, 16336202884404,
+ 16336202884752, 16336202885158, 16336202885533, 16336202885938, 16336202886364, 16336202886759, 16336202887175,
+ 16336202887585, 16336202887929, 16336202888345, 16336202888743, 16336202889157, 16336202889570, 16336202889970,
+ 16336202890382, 16336202890761, 16336202891187, 16336202891600, 16336202892033, 16336202892454, 16336202892794,
+ 16336202893178, 16336202893533, 16336202893903, 16336202894264, 16336202894668, 16336202895049, 16336202895400,
+ 16336202895774, 16336202896157, 16336202896537, 16336202896883, 16336202897232, 16336202897658, 16336202898065,
+ 16336202898493, 16336202898884, 16336202899251, 16336202899673, 16336202900047, 16336202900467, 16336202900883,
+ 16336202901300, 16336202901676, 16336202902068, 16336202902479, 16336202902902, 16336202903260, 16336202903675,
+ 16336202904094, 16336202904476, 16336202904824, 16336202905158, 16336202905533, 16336202905934, 16336202906289,
+ 16336202906717, 16336202907158, 16336202907547, 16336202907904, 16336202908294, 16336202908717, 16336202909157,
+ 16336202909582, 16336202910005, 16336202910399, 16336202910800, 16336202911220, 16336202911657, 16336202912064,
+ 16336202912405, 16336202912779, 16336202913158, 16336202913553, 16336202913966, 16336202914376, 16336202914719,
+ 16336202915091, 16336202915515, 16336202915887, 16336202916293, 16336202916649, 16336202917438, 16336202917869,
+ 16336202918221, 16336202919053, 16336202919425, 16336202919833, 16336202920234, 16336202920658, 16336202921033,
+ 16336202921433, 16336202921801, 16336202922161, 16336202922589, 16336202923017, 16336202923418, 16336202923804,
+ 16336202924199, 16336202924593, 16336202925033, 16336202925449, 16336202925818, 16336202926223, 16336202926662,
+ 16336202927431, 16336202927812, 16336202928227, 16336202928658, 16336202929061, 16336202929473, 16336202929891,
+ 16336202930241, 16336202930657, 16336202931057, 16336202931396, 16336202931811, 16336202932225, 16336202932657,
+ 16336202933058, 16336202933445, 16336202933790, 16336202934157, 16336202934562, 16336202934988, 16336202935391,
+ 16336202935777, 16336202936160, 16336202936562, 16336202936986, 16336202937396, 16336202937751, 16336202938158,
+ 16336202938578, 16336202938985, 16336202939396, 16336202939752, 16336202940157, 16336202940585
],
"frameTimes": [
- 346, 411, 420, 382, 417, 433, 410, 431, 428, 375, 401, 415, 413, 382, 362,
- 380, 406, 353, 354, 389, 416, 425, 346, 432, 415, 393, 415, 367, 388, 401,
- 417, 376, 422, 375, 410, 392, 375, 418, 375, 352, 414, 764, 420, 776, 399,
- 418, 363, 335, 341, 386, 715, 426, 419, 417, 345, 409, 345, 428, 402, 393,
- 425, 426, 424, 379, 411, 426, 415, 445, 427, 398, 435, 405, 432, 427, 417,
- 420, 434, 397, 407, 339, 354, 416, 415, 364, 355, 398, 429, 361, 369, 407,
- 414, 342, 369, 429, 366, 440, 413, 363, 336, 375, 423, 409, 427, 769, 426,
- 352, 386, 353, 405, 435, 362, 375, 419, 388, 381, 376, 335, 382, 426, 389,
- 382, 399, 364, 355, 369, 429, 428, 352, 434, 423, 405, 362, 433, 423, 421,
- 420, 402, 355, 341, 409, 423, 411, 420, 346, 341, 381, 350, 356, 348, 339,
- 424, 420, 339, 430, 405, 427, 437, 373, 354, 412, 405, 426, 439, 349, 410,
- 414, 364, 407, 410, 850, 378, 346, 369, 415, 430, 414, 382, 342, 432, 404,
- 419, 403, 826, 408, 435, 373, 412, 408, 426, 363, 399, 411, 403, 429, 344,
- 382, 394, 386, 343, 420, 361, 414, 1198, 403, 812, 425, 355, 342, 362, 375,
- 400, 366, 411, 431, 419, 420, 345, 418, 1188, 353, 420, 434, 362, 1097, 399,
- 1598, 422, 387, 367, 422, 390, 425, 411, 832, 416, 351, 421, 416, 841, 439,
- 353, 423, 391, 410, 406, 1232, 395, 419, 346, 426, 413, 557, 339, 430, 850,
- 408, 403, 423, 343, 1247, 372, 404, 356, 858, 344, 348, 766, 834, 335, 1148,
- 702, 407, 396, 436, 370, 378, 434, 416, 409, 388, 401, 397, 350, 419, 846,
- 375, 354, 415, 433, 762, 422, 362, 359, 383, 346, 340, 832, 415, 435, 360,
- 396, 435, 422, 409, 412, 429, 375, 385, 375, 407, 429, 416, 415, 424, 344,
- 421, 360, 403, 409, 405, 350, 393, 375, 368, 421, 351, 365, 419, 350, 416,
- 434, 350, 432, 400, 406, 410, 400, 388, 413, 362, 391, 347, 437, 373, 336,
- 398, 404, 353, 431, 412, 786, 420, 424, 403, 355, 417, 417, 347, 427, 390,
- 434, 363, 360, 410, 380, 408, 409, 379, 391, 405, 433, 407, 396, 358, 427,
- 419, 429, 396, 776, 421, 415, 349, 411, 435, 439, 357, 421, 409, 417, 431,
- 417, 340, 428, 379, 342, 437, 402, 352, 394, 724, 410, 379, 395, 414, 393,
- 417, 421, 341, 391, 348, 375, 426, 416, 344, 398, 413, 412, 426, 433, 340,
- 355, 361, 381, 374, 380, 349, 407, 391, 422, 420, 417, 392, 423, 415, 382,
- 334, 401, 428, 389, 390, 440, 423, 401, 437, 341, 379, 413, 343, 424, 406,
- 789, 352, 372, 401, 375, 368, 428, 401, 395, 440, 369, 439, 381, 431, 412,
- 350, 400, 415, 432, 387, 367, 426, 386, 402, 410, 407, 407, 356, 428
+ 346, 411, 420, 382, 417, 433, 410, 431, 428, 375, 401, 415, 413, 382, 362, 380, 406, 353, 354, 389, 416, 425, 346,
+ 432, 415, 393, 415, 367, 388, 401, 417, 376, 422, 375, 410, 392, 375, 418, 375, 352, 414, 764, 420, 776, 399, 418,
+ 363, 335, 341, 386, 715, 426, 419, 417, 345, 409, 345, 428, 402, 393, 425, 426, 424, 379, 411, 426, 415, 445, 427,
+ 398, 435, 405, 432, 427, 417, 420, 434, 397, 407, 339, 354, 416, 415, 364, 355, 398, 429, 361, 369, 407, 414, 342,
+ 369, 429, 366, 440, 413, 363, 336, 375, 423, 409, 427, 769, 426, 352, 386, 353, 405, 435, 362, 375, 419, 388, 381,
+ 376, 335, 382, 426, 389, 382, 399, 364, 355, 369, 429, 428, 352, 434, 423, 405, 362, 433, 423, 421, 420, 402, 355,
+ 341, 409, 423, 411, 420, 346, 341, 381, 350, 356, 348, 339, 424, 420, 339, 430, 405, 427, 437, 373, 354, 412, 405,
+ 426, 439, 349, 410, 414, 364, 407, 410, 850, 378, 346, 369, 415, 430, 414, 382, 342, 432, 404, 419, 403, 826, 408,
+ 435, 373, 412, 408, 426, 363, 399, 411, 403, 429, 344, 382, 394, 386, 343, 420, 361, 414, 1198, 403, 812, 425, 355,
+ 342, 362, 375, 400, 366, 411, 431, 419, 420, 345, 418, 1188, 353, 420, 434, 362, 1097, 399, 1598, 422, 387, 367,
+ 422, 390, 425, 411, 832, 416, 351, 421, 416, 841, 439, 353, 423, 391, 410, 406, 1232, 395, 419, 346, 426, 413, 557,
+ 339, 430, 850, 408, 403, 423, 343, 1247, 372, 404, 356, 858, 344, 348, 766, 834, 335, 1148, 702, 407, 396, 436, 370,
+ 378, 434, 416, 409, 388, 401, 397, 350, 419, 846, 375, 354, 415, 433, 762, 422, 362, 359, 383, 346, 340, 832, 415,
+ 435, 360, 396, 435, 422, 409, 412, 429, 375, 385, 375, 407, 429, 416, 415, 424, 344, 421, 360, 403, 409, 405, 350,
+ 393, 375, 368, 421, 351, 365, 419, 350, 416, 434, 350, 432, 400, 406, 410, 400, 388, 413, 362, 391, 347, 437, 373,
+ 336, 398, 404, 353, 431, 412, 786, 420, 424, 403, 355, 417, 417, 347, 427, 390, 434, 363, 360, 410, 380, 408, 409,
+ 379, 391, 405, 433, 407, 396, 358, 427, 419, 429, 396, 776, 421, 415, 349, 411, 435, 439, 357, 421, 409, 417, 431,
+ 417, 340, 428, 379, 342, 437, 402, 352, 394, 724, 410, 379, 395, 414, 393, 417, 421, 341, 391, 348, 375, 426, 416,
+ 344, 398, 413, 412, 426, 433, 340, 355, 361, 381, 374, 380, 349, 407, 391, 422, 420, 417, 392, 423, 415, 382, 334,
+ 401, 428, 389, 390, 440, 423, 401, 437, 341, 379, 413, 343, 424, 406, 789, 352, 372, 401, 375, 368, 428, 401, 395,
+ 440, 369, 439, 381, 431, 412, 350, 400, 415, 432, 387, 367, 426, 386, 402, 410, 407, 407, 356, 428
],
"percentileMs": {
"50": 40.7,
diff --git a/biome.json b/biome.json
new file mode 100644
index 0000000000..1c4bd8ebd2
--- /dev/null
+++ b/biome.json
@@ -0,0 +1,66 @@
+{
+ "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
+ "organizeImports": {
+ "enabled": true
+ },
+ "linter": {
+ "enabled": false
+ },
+ "javascript": {
+ "parser": {
+ "unsafeParameterDecoratorsEnabled": true
+ },
+ "formatter": {
+ "arrowParentheses": "asNeeded",
+ "quoteProperties": "preserve",
+ "semicolons": "always",
+ "trailingComma": "all",
+ "indentStyle": "space",
+ "quoteStyle": "double"
+ }
+ },
+ "json": {
+ "formatter": {
+ "indentStyle": "space"
+ }
+ },
+ "vcs": {
+ "clientKind": "git",
+ "enabled": false,
+ "root": "./"
+ },
+ "files": {
+ "maxSize": 9128312873
+ },
+ "formatter": {
+ "enabled": true,
+ "indentWidth": 2,
+ "lineEnding": "lf",
+ "formatWithErrors": true,
+ "lineWidth": 120,
+ "indentStyle": "space",
+ "ignore": [
+ "node_modules/**",
+ "test/snapshots",
+ "test/fixtures",
+ ".next",
+ "test/js/deno",
+ "./src/deps",
+ "./src/bun.js/WebKit/**",
+ "packages/bun-polyfills",
+ "./build-*",
+ "./build",
+ ".cache",
+ "out/",
+ "test/transpiler/property-non-ascii-fixture.js",
+ "test/transpiler/macro-test.test.ts",
+ "test/transpiler/decorator-metadata.test.ts",
+ "src/react-refresh.js",
+ "bindings-obj/*",
+ "src/deps/**",
+ "./bench/react-hello-world/react-hello-world.node.js",
+ "./test/cli/run/require-cache-bug-leak-fixture-large-ast.js",
+ "./test/cli/run/esm-leak-fixture-large-ast.mjs"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/bun.lockb b/bun.lockb
index 7bba6881f0..e7d7e711d7 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/package.json b/package.json
index 583b6f6f3a..defee9719e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,7 @@
{
"name": "bun",
"dependencies": {
+ "@biomejs/biome": "^1.5.3",
"@vscode/debugadapter": "^1.61.0",
"esbuild": "^0.17.15",
"eslint": "^8.20.0",
@@ -21,7 +22,7 @@
"build:release": "cmake . -DCMAKE_BUILD_TYPE=Release -GNinja -Bbuild-release && ninja -Cbuild-release",
"build:safe": "cmake . -DZIG_OPTIMIZE=ReleaseSafe -DUSE_DEBUG_JSC=ON -DCMAKE_BUILD_TYPE=Release -GNinja -Bbuild-safe && ninja -Cbuild-safe",
"typecheck": "tsc --noEmit && cd test && bun run typecheck",
- "fmt": "prettier --write --cache \"./{src,test,bench,packages/{bun-types,bun-inspector-*,bun-vscode,bun-debug-adapter-protocol}}/**/*.{mjs,ts,tsx,js,jsx}\"",
+ "fmt": "biome format --write {src,test,bench,packages/{bun-types,bun-inspector-*,bun-vscode,bun-debug-adapter-protocol}}",
"fmt:zig": "zig fmt src/*.zig src/**/*.zig",
"lint": "eslint './**/*.d.ts' --cache",
"lint:fix": "eslint './**/*.d.ts' --cache --fix",
diff --git a/packages/bun-error/index.tsx b/packages/bun-error/index.tsx
index 5c64fe8073..e75f76621f 100644
--- a/packages/bun-error/index.tsx
+++ b/packages/bun-error/index.tsx
@@ -11,11 +11,7 @@ import type {
StackFrame,
WebsocketMessageBuildFailure,
} from "../../src/api/schema";
-import {
- messagesToMarkdown,
- problemsToMarkdown,
- withBunInfo,
-} from "./markdown";
+import { messagesToMarkdown, problemsToMarkdown, withBunInfo } from "./markdown";
import { fetchAllMappings, remapPosition, sourceMappings } from "./sourcemap";
export enum StackFrameScope {
@@ -82,9 +78,7 @@ enum ErrorTagType {
}
const ErrorTag = ({ type }: { type: ErrorTagType }) => (
-
- {ErrorTagType[type]}
-
+ {ErrorTagType[type]}
);
const errorTags = [
@@ -133,11 +127,7 @@ function hasColumnOrLine(filename: string) {
return /:\d+/.test(filename);
}
-function appendLineColumnIfNeeded(
- base: string,
- line?: number,
- column?: number,
-) {
+function appendLineColumnIfNeeded(base: string, line?: number, column?: number) {
if (hasColumnOrLine(base)) return base;
return appendLineColumn(base, line, column);
@@ -155,11 +145,7 @@ function appendLineColumn(base: string, line?: number, column?: number) {
return base;
}
-const blobFileURL = (
- filename: string,
- line?: number,
- column?: number,
-): string => {
+const blobFileURL = (filename: string, line?: number, column?: number): string => {
var base = `/blob:${filename}`;
base = appendLineColumnIfNeeded(base, line, column);
@@ -167,11 +153,7 @@ const blobFileURL = (
return new URL(base, globalThis.location.href).href;
};
-const maybeBlobFileURL = (
- filename: string,
- line?: number,
- column?: number,
-): string => {
+const maybeBlobFileURL = (filename: string, line?: number, column?: number): string => {
if (filename.includes(".bun")) {
return blobFileURL(filename, line, column);
}
@@ -183,9 +165,7 @@ const maybeBlobFileURL = (
return srcFileURL(filename, line, column);
};
-const openWithoutFlashOfNewTab: React.MouseEventHandler = (
- event,
-) => {
+const openWithoutFlashOfNewTab: React.MouseEventHandler = event => {
const target = event.currentTarget;
const href = target.getAttribute("href");
if (!href || event.button !== 0) {
@@ -216,18 +196,13 @@ const openWithoutFlashOfNewTab: React.MouseEventHandler = (
})
.then(
() => {},
- (er) => {},
+ er => {},
);
return false;
};
-const srcFileURL = (
- filename: string,
- line?: number,
- column?: number,
-): string => {
- if (filename.startsWith("http://") || filename.startsWith("https://"))
- return appendLineColumnIfNeeded(filename);
+const srcFileURL = (filename: string, line?: number, column?: number): string => {
+ if (filename.startsWith("http://") || filename.startsWith("https://")) return appendLineColumnIfNeeded(filename);
if (filename.endsWith(".bun")) {
return new URL("/" + filename, globalThis.location.href).href;
@@ -272,10 +247,7 @@ class FancyTypeError {
const nextWord = /(["a-zA-Z0-9_\.]+)\)$/.exec(partial);
if (nextWord && nextWord[0]) {
this.runtimeTypeName = nextWord[0];
- this.runtimeTypeName = this.runtimeTypeName.substring(
- 0,
- this.runtimeTypeName.length - 1,
- );
+ this.runtimeTypeName = this.runtimeTypeName.substring(0, this.runtimeTypeName.length - 1);
switch (this.runtimeTypeName.toLowerCase()) {
case "undefined": {
this.runtimeType = RuntimeType.Undefined;
@@ -312,15 +284,12 @@ class FancyTypeError {
}
}
this.message = exception.message.substring(0, i);
- this.message = this.message.substring(
- 0,
- this.message.lastIndexOf("(In "),
- );
+ this.message = this.message.substring(0, this.message.lastIndexOf("(In "));
}
}
}
-export const clientURL = (filename) => {
+export const clientURL = filename => {
if (filename.includes(".bun")) {
return `/${filename.replace(/^(\/)?/g, "")}`;
}
@@ -368,22 +337,17 @@ const AsyncSourceLines = ({
Accept: "text/plain",
},
})
- .then((resp) => {
+ .then(resp => {
return resp.text();
})
- .then((text) => {
+ .then(text => {
if (cancelled) return;
// TODO: make this faster
const lines = text.split("\n");
- const startLineNumber = Math.max(
- Math.min(Math.max(highlight - 4, 0), lines.length - 1),
- 0,
- );
+ const startLineNumber = Math.max(Math.min(Math.max(highlight - 4, 0), lines.length - 1), 0);
const endLineNumber = Math.min(startLineNumber + 8, lines.length);
- const sourceLines: SourceLine[] = new Array(
- endLineNumber - startLineNumber,
- );
+ const sourceLines: SourceLine[] = new Array(endLineNumber - startLineNumber);
var index = 0;
for (let i = startLineNumber; i < endLineNumber; i++) {
const currentLine = lines[i - 1];
@@ -394,14 +358,10 @@ const AsyncSourceLines = ({
};
}
- setSourceLines(
- index !== sourceLines.length
- ? sourceLines.slice(0, index)
- : sourceLines,
- );
+ setSourceLines(index !== sourceLines.length ? sourceLines.slice(0, index) : sourceLines);
setLoadState(LoadState.loaded);
})
- .catch((err) => {
+ .catch(err => {
if (!cancelled) {
console.error(err);
setLoadState(LoadState.failed);
@@ -499,8 +459,7 @@ const SourceLines = ({
}
}
- const leftPad =
- maxLineNumber.toString(10).length - minLineNumber.toString(10).length;
+ const leftPad = maxLineNumber.toString(10).length - minLineNumber.toString(10).length;
const _sourceLines = sourceLines.slice(start, end);
const lines = new Array(_sourceLines.length + React.Children.count(children));
@@ -520,15 +479,10 @@ const SourceLines = ({
data-line={line}
data-column={classes.highlight ? highlightColumnStart : dedent}
title={`Open line ${line} in editor`}
- href={buildURL(
- line,
- classes.highlight ? highlightColumnStart : dedent,
- )}
+ href={buildURL(line, classes.highlight ? highlightColumnStart : dedent)}
onClickCapture={openWithoutFlashOfNewTab}
key={"highlight-number-" + line}
- className={`BunError-SourceLine-number ${
- classes.empty ? "BunError-SourceLine-number--empty" : ""
- } ${
+ className={`BunError-SourceLine-number ${classes.empty ? "BunError-SourceLine-number--empty" : ""} ${
classes.highlight ? "BunError-SourceLine-number--highlight" : ""
}`}
>
@@ -536,9 +490,9 @@ const SourceLines = ({
{_text}
@@ -549,9 +503,7 @@ const SourceLines = ({
return (
@@ -568,10 +520,7 @@ const BuildErrorSourceLines = ({
}) => {
const { line, line_text, column } = location;
const sourceLines: SourceLine[] = [{ line, text: line_text }];
- const buildURL = React.useCallback(
- (line, column) => srcFileURL(filename, line, column),
- [srcFileURL, filename],
- );
+ const buildURL = React.useCallback((line, column) => srcFileURL(filename, line, column), [srcFileURL, filename]);
return (
{
switch (scope) {
case StackFrameScope.Constructor: {
- functionName =
- markdown && functionName ? "`" + functionName + "`" : functionName;
+ functionName = markdown && functionName ? "`" + functionName + "`" : functionName;
return functionName ? `new ${functionName}` : "new (anonymous)";
}
@@ -636,16 +584,12 @@ export const StackFrameIdentifier = ({
case StackFrameScope.Function:
default: {
- return functionName
- ? markdown
- ? "`" + functionName + "`"
- : functionName
- : "位()";
+ return functionName ? (markdown ? "`" + functionName + "`" : functionName) : "位()";
}
}
};
-const getNativeStackFrameIdentifier = (frame) => {
+const getNativeStackFrameIdentifier = frame => {
const { file, function_name: functionName, scope } = frame;
return StackFrameIdentifier({
@@ -673,11 +617,7 @@ const NativeStackFrame = ({
} = frame;
const fileName = normalizedFilename(file, cwd);
return (
-
+
{fileName}
{line > -1 &&
:{line}
}
- {column > -1 && (
-
:{column}
- )}
+ {column > -1 &&
:{column}
}
@@ -714,21 +652,11 @@ const NativeStackFrames = ({ frames, urlBuilder }) => {
var maxLength = 0;
for (let i = 0; i < frames.length; i++) {
- maxLength = Math.max(
- getNativeStackFrameIdentifier(frames[i]).length,
- maxLength,
- );
+ maxLength = Math.max(getNativeStackFrameIdentifier(frames[i]).length, maxLength);
}
for (let i = 0; i < frames.length; i++) {
- items[i] = (
-
- );
+ items[i] =
;
}
return (
@@ -756,10 +684,7 @@ const NativeStackTrace = ({
const filename = normalizedFilename(file, cwd);
const urlBuilder = isClient ? clientURL : maybeBlobFileURL;
const ref = React.useRef
(null);
- const buildURL = React.useCallback(
- (line, column) => urlBuilder(file, line, column),
- [file, urlBuilder],
- );
+ const buildURL = React.useCallback((line, column) => urlBuilder(file, line, column), [file, urlBuilder]);
return (
@@ -797,9 +722,7 @@ const NativeStackTrace = ({
{children}
)}
- {frames.length > 1 && (
-
- )}
+ {frames.length > 1 && }
);
};
@@ -822,9 +745,7 @@ const JSException = ({
isClient: boolean;
}) => {
const tag = isClient ? ErrorTagType.client : ErrorTagType.server;
- const [sourceLines, _setSourceLines] = React.useState(
- value?.stack?.source_lines ?? [],
- );
+ const [sourceLines, _setSourceLines] = React.useState(value?.stack?.source_lines ?? []);
var message = value.message || "";
var name = value.name || "";
if (!name && !message) {
@@ -849,25 +770,17 @@ const JSException = ({
if (fancyTypeError.runtimeType !== RuntimeType.Nothing) {
return (
-
);
};
@@ -1034,16 +932,12 @@ const ResolveError = ({ message }: { message: Message }) => {
Can't import{" "}
-
- "{message.on.resolve}"
-
+ "{message.on.resolve}"
{subtitle && {subtitle}
}
- {message.data.location && (
-
- )}
+ {message.data.location && }
);
};
@@ -1052,9 +946,7 @@ const OverlayMessageContainer = ({
reason,
isClient = false,
}: FallbackMessageContainer & { isClient: boolean }) => {
- const errorCount = problems
- ? problems.exceptions.length + problems.build.errors
- : 0;
+ const errorCount = problems ? problems.exceptions.length + problems.build.errors : 0;
return (
@@ -1086,7 +978,7 @@ function copyToClipboard(input: string | Promise
) {
if (!input) return;
if (typeof input === "object" && "then" in input) {
- return input.then((str) => copyToClipboard(str));
+ return input.then(str => copyToClipboard(str));
}
return navigator.clipboard.writeText(input).then(() => {});
@@ -1148,9 +1040,7 @@ function renderWithFunc(func) {
reactRoot = document.createElement("div");
reactRoot.id = BUN_ERROR_CONTAINER_ID;
- const fallbackStyleSheet = document.querySelector(
- "style[data-has-bun-fallback-style]",
- );
+ const fallbackStyleSheet = document.querySelector("style[data-has-bun-fallback-style]");
if (!fallbackStyleSheet) {
reactRoot.style.visibility = "hidden";
}
@@ -1204,7 +1094,7 @@ import { parse as getStackTrace } from "./stack-trace-parser";
var runtimeErrorController: AbortController | null = null;
var pending: { stopped: boolean }[] = [];
-var onIdle = globalThis.requestIdleCallback || ((cb) => setTimeout(cb, 32));
+var onIdle = globalThis.requestIdleCallback || (cb => setTimeout(cb, 32));
function clearSourceMappings() {
sourceMappings.clear();
}
@@ -1270,8 +1160,7 @@ export function renderRuntimeError(error: Error) {
exception.stack.frames[0].position.line = error[lineNumberProperty];
if (Number.isFinite(error[columnNumberProperty])) {
- exception.stack.frames[0].position.column_start =
- error[columnNumberProperty];
+ exception.stack.frames[0].position.column_start = error[columnNumberProperty];
}
}
}
@@ -1308,20 +1197,18 @@ export function renderRuntimeError(error: Error) {
// Rely on the cached ones
// and don't fetch them again
const framePromises = fetchAllMappings(
- exception.stack.frames.map((frame) =>
- normalizedFilename(frame.file, thisCwd),
- ),
+ exception.stack.frames.map(frame => normalizedFilename(frame.file, thisCwd)),
signal,
)
.map((frame, i) => {
if (stopThis.stopped) return null;
return [frame, i];
})
- .map((result) => {
+ .map(result => {
if (!result) return;
const [mappings, frameIndex] = result;
if (mappings?.then) {
- return mappings.then((mappings) => {
+ return mappings.then(mappings => {
if (!mappings || stopThis.stopped) {
return null;
}
@@ -1391,10 +1278,7 @@ export function dismissError() {
}
}
-export const renderBuildFailure = (
- failure: WebsocketMessageBuildFailure,
- cwd: string,
-) => {
+export const renderBuildFailure = (failure: WebsocketMessageBuildFailure, cwd: string) => {
thisCwd = cwd;
renderWithFunc(() => (
diff --git a/packages/bun-error/markdown.ts b/packages/bun-error/markdown.ts
index d6bbbf30c6..52c4251e55 100644
--- a/packages/bun-error/markdown.ts
+++ b/packages/bun-error/markdown.ts
@@ -1,15 +1,5 @@
-import {
- normalizedFilename,
- StackFrameIdentifier,
- thisCwd,
- StackFrameScope,
-} from "./index";
-import type {
- JSException,
- JSException as JSExceptionType,
- Message,
- Problems,
-} from "../../src/api/schema";
+import { normalizedFilename, StackFrameIdentifier, thisCwd, StackFrameScope } from "./index";
+import type { JSException, JSException as JSExceptionType, Message, Problems } from "../../src/api/schema";
export function problemsToMarkdown(problems: Problems) {
var markdown = "";
@@ -27,14 +17,14 @@ export function problemsToMarkdown(problems: Problems) {
export function messagesToMarkdown(messages: Message[]): string {
return messages
.map(messageToMarkdown)
- .map((a) => a.trim())
+ .map(a => a.trim())
.join("\n");
}
export function exceptionsToMarkdown(exceptions: JSExceptionType[]): string {
return exceptions
.map(exceptionToMarkdown)
- .map((a) => a.trim())
+ .map(a => a.trim())
.join("\n");
}
@@ -73,11 +63,7 @@ function exceptionToMarkdown(exception: JSException): string {
const {
file: _file = "",
function_name = "",
- position: {
- line = -1,
- column_start: column = -1,
- column_stop: columnEnd = column,
- } = {
+ position: { line = -1, column_start: column = -1, column_stop: columnEnd = column } = {
line: -1,
column_start: -1,
column_stop: -1,
@@ -114,23 +100,17 @@ function exceptionToMarkdown(exception: JSException): string {
markdown += "\n```";
markdown += extname;
markdown += "\n";
- stack.source_lines.forEach((sourceLine) => {
+ stack.source_lines.forEach(sourceLine => {
const lineText = sourceLine.text.trimEnd();
markdown += lineText + "\n";
if (sourceLine.line === line && stack.source_lines.length > 1) {
// the comment should start at the first non-whitespace character
// ideally it should be length the original line
// but it may not be
- var prefix = "".padStart(
- lineText.length - lineText.trimStart().length,
- " ",
- );
+ var prefix = "".padStart(lineText.length - lineText.trimStart().length, " ");
- prefix +=
- "/* ".padEnd(column - 1 - prefix.length, " ") +
- "^ happened here ";
- markdown +=
- prefix.padEnd(Math.max(lineText.length, 1) - 1, " ") + "*/\n";
+ prefix += "/* ".padEnd(column - 1 - prefix.length, " ") + "^ happened here ";
+ markdown += prefix.padEnd(Math.max(lineText.length, 1) - 1, " ") + "*/\n";
}
});
markdown = markdown.trimEnd() + "\n```";
@@ -240,11 +220,9 @@ function messageToMarkdown(message: Message): string {
if (message.data.location.line_text.length) {
const extnameI = message.data.location.file.lastIndexOf(".");
- const extname =
- extnameI > -1 ? message.data.location.file.slice(extnameI + 1) : "";
+ const extname = extnameI > -1 ? message.data.location.file.slice(extnameI + 1) : "";
- markdown +=
- "\n```" + extname + "\n" + message.data.location.line_text + "\n```\n";
+ markdown += "\n```" + extname + "\n" + message.data.location.line_text + "\n```\n";
} else {
markdown += "\n";
}
@@ -257,14 +235,14 @@ function messageToMarkdown(message: Message): string {
return markdown;
}
-export const withBunInfo = (text) => {
+export const withBunInfo = text => {
const bunInfo = getBunInfo();
const trimmed = text.trim();
if (bunInfo && "then" in bunInfo) {
return bunInfo.then(
- (info) => {
+ info => {
const markdown = bunInfoToMarkdown(info).trim();
return trimmed + "\n" + markdown + "\n";
},
@@ -379,8 +357,8 @@ function getBunInfo() {
Accept: "application/json",
},
})
- .then((resp) => resp.json())
- .then((bunInfo) => {
+ .then(resp => resp.json())
+ .then(bunInfo => {
clearTimeout(id);
bunInfoMemoized = bunInfo;
if ("sessionStorage" in globalThis) {
diff --git a/packages/bun-error/runtime-error.ts b/packages/bun-error/runtime-error.ts
index 5341e0bc89..7827aa1bc9 100644
--- a/packages/bun-error/runtime-error.ts
+++ b/packages/bun-error/runtime-error.ts
@@ -1,10 +1,6 @@
// Based on https://github.com/stacktracejs/error-stack-parser/blob/master/error-stack-parser.js
-import type {
- StackFrame as StackFrameType,
- StackFramePosition,
- StackFrameScope,
-} from "../../src/api/schema";
+import type { StackFrame as StackFrameType, StackFramePosition, StackFrameScope } from "../../src/api/schema";
export class StackFrame implements StackFrameType {
function_name: string;
@@ -89,9 +85,7 @@ export default class RuntimeError {
return filtered.map(function (line) {
if (line.indexOf("(eval ") > -1) {
// Throw away eval information until we implement stacktrace.js/stackframe#8
- line = line
- .replace(/eval code/g, "eval")
- .replace(/(\(eval at [^()]*)|(\),.*$)/g, "");
+ line = line.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(\),.*$)/g, "");
}
var sanitizedLine = line.replace(/^\s+/, "").replace(/\(eval code/g, "(");
@@ -100,20 +94,13 @@ export default class RuntimeError {
var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/);
// remove the parenthesized location from the line, if it was matched
- sanitizedLine = location
- ? sanitizedLine.replace(location[0], "")
- : sanitizedLine;
+ sanitizedLine = location ? sanitizedLine.replace(location[0], "") : sanitizedLine;
var tokens = sanitizedLine.split(/\s+/).slice(1);
// if a location was matched, pass it to extractLocation() otherwise pop the last token
- var locationParts = this.extractLocation(
- location ? location[1] : tokens.pop(),
- );
+ var locationParts = this.extractLocation(location ? location[1] : tokens.pop());
var functionName = tokens.join(" ") || undefined;
- var fileName =
- ["eval", ""].indexOf(locationParts[0]) > -1
- ? undefined
- : locationParts[0];
+ var fileName = ["eval", ""].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];
return new StackFrame({
functionName: functionName,
@@ -133,10 +120,7 @@ export default class RuntimeError {
return filtered.map(function (line) {
// Throw away eval information until we implement stacktrace.js/stackframe#8
if (line.indexOf(" > eval") > -1) {
- line = line.replace(
- / line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,
- ":$1",
- );
+ line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1");
}
if (line.indexOf("@") === -1 && line.indexOf(":") === -1) {
@@ -148,9 +132,7 @@ export default class RuntimeError {
var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/;
var matches = line.match(functionNameRegex);
var functionName = matches && matches[1] ? matches[1] : undefined;
- var locationParts = this.extractLocation(
- line.replace(functionNameRegex, ""),
- );
+ var locationParts = this.extractLocation(line.replace(functionNameRegex, ""));
return new StackFrame({
functionName: functionName,
diff --git a/packages/bun-error/sourcemap.ts b/packages/bun-error/sourcemap.ts
index 115ff69f13..aa3fabbecb 100644
--- a/packages/bun-error/sourcemap.ts
+++ b/packages/bun-error/sourcemap.ts
@@ -1,7 +1,6 @@
// Accelerate VLQ decoding with a lookup table
const vlqTable = new Uint8Array(128);
-const vlqChars =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+const vlqChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
vlqTable.fill(0xff);
for (let i = 0; i < vlqChars.length; i++) vlqTable[vlqChars.charCodeAt(i)] = i;
@@ -10,10 +9,7 @@ export function parseSourceMap(json) {
throw new Error("Invalid source map");
}
- if (
- !(json.sources instanceof Array) ||
- json.sources.some((x) => typeof x !== "string")
- ) {
+ if (!(json.sources instanceof Array) || json.sources.some(x => typeof x !== "string")) {
throw new Error("Invalid source map");
}
@@ -147,8 +143,7 @@ export function decodeMappings(mappings, sourcesCount) {
// Read the original source
const originalSourceDelta = decodeVLQ();
originalSource += originalSourceDelta;
- if (originalSource < 0 || originalSource >= sourcesCount)
- decodeError("Invalid original source");
+ if (originalSource < 0 || originalSource >= sourcesCount) decodeError("Invalid original source");
// Read the original line
const originalLineDelta = decodeVLQ();
@@ -211,11 +206,7 @@ export function decodeMappings(mappings, sourcesCount) {
return data.subarray(0, dataLength);
}
-export function remapPosition(
- decodedMappings: Int32Array,
- line: number,
- column: number,
-) {
+export function remapPosition(decodedMappings: Int32Array, line: number, column: number) {
if (!(decodedMappings instanceof Int32Array)) {
throw new Error("decodedMappings must be an Int32Array");
}
@@ -260,7 +251,7 @@ export function fetchMappings(file, signal) {
return sourceMappings.get(file);
}
- return fetchRemoteSourceMap(file, signal).then((json) => {
+ return fetchRemoteSourceMap(file, signal).then(json => {
if (!json) return null;
const { data } = parseSourceMap(json);
sourceMappings.set(file, data);
@@ -285,11 +276,11 @@ export function fetchAllMappings(files, signal) {
var resolvers = [];
for (let i = 0; i < indices.length; i++) {
results[indices[i]] = new Promise((resolve, reject) => {
- resolvers[i] = (res) => resolve(res ? [res, i] : null);
+ resolvers[i] = res => resolve(res ? [res, i] : null);
});
}
- mapped.finally((a) => {
+ mapped.finally(a => {
for (let resolve of resolvers) {
try {
resolve(a);
@@ -320,10 +311,7 @@ function indexOfMapping(mappings: Int32Array, line: number, column: number) {
var i = index + step;
// this multiply is slow but it's okay for now
var j = i * 6;
- if (
- mappings[j] < line ||
- (mappings[j] == line && mappings[j + 1] <= column)
- ) {
+ if (mappings[j] < line || (mappings[j] == line && mappings[j + 1] <= column)) {
index = i + 1;
count -= step + 1;
} else {
diff --git a/packages/bun-error/stack-trace-parser.ts b/packages/bun-error/stack-trace-parser.ts
index c779a61850..9fd9abcb93 100644
--- a/packages/bun-error/stack-trace-parser.ts
+++ b/packages/bun-error/stack-trace-parser.ts
@@ -17,12 +17,7 @@ export function parse(stackString): StackFrame[] {
const lines = stackString.split("\n");
return lines.reduce((stack, line) => {
- const parseResult =
- parseChrome(line) ||
- parseWinjs(line) ||
- parseGecko(line) ||
- parseNode(line) ||
- parseJSC(line);
+ const parseResult = parseChrome(line) || parseWinjs(line) || parseGecko(line) || parseNode(line) || parseJSC(line);
if (parseResult) {
stack.push(parseResult);
@@ -32,15 +27,14 @@ export function parse(stackString): StackFrame[] {
}, []);
}
-const formatFile = (file) => {
+const formatFile = file => {
if (!file) {
return "";
}
if (file.startsWith("blob:")) {
if (globalThis["__BUN"]?.client) {
- const replacement =
- globalThis["__BUN"]?.client.dependencies.getFilePathFromBlob(file);
+ const replacement = globalThis["__BUN"]?.client.dependencies.getFilePathFromBlob(file);
if (replacement) {
file = replacement;
}
@@ -146,8 +140,7 @@ function parseGecko(line) {
};
}
-const javaScriptCoreRe =
- /^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;
+const javaScriptCoreRe = /^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;
function parseJSC(line) {
const parts = javaScriptCoreRe.exec(line);
@@ -166,8 +159,7 @@ function parseJSC(line) {
};
}
-const nodeRe =
- /^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;
+const nodeRe = /^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;
function parseNode(line) {
const parts = nodeRe.exec(line);
diff --git a/packages/bun-inspector-protocol/src/protocol/jsc/protocol.json b/packages/bun-inspector-protocol/src/protocol/jsc/protocol.json
index bb8158358f..2e9e6b5682 100644
--- a/packages/bun-inspector-protocol/src/protocol/jsc/protocol.json
+++ b/packages/bun-inspector-protocol/src/protocol/jsc/protocol.json
@@ -48,10 +48,7 @@
"id": "Channel",
"description": "Logging channel.",
"type": "object",
- "properties": [
- { "name": "source", "$ref": "ChannelSource" },
- { "name": "level", "$ref": "ChannelLevel" }
- ]
+ "properties": [{ "name": "source", "$ref": "ChannelSource" }, { "name": "level", "$ref": "ChannelLevel" }]
},
{
"id": "ConsoleMessage",
@@ -1142,10 +1139,7 @@
{
"name": "snapshot",
"description": "Take a heap snapshot.",
- "returns": [
- { "name": "timestamp", "type": "number" },
- { "name": "snapshotData", "$ref": "HeapSnapshotData" }
- ]
+ "returns": [{ "name": "timestamp", "type": "number" }, { "name": "snapshotData", "$ref": "HeapSnapshotData" }]
},
{
"name": "startTracking",
@@ -1235,10 +1229,7 @@
{ "name": "evaluateForTestInFrontend", "parameters": [{ "name": "script", "type": "string" }] },
{
"name": "inspect",
- "parameters": [
- { "name": "object", "$ref": "Runtime.RemoteObject" },
- { "name": "hints", "type": "object" }
- ]
+ "parameters": [{ "name": "object", "$ref": "Runtime.RemoteObject" }, { "name": "hints", "type": "object" }]
}
]
},
diff --git a/packages/bun-inspector-protocol/src/protocol/v8/protocol.json b/packages/bun-inspector-protocol/src/protocol/v8/protocol.json
index d5a7db25e8..5f216d661d 100644
--- a/packages/bun-inspector-protocol/src/protocol/v8/protocol.json
+++ b/packages/bun-inspector-protocol/src/protocol/v8/protocol.json
@@ -1518,10 +1518,7 @@
"id": "EventMetadata",
"description": "A key-value pair for additional event information to pass along.",
"type": "object",
- "properties": [
- { "name": "key", "type": "string" },
- { "name": "value", "type": "string" }
- ]
+ "properties": [{ "name": "key", "type": "string" }, { "name": "value", "type": "string" }]
},
{
"id": "BackgroundServiceEvent",
@@ -1573,10 +1570,7 @@
{
"name": "setRecording",
"description": "Set the recording state for the service.",
- "parameters": [
- { "name": "shouldRecord", "type": "boolean" },
- { "name": "service", "$ref": "ServiceName" }
- ]
+ "parameters": [{ "name": "shouldRecord", "type": "boolean" }, { "name": "service", "$ref": "ServiceName" }]
},
{
"name": "clearEvents",
@@ -1588,10 +1582,7 @@
{
"name": "recordingStateChanged",
"description": "Called when the recording state for the service has been updated.",
- "parameters": [
- { "name": "isRecording", "type": "boolean" },
- { "name": "service", "$ref": "ServiceName" }
- ]
+ "parameters": [{ "name": "isRecording", "type": "boolean" }, { "name": "service", "$ref": "ServiceName" }]
},
{
"name": "backgroundServiceEventReceived",
@@ -2081,10 +2072,7 @@
{
"id": "Header",
"type": "object",
- "properties": [
- { "name": "name", "type": "string" },
- { "name": "value", "type": "string" }
- ]
+ "properties": [{ "name": "name", "type": "string" }, { "name": "value", "type": "string" }]
},
{
"id": "CachedResponse",
@@ -3454,10 +3442,7 @@
{
"name": "setStyleSheetText",
"description": "Sets the new stylesheet text.",
- "parameters": [
- { "name": "styleSheetId", "$ref": "StyleSheetId" },
- { "name": "text", "type": "string" }
- ],
+ "parameters": [{ "name": "styleSheetId", "$ref": "StyleSheetId" }, { "name": "text", "type": "string" }],
"returns": [
{
"name": "sourceMapURL",
@@ -3582,10 +3567,7 @@
},
{
"name": "executeSQL",
- "parameters": [
- { "name": "databaseId", "$ref": "DatabaseId" },
- { "name": "query", "type": "string" }
- ],
+ "parameters": [{ "name": "databaseId", "$ref": "DatabaseId" }, { "name": "query", "type": "string" }],
"returns": [
{ "name": "columnNames", "optional": true, "type": "array", "items": { "type": "string" } },
{ "name": "values", "optional": true, "type": "array", "items": { "type": "any" } },
@@ -3626,10 +3608,7 @@
{
"name": "selectPrompt",
"description": "Select a device in response to a DeviceAccess.deviceRequestPrompted event.",
- "parameters": [
- { "name": "id", "$ref": "RequestId" },
- { "name": "deviceId", "$ref": "DeviceId" }
- ]
+ "parameters": [{ "name": "id", "$ref": "RequestId" }, { "name": "deviceId", "$ref": "DeviceId" }]
},
{
"name": "cancelPrompt",
@@ -5677,10 +5656,7 @@
},
{
"name": "removeDOMStorageItem",
- "parameters": [
- { "name": "storageId", "$ref": "StorageId" },
- { "name": "key", "type": "string" }
- ]
+ "parameters": [{ "name": "storageId", "$ref": "StorageId" }, { "name": "key", "type": "string" }]
},
{
"name": "setDOMStorageItem",
@@ -5702,10 +5678,7 @@
},
{
"name": "domStorageItemRemoved",
- "parameters": [
- { "name": "storageId", "$ref": "StorageId" },
- { "name": "key", "type": "string" }
- ]
+ "parameters": [{ "name": "storageId", "$ref": "StorageId" }, { "name": "key", "type": "string" }]
},
{
"name": "domStorageItemUpdated",
@@ -5775,10 +5748,7 @@
{
"id": "MediaFeature",
"type": "object",
- "properties": [
- { "name": "name", "type": "string" },
- { "name": "value", "type": "string" }
- ]
+ "properties": [{ "name": "name", "type": "string" }, { "name": "value", "type": "string" }]
},
{
"id": "VirtualTimePolicy",
@@ -5792,10 +5762,7 @@
"description": "Used to specify User Agent Cient Hints to emulate. See https://wicg.github.io/ua-client-hints",
"experimental": true,
"type": "object",
- "properties": [
- { "name": "brand", "type": "string" },
- { "name": "version", "type": "string" }
- ]
+ "properties": [{ "name": "brand", "type": "string" }, { "name": "version", "type": "string" }]
},
{
"id": "UserAgentMetadata",
@@ -6153,10 +6120,7 @@
"name": "setSensorOverrideReadings",
"description": "Updates the sensor readings reported by a sensor type previously overriden\nby setSensorOverrideEnabled.",
"experimental": true,
- "parameters": [
- { "name": "type", "$ref": "SensorType" },
- { "name": "reading", "$ref": "SensorReading" }
- ]
+ "parameters": [{ "name": "type", "$ref": "SensorType" }, { "name": "reading", "$ref": "SensorReading" }]
},
{
"name": "setIdleOverride",
@@ -6441,17 +6405,11 @@
{ "name": "disable" },
{
"name": "selectAccount",
- "parameters": [
- { "name": "dialogId", "type": "string" },
- { "name": "accountIndex", "type": "integer" }
- ]
+ "parameters": [{ "name": "dialogId", "type": "string" }, { "name": "accountIndex", "type": "integer" }]
},
{
"name": "clickDialogButton",
- "parameters": [
- { "name": "dialogId", "type": "string" },
- { "name": "dialogButton", "$ref": "DialogButton" }
- ]
+ "parameters": [{ "name": "dialogId", "type": "string" }, { "name": "dialogButton", "$ref": "DialogButton" }]
},
{
"name": "dismissDialog",
@@ -6506,10 +6464,7 @@
"id": "HeaderEntry",
"description": "Response HTTP header entry",
"type": "object",
- "properties": [
- { "name": "name", "type": "string" },
- { "name": "value", "type": "string" }
- ]
+ "properties": [{ "name": "name", "type": "string" }, { "name": "value", "type": "string" }]
},
{
"id": "AuthChallenge",
@@ -8346,28 +8301,19 @@
"id": "PlayerProperty",
"description": "Corresponds to kMediaPropertyChange",
"type": "object",
- "properties": [
- { "name": "name", "type": "string" },
- { "name": "value", "type": "string" }
- ]
+ "properties": [{ "name": "name", "type": "string" }, { "name": "value", "type": "string" }]
},
{
"id": "PlayerEvent",
"description": "Corresponds to kMediaEventTriggered",
"type": "object",
- "properties": [
- { "name": "timestamp", "$ref": "Timestamp" },
- { "name": "value", "type": "string" }
- ]
+ "properties": [{ "name": "timestamp", "$ref": "Timestamp" }, { "name": "value", "type": "string" }]
},
{
"id": "PlayerErrorSourceLocation",
"description": "Represents logged source line numbers reported in an error.\nNOTE: file and line are from chromium c++ implementation code, not js.",
"type": "object",
- "properties": [
- { "name": "file", "type": "string" },
- { "name": "line", "type": "integer" }
- ]
+ "properties": [{ "name": "file", "type": "string" }, { "name": "line", "type": "integer" }]
},
{
"id": "PlayerError",
@@ -12411,10 +12357,7 @@
"description": "Pair of issuer origin and number of available (signed, but not used) Trust\nTokens from that issuer.",
"experimental": true,
"type": "object",
- "properties": [
- { "name": "issuerOrigin", "type": "string" },
- { "name": "count", "type": "number" }
- ]
+ "properties": [{ "name": "issuerOrigin", "type": "string" }, { "name": "count", "type": "number" }]
},
{
"id": "InterestGroupAccessType",
@@ -12477,10 +12420,7 @@
"id": "SharedStorageEntry",
"description": "Struct for a single key-value pair in an origin's shared storage.",
"type": "object",
- "properties": [
- { "name": "key", "type": "string" },
- { "name": "value", "type": "string" }
- ]
+ "properties": [{ "name": "key", "type": "string" }, { "name": "value", "type": "string" }]
},
{
"id": "SharedStorageMetadata",
@@ -12496,10 +12436,7 @@
"id": "SharedStorageReportingMetadata",
"description": "Pair of reporting metadata details for a candidate URL for `selectURL()`.",
"type": "object",
- "properties": [
- { "name": "eventType", "type": "string" },
- { "name": "reportingUrl", "type": "string" }
- ]
+ "properties": [{ "name": "eventType", "type": "string" }, { "name": "reportingUrl", "type": "string" }]
},
{
"id": "SharedStorageUrlWithMetadata",
@@ -12631,10 +12568,7 @@
"id": "AttributionReportingAggregationKeysEntry",
"experimental": true,
"type": "object",
- "properties": [
- { "name": "key", "type": "string" },
- { "name": "value", "$ref": "UnsignedInt128AsBase16" }
- ]
+ "properties": [{ "name": "key", "type": "string" }, { "name": "value", "$ref": "UnsignedInt128AsBase16" }]
},
{
"id": "AttributionReportingEventReportWindows",
@@ -13009,10 +12943,7 @@
"name": "getInterestGroupDetails",
"description": "Gets details for a named interest group.",
"experimental": true,
- "parameters": [
- { "name": "ownerOrigin", "type": "string" },
- { "name": "name", "type": "string" }
- ],
+ "parameters": [{ "name": "ownerOrigin", "type": "string" }, { "name": "name", "type": "string" }],
"returns": [{ "name": "details", "$ref": "InterestGroupDetails" }]
},
{
@@ -13055,10 +12986,7 @@
"name": "deleteSharedStorageEntry",
"description": "Deletes entry for `key` (if it exists) for a given origin's shared storage.",
"experimental": true,
- "parameters": [
- { "name": "ownerOrigin", "type": "string" },
- { "name": "key", "type": "string" }
- ]
+ "parameters": [{ "name": "ownerOrigin", "type": "string" }, { "name": "key", "type": "string" }]
},
{
"name": "clearSharedStorageEntries",
@@ -13082,10 +13010,7 @@
"name": "setStorageBucketTracking",
"description": "Set tracking for a storage key's buckets.",
"experimental": true,
- "parameters": [
- { "name": "storageKey", "type": "string" },
- { "name": "enable", "type": "boolean" }
- ]
+ "parameters": [{ "name": "storageKey", "type": "string" }, { "name": "enable", "type": "boolean" }]
},
{
"name": "deleteStorageBucket",
@@ -13531,10 +13456,7 @@
"id": "RemoteLocation",
"experimental": true,
"type": "object",
- "properties": [
- { "name": "host", "type": "string" },
- { "name": "port", "type": "integer" }
- ]
+ "properties": [{ "name": "host", "type": "string" }, { "name": "port", "type": "integer" }]
}
],
"commands": [
diff --git a/packages/bun-internal-test/resources/packages.json b/packages/bun-internal-test/resources/packages.json
index 49bd248215..ed7b529d5b 100644
--- a/packages/bun-internal-test/resources/packages.json
+++ b/packages/bun-internal-test/resources/packages.json
@@ -79,10 +79,7 @@
"env": {
"NAME": "Bun"
},
- "args": [
- "--jsx-import-source",
- "src/middleware/jsx/jsx-dev-runtime"
- ],
+ "args": ["--jsx-import-source", "src/middleware/jsx/jsx-dev-runtime"],
"path": "runtime_tests/bun/index.test.tsx"
}
},
diff --git a/packages/bun-internal-test/src/runner.node.mjs b/packages/bun-internal-test/src/runner.node.mjs
index 16c5a8aeda..b1b4e3bc6e 100644
--- a/packages/bun-internal-test/src/runner.node.mjs
+++ b/packages/bun-internal-test/src/runner.node.mjs
@@ -381,8 +381,9 @@ if (failing_tests.length) {
report += `${reason}\n\n`;
}
report += "```\n";
- report += output.replace(/\x1b\[[0-9;]*m/g, "")
- .replace(/^::(group|endgroup|error|warning|set-output|add-matcher|remove-matcher).*$/gm, "")
+ report += output
+ .replace(/\x1b\[[0-9;]*m/g, "")
+ .replace(/^::(group|endgroup|error|warning|set-output|add-matcher|remove-matcher).*$/gm, "");
report += "```\n\n";
}
}
@@ -405,10 +406,7 @@ if (ci) {
if (regressions.length > 0) {
action.setFailed(`${regressions.length} regressing tests`);
}
- action.setOutput(
- "regressing_tests",
- regressions.map(({ path }) => `- \`${path}\``).join("\n"),
- );
+ action.setOutput("regressing_tests", regressions.map(({ path }) => `- \`${path}\``).join("\n"));
action.setOutput("regressing_test_count", regressions.length);
} else {
if (failing_tests.length > 0) {
diff --git a/packages/bun-lambda/runtime.ts b/packages/bun-lambda/runtime.ts
index 3f567ec17b..781e9dddb0 100755
--- a/packages/bun-lambda/runtime.ts
+++ b/packages/bun-lambda/runtime.ts
@@ -279,7 +279,7 @@ async function sendResponse(response: unknown): Promise {
}
await fetch(`runtime/invocation/${requestId}/response`, {
method: "POST",
- body: response === null ? null : (typeof response === 'string' ? response : JSON.stringify(response)),
+ body: response === null ? null : typeof response === "string" ? response : JSON.stringify(response),
});
}
@@ -594,8 +594,8 @@ class LambdaServer implements Server {
typeof options.port === "number"
? options.port
: typeof options.port === "string"
- ? parseInt(options.port)
- : this.port;
+ ? parseInt(options.port)
+ : this.port;
this.hostname = options.hostname ?? this.hostname;
this.development = options.development ?? this.development;
}
diff --git a/packages/bun-lambda/scripts/build-layer.ts b/packages/bun-lambda/scripts/build-layer.ts
index b5b2a1db5c..fd930d4883 100644
--- a/packages/bun-lambda/scripts/build-layer.ts
+++ b/packages/bun-lambda/scripts/build-layer.ts
@@ -87,12 +87,13 @@ export class BuildCommand extends Command {
this.log("Saving...", output);
const archiveBuffer = await archive
.generateAsync({
- type: 'blob',
+ type: "blob",
compression: "DEFLATE",
compressionOptions: {
level: 9,
},
- }).then(blob => blob.arrayBuffer());
+ })
+ .then(blob => blob.arrayBuffer());
writeFileSync(output, archiveBuffer);
this.log("Saved");
}
diff --git a/packages/bun-lambda/scripts/publish-layer.ts b/packages/bun-lambda/scripts/publish-layer.ts
index b7129fc50b..7ef22f0202 100644
--- a/packages/bun-lambda/scripts/publish-layer.ts
+++ b/packages/bun-lambda/scripts/publish-layer.ts
@@ -32,54 +32,60 @@ export class PublishCommand extends BuildCommand {
}
const { layer, region, arch, output, public: isPublic } = flags;
if (region.includes("*")) {
- // prettier-ignore
- const result = this.#aws([
- "ec2",
- "describe-regions",
- "--query", "Regions[].RegionName",
- "--output", "json"
- ]);
+ // biome-ignore: format ignore
+ const result = this.#aws(["ec2", "describe-regions", "--query", "Regions[].RegionName", "--output", "json"]);
region.length = 0;
for (const name of JSON.parse(result)) {
region.push(name);
}
} else if (!region.length) {
- // prettier-ignore
- region.push(this.#aws([
- "configure",
- "get",
- "region"
- ]));
+ // biome-ignore: format ignore
+ region.push(this.#aws(["configure", "get", "region"]));
}
this.log("Publishing...");
for (const regionName of region) {
for (const layerName of layer) {
- // prettier-ignore
+ // biome-ignore: format ignore
const result = this.#aws([
"lambda",
"publish-layer-version",
- "--layer-name", layerName,
- "--region", regionName,
- "--description", "Bun is an incredibly fast JavaScript runtime, bundler, transpiler, and package manager.",
- "--license-info", "MIT",
- "--compatible-architectures", arch === "x64" ? "x86_64" : "arm64",
- "--compatible-runtimes", "provided.al2", "provided",
- "--zip-file", `fileb://${output}`,
- "--output", "json",
+ "--layer-name",
+ layerName,
+ "--region",
+ regionName,
+ "--description",
+ "Bun is an incredibly fast JavaScript runtime, bundler, transpiler, and package manager.",
+ "--license-info",
+ "MIT",
+ "--compatible-architectures",
+ arch === "x64" ? "x86_64" : "arm64",
+ "--compatible-runtimes",
+ "provided.al2",
+ "provided",
+ "--zip-file",
+ `fileb://${output}`,
+ "--output",
+ "json",
]);
const { LayerVersionArn } = JSON.parse(result);
this.log("Published", LayerVersionArn);
if (isPublic) {
- // prettier-ignore
+ // biome-ignore: format ignore
this.#aws([
"lambda",
"add-layer-version-permission",
- "--layer-name", layerName,
- "--region", regionName,
- "--version-number", LayerVersionArn.split(":").pop(),
- "--statement-id", `${layerName}-public`,
- "--action", "lambda:GetLayerVersion",
- "--principal", "*",
+ "--layer-name",
+ layerName,
+ "--region",
+ regionName,
+ "--version-number",
+ LayerVersionArn.split(":").pop(),
+ "--statement-id",
+ `${layerName}-public`,
+ "--action",
+ "lambda:GetLayerVersion",
+ "--principal",
+ "*",
]);
}
}
diff --git a/packages/bun-release/scripts/upload-s3.ts b/packages/bun-release/scripts/upload-s3.ts
index b790eac5ca..f25eeeb240 100644
--- a/packages/bun-release/scripts/upload-s3.ts
+++ b/packages/bun-release/scripts/upload-s3.ts
@@ -32,9 +32,7 @@ for (const asset of release.assets) {
const url = asset.browser_download_url;
const response = await fetch(url);
if (!response.ok) {
- throw new Error(
- `Failed to download asset: ${response.status} ${url}`
- );
+ throw new Error(`Failed to download asset: ${response.status} ${url}`);
}
const name = asset.name;
let contentType: string;
@@ -86,9 +84,7 @@ async function uploadToS3({
headers,
});
if (!response.ok) {
- throw new Error(
- `Failed to upload to S3: ${response.status} ${response.statusText}`
- );
+ throw new Error(`Failed to upload to S3: ${response.status} ${response.statusText}`);
}
}
diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts
index 6df8fd0c95..9c3fc0631a 100644
--- a/packages/bun-types/bun.d.ts
+++ b/packages/bun-types/bun.d.ts
@@ -45,10 +45,7 @@ declare module "bun" {
* @param {string} options.PATH Overrides the PATH environment variable
* @param {string} options.cwd Limits the search to a particular directory in which to searc
*/
- function which(
- command: string,
- options?: { PATH?: string; cwd?: string },
- ): string | null;
+ function which(command: string, options?: { PATH?: string; cwd?: string }): string | null;
export type ShellFunction = (input: Uint8Array) => Uint8Array;
@@ -166,10 +163,7 @@ declare module "bun" {
}
export interface Shell {
- (
- strings: TemplateStringsArray,
- ...expressions: ShellExpression[]
- ): ShellPromise;
+ (strings: TemplateStringsArray, ...expressions: ShellExpression[]): ShellPromise;
/**
* Perform bash-like brace expansion on the given pattern.
@@ -488,9 +482,7 @@ declare module "bun" {
* This function is faster because it uses uninitialized memory when copying. Since the entire
* length of the buffer is known, it is safe to use uninitialized memory.
*/
- function concatArrayBuffers(
- buffers: Array,
- ): ArrayBuffer;
+ function concatArrayBuffers(buffers: Array): ArrayBuffer;
/**
* Consume all data from a {@link ReadableStream} until it closes or errors.
@@ -546,10 +538,7 @@ declare module "bun" {
*/
function readableStreamToFormData(
stream: ReadableStream,
- multipartBoundaryExcludingDashes?:
- | string
- | NodeJS.TypedArray
- | ArrayBufferView,
+ multipartBoundaryExcludingDashes?: string | NodeJS.TypedArray | ArrayBufferView,
): Promise;
/**
@@ -578,9 +567,7 @@ declare module "bun" {
* @param stream The stream to consume
* @returns A promise that resolves with the chunks as an array
*/
- function readableStreamToArray(
- stream: ReadableStream,
- ): Promise | T[];
+ function readableStreamToArray(stream: ReadableStream): Promise | T[];
/**
* Escape the following characters in a string:
@@ -618,9 +605,7 @@ declare module "bun" {
interface Peek {
(promise: T | Promise): Promise | T;
- status(
- promise: T | Promise,
- ): "pending" | "fulfilled" | "rejected";
+ status(promise: T | Promise): "pending" | "fulfilled" | "rejected";
}
/**
* Extract the value from the Promise in the same tick of the event loop
@@ -660,9 +645,7 @@ declare module "bun" {
stream?: boolean;
}): void;
- write(
- chunk: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
- ): number;
+ write(chunk: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer): number;
/**
* Flush the internal buffer
*
@@ -804,9 +787,7 @@ declare module "bun" {
*
* If the file descriptor is not writable yet, the data is buffered.
*/
- write(
- chunk: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
- ): number;
+ write(chunk: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer): number;
/**
* Flush the internal buffer, committing the data to disk or the pipe.
*/
@@ -978,35 +959,14 @@ declare module "bun" {
Hash;
interface Hash {
- wyhash: (
- data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
- seed?: bigint,
- ) => bigint;
- adler32: (
- data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
- ) => number;
- crc32: (
- data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
- ) => number;
- cityHash32: (
- data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
- ) => number;
- cityHash64: (
- data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
- seed?: bigint,
- ) => bigint;
- murmur32v3: (
- data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
- seed?: number,
- ) => number;
- murmur32v2: (
- data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
- seed?: number,
- ) => number;
- murmur64v2: (
- data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
- seed?: bigint,
- ) => bigint;
+ wyhash: (data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer, seed?: bigint) => bigint;
+ adler32: (data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer) => number;
+ crc32: (data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer) => number;
+ cityHash32: (data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer) => number;
+ cityHash64: (data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer, seed?: bigint) => bigint;
+ murmur32v3: (data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer, seed?: number) => number;
+ murmur32v2: (data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer, seed?: number) => number;
+ murmur64v2: (data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer, seed?: bigint) => bigint;
}
type JavaScriptLoader = "jsx" | "js" | "ts" | "tsx";
@@ -1187,20 +1147,13 @@ declare module "bun" {
* This function does not resolve imports.
* @param code The code to transpile
*/
- transform(
- code: Bun.StringOrBuffer,
- loader?: JavaScriptLoader,
- ): Promise;
+ transform(code: Bun.StringOrBuffer, loader?: JavaScriptLoader): Promise;
/**
* Transpile code from TypeScript or JSX into valid JavaScript.
* This function does not resolve imports.
* @param code The code to transpile
*/
- transformSync(
- code: Bun.StringOrBuffer,
- loader: JavaScriptLoader,
- ctx: object,
- ): string;
+ transformSync(code: Bun.StringOrBuffer, loader: JavaScriptLoader, ctx: object): string;
/**
* Transpile code from TypeScript or JSX into valid JavaScript.
* This function does not resolve imports.
@@ -1437,10 +1390,7 @@ declare module "bun" {
*
* When using bcrypt, passwords exceeding 72 characters will be SHA512'd before
*/
- algorithm?:
- | Password.AlgorithmLabel
- | Password.Argon2Algorithm
- | Password.BCryptAlgorithm,
+ algorithm?: Password.AlgorithmLabel | Password.Argon2Algorithm | Password.BCryptAlgorithm,
): Promise;
/**
@@ -1525,10 +1475,7 @@ declare module "bun" {
*
* When using bcrypt, passwords exceeding 72 characters will be SHA256'd before
*/
- algorithm?:
- | Password.AlgorithmLabel
- | Password.Argon2Algorithm
- | Password.BCryptAlgorithm,
+ algorithm?: Password.AlgorithmLabel | Password.Argon2Algorithm | Password.BCryptAlgorithm,
): string;
};
@@ -1623,10 +1570,7 @@ declare module "bun" {
* ws.send("Compress this.", true);
* ws.send(new Uint8Array([1, 2, 3, 4]));
*/
- send(
- data: string | Bun.BufferSource,
- compress?: boolean,
- ): ServerWebSocketSendStatus;
+ send(data: string | Bun.BufferSource, compress?: boolean): ServerWebSocketSendStatus;
/**
* Sends a text message to the client.
@@ -1648,10 +1592,7 @@ declare module "bun" {
* ws.send(new TextEncoder().encode("Hello!"));
* ws.send(new Uint8Array([1, 2, 3, 4]), true);
*/
- sendBinary(
- data: Bun.BufferSource,
- compress?: boolean,
- ): ServerWebSocketSendStatus;
+ sendBinary(data: Bun.BufferSource, compress?: boolean): ServerWebSocketSendStatus;
/**
* Closes the connection.
@@ -1703,11 +1644,7 @@ declare module "bun" {
* ws.publish("chat", "Compress this.", true);
* ws.publish("chat", new Uint8Array([1, 2, 3, 4]));
*/
- publish(
- topic: string,
- data: string | Bun.BufferSource,
- compress?: boolean,
- ): ServerWebSocketSendStatus;
+ publish(topic: string, data: string | Bun.BufferSource, compress?: boolean): ServerWebSocketSendStatus;
/**
* Sends a text message to subscribers of the topic.
@@ -1719,11 +1656,7 @@ declare module "bun" {
* ws.publish("chat", "Hello!");
* ws.publish("chat", "Compress this.", true);
*/
- publishText(
- topic: string,
- data: string,
- compress?: boolean,
- ): ServerWebSocketSendStatus;
+ publishText(topic: string, data: string, compress?: boolean): ServerWebSocketSendStatus;
/**
* Sends a binary message to subscribers of the topic.
@@ -1735,11 +1668,7 @@ declare module "bun" {
* ws.publish("chat", new TextEncoder().encode("Hello!"));
* ws.publish("chat", new Uint8Array([1, 2, 3, 4]), true);
*/
- publishBinary(
- topic: string,
- data: Bun.BufferSource,
- compress?: boolean,
- ): ServerWebSocketSendStatus;
+ publishBinary(topic: string, data: Bun.BufferSource, compress?: boolean): ServerWebSocketSendStatus;
/**
* Subscribes a client to the topic.
@@ -1915,10 +1844,7 @@ declare module "bun" {
* @param ws The websocket that sent the message
* @param message The message received
*/
- message(
- ws: ServerWebSocket,
- message: string | Buffer,
- ): void | Promise;
+ message(ws: ServerWebSocket, message: string | Buffer): void | Promise;
/**
* Called when a connection is opened.
@@ -1942,11 +1868,7 @@ declare module "bun" {
* @param code The close code
* @param message The close message
*/
- close?(
- ws: ServerWebSocket,
- code: number,
- reason: string,
- ): void | Promise;
+ close?(ws: ServerWebSocket, code: number, reason: string): void | Promise;
/**
* Called when a ping is sent.
@@ -2061,10 +1983,7 @@ declare module "bun" {
*/
development?: boolean;
- error?: (
- this: Server,
- request: ErrorLike,
- ) => Response | Promise | undefined | Promise;
+ error?: (this: Server, request: ErrorLike) => Response | Promise | undefined | Promise;
/**
* Uniquely identify a server instance with an ID
@@ -2129,11 +2048,7 @@ declare module "bun" {
*
* Respond to {@link Request} objects with a {@link Response} object.
*/
- fetch(
- this: Server,
- request: Request,
- server: Server,
- ): Response | Promise;
+ fetch(this: Server, request: Request, server: Server): Response | Promise;
}
interface UnixServeOptions extends GenericServeOptions {
@@ -2147,15 +2062,10 @@ declare module "bun" {
*
* Respond to {@link Request} objects with a {@link Response} object.
*/
- fetch(
- this: Server,
- request: Request,
- server: Server,
- ): Response | Promise;
+ fetch(this: Server, request: Request, server: Server): Response | Promise;
}
- interface WebSocketServeOptions
- extends GenericServeOptions {
+ interface WebSocketServeOptions extends GenericServeOptions {
/**
* What port should the server listen on?
* @default process.env.PORT || "3000"
@@ -2232,8 +2142,7 @@ declare module "bun" {
): Response | undefined | void | Promise;
}
- interface UnixWebSocketServeOptions
- extends GenericServeOptions {
+ interface UnixWebSocketServeOptions extends GenericServeOptions {
/**
* If set, the HTTP server will listen on a unix socket instead of a port.
* (Cannot be used with hostname+port)
@@ -2283,11 +2192,7 @@ declare module "bun" {
*
* Respond to {@link Request} objects with a {@link Response} object.
*/
- fetch(
- this: Server,
- request: Request,
- server: Server,
- ): Response | undefined | Promise;
+ fetch(this: Server, request: Request, server: Server): Response | undefined | Promise;
}
interface TLSWebSocketServeOptions
@@ -2340,12 +2245,7 @@ declare module "bun" {
* the well-known CAs curated by Mozilla. Mozilla's CAs are completely
* replaced when CAs are explicitly specified using this option.
*/
- ca?:
- | string
- | Buffer
- | BunFile
- | Array
- | undefined;
+ ca?: string | Buffer | BunFile | Array | undefined;
/**
* Cert chains in PEM format. One cert chain should be provided per
* private key. Each cert chain should consist of the PEM formatted
@@ -2357,12 +2257,7 @@ declare module "bun" {
* intermediate certificates are not provided, the peer will not be
* able to validate the certificate, and the handshake will fail.
*/
- cert?:
- | string
- | Buffer
- | BunFile
- | Array
- | undefined;
+ cert?: string | Buffer | BunFile | Array | undefined;
/**
* Private keys in PEM format. PEM allows the option of private keys
* being encrypted. Encrypted keys will be decrypted with
@@ -2373,12 +2268,7 @@ declare module "bun" {
* object.passphrase is optional. Encrypted keys will be decrypted with
* object.passphrase if provided, or options.passphrase if it is not.
*/
- key?:
- | string
- | Buffer
- | BunFile
- | Array
- | undefined;
+ key?: string | Buffer | BunFile | Array | undefined;
/**
* Optionally affect the OpenSSL protocol behavior, which is not
* usually necessary. This should be used carefully if at all! Value is
@@ -2668,10 +2558,7 @@ declare module "bun" {
* @param path The path to the file as a byte buffer (the buffer is copied)
*/
// tslint:disable-next-line:unified-signatures
- function file(
- path: ArrayBufferLike | Uint8Array,
- options?: BlobPropertyBag,
- ): BunFile;
+ function file(path: ArrayBufferLike | Uint8Array, options?: BlobPropertyBag): BunFile;
/**
* [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) powered by the fastest system calls available for operating on files.
@@ -2935,10 +2822,7 @@ declare module "bun" {
*
* @param hashInto `TypedArray` to write the hash into. Faster than creating a new one each time
*/
- static hash(
- input: Bun.BlobOrStringOrBuffer,
- hashInto?: NodeJS.TypedArray,
- ): NodeJS.TypedArray;
+ static hash(input: Bun.BlobOrStringOrBuffer, hashInto?: NodeJS.TypedArray): NodeJS.TypedArray;
/**
* Run the hash over the given data
@@ -2947,10 +2831,7 @@ declare module "bun" {
*
* @param encoding `DigestEncoding` to return the hash in
*/
- static hash(
- input: Bun.BlobOrStringOrBuffer,
- encoding: DigestEncoding,
- ): string;
+ static hash(input: Bun.BlobOrStringOrBuffer, encoding: DigestEncoding): string;
}
type SupportedCryptoAlgorithms =
@@ -2992,10 +2873,7 @@ declare module "bun" {
*
* @param input
*/
- update(
- input: Bun.BlobOrStringOrBuffer,
- inputEncoding?: CryptoEncoding,
- ): CryptoHasher;
+ update(input: Bun.BlobOrStringOrBuffer, inputEncoding?: CryptoEncoding): CryptoHasher;
/**
* Perform a deep copy of the hasher
@@ -3110,10 +2988,7 @@ declare module "bun" {
* openssl sha512-256 /path/to/file
* ```
*/
- function sha(
- input: Bun.StringOrBuffer,
- hashInto?: NodeJS.TypedArray,
- ): NodeJS.TypedArray;
+ function sha(input: Bun.StringOrBuffer, hashInto?: NodeJS.TypedArray): NodeJS.TypedArray;
/**
* Hash `input` using [SHA-2 512/256](https://en.wikipedia.org/wiki/SHA-2#Comparison_of_SHA_functions)
@@ -3283,20 +3158,14 @@ declare module "bun" {
* @param options Compression options to use
* @returns The output buffer with the compressed data
*/
- function deflateSync(
- data: Uint8Array,
- options?: ZlibCompressionOptions,
- ): Uint8Array;
+ function deflateSync(data: Uint8Array, options?: ZlibCompressionOptions): Uint8Array;
/**
* Compresses a chunk of data with `zlib` GZIP algorithm.
* @param data The buffer of data to compress
* @param options Compression options to use
* @returns The output buffer with the compressed data
*/
- function gzipSync(
- data: Uint8Array,
- options?: ZlibCompressionOptions,
- ): Uint8Array;
+ function gzipSync(data: Uint8Array, options?: ZlibCompressionOptions): Uint8Array;
/**
* Decompresses a chunk of data with `zlib` INFLATE algorithm.
* @param data The buffer of data to decompress
@@ -3331,17 +3200,7 @@ declare module "bun" {
| "browser";
/** https://bun.sh/docs/bundler/loaders */
- type Loader =
- | "js"
- | "jsx"
- | "ts"
- | "tsx"
- | "json"
- | "toml"
- | "file"
- | "napi"
- | "wasm"
- | "text";
+ type Loader = "js" | "jsx" | "ts" | "tsx" | "json" | "toml" | "file" | "napi" | "wasm" | "text";
interface PluginConstraints {
/**
@@ -3432,9 +3291,7 @@ declare module "bun" {
}
type OnLoadResult = OnLoadResultSourceCode | OnLoadResultObject | undefined;
- type OnLoadCallback = (
- args: OnLoadArgs,
- ) => OnLoadResult | Promise;
+ type OnLoadCallback = (args: OnLoadArgs) => OnLoadResult | Promise;
interface OnResolveArgs {
/**
@@ -3476,11 +3333,7 @@ declare module "bun" {
type OnResolveCallback = (
args: OnResolveArgs,
- ) =>
- | OnResolveResult
- | Promise
- | undefined
- | null;
+ ) => OnResolveResult | Promise | undefined | null;
interface PluginBuilder {
/**
@@ -3514,10 +3367,7 @@ declare module "bun" {
* });
* ```
*/
- onResolve(
- constraints: PluginConstraints,
- callback: OnResolveCallback,
- ): void;
+ onResolve(constraints: PluginConstraints, callback: OnResolveCallback): void;
/**
* The config object passed to `Bun.build` as is. Can be mutated.
*/
@@ -3549,10 +3399,7 @@ declare module "bun" {
* console.log(foo); // "bar"
* ```
*/
- module(
- specifier: string,
- callback: () => OnLoadResult | Promise,
- ): void;
+ module(specifier: string, callback: () => OnLoadResult | Promise): void;
}
interface BunPlugin {
@@ -3664,11 +3511,7 @@ declare module "bun" {
* will be slow. In the future, Bun will buffer writes and flush them at the
* end of the tick, when the event loop is idle, or sooner if the buffer is full.
*/
- write(
- data: string | Bun.BufferSource,
- byteOffset?: number,
- byteLength?: number,
- ): number;
+ write(data: string | Bun.BufferSource, byteOffset?: number, byteLength?: number): number;
/**
* The data context for the socket.
@@ -3680,11 +3523,7 @@ declare module "bun" {
*
* Use it to send your last message and close the connection.
*/
- end(
- data?: string | Bun.BufferSource,
- byteOffset?: number,
- byteLength?: number,
- ): number;
+ end(data?: string | Bun.BufferSource, byteOffset?: number, byteLength?: number): number;
/**
* Close the socket immediately
@@ -3783,10 +3622,7 @@ declare module "bun" {
}
type BinaryType = keyof BinaryTypeList;
- interface SocketHandler<
- Data = unknown,
- DataBinaryType extends BinaryType = "buffer",
- > {
+ interface SocketHandler {
/**
* Is called when the socket connects, or in case of TLS if no handshake is provided
* this will be called only after handshake
@@ -3795,10 +3631,7 @@ declare module "bun" {
open?(socket: Socket): void | Promise;
close?(socket: Socket): void | Promise;
error?(socket: Socket, error: Error): void | Promise;
- data?(
- socket: Socket,
- data: BinaryTypeList[DataBinaryType],
- ): void | Promise;
+ data?(socket: Socket, data: BinaryTypeList[DataBinaryType]): void | Promise;
drain?(socket: Socket): void | Promise;
/**
@@ -3807,11 +3640,7 @@ declare module "bun" {
* @param success Indicates if the server authorized despite the authorizationError.
* @param authorizationError Certificate Authorization Error or null.
*/
- handshake?(
- socket: Socket,
- success: boolean,
- authorizationError: Error | null,
- ): void;
+ handshake?(socket: Socket, success: boolean, authorizationError: Error | null): void;
/**
* When the socket has been shutdown from the other end, this function is
@@ -3864,15 +3693,13 @@ declare module "bun" {
// port: number;
// }
- interface TCPSocketListenOptions
- extends SocketOptions {
+ interface TCPSocketListenOptions extends SocketOptions {
hostname: string;
port: number;
tls?: TLSOptions;
}
- interface TCPSocketConnectOptions
- extends SocketOptions {
+ interface TCPSocketConnectOptions extends SocketOptions {
hostname: string;
port: number;
tls?: boolean;
@@ -3893,12 +3720,8 @@ declare module "bun" {
* @param options.tls The TLS configuration object
* @param options.unix The unix socket to connect to
*/
- function connect(
- options: TCPSocketConnectOptions,
- ): Promise>;
- function connect(
- options: UnixSocketOptions,
- ): Promise>;
+ function connect(options: TCPSocketConnectOptions): Promise>;
+ function connect(options: UnixSocketOptions): Promise>;
/**
* Create a TCP server that listens on a port
@@ -3911,12 +3734,8 @@ declare module "bun" {
* @param options.tls The TLS configuration object
* @param options.unix The unix socket to connect to
*/
- function listen(
- options: TCPSocketListenOptions,
- ): TCPSocketListener;
- function listen(
- options: UnixSocketOptions,
- ): UnixSocketListener;
+ function listen(options: TCPSocketListenOptions): TCPSocketListener;
+ function listen(options: UnixSocketOptions): UnixSocketListener;
namespace SpawnOptions {
/**
@@ -4086,24 +3905,19 @@ declare module "bun" {
// windowsHide?: boolean;
}
- type OptionsToSubprocess =
- Opts extends OptionsObject
- ? Subprocess<
- // "Writable extends In" means "if In === Writable",
- // aka if true that means the user didn't specify anything
- Writable extends In ? "ignore" : In,
- Readable extends Out ? "pipe" : Out,
- Readable extends Err ? "inherit" : Err
- >
- : Subprocess;
+ type OptionsToSubprocess = Opts extends OptionsObject
+ ? Subprocess<
+ // "Writable extends In" means "if In === Writable",
+ // aka if true that means the user didn't specify anything
+ Writable extends In ? "ignore" : In,
+ Readable extends Out ? "pipe" : Out,
+ Readable extends Err ? "inherit" : Err
+ >
+ : Subprocess;
- type OptionsToSyncSubprocess =
- Opts extends OptionsObject
- ? SyncSubprocess<
- Readable extends Out ? "pipe" : Out,
- Readable extends Err ? "pipe" : Err
- >
- : SyncSubprocess;
+ type OptionsToSyncSubprocess = Opts extends OptionsObject
+ ? SyncSubprocess
+ : SyncSubprocess;
type ReadableIO = ReadableStream | number | undefined;
@@ -4113,9 +3927,7 @@ declare module "bun" {
? number
: undefined;
- type ReadableToSyncIO = X extends "pipe" | undefined
- ? Buffer
- : undefined;
+ type ReadableToSyncIO = X extends "pipe" | undefined ? Buffer : undefined;
type WritableIO = FileSink | number | undefined;
@@ -4600,10 +4412,7 @@ declare module "bun" {
*
* This is sort of like readline() except without the IO.
*/
- function indexOfLine(
- buffer: ArrayBufferView | ArrayBufferLike,
- offset?: number,
- ): number;
+ function indexOfLine(buffer: ArrayBufferView | ArrayBufferLike, offset?: number): number;
/**
* Provides a higher level API for command-line argument parsing than interacting
@@ -4731,9 +4540,7 @@ declare module "bun" {
* }
* ```
*/
- scan(
- optionsOrCwd?: string | GlobScanOptions,
- ): AsyncIterableIterator;
+ scan(optionsOrCwd?: string | GlobScanOptions): AsyncIterableIterator;
/**
* Synchronously scan a root directory recursively for files that match this glob pattern. Returns an iterator.
diff --git a/packages/bun-types/deprecated.d.ts b/packages/bun-types/deprecated.d.ts
index 9cc1d11194..5a90164689 100644
--- a/packages/bun-types/deprecated.d.ts
+++ b/packages/bun-types/deprecated.d.ts
@@ -55,12 +55,7 @@ declare namespace Bun {
interface CustomEvent {
/** @deprecated */
- initCustomEvent(
- type: string,
- bubbles?: boolean,
- cancelable?: boolean,
- detail?: T,
- ): void;
+ initCustomEvent(type: string, bubbles?: boolean, cancelable?: boolean, detail?: T): void;
}
interface DOMException {
diff --git a/packages/bun-types/fetch.d.ts b/packages/bun-types/fetch.d.ts
index b083a5e769..01c53de54d 100644
--- a/packages/bun-types/fetch.d.ts
+++ b/packages/bun-types/fetch.d.ts
@@ -1,13 +1,8 @@
-type _Response = typeof globalThis extends { onmessage: any }
- ? {}
- : import("undici-types").Response;
+type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response;
export interface Response extends _Response {}
export declare class Response {
- constructor(
- body?: Bun.BodyInit | null | undefined,
- init?: Bun.ResponseInit | undefined,
- );
+ constructor(body?: Bun.BodyInit | null | undefined, init?: Bun.ResponseInit | undefined);
/**
* Create a new {@link Response} with a JSON body
diff --git a/packages/bun-types/ffi.d.ts b/packages/bun-types/ffi.d.ts
index 1593d227dd..fb966af01f 100644
--- a/packages/bun-types/ffi.d.ts
+++ b/packages/bun-types/ffi.d.ts
@@ -551,11 +551,7 @@ declare module "bun:ffi" {
close(): void;
}
- type ToFFIType = T extends FFIType
- ? T
- : T extends string
- ? FFITypeStringToType[T]
- : never;
+ type ToFFIType = T extends FFIType ? T : T extends string ? FFITypeStringToType[T] : never;
type ConvertFns = {
[K in keyof Fns]: (
@@ -565,8 +561,7 @@ declare module "bun:ffi" {
[unknown] extends [Fns[K]["args"]]
? []
: never
- ) => // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
- [unknown] extends [Fns[K]["returns"]]
+ ) => [unknown] extends [Fns[K]["returns"]] // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
? undefined
: FFITypeToReturnsType[ToFFIType>];
};
@@ -597,10 +592,7 @@ declare module "bun:ffi" {
* bun uses [tinycc](https://github.com/TinyCC/tinycc), so a big thanks
* goes to Fabrice Bellard and TinyCC maintainers for making this possible.
*/
- function dlopen>(
- name: string,
- symbols: Fns,
- ): Library;
+ function dlopen>(name: string, symbols: Fns): Library;
/**
* Turn a native library's function pointer into a JavaScript function
@@ -686,9 +678,7 @@ declare module "bun:ffi" {
* bun uses [tinycc](https://github.com/TinyCC/tinycc), so a big thanks
* goes to Fabrice Bellard and TinyCC maintainers for making this possible.
*/
- function linkSymbols>(
- symbols: Fns,
- ): Library;
+ function linkSymbols>(symbols: Fns): Library;
/**
* Read a pointer as a {@link Buffer}
@@ -704,11 +694,7 @@ declare module "bun:ffi" {
* reading beyond the bounds of the pointer will crash the program or cause
* undefined behavior. Use with care!
*/
- function toBuffer(
- ptr: Pointer,
- byteOffset?: number,
- byteLength?: number,
- ): Buffer;
+ function toBuffer(ptr: Pointer, byteOffset?: number, byteLength?: number): Buffer;
/**
* Read a pointer as an {@link ArrayBuffer}
@@ -724,11 +710,7 @@ declare module "bun:ffi" {
* reading beyond the bounds of the pointer will crash the program or cause
* undefined behavior. Use with care!
*/
- function toArrayBuffer(
- ptr: Pointer,
- byteOffset?: number,
- byteLength?: number,
- ): ArrayBuffer;
+ function toArrayBuffer(ptr: Pointer, byteOffset?: number, byteLength?: number): ArrayBuffer;
namespace read {
/**
@@ -915,10 +897,7 @@ declare module "bun:ffi" {
* }
* ```
*/
- function ptr(
- view: NodeJS.TypedArray | ArrayBufferLike | DataView,
- byteOffset?: number,
- ): Pointer;
+ function ptr(view: NodeJS.TypedArray | ArrayBufferLike | DataView, byteOffset?: number): Pointer;
/**
* Get a string from a UTF-8 encoded C string
diff --git a/packages/bun-types/globals.d.ts b/packages/bun-types/globals.d.ts
index 56b6eeb4be..9a04c1e1b4 100644
--- a/packages/bun-types/globals.d.ts
+++ b/packages/bun-types/globals.d.ts
@@ -33,9 +33,7 @@ type _Performance = typeof globalThis extends {
? {}
: import("perf_hooks").Performance;
-type _Worker = typeof globalThis extends { onerror: any; Worker: infer T }
- ? T
- : Bun.Worker;
+type _Worker = typeof globalThis extends { onerror: any; Worker: infer T } ? T : Bun.Worker;
type _Event = typeof globalThis extends { onerror: any; Event: any }
? {}
@@ -140,10 +138,7 @@ type _Body = typeof globalThis extends { onerror: any }
};
import type { MessagePort } from "worker_threads";
-import type {
- TextEncoder as NodeTextEncoder,
- TextDecoder as NodeTextDecoder,
-} from "util";
+import type { TextEncoder as NodeTextEncoder, TextDecoder as NodeTextDecoder } from "util";
import type { WebSocket as _WebSocket } from "ws";
declare module "*.txt" {
@@ -201,15 +196,9 @@ declare global {
type TimerHandler = (...args: any[]) => void;
type BufferSource = NodeJS.TypedArray | DataView | ArrayBufferLike;
type DOMHighResTimeStamp = number;
- type EventListenerOrEventListenerObject =
- | EventListener
- | EventListenerObject;
+ type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
- type BlobOrStringOrBuffer =
- | string
- | NodeJS.TypedArray
- | ArrayBufferLike
- | Blob;
+ type BlobOrStringOrBuffer = string | NodeJS.TypedArray | ArrayBufferLike | Blob;
type Platform =
| "aix"
@@ -223,56 +212,23 @@ declare global {
| "win32"
| "cygwin"
| "netbsd";
- type Architecture =
- | "arm"
- | "arm64"
- | "ia32"
- | "mips"
- | "mipsel"
- | "ppc"
- | "ppc64"
- | "s390"
- | "s390x"
- | "x64";
+ type Architecture = "arm" | "arm64" | "ia32" | "mips" | "mipsel" | "ppc" | "ppc64" | "s390" | "s390x" | "x64";
- type UncaughtExceptionListener = (
- error: Error,
- origin: UncaughtExceptionOrigin,
- ) => void;
+ type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void;
/**
* Most of the time the unhandledRejection will be an Error, but this should not be relied upon
* as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error.
*/
- type UnhandledRejectionListener = (
- reason: unknown,
- promise: Promise,
- ) => void;
+ type UnhandledRejectionListener = (reason: unknown, promise: Promise) => void;
- type MultipleResolveListener = (
- type: MultipleResolveType,
- promise: Promise,
- value: unknown,
- ) => void;
+ type MultipleResolveListener = (type: MultipleResolveType, promise: Promise, value: unknown) => void;
- type HeadersInit =
- | Headers
- | Record
- | Array<[string, string]>
- | IterableIterator<[string, string]>;
+ type HeadersInit = Headers | Record | Array<[string, string]> | IterableIterator<[string, string]>;
- type ResponseType =
- | "basic"
- | "cors"
- | "default"
- | "error"
- | "opaque"
- | "opaqueredirect";
+ type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
interface TextEncoder extends NodeTextEncoder {
- new (
- encoding?: Bun.Encoding,
- options?: { fatal?: boolean; ignoreBOM?: boolean },
- ): TextEncoder;
+ new (encoding?: Bun.Encoding, options?: { fatal?: boolean; ignoreBOM?: boolean }): TextEncoder;
/**
* UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object
* containing the read Unicode code units and written UTF-8 bytes.
@@ -286,17 +242,11 @@ declare global {
* @param src The text to encode.
* @param dest The array to hold the encode result.
*/
- encodeInto(
- src?: string,
- dest?: Bun.BufferSource,
- ): import("util").EncodeIntoResult;
+ encodeInto(src?: string, dest?: Bun.BufferSource): import("util").EncodeIntoResult;
}
interface TextDecoder extends NodeTextDecoder {
- new (
- encoding?: Bun.Encoding,
- options?: { fatal?: boolean; ignoreBOM?: boolean },
- ): TextDecoder;
+ new (encoding?: Bun.Encoding, options?: { fatal?: boolean; ignoreBOM?: boolean }): TextDecoder;
}
interface ErrorEventInit extends EventInit {
@@ -416,10 +366,7 @@ declare global {
}
interface EventSource extends EventTarget {
- new (
- url: string | URL,
- eventSourceInitDict?: EventSourceInit,
- ): EventSource;
+ new (url: string | URL, eventSourceInitDict?: EventSourceInit): EventSource;
onerror: ((this: EventSource, ev: Event) => any) | null;
onmessage: ((this: EventSource, ev: MessageEvent) => any) | null;
@@ -485,9 +432,7 @@ declare global {
}
interface TransformerFlushCallback {
- (
- controller: TransformStreamDefaultController,
- ): void | PromiseLike;
+ (controller: TransformStreamDefaultController): void | PromiseLike;
}
interface TransformerStartCallback {
@@ -495,10 +440,7 @@ declare global {
}
interface TransformerTransformCallback {
- (
- chunk: I,
- controller: TransformStreamDefaultController,
- ): void | PromiseLike;
+ (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike;
}
interface UnderlyingSinkAbortCallback {
@@ -514,10 +456,7 @@ declare global {
}
interface UnderlyingSinkWriteCallback {
- (
- chunk: W,
- controller: WritableStreamDefaultController,
- ): void | PromiseLike;
+ (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike;
}
interface UnderlyingSourceCancelCallback {
@@ -545,9 +484,7 @@ declare global {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface DirectUnderlyingSource {
cancel?: UnderlyingSourceCancelCallback;
- pull: (
- controller: ReadableStreamDirectController,
- ) => void | PromiseLike;
+ pull: (controller: ReadableStreamDirectController) => void | PromiseLike;
type: "direct";
}
@@ -647,10 +584,7 @@ declare global {
/**
* If set, specifies the initial value of process.env inside the Worker thread. As a special value, worker.SHARE_ENV may be used to specify that the parent thread and the child thread should share their environment variables; in that case, changes to one thread's process.env object affect the other thread as well. Default: process.env.
*/
- env?:
- | Record
- | (typeof import("node:worker_threads"))["SHARE_ENV"]
- | undefined;
+ env?: Record | typeof import("node:worker_threads")["SHARE_ENV"] | undefined;
/**
* In Bun, this does nothing.
@@ -736,10 +670,7 @@ declare global {
? T
: {
prototype: ReadableStream;
- new (
- underlyingSource?: Bun.UnderlyingSource,
- strategy?: QueuingStrategy,
- ): ReadableStream;
+ new (underlyingSource?: Bun.UnderlyingSource, strategy?: QueuingStrategy): ReadableStream;
new (
underlyingSource?: Bun.DirectUnderlyingSource,
strategy?: QueuingStrategy,
@@ -754,10 +685,7 @@ declare global {
? T
: {
prototype: WritableStream;
- new (
- underlyingSink?: Bun.UnderlyingSink,
- strategy?: QueuingStrategy,
- ): WritableStream;
+ new (underlyingSink?: Bun.UnderlyingSink, strategy?: QueuingStrategy): WritableStream;
};
interface Worker extends _Worker {}
@@ -768,10 +696,7 @@ declare global {
? T
: {
prototype: Worker;
- new (
- scriptURL: string | URL,
- options?: Bun.WorkerOptions | undefined,
- ): Worker;
+ new (scriptURL: string | URL, options?: Bun.WorkerOptions | undefined): Worker;
/**
* This is the cloned value of the `data` property passed to `new Worker()`
*
@@ -867,17 +792,11 @@ declare global {
* @param `name` - The name of the file
* @param `options` - An object containing properties to be added to the [File](https://developer.mozilla.org/en-US/docs/Web/API/File)
*/
- new (
- parts: Bun.BlobPart[],
- name: string,
- options?: BlobPropertyBag & { lastModified?: Date | number },
- ): File;
+ new (parts: Bun.BlobPart[], name: string, options?: BlobPropertyBag & { lastModified?: Date | number }): File;
readonly lastModified: number;
readonly name: string;
}
- var File: typeof globalThis extends { onerror: any; File: infer T }
- ? T
- : typeof File;
+ var File: typeof globalThis extends { onerror: any; File: infer T } ? T : typeof File;
interface FetchRequestInit extends RequestInit {
/**
@@ -1007,10 +926,7 @@ declare global {
*
* @returns A promise that resolves to {@link Response} object.
*/
- function fetch(
- url: string | URL | Request,
- init?: FetchRequestInit,
- ): Promise;
+ function fetch(url: string | URL | Request, init?: FetchRequestInit): Promise;
function queueMicrotask(callback: (...args: any[]) => void): void;
/**
@@ -1052,21 +968,13 @@ declare global {
* @param handler function to call
* @param interval milliseconds to wait between calls
*/
- function setInterval(
- handler: Bun.TimerHandler,
- interval?: number,
- ...arguments: any[]
- ): Timer;
+ function setInterval(handler: Bun.TimerHandler, interval?: number, ...arguments: any[]): Timer;
/**
* Run a function after `timeout` (milliseconds)
* @param handler function to call
* @param timeout milliseconds to wait between calls
*/
- function setTimeout(
- handler: Bun.TimerHandler,
- timeout?: number,
- ...arguments: any[]
- ): Timer;
+ function setTimeout(handler: Bun.TimerHandler, timeout?: number, ...arguments: any[]): Timer;
function addEventListener(
type: K,
@@ -1128,10 +1036,7 @@ declare global {
? T
: {
prototype: MessageEvent;
- new (
- type: string,
- eventInitDict?: Bun.MessageEventInit,
- ): MessageEvent;
+ new (type: string, eventInitDict?: Bun.MessageEventInit): MessageEvent;
};
interface CustomEvent extends Event {
@@ -1141,10 +1046,7 @@ declare global {
var CustomEvent: {
prototype: CustomEvent;
- new (
- type: string,
- eventInitDict?: Bun.CustomEventInit,
- ): CustomEvent;
+ new (type: string, eventInitDict?: Bun.CustomEventInit): CustomEvent;
};
/**
@@ -1174,14 +1076,7 @@ declare global {
: typeof URL;
interface URLSearchParams {
- new (
- init?:
- | string
- | string[][]
- | Record
- | URLSearchParams
- | undefined,
- ): URLSearchParams;
+ new (init?: string | string[][] | Record | URLSearchParams | undefined): URLSearchParams;
toString(): string;
}
var URLSearchParams: typeof globalThis extends {
@@ -1270,9 +1165,7 @@ declare global {
fetch: Promise;
instantiate: Promise;
satisfy: Promise;
- dependencies: Array<
- (typeof Loader)["registry"] extends Map ? V : any
- >;
+ dependencies: Array<(typeof Loader)["registry"] extends Map ? V : any>;
/**
* Your application will probably crash if you mess with this.
*/
@@ -1360,9 +1253,7 @@ declare global {
interface ReadableStreamDirectController {
close(error?: Error): void;
- write(
- data: Bun.BufferSource | ArrayBuffer | string,
- ): number | Promise;
+ write(data: Bun.BufferSource | ArrayBuffer | string): number | Promise;
end(): number | Promise;
flush(): number | Promise;
start(): void;
@@ -1373,16 +1264,13 @@ declare global {
new (): ReadableStreamDefaultController;
};
- interface ReadableStreamDefaultReader
- extends ReadableStreamGenericReader {
+ interface ReadableStreamDefaultReader extends ReadableStreamGenericReader {
read(): Promise>;
/**
* Only available in Bun. If there are multiple chunks in the queue, this will return all of them at the same time.
* Will only return a promise if the data is not immediately available.
*/
- readMany():
- | Promise>
- | Bun.ReadableStreamDefaultReadManyResult;
+ readMany(): Promise> | Bun.ReadableStreamDefaultReadManyResult;
releaseLock(): void;
}
@@ -1641,9 +1529,7 @@ declare global {
*
* @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
*/
- prepareStackTrace?:
- | ((err: Error, stackTraces: NodeJS.CallSite[]) => any)
- | undefined;
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
stackTraceLimit: number;
}
@@ -1690,9 +1576,7 @@ declare global {
* @param arrayLike - The iterable or async iterable to convert to an array.
* @returns A {@link Promise} whose fulfillment is a new {@link Array} instance containing the values from the iterator.
*/
- fromAsync(
- arrayLike: AsyncIterable | Iterable | ArrayLike,
- ): Promise[]>;
+ fromAsync(arrayLike: AsyncIterable | Iterable | ArrayLike): Promise[]>;
/**
* Create an array from an iterable or async iterable object.
@@ -1959,10 +1843,7 @@ declare global {
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone)
*/
- function structuredClone(
- value: T,
- options?: Bun.StructuredSerializeOptions,
- ): T;
+ function structuredClone(value: T, options?: Bun.StructuredSerializeOptions): T;
/**
* Post a message to the parent thread.
diff --git a/packages/bun-types/html-rewriter.d.ts b/packages/bun-types/html-rewriter.d.ts
index f391180a27..44c9951e4d 100644
--- a/packages/bun-types/html-rewriter.d.ts
+++ b/packages/bun-types/html-rewriter.d.ts
@@ -106,13 +106,8 @@ declare namespace HTMLRewriterTypes {
*/
declare class HTMLRewriter {
constructor();
- on(
- selector: string,
- handlers: HTMLRewriterTypes.HTMLRewriterElementContentHandlers,
- ): HTMLRewriter;
- onDocument(
- handlers: HTMLRewriterTypes.HTMLRewriterDocumentContentHandlers,
- ): HTMLRewriter;
+ on(selector: string, handlers: HTMLRewriterTypes.HTMLRewriterElementContentHandlers): HTMLRewriter;
+ onDocument(handlers: HTMLRewriterTypes.HTMLRewriterDocumentContentHandlers): HTMLRewriter;
/**
* @param input - The HTML to transform
* @returns A new {@link Response} with the transformed HTML
diff --git a/packages/bun-types/jsc.d.ts b/packages/bun-types/jsc.d.ts
index a1228b63f0..f29277591f 100644
--- a/packages/bun-types/jsc.d.ts
+++ b/packages/bun-types/jsc.d.ts
@@ -31,9 +31,7 @@ declare module "bun:jsc" {
function isRope(input: string): boolean;
function callerSourceOrigin(): string;
function noFTL(func: (...args: any[]) => any): (...args: any[]) => any;
- function noOSRExitFuzzing(
- func: (...args: any[]) => any,
- ): (...args: any[]) => any;
+ function noOSRExitFuzzing(func: (...args: any[]) => any): (...args: any[]) => any;
function optimizeNextInvocation(func: (...args: any[]) => any): void;
function numberOfDFGCompiles(func: (...args: any[]) => any): number;
function releaseWeakRefs(): void;
@@ -49,10 +47,7 @@ declare module "bun:jsc" {
* @param value A JavaScript value, usually an object or array, to be converted.
* @returns A SharedArrayBuffer that can be sent to another Bun instance.
*/
- function serialize(
- value: any,
- options?: { binaryType?: "arraybuffer" },
- ): SharedArrayBuffer;
+ function serialize(value: any, options?: { binaryType?: "arraybuffer" }): SharedArrayBuffer;
/**
* Convert a JavaScript value to a binary representation that can be sent to another Bun instance.
@@ -62,19 +57,14 @@ declare module "bun:jsc" {
* @param value A JavaScript value, usually an object or array, to be converted.
* @returns A Buffer that can be sent to another Bun instance.
*/
- function serialize(
- value: any,
- options?: { binaryType: "nodebuffer" },
- ): Buffer;
+ function serialize(value: any, options?: { binaryType: "nodebuffer" }): Buffer;
/**
* Convert an ArrayBuffer or Buffer to a JavaScript value compatible with the HTML Structured Clone Algorithm.
*
* @param value A serialized value, usually an ArrayBuffer or Buffer, to be converted.
*/
- function deserialize(
- value: ArrayBufferLike | NodeJS.TypedArray | Buffer,
- ): any;
+ function deserialize(value: ArrayBufferLike | NodeJS.TypedArray | Buffer): any;
/**
* Set the timezone used by Intl, Date, etc.
diff --git a/packages/bun-types/overrides.d.ts b/packages/bun-types/overrides.d.ts
index 48d1fc8292..4c4941ebdd 100644
--- a/packages/bun-types/overrides.d.ts
+++ b/packages/bun-types/overrides.d.ts
@@ -16,20 +16,13 @@ declare module "fs/promises" {
}
declare module "tls" {
- interface BunConnectionOptions
- extends Omit {
+ interface BunConnectionOptions extends Omit {
/**
* Optionally override the trusted CA certificates. Default is to trust
* the well-known CAs curated by Mozilla. Mozilla's CAs are completely
* replaced when CAs are explicitly specified using this option.
*/
- ca?:
- | string
- | Buffer
- | NodeJS.TypedArray
- | BunFile
- | Array
- | undefined;
+ ca?: string | Buffer | NodeJS.TypedArray | BunFile | Array | undefined;
/**
* Cert chains in PEM format. One cert chain should be provided per
* private key. Each cert chain should consist of the PEM formatted
@@ -67,8 +60,5 @@ declare module "tls" {
| undefined;
}
- function connect(
- options: BunConnectionOptions,
- secureConnectListener?: () => void,
- ): TLSSocket;
+ function connect(options: BunConnectionOptions, secureConnectListener?: () => void): TLSSocket;
}
diff --git a/packages/bun-types/package.json b/packages/bun-types/package.json
index 3466f085a2..7f4cc7eeec 100644
--- a/packages/bun-types/package.json
+++ b/packages/bun-types/package.json
@@ -27,7 +27,7 @@
"prebuild": "echo $(pwd)",
"build": "bun scripts/build.ts && bun run fmt",
"test": "tsc",
- "fmt": "echo $(which prettier) && prettier --write './**/*.{ts,tsx,js,jsx}'"
+ "fmt": "echo $(which biome) && biome format --write ."
},
"keywords": [
"bun",
diff --git a/packages/bun-types/scripts/build.ts b/packages/bun-types/scripts/build.ts
index 2a0f8e93b9..e3dacef9f8 100644
--- a/packages/bun-types/scripts/build.ts
+++ b/packages/bun-types/scripts/build.ts
@@ -2,13 +2,6 @@ import { join } from "node:path";
import pkg from "../package.json";
-const BUN_VERSION = (
- process.env.BUN_VERSION ||
- Bun.version ||
- process.versions.bun
-).replace(/^.*v/, "");
+const BUN_VERSION = (process.env.BUN_VERSION || Bun.version || process.versions.bun).replace(/^.*v/, "");
-Bun.write(
- join(import.meta.dir, "..", "package.json"),
- JSON.stringify({ version: BUN_VERSION, ...pkg }, null, 2),
-);
+Bun.write(join(import.meta.dir, "..", "package.json"), JSON.stringify({ version: BUN_VERSION, ...pkg }, null, 2));
diff --git a/packages/bun-types/sqlite.d.ts b/packages/bun-types/sqlite.d.ts
index a336e37b4d..f0ef907e82 100644
--- a/packages/bun-types/sqlite.d.ts
+++ b/packages/bun-types/sqlite.d.ts
@@ -165,17 +165,11 @@ declare module "bun:sqlite" {
* | `bigint` | `INTEGER` |
* | `null` | `NULL` |
*/
- run(
- sqlQuery: string,
- ...bindings: ParamsType[]
- ): void;
+ run(sqlQuery: string, ...bindings: ParamsType[]): void;
/**
This is an alias of {@link Database.prototype.run}
*/
- exec(
- sqlQuery: string,
- ...bindings: ParamsType[]
- ): void;
+ exec(sqlQuery: string, ...bindings: ParamsType[]): void;
/**
* Compile a SQL query and return a {@link Statement} object. This is the
@@ -226,10 +220,7 @@ declare module "bun:sqlite" {
*
* Under the hood, this calls `sqlite3_prepare_v3`.
*/
- prepare<
- ReturnType,
- ParamsType extends SQLQueryBindings | SQLQueryBindings[],
- >(
+ prepare(
sqlQuery: string,
params?: ParamsType,
): // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
@@ -435,10 +426,7 @@ declare module "bun:sqlite" {
* });
* ```
*/
- static deserialize(
- serialized: NodeJS.TypedArray | ArrayBufferLike,
- isReadOnly?: boolean,
- ): Database;
+ static deserialize(serialized: NodeJS.TypedArray | ArrayBufferLike, isReadOnly?: boolean): Database;
}
/**
@@ -467,10 +455,7 @@ declare module "bun:sqlite" {
* // => undefined
* ```
*/
- export class Statement<
- ReturnType = unknown,
- ParamsType extends SQLQueryBindings[] = any[],
- > {
+ export class Statement {
/**
* Creates a new prepared statement from native code.
*
@@ -604,9 +589,7 @@ declare module "bun:sqlite" {
* | `bigint` | `INTEGER` |
* | `null` | `NULL` |
*/
- values(
- ...params: ParamsType
- ): Array>;
+ values(...params: ParamsType): Array>;
/**
* The names of the columns returned by the prepared statement.
@@ -806,10 +789,7 @@ declare module "bun:sqlite" {
| number
| boolean
| null
- | Record<
- string,
- string | bigint | NodeJS.TypedArray | number | boolean | null
- >;
+ | Record;
export default Database;
diff --git a/packages/bun-types/test.d.ts b/packages/bun-types/test.d.ts
index ccd1675b54..50b3e03b39 100644
--- a/packages/bun-types/test.d.ts
+++ b/packages/bun-types/test.d.ts
@@ -98,8 +98,7 @@ declare module "bun:test" {
/**
* Constructs the type of a mock function, e.g. the return type of `jest.fn()`.
*/
- type Mock any = (...args: any[]) => any> =
- JestMock.Mock;
+ type Mock any = (...args: any[]) => any> = JestMock.Mock;
/**
* Wraps a class, function or object type with Jest mock type definitions.
*/
@@ -123,8 +122,7 @@ declare module "bun:test" {
/**
* Constructs the type of a spied class or function.
*/
- type Spied