mirror of
https://github.com/oven-sh/bun
synced 2026-02-07 01:18:51 +00:00
Compare commits
1253 Commits
jarred/sub
...
dylan/gith
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c2a7c6b82 | ||
|
|
766f8ceebc | ||
|
|
32f8cb31be | ||
|
|
297732bbb3 | ||
|
|
90be254373 | ||
|
|
034dd3d03d | ||
|
|
0384d3c558 | ||
|
|
00773e15f1 | ||
|
|
126809f20c | ||
|
|
fbe3f5dfb3 | ||
|
|
29b4c84b8c | ||
|
|
38f9bb96df | ||
|
|
6e0ec3248f | ||
|
|
35d0cf910d | ||
|
|
5cb84231b2 | ||
|
|
bbd4504954 | ||
|
|
a0b44e9873 | ||
|
|
90c395bdac | ||
|
|
c2b7cadd4f | ||
|
|
1a4685213b | ||
|
|
76e6a178e3 | ||
|
|
bb5efb67ab | ||
|
|
4bac561184 | ||
|
|
edf9757650 | ||
|
|
e65def0f82 | ||
|
|
7970704222 | ||
|
|
ced3226ffb | ||
|
|
1c20e05d70 | ||
|
|
c03f7c998d | ||
|
|
4969f068f6 | ||
|
|
beb03c3c54 | ||
|
|
4a1470d26c | ||
|
|
5a3b634982 | ||
|
|
520ecc21ac | ||
|
|
8846ae2454 | ||
|
|
a4c379d316 | ||
|
|
8911c398d9 | ||
|
|
25b080a05e | ||
|
|
1738588f38 | ||
|
|
5e60a9363f | ||
|
|
cd20a84f18 | ||
|
|
e07dd6194a | ||
|
|
bcabf31121 | ||
|
|
5cb6890fad | ||
|
|
f1e6ea2254 | ||
|
|
56a6cf716e | ||
|
|
3517ce8e23 | ||
|
|
3c525b4962 | ||
|
|
e945be72b4 | ||
|
|
3002a7e14f | ||
|
|
c18165b30f | ||
|
|
e18863df1b | ||
|
|
41f23273b0 | ||
|
|
e62a422c14 | ||
|
|
91f7e6c66d | ||
|
|
946424cf86 | ||
|
|
270b07e85e | ||
|
|
b458abedbb | ||
|
|
4ef60da8a9 | ||
|
|
0e7f69f179 | ||
|
|
84ee02cb4b | ||
|
|
7a92bf87c8 | ||
|
|
55c1311aef | ||
|
|
beed35e55e | ||
|
|
5cd37e5e8a | ||
|
|
1761379135 | ||
|
|
30b10d5fb1 | ||
|
|
ca58556c54 | ||
|
|
a1b2c23671 | ||
|
|
5d60aae3b3 | ||
|
|
2392e48e9d | ||
|
|
3386afc0bc | ||
|
|
1a1014525b | ||
|
|
c30a110641 | ||
|
|
ced6201cb0 | ||
|
|
905a3313b5 | ||
|
|
f0475e89c5 | ||
|
|
cb75b4799f | ||
|
|
5f1150442a | ||
|
|
94b6ab02c2 | ||
|
|
631181a503 | ||
|
|
83a5c9f3da | ||
|
|
791f8ab0a1 | ||
|
|
da11bb4a82 | ||
|
|
94409770de | ||
|
|
c505f172b8 | ||
|
|
9972e553a0 | ||
|
|
cdbdc55cbf | ||
|
|
3f472bd511 | ||
|
|
4eb3067ef5 | ||
|
|
3c8701362b | ||
|
|
fadd1c0152 | ||
|
|
1e19d59273 | ||
|
|
cfd42c3999 | ||
|
|
98010efefc | ||
|
|
020f49dcd6 | ||
|
|
1e841a7881 | ||
|
|
b0d1cc1df7 | ||
|
|
0a835ba963 | ||
|
|
2b1b897375 | ||
|
|
87983464d8 | ||
|
|
d5565ab2cd | ||
|
|
8dc811e4aa | ||
|
|
1e1c817603 | ||
|
|
e2ed31b7e7 | ||
|
|
a7d9f16107 | ||
|
|
bbbb4835b4 | ||
|
|
f191993c8f | ||
|
|
994e58b5ea | ||
|
|
59639ba654 | ||
|
|
d22e3ebf9a | ||
|
|
0873a15a63 | ||
|
|
20718b972e | ||
|
|
a951859c55 | ||
|
|
3005d9e348 | ||
|
|
7f96f72d65 | ||
|
|
7550658fab | ||
|
|
80736043d6 | ||
|
|
3b259211df | ||
|
|
6b777c4b0b | ||
|
|
81a6aef771 | ||
|
|
f41bb3fb20 | ||
|
|
e0557d70e3 | ||
|
|
e2231f15e8 | ||
|
|
a19c7b4304 | ||
|
|
4a328609b9 | ||
|
|
021331f154 | ||
|
|
647093ff73 | ||
|
|
7df50add99 | ||
|
|
c99059db9f | ||
|
|
237bcdf99f | ||
|
|
0b395ca1dc | ||
|
|
c1fd06c56d | ||
|
|
f79301c620 | ||
|
|
4ae33cbf45 | ||
|
|
59655d0587 | ||
|
|
7edaf736a2 | ||
|
|
c770db7d52 | ||
|
|
cbc015d8d8 | ||
|
|
18e143ae7b | ||
|
|
8989a1883e | ||
|
|
983b747020 | ||
|
|
1ba95a65ee | ||
|
|
54b8cbd972 | ||
|
|
4eb9e8bb5a | ||
|
|
80c2da73ef | ||
|
|
4ba564dbf1 | ||
|
|
5fc8bc8f04 | ||
|
|
9fd3b5587b | ||
|
|
04b00229cf | ||
|
|
8a29c64302 | ||
|
|
2345e268bc | ||
|
|
97066d034d | ||
|
|
5f24c8a4a8 | ||
|
|
96438a4d58 | ||
|
|
5b3cf8bec5 | ||
|
|
c02b921983 | ||
|
|
0b0aadfc5f | ||
|
|
905aff3cfc | ||
|
|
9e6d39bae6 | ||
|
|
f651f74f9d | ||
|
|
01b908ad64 | ||
|
|
8a2729e75f | ||
|
|
9b3db96308 | ||
|
|
b86915c808 | ||
|
|
be706fecb4 | ||
|
|
2e94d1a033 | ||
|
|
fc6c4bbefb | ||
|
|
2fc6913085 | ||
|
|
f444e628ca | ||
|
|
42be4e52fe | ||
|
|
385c81d67b | ||
|
|
8b0a7b9fb8 | ||
|
|
2c5e1cb7d7 | ||
|
|
7be1e85c6d | ||
|
|
4cc9a43089 | ||
|
|
01c81a5f57 | ||
|
|
85eda20587 | ||
|
|
940ecd05a8 | ||
|
|
7c8a196c76 | ||
|
|
79a2f81447 | ||
|
|
0504bb8984 | ||
|
|
d726a17aca | ||
|
|
33e93e6789 | ||
|
|
c8da2618ee | ||
|
|
8e9af05d6a | ||
|
|
ba0b5baee4 | ||
|
|
384a9cda5e | ||
|
|
97ec866f85 | ||
|
|
ef3c9b7c6d | ||
|
|
6260aaac5f | ||
|
|
d3dab09690 | ||
|
|
f8f8353108 | ||
|
|
66234d9d57 | ||
|
|
3d60b870ee | ||
|
|
3ae23091c6 | ||
|
|
092b86321c | ||
|
|
da07811427 | ||
|
|
c0dd284136 | ||
|
|
504972fa5d | ||
|
|
f78f423d0b | ||
|
|
c4ca4c70d1 | ||
|
|
d94b96d9f4 | ||
|
|
74251fbf5e | ||
|
|
08a738c6c8 | ||
|
|
cc369ad9d0 | ||
|
|
a94bba6399 | ||
|
|
f6a62c01bf | ||
|
|
979074de2b | ||
|
|
958504296d | ||
|
|
75a3c25ff8 | ||
|
|
3da9c728d6 | ||
|
|
85733abe79 | ||
|
|
89625c0cc8 | ||
|
|
2d881b88f9 | ||
|
|
9ef33312b1 | ||
|
|
1d58da3cb3 | ||
|
|
c0dee9adf1 | ||
|
|
afd66c62ff | ||
|
|
57da449442 | ||
|
|
62d1e46b92 | ||
|
|
b988a63429 | ||
|
|
e322dfb589 | ||
|
|
989ac717fc | ||
|
|
3ceb2655d8 | ||
|
|
8c3a2ff6cc | ||
|
|
b9d143c99d | ||
|
|
f40d6bd94d | ||
|
|
4f7d06500c | ||
|
|
f6bbfa7e40 | ||
|
|
435fdbfddc | ||
|
|
83602b6834 | ||
|
|
3b808f5ac5 | ||
|
|
aaf1624346 | ||
|
|
a98e0adc7d | ||
|
|
06487ef64f | ||
|
|
b2fdcad77b | ||
|
|
51f9a91736 | ||
|
|
d7b73dd4fc | ||
|
|
5931e350cd | ||
|
|
e7a14f857d | ||
|
|
79abd245e2 | ||
|
|
2b622162ef | ||
|
|
5a3e0836b1 | ||
|
|
24c4d92c0b | ||
|
|
184c56704b | ||
|
|
feea8824f1 | ||
|
|
028e48ed97 | ||
|
|
609222d05e | ||
|
|
5d91922c5d | ||
|
|
d66831c4f3 | ||
|
|
7f1caaaa44 | ||
|
|
42fc49d413 | ||
|
|
72970ecd15 | ||
|
|
f9b573aa89 | ||
|
|
bbf8a17bf5 | ||
|
|
8c8accf968 | ||
|
|
24be0f4fc5 | ||
|
|
e59c6f642d | ||
|
|
1bdb4b2466 | ||
|
|
ca0ab9508f | ||
|
|
68fd43313d | ||
|
|
b06ca07eee | ||
|
|
01ed3045cb | ||
|
|
6b3be4d821 | ||
|
|
e399bceb3c | ||
|
|
a8fca7d679 | ||
|
|
b249d1b75b | ||
|
|
3495b7c1f8 | ||
|
|
3c20290e49 | ||
|
|
0df3485132 | ||
|
|
3ea983578f | ||
|
|
000a0c9dca | ||
|
|
c1d7ec9564 | ||
|
|
9e909dcae1 | ||
|
|
3c1ad4b568 | ||
|
|
743531b4ac | ||
|
|
d1834b5a92 | ||
|
|
e38a3e5d85 | ||
|
|
6a1fc20835 | ||
|
|
95c747f598 | ||
|
|
65302a1db5 | ||
|
|
c4557e57a1 | ||
|
|
f61d9e340d | ||
|
|
47a2548cbf | ||
|
|
5516adec57 | ||
|
|
4e920d73b7 | ||
|
|
a92258355d | ||
|
|
5bbaa7b400 | ||
|
|
de8ace9fbe | ||
|
|
375f69559f | ||
|
|
7d15a040fd | ||
|
|
3236a99b2d | ||
|
|
18d4cfd4f2 | ||
|
|
6255fe6a4b | ||
|
|
dd9691289f | ||
|
|
e98aae195c | ||
|
|
5741d4f9b4 | ||
|
|
1bed749d8c | ||
|
|
bbe66a4367 | ||
|
|
f649aae36f | ||
|
|
9f9db85a94 | ||
|
|
bbc2dacd84 | ||
|
|
0bb9493e47 | ||
|
|
14efd03b48 | ||
|
|
d5b11be769 | ||
|
|
007133d060 | ||
|
|
6279358cbc | ||
|
|
ca34a09a4d | ||
|
|
b746579863 | ||
|
|
8549134658 | ||
|
|
27e40b0836 | ||
|
|
b57f51fda2 | ||
|
|
fad1742410 | ||
|
|
768f4539e8 | ||
|
|
37b16a9007 | ||
|
|
a2d96f9040 | ||
|
|
b5519af7e7 | ||
|
|
9d94f148dc | ||
|
|
5cf64b07be | ||
|
|
e301fde96d | ||
|
|
2a7687fff8 | ||
|
|
780f7de843 | ||
|
|
660eb46b17 | ||
|
|
c6f3044654 | ||
|
|
b374c67c16 | ||
|
|
ce960f9506 | ||
|
|
ab49f95ef2 | ||
|
|
047754d5dd | ||
|
|
b400dfb386 | ||
|
|
88538b7c2c | ||
|
|
79138c4c7c | ||
|
|
24fbcb8f52 | ||
|
|
51e437e8a0 | ||
|
|
e6c2f48895 | ||
|
|
cf961336d0 | ||
|
|
b44615a916 | ||
|
|
fd740d41e5 | ||
|
|
46a9b124f5 | ||
|
|
7c2180194c | ||
|
|
3150ff49a7 | ||
|
|
2fe5b4da2f | ||
|
|
0b94ccdf8c | ||
|
|
845421c44b | ||
|
|
42ea8b2402 | ||
|
|
a13e64c286 | ||
|
|
60d0e6b73f | ||
|
|
a315ee7e03 | ||
|
|
57672eb266 | ||
|
|
511c0ab386 | ||
|
|
d9306c2681 | ||
|
|
aa17f97d13 | ||
|
|
e547efbf4a | ||
|
|
3d243e5e95 | ||
|
|
5ea8fe8c90 | ||
|
|
84b2cc1739 | ||
|
|
15ce587fa2 | ||
|
|
20a4b72ff4 | ||
|
|
41d778fbfb | ||
|
|
5f3a6f2bf3 | ||
|
|
58185e139a | ||
|
|
51d69d8c85 | ||
|
|
4dd2cb33b7 | ||
|
|
31f025fa02 | ||
|
|
81317a52ea | ||
|
|
7d29782896 | ||
|
|
1aa4cd2f6a | ||
|
|
c7f411bd88 | ||
|
|
60e6a47bb0 | ||
|
|
d9dc15115c | ||
|
|
159ee8ddfc | ||
|
|
84634117a9 | ||
|
|
5ea278e1c6 | ||
|
|
9e29159f44 | ||
|
|
e23832d1ce | ||
|
|
9665d7d216 | ||
|
|
c114956788 | ||
|
|
61bf957b99 | ||
|
|
2cbac4bbdd | ||
|
|
320c23543c | ||
|
|
0ea8de4087 | ||
|
|
7129303347 | ||
|
|
8582bc08ec | ||
|
|
eeea1707a1 | ||
|
|
b7e08cb937 | ||
|
|
054413ba1f | ||
|
|
04dcf180d5 | ||
|
|
79094e6643 | ||
|
|
682af03cdc | ||
|
|
1564f75d06 | ||
|
|
224f980081 | ||
|
|
2369bade48 | ||
|
|
10cd5aaa15 | ||
|
|
f4668e45f8 | ||
|
|
a1e62e6bf9 | ||
|
|
e009be1c5d | ||
|
|
af0bc28c51 | ||
|
|
bb5450fad0 | ||
|
|
5bb8c42bdb | ||
|
|
69114ac0a9 | ||
|
|
8830cbc51e | ||
|
|
23c90a76c2 | ||
|
|
714ce7619d | ||
|
|
34b2e9acc2 | ||
|
|
4c818b9364 | ||
|
|
cee33485d0 | ||
|
|
f052e66df5 | ||
|
|
46e34a3fa9 | ||
|
|
2bcae716d1 | ||
|
|
4281a68a2b | ||
|
|
ab020b2275 | ||
|
|
0617896d70 | ||
|
|
1c3cb22d1f | ||
|
|
275a635ad7 | ||
|
|
35bf039dfb | ||
|
|
de9a2b9fe5 | ||
|
|
201cbb20e4 | ||
|
|
8c51db0879 | ||
|
|
10b04fbd26 | ||
|
|
bdc43c1696 | ||
|
|
bc028168a8 | ||
|
|
00f428b627 | ||
|
|
d28a4dbb00 | ||
|
|
0a30bf0212 | ||
|
|
04658776e4 | ||
|
|
369e9f3fbd | ||
|
|
1b7b37232e | ||
|
|
fe4f39fd17 | ||
|
|
9cc03cd71a | ||
|
|
d9f9fc975b | ||
|
|
bdbc0f23e7 | ||
|
|
ba6908aed7 | ||
|
|
4e6b905a98 | ||
|
|
43f2a8eb85 | ||
|
|
c72629d88a | ||
|
|
33cf491fea | ||
|
|
2f917f7030 | ||
|
|
207282862e | ||
|
|
3c054253e1 | ||
|
|
2c0fd28e72 | ||
|
|
b8586b33da | ||
|
|
beaf91590a | ||
|
|
d84f79bcc1 | ||
|
|
917cbc8d5d | ||
|
|
074f236994 | ||
|
|
03eb000ad6 | ||
|
|
9a184c8279 | ||
|
|
b53a332809 | ||
|
|
a09b515a62 | ||
|
|
8eddfc61a8 | ||
|
|
37525db5cf | ||
|
|
e9eb88355b | ||
|
|
9f5564b4bc | ||
|
|
931ba9ad49 | ||
|
|
851b8acb76 | ||
|
|
7a158e68ae | ||
|
|
cb36b4d1ab | ||
|
|
2621fbf206 | ||
|
|
d7ab2c04ec | ||
|
|
f84f77d1ed | ||
|
|
425f4b0de1 | ||
|
|
7b70ed52fa | ||
|
|
8cf1707cd3 | ||
|
|
9f4d7690ac | ||
|
|
5854d39525 | ||
|
|
b4e6ca0462 | ||
|
|
f408749182 | ||
|
|
92da72beb0 | ||
|
|
a896d6c46c | ||
|
|
4eed310a45 | ||
|
|
1daa61a45f | ||
|
|
03490afdb3 | ||
|
|
e1e5f8c43b | ||
|
|
b655d09387 | ||
|
|
e0503faec7 | ||
|
|
bddf523ac9 | ||
|
|
1506a25198 | ||
|
|
1abc89e391 | ||
|
|
3cb462a3e6 | ||
|
|
f8b87e3ee2 | ||
|
|
e6f055e9fb | ||
|
|
f999bdca26 | ||
|
|
e75ce84c37 | ||
|
|
b631ea7d72 | ||
|
|
7b59d9d97c | ||
|
|
d28247573c | ||
|
|
56884b5f1d | ||
|
|
887496bcf9 | ||
|
|
da43761032 | ||
|
|
4efce63dad | ||
|
|
2a33bd2cc5 | ||
|
|
b337e36da1 | ||
|
|
77d0828179 | ||
|
|
eccd854dbc | ||
|
|
a64f2f5466 | ||
|
|
d3cd753d4d | ||
|
|
f423791e19 | ||
|
|
a6cadce6f6 | ||
|
|
51d0c3b79f | ||
|
|
7672ee95af | ||
|
|
512acf072e | ||
|
|
4ee11d922c | ||
|
|
885049831f | ||
|
|
e5106d320c | ||
|
|
ede2a494bc | ||
|
|
48df99c496 | ||
|
|
ed15259623 | ||
|
|
4272038743 | ||
|
|
002f4ecc9e | ||
|
|
495f25501f | ||
|
|
0992c3867d | ||
|
|
58a78ef8b7 | ||
|
|
740027975b | ||
|
|
706406af48 | ||
|
|
39493e5d94 | ||
|
|
a249c79983 | ||
|
|
6459288c85 | ||
|
|
4726b7e227 | ||
|
|
358f388a46 | ||
|
|
4f35d0537b | ||
|
|
1d9c982488 | ||
|
|
5e6e8ece4e | ||
|
|
964c4037de | ||
|
|
1bc76511ec | ||
|
|
35509126a6 | ||
|
|
8765092591 | ||
|
|
46678c46ee | ||
|
|
e8d948b9d9 | ||
|
|
f891d1df50 | ||
|
|
faad250559 | ||
|
|
74e87b5a8a | ||
|
|
819a63e3ec | ||
|
|
c65c320b09 | ||
|
|
a53ed1bde1 | ||
|
|
d2190ea6f3 | ||
|
|
b7850565f4 | ||
|
|
10996a797a | ||
|
|
949d715a14 | ||
|
|
90388aa7ea | ||
|
|
1671977af7 | ||
|
|
8aec181f16 | ||
|
|
37753e9787 | ||
|
|
8519ff02e6 | ||
|
|
397cb6600b | ||
|
|
bef469ea55 | ||
|
|
ac7ad4d5c6 | ||
|
|
0b27a26edb | ||
|
|
e12dc23c62 | ||
|
|
7fec8a96ab | ||
|
|
14b063d802 | ||
|
|
99fa95b954 | ||
|
|
f27fdf932b | ||
|
|
d0dbafb32f | ||
|
|
b5bd98c0ef | ||
|
|
e851e5fddb | ||
|
|
1aff60d2ba | ||
|
|
d5c81b7423 | ||
|
|
ddb6eced34 | ||
|
|
5c3c50372b | ||
|
|
af0acaff37 | ||
|
|
9090f06612 | ||
|
|
7a193ed243 | ||
|
|
c168c70e60 | ||
|
|
557c2e97d7 | ||
|
|
64871b2bfb | ||
|
|
ce2cdb44e1 | ||
|
|
348ad87013 | ||
|
|
0e900c8ca9 | ||
|
|
61673fa705 | ||
|
|
d1a4f4fd69 | ||
|
|
0b915fed03 | ||
|
|
7b23cb5cd7 | ||
|
|
04328c163b | ||
|
|
5a95fae533 | ||
|
|
47f0e14477 | ||
|
|
0ef25c65ec | ||
|
|
b0c89baac7 | ||
|
|
7bc20c994c | ||
|
|
033b8936c9 | ||
|
|
6336d01743 | ||
|
|
cc062855af | ||
|
|
d68f44d604 | ||
|
|
ffacc1d02d | ||
|
|
1be13fa192 | ||
|
|
46094189f4 | ||
|
|
0c8fe888b9 | ||
|
|
57fcd882fc | ||
|
|
b2e48477db | ||
|
|
e4805d0895 | ||
|
|
e9eaab727b | ||
|
|
2ded9af4f7 | ||
|
|
2aa304a29d | ||
|
|
3419d3bc02 | ||
|
|
a6644eac24 | ||
|
|
6c23035769 | ||
|
|
4a698ed52c | ||
|
|
e1fcc810cb | ||
|
|
6bfb65b312 | ||
|
|
dc330701d2 | ||
|
|
d434370500 | ||
|
|
9806c301dd | ||
|
|
73416ebb62 | ||
|
|
bddf484c2c | ||
|
|
21531f1e80 | ||
|
|
ac36ea51cf | ||
|
|
ae3fcb5bd8 | ||
|
|
5767ad3fc5 | ||
|
|
4f41c3fb40 | ||
|
|
b249ed7257 | ||
|
|
2b4dcc8c81 | ||
|
|
15a5aa1a68 | ||
|
|
3cf229a898 | ||
|
|
e94172255d | ||
|
|
d21aee5143 | ||
|
|
65a56c2560 | ||
|
|
1bd71f2f44 | ||
|
|
fe33073f2e | ||
|
|
14d52897ad | ||
|
|
ca434fba6e | ||
|
|
55f8029dc2 | ||
|
|
a3dc33c133 | ||
|
|
a274ddba3a | ||
|
|
8e36485a76 | ||
|
|
5f2e74bbcc | ||
|
|
ce6fc8609b | ||
|
|
a251669fa1 | ||
|
|
4f6636b3ca | ||
|
|
28a3093d48 | ||
|
|
fe0506b88e | ||
|
|
e78f891acd | ||
|
|
948fdfe482 | ||
|
|
757d19c2f7 | ||
|
|
a4b67ccbff | ||
|
|
1fca6becd3 | ||
|
|
6965b5c192 | ||
|
|
dfa62b660d | ||
|
|
5ff2cd3418 | ||
|
|
f56eec6fa3 | ||
|
|
65330a32cc | ||
|
|
003237b086 | ||
|
|
70f89b1bfc | ||
|
|
4f5f01a748 | ||
|
|
e41d7a0bd5 | ||
|
|
b745ae2667 | ||
|
|
2f1e9b2eb8 | ||
|
|
c68b11e8cb | ||
|
|
16d20bde09 | ||
|
|
bea44d948e | ||
|
|
b230e7a73a | ||
|
|
e024116b77 | ||
|
|
79b6d4734a | ||
|
|
dc26181da4 | ||
|
|
0603991beb | ||
|
|
17fa4211ac | ||
|
|
81a1d8f589 | ||
|
|
055f1e9639 | ||
|
|
cac11ee826 | ||
|
|
f8d9a8be87 | ||
|
|
9c601542d0 | ||
|
|
7c7769a7c7 | ||
|
|
17e8181b4e | ||
|
|
ee939f7a6d | ||
|
|
6cc89eff2c | ||
|
|
d6d04cab24 | ||
|
|
bb95f90a62 | ||
|
|
1806322554 | ||
|
|
38b5a85d8a | ||
|
|
68b55cd855 | ||
|
|
43b4e1b67b | ||
|
|
f3fb712051 | ||
|
|
f6779193c0 | ||
|
|
29f72efac3 | ||
|
|
4985a44fe2 | ||
|
|
6a9bc6f6c2 | ||
|
|
bf6b174233 | ||
|
|
5de98f23bb | ||
|
|
1d02104c51 | ||
|
|
4f22c39651 | ||
|
|
6c01a1191f | ||
|
|
b95f7d5bbc | ||
|
|
c32013dbba | ||
|
|
6cdb7e77dd | ||
|
|
0e7ed4c667 | ||
|
|
3b802c9a13 | ||
|
|
996e5dd235 | ||
|
|
025749027b | ||
|
|
44babb9ce5 | ||
|
|
a63fe2be24 | ||
|
|
bf75f61ddf | ||
|
|
1b608fcc8a | ||
|
|
c4cf38601b | ||
|
|
25fc19e7c6 | ||
|
|
9c3b2f7ad6 | ||
|
|
436b8e1461 | ||
|
|
272e71fec2 | ||
|
|
4ba97c7687 | ||
|
|
3df5843503 | ||
|
|
20eff9f6d2 | ||
|
|
69eedb4c92 | ||
|
|
4a8bbc2216 | ||
|
|
92b766095d | ||
|
|
b18e4064a2 | ||
|
|
58b67347e6 | ||
|
|
1a0fb4cf83 | ||
|
|
6393e1e709 | ||
|
|
a78b6f920d | ||
|
|
7da520b22e | ||
|
|
45dc75b3be | ||
|
|
1cce9da80a | ||
|
|
21bf3ddaf2 | ||
|
|
514f2a8edd | ||
|
|
5f5d74c534 | ||
|
|
b3b70035a1 | ||
|
|
666f5c5ea9 | ||
|
|
55488ad77f | ||
|
|
23fd28afc3 | ||
|
|
f6cb20f516 | ||
|
|
096abc638a | ||
|
|
d3fc1ee7d2 | ||
|
|
cd2bf2591d | ||
|
|
8428bd90a3 | ||
|
|
6872af907c | ||
|
|
dc906ba0c7 | ||
|
|
36b814de57 | ||
|
|
142ad97886 | ||
|
|
cbc3daf739 | ||
|
|
4f91f66a37 | ||
|
|
1671e3cc7e | ||
|
|
24a85f8de6 | ||
|
|
2432150321 | ||
|
|
38141e3aa7 | ||
|
|
5f5ef81f11 | ||
|
|
a1e786011d | ||
|
|
7b4c8802a1 | ||
|
|
dddbce8a41 | ||
|
|
7ce8328d28 | ||
|
|
b62c45fea3 | ||
|
|
7deca69820 | ||
|
|
8753c483ff | ||
|
|
2149e1f0a0 | ||
|
|
c52ebd96ba | ||
|
|
904716f56b | ||
|
|
a858261832 | ||
|
|
9fccbf9364 | ||
|
|
41a023e21d | ||
|
|
cf378d51fd | ||
|
|
7f5022db0c | ||
|
|
9ea025c543 | ||
|
|
477747142a | ||
|
|
29b0e3eaf7 | ||
|
|
9ab21ceb59 | ||
|
|
f7f1b60444 | ||
|
|
da257336b0 | ||
|
|
565996a087 | ||
|
|
fac1c49727 | ||
|
|
3a760ec0ec | ||
|
|
d90a638101 | ||
|
|
047a8d3f0d | ||
|
|
2c4777f579 | ||
|
|
0642cf31f3 | ||
|
|
b1b3f7af54 | ||
|
|
cb41d77d2a | ||
|
|
0fd7d3a8c3 | ||
|
|
8bc459ba99 | ||
|
|
5c312ec0c9 | ||
|
|
bf92c36be1 | ||
|
|
253cb391b3 | ||
|
|
55c262a321 | ||
|
|
af3931371e | ||
|
|
9ccc455f8d | ||
|
|
8b0a3c75cb | ||
|
|
fac4efb9b9 | ||
|
|
f17080df7f | ||
|
|
2077e563b7 | ||
|
|
1604666988 | ||
|
|
6c6e680d91 | ||
|
|
9f222c5ed2 | ||
|
|
3d0b297306 | ||
|
|
ce5cbb0491 | ||
|
|
9bf03a84c1 | ||
|
|
3e9bb6859b | ||
|
|
86f0b08b8d | ||
|
|
38db5f1c83 | ||
|
|
9f10724eda | ||
|
|
bb8c803bdf | ||
|
|
9d167deb10 | ||
|
|
093fe1bae9 | ||
|
|
9dc3fbcfc4 | ||
|
|
be9bab5c29 | ||
|
|
52eac73726 | ||
|
|
f05e23ed20 | ||
|
|
b4abb0f337 | ||
|
|
41c983b386 | ||
|
|
f84b2ec6d1 | ||
|
|
e0cb7e4342 | ||
|
|
204f514633 | ||
|
|
5005188a13 | ||
|
|
8189f78eed | ||
|
|
2eb19a96b1 | ||
|
|
fd26d2e9fa | ||
|
|
370d9c2931 | ||
|
|
c00359a521 | ||
|
|
71d0e14210 | ||
|
|
d925367cae | ||
|
|
179cd18f70 | ||
|
|
072cd5a745 | ||
|
|
c52d9fd1b6 | ||
|
|
e45f72e8e4 | ||
|
|
645cf90335 | ||
|
|
e5b2e3c602 | ||
|
|
897d7bd564 | ||
|
|
07cb04e311 | ||
|
|
b1fcc9e6bf | ||
|
|
1f174b9d95 | ||
|
|
c154402c45 | ||
|
|
17b8056b31 | ||
|
|
40160ec6d6 | ||
|
|
fe92a89b93 | ||
|
|
1cb5a73243 | ||
|
|
70fa1564c2 | ||
|
|
fcd8397db2 | ||
|
|
4688d72945 | ||
|
|
c55f59e030 | ||
|
|
be108c0fea | ||
|
|
4e3fb8ed5b | ||
|
|
9d3f1e0d26 | ||
|
|
88ca7fd738 | ||
|
|
30e1fe1035 | ||
|
|
562595fa02 | ||
|
|
d6520cd761 | ||
|
|
13cfca4814 | ||
|
|
e20461d961 | ||
|
|
d04c0d51fe | ||
|
|
a5b25c5a79 | ||
|
|
6142715c06 | ||
|
|
34e130a3e0 | ||
|
|
09434f1486 | ||
|
|
1a92b92f8a | ||
|
|
fb903bb091 | ||
|
|
34fce03f0f | ||
|
|
bfa40d1d3f | ||
|
|
f829bd7190 | ||
|
|
ab4e662484 | ||
|
|
35ba83584f | ||
|
|
50cf083668 | ||
|
|
dd9325d8c9 | ||
|
|
3b7626aacb | ||
|
|
a9aa3e732c | ||
|
|
ae0ea761ce | ||
|
|
1a3a0adc63 | ||
|
|
006a2f37dd | ||
|
|
65b543fba6 | ||
|
|
b459d09030 | ||
|
|
97fa2702d1 | ||
|
|
4af4d3eeca | ||
|
|
1e0155faf2 | ||
|
|
81033c52fb | ||
|
|
86639fe62a | ||
|
|
54e7a6f57a | ||
|
|
32826119fc | ||
|
|
12f586eeb7 | ||
|
|
f9f169bb9e | ||
|
|
2fe27fdeea | ||
|
|
19afe95cc6 | ||
|
|
af410879cd | ||
|
|
26e32ec1cb | ||
|
|
3a60764f32 | ||
|
|
5398ed52d8 | ||
|
|
6ede31cb04 | ||
|
|
88ddb103f2 | ||
|
|
525d055d4a | ||
|
|
4c8a08d6ba | ||
|
|
280c45c269 | ||
|
|
8bb080fc7c | ||
|
|
619d931568 | ||
|
|
50a3853eb4 | ||
|
|
0bfd00e734 | ||
|
|
0b1d4ff81b | ||
|
|
792ad30a8c | ||
|
|
ed5595f792 | ||
|
|
5c8cbf9806 | ||
|
|
57342459dd | ||
|
|
901c4f57aa | ||
|
|
1c6da5934d | ||
|
|
e5344bfcc5 | ||
|
|
46a85358d7 | ||
|
|
6632135ec0 | ||
|
|
7b73dcf906 | ||
|
|
75b1ef1ef4 | ||
|
|
830f83a44d | ||
|
|
88d6615e4e | ||
|
|
cc1b340cff | ||
|
|
8ccf5a07ca | ||
|
|
10a8c6acdd | ||
|
|
2cd1d44739 | ||
|
|
de536fc953 | ||
|
|
a1456767f7 | ||
|
|
e0feff22c9 | ||
|
|
44ff09015c | ||
|
|
3c45182097 | ||
|
|
c02da2c5a6 | ||
|
|
5cd91fa1a3 | ||
|
|
d21739af1a | ||
|
|
bd372e9cf4 | ||
|
|
afe04aa8bf | ||
|
|
9b2bad8bed | ||
|
|
7622f2e339 | ||
|
|
3d05cb017d | ||
|
|
1c54deab52 | ||
|
|
28d71e2d9f | ||
|
|
02c920f4fd | ||
|
|
1b50ecc52b | ||
|
|
f8ea534f3b | ||
|
|
9aea2f90a5 | ||
|
|
38cc698b4d | ||
|
|
f13f465024 | ||
|
|
e8d6ad6d66 | ||
|
|
434f1bffad | ||
|
|
0b0db78799 | ||
|
|
b3434a8b88 | ||
|
|
223ce77eca | ||
|
|
ec9787770e | ||
|
|
360a007f16 | ||
|
|
76652ac3ca | ||
|
|
14cec299f5 | ||
|
|
55c42f1663 | ||
|
|
85808700c8 | ||
|
|
73fba0c5f1 | ||
|
|
7060008b83 | ||
|
|
ae4f2d63c8 | ||
|
|
9129309f0a | ||
|
|
c987bdcbf9 | ||
|
|
f6a451256f | ||
|
|
71b942b581 | ||
|
|
cd2e9e9dcf | ||
|
|
347309b26f | ||
|
|
8d67870da4 | ||
|
|
04e0583c31 | ||
|
|
c37d0be027 | ||
|
|
4c136cddd7 | ||
|
|
b50dc40fb8 | ||
|
|
6160dc3995 | ||
|
|
a1f40400c1 | ||
|
|
c940f00e2d | ||
|
|
97ccbc189a | ||
|
|
0a2c101c28 | ||
|
|
c526a6bce8 | ||
|
|
da9b2452a7 | ||
|
|
210ae2ffb2 | ||
|
|
9f16906499 | ||
|
|
605c429770 | ||
|
|
b064872d9a | ||
|
|
ff36fa8a53 | ||
|
|
19682b4225 | ||
|
|
536bd72de9 | ||
|
|
87ca9948ec | ||
|
|
57e5c35277 | ||
|
|
8b4c3ec0c7 | ||
|
|
9c7eb75a9a | ||
|
|
b0fe167910 | ||
|
|
6223030360 | ||
|
|
1835e4b9f9 | ||
|
|
8ca49f906a | ||
|
|
dac6c48b1e | ||
|
|
2b0694ec8c | ||
|
|
26bfc4f0a3 | ||
|
|
fbec10758b | ||
|
|
30d43b027f | ||
|
|
693b1c9b23 | ||
|
|
ce0efc37cc | ||
|
|
11c105aa1d | ||
|
|
9167aedcc8 | ||
|
|
fc4c3e3199 | ||
|
|
61a8490c66 | ||
|
|
abd6e496ab | ||
|
|
8e1b2ba32e | ||
|
|
c7fc8fdf96 | ||
|
|
7f4bb93782 | ||
|
|
a10a8e9c70 | ||
|
|
b595ddf20d | ||
|
|
4bd9b20c8a | ||
|
|
9190061ba4 | ||
|
|
41f9fd85f6 | ||
|
|
cdff2697ef | ||
|
|
ca02695993 | ||
|
|
9a2f2a94bf | ||
|
|
e22c245d08 | ||
|
|
171242680d | ||
|
|
5995f2ed71 | ||
|
|
abbde39a02 | ||
|
|
e1a17aff4c | ||
|
|
b8c5646c49 | ||
|
|
62b0b601c2 | ||
|
|
e43b4815b5 | ||
|
|
923d9c1bbb | ||
|
|
e3a6007a76 | ||
|
|
00ae8f79e4 | ||
|
|
dc1330aef5 | ||
|
|
3c1e3792d6 | ||
|
|
603164e66a | ||
|
|
f19b5ce409 | ||
|
|
f356da1b5e | ||
|
|
07a2f80cbc | ||
|
|
2888f43c8a | ||
|
|
697e105ffa | ||
|
|
5d7174d789 | ||
|
|
ab3b072249 | ||
|
|
690e79445d | ||
|
|
bce68bc898 | ||
|
|
94091a7522 | ||
|
|
2852520d90 | ||
|
|
abf3a13433 | ||
|
|
cebd351e61 | ||
|
|
19cff80af8 | ||
|
|
9830e50a29 | ||
|
|
820e6605f8 | ||
|
|
c06bba77d4 | ||
|
|
4ba217bc42 | ||
|
|
a42a9e901c | ||
|
|
3482d76175 | ||
|
|
63c9315b24 | ||
|
|
40126bbe60 | ||
|
|
70615f4036 | ||
|
|
1b1b96aff8 | ||
|
|
de1e963ffa | ||
|
|
a299b1b8e3 | ||
|
|
4cc0eebf4b | ||
|
|
b1e97edc59 | ||
|
|
a56dfe486b | ||
|
|
e9c3529476 | ||
|
|
c9a4bdf44d | ||
|
|
c6fe82018a | ||
|
|
3016723198 | ||
|
|
e453b949dd | ||
|
|
1236e3f59c | ||
|
|
c6d314e954 | ||
|
|
2c548d45f8 | ||
|
|
4c741cc8b6 | ||
|
|
4b5af13ac0 | ||
|
|
35cbfa63a6 | ||
|
|
dd84681d30 | ||
|
|
0a1fca5d7d | ||
|
|
af033c02c5 | ||
|
|
40506e33e7 | ||
|
|
b542921f3d | ||
|
|
b0a7f8df92 | ||
|
|
32e16bda23 | ||
|
|
e32ada318a | ||
|
|
b011610bb3 | ||
|
|
723c7c56dc | ||
|
|
6b7a0c1d3f | ||
|
|
22f7981cff | ||
|
|
ad29d9ffb3 | ||
|
|
8200f43a04 | ||
|
|
3fceae8070 | ||
|
|
8cd8e34719 | ||
|
|
930981c9d9 | ||
|
|
f8b22d51a9 | ||
|
|
2b1b7eb6b3 | ||
|
|
e241e503b7 | ||
|
|
39940ec1f5 | ||
|
|
f725b7e1ab | ||
|
|
da66bed946 | ||
|
|
58fe024aea | ||
|
|
6205cf3fe4 | ||
|
|
fb6c87da07 | ||
|
|
d0fb442c59 | ||
|
|
1c949354c6 | ||
|
|
3a042cdb48 | ||
|
|
a97914fff3 | ||
|
|
ec00838a03 | ||
|
|
860bd53fb3 | ||
|
|
477638435c | ||
|
|
cb384dfa29 | ||
|
|
dd15a98879 | ||
|
|
6b2637468c | ||
|
|
ab4f4bca6d | ||
|
|
73a611a3b9 | ||
|
|
c5333ab597 | ||
|
|
75e8c4699c | ||
|
|
8fcb0ff0b6 | ||
|
|
dbd569d2ab | ||
|
|
40eca63653 | ||
|
|
e7eadcde5a | ||
|
|
36adee4dc8 | ||
|
|
9fe1ad93cb | ||
|
|
8311761c82 | ||
|
|
8702f965a2 | ||
|
|
888a685e26 | ||
|
|
51c1d18e68 | ||
|
|
af6476ca74 | ||
|
|
614d256cb6 | ||
|
|
3867431ed1 | ||
|
|
1f7f5646de | ||
|
|
40623cf967 | ||
|
|
d07e4f8bd1 | ||
|
|
e4bf189e9d | ||
|
|
2292ef8d0e | ||
|
|
a114af4eea | ||
|
|
5152aebde1 | ||
|
|
1310a1d99e | ||
|
|
a20d3eaebb | ||
|
|
3cc61f8e30 | ||
|
|
ef2c9c330c | ||
|
|
5db06105ba | ||
|
|
24433ceb27 | ||
|
|
ff797f7410 | ||
|
|
cef32c1123 | ||
|
|
50d4cedd92 | ||
|
|
27ad376071 | ||
|
|
eebcd30067 | ||
|
|
1afe2f05dc | ||
|
|
170e3117d7 | ||
|
|
fc08e69039 | ||
|
|
25918ddd2a | ||
|
|
edfd2af949 | ||
|
|
dffaeaca1e | ||
|
|
88bdae8218 | ||
|
|
fdfe00452b | ||
|
|
b38d553d60 | ||
|
|
0833275f03 | ||
|
|
4252d015ca | ||
|
|
9fd0072740 | ||
|
|
4dbbdb1671 | ||
|
|
4b5c9acc72 | ||
|
|
b63218206d | ||
|
|
349ccf229b | ||
|
|
85602b406a | ||
|
|
cc6077fbf5 | ||
|
|
495534a054 | ||
|
|
57513f38d3 | ||
|
|
0b3abf2c78 | ||
|
|
9294ef73b7 | ||
|
|
36ec06493e | ||
|
|
6068ad15d4 | ||
|
|
c2c9173eff | ||
|
|
99e7856269 | ||
|
|
1355d415e9 | ||
|
|
410059c9f3 | ||
|
|
80096884f6 | ||
|
|
d2dd2ae306 | ||
|
|
5c3ce875b2 | ||
|
|
6970250b57 | ||
|
|
c880c53199 | ||
|
|
75371d1462 | ||
|
|
2c762f47c9 | ||
|
|
3246efa580 | ||
|
|
4060afb7c7 | ||
|
|
e4d3f51161 | ||
|
|
1777e9d0b1 | ||
|
|
707b454bf4 | ||
|
|
ca4c99b1bf | ||
|
|
a302549d3e | ||
|
|
1a7418e890 | ||
|
|
c1219a3b48 | ||
|
|
632e4ac6ac | ||
|
|
18ae17871d | ||
|
|
09ebb217dd | ||
|
|
dbccfc2b26 | ||
|
|
28f7240dd3 | ||
|
|
9f10956ce1 | ||
|
|
c9a50b2f2d | ||
|
|
d683d7185d | ||
|
|
fc13938fc6 | ||
|
|
f8e8b10e10 | ||
|
|
050292229f | ||
|
|
906e97223a | ||
|
|
dc10b24730 | ||
|
|
d3ef6c330a | ||
|
|
4700762132 | ||
|
|
08d606c3d7 | ||
|
|
ed82b919a0 | ||
|
|
4fa065180b | ||
|
|
cd9b47315c | ||
|
|
062c3948ba | ||
|
|
bff3b902e8 | ||
|
|
3b4900193b | ||
|
|
bab317edd1 | ||
|
|
1dac9248ad | ||
|
|
c57b32fa0c | ||
|
|
43c22b4411 | ||
|
|
bee72be733 | ||
|
|
ea159b6004 | ||
|
|
ac72f28fc8 | ||
|
|
e4e7966d64 | ||
|
|
48cb526e0b | ||
|
|
fd6d28a9fa | ||
|
|
944dc988bf | ||
|
|
2fac218a36 | ||
|
|
16c184efdf | ||
|
|
6b5c49c269 | ||
|
|
af6a43c49b | ||
|
|
18310cfd7c | ||
|
|
9046767da4 | ||
|
|
f70c83345a | ||
|
|
52f5f9545a | ||
|
|
1434fb66d3 | ||
|
|
f325a0016b | ||
|
|
9d7bcac680 | ||
|
|
8d11ab3c35 | ||
|
|
56e491ad8a | ||
|
|
9296a369de | ||
|
|
9050e6ee87 | ||
|
|
84af4f0133 | ||
|
|
6338413696 | ||
|
|
fbec7bda6a | ||
|
|
0f371a2869 | ||
|
|
c30346cf5d | ||
|
|
64ef2389dc | ||
|
|
6ec55cbeeb | ||
|
|
3430cdd91b | ||
|
|
9702568161 | ||
|
|
016a9d6535 | ||
|
|
9f10c1a805 | ||
|
|
7631a47612 | ||
|
|
b8851143f9 | ||
|
|
f3028ff6f3 | ||
|
|
3d35fae890 | ||
|
|
1636291b03 | ||
|
|
e69e8d35b9 | ||
|
|
9438540bf9 | ||
|
|
d34179b9eb | ||
|
|
90074ce98c | ||
|
|
fd0054a800 | ||
|
|
0fb5f15673 | ||
|
|
16929129f0 | ||
|
|
524e48a81d | ||
|
|
76b1a3a88d | ||
|
|
b74351e55f | ||
|
|
a1b4dc42cb | ||
|
|
5ae5125919 | ||
|
|
82a68cd3da | ||
|
|
a41150836a | ||
|
|
e637b43117 | ||
|
|
443ba0f396 | ||
|
|
71ea4a2c9b | ||
|
|
a8ab18bd50 | ||
|
|
ce91423a19 | ||
|
|
5875d1419b | ||
|
|
24a9bc23b7 | ||
|
|
97c3688788 | ||
|
|
0b915b1dd2 | ||
|
|
5fcbfa780f | ||
|
|
a736010fdd | ||
|
|
b733125085 | ||
|
|
5ef36f1b6f | ||
|
|
7cc772cd39 | ||
|
|
7ae73fad68 | ||
|
|
96dcfd3cfe | ||
|
|
9833841101 | ||
|
|
1cd67b62e9 | ||
|
|
ffde9f7842 | ||
|
|
2819509786 |
@@ -1,10 +1,11 @@
|
||||
# Bun's Dev Container
|
||||
|
||||
To get started, login to GitHub and clone bun's GitHub repo into `/workspaces/bun`
|
||||
To get started, login to GitHub and clone bun's GitHub repo into `/build/bun`
|
||||
|
||||
# First time setup
|
||||
|
||||
```bash
|
||||
gh auth login # if it fails to open a browser, use Personal Access Token instead
|
||||
gh repo clone oven-sh/bun . -- --depth=1 --progress -j8
|
||||
```
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
"esbenp.prettier-vscode",
|
||||
"xaver.clang-format"
|
||||
],
|
||||
"postCreateCommand": "cd /build/bun; bash /build/getting-started.sh; code /build/README.md",
|
||||
"postCreateCommand": "cd /build/bun; bash /build/getting-started.sh; cat /build/README.md",
|
||||
|
||||
"build": {
|
||||
"target": "bun.devcontainer",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "To get started, login to GitHub and clone bun's GitHub repo into /workspaces/bun"
|
||||
echo "Make sure to login with a Personal Access Token"
|
||||
echo "To get started, login to GitHub and clone bun's GitHub repo into /build/bun"
|
||||
echo "If it fails to open a browser, login with a Personal Access Token instead"
|
||||
echo "# First time setup"
|
||||
echo "gh auth login"
|
||||
echo "gh repo clone oven-sh/bun . -- --depth=1 --progress -j8"
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
curl -L https://github.com/Jarred-Sumner/vscode-zig/releases/download/march18/zig-0.2.5.vsix >/home/ubuntu/vscode-zig.vsix
|
||||
git clone https://github.com/oven-sh/zls /home/ubuntu/zls
|
||||
curl -L https://github.com/zigtools/zls-vscode/releases/download/1.1.6/zls-vscode-1.1.6.vsix >/home/ubuntu/vscode-zig.vsix
|
||||
git clone https://github.com/zigtools/zls /home/ubuntu/zls
|
||||
cd /home/ubuntu/zls
|
||||
git checkout aabdb0c6ecb3c9a47feff2c2bfb9be4e95adf723
|
||||
git submodule update --init --recursive --progress --depth=1
|
||||
zig build -Drelease-fast
|
||||
|
||||
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -6,3 +6,5 @@ src/bun.js/bindings/sqlite/sqlite3.c linguist-vendored
|
||||
src/bun.js/bindings/sqlite/sqlite3_local.h linguist-vendored
|
||||
*.lockb binary diff=lockb
|
||||
*.zig text eol=lf
|
||||
src/bun.js/bindings/simdutf.cpp linguist-vendored
|
||||
src/bun.js/bindings/simdutf.h linguist-vendored
|
||||
|
||||
44
.github/ISSUE_TEMPLATE/1-bug-report.yml
vendored
44
.github/ISSUE_TEMPLATE/1-bug-report.yml
vendored
@@ -1,44 +0,0 @@
|
||||
name: 🐛 Bug report
|
||||
description: Create a report to help us improve
|
||||
labels: [bug, need repro]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for reporting an issue.
|
||||
|
||||
This issue tracker is for bugs and issues found within bun.
|
||||
If you require more general support please reach out to our [discord server](https://bun.sh/discord).
|
||||
|
||||
Please fill in as much of the following form as you're able.
|
||||
- type: input
|
||||
attributes:
|
||||
label: Version
|
||||
description: Output of `bun -v`
|
||||
- type: input
|
||||
attributes:
|
||||
label: Platform
|
||||
description: |
|
||||
UNIX: output of `uname -a`
|
||||
Windows: output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in PowerShell console
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What steps will reproduce the bug?
|
||||
description: Enter details about your bug, preferably a simple code snippet that can be run using `bun` directly without installing third-party dependencies.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: How often does it reproduce? Is there a required condition?
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What is the expected behavior?
|
||||
description: If possible, please provide textual output instead of screenshots.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What do you see instead?
|
||||
description: If possible, please provide textual output instead of screenshots.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional information
|
||||
description: Tell us anything else you think we should know.
|
||||
35
.github/ISSUE_TEMPLATE/1-install-problem.yml
vendored
Normal file
35
.github/ISSUE_TEMPLATE/1-install-problem.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: 📥 Install Problem
|
||||
description: Report an issue during install or upgrade
|
||||
labels: [bug, install]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for submitting a bug report. It helps make Bun better.
|
||||
|
||||
If you need help or support using Bun, and are not reporting an issue, please
|
||||
join our [Discord](https://discord.gg/CXdq2DP29u) server, where you can ask questions in the [`#help`](https://discord.gg/32EtH6p7HN) forum.
|
||||
|
||||
Please try to include as much information as possible.
|
||||
- type: input
|
||||
attributes:
|
||||
label: What platform is your computer?
|
||||
description: |
|
||||
For MacOS and Linux: copy the output of `uname -mprs`
|
||||
For Windows: copy the output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in the PowerShell console
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: How did you attempt to install or upgrade?
|
||||
description: Please provide the commands you ran to install or upgrade.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What do you see instead?
|
||||
description: If possible, please provide text instead of a screenshot.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional information
|
||||
description: Is there anything else you think we should know?
|
||||
41
.github/ISSUE_TEMPLATE/2-bug-report.yml
vendored
Normal file
41
.github/ISSUE_TEMPLATE/2-bug-report.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: 🐛 Bug Report
|
||||
description: Report an issue that should be fixed
|
||||
labels: [bug]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for submitting a bug report. It helps make Bun better.
|
||||
|
||||
If you need help or support using Bun, and are not reporting a bug, please
|
||||
join our [Discord](https://discord.gg/CXdq2DP29u) server, where you can ask questions in the [`#help`](https://discord.gg/32EtH6p7HN) forum.
|
||||
|
||||
Please try to include as much information as possible.
|
||||
- type: input
|
||||
attributes:
|
||||
label: What version of Bun is running?
|
||||
description: Copy the output of `bun -v`
|
||||
- type: input
|
||||
attributes:
|
||||
label: What platform is your computer?
|
||||
description: |
|
||||
For MacOS and Linux: copy the output of `uname -mprs`
|
||||
For Windows: copy the output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in the PowerShell console
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What steps can reproduce the bug?
|
||||
description: Explain the bug and provide a code snippet that can reproduce it.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What is the expected behavior?
|
||||
description: If possible, please provide text instead of a screenshot.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What do you see instead?
|
||||
description: If possible, please provide text instead of a screenshot.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional information
|
||||
description: Is there anything else you think we should know?
|
||||
25
.github/ISSUE_TEMPLATE/2-feature-request.yml
vendored
25
.github/ISSUE_TEMPLATE/2-feature-request.yml
vendored
@@ -1,25 +0,0 @@
|
||||
name: 🚀 Feature request
|
||||
description: Suggest an idea for this project
|
||||
labels: [enhancement]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for suggesting an idea to make bun better.
|
||||
|
||||
Please fill in as much of the following form as you're able.
|
||||
|
||||
For more information on development, please reach out to our [discord server](https://bun.sh/discord).
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What is the problem this feature will solve?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What is the feature you are proposing to solve the problem?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What alternatives have you considered?
|
||||
@@ -1,18 +0,0 @@
|
||||
name: 📗 Open an issue regarding the bun docs
|
||||
description: Let us know about any problematic documentations
|
||||
labels: [documentation]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for wanting to make bun better!
|
||||
|
||||
Please fill in as much of the following form as you're able.
|
||||
- type: input
|
||||
attributes:
|
||||
label: Affected URL(s)
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description of the problem
|
||||
validations:
|
||||
required: true
|
||||
24
.github/ISSUE_TEMPLATE/3-feature-request.yml
vendored
Normal file
24
.github/ISSUE_TEMPLATE/3-feature-request.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: 🚀 Feature Request
|
||||
description: Suggest an idea, feature, or enhancement
|
||||
labels: [enhancement]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for submitting an idea. It helps make Bun better.
|
||||
|
||||
If you want to discuss Bun, or learn how others are using Bun, please
|
||||
join our [Discord](https://discord.gg/CXdq2DP29u) server, where you can share in the [`#feedback-ideas`](https://discord.gg/unwUnHBNqy) channel.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What is the problem this feature would solve?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What is the feature you are proposing to solve the problem?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What alternatives have you considered?
|
||||
29
.github/ISSUE_TEMPLATE/4-docs-problem.yml
vendored
Normal file
29
.github/ISSUE_TEMPLATE/4-docs-problem.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: 📗 Documentation Request
|
||||
description: Tell us if there is missing or incorrect documentation
|
||||
labels: [documentation]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for submitting a documentation request. It helps make Bun better.
|
||||
|
||||
We are working on moving documentation from the [README](https://github.com/oven-sh/bun#table-of-contents) to a documentation website. Please report as many issues or missing content requests as you can so we can incoperate that in the new documentation.
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: What is the type of issue?
|
||||
multiple: true
|
||||
options:
|
||||
- Documentation is missing
|
||||
- Documentation is incorrect
|
||||
- Documentation is confusing
|
||||
- Example code is not working
|
||||
- Something else
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What is the issue?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Where did you find it?
|
||||
description: If possible, please provide the URL(s) where you found this issue.
|
||||
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +1,5 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Discord server
|
||||
- name: 💬 Ask a Question
|
||||
url: https://discord.com/invite/CXdq2DP29u
|
||||
about: Please visit our Discord server for questions and support requests.
|
||||
about: Join our Discord server for questions, support requests, or just to chat.
|
||||
|
||||
52
.github/labeler.yml
vendored
52
.github/labeler.yml
vendored
@@ -1,52 +0,0 @@
|
||||
chore:
|
||||
- any: ['*', '**/*']
|
||||
all: ['!packages/*', '!packages/**/*', '!src/*', '!src/**/*', '!types/*', '!types/**/*', '!test/*', '!test/**/*', '!bench/*', '!bench/**/*', '!examples/*', '!examples/**/*']
|
||||
|
||||
'packages:bun':
|
||||
- src/*
|
||||
- src/**/*
|
||||
|
||||
'packages:bun-darwin-aarch64':
|
||||
- packages/bun-darwin-aarch64/*
|
||||
- packages/bun-darwin-aarch64/**/*
|
||||
|
||||
'packages:bun-error':
|
||||
- packages/bun-error/*
|
||||
- packages/bun-error/**/*
|
||||
|
||||
'packages:bun-framework-next':
|
||||
- packages/bun-framework-next/*
|
||||
- packages/bun-framework-next/**/*
|
||||
|
||||
'packages:bun-landing':
|
||||
- packages/bun-landing/*
|
||||
- packages/bun-landing/**/*
|
||||
|
||||
'packages:bun-linux-x64':
|
||||
- packages/bun-linux-x64/*
|
||||
- packages/bun-linux-x64/**/*
|
||||
|
||||
'packages:bun-macro-relay':
|
||||
- packages/bun-macro-relay/*
|
||||
- packages/bun-macro-relay/**/*
|
||||
|
||||
'packages:bun-types':
|
||||
- packages/bun-types/*
|
||||
- packages/bun-types/**/*
|
||||
- types/bun/*
|
||||
|
||||
'packages:bun-wasm':
|
||||
- packages/bun-wasm/*
|
||||
- packages/bun-wasm/**/*
|
||||
|
||||
'tests':
|
||||
- test/*
|
||||
- test/**/*
|
||||
|
||||
'benchmarks':
|
||||
- bench/*
|
||||
- bench/**/*
|
||||
|
||||
'templates':
|
||||
- examples/*
|
||||
- examples/**/*
|
||||
66
.github/labels.yml
vendored
66
.github/labels.yml
vendored
@@ -1,66 +0,0 @@
|
||||
- name: 'bug'
|
||||
color: 'd73a4a'
|
||||
- name: 'segfault'
|
||||
color: 'b60205'
|
||||
- name: 'documentation'
|
||||
color: '0075ca'
|
||||
- name: 'duplicate'
|
||||
color: 'cfd3d7'
|
||||
- name: 'wontfix'
|
||||
color: 'cfd3d7'
|
||||
- name: 'question'
|
||||
color: 'd876e3'
|
||||
- name: 'enhancement'
|
||||
color: 'a2eeef'
|
||||
- name: 'good first issue'
|
||||
color: '7057ff'
|
||||
- name: 'help wanted'
|
||||
color: '008672'
|
||||
- name: 'infrastructure'
|
||||
color: '7c5f8a'
|
||||
- name: 'invalid'
|
||||
color: 'e4e669'
|
||||
- name: 'need repro'
|
||||
color: 'c66037'
|
||||
- name: 'node.js'
|
||||
color: '0E8A16'
|
||||
- name: 'napi'
|
||||
color: 'BE05D2'
|
||||
- name: 'esm<>cjs'
|
||||
color: '7dcde3'
|
||||
- name: 'performance'
|
||||
color: 'E99695'
|
||||
- name: 'polyfill'
|
||||
color: 'f9c5e6'
|
||||
- name: 'tracking'
|
||||
color: '5319E7'
|
||||
- name: 'transpiler'
|
||||
color: 'BFDADC'
|
||||
- name: 'typescript'
|
||||
color: '87511b'
|
||||
- name: 'chore'
|
||||
color: 'cfd3d7'
|
||||
- name: 'templates'
|
||||
color: 'FBCA04'
|
||||
- name: 'benchmarks'
|
||||
color: 'FBCA04'
|
||||
- name: 'tests'
|
||||
color: 'FBCA04'
|
||||
- name: 'packages:bun'
|
||||
color: 'FBCA04'
|
||||
- name: 'packages:bun-darwin-aarch64'
|
||||
color: 'FBCA04'
|
||||
- name: 'packages:bun-error'
|
||||
color: 'FBCA04'
|
||||
- name: 'packages:bun-framework-next'
|
||||
color: 'FBCA04'
|
||||
- name: 'packages:bun-landing'
|
||||
color: 'FBCA04'
|
||||
- name: 'packages:bun-linux-x64'
|
||||
color: 'FBCA04'
|
||||
- name: 'packages:bun-macro-relay'
|
||||
color: 'FBCA04'
|
||||
- name: 'packages:bun-types'
|
||||
color: 'FBCA04'
|
||||
- name: 'packages:bun-wasm'
|
||||
color: 'FBCA04'
|
||||
30
.github/workflows/bun-homebrew.yml
vendored
Normal file
30
.github/workflows/bun-homebrew.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: bun-homebrew
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
- edited
|
||||
jobs:
|
||||
homebrew:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'oven-sh' && github.event.release.published_at != null
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: oven-sh/homebrew-bun
|
||||
token: ${{ env.HOMEBREW_TOKEN }}
|
||||
- id: setup-ruby
|
||||
name: Setup Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '2.6'
|
||||
- id: update-tap
|
||||
name: Update Tap
|
||||
run: ruby scripts/release.rb "${{ github.event.release.tag_name }}"
|
||||
- id: commit-tap
|
||||
name: Commit Tap
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: Release ${{ github.event.release.tag_name }}
|
||||
46
.github/workflows/bun-landing.yml
vendored
46
.github/workflows/bun-landing.yml
vendored
@@ -1,46 +0,0 @@
|
||||
name: bun-landing
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- packages/bun-landing/**/*
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: website build
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'oven-sh'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version:
|
||||
- 16
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node ${{ matrix.node }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
|
||||
- name: Install bun
|
||||
uses: xhyrom/setup-bun@v0.1.2
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Install global dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Install package dependencies
|
||||
run: cd packages/bun-landing && bun install
|
||||
|
||||
- name: Build
|
||||
run: cd packages/bun-landing && bun run build.tsx
|
||||
|
||||
- name: Commit changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: build:(landing) automated website build
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
42
.github/workflows/bun-linux-build.yml
vendored
42
.github/workflows/bun-linux-build.yml
vendored
@@ -6,7 +6,8 @@ env:
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, bun-actions]
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "src/**/*"
|
||||
- "test/**/*"
|
||||
@@ -14,7 +15,8 @@ on:
|
||||
- "Makefile"
|
||||
- "Dockerfile"
|
||||
pull_request:
|
||||
branches: [main]
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "src/**/*"
|
||||
- "test/**/*"
|
||||
@@ -37,27 +39,30 @@ jobs:
|
||||
arch: x86_64
|
||||
build_arch: amd64
|
||||
runner: linux-amd64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-linux-amd64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-linux-amd64-lto.tar.gz"
|
||||
webkit_basename: "bun-webkit-linux-amd64-lto"
|
||||
build_machine_arch: x86_64
|
||||
- cpu: westmere
|
||||
tag: linux-x64-baseline
|
||||
arch: x86_64
|
||||
build_arch: amd64
|
||||
runner: linux-amd64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-linux-amd64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-linux-amd64-lto.tar.gz"
|
||||
webkit_basename: "bun-webkit-linux-amd64-lto"
|
||||
build_machine_arch: x86_64
|
||||
- cpu: native
|
||||
tag: linux-aarch64
|
||||
arch: aarch64
|
||||
build_arch: arm64
|
||||
runner: linux-arm64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-linux-arm64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-linux-arm64-lto.tar.gz"
|
||||
webkit_basename: "bun-webkit-linux-arm64-lto"
|
||||
build_machine_arch: aarch64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout submodules
|
||||
run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc)
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: docker/setup-buildx-action@v2
|
||||
id: buildx
|
||||
with:
|
||||
@@ -71,16 +76,19 @@ jobs:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: |
|
||||
mkdir -p /tmp/.buildx-cache-${{matrix.tag}}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
cache-from: type=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.build_arch}}
|
||||
cache-to: type=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.build_arch}},mode=max
|
||||
cache-from: type=local,src=/tmp/.buildx-cache-${{matrix.tag}}
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-${{matrix.tag}}
|
||||
build-args: |
|
||||
ARCH=${{matrix.arch}}
|
||||
BUILDARCH=${{matrix.build_arch}}
|
||||
BUILD_MACHINE_ARCH=${{matrix.build_machine_arch}}
|
||||
CPU_TARGET=${{matrix.cpu}}
|
||||
WEBKIT_URL=${{matrix.webkit_url}}
|
||||
GIT_SHA=${{github.sha}}
|
||||
@@ -122,17 +130,19 @@ jobs:
|
||||
path: ${{runner.temp}}/release/bun-${{matrix.tag}}.zip
|
||||
- name: Release
|
||||
id: release
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: ncipollo/release-action@v1
|
||||
if: github.ref == 'refs/heads/main'
|
||||
with:
|
||||
prerelease: true
|
||||
generate_release_notes: true
|
||||
body: "This is the canary release of Bun that corresponds to the commit [${{ github.sha }}]"
|
||||
body: "This canary release of Bun corresponds to the commit [${{ github.sha }}]"
|
||||
allowUpdates: true
|
||||
replacesArtifacts: true
|
||||
generateReleaseNotes: true
|
||||
artifactErrorsFailBuild: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
name: "Canary (${{github.sha}})"
|
||||
tag_name: "canary"
|
||||
files: |
|
||||
${{runner.temp}}/release/bun-${{matrix.tag}}.zip
|
||||
${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip
|
||||
tag: "canary"
|
||||
artifacts: "${{runner.temp}}/release/bun-${{matrix.tag}}.zip,${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip"
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: bun-obj-${{matrix.tag}}
|
||||
|
||||
91
.github/workflows/bun-mac-aarch64.yml
vendored
91
.github/workflows/bun-mac-aarch64.yml
vendored
@@ -6,7 +6,7 @@ env:
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, bun-actions]
|
||||
branches: [main]
|
||||
paths:
|
||||
- "src/**/*"
|
||||
- "test/**/*"
|
||||
@@ -42,8 +42,8 @@ jobs:
|
||||
tag: bun-obj-darwin-aarch64
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout submodules
|
||||
run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc)
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: docker/setup-buildx-action@v2
|
||||
id: buildx
|
||||
with:
|
||||
@@ -59,21 +59,40 @@ jobs:
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
if: runner.arch == 'X64'
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
tags: ghcr.io/oven-sh/bun-obj:${{github.sha}}-${{matrix.cpu}}-${{matrix.arch}}-macos
|
||||
cache-from: type=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.arch}}-macos
|
||||
cache-to: type=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.arch}}-macos,mode=max
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=min
|
||||
build-args: |
|
||||
ARCH=${{ matrix.arch }}
|
||||
BUILDARCH=amd64
|
||||
BUILD_MACHINE_ARCH=x86_64
|
||||
CPU_TARGET=${{ matrix.cpu }}
|
||||
TRIPLET=${{matrix.arch}}-macos-none
|
||||
GIT_SHA=${{github.sha}}
|
||||
platforms: linux/amd64
|
||||
target: build_release_obj
|
||||
outputs: type=local,dest=${{runner.temp}}/release
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
if: runner.arch == 'ARM64'
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=min
|
||||
build-args: |
|
||||
ARCH=${{ matrix.arch }}
|
||||
BUILDARCH=arm64
|
||||
BUILD_MACHINE_ARCH=aarch64
|
||||
CPU_TARGET=${{ matrix.cpu }}
|
||||
TRIPLET=${{matrix.arch}}-macos-none
|
||||
GIT_SHA=${{github.sha}}
|
||||
platforms: linux/arm64
|
||||
target: build_release_obj
|
||||
outputs: type=local,dest=${{runner.temp}}/release
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.tag }}
|
||||
@@ -91,7 +110,7 @@ jobs:
|
||||
# obj: bun-obj-darwin-x64-baseline
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64-baseline
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: true
|
||||
# compile_obj: false
|
||||
# - cpu: haswell
|
||||
@@ -100,7 +119,7 @@ jobs:
|
||||
# obj: bun-obj-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: true
|
||||
# compile_obj: false
|
||||
# - cpu: westmere
|
||||
@@ -109,7 +128,7 @@ jobs:
|
||||
# obj: bun-obj-darwin-x64-baseline
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64-baseline
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: false
|
||||
# compile_obj: true
|
||||
# - cpu: haswell
|
||||
@@ -118,7 +137,7 @@ jobs:
|
||||
# obj: bun-obj-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: false
|
||||
# compile_obj: true
|
||||
- cpu: native
|
||||
@@ -126,7 +145,7 @@ jobs:
|
||||
tag: bun-darwin-aarch64
|
||||
obj: bun-obj-darwin-aarch64
|
||||
artifact: bun-obj-darwin-aarch64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
runner: macos-arm64
|
||||
dependencies: true
|
||||
compile_obj: true
|
||||
@@ -146,10 +165,16 @@ jobs:
|
||||
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
|
||||
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
|
||||
run: |
|
||||
brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
|
||||
brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
|
||||
echo "export PATH=$(brew --prefix ccache)/bin:\$PATH" >> $GITHUB_ENV
|
||||
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
|
||||
echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV
|
||||
brew link --overwrite llvm@13
|
||||
echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
|
||||
brew link --overwrite llvm@15
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ runner.os }}-ccache-${{ matrix.tag }}
|
||||
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}
|
||||
- name: Download WebKit
|
||||
if: matrix.compile_obj
|
||||
env:
|
||||
@@ -194,7 +219,7 @@ jobs:
|
||||
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
|
||||
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
|
||||
run: |
|
||||
mkdir -p $OBJ_DIR
|
||||
mkdir -p $OBJ_DIR $BUN_DEPS_OUT_DIR
|
||||
make clean-bindings
|
||||
make -j $(sysctl -n hw.ncpu) release-bindings
|
||||
- name: Upload C++
|
||||
@@ -209,7 +234,6 @@ jobs:
|
||||
with:
|
||||
name: ${{ matrix.tag }}-deps
|
||||
path: ${{runner.temp}}/bun-deps
|
||||
|
||||
macOS:
|
||||
name: macOS Link
|
||||
runs-on: ${{ matrix.runner }}
|
||||
@@ -225,7 +249,7 @@ jobs:
|
||||
# package: bun-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64-baseline
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# - cpu: haswell
|
||||
# arch: x86_64
|
||||
# tag: bun-darwin-x64
|
||||
@@ -233,14 +257,14 @@ jobs:
|
||||
# package: bun-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
- cpu: native
|
||||
arch: aarch64
|
||||
tag: bun-darwin-aarch64
|
||||
obj: bun-obj-darwin-aarch64
|
||||
package: bun-darwin-aarch64
|
||||
artifact: bun-obj-darwin-aarch64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
runner: macos-arm64
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -258,10 +282,15 @@ jobs:
|
||||
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
|
||||
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
|
||||
run: |
|
||||
brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
|
||||
brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
|
||||
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
|
||||
echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV
|
||||
brew link --overwrite llvm@13
|
||||
echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
|
||||
brew link --overwrite llvm@15
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ runner.os }}-ccache-${{ matrix.tag }}-link
|
||||
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}-link
|
||||
- name: Download WebKit
|
||||
env:
|
||||
CPU_TARGET: ${{ matrix.cpu }}
|
||||
@@ -304,7 +333,7 @@ jobs:
|
||||
rm -rf packages/${{ matrix.package }}
|
||||
mkdir -p packages/${{ matrix.package }}
|
||||
mv ${{ runner.temp }}/release/* packages/${{ matrix.package }}/
|
||||
make bun-link-lld-release copy-to-bun-release-dir-bin
|
||||
make webcrypto bun-link-lld-release copy-to-bun-release-dir-bin
|
||||
- name: Zip
|
||||
env:
|
||||
CPU_TARGET: ${{ matrix.cpu }}
|
||||
@@ -340,14 +369,16 @@ jobs:
|
||||
path: ${{runner.temp}}/release/${{matrix.tag}}.zip
|
||||
- name: Release
|
||||
id: release
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: ncipollo/release-action@v1
|
||||
if: github.ref == 'refs/heads/main'
|
||||
with:
|
||||
prerelease: true
|
||||
generate_release_notes: true
|
||||
body: "This is the canary release of Bun that corresponds to the commit [${{ github.sha }}]"
|
||||
body: "This canary release of Bun corresponds to the commit [${{ github.sha }}]"
|
||||
allowUpdates: true
|
||||
replacesArtifacts: true
|
||||
generateReleaseNotes: true
|
||||
artifactErrorsFailBuild: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
name: "Canary (${{github.sha}})"
|
||||
tag_name: "canary"
|
||||
files: |
|
||||
${{runner.temp}}/release/${{matrix.tag}}.zip
|
||||
${{runner.temp}}/release/${{matrix.tag}}-profile.zip
|
||||
tag: "canary"
|
||||
artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip"
|
||||
|
||||
100
.github/workflows/bun-mac-x64-baseline.yml
vendored
100
.github/workflows/bun-mac-x64-baseline.yml
vendored
@@ -6,7 +6,7 @@ env:
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, bun-actions]
|
||||
branches: [main]
|
||||
paths:
|
||||
- "src/**/*"
|
||||
- "test/**/*"
|
||||
@@ -42,8 +42,8 @@ jobs:
|
||||
# tag: bun-obj-darwin-aarch64
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout submodules
|
||||
run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc)
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: docker/setup-buildx-action@v2
|
||||
id: buildx
|
||||
with:
|
||||
@@ -59,21 +59,40 @@ jobs:
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
if: runner.arch == 'X64'
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
tags: ghcr.io/oven-sh/bun-obj:${{github.sha}}-${{matrix.cpu}}-${{matrix.arch}}-macos-baseline
|
||||
cache-from: type=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.arch}}-macos-baseline
|
||||
cache-to: type=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.arch}}-macos-baseline,mode=max
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=min
|
||||
build-args: |
|
||||
ARCH=${{ matrix.arch }}
|
||||
BUILDARCH=amd64
|
||||
BUILD_MACHINE_ARCH=x86_64
|
||||
CPU_TARGET=${{ matrix.cpu }}
|
||||
TRIPLET=${{matrix.arch}}-macos-none
|
||||
GIT_SHA=${{github.sha}}
|
||||
platforms: linux/amd64
|
||||
target: build_release_obj
|
||||
outputs: type=local,dest=${{runner.temp}}/release
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
if: runner.arch == 'ARM64'
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=min
|
||||
build-args: |
|
||||
ARCH=${{ matrix.arch }}
|
||||
BUILDARCH=arm64
|
||||
BUILD_MACHINE_ARCH=aarch64
|
||||
CPU_TARGET=${{ matrix.cpu }}
|
||||
TRIPLET=${{matrix.arch}}-macos-none
|
||||
GIT_SHA=${{github.sha}}
|
||||
platforms: linux/arm64
|
||||
target: build_release_obj
|
||||
outputs: type=local,dest=${{runner.temp}}/release
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.tag }}
|
||||
@@ -91,7 +110,7 @@ jobs:
|
||||
obj: bun-obj-darwin-x64-baseline
|
||||
runner: macos-11
|
||||
artifact: bun-obj-darwin-x64-baseline
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
dependencies: true
|
||||
compile_obj: false
|
||||
# - cpu: haswell
|
||||
@@ -100,7 +119,7 @@ jobs:
|
||||
# obj: bun-obj-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: true
|
||||
# compile_obj: false
|
||||
- cpu: westmere
|
||||
@@ -109,7 +128,7 @@ jobs:
|
||||
obj: bun-obj-darwin-x64-baseline
|
||||
runner: macos-11
|
||||
artifact: bun-obj-darwin-x64-baseline
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
dependencies: false
|
||||
compile_obj: true
|
||||
# - cpu: haswell
|
||||
@@ -118,7 +137,7 @@ jobs:
|
||||
# obj: bun-obj-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: false
|
||||
# compile_obj: true
|
||||
# - cpu: native
|
||||
@@ -126,7 +145,7 @@ jobs:
|
||||
# tag: bun-darwin-aarch64
|
||||
# obj: bun-obj-darwin-aarch64
|
||||
# artifact: bun-obj-darwin-aarch64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# runner: macos-arm64
|
||||
# dependencies: true
|
||||
# compile_obj: true
|
||||
@@ -146,10 +165,23 @@ jobs:
|
||||
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
|
||||
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
|
||||
run: |
|
||||
brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
|
||||
brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
|
||||
echo "export PATH=$(brew --prefix ccache)/bin:\$PATH" >> $GITHUB_ENV
|
||||
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
|
||||
echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV
|
||||
brew link --overwrite llvm@13
|
||||
echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
|
||||
brew link --overwrite llvm@15
|
||||
- name: ccache (dependencies)
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
if: matrix.dependencies
|
||||
with:
|
||||
key: ${{ runner.os }}-ccache-${{ matrix.tag }}-dependencies
|
||||
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}-dependencies
|
||||
- name: ccache (c++)
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
if: matrix.compile_obj
|
||||
with:
|
||||
key: ${{ runner.os }}-ccache-${{ matrix.tag }}-obj
|
||||
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}-obj
|
||||
- name: Download WebKit
|
||||
if: matrix.compile_obj
|
||||
env:
|
||||
@@ -175,7 +207,7 @@ jobs:
|
||||
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
|
||||
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
|
||||
run: |
|
||||
mkdir -p $BUN_DEPS_OUT_DIR
|
||||
mkdir -p $OBJ_DIR $BUN_DEPS_OUT_DIR
|
||||
make vendor-without-check
|
||||
- name: Compile C++
|
||||
if: matrix.compile_obj
|
||||
@@ -189,7 +221,7 @@ jobs:
|
||||
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
|
||||
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
|
||||
run: |
|
||||
mkdir -p $OBJ_DIR
|
||||
mkdir -p $OBJ_DIR $BUN_DEPS_OUT_DIR
|
||||
make -j $(sysctl -n hw.ncpu) release-bindings
|
||||
- name: Upload C++
|
||||
if: matrix.compile_obj
|
||||
@@ -203,7 +235,6 @@ jobs:
|
||||
with:
|
||||
name: ${{ matrix.tag }}-deps
|
||||
path: ${{runner.temp}}/bun-deps
|
||||
|
||||
macOS:
|
||||
name: macOS Link
|
||||
runs-on: ${{ matrix.runner }}
|
||||
@@ -219,7 +250,7 @@ jobs:
|
||||
package: bun-darwin-x64
|
||||
runner: macos-11
|
||||
artifact: bun-obj-darwin-x64-baseline
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# - cpu: haswell
|
||||
# arch: x86_64
|
||||
# tag: bun-darwin-x64
|
||||
@@ -227,14 +258,14 @@ jobs:
|
||||
# package: bun-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# - cpu: native
|
||||
# arch: aarch64
|
||||
# tag: bun-darwin-aarch64
|
||||
# obj: bun-obj-darwin-aarch64
|
||||
# package: bun-darwin-aarch64
|
||||
# artifact: bun-obj-darwin-aarch64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# runner: macos-arm64
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -252,10 +283,15 @@ jobs:
|
||||
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
|
||||
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
|
||||
run: |
|
||||
brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
|
||||
brew install ccache rust llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
|
||||
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
|
||||
echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV
|
||||
brew link --overwrite llvm@13
|
||||
echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
|
||||
brew link --overwrite llvm@15
|
||||
- name: ccache (link)
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ runner.os }}-ccache-${{ matrix.tag }}-link
|
||||
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}-link
|
||||
- name: Download WebKit
|
||||
env:
|
||||
CPU_TARGET: ${{ matrix.cpu }}
|
||||
@@ -301,7 +337,7 @@ jobs:
|
||||
rm -rf packages/${{ matrix.package }}
|
||||
mkdir -p packages/${{ matrix.package }}
|
||||
mv ${{ runner.temp }}/release/* packages/${{ matrix.package }}/
|
||||
make bun-link-lld-release copy-to-bun-release-dir-bin
|
||||
make webcrypto bun-link-lld-release copy-to-bun-release-dir-bin
|
||||
- name: Zip
|
||||
env:
|
||||
CPU_TARGET: ${{ matrix.cpu }}
|
||||
@@ -337,14 +373,16 @@ jobs:
|
||||
path: ${{runner.temp}}/release/${{matrix.tag}}.zip
|
||||
- name: Release
|
||||
id: release
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: ncipollo/release-action@v1
|
||||
if: github.ref == 'refs/heads/main'
|
||||
with:
|
||||
prerelease: true
|
||||
generate_release_notes: true
|
||||
body: "This is the canary release of Bun that corresponds to the commit [${{ github.sha }}]"
|
||||
body: "This canary release of Bun corresponds to the commit [${{ github.sha }}]"
|
||||
allowUpdates: true
|
||||
replacesArtifacts: true
|
||||
generateReleaseNotes: true
|
||||
artifactErrorsFailBuild: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
name: "Canary (${{github.sha}})"
|
||||
tag_name: "canary"
|
||||
files: |
|
||||
${{runner.temp}}/release/${{matrix.tag}}.zip
|
||||
${{runner.temp}}/release/${{matrix.tag}}-profile.zip
|
||||
tag: "canary"
|
||||
artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip"
|
||||
|
||||
98
.github/workflows/bun-mac-x64.yml
vendored
98
.github/workflows/bun-mac-x64.yml
vendored
@@ -6,7 +6,7 @@ env:
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, bun-actions]
|
||||
branches: [main]
|
||||
paths:
|
||||
- "src/**/*"
|
||||
- "test/**/*"
|
||||
@@ -42,8 +42,8 @@ jobs:
|
||||
# tag: bun-obj-darwin-aarch64
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout submodules
|
||||
run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc)
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: docker/setup-buildx-action@v2
|
||||
id: buildx
|
||||
with:
|
||||
@@ -59,21 +59,40 @@ jobs:
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
if: runner.arch == 'X64'
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
tags: ghcr.io/oven-sh/bun-obj:${{github.sha}}-${{matrix.cpu}}-${{matrix.arch}}-macos
|
||||
cache-from: type=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.arch}}-macos
|
||||
cache-to: type=registry,ref=ghcr.io/oven-sh/bun-obj:buildcache-bust-3--${{matrix.cpu}}-${{matrix.arch}}-macos,mode=max
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=min
|
||||
build-args: |
|
||||
ARCH=${{ matrix.arch }}
|
||||
BUILDARCH=amd64
|
||||
BUILD_MACHINE_ARCH=x86_64
|
||||
CPU_TARGET=${{ matrix.cpu }}
|
||||
TRIPLET=${{matrix.arch}}-macos-none
|
||||
GIT_SHA=${{github.sha}}
|
||||
platforms: linux/amd64
|
||||
target: build_release_obj
|
||||
outputs: type=local,dest=${{runner.temp}}/release
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
if: runner.arch == 'ARM64'
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=min
|
||||
build-args: |
|
||||
ARCH=${{ matrix.arch }}
|
||||
BUILDARCH=arm64
|
||||
BUILD_MACHINE_ARCH=aarch64
|
||||
CPU_TARGET=${{ matrix.cpu }}
|
||||
TRIPLET=${{matrix.arch}}-macos-none
|
||||
GIT_SHA=${{github.sha}}
|
||||
platforms: linux/arm64
|
||||
target: build_release_obj
|
||||
outputs: type=local,dest=${{runner.temp}}/release
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.tag }}
|
||||
@@ -91,7 +110,7 @@ jobs:
|
||||
# obj: bun-obj-darwin-x64-baseline
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64-baseline
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: true
|
||||
# compile_obj: false
|
||||
- cpu: haswell
|
||||
@@ -100,7 +119,7 @@ jobs:
|
||||
obj: bun-obj-darwin-x64
|
||||
runner: macos-11
|
||||
artifact: bun-obj-darwin-x64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
dependencies: true
|
||||
compile_obj: false
|
||||
# - cpu: westmere
|
||||
@@ -109,7 +128,7 @@ jobs:
|
||||
# obj: bun-obj-darwin-x64-baseline
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64-baseline
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: false
|
||||
# compile_obj: true
|
||||
- cpu: haswell
|
||||
@@ -118,7 +137,7 @@ jobs:
|
||||
obj: bun-obj-darwin-x64
|
||||
runner: macos-11
|
||||
artifact: bun-obj-darwin-x64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
dependencies: false
|
||||
compile_obj: true
|
||||
# - cpu: native
|
||||
@@ -126,7 +145,7 @@ jobs:
|
||||
# tag: bun-darwin-aarch64
|
||||
# obj: bun-obj-darwin-aarch64
|
||||
# artifact: bun-obj-darwin-aarch64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
# runner: macos-arm64
|
||||
# dependencies: true
|
||||
# compile_obj: true
|
||||
@@ -146,10 +165,10 @@ jobs:
|
||||
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
|
||||
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
|
||||
run: |
|
||||
brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
|
||||
brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
|
||||
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
|
||||
echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV
|
||||
brew link --overwrite llvm@13
|
||||
echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
|
||||
brew link --overwrite llvm@15
|
||||
- name: Download WebKit
|
||||
if: matrix.compile_obj
|
||||
env:
|
||||
@@ -165,6 +184,18 @@ jobs:
|
||||
rm -rf $JSC_BASE_DIR
|
||||
mkdir -p $JSC_BASE_DIR
|
||||
curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1
|
||||
- name: ccache (dependencies)
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
if: matrix.dependencies
|
||||
with:
|
||||
key: ${{ runner.os }}-ccache-${{ matrix.tag }}-dependencies
|
||||
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}-dependencies
|
||||
- name: ccache (c++)
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
if: matrix.compile_obj
|
||||
with:
|
||||
key: ${{ runner.os }}-ccache-${{ matrix.tag }}-obj
|
||||
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}-obj
|
||||
- name: Compile dependencies
|
||||
if: matrix.dependencies
|
||||
env:
|
||||
@@ -177,7 +208,7 @@ jobs:
|
||||
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
|
||||
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
|
||||
run: |
|
||||
mkdir -p $BUN_DEPS_OUT_DIR
|
||||
mkdir -p $OBJ_DIR $BUN_DEPS_OUT_DIR
|
||||
make vendor-without-check
|
||||
- name: Compile C++
|
||||
if: matrix.compile_obj
|
||||
@@ -191,7 +222,7 @@ jobs:
|
||||
WEBKIT_RELEASE_DIR: ${{ runner.temp }}/bun-webkit
|
||||
WEBKIT_RELEASE_DIR_LTO: ${{ runner.temp }}/bun-webkit
|
||||
run: |
|
||||
mkdir -p $OBJ_DIR
|
||||
mkdir -p $OBJ_DIR $BUN_DEPS_OUT_DIR
|
||||
make -j $(sysctl -n hw.ncpu) release-bindings
|
||||
- name: Upload C++
|
||||
if: matrix.compile_obj
|
||||
@@ -221,7 +252,7 @@ jobs:
|
||||
# package: bun-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64-baseline
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
- cpu: haswell
|
||||
arch: x86_64
|
||||
tag: bun-darwin-x64
|
||||
@@ -229,14 +260,14 @@ jobs:
|
||||
package: bun-darwin-x64
|
||||
runner: macos-11
|
||||
artifact: bun-obj-darwin-x64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# - cpu: native
|
||||
# arch: aarch64
|
||||
# tag: bun-darwin-aarch64
|
||||
# obj: bun-obj-darwin-aarch64
|
||||
# package: bun-darwin-aarch64
|
||||
# artifact: bun-obj-darwin-aarch64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
# runner: macos-arm64
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -254,10 +285,10 @@ jobs:
|
||||
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj
|
||||
BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps
|
||||
run: |
|
||||
brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
|
||||
brew install rust ccache llvm@15 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force
|
||||
echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV
|
||||
echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV
|
||||
brew link --overwrite llvm@13
|
||||
echo "export PATH=$(brew --prefix llvm@15)/bin:\$PATH" >> $GITHUB_ENV
|
||||
brew link --overwrite llvm@15
|
||||
- name: Download WebKit
|
||||
env:
|
||||
CPU_TARGET: ${{ matrix.cpu }}
|
||||
@@ -288,6 +319,11 @@ jobs:
|
||||
with:
|
||||
name: ${{ matrix.obj }}
|
||||
path: ${{ runner.temp }}/release
|
||||
- name: ccache (link)
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ runner.os }}-ccache-${{ matrix.tag }}-link
|
||||
restore-keys: ${{ runner.os }}-ccache-${{ matrix.tag }}-link
|
||||
- name: Link
|
||||
env:
|
||||
CPU_TARGET: ${{ matrix.cpu }}
|
||||
@@ -303,7 +339,7 @@ jobs:
|
||||
rm -rf packages/${{ matrix.package }}
|
||||
mkdir -p packages/${{ matrix.package }}
|
||||
mv ${{ runner.temp }}/release/* packages/${{ matrix.package }}/
|
||||
make bun-link-lld-release copy-to-bun-release-dir-bin
|
||||
make webcrypto bun-link-lld-release copy-to-bun-release-dir-bin
|
||||
- name: Zip
|
||||
env:
|
||||
CPU_TARGET: ${{ matrix.cpu }}
|
||||
@@ -339,14 +375,16 @@ jobs:
|
||||
path: ${{runner.temp}}/release/${{matrix.tag}}.zip
|
||||
- name: Release
|
||||
id: release
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: ncipollo/release-action@v1
|
||||
if: github.ref == 'refs/heads/main'
|
||||
with:
|
||||
prerelease: true
|
||||
generate_release_notes: true
|
||||
body: "This is the canary release of Bun that corresponds to the commit [${{ github.sha }}]"
|
||||
body: "This canary release of Bun corresponds to the commit [${{ github.sha }}]"
|
||||
allowUpdates: true
|
||||
replacesArtifacts: true
|
||||
generateReleaseNotes: true
|
||||
artifactErrorsFailBuild: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
name: "Canary (${{github.sha}})"
|
||||
tag_name: "canary"
|
||||
files: |
|
||||
${{runner.temp}}/release/${{matrix.tag}}.zip
|
||||
${{runner.temp}}/release/${{matrix.tag}}-profile.zip
|
||||
tag: "canary"
|
||||
artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip"
|
||||
|
||||
137
.github/workflows/bun-types-release.yml
vendored
Normal file
137
.github/workflows/bun-types-release.yml
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
name: Release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test-build:
|
||||
name: Test & Build
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'oven-sh'
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-types
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install bun
|
||||
uses: xhyrom/setup-bun@v0.1.8
|
||||
with:
|
||||
bun-version: canary
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: ESLint
|
||||
run: bun run lint
|
||||
|
||||
- name: Build package
|
||||
run: bun run build
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: bun-types
|
||||
path: packages/bun-types/dist/*
|
||||
if-no-files-found: error
|
||||
|
||||
publish-npm:
|
||||
name: Publish on NPM
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test-build]
|
||||
if: github.repository_owner == 'oven-sh'
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-types
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: latest
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: bun-types
|
||||
path: packages/bun-types/dist
|
||||
|
||||
- name: Publish on NPM
|
||||
run: cd packages/bun-types/dist/ && npm publish --access public
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
publish-gpr:
|
||||
name: Publish on GPR
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test-build]
|
||||
if: github.repository_owner == 'oven-sh'
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-types
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: latest
|
||||
registry-url: 'https://npm.pkg.github.com/'
|
||||
scope: '@oven-sh'
|
||||
|
||||
- name: Install bun
|
||||
uses: xhyrom/setup-bun@v0.1.8
|
||||
with:
|
||||
bun-version: canary
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: bun-types
|
||||
path: dist
|
||||
|
||||
- name: Add scope to name
|
||||
run: bun scripts/gpr.ts
|
||||
|
||||
- name: Publish on GPR
|
||||
run: cd dist/ && npm publish --access public
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# no need for separate releases now
|
||||
# create-release:
|
||||
# name: Create Release
|
||||
# runs-on: ubuntu-latest
|
||||
# needs: [test-build]
|
||||
# defaults:
|
||||
# run:
|
||||
# working-directory: packages/bun-types
|
||||
# if: github.repository_owner == 'oven-sh'
|
||||
|
||||
# steps:
|
||||
# - name: Download all artifacts
|
||||
# uses: actions/download-artifact@v3
|
||||
# with:
|
||||
# name: bun-types
|
||||
# path: packages/bun-types/dist
|
||||
|
||||
# - name: Set version
|
||||
# run: echo "version=$(jq --raw-output '.version' dist/package.json)" >> $GITHUB_ENV
|
||||
|
||||
# - name: Create Release
|
||||
# uses: softprops/action-gh-release@v0.1.14
|
||||
# with:
|
||||
# tag_name: "v${{ env.version }}"
|
||||
# body: "This is the release of bun-types that corresponds to the commit [${{ github.sha }}]"
|
||||
# token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# files: |
|
||||
# dist/*
|
||||
44
.github/workflows/bun-types-tests.yml
vendored
Normal file
44
.github/workflows/bun-types-tests.yml
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
name: TypeScript Types
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- packages/bun-types/**/*
|
||||
branches: [main]
|
||||
pull_request:
|
||||
paths:
|
||||
- packages/bun-types/**/*
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: Build and Test
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-types
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install bun
|
||||
uses: xhyrom/setup-bun@v0.1.8
|
||||
with:
|
||||
bun-version: latest
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Generate package
|
||||
run: bun run build
|
||||
|
||||
- name: ESLint
|
||||
run: bun run lint
|
||||
|
||||
- name: Tests
|
||||
run: bun run test
|
||||
24
.github/workflows/label-sync.yml
vendored
24
.github/workflows/label-sync.yml
vendored
@@ -1,24 +0,0 @@
|
||||
name: Label Sync
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '.github/labels.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
label-sync:
|
||||
name: Label sync
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Sync labels
|
||||
uses: crazy-max/ghaction-github-labeler@v4
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
14
.github/workflows/labeler.yml
vendored
14
.github/workflows/labeler.yml
vendored
@@ -1,14 +0,0 @@
|
||||
name: 'Labeler'
|
||||
on:
|
||||
pull_request_target:
|
||||
|
||||
jobs:
|
||||
labeler:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Label PR
|
||||
uses: actions/labeler@v4
|
||||
with:
|
||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
sync-labels: true
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -104,3 +104,9 @@ src/runtime.version
|
||||
*.database
|
||||
*.db
|
||||
misctools/machbench
|
||||
*.big
|
||||
.eslintcache
|
||||
|
||||
bun-webkit
|
||||
|
||||
src/deps/c-ares/build
|
||||
|
||||
12
.gitmodules
vendored
12
.gitmodules
vendored
@@ -36,14 +36,7 @@ shallow = true
|
||||
fetchRecurseSubmodules = false
|
||||
[submodule "src/deps/boringssl"]
|
||||
path = src/deps/boringssl
|
||||
url = https://github.com/google/boringssl.git
|
||||
ignore = dirty
|
||||
depth = 1
|
||||
shallow = true
|
||||
fetchRecurseSubmodules = false
|
||||
[submodule "src/deps/libbacktrace"]
|
||||
path = src/deps/libbacktrace
|
||||
url = https://github.com/ianlancetaylor/libbacktrace
|
||||
url = https://github.com/oven-sh/boringssl.git
|
||||
ignore = dirty
|
||||
depth = 1
|
||||
shallow = true
|
||||
@@ -69,3 +62,6 @@ ignore = dirty
|
||||
depth = 1
|
||||
shallow = true
|
||||
fetchRecurseSubmodules = false
|
||||
[submodule "src/deps/c-ares"]
|
||||
path = src/deps/c-ares
|
||||
url = https://github.com/c-ares/c-ares.git
|
||||
|
||||
8
.prettierignore
Normal file
8
.prettierignore
Normal file
@@ -0,0 +1,8 @@
|
||||
src/fallback.html
|
||||
# src/test
|
||||
test/bun.js/solid-dom-fixtures
|
||||
test/bun.js/bundled
|
||||
#src/bun.js/builtins
|
||||
# src/api/demo
|
||||
test/snapshots
|
||||
test/snapshots-no-hmr
|
||||
7
.prettierrc
Normal file
7
.prettierrc
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"singleQuote": false,
|
||||
"bracketSpacing": true,
|
||||
"trailingComma": "all"
|
||||
}
|
||||
9
.scripts/postinstall.sh
Executable file
9
.scripts/postinstall.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
set -euxo pipefail
|
||||
|
||||
# if bun-webkit node_modules directory exists
|
||||
if [ -d ./node_modules/bun-webkit ]; then
|
||||
rm -f bun-webkit
|
||||
# get the first matching bun-webkit-* directory name
|
||||
ln -s ./node_modules/$(ls ./node_modules | grep bun-webkit- | head -n 1) ./bun-webkit
|
||||
fi
|
||||
@@ -8,6 +8,10 @@ PICOHTTPPARSER_VERSION=$(git rev-parse HEAD:./src/deps/picohttpparser)
|
||||
BORINGSSL_VERSION=$(git rev-parse HEAD:./src/deps/boringssl)
|
||||
ZLIB_VERSION=$(git rev-parse HEAD:./src/deps/zlib)
|
||||
UWS_VERSION=$(git rev-parse HEAD:./src/deps/uws)
|
||||
LOLHTML=$(git rev-parse HEAD:./src/deps/lol-html)
|
||||
TINYCC=$(git rev-parse HEAD:./src/deps/tinycc)
|
||||
C_ARES=$(git rev-parse HEAD:./src/deps/c-ares)
|
||||
USOCKETS=$(cd src/deps/uws/uSockets && git rev-parse HEAD)
|
||||
|
||||
rm -rf src/generated_versions_list.zig
|
||||
echo "// AUTO-GENERATED FILE. Created via .scripts/write-versions.sh" >src/generated_versions_list.zig
|
||||
@@ -20,6 +24,9 @@ echo "pub const uws = \"$UWS_VERSION\";" >>src/generated_versions_list.zig
|
||||
echo "pub const webkit = \"$WEBKIT_VERSION\";" >>src/generated_versions_list.zig
|
||||
echo "pub const zig = @import(\"std\").fmt.comptimePrint(\"{}\", .{@import(\"builtin\").zig_version});" >>src/generated_versions_list.zig
|
||||
echo "pub const zlib = \"$ZLIB_VERSION\";" >>src/generated_versions_list.zig
|
||||
echo "pub const tinycc = \"$TINYCC\";" >>src/generated_versions_list.zig
|
||||
echo "pub const lolhtml = \"$LOLHTML\";" >>src/generated_versions_list.zig
|
||||
echo "pub const c_ares = \"$C_ARES\";" >>src/generated_versions_list.zig
|
||||
echo "" >>src/generated_versions_list.zig
|
||||
|
||||
zig fmt src/generated_versions_list.zig
|
||||
|
||||
41
.vscode/c_cpp_properties.json
vendored
41
.vscode/c_cpp_properties.json
vendored
@@ -4,31 +4,43 @@
|
||||
"name": "Mac",
|
||||
"forcedInclude": ["${workspaceFolder}/src/bun.js/bindings/root.h"],
|
||||
"includePath": [
|
||||
"${workspaceFolder}/../webkit-build/include/",
|
||||
"${workspaceFolder}/bun-webkit/include/",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/ICU/Headers/",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/WTF/Headers",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/*",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/bmalloc/Headers/",
|
||||
"${workspaceFolder}/src/bun.js/bindings/",
|
||||
"${workspaceFolder}/src/bun.js/bindings/WebCore/",
|
||||
"${workspaceFolder}/src/bun.js/bindings/sqlite/",
|
||||
"${workspaceFolder}/src/bun.js/bindings/webcrypto/",
|
||||
"${workspaceFolder}/src/bun.js/builtins/",
|
||||
"${workspaceFolder}/src/bun.js/builtins/cpp",
|
||||
"${workspaceFolder}/src/bun.js/bindings/WebCore/",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/Source/bmalloc/",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/ICU/Headers/",
|
||||
"${workspaceFolder}/../webkit-build/include/"
|
||||
"${workspaceFolder}/src/deps/boringssl/include/",
|
||||
|
||||
"${workspaceFolder}/src/deps",
|
||||
"${workspaceFolder}/src/deps/uws/uSockets/src"
|
||||
],
|
||||
"browse": {
|
||||
"path": [
|
||||
"${workspaceFolder}/src/bun.js/bindings/*",
|
||||
"${workspaceFolder}/../webkit-build/include/",
|
||||
"${workspaceFolder}/bun-webkit/include/",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/ICU/Headers/",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/**",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/JavaScriptCore/Headers/**",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/WTF/Headers/**",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/*",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/bmalloc/Headers/**",
|
||||
"${workspaceFolder}/src/bun.js/bindings/*",
|
||||
"${workspaceFolder}/src/bun.js/bindings/**",
|
||||
"${workspaceFolder}/src/bun.js/modules/**",
|
||||
"${workspaceFolder}/src/bun.js/bindings/sqlite/",
|
||||
"${workspaceFolder}/src/bun.js/bindings/webcrypto/",
|
||||
"${workspaceFolder}/src/bun.js/builtins/**",
|
||||
"${workspaceFolder}/src/bun.js/builtins/cpp/**",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/Source/bmalloc/**",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/ICU/Headers/",
|
||||
"${workspaceFolder}/../webkit-build/include/"
|
||||
"${workspaceFolder}/src/bun.js/modules/**",
|
||||
"${workspaceFolder}/src/deps",
|
||||
"${workspaceFolder}/src/deps/boringssl/include/",
|
||||
"${workspaceFolder}/src/deps/uws/uSockets/src"
|
||||
],
|
||||
"limitSymbolsToIncludedHeaders": true,
|
||||
"databaseFilename": ".vscode/cppdb"
|
||||
@@ -45,10 +57,9 @@
|
||||
"DU_DISABLE_RENAMING=1"
|
||||
],
|
||||
"macFrameworkPath": [],
|
||||
"compilerPath": "clang++",
|
||||
"compilerPath": "/opt/homebrew/opt/llvm/bin/clang++",
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++20",
|
||||
"intelliSenseMode": "macos-clang-x64"
|
||||
"cppStandard": "c++20"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
|
||||
72
.vscode/launch.json
generated
vendored
72
.vscode/launch.json
generated
vendored
@@ -7,7 +7,7 @@
|
||||
"name": "bun test",
|
||||
"program": "bun-debug",
|
||||
"args": ["wiptest", "${file}"],
|
||||
"cwd": "${workspaceFolder}/test",
|
||||
"cwd": "${workspaceFolder}/test/bun.js",
|
||||
"env": {
|
||||
"FORCE_COLOR": "1"
|
||||
},
|
||||
@@ -21,7 +21,8 @@
|
||||
"args": ["wiptest"],
|
||||
"cwd": "${workspaceFolder}/test",
|
||||
"env": {
|
||||
"FORCE_COLOR": "1"
|
||||
"FORCE_COLOR": "1",
|
||||
"BUN_GARBAGE_COLLECTOR_LEVEL": "2"
|
||||
},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
@@ -37,6 +38,18 @@
|
||||
},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun run (hot)",
|
||||
"program": "bun-debug",
|
||||
"args": ["--hot", "${file}"],
|
||||
"cwd": "${file}/../../",
|
||||
"env": {
|
||||
"FORCE_COLOR": "1"
|
||||
},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
@@ -96,6 +109,43 @@
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun build debug",
|
||||
"program": "bun-debug",
|
||||
"args": ["build", "--platform=bun", "--outdir=/tmp/testout", "${file}"],
|
||||
"cwd": "${file}/../../",
|
||||
"console": "internalConsole",
|
||||
"env": {
|
||||
"BUN_CONFIG_MINIFY_WHITESPACE": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bunx debug",
|
||||
"program": "bun-debug",
|
||||
"args": ["--bun", "x", "tsc", "--help"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole",
|
||||
"env": {
|
||||
"BUN_DEBUG_QUIET_LOGS": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun install",
|
||||
"program": "bun-debug",
|
||||
"args": ["install"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole",
|
||||
"env": {
|
||||
"BUN_DEBUG_QUIET_LOGS": "1"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
@@ -104,6 +154,24 @@
|
||||
"args": ["https://example.com", "--verbose"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Build zig unit test",
|
||||
"program": "make",
|
||||
"args": ["build-unit", "${file}"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Run zig unit test",
|
||||
"program": "${workspaceFolder}/zig-out/bin/test",
|
||||
"args": ["abc"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
22
.vscode/settings.json
vendored
22
.vscode/settings.json
vendored
@@ -7,10 +7,13 @@
|
||||
"search.followSymlinks": false,
|
||||
"search.useIgnoreFiles": true,
|
||||
"zig.buildOnSave": false,
|
||||
"zig.buildArgs": ["obj", "-Dfor-editor"],
|
||||
"zig.buildOption": "build",
|
||||
"zig.buildFilePath": "${workspaceFolder}/build.zig",
|
||||
"[zig]": {
|
||||
"editor.tabSize": 4,
|
||||
"editor.useTabStops": false,
|
||||
"editor.defaultFormatter": "AugusteRame.zls-vscode",
|
||||
"editor.tabSize": 4,
|
||||
"editor.useTabStops": false,
|
||||
"editor.defaultFormatter": "tiehuis.zig",
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"[ts]": {
|
||||
@@ -31,7 +34,6 @@
|
||||
},
|
||||
"zig.beforeDebugCmd": "make build-unit ${file} ${filter} ${bin}",
|
||||
"zig.testCmd": "make test ${file} ${filter} ${bin}",
|
||||
|
||||
"lldb.verboseLogging": false,
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
@@ -44,8 +46,6 @@
|
||||
"**/*.xcscheme": true,
|
||||
"**/*.pem": true,
|
||||
"**/*.xcodeproj": true,
|
||||
"packages/bun-types/*.d.ts": true,
|
||||
|
||||
"test/snapshots": true,
|
||||
"test/snapshots-no-hmr": true,
|
||||
"src/bun.js/WebKit": true,
|
||||
@@ -57,6 +57,8 @@
|
||||
"src/deps/uws": true,
|
||||
"src/deps/zlib": true,
|
||||
"src/deps/lol-html": true,
|
||||
"src/deps/c-ares": true,
|
||||
"src/deps/tinycc": true,
|
||||
"test/snippets/package-json-exports/_node_modules_copy": true
|
||||
},
|
||||
"C_Cpp.files.exclude": {
|
||||
@@ -87,6 +89,7 @@
|
||||
"editor.defaultFormatter": "xaver.clang-format"
|
||||
},
|
||||
"files.associations": {
|
||||
"*.lock": "yarnlock",
|
||||
"*.idl": "cpp",
|
||||
"memory": "cpp",
|
||||
"iostream": "cpp",
|
||||
@@ -178,7 +181,10 @@
|
||||
"ctype.h": "c",
|
||||
"ethernet.h": "c",
|
||||
"inet.h": "c",
|
||||
"packet.h": "c"
|
||||
"packet.h": "c",
|
||||
"queue": "cpp"
|
||||
},
|
||||
"cmake.configureOnOpen": false
|
||||
"cmake.configureOnOpen": false,
|
||||
"C_Cpp.errorSquiggles": "Enabled",
|
||||
"eslint.workingDirectories": ["packages/bun-types"]
|
||||
}
|
||||
|
||||
179
Dockerfile
179
Dockerfile
@@ -7,17 +7,20 @@ ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
ARG CPU_TARGET=native
|
||||
ARG ARCH=x86_64
|
||||
ARG BUILD_MACHINE_ARCH=x86_64
|
||||
ARG TRIPLET=${ARCH}-linux-gnu
|
||||
ARG BUILDARCH=amd64
|
||||
ARG WEBKIT_TAG=jul27-2
|
||||
ARG ZIG_TAG=jul1
|
||||
ARG ZIG_VERSION="0.11.0-dev.947+cf822c6dd"
|
||||
ARG WEBKIT_BASENAME="bun-webkit-linux-$BUILDARCH"
|
||||
|
||||
ARG ZIG_FOLDERNAME=zig-linux-${BUILD_MACHINE_ARCH}-${ZIG_VERSION}
|
||||
ARG ZIG_FILENAME=${ZIG_FOLDERNAME}.tar.xz
|
||||
ARG WEBKIT_URL="https://github.com/oven-sh/WebKit/releases/download/$WEBKIT_TAG/${WEBKIT_BASENAME}.tar.gz"
|
||||
|
||||
ARG ZIG_URL="https://github.com/oven-sh/zig/releases/download/$ZIG_TAG/zig-linux-$BUILDARCH.zip"
|
||||
ARG ZIG_URL="https://ziglang.org/builds/${ZIG_FILENAME}"
|
||||
ARG GIT_SHA=""
|
||||
ARG BUN_BASE_VERSION=0.1
|
||||
|
||||
ARG BUN_BASE_VERSION=0.4
|
||||
|
||||
FROM bitnami/minideb:bullseye as bun-base
|
||||
|
||||
@@ -25,7 +28,7 @@ RUN install_packages ca-certificates curl wget lsb-release software-properties-c
|
||||
|
||||
RUN wget https://apt.llvm.org/llvm.sh && \
|
||||
chmod +x llvm.sh && \
|
||||
./llvm.sh 13
|
||||
./llvm.sh 15
|
||||
|
||||
RUN install_packages \
|
||||
cmake \
|
||||
@@ -43,10 +46,11 @@ RUN install_packages \
|
||||
rsync \
|
||||
ruby \
|
||||
unzip \
|
||||
bash tar gzip
|
||||
xz-utils \
|
||||
bash tar gzip ccache
|
||||
|
||||
ENV CXX=clang++-13
|
||||
ENV CC=clang-13
|
||||
ENV CXX=clang++-15
|
||||
ENV CC=clang-15
|
||||
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
|
||||
install_packages nodejs && \
|
||||
@@ -63,13 +67,15 @@ ARG BUILDARCH
|
||||
ARG ZIG_PATH
|
||||
ARG WEBKIT_URL
|
||||
ARG ZIG_URL
|
||||
ARG ZIG_FOLDERNAME
|
||||
ARG ZIG_FILENAME
|
||||
|
||||
ENV WEBKIT_OUT_DIR=${WEBKIT_DIR}
|
||||
ENV BUILDARCH=${BUILDARCH}
|
||||
ENV AR=/usr/bin/llvm-ar-13
|
||||
ENV AR=/usr/bin/llvm-ar-15
|
||||
ENV ZIG "${ZIG_PATH}/zig"
|
||||
ENV PATH="$ZIG/bin:$PATH"
|
||||
ENV LD=lld-13
|
||||
ENV LD=lld-15
|
||||
|
||||
RUN mkdir -p $BUN_DIR $BUN_DEPS_OUT_DIR
|
||||
|
||||
@@ -78,8 +84,8 @@ FROM bun-base as bun-base-with-zig-and-webkit
|
||||
WORKDIR $GITHUB_WORKSPACE
|
||||
|
||||
ADD $ZIG_URL .
|
||||
RUN unzip -q zig-linux-$BUILDARCH.zip && \
|
||||
rm zig-linux-$BUILDARCH.zip;
|
||||
RUN tar xf ${ZIG_FILENAME} && \
|
||||
rm ${ZIG_FILENAME} && mv ${ZIG_FOLDERNAME} zig;
|
||||
|
||||
|
||||
|
||||
@@ -105,6 +111,30 @@ RUN mkdir -p ${WEBKIT_DIR} && cd ${GITHUB_WORKSPACE} && \
|
||||
LABEL org.opencontainers.image.title="bun base image with zig & webkit ${BUILDARCH} (glibc)"
|
||||
LABEL org.opencontainers.image.source=https://github.com/oven-sh/bun
|
||||
|
||||
FROM bun-base as c-ares
|
||||
|
||||
ARG DEBIAN_FRONTEND
|
||||
ARG GITHUB_WORKSPACE
|
||||
ARG ZIG_PATH
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR
|
||||
ARG BUN_RELEASE_DIR
|
||||
ARG BUN_DEPS_OUT_DIR
|
||||
ARG BUN_DIR
|
||||
ARG CPU_TARGET
|
||||
|
||||
ENV CPU_TARGET=${CPU_TARGET}
|
||||
ENV CCACHE_DIR=/ccache
|
||||
ENV JSC_BASE_DIR=${WEBKIT_DIR}
|
||||
ENV LIB_ICU_PATH=${WEBKIT_DIR}/lib
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/deps/c-ares ${BUN_DIR}/src/deps/c-ares
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && make c-ares && rm -rf ${BUN_DIR}/src/deps/c-ares ${BUN_DIR}/Makefile
|
||||
|
||||
|
||||
FROM bun-base as lolhtml
|
||||
|
||||
@@ -122,7 +152,9 @@ ARG BUN_DIR
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/deps/lol-html ${BUN_DIR}/src/deps/lol-html
|
||||
|
||||
RUN export PATH=$PATH:$HOME/.cargo/bin && export CC=$(which clang-13) && cd ${BUN_DIR} && \
|
||||
ENV CCACHE_DIR=/ccache
|
||||
|
||||
RUN --mount=type=cache,target=/ccache export PATH=$PATH:$HOME/.cargo/bin && export CC=$(which clang-15) && cd ${BUN_DIR} && \
|
||||
make lolhtml && rm -rf src/deps/lol-html Makefile
|
||||
|
||||
FROM bun-base as mimalloc
|
||||
@@ -141,7 +173,9 @@ COPY src/deps/mimalloc ${BUN_DIR}/src/deps/mimalloc
|
||||
ARG CPU_TARGET
|
||||
ENV CPU_TARGET=${CPU_TARGET}
|
||||
|
||||
RUN cd ${BUN_DIR} && \
|
||||
ENV CCACHE_DIR=/ccache
|
||||
|
||||
RUN --mount=type=cache,target=/ccache cd ${BUN_DIR} && \
|
||||
make mimalloc && rm -rf src/deps/mimalloc Makefile
|
||||
|
||||
FROM bun-base as zlib
|
||||
@@ -162,7 +196,9 @@ COPY src/deps/zlib ${BUN_DIR}/src/deps/zlib
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
RUN cd $BUN_DIR && \
|
||||
ENV CCACHE_DIR=/ccache
|
||||
|
||||
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && \
|
||||
make zlib && rm -rf src/deps/zlib Makefile
|
||||
|
||||
FROM bun-base as libarchive
|
||||
@@ -183,8 +219,14 @@ RUN install_packages autoconf automake libtool pkg-config
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/deps/libarchive ${BUN_DIR}/src/deps/libarchive
|
||||
|
||||
ENV CCACHE_DIR=/ccache
|
||||
WORKDIR $BUN_DIR
|
||||
RUN make libarchive && rm -rf src/deps/libarchive Makefile
|
||||
|
||||
|
||||
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && \
|
||||
make libarchive && rm -rf src/deps/libarchive Makefile
|
||||
|
||||
|
||||
|
||||
FROM bun-base as tinycc
|
||||
|
||||
@@ -201,27 +243,6 @@ ENV CPU_TARGET=${CPU_TARGET}
|
||||
|
||||
RUN install_packages libtcc-dev && cp /usr/lib/$(uname -m)-linux-gnu/libtcc.a ${BUN_DEPS_OUT_DIR}
|
||||
|
||||
FROM bun-base as libbacktrace
|
||||
|
||||
ARG DEBIAN_FRONTEND
|
||||
ARG GITHUB_WORKSPACE
|
||||
ARG ZIG_PATH
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR
|
||||
ARG BUN_RELEASE_DIR
|
||||
ARG BUN_DEPS_OUT_DIR
|
||||
ARG BUN_DIR
|
||||
ARG CPU_TARGET
|
||||
ENV CPU_TARGET=${CPU_TARGET}
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/deps/libbacktrace ${BUN_DIR}/src/deps/libbacktrace
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
RUN cd $BUN_DIR && \
|
||||
make libbacktrace && rm -rf src/deps/libbacktrace Makefile
|
||||
|
||||
FROM bun-base as boringssl
|
||||
|
||||
RUN install_packages golang
|
||||
@@ -242,27 +263,9 @@ COPY src/deps/boringssl ${BUN_DIR}/src/deps/boringssl
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
RUN make boringssl && rm -rf src/deps/boringssl Makefile
|
||||
ENV CCACHE_DIR=/ccache
|
||||
|
||||
FROM bun-base as base64
|
||||
|
||||
ARG DEBIAN_FRONTEND
|
||||
ARG GITHUB_WORKSPACE
|
||||
ARG ZIG_PATH
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR
|
||||
ARG BUN_RELEASE_DIR
|
||||
ARG BUN_DEPS_OUT_DIR
|
||||
ARG BUN_DIR
|
||||
ARG CPU_TARGET
|
||||
ENV CPU_TARGET=${CPU_TARGET}
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/base64 ${BUN_DIR}/src/base64
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
RUN make base64 && rm -rf src/base64 Makefile
|
||||
RUN --mount=type=cache,target=/ccache cd ${BUN_DIR} && make boringssl && rm -rf src/deps/boringssl Makefile
|
||||
|
||||
FROM bun-base as uws
|
||||
|
||||
@@ -300,6 +303,8 @@ ARG BUN_RELEASE_DIR
|
||||
ARG BUN_DEPS_OUT_DIR
|
||||
ARG BUN_DIR
|
||||
ARG CPU_TARGET
|
||||
|
||||
|
||||
ENV CPU_TARGET=${CPU_TARGET}
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
@@ -371,11 +376,12 @@ ENV CPU_TARGET=${CPU_TARGET}
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
COPY ./root.zig ${BUN_DIR}/root.zig
|
||||
COPY ./src ${BUN_DIR}/src
|
||||
COPY ./build.zig ${BUN_DIR}/build.zig
|
||||
COPY ./completions ${BUN_DIR}/completions
|
||||
COPY ./packages ${BUN_DIR}/packages
|
||||
COPY ./build-id ${BUN_DIR}/build-id
|
||||
COPY ./src/build-id ${BUN_DIR}/src/build-id
|
||||
COPY ./package.json ${BUN_DIR}/package.json
|
||||
COPY ./misctools ${BUN_DIR}/misctools
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
@@ -413,12 +419,14 @@ ENV GIT_SHA=${GIT_SHA}
|
||||
COPY --from=identifier_cache ${BUN_DIR}/src/js_lexer/*.blob ${BUN_DIR}/src/js_lexer/
|
||||
COPY --from=node_fallbacks ${BUN_DIR}/src/node-fallbacks/out ${BUN_DIR}/src/node-fallbacks/out
|
||||
|
||||
COPY ./build-id ${BUN_DIR}/build-id
|
||||
COPY ./src/build-id ${BUN_DIR}/src/build-id
|
||||
|
||||
RUN cd $BUN_DIR && mkdir -p src/bun.js/bindings-obj && rm -rf $HOME/.cache zig-cache && make prerelease && \
|
||||
ENV CCACHE_DIR=/ccache
|
||||
|
||||
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && mkdir -p src/bun.js/bindings-obj && rm -rf $HOME/.cache zig-cache && make prerelease && \
|
||||
mkdir -p $BUN_RELEASE_DIR && \
|
||||
OUTPUT_DIR=/tmp $ZIG_PATH/zig build obj -Drelease-fast -Dtarget="${TRIPLET}" -Dcpu="${CPU_TARGET}" && \
|
||||
cp /tmp/bun.o /tmp/bun-${BUN_BASE_VERSION}.$(cat ${BUN_DIR}/build-id).o && cd / && rm -rf $BUN_DIR
|
||||
OUTPUT_DIR=/tmp/bun-${TRIPLET}-${GIT_SHA} $ZIG_PATH/zig build obj -Doutput-dir=/tmp/bun-${TRIPLET}-${GIT_SHA} -Drelease-fast -Dtarget="${TRIPLET}" -Dcpu="${CPU_TARGET}" && \
|
||||
cp /tmp/bun-${TRIPLET}-${GIT_SHA}/bun.o /tmp/bun-${TRIPLET}-${GIT_SHA}/bun-${BUN_BASE_VERSION}.$(cat ${BUN_DIR}/src/build-id).o && cd / && rm -rf $BUN_DIR
|
||||
|
||||
FROM scratch as build_release_obj
|
||||
|
||||
@@ -429,12 +437,13 @@ ARG ZIG_PATH
|
||||
ARG WEBKIT_DIR
|
||||
ARG BUN_RELEASE_DIR
|
||||
ARG BUN_DEPS_OUT_DIR
|
||||
ARG GIT_SHA
|
||||
ARG TRIPLET
|
||||
ARG BUN_DIR
|
||||
ARG CPU_TARGET
|
||||
ENV CPU_TARGET=${CPU_TARGET}
|
||||
|
||||
|
||||
COPY --from=compile_release_obj /tmp/*.o /
|
||||
COPY --from=compile_release_obj /tmp/bun-${TRIPLET}-${GIT_SHA}/*.o /
|
||||
|
||||
FROM prepare_release as compile_cpp
|
||||
|
||||
@@ -456,22 +465,15 @@ WORKDIR $BUN_DIR
|
||||
ENV JSC_BASE_DIR=${WEBKIT_DIR}
|
||||
ENV LIB_ICU_PATH=${WEBKIT_DIR}/lib
|
||||
|
||||
COPY --from=lolhtml ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=mimalloc ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=libarchive ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=picohttp ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=boringssl ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=uws ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=uws ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=libbacktrace ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=zlib ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=tinycc ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=base64 ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
# Required for `make webcrypto`
|
||||
COPY src/deps/boringssl/include ${BUN_DIR}/src/deps/boringssl/include
|
||||
|
||||
RUN cd $BUN_DIR && mkdir -p src/bun.js/bindings-obj && rm -rf $HOME/.cache zig-cache && mkdir -p $BUN_RELEASE_DIR && \
|
||||
make release-bindings -j10 && mv src/bun.js/bindings-obj/* /tmp
|
||||
ENV CCACHE_DIR=/ccache
|
||||
|
||||
FROM prepare_release as sqlite
|
||||
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && mkdir -p src/bun.js/bindings-obj && rm -rf $HOME/.cache zig-cache && mkdir -p $BUN_RELEASE_DIR && make webcrypto && \
|
||||
make release-bindings -j10 && mv ${BUN_DEPS_OUT_DIR}/libwebcrypto.a /tmp && mv src/bun.js/bindings-obj/* /tmp
|
||||
|
||||
FROM bun-base as sqlite
|
||||
|
||||
ARG DEBIAN_FRONTEND
|
||||
ARG GITHUB_WORKSPACE
|
||||
@@ -482,18 +484,22 @@ ARG BUN_RELEASE_DIR
|
||||
ARG BUN_DEPS_OUT_DIR
|
||||
ARG BUN_DIR
|
||||
|
||||
ENV CCACHE_DIR=/ccache
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/bun.js/bindings/sqlite ${BUN_DIR}/src/bun.js/bindings/sqlite
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
ENV JSC_BASE_DIR=${WEBKIT_DIR}
|
||||
ENV LIB_ICU_PATH=${WEBKIT_DIR}/lib
|
||||
|
||||
RUN cd $BUN_DIR && make sqlite
|
||||
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && make sqlite
|
||||
|
||||
FROM scratch as build_release_cpp
|
||||
|
||||
COPY --from=compile_cpp /tmp/*.o /
|
||||
COPY --from=compile_cpp /tmp/libwebcrypto.a /
|
||||
|
||||
FROM prepare_release as build_release
|
||||
|
||||
@@ -515,20 +521,21 @@ WORKDIR $BUN_DIR
|
||||
ENV JSC_BASE_DIR=${WEBKIT_DIR}
|
||||
ENV LIB_ICU_PATH=${WEBKIT_DIR}/lib
|
||||
|
||||
COPY --from=zlib ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=libarchive ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=boringssl ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=lolhtml ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=mimalloc ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=libarchive ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=picohttp ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=boringssl ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=sqlite ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=tinycc ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=uws ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=uws ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=libbacktrace ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=zlib ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=tinycc ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=base64 ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=sqlite ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=c-ares ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
|
||||
COPY --from=build_release_obj /*.o /tmp
|
||||
COPY --from=build_release_cpp /*.o ${BUN_DIR}/src/bun.js/bindings-obj/
|
||||
COPY --from=build_release_cpp /*.a ${BUN_DEPS_OUT_DIR}/
|
||||
|
||||
RUN cd $BUN_DIR && mkdir -p ${BUN_RELEASE_DIR} && make bun-relink copy-to-bun-release-dir && \
|
||||
rm -rf $HOME/.cache zig-cache misctools package.json build-id completions build.zig $(BUN_DIR)/packages
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG BUILDARCH=amd64
|
||||
ARG ARCH=x86_64
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
ARG BUN_PACKAGES_DIR=${BUN_DIR}/packages
|
||||
ARG ZIG_VERSION="0.11.0-dev.947+cf822c6dd"
|
||||
|
||||
ARG ZIG_FOLDERNAME=zig-linux-${ARCH}-${ZIG_VERSION}
|
||||
ARG ZIG_FILENAME=${ZIG_FOLDERNAME}.tar.xz
|
||||
ARG ZIG_URL="https://ziglang.org/builds/${ZIG_FILENAME}"
|
||||
|
||||
FROM --platform=linux/${BUILDARCH} ubuntu:22.04 as bun.devcontainer
|
||||
|
||||
@@ -17,13 +24,14 @@ ARG WEBKIT_DIR
|
||||
ARG BUN_RELEASE_DIR
|
||||
ARG BUN_DEPS_OUT_DIR
|
||||
ARG BUN_DIR
|
||||
ARG BUN_PACKAGES_DIR
|
||||
|
||||
ENV WEBKIT_OUT_DIR ${WEBKIT_DIR}
|
||||
ENV PATH "$ZIG_PATH:$PATH"
|
||||
ENV JSC_BASE_DIR $WEBKIT_OUT_DIR
|
||||
ENV LIB_ICU_PATH ${WEBKIT_OUT_DIR}/lib
|
||||
ENV BUN_RELEASE_DIR ${BUN_RELEASE_DIR}
|
||||
ENV PATH "${GITHUB_WORKSPACE}/packages/bun-linux-x64:${GITHUB_WORKSPACE}/packages/bun-linux-aarch64:${GITHUB_WORKSPACE}/packages/debug-bun-linux-x64:${GITHUB_WORKSPACE}/packages/debug-bun-linux-aarch64:$PATH"
|
||||
ENV PATH "${BUN_PACKAGES_DIR}/bun-linux-x64:${BUN_PACKAGES_DIR}/bun-linux-aarch64:${BUN_PACKAGES_DIR}/debug-bun-linux-x64:${BUN_PACKAGES_DIR}/debug-bun-linux-aarch64:$PATH"
|
||||
ENV PATH "/home/ubuntu/zls/zig-out/bin:$PATH"
|
||||
ENV BUN_INSTALL /home/ubuntu/.bun
|
||||
ENV XDG_CONFIG_HOME /home/ubuntu/.config
|
||||
@@ -35,7 +43,7 @@ RUN apt-get update && \
|
||||
add-apt-repository ppa:longsleep/golang-backports && \
|
||||
wget https://apt.llvm.org/llvm.sh --no-check-certificate && \
|
||||
chmod +x llvm.sh && \
|
||||
./llvm.sh 13 && \
|
||||
./llvm.sh 15 && \
|
||||
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
|
||||
apt-get update && \
|
||||
apt-get install --no-install-recommends -y \
|
||||
@@ -48,16 +56,16 @@ RUN apt-get update && \
|
||||
git \
|
||||
libssl-dev \
|
||||
ruby \
|
||||
liblld-13-dev \
|
||||
libclang-13-dev \
|
||||
liblld-15-dev \
|
||||
libclang-15-dev \
|
||||
nodejs \
|
||||
gcc \
|
||||
g++ \
|
||||
clang-13 \
|
||||
clang-format-13 \
|
||||
libc++-13-dev \
|
||||
libc++abi-13-dev \
|
||||
lld-13 \
|
||||
clang-15 \
|
||||
clang-format-15 \
|
||||
libc++-15-dev \
|
||||
libc++abi-15-dev \
|
||||
lld-15 \
|
||||
libicu-dev \
|
||||
wget \
|
||||
rustc \
|
||||
@@ -65,35 +73,38 @@ RUN apt-get update && \
|
||||
unzip \
|
||||
tar \
|
||||
golang-go ninja-build pkg-config automake autoconf libtool curl && \
|
||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-13 90 && \
|
||||
update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-13 90 && \
|
||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-13 90 && \
|
||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-15 90 && \
|
||||
update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-15 90 && \
|
||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-15 90 && \
|
||||
npm install -g esbuild
|
||||
|
||||
ENV CC=clang-13
|
||||
ENV CXX=clang++-13
|
||||
ENV CC=clang-15
|
||||
ENV CXX=clang++-15
|
||||
ENV ZIG "${ZIG_PATH}/zig"
|
||||
|
||||
|
||||
|
||||
WORKDIR $GITHUB_WORKSPACE
|
||||
|
||||
RUN cd / && mkdir -p $BUN_RELEASE_DIR $BUN_DEPS_OUT_DIR ${BUN_DIR} ${BUN_DEPS_OUT_DIR}
|
||||
|
||||
WORKDIR $GITHUB_WORKSPACE
|
||||
|
||||
RUN cd $GITHUB_WORKSPACE && \
|
||||
curl -o zig-linux-$BUILDARCH.zip -L https://github.com/oven-sh/zig/releases/download/jul1/zig-linux-$BUILDARCH.zip && \
|
||||
unzip -q zig-linux-$BUILDARCH.zip && \
|
||||
rm zig-linux-$BUILDARCH.zip;
|
||||
|
||||
ARG ZIG_FOLDERNAME
|
||||
ARG ZIG_FILENAME
|
||||
ARG ZIG_URL
|
||||
|
||||
ADD $ZIG_URL .
|
||||
RUN tar -xf ${ZIG_FILENAME} && \
|
||||
rm ${ZIG_FILENAME} && \
|
||||
mv ${ZIG_FOLDERNAME} ${ZIG_PATH};
|
||||
|
||||
RUN cd $GITHUB_WORKSPACE && \
|
||||
curl -o bun-webkit-linux-$BUILDARCH.tar.gz -L https://github.com/oven-sh/WebKit/releases/download/sept17/bun-webkit-linux-$BUILDARCH.tar.gz && \
|
||||
curl -o bun-webkit-linux-$BUILDARCH.tar.gz -L https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-linux-$BUILDARCH.tar.gz && \
|
||||
tar -xzf bun-webkit-linux-$BUILDARCH.tar.gz && \
|
||||
rm bun-webkit-linux-$BUILDARCH.tar.gz && \
|
||||
cat $WEBKIT_OUT_DIR/include/cmakeconfig.h > /dev/null
|
||||
|
||||
RUN apt-get -y update && update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-13 90
|
||||
RUN apt-get -y update && update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-15 90
|
||||
|
||||
COPY .devcontainer/workspace.code-workspace $GITHUB_WORKSPACE/workspace.code-workspace
|
||||
COPY .devcontainer/zls.json $GITHUB_WORKSPACE/workspace.code-workspace
|
||||
@@ -112,4 +123,4 @@ RUN mkdir -p /home/ubuntu/.bun /home/ubuntu/.config $GITHUB_WORKSPACE/bun && \
|
||||
bash /scripts/github.sh && \
|
||||
bash /scripts/nice.sh && \
|
||||
bash /scripts/zig-env.sh
|
||||
COPY .devcontainer/zls.json /home/ubuntu/.config/zls.json
|
||||
COPY .devcontainer/zls.json /home/ubuntu/.config/zls.json
|
||||
|
||||
368
Makefile
368
Makefile
@@ -4,6 +4,10 @@ OS_NAME := $(shell uname -s | tr '[:upper:]' '[:lower:]')
|
||||
ARCH_NAME_RAW := $(shell uname -m)
|
||||
BUN_AUTO_UPDATER_REPO = Jarred-Sumner/bun-releases-for-updater
|
||||
|
||||
CMAKE_CXX_COMPILER_LAUNCHER_FLAG :=
|
||||
|
||||
|
||||
|
||||
# 'make' command will trigger the help target
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
@@ -35,6 +39,7 @@ NATIVE_OR_OLD_MARCH = -march=westmere
|
||||
endif
|
||||
|
||||
MIN_MACOS_VERSION ?= $(DEFAULT_MIN_MACOS_VERSION)
|
||||
BUN_BASE_VERSION = 0.4
|
||||
|
||||
AR=
|
||||
|
||||
@@ -49,12 +54,12 @@ DEBUG_PACKAGE_DIR = $(PACKAGES_REALPATH)/debug-$(PACKAGE_NAME)
|
||||
RELEASE_BUN = $(PACKAGE_DIR)/bun
|
||||
DEBUG_BIN = $(DEBUG_PACKAGE_DIR)/
|
||||
DEBUG_BUN = $(DEBUG_BIN)/bun-debug
|
||||
BUILD_ID = $(shell cat ./build-id)
|
||||
PACKAGE_JSON_VERSION = 0.1.$(BUILD_ID)
|
||||
BUILD_ID = $(shell cat ./src/build-id)
|
||||
PACKAGE_JSON_VERSION = $(BUN_BASE_VERSION).$(BUILD_ID)
|
||||
BUN_BUILD_TAG = bun-v$(PACKAGE_JSON_VERSION)
|
||||
BUN_RELEASE_BIN = $(PACKAGE_DIR)/bun
|
||||
PRETTIER ?= $(shell which prettier || echo "./node_modules/.bin/prettier")
|
||||
DSYMUTIL ?= $(shell which dsymutil || which dsymutil-13)
|
||||
DSYMUTIL ?= $(shell which dsymutil || which dsymutil-15)
|
||||
WEBKIT_DIR ?= $(realpath src/bun.js/WebKit)
|
||||
WEBKIT_RELEASE_DIR ?= $(WEBKIT_DIR)/WebKitBuild/Release
|
||||
WEBKIT_DEBUG_DIR ?= $(WEBKIT_DIR)/WebKitBuild/Debug
|
||||
@@ -69,20 +74,39 @@ ZIG ?= $(shell which zig || echo -e "error: Missing zig. Please make sure zig is
|
||||
# This is easier to happen than you'd expect.
|
||||
# Using realpath here causes issues because clang uses clang++ as a symlink
|
||||
# so if that's resolved, it won't build for C++
|
||||
CC = $(shell which clang-13 || which clang)
|
||||
CXX = $(shell which clang++-13 || which clang++)
|
||||
REAL_CC = $(shell which clang-15 || which clang)
|
||||
REAL_CXX = $(shell which clang++-15 || which clang++)
|
||||
|
||||
CC = $(REAL_CC)
|
||||
CXX = $(REAL_CXX)
|
||||
CCACHE_CC_OR_CC := $(REAL_CC)
|
||||
|
||||
CCACHE_PATH := $(shell which ccache 2>/dev/null)
|
||||
|
||||
CCACHE_CC_FLAG = CC=$(CCACHE_CC_OR_CC)
|
||||
|
||||
ifeq (,$(findstring,$(shell which ccache),ccache))
|
||||
CMAKE_CXX_COMPILER_LAUNCHER_FLAG := -DCMAKE_CXX_COMPILER_LAUNCHER=$(CCACHE_PATH) -DCMAKE_C_COMPILER_LAUNCHER=$(CCACHE_PATH)
|
||||
CCACHE_CC_OR_CC := "$(CCACHE_PATH) $(REAL_CC)"
|
||||
export CCACHE_COMPILERTYPE = clang
|
||||
CCACHE_CC_FLAG = CC=$(CCACHE_CC_OR_CC) CCACHE_COMPILER=$(REAL_CC)
|
||||
CCACHE_CXX_FLAG = CXX=$(CCACHE_PATH) CCACHE_COMPILER=$(REAL_CXX)
|
||||
endif
|
||||
|
||||
CXX_WITH_CCACHE = $(CCACHE_PATH) $(CXX)
|
||||
CC_WITH_CCACHE = $(CCACHE_PATH) $(CC)
|
||||
|
||||
ifeq ($(OS_NAME),darwin)
|
||||
# Find LLVM
|
||||
ifeq ($(wildcard $(LLVM_PREFIX)),)
|
||||
LLVM_PREFIX = $(shell brew --prefix llvm@13)
|
||||
LLVM_PREFIX = $(shell brew --prefix llvm@15)
|
||||
endif
|
||||
ifeq ($(wildcard $(LLVM_PREFIX)),)
|
||||
LLVM_PREFIX = $(shell brew --prefix llvm)
|
||||
endif
|
||||
ifeq ($(wildcard $(LLVM_PREFIX)),)
|
||||
# This is kinda ugly, but I can't find a better way to error :(
|
||||
LLVM_PREFIX = $(shell echo -e "error: Unable to find llvm. Please run 'brew install llvm@13' or set LLVM_PREFIX=/path/to/llvm")
|
||||
LLVM_PREFIX = $(shell echo -e "error: Unable to find llvm. Please run 'brew install llvm@15' or set LLVM_PREFIX=/path/to/llvm")
|
||||
endif
|
||||
|
||||
LDFLAGS += -L$(LLVM_PREFIX)/lib
|
||||
@@ -117,7 +141,15 @@ LIBICONV_PATH ?= $(BREW_PREFIX_PATH)/opt/libiconv/lib/libiconv.a
|
||||
|
||||
OPENSSL_LINUX_DIR = $(BUN_DEPS_DIR)/openssl/openssl-OpenSSL_1_1_1l
|
||||
|
||||
CMAKE_FLAGS_WITHOUT_RELEASE = -DCMAKE_C_COMPILER=$(CC) -DCMAKE_CXX_COMPILER=$(CXX) -DCMAKE_OSX_DEPLOYMENT_TARGET=$(MIN_MACOS_VERSION)
|
||||
CMAKE_FLAGS_WITHOUT_RELEASE = -DCMAKE_C_COMPILER=$(CC) \
|
||||
-DCMAKE_CXX_COMPILER=$(CXX) \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=$(MIN_MACOS_VERSION) \
|
||||
$(CMAKE_CXX_COMPILER_LAUNCHER_FLAG) \
|
||||
-DCMAKE_AR=$(AR) \
|
||||
-DCMAKE_RANLIB=$(which llvm-15-ranlib || which llvm-ranlib)
|
||||
|
||||
|
||||
|
||||
CMAKE_FLAGS = $(CMAKE_FLAGS_WITHOUT_RELEASE) -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
# SQLite3 is dynamically linked on macOS
|
||||
@@ -126,24 +158,23 @@ CMAKE_FLAGS = $(CMAKE_FLAGS_WITHOUT_RELEASE) -DCMAKE_BUILD_TYPE=Release
|
||||
SQLITE_OBJECT =
|
||||
|
||||
|
||||
BITCODE_OR_SECTIONS=
|
||||
EMBED_OR_EMIT_BITCODE=
|
||||
|
||||
LIBTOOL=libtoolize
|
||||
ifeq ($(OS_NAME),darwin)
|
||||
LIBTOOL=glibtoolize
|
||||
AR=$(LLVM_PREFIX)/bin/llvm-ar
|
||||
BITCODE_OR_SECTIONS=-fembed-bitcode
|
||||
BITCODE_OR_SECTIONS=
|
||||
endif
|
||||
|
||||
ifeq ($(OS_NAME),linux)
|
||||
LIBICONV_PATH =
|
||||
AR = $(shell which llvm-ar-13 || which llvm-ar || which ar)
|
||||
AR = $(shell which llvm-ar-15 || which llvm-ar || which ar)
|
||||
endif
|
||||
|
||||
OPTIMIZATION_LEVEL=-O3 $(MARCH_NATIVE)
|
||||
DEBUG_OPTIMIZATION_LEVEL= -O1 $(MARCH_NATIVE)
|
||||
CFLAGS_WITHOUT_MARCH = $(MACOS_MIN_FLAG) $(BITCODE_OR_SECTIONS) $(OPTIMIZATION_LEVEL) -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden
|
||||
BUN_CFLAGS = $(MACOS_MIN_FLAG) $(MARCH_NATIVE) $(EMBED_OR_EMIT_BITCODE) $(OPTIMIZATION_LEVEL) -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden
|
||||
CFLAGS_WITHOUT_MARCH = $(MACOS_MIN_FLAG) $(OPTIMIZATION_LEVEL) -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden
|
||||
BUN_CFLAGS = $(MACOS_MIN_FLAG) $(MARCH_NATIVE) $(OPTIMIZATION_LEVEL) -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden
|
||||
BUN_TMP_DIR := /tmp/make-bun
|
||||
CFLAGS=$(CFLAGS_WITHOUT_MARCH) $(MARCH_NATIVE)
|
||||
|
||||
@@ -152,18 +183,26 @@ DEFAULT_USE_BMALLOC := 1
|
||||
|
||||
USE_BMALLOC ?= DEFAULT_USE_BMALLOC
|
||||
|
||||
JSC_BASE_DIR ?= ${HOME}/webkit-build
|
||||
# Set via postinstall
|
||||
AUTO_JSX_BASE_DIR ?= $(realpath $(firstword $(wildcard bun-webkit)))
|
||||
|
||||
ifeq (,$(AUTO_JSX_BASE_DIR))
|
||||
AUTO_JSX_BASE_DIR ?= $(HOME)/webkit-build
|
||||
endif
|
||||
|
||||
JSC_BASE_DIR ?= $(AUTO_JSX_BASE_DIR)
|
||||
|
||||
DEFAULT_JSC_LIB :=
|
||||
DEFAULT_JSC_LIB_DEBUG :=
|
||||
|
||||
ifeq ($(OS_NAME),linux)
|
||||
DEFAULT_JSC_LIB = $(JSC_BASE_DIR)/lib
|
||||
DEFAULT_JSC_LIB_DEBUG = $(DEFAULT_JSC_LIB)
|
||||
|
||||
ifneq (,$(realpath $(WEBKIT_RELEASE_DIR_LTO)/lib))
|
||||
DEFAULT_JSC_LIB = $(WEBKIT_RELEASE_DIR_LTO)/lib
|
||||
endif
|
||||
|
||||
ifeq ($(OS_NAME),darwin)
|
||||
DEFAULT_JSC_LIB = $(WEBKIT_RELEASE_DIR_LTO)/lib
|
||||
ifneq (,$(realpath $(WEBKIT_RELEASE_DIR)/lib))
|
||||
DEFAULT_JSC_LIB_DEBUG = $(WEBKIT_RELEASE_DIR)/lib
|
||||
endif
|
||||
|
||||
@@ -227,7 +266,7 @@ STRIP=/usr/bin/strip
|
||||
endif
|
||||
|
||||
ifeq ($(OS_NAME),linux)
|
||||
STRIP=$(shell which llvm-strip || which llvm-strip-13 || which strip || echo "Missing strip")
|
||||
STRIP=$(shell which llvm-strip || which llvm-strip-15 || which strip || echo "Missing strip")
|
||||
endif
|
||||
|
||||
|
||||
@@ -267,36 +306,39 @@ DEBUG_MODULES_OBJ_FILES := $(patsubst $(MODULES_DIR)/%.cpp,$(DEBUG_OBJ_DIR)/%.o,
|
||||
BINDINGS_OBJ := $(OBJ_FILES) $(WEBCORE_OBJ_FILES) $(SQLITE_OBJ_FILES) $(NODE_OS_OBJ_FILES) $(BUILTINS_OBJ_FILES) $(IO_FILES) $(MODULES_OBJ_FILES)
|
||||
DEBUG_BINDINGS_OBJ := $(DEBUG_OBJ_FILES) $(DEBUG_WEBCORE_OBJ_FILES) $(DEBUG_SQLITE_OBJ_FILES) $(DEBUG_NODE_OS_OBJ_FILES) $(DEBUG_BUILTINS_OBJ_FILES) $(DEBUG_IO_FILES) $(DEBUG_MODULES_OBJ_FILES)
|
||||
|
||||
MAC_INCLUDE_DIRS := -I$(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders \
|
||||
-I$(WEBKIT_RELEASE_DIR)/WTF/Headers \
|
||||
ALL_JSC_INCLUDE_DIRS := -I$(WEBKIT_RELEASE_DIR)/WTF/Headers \
|
||||
-I$(WEBKIT_RELEASE_DIR)/ICU/Headers \
|
||||
-I$(WEBKIT_RELEASE_DIR)/bmalloc/Headers \
|
||||
-I$(WEBKIT_RELEASE_DIR)/ \
|
||||
-Isrc/bun.js/bindings/ \
|
||||
-Isrc/bun.js/builtins/ \
|
||||
-Isrc/bun.js/bindings/webcore \
|
||||
-Isrc/bun.js/bindings/sqlite \
|
||||
-Isrc/bun.js/builtins/cpp \
|
||||
-Isrc/bun.js/bindings/node_os \
|
||||
-Isrc/bun.js/modules \
|
||||
-I$(WEBKIT_DIR)/Source/bmalloc \
|
||||
-I$(WEBKIT_DIR)/Source \
|
||||
-I$(WEBKIT_RELEASE_DIR)/include \
|
||||
-I$(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders \
|
||||
-I$(WEBKIT_RELEASE_DIR)/bmalloc/PrivateHeaders \
|
||||
-I$(WEBKIT_RELEASE_DIR)/WTF/PrivateHeaders
|
||||
|
||||
SHARED_INCLUDE_DIR = -I$(realpath src/bun.js/bindings)/ \
|
||||
-I$(realpath src/bun.js/builtins/) \
|
||||
-I$(realpath src/bun.js/bindings) \
|
||||
-I$(realpath src/bun.js/bindings/webcore) \
|
||||
-I$(realpath src/bun.js/bindings/webcrypto) \
|
||||
-I$(realpath src/bun.js/bindings/sqlite) \
|
||||
-I$(realpath src/bun.js/builtins/cpp) \
|
||||
-I$(realpath src/bun.js/bindings/node_os) \
|
||||
-I$(realpath src/bun.js/modules) \
|
||||
-I$(JSC_INCLUDE_DIR)
|
||||
|
||||
LINUX_INCLUDE_DIRS := -I$(JSC_INCLUDE_DIR) \
|
||||
-Isrc/bun.js/builtins/ \
|
||||
-Isrc/bun.js/bindings/ \
|
||||
-Isrc/bun.js/bindings/webcore \
|
||||
-Isrc/bun.js/bindings/sqlite \
|
||||
-Isrc/bun.js/builtins/cpp \
|
||||
-Isrc/bun.js/bindings/node_os \
|
||||
-Isrc/bun.js/modules \
|
||||
MAC_INCLUDE_DIRS := $(ALL_JSC_INCLUDE_DIRS) \
|
||||
$(SHARED_INCLUDE_DIR) \
|
||||
-I$(WEBKIT_DIR)/Source \
|
||||
|
||||
LINUX_INCLUDE_DIRS := $(ALL_JSC_INCLUDE_DIRS) \
|
||||
$(SHARED_INCLUDE_DIR) \
|
||||
-I$(ZLIB_INCLUDE_DIR)
|
||||
|
||||
|
||||
UWS_INCLUDE_DIR := -I$(BUN_DEPS_DIR)/uws/uSockets/src -I$(BUN_DEPS_DIR)/uws/src -I$(BUN_DEPS_DIR)
|
||||
|
||||
|
||||
INCLUDE_DIRS := $(UWS_INCLUDE_DIR) -I$(BUN_DEPS_DIR)/mimalloc/include -Isrc/napi
|
||||
INCLUDE_DIRS := $(UWS_INCLUDE_DIR) -I$(BUN_DEPS_DIR)/mimalloc/include -Isrc/napi -I$(BUN_DEPS_DIR)/boringssl/include -I$(BUN_DEPS_DIR)/c-ares/include
|
||||
|
||||
|
||||
ifeq ($(OS_NAME),linux)
|
||||
@@ -363,11 +405,11 @@ ifeq ($(OS_NAME), darwin)
|
||||
SYMBOLS=-exported_symbols_list $(realpath src/symbols.txt)
|
||||
PLATFORM_LINKER_FLAGS += -DDU_DISABLE_RENAMING=1 \
|
||||
-lstdc++ \
|
||||
-fno-keep-static-consts
|
||||
-fno-keep-static-consts -lresolv
|
||||
endif
|
||||
|
||||
ifeq ($(OS_NAME),linux)
|
||||
SYMBOLS=-Wl,--dynamic-list $(realpath src/symbols.dyn)
|
||||
SYMBOLS=-Wl,--dynamic-list $(realpath src/symbols.dyn) -Wl,--version-script=$(realpath src/linker.lds)
|
||||
endif
|
||||
|
||||
SHARED_LIB_EXTENSION = .so
|
||||
@@ -390,23 +432,38 @@ MINIMUM_ARCHIVE_FILES = -L$(BUN_DEPS_OUT_DIR) \
|
||||
-lz \
|
||||
$(BUN_DEPS_OUT_DIR)/picohttpparser.o \
|
||||
$(_MIMALLOC_LINK) \
|
||||
-ldecrepit \
|
||||
-lssl \
|
||||
-lcrypto \
|
||||
-llolhtml \
|
||||
$(BUN_DEPS_OUT_DIR)/libbacktrace.a
|
||||
-llolhtml
|
||||
|
||||
ARCHIVE_FILES_WITHOUT_LIBCRYPTO = $(MINIMUM_ARCHIVE_FILES) \
|
||||
-larchive \
|
||||
-lbase64 \
|
||||
-ltcc \
|
||||
-lusockets \
|
||||
-lcares \
|
||||
$(BUN_DEPS_OUT_DIR)/libuwsockets.o
|
||||
|
||||
ARCHIVE_FILES = $(ARCHIVE_FILES_WITHOUT_LIBCRYPTO)
|
||||
ARCHIVE_FILES = $(ARCHIVE_FILES_WITHOUT_LIBCRYPTO)
|
||||
|
||||
STATIC_MUSL_FLAG ?=
|
||||
|
||||
WRAP_SYMBOLS_ON_LINUX =
|
||||
|
||||
ifeq ($(OS_NAME), linux)
|
||||
WRAP_SYMBOLS_ON_LINUX = -Wl,--wrap=fcntl -Wl,--wrap=fcntl64 -Wl,--wrap=stat64 -Wl,--wrap=pow -Wl,--wrap=exp -Wl,--wrap=log -Wl,--wrap=log2 \
|
||||
-Wl,--wrap=lstat \
|
||||
-Wl,--wrap=stat \
|
||||
-Wl,--wrap=fstat \
|
||||
-Wl,--wrap=fstatat \
|
||||
-Wl,--wrap=lstat64 \
|
||||
-Wl,--wrap=stat64 \
|
||||
-Wl,--wrap=fstat64 \
|
||||
-Wl,--wrap=fstatat64 \
|
||||
-Wl,--wrap=mknod \
|
||||
-Wl,--wrap=mknodat \
|
||||
-Wl,--wrap=statx
|
||||
|
||||
PLATFORM_LINKER_FLAGS = $(BUN_CFLAGS) \
|
||||
-fuse-ld=lld \
|
||||
-Wl,-z,now \
|
||||
@@ -417,15 +474,15 @@ PLATFORM_LINKER_FLAGS = $(BUN_CFLAGS) \
|
||||
-static-libgcc \
|
||||
-fno-omit-frame-pointer \
|
||||
-Wl,--compress-debug-sections,zlib \
|
||||
-l:libatomic.a \
|
||||
${STATIC_MUSL_FLAG} \
|
||||
-Wl,-Bsymbolic-functions \
|
||||
-fno-semantic-interposition \
|
||||
-flto \
|
||||
-Wl,--allow-multiple-definition \
|
||||
-rdynamic
|
||||
|
||||
|
||||
|
||||
|
||||
endif
|
||||
|
||||
|
||||
@@ -438,9 +495,9 @@ BUN_LLD_FLAGS_WITHOUT_JSC = $(ARCHIVE_FILES) \
|
||||
|
||||
|
||||
|
||||
BUN_LLD_FLAGS = $(BUN_LLD_FLAGS_WITHOUT_JSC) $(JSC_FILES) $(BINDINGS_OBJ)
|
||||
BUN_LLD_FLAGS_DEBUG = $(BUN_LLD_FLAGS_WITHOUT_JSC) $(JSC_FILES_DEBUG) $(DEBUG_BINDINGS_OBJ)
|
||||
BUN_LLD_FLAGS_FAST = $(BUN_LLD_FLAGS_WITHOUT_JSC) $(JSC_FILES_DEBUG) $(BINDINGS_OBJ)
|
||||
BUN_LLD_FLAGS = $(BUN_LLD_FLAGS_WITHOUT_JSC) $(WRAP_SYMBOLS_ON_LINUX) $(JSC_FILES) $(BINDINGS_OBJ) -lwebcrypto
|
||||
BUN_LLD_FLAGS_DEBUG = $(BUN_LLD_FLAGS_WITHOUT_JSC) $(WRAP_SYMBOLS_ON_LINUX) $(JSC_FILES_DEBUG) $(DEBUG_BINDINGS_OBJ) -lwebcrypto-debug
|
||||
BUN_LLD_FLAGS_FAST = $(BUN_LLD_FLAGS_WITHOUT_JSC) $(WRAP_SYMBOLS_ON_LINUX) $(JSC_FILES_DEBUG) $(BINDINGS_OBJ) -lwebcrypto-debug
|
||||
|
||||
CLANG_VERSION = $(shell $(CC) --version | awk '/version/ {for(i=1; i<=NF; i++){if($$i=="version"){split($$(i+1),v,".");print v[1]}}}')
|
||||
|
||||
@@ -449,16 +506,12 @@ CLANG_VERSION = $(shell $(CC) --version | awk '/version/ {for(i=1; i<=NF; i++){i
|
||||
bun:
|
||||
|
||||
npm-install:
|
||||
$(NPM_CLIENT) install
|
||||
$(NPM_CLIENT) install --ignore-scripts --production
|
||||
|
||||
print-% : ; @echo $* = $($*)
|
||||
|
||||
|
||||
|
||||
.PHONY: base64
|
||||
base64:
|
||||
cd src/base64 && \
|
||||
rm -rf src/base64/*.{o,ll,bc} && \
|
||||
$(CC) $(EMIT_LLVM_FOR_RELEASE) $(BUN_CFLAGS) $(OPTIMIZATION_LEVEL) -g -fPIC -c *.c -I$(SRC_DIR)/base64 && \
|
||||
$(CXX) $(EMIT_LLVM_FOR_RELEASE) $(CXXFLAGS) $(BUN_CFLAGS) -c neonbase64.cc -g -fPIC && \
|
||||
$(AR) rcvs $(BUN_DEPS_OUT_DIR)/libbase64.a ./*.o
|
||||
|
||||
# Prevent dependency on libtcc1 so it doesn't do filesystem lookups
|
||||
TINYCC_CFLAGS= -DTCC_LIBTCC1=\"\0\"
|
||||
@@ -470,7 +523,7 @@ TINYCC_CFLAGS= -DTCC_LIBTCC1=\"\0\"
|
||||
tinycc:
|
||||
cd $(TINYCC_DIR) && \
|
||||
make clean && \
|
||||
AR=$(AR) CC=$(CC) CFLAGS='$(CFLAGS_WITHOUT_MARCH) $(NATIVE_OR_OLD_MARCH) -mtune=native $(TINYCC_CFLAGS)' ./configure --enable-static --cc=$(CC) --ar=$(AR) --config-predefs=yes && \
|
||||
AR=$(AR) $(CCACHE_CC_FLAG) CFLAGS='$(CFLAGS_WITHOUT_MARCH) $(NATIVE_OR_OLD_MARCH) -mtune=native $(TINYCC_CFLAGS)' ./configure --enable-static --cc=$(CCACHE_CC_OR_CC) --ar=$(AR) --config-predefs=yes && \
|
||||
make -j10 && \
|
||||
cp $(TINYCC_DIR)/*.a $(BUN_DEPS_OUT_DIR)
|
||||
|
||||
@@ -482,9 +535,13 @@ builtins: ## to generate builtins
|
||||
$(shell which python || which python2) $(realpath $(WEBKIT_DIR)/Source/JavaScriptCore/Scripts/generate-js-builtins.py) -i $(realpath src)/bun.js/builtins/js -o $(realpath src)/bun.js/builtins/cpp --framework WebCore --force
|
||||
$(shell which python || which python2) $(realpath $(WEBKIT_DIR)/Source/JavaScriptCore/Scripts/generate-js-builtins.py) -i $(realpath src)/bun.js/builtins/js -o $(realpath src)/bun.js/builtins/cpp --framework WebCore --wrappers-only
|
||||
rm -rf /tmp/1.h src/bun.js/builtins/cpp/WebCoreJSBuiltinInternals.h.1
|
||||
echo -e '// clang-format off\nnamespace Zig { class GlobalObject; }' >> /tmp/1.h
|
||||
echo -e '// clang-format off\nnamespace Zig { class GlobalObject; }\n#include "root.h"\n' >> /tmp/1.h
|
||||
cat /tmp/1.h src/bun.js/builtins/cpp/WebCoreJSBuiltinInternals.h > src/bun.js/builtins/cpp/WebCoreJSBuiltinInternals.h.1
|
||||
mv src/bun.js/builtins/cpp/WebCoreJSBuiltinInternals.h.1 src/bun.js/builtins/cpp/WebCoreJSBuiltinInternals.h
|
||||
rm -rf /tmp/1.h src/bun.js/builtins/cpp/WebCoreJSBuiltinInternals.h.1
|
||||
echo -e '// clang-format off\nnamespace Zig { class GlobalObject; }\n#include "root.h"\n' >> /tmp/1.h
|
||||
cat /tmp/1.h src/bun.js/builtins/cpp/WebCoreJSBuiltinInternals.cpp > src/bun.js/builtins/cpp/WebCoreJSBuiltinInternals.cpp.1
|
||||
mv src/bun.js/builtins/cpp/WebCoreJSBuiltinInternals.cpp.1 src/bun.js/builtins/cpp/WebCoreJSBuiltinInternals.cpp
|
||||
$(SED) -i -e 's/class JSDOMGlobalObject/using JSDOMGlobalObject = Zig::GlobalObject/' src/bun.js/builtins/cpp/WebCoreJSBuiltinInternals.h
|
||||
# this is the one we actually build
|
||||
mv src/bun.js/builtins/cpp/*JSBuiltin*.cpp src/bun.js/builtins
|
||||
@@ -492,14 +549,25 @@ builtins: ## to generate builtins
|
||||
.PHONY: generate-builtins
|
||||
generate-builtins: builtins
|
||||
|
||||
.PHONY: tinycc
|
||||
vendor-without-check: npm-install node-fallbacks runtime_js fallback_decoder bun_error mimalloc picohttp zlib boringssl libarchive libbacktrace lolhtml usockets uws base64 tinycc
|
||||
|
||||
BUN_TYPES_REPO_PATH ?= $(realpath ../bun-types)
|
||||
|
||||
BUN_TYPES_REPO_PATH ?= $(realpath packages/bun-types)
|
||||
|
||||
ifeq ($(DEBUG),true)
|
||||
BUN_RELEASE_BIN = bun
|
||||
endif
|
||||
|
||||
.PHONY: c-ares
|
||||
c-ares:
|
||||
rm -rf $(BUN_DEPS_DIR)/c-ares/build && \
|
||||
mkdir $(BUN_DEPS_DIR)/c-ares/build && \
|
||||
cd $(BUN_DEPS_DIR)/c-ares/build && \
|
||||
cmake $(CMAKE_FLAGS) -DCMAKE_C_FLAGS="$(CFLAGS) -flto=full" -DCMAKE_BUILD_TYPE=Release -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_SHARED=OFF -G "Ninja" .. && \
|
||||
ninja && cp lib/libcares.a $(BUN_DEPS_OUT_DIR)/libcares.a
|
||||
|
||||
.PHONY: prepare-types
|
||||
prepare-types:
|
||||
BUN_VERSION=$(PACKAGE_JSON_VERSION) $(BUN_RELEASE_BIN) $(BUN_TYPES_REPO_PATH)/bundle.ts $(BUN_TYPES_REPO_PATH)/dist
|
||||
BUN_VERSION=$(PACKAGE_JSON_VERSION) $(BUN_RELEASE_BIN) $(BUN_TYPES_REPO_PATH)/scripts/bundle.ts $(BUN_TYPES_REPO_PATH)/dist
|
||||
echo "Generated types for $(PACKAGE_JSON_VERSION) in $(BUN_TYPES_REPO_PATH)/dist"
|
||||
cp $(BUN_TYPES_REPO_PATH)/dist/types.d.ts /tmp/bun-types.d.ts
|
||||
cd /tmp && $(PACKAGE_DIR)/../../node_modules/.bin/tsc /tmp/bun-types.d.ts
|
||||
@@ -507,12 +575,13 @@ prepare-types:
|
||||
release-types:
|
||||
# can be removed when/if "bun publish" is implemented
|
||||
@npm --version >/dev/null 2>&1 || (echo -e "ERROR: npm is required."; exit 1)
|
||||
cd $(BUN_TYPES_REPO_PATH)/dist && npm publish
|
||||
cd $(BUN_TYPES_REPO_PATH)/dist && npm publish --dry-run
|
||||
|
||||
.PHONY: format
|
||||
format: ## to format the code
|
||||
$(PRETTIER) --write test/bun.js/*.js
|
||||
$(PRETTIER) --write test/bun.js/solid-dom-fixtures/**/*.js
|
||||
-$(PRETTIER) --write 'test/bun.js/*.{js,jsx,ts,tsx}'
|
||||
-$(PRETTIER) --write 'test/bun.js/solid-dom-fixtures/**/*.{js,jsx,ts,tsx}'
|
||||
|
||||
|
||||
.PHONY: lolhtml
|
||||
lolhtml:
|
||||
@@ -521,7 +590,7 @@ lolhtml:
|
||||
# no asm is not worth it!!
|
||||
.PHONY: boringssl-build
|
||||
boringssl-build:
|
||||
cd $(BUN_DEPS_DIR)/boringssl && mkdir -p build && cd build && CFLAGS="$(CFLAGS)" cmake $(CMAKE_FLAGS) -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -GNinja .. && ninja
|
||||
cd $(BUN_DEPS_DIR)/boringssl && mkdir -p build && cd build && CFLAGS="$(CFLAGS)" cmake $(CMAKE_FLAGS) -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -GNinja .. && ninja libcrypto.a libssl.a libdecrepit.a
|
||||
|
||||
.PHONY: boringssl-build-debug
|
||||
boringssl-build-debug:
|
||||
@@ -530,6 +599,7 @@ boringssl-build-debug:
|
||||
boringssl-copy:
|
||||
cp $(BUN_DEPS_DIR)/boringssl/build/ssl/libssl.a $(BUN_DEPS_OUT_DIR)/libssl.a
|
||||
cp $(BUN_DEPS_DIR)/boringssl/build/crypto/libcrypto.a $(BUN_DEPS_OUT_DIR)/libcrypto.a
|
||||
cp $(BUN_DEPS_DIR)/boringssl/build/decrepit/libdecrepit.a $(BUN_DEPS_OUT_DIR)/libdecrepit.a
|
||||
|
||||
.PHONY: boringssl
|
||||
boringssl: boringssl-build boringssl-copy
|
||||
@@ -540,14 +610,6 @@ boringssl-debug: boringssl-build-debug boringssl-copy
|
||||
compile-ffi-test:
|
||||
clang $(OPTIMIZATION_LEVEL) -shared -undefined dynamic_lookup -o /tmp/bun-ffi-test.dylib -fPIC ./test/bun.js/ffi-test.c
|
||||
|
||||
.PHONY: libbacktrace
|
||||
libbacktrace:
|
||||
cd $(BUN_DEPS_DIR)/libbacktrace && \
|
||||
CFLAGS="$(CFLAGS)" CC=$(CC) ./configure --disable-shared --enable-static --with-pic && \
|
||||
make -j$(CPUS) && \
|
||||
cp ./.libs/libbacktrace.a $(BUN_DEPS_OUT_DIR)/libbacktrace.a
|
||||
|
||||
|
||||
sqlite:
|
||||
|
||||
|
||||
@@ -557,7 +619,7 @@ libarchive:
|
||||
(make clean || echo ""); \
|
||||
(./build/clean.sh || echo ""); \
|
||||
./build/autogen.sh; \
|
||||
CFLAGS="$(CFLAGS)" CC=$(CC) ./configure --disable-shared --enable-static --with-pic --disable-bsdtar --disable-bsdcat --disable-rpath --enable-posix-regex-lib --without-xml2 --without-expat --without-openssl --without-iconv --without-zlib; \
|
||||
CFLAGS="$(CFLAGS)" $(CCACHE_CC_FLAG) ./configure --disable-shared --enable-static --with-pic --disable-bsdtar --disable-bsdcat --disable-rpath --enable-posix-regex-lib --without-xml2 --without-expat --without-openssl --without-iconv --without-zlib; \
|
||||
make -j${CPUS}; \
|
||||
cp ./.libs/libarchive.a $(BUN_DEPS_OUT_DIR)/libarchive.a;
|
||||
|
||||
@@ -573,11 +635,8 @@ tgz-debug:
|
||||
$(CXX) $(DEBUG_PACKAGE_DIR)/tgz.o -g -o ./misctools/tgz $(DEFAULT_LINKER_FLAGS) -lc $(ARCHIVE_FILES)
|
||||
rm -rf $(DEBUG_PACKAGE_DIR)/tgz.o
|
||||
|
||||
vendor: require init-submodules vendor-without-check
|
||||
|
||||
zlib:
|
||||
cd $(BUN_DEPS_DIR)/zlib; CFLAGS="$(CFLAGS)" cmake $(CMAKE_FLAGS) .; CFLAGS="$(CFLAGS)" make;
|
||||
cp $(BUN_DEPS_DIR)/zlib/libz.a $(BUN_DEPS_OUT_DIR)/libz.a
|
||||
cd $(BUN_DEPS_DIR)/zlib; make clean; $(CCACHE_CC_FLAG) CFLAGS="$(CFLAGS)" ./configure --static && make -j${CPUS} && cp ./libz.a $(BUN_DEPS_OUT_DIR)/libz.a
|
||||
|
||||
ifeq ($(POSIX_PKG_MANAGER), brew)
|
||||
PKGNAME_NINJA := ninja
|
||||
@@ -588,14 +647,14 @@ endif
|
||||
.PHONY: require
|
||||
require:
|
||||
@echo "Checking if the required utilities are available..."
|
||||
@if [ $(CLANG_VERSION) -lt "13" ]; then echo -e "ERROR: clang version >=13 required, found: $(CLANG_VERSION). Install with:\n\n $(POSIX_PKG_MANAGER) install llvm@13"; exit 1; fi
|
||||
@if [ $(CLANG_VERSION) -lt "15" ]; then echo -e "ERROR: clang version >=15 required, found: $(CLANG_VERSION). Install with:\n\n $(POSIX_PKG_MANAGER) install llvm@15"; exit 1; fi
|
||||
@cmake --version >/dev/null 2>&1 || (echo -e "ERROR: cmake is required."; exit 1)
|
||||
@esbuild --version >/dev/null 2>&1 || (echo -e "ERROR: esbuild is required."; exit 1)
|
||||
@$(NPM_CLIENT) --version >/dev/null 2>&1 || (echo -e "ERROR: NPM client (bun or npm) is required."; exit 1)
|
||||
@go version >/dev/null 2>&1 || (echo -e "ERROR: go is required."; exit 1)
|
||||
@which aclocal > /dev/null || (echo -e "ERROR: automake is required. Install with:\n\n $(POSIX_PKG_MANAGER) install automake"; exit 1)
|
||||
@which $(LIBTOOL) > /dev/null || (echo -e "ERROR: libtool is required. Install with:\n\n $(POSIX_PKG_MANAGER) install libtool"; exit 1)
|
||||
@which $(PKGNAME_NINJA) > /dev/null || (echo -e "ERROR: Ninja is required. Install with:\n\n $(POSIX_PKG_MANAGER) install $(PKGNAME_NINJA)"; exit 1)
|
||||
@which ninja > /dev/null || (echo -e "ERROR: Ninja is required. Install with:\n\n $(POSIX_PKG_MANAGER) install $(PKGNAME_NINJA)"; exit 1)
|
||||
@echo "You have the dependencies installed! Woo"
|
||||
|
||||
init-submodules:
|
||||
@@ -667,12 +726,12 @@ USOCKETS_SRC_DIR = $(BUN_DEPS_DIR)/uws/uSockets/src/
|
||||
|
||||
usockets:
|
||||
rm -rf $(BUN_DEPS_DIR)/uws/uSockets/*.o $(BUN_DEPS_DIR)/uws/uSockets/**/*.o $(BUN_DEPS_DIR)/uws/uSockets/*.a $(BUN_DEPS_DIR)/uws/uSockets/*.bc
|
||||
cd $(USOCKETS_DIR) && $(CC) -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc $(EMIT_LLVM_FOR_RELEASE) $(MACOS_MIN_FLAG) -fPIC $(CFLAGS) $(UWS_CC_FLAGS) -save-temps -I$(BUN_DEPS_DIR)/uws/uSockets/src $(UWS_LDFLAGS) -g $(DEFAULT_LINKER_FLAGS) $(PLATFORM_LINKER_FLAGS) $(OPTIMIZATION_LEVEL) -g -c $(wildcard $(USOCKETS_SRC_DIR)/*.c) $(wildcard $(USOCKETS_SRC_DIR)/**/*.c)
|
||||
cd $(USOCKETS_DIR) && $(CXX) -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc $(EMIT_LLVM_FOR_RELEASE) $(MACOS_MIN_FLAG) -fPIC $(CXXFLAGS) $(UWS_CXX_FLAGS) -save-temps -I$(BUN_DEPS_DIR)/uws/uSockets/src $(UWS_LDFLAGS) -g $(DEFAULT_LINKER_FLAGS) $(PLATFORM_LINKER_FLAGS) $(OPTIMIZATION_LEVEL) -g -c $(wildcard $(USOCKETS_SRC_DIR)/*.cpp) $(wildcard $(USOCKETS_SRC_DIR)/**/*.cpp)
|
||||
cd $(USOCKETS_DIR) && $(CC_WITH_CCACHE) -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc $(EMIT_LLVM_FOR_RELEASE) $(MACOS_MIN_FLAG) -fPIC $(CFLAGS) $(UWS_CC_FLAGS) -save-temps -I$(BUN_DEPS_DIR)/uws/uSockets/src $(UWS_LDFLAGS) -g $(DEFAULT_LINKER_FLAGS) $(PLATFORM_LINKER_FLAGS) $(OPTIMIZATION_LEVEL) -g -c $(wildcard $(USOCKETS_SRC_DIR)/*.c) $(wildcard $(USOCKETS_SRC_DIR)/**/*.c)
|
||||
cd $(USOCKETS_DIR) && $(CXX_WITH_CCACHE) -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc $(EMIT_LLVM_FOR_RELEASE) $(MACOS_MIN_FLAG) -fPIC $(CXXFLAGS) $(UWS_CXX_FLAGS) -save-temps -I$(BUN_DEPS_DIR)/uws/uSockets/src $(UWS_LDFLAGS) -g $(DEFAULT_LINKER_FLAGS) $(PLATFORM_LINKER_FLAGS) $(OPTIMIZATION_LEVEL) -g -c $(wildcard $(USOCKETS_SRC_DIR)/*.cpp) $(wildcard $(USOCKETS_SRC_DIR)/**/*.cpp)
|
||||
cd $(USOCKETS_DIR) && $(AR) rcvs $(BUN_DEPS_OUT_DIR)/libusockets.a $(USOCKETS_DIR)/*.{o,bc}
|
||||
|
||||
uws: usockets
|
||||
$(CXX) $(BITCODE_OR_SECTIONS) $(EMIT_LLVM_FOR_RELEASE) -fPIC -I$(BUN_DEPS_DIR)/uws/uSockets/src $(CLANG_FLAGS) $(CFLAGS) $(UWS_CXX_FLAGS) $(UWS_LDFLAGS) $(PLATFORM_LINKER_FLAGS) -c -I$(BUN_DEPS_DIR) $(BUN_DEPS_OUT_DIR)/libusockets.a $(BUN_DEPS_DIR)/libuwsockets.cpp -o $(BUN_DEPS_OUT_DIR)/libuwsockets.o
|
||||
$(CXX_WITH_CCACHE) $(EMIT_LLVM_FOR_RELEASE) -fPIC -I$(BUN_DEPS_DIR)/uws/uSockets/src $(CLANG_FLAGS) $(CFLAGS) $(UWS_CXX_FLAGS) $(UWS_LDFLAGS) $(PLATFORM_LINKER_FLAGS) -c -I$(BUN_DEPS_DIR) $(BUN_DEPS_OUT_DIR)/libusockets.a $(BUN_DEPS_DIR)/libuwsockets.cpp -o $(BUN_DEPS_OUT_DIR)/libuwsockets.o
|
||||
|
||||
.PHONY: sign-macos-x64
|
||||
sign-macos-x64:
|
||||
@@ -831,22 +890,30 @@ jsc: jsc-build jsc-copy-headers jsc-bindings
|
||||
.PHONY: jsc-build
|
||||
jsc-build: $(JSC_BUILD_STEPS)
|
||||
.PHONY: jsc-bindings
|
||||
jsc-bindings: headers bindings
|
||||
jsc-bindings: headers bindings webcrypto-debug webcrypto
|
||||
|
||||
.PHONY: clone-submodules
|
||||
clone-submodules:
|
||||
git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress
|
||||
|
||||
.PHONY: devcontainer
|
||||
devcontainer: $(OBJ_DIR) $(DEBUG_OBJ_DIR) clone-submodules libbacktrace mimalloc zlib libarchive boringssl picohttp identifier-cache node-fallbacks npm-install api analytics bun_error fallback_decoder bindings uws lolhtml usockets base64 tinycc runtime_js_dev sqlite dev
|
||||
devcontainer: $(OBJ_DIR) $(DEBUG_OBJ_DIR) clone-submodules mimalloc zlib libarchive boringssl picohttp identifier-cache node-fallbacks npm-install api analytics bun_error fallback_decoder bindings uws lolhtml usockets tinycc c-ares runtime_js_dev sqlite webcrypto-debug webcrypto
|
||||
|
||||
.PHONY: devcontainer-build
|
||||
devcontainer-build:
|
||||
DOCKER_BUILDARCH="$(DOCKER_BUILDARCH)" devcontainer build --workspace-folder .
|
||||
|
||||
.PHONY: devcontainer-open
|
||||
devcontainer-open:
|
||||
DOCKER_BUILDARCH="$(DOCKER_BUILDARCH)" devcontainer open
|
||||
.PHONY: devcontainer-up
|
||||
devcontainer-up:
|
||||
DOCKER_BUILDARCH="$(DOCKER_BUILDARCH)" devcontainer up --workspace-folder .
|
||||
|
||||
.PHONY: devcontainer-rebuild
|
||||
devcontainer-rebuild:
|
||||
DOCKER_BUILDARCH="$(DOCKER_BUILDARCH)" devcontainer up --workspace-folder . --remove-existing-container
|
||||
|
||||
.PHONY: devcontainer-sh
|
||||
devcontainer-sh:
|
||||
DOCKER_BUILDARCH="$(DOCKER_BUILDARCH)" devcontainer exec --workspace-folder . zsh
|
||||
|
||||
CLANG_FORMAT := $(shell command -v clang-format 2> /dev/null)
|
||||
|
||||
@@ -868,7 +935,7 @@ MIMALLOC_OVERRIDE_FLAG ?=
|
||||
|
||||
|
||||
bump:
|
||||
expr 0.1.0 + 1 > build-id
|
||||
expr 0.4.0 + 1 > build-id
|
||||
|
||||
.PHONY: identifier-cache
|
||||
identifier-cache:
|
||||
@@ -1176,6 +1243,11 @@ jsc-copy-headers:
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/OperandsInlines.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/OperandsInlines.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/Operands.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/Operands.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/domjit/DOMJITHeapRange.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/DOMJITHeapRange.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/runtime/GeneratorPrototype.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/GeneratorPrototype.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/runtime/GeneratorFunctionPrototype.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/GeneratorFunctionPrototype.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/runtime/AsyncFunctionPrototype.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/AsyncFunctionPrototype.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/runtime/SymbolObject.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/SymbolObject.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/runtime/JSGenerator.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/JSGenerator.h
|
||||
find $(WEBKIT_RELEASE_DIR)/JavaScriptCore/Headers/JavaScriptCore/ -name "*.h" -exec cp {} $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/ \;
|
||||
|
||||
# This is a workaround for a JSC bug that impacts aarch64
|
||||
@@ -1204,7 +1276,7 @@ jsc-build-mac-compile:
|
||||
-DUSE_PTHREAD_JIT_PERMISSIONS_API=ON \
|
||||
$(WEBKIT_DIR) \
|
||||
$(WEBKIT_RELEASE_DIR) && \
|
||||
CFLAGS="$(CFLAGS) $(BITCODE_OR_SECTIONS) -ffat-lto-objects" CXXFLAGS="$(CXXFLAGS) $(BITCODE_OR_SECTIONS) -ffat-lto-objects" \
|
||||
CFLAGS="$(CFLAGS) -ffat-lto-objects" CXXFLAGS="$(CXXFLAGS) -ffat-lto-objects" \
|
||||
cmake --build $(WEBKIT_RELEASE_DIR) --config Release --target jsc
|
||||
|
||||
.PHONY: jsc-build-mac-compile-lto
|
||||
@@ -1306,6 +1378,7 @@ clean: clean-bindings
|
||||
(cd $(BUN_DEPS_DIR)/boringssl && make clean) || echo "";
|
||||
(cd $(BUN_DEPS_DIR)/picohttp && make clean) || echo "";
|
||||
(cd $(BUN_DEPS_DIR)/zlib && make clean) || echo "";
|
||||
(cd $(BUN_DEPS_DIR)/c-ares && rm -rf build && make clean) || echo "";
|
||||
|
||||
.PHONY: release-bindings
|
||||
release-bindings: $(OBJ_DIR) $(OBJ_FILES) $(WEBCORE_OBJ_FILES) $(SQLITE_OBJ_FILES) $(NODE_OS_OBJ_FILES) $(BUILTINS_OBJ_FILES) $(IO_FILES) $(MODULES_OBJ_FILES)
|
||||
@@ -1373,6 +1446,7 @@ bun-link-lld-debug:
|
||||
$(DEBUG_BIN)/bun-debug.o \
|
||||
-W \
|
||||
-o $(DEBUG_BIN)/bun-debug
|
||||
@rm -f $(DEBUG_BIN)/bun-debug.o.o 2> /dev/null # workaround for https://github.com/ziglang/zig/issues/14080
|
||||
|
||||
bun-link-lld-debug-no-jsc:
|
||||
$(CXX) $(BUN_LLD_FLAGS_WITHOUT_JSC) $(SYMBOLS) \
|
||||
@@ -1401,6 +1475,7 @@ bun-link-lld-release:
|
||||
$(OPTIMIZATION_LEVEL) $(RELEASE_FLAGS)
|
||||
rm -rf $(BUN_RELEASE_BIN).dSYM
|
||||
cp $(BUN_RELEASE_BIN) $(BUN_RELEASE_BIN)-profile
|
||||
@rm -f $(BUN_RELEASE_BIN).o.o # workaround for https://github.com/ziglang/zig/issues/14080
|
||||
|
||||
bun-release-copy-obj:
|
||||
cp $(BUN_RELEASE_BIN).o $(BUN_DEPLOY_DIR).o
|
||||
@@ -1442,9 +1517,11 @@ wasm-return1:
|
||||
generate-classes:
|
||||
bun src/bun.js/scripts/generate-classes.ts
|
||||
$(ZIG) fmt src/bun.js/bindings/generated_classes.zig
|
||||
clang-format -i src/bun.js/bindings/ZigGeneratedClasses.h src/bun.js/bindings/ZigGeneratedClasses.cpp
|
||||
|
||||
generate-sink:
|
||||
bun src/bun.js/scripts/generate-jssink.js
|
||||
clang-format -i src/bun.js/bindings/JSSink.cpp src/bun.js/bindings/JSSink.h
|
||||
$(WEBKIT_DIR)/Source/JavaScriptCore/create_hash_table src/bun.js/bindings/JSSink.cpp > src/bun.js/bindings/JSSinkLookupTable.h
|
||||
$(SED) -i -e 's/#include "Lookup.h"//' src/bun.js/bindings/JSSinkLookupTable.h
|
||||
$(SED) -i -e 's/namespace JSC {//' src/bun.js/bindings/JSSinkLookupTable.h
|
||||
@@ -1465,7 +1542,7 @@ $(DEBUG_OBJ_DIR):
|
||||
mkdir -p $(DEBUG_OBJ_DIR)
|
||||
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
||||
$(CXX) $(CLANG_FLAGS) $(UWS_INCLUDE) \
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) $(UWS_INCLUDE) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
@@ -1475,7 +1552,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
||||
-c -o $@ $<
|
||||
|
||||
$(OBJ_DIR)/%.o: src/bun.js/modules/%.cpp
|
||||
$(CXX) $(CLANG_FLAGS) $(UWS_INCLUDE) \
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) $(UWS_INCLUDE) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
@@ -1485,7 +1562,7 @@ $(OBJ_DIR)/%.o: src/bun.js/modules/%.cpp
|
||||
-c -o $@ $<
|
||||
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/webcore/%.cpp
|
||||
$(CXX) $(CLANG_FLAGS) \
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
@@ -1495,7 +1572,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/webcore/%.cpp
|
||||
-c -o $@ $<
|
||||
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/sqlite/%.cpp
|
||||
$(CXX) $(CLANG_FLAGS) \
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
@@ -1505,7 +1582,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/sqlite/%.cpp
|
||||
-c -o $@ $<
|
||||
|
||||
$(OBJ_DIR)/%.o: src/io/%.cpp
|
||||
$(CXX) $(CLANG_FLAGS) \
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
@@ -1515,7 +1592,7 @@ $(OBJ_DIR)/%.o: src/io/%.cpp
|
||||
-c -o $@ $<
|
||||
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/node_os/%.cpp
|
||||
$(CXX) $(CLANG_FLAGS) \
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
@@ -1525,7 +1602,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/node_os/%.cpp
|
||||
-c -o $@ $<
|
||||
|
||||
$(OBJ_DIR)/%.o: src/bun.js/builtins/%.cpp
|
||||
$(CXX) $(CLANG_FLAGS) \
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
@@ -1536,88 +1613,153 @@ $(OBJ_DIR)/%.o: src/bun.js/builtins/%.cpp
|
||||
|
||||
# $(DEBUG_OBJ_DIR) is not included here because it breaks
|
||||
# detecting if a file needs to be rebuilt
|
||||
.PHONY: $(SRC_DIR)/%.cpp
|
||||
$(DEBUG_OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
||||
$(CXX) $(CLANG_FLAGS) $(UWS_INCLUDE) \
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) $(UWS_INCLUDE) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
-DBUN_DEBUG \
|
||||
$(EMIT_LLVM_FOR_DEBUG) \
|
||||
-g3 -c -o $@ $<
|
||||
|
||||
# $(DEBUG_OBJ_DIR) is not included here because it breaks
|
||||
# detecting if a file needs to be rebuilt
|
||||
.PHONY: $(SRC_DIR)/webcore/%.cpp
|
||||
$(DEBUG_OBJ_DIR)/%.o: $(SRC_DIR)/webcore/%.cpp
|
||||
$(CXX) $(CLANG_FLAGS) \
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
$(EMIT_LLVM_FOR_DEBUG) \
|
||||
-DBUN_DEBUG \
|
||||
-g3 -c -o $@ $<
|
||||
|
||||
.PHONY: src/io/%.cpp
|
||||
$(DEBUG_OBJ_DIR)/%.o: src/io/%.cpp
|
||||
$(CXX) $(CLANG_FLAGS) \
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
-DBUN_DEBUG \
|
||||
$(EMIT_LLVM_FOR_DEBUG) \
|
||||
-g3 -c -o $@ $<
|
||||
|
||||
|
||||
# $(DEBUG_OBJ_DIR) is not included here because it breaks
|
||||
# detecting if a file needs to be rebuilt
|
||||
.PHONY: $(SRC_DIR)/sqlite/%.cpp
|
||||
$(DEBUG_OBJ_DIR)/%.o: $(SRC_DIR)/sqlite/%.cpp
|
||||
$(CXX) $(CLANG_FLAGS) \
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
$(EMIT_LLVM_FOR_DEBUG) \
|
||||
-DBUN_DEBUG \
|
||||
-g3 -c -o $@ $<
|
||||
|
||||
# $(DEBUG_OBJ_DIR) is not included here because it breaks
|
||||
# detecting if a file needs to be rebuilt
|
||||
.PHONY: $(SRC_DIR)/node_os/%.cpp
|
||||
$(DEBUG_OBJ_DIR)/%.o: $(SRC_DIR)/node_os/%.cpp
|
||||
$(CXX) $(CLANG_FLAGS) \
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
$(EMIT_LLVM_FOR_DEBUG) \
|
||||
-DBUN_DEBUG \
|
||||
-g3 -c -o $@ $<
|
||||
|
||||
# $(DEBUG_OBJ_DIR) is not included here because it breaks
|
||||
# detecting if a file needs to be rebuilt
|
||||
.PHONY: src/bun.js/builtins/%.cpp
|
||||
$(DEBUG_OBJ_DIR)/%.o: src/bun.js/builtins/%.cpp
|
||||
$(CXX) $(CLANG_FLAGS) \
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
$(EMIT_LLVM_FOR_DEBUG) \
|
||||
-DBUN_DEBUG \
|
||||
-g3 -c -o $@ $<
|
||||
|
||||
.PHONY: src/bun.js/modules/%.cpp
|
||||
$(DEBUG_OBJ_DIR)/%.o: src/bun.js/modules/%.cpp
|
||||
$(CXX) $(CLANG_FLAGS) \
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
$(EMIT_LLVM_FOR_DEBUG) \
|
||||
-DBUN_DEBUG \
|
||||
-g3 -c -o $@ $<
|
||||
|
||||
|
||||
|
||||
$(DEBUG_OBJ_DIR)/webcrypto/%.o: src/bun.js/bindings/webcrypto/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
-I$(SRC_DIR) \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
$(EMIT_LLVM_FOR_DEBUG) \
|
||||
-DBUN_DEBUG \
|
||||
-g3 -c -o $@ $<
|
||||
|
||||
|
||||
|
||||
|
||||
.PHONY: webcrypto-debug-obj
|
||||
# Make all the .cpp files in the webcrypto directory into .o files using Makefile substitutions
|
||||
webcrypto-debug-obj: $(patsubst src/bun.js/bindings/webcrypto/%.cpp, $(DEBUG_OBJ_DIR)/webcrypto/%.o, $(wildcard src/bun.js/bindings/webcrypto/*.cpp))
|
||||
|
||||
.PHONY: webcrypto-debug
|
||||
webcrypto-debug:
|
||||
rm -rf $(DEBUG_OBJ_DIR)/webcrypto $(BUN_DEPS_OUT_DIR)/libwebcrypto-debug.a
|
||||
mkdir -p $(DEBUG_OBJ_DIR)/webcrypto
|
||||
make webcrypto-debug-obj -j$(CPUS)
|
||||
$(AR) rcs $(BUN_DEPS_OUT_DIR)/libwebcrypto-debug.a $(DEBUG_OBJ_DIR)/webcrypto/*.o
|
||||
|
||||
|
||||
$(OBJ_DIR)/webcrypto/%.o: src/bun.js/bindings/webcrypto/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
$(EMIT_LLVM_FOR_RELEASE) \
|
||||
-g3 -c -o $@ $<
|
||||
|
||||
|
||||
.PHONY: webcrypto-obj
|
||||
# Make all the .cpp files in the webcrypto directory into .o files using Makefile substitutions
|
||||
webcrypto-obj: $(patsubst src/bun.js/bindings/webcrypto/%.cpp, $(OBJ_DIR)/webcrypto/%.o, $(wildcard src/bun.js/bindings/webcrypto/*.cpp))
|
||||
|
||||
.PHONY: webcrypto
|
||||
webcrypto:
|
||||
rm -rf $(OBJ_DIR)/webcrypto $(BUN_DEPS_OUT_DIR)/libwebcrypto.a
|
||||
mkdir -p $(OBJ_DIR)/webcrypto
|
||||
make webcrypto-obj -j$(CPUS)
|
||||
$(AR) rcs $(BUN_DEPS_OUT_DIR)/libwebcrypto.a $(OBJ_DIR)/webcrypto/*.o
|
||||
|
||||
sizegen:
|
||||
mkdir -p $(BUN_TMP_DIR)
|
||||
$(CXX) src/bun.js/headergen/sizegen.cpp -Wl,-dead_strip -Wl,-dead_strip_dylibs -fuse-ld=lld -o $(BUN_TMP_DIR)/sizegen $(CLANG_FLAGS) -O1
|
||||
$(CXX) src/bun.js/headergen/sizegen.cpp -Wl,-dead_strip -Wl,-dead_strip_dylibs -fuse-ld=lld -o $(BUN_TMP_DIR)/sizegen $(CLANG_FLAGS) -O1
|
||||
$(BUN_TMP_DIR)/sizegen > src/bun.js/bindings/sizes.zig
|
||||
|
||||
|
||||
@@ -1778,7 +1920,15 @@ copy-to-bun-release-dir-bin:
|
||||
cp -r $(PACKAGE_DIR)/bun $(BUN_RELEASE_DIR)/bun
|
||||
cp -r $(PACKAGE_DIR)/bun-profile $(BUN_RELEASE_DIR)/bun-profile
|
||||
|
||||
PACKAGE_MAP = --pkg-begin thread_pool $(BUN_DIR)/src/thread_pool.zig --pkg-begin io $(BUN_DIR)/src/io/io_$(OS_NAME).zig --pkg-end --pkg-begin http $(BUN_DIR)/src/http_client_async.zig --pkg-begin strings $(BUN_DIR)/src/string_immutable.zig --pkg-end --pkg-begin picohttp $(BUN_DIR)/src/deps/picohttp.zig --pkg-end --pkg-begin io $(BUN_DIR)/src/io/io_darwin.zig --pkg-end --pkg-begin boringssl $(BUN_DIR)/src/boringssl.zig --pkg-end --pkg-begin thread_pool $(BUN_DIR)/src/thread_pool.zig --pkg-begin io $(BUN_DIR)/src/io/io_darwin.zig --pkg-end --pkg-begin http $(BUN_DIR)/src/http_client_async.zig --pkg-begin strings $(BUN_DIR)/src/string_immutable.zig --pkg-end --pkg-begin picohttp $(BUN_DIR)/src/deps/picohttp.zig --pkg-end --pkg-begin io $(BUN_DIR)/src/io/io_darwin.zig --pkg-end --pkg-begin boringssl $(BUN_DIR)/src/boringssl.zig --pkg-end --pkg-begin thread_pool $(BUN_DIR)/src/thread_pool.zig --pkg-end --pkg-end --pkg-end --pkg-end --pkg-end --pkg-begin picohttp $(BUN_DIR)/src/deps/picohttp.zig --pkg-end --pkg-begin io $(BUN_DIR)/src/io/io_darwin.zig --pkg-end --pkg-begin strings $(BUN_DIR)/src/string_immutable.zig --pkg-end --pkg-begin clap $(BUN_DIR)/src/deps/zig-clap/clap.zig --pkg-end --pkg-begin http $(BUN_DIR)/src/http_client_async.zig --pkg-begin strings $(BUN_DIR)/src/string_immutable.zig --pkg-end --pkg-begin picohttp $(BUN_DIR)/src/deps/picohttp.zig --pkg-end --pkg-begin io $(BUN_DIR)/src/io/io_darwin.zig --pkg-end --pkg-begin boringssl $(BUN_DIR)/src/boringssl.zig --pkg-end --pkg-begin thread_pool $(BUN_DIR)/src/thread_pool.zig --pkg-begin io $(BUN_DIR)/src/io/io_darwin.zig --pkg-end --pkg-begin http $(BUN_DIR)/src/http_client_async.zig --pkg-begin strings $(BUN_DIR)/src/string_immutable.zig --pkg-end --pkg-begin picohttp $(BUN_DIR)/src/deps/picohttp.zig --pkg-end --pkg-begin io $(BUN_DIR)/src/io/io_darwin.zig --pkg-end --pkg-begin boringssl $(BUN_DIR)/src/boringssl.zig --pkg-end --pkg-begin thread_pool $(BUN_DIR)/src/thread_pool.zig --pkg-end --pkg-end --pkg-end --pkg-end --pkg-begin boringssl $(BUN_DIR)/src/boringssl.zig --pkg-end --pkg-begin javascript_core $(BUN_DIR)/src/jsc.zig --pkg-begin http $(BUN_DIR)/src/http_client_async.zig --pkg-end --pkg-begin strings $(BUN_DIR)/src/string_immutable.zig --pkg-end --pkg-begin picohttp $(BUN_DIR)/src/deps/picohttp.zig --pkg-end --pkg-end
|
||||
PACKAGE_MAP = --pkg-begin async_io $(BUN_DIR)/src/io/io_darwin.zig --pkg-begin bun $(BUN_DIR)/src/bun_redirect.zig --pkg-end --pkg-end --pkg-begin javascript_core $(BUN_DIR)/src/jsc.zig --pkg-begin bun $(BUN_DIR)/src/bun_redirect.zig --pkg-end --pkg-end --pkg-begin bun $(BUN_DIR)/src/bun_redirect.zig --pkg-end
|
||||
|
||||
|
||||
.PHONY: vendor-without-check
|
||||
vendor-without-check: npm-install node-fallbacks runtime_js fallback_decoder bun_error mimalloc picohttp zlib boringssl libarchive lolhtml sqlite usockets uws tinycc c-ares
|
||||
|
||||
.PHONY: vendor
|
||||
vendor: require init-submodules vendor-without-check
|
||||
|
||||
.PHONY: bun
|
||||
bun: vendor identifier-cache build-obj bun-link-lld-release bun-codesign-release-local
|
||||
|
||||
|
||||
BIN
bench/bun.lockb
Executable file
BIN
bench/bun.lockb
Executable file
Binary file not shown.
169
bench/expect-to-equal/.gitignore
vendored
Normal file
169
bench/expect-to-equal/.gitignore
vendored
Normal file
@@ -0,0 +1,169 @@
|
||||
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
|
||||
|
||||
# Logs
|
||||
|
||||
logs
|
||||
_.log
|
||||
npm-debug.log_
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
|
||||
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
||||
|
||||
# Runtime data
|
||||
|
||||
pids
|
||||
_.pid
|
||||
_.seed
|
||||
\*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
|
||||
coverage
|
||||
\*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Snowpack dependency directory (https://snowpack.dev/)
|
||||
|
||||
web_modules/
|
||||
|
||||
# TypeScript cache
|
||||
|
||||
\*.tsbuildinfo
|
||||
|
||||
# Optional npm cache directory
|
||||
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
|
||||
.eslintcache
|
||||
|
||||
# Optional stylelint cache
|
||||
|
||||
.stylelintcache
|
||||
|
||||
# Microbundle cache
|
||||
|
||||
.rpt2_cache/
|
||||
.rts2_cache_cjs/
|
||||
.rts2_cache_es/
|
||||
.rts2_cache_umd/
|
||||
|
||||
# Optional REPL history
|
||||
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
|
||||
\*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variable files
|
||||
|
||||
.env
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.local
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
|
||||
.cache
|
||||
.parcel-cache
|
||||
|
||||
# Next.js build output
|
||||
|
||||
.next
|
||||
out
|
||||
|
||||
# Nuxt.js build / generate output
|
||||
|
||||
.nuxt
|
||||
dist
|
||||
|
||||
# Gatsby files
|
||||
|
||||
.cache/
|
||||
|
||||
# Comment in the public line in if your project uses Gatsby and not Next.js
|
||||
|
||||
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||
|
||||
# public
|
||||
|
||||
# vuepress build output
|
||||
|
||||
.vuepress/dist
|
||||
|
||||
# vuepress v2.x temp and cache directory
|
||||
|
||||
.temp
|
||||
.cache
|
||||
|
||||
# Docusaurus cache and generated files
|
||||
|
||||
.docusaurus
|
||||
|
||||
# Serverless directories
|
||||
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
|
||||
.dynamodb/
|
||||
|
||||
# TernJS port file
|
||||
|
||||
.tern-port
|
||||
|
||||
# Stores VSCode versions used for testing VSCode extensions
|
||||
|
||||
.vscode-test
|
||||
|
||||
# yarn v2
|
||||
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.\*
|
||||
43
bench/expect-to-equal/README.md
Normal file
43
bench/expect-to-equal/README.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# expect-to-equal
|
||||
|
||||
To install dependencies:
|
||||
|
||||
```bash
|
||||
bun install
|
||||
```
|
||||
|
||||
To run in Bun:
|
||||
|
||||
```bash
|
||||
# so it doesn't run the vitest one
|
||||
bun wiptest expect-to-equal.test.js
|
||||
```
|
||||
|
||||
To run in Jest:
|
||||
|
||||
```bash
|
||||
# If you remove the import the performance doesn't change much
|
||||
NODE_OPTIONS="--experimental-vm-modules" ./node_modules/.bin/jest expect-to-equal.test.js
|
||||
```
|
||||
|
||||
To run in Vitest:
|
||||
|
||||
```bash
|
||||
./node_modules/.bin/vitest --run expect-to-equal.vitest.test.js
|
||||
```
|
||||
|
||||
Output on my machine (M1):
|
||||
|
||||
bun:test (bun v0.3.0):
|
||||
|
||||
> [36.40ms] expect().toEqual() x 10000
|
||||
|
||||
jest (node v18.11.0)
|
||||
|
||||
> expect().toEqual() x 10000: 5053 ms
|
||||
|
||||
vitest (node v18.11.0)
|
||||
|
||||
> expect().toEqual() x 10000: 401.08ms
|
||||
|
||||
This project was created using `bun init` in bun v0.3.0. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
||||
BIN
bench/expect-to-equal/bun.lockb
Executable file
BIN
bench/expect-to-equal/bun.lockb
Executable file
Binary file not shown.
42
bench/expect-to-equal/expect-to-equal.test.js
Normal file
42
bench/expect-to-equal/expect-to-equal.test.js
Normal file
@@ -0,0 +1,42 @@
|
||||
// bun:test automatically rewrites this import to bun:test when run in bun
|
||||
import { test, expect } from "@jest/globals";
|
||||
|
||||
const N = parseInt(process.env.RUN_COUNT || "10000", 10);
|
||||
if (!Number.isSafeInteger(N)) {
|
||||
throw new Error("Invalid RUN_COUNT");
|
||||
}
|
||||
|
||||
const label = "expect().toEqual() x " + N;
|
||||
|
||||
test(label, () => {
|
||||
console.time(label);
|
||||
for (let runsLeft = N; runsLeft > 0; runsLeft--) {
|
||||
expect("hello").toEqual("hello");
|
||||
expect(123).toEqual(123);
|
||||
|
||||
expect({ a: 1, b: 2 }).toEqual({ b: 2, a: 1 });
|
||||
expect([1, 2, 3]).toEqual([1, 2, 3]);
|
||||
expect({ a: 1, b: 2 }).not.toEqual({ b: 2, a: 1, c: 3 });
|
||||
expect([1, 2, 3]).not.toEqual([1, 2, 3, 4]);
|
||||
expect({ a: 1, b: 2, c: 3 }).not.toEqual({ a: 1, b: 2 });
|
||||
expect([1, 2, 3, 4]).not.toEqual([1, 2, 3]);
|
||||
|
||||
let a = [{ a: 1 }, { b: 2, c: 3, d: 4 }, { e: 5, f: 6 }];
|
||||
let b = [{ a: 1 }, { b: 2, c: 3, d: 4 }, { e: 5, f: 6 }];
|
||||
expect(a).toEqual(b);
|
||||
expect(b).toEqual(a);
|
||||
a[0].a = 2;
|
||||
expect(a).not.toEqual(b);
|
||||
expect(b).not.toEqual(a);
|
||||
|
||||
let c = { [Symbol("test")]: 1 };
|
||||
let d = { [Symbol("test")]: 1 };
|
||||
expect(c).not.toEqual(d);
|
||||
expect(d).not.toEqual(c);
|
||||
|
||||
a = { a: 1, b: 2, c: 3 };
|
||||
b = { a: 1, b: 2 };
|
||||
expect(a).not.toEqual(b);
|
||||
}
|
||||
console.timeEnd(label);
|
||||
});
|
||||
41
bench/expect-to-equal/expect-to-equal.vitest.test.js
Normal file
41
bench/expect-to-equal/expect-to-equal.vitest.test.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import { test, expect } from "vitest";
|
||||
|
||||
const N = parseInt(process.env.RUN_COUNT || "10000", 10);
|
||||
if (!Number.isSafeInteger(N)) {
|
||||
throw new Error("Invalid RUN_COUNT");
|
||||
}
|
||||
|
||||
const label = "expect().toEqual() x " + N;
|
||||
|
||||
test(label, () => {
|
||||
console.time(label);
|
||||
for (let runsLeft = N; runsLeft > 0; runsLeft--) {
|
||||
expect("hello").toEqual("hello");
|
||||
expect(123).toEqual(123);
|
||||
|
||||
expect({ a: 1, b: 2 }).toEqual({ b: 2, a: 1 });
|
||||
expect([1, 2, 3]).toEqual([1, 2, 3]);
|
||||
expect({ a: 1, b: 2 }).not.toEqual({ b: 2, a: 1, c: 3 });
|
||||
expect([1, 2, 3]).not.toEqual([1, 2, 3, 4]);
|
||||
expect({ a: 1, b: 2, c: 3 }).not.toEqual({ a: 1, b: 2 });
|
||||
expect([1, 2, 3, 4]).not.toEqual([1, 2, 3]);
|
||||
|
||||
let a = [{ a: 1 }, { b: 2, c: 3, d: 4 }, { e: 5, f: 6 }];
|
||||
let b = [{ a: 1 }, { b: 2, c: 3, d: 4 }, { e: 5, f: 6 }];
|
||||
expect(a).toEqual(b);
|
||||
expect(b).toEqual(a);
|
||||
a[0].a = 2;
|
||||
expect(a).not.toEqual(b);
|
||||
expect(b).not.toEqual(a);
|
||||
|
||||
let c = { [Symbol("test")]: 1 };
|
||||
let d = { [Symbol("test")]: 1 };
|
||||
expect(c).not.toEqual(d);
|
||||
expect(d).not.toEqual(c);
|
||||
|
||||
a = { a: 1, b: 2, c: 3 };
|
||||
b = { a: 1, b: 2 };
|
||||
expect(a).not.toEqual(b);
|
||||
}
|
||||
console.timeEnd(label);
|
||||
});
|
||||
1
bench/expect-to-equal/index.ts
Normal file
1
bench/expect-to-equal/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
console.log("Hello via Bun!");
|
||||
9
bench/expect-to-equal/package.json
Normal file
9
bench/expect-to-equal/package.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "expect-to-equal",
|
||||
"module": "index.ts",
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"jest": "^29.3.1",
|
||||
"vitest": "^0.25.3"
|
||||
}
|
||||
}
|
||||
20
bench/expect-to-equal/tsconfig.json
Normal file
20
bench/expect-to-equal/tsconfig.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"lib": [
|
||||
"ESNext"
|
||||
],
|
||||
"module": "esnext",
|
||||
"target": "esnext",
|
||||
"moduleResolution": "nodenext",
|
||||
"strict": true,
|
||||
"downlevelIteration": true,
|
||||
"skipLibCheck": true,
|
||||
"jsx": "preserve",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"allowJs": true,
|
||||
"types": [
|
||||
"bun-types" // add Bun global
|
||||
]
|
||||
}
|
||||
}
|
||||
17
bench/fetch/bun.js
Normal file
17
bench/fetch/bun.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
const count = 100;
|
||||
|
||||
bench(`fetch(https://example.com) x ${count}`, async () => {
|
||||
const requests = new Array(count);
|
||||
|
||||
for (let i = 0; i < requests.length; i++) {
|
||||
requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then((r) =>
|
||||
r.text(),
|
||||
);
|
||||
}
|
||||
|
||||
await Promise.all(requests);
|
||||
});
|
||||
|
||||
await run();
|
||||
17
bench/fetch/deno.js
Normal file
17
bench/fetch/deno.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { bench, run } from "https://esm.run/mitata";
|
||||
|
||||
const count = 100;
|
||||
|
||||
bench(`fetch(https://example.com) x ${count}`, async () => {
|
||||
const requests = new Array(count);
|
||||
|
||||
for (let i = 0; i < requests.length; i++) {
|
||||
requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then((r) =>
|
||||
r.text(),
|
||||
);
|
||||
}
|
||||
|
||||
await Promise.all(requests);
|
||||
});
|
||||
|
||||
await run();
|
||||
17
bench/fetch/node.mjs
Normal file
17
bench/fetch/node.mjs
Normal file
@@ -0,0 +1,17 @@
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
const count = 100;
|
||||
|
||||
bench(`fetch(https://example.com) x ${count}`, async () => {
|
||||
const requests = new Array(count);
|
||||
|
||||
for (let i = 0; i < requests.length; i++) {
|
||||
requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then((r) =>
|
||||
r.text()
|
||||
);
|
||||
}
|
||||
|
||||
await Promise.all(requests);
|
||||
});
|
||||
|
||||
await run();
|
||||
@@ -3,7 +3,7 @@ import { run, bench, group } from "../node_modules/mitata/src/cli.mjs";
|
||||
const extension = "darwin" !== Deno.build.os ? "so" : "dylib";
|
||||
const path = new URL(
|
||||
"src/target/release/libffi_napi_bench." + extension,
|
||||
import.meta.url
|
||||
import.meta.url,
|
||||
).pathname;
|
||||
|
||||
const {
|
||||
@@ -11,7 +11,7 @@ const {
|
||||
} = Deno.dlopen(path, {
|
||||
ffi_noop: { parameters: [], result: "void" },
|
||||
ffi_string: { parameters: [], result: "pointer" },
|
||||
ffi_hash: { parameters: ["pointer", "u32"], result: "u32" },
|
||||
ffi_hash: { parameters: ["buffer", "u32"], result: "u32" },
|
||||
});
|
||||
|
||||
const bytes = new Uint8Array(64);
|
||||
@@ -19,9 +19,7 @@ const bytes = new Uint8Array(64);
|
||||
group("deno:ffi", () => {
|
||||
bench("noop", () => ffi_noop());
|
||||
bench("hash", () => ffi_hash(bytes, bytes.byteLength));
|
||||
bench("c string", () =>
|
||||
new Deno.UnsafePointerView(ffi_string()).getCString()
|
||||
);
|
||||
bench("c string", () => Deno.UnsafePointerView.getCString(ffi_string()));
|
||||
});
|
||||
|
||||
await run();
|
||||
|
||||
Binary file not shown.
@@ -43,7 +43,7 @@ if (process.env.PROJECT === "bun") {
|
||||
},
|
||||
|
||||
shell: false,
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -114,5 +114,5 @@ async function main() {
|
||||
main().catch((error) =>
|
||||
setTimeout(() => {
|
||||
throw error;
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
BIN
bench/hot-module-reloading/css-stress-test/bun.lockb
Executable file
BIN
bench/hot-module-reloading/css-stress-test/bun.lockb
Executable file
Binary file not shown.
@@ -1,3 +1,4 @@
|
||||
// @ts-nocheck
|
||||
import "../src/index.css";
|
||||
|
||||
import App from "next/app";
|
||||
|
||||
@@ -3,6 +3,7 @@ export function IndexPage() {
|
||||
return (
|
||||
<Main
|
||||
productName={
|
||||
// @ts-ignore
|
||||
typeof location !== "undefined" ? location.search.substring(1) : ""
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -70,9 +70,9 @@ fs.writeFileSync(
|
||||
`${process.platform}-${
|
||||
process.arch === "arm64" ? "aarch64" : process.arch
|
||||
}` +
|
||||
".json"
|
||||
".json",
|
||||
),
|
||||
JSON.stringify(report, null, 2)
|
||||
JSON.stringify(report, null, 2),
|
||||
);
|
||||
|
||||
console.log(
|
||||
@@ -101,7 +101,7 @@ console.log(
|
||||
TOTAL_FRAMES,
|
||||
"(" +
|
||||
Math.round(
|
||||
Math.max(Math.min(1.0, timings.length / TOTAL_FRAMES), 0) * 100
|
||||
Math.max(Math.min(1.0, timings.length / TOTAL_FRAMES), 0) * 100,
|
||||
) +
|
||||
"%)"
|
||||
"%)",
|
||||
);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
export const Main = ({ productName, cssInJS }) => {
|
||||
export const Main = (props: { productName: string; cssInJS?: string }) => {
|
||||
return (
|
||||
<>
|
||||
<header>
|
||||
<div className="Title">CSS HMR Stress Test!</div>
|
||||
<p className="Description">
|
||||
This page visually tests how quickly a bundler can update{" "}
|
||||
{cssInJS ? "CSS-in-JS" : "CSS"} over Hot Module Reloading.
|
||||
{props.cssInJS ? "CSS-in-JS" : "CSS"} over Hot Module Reloading.
|
||||
</p>
|
||||
</header>
|
||||
<main className="main">
|
||||
@@ -53,9 +53,9 @@ export const Main = ({ productName, cssInJS }) => {
|
||||
</div>
|
||||
|
||||
<div className="Bundler-container">
|
||||
<div className="Bundler">{productName}</div>
|
||||
<div className="Bundler">{props.productName}</div>
|
||||
<div className="Bundler-updateRate">
|
||||
{cssInJS ? "CSS-in-JS framework: " + cssInJS : ""}
|
||||
{props.cssInJS ? "CSS-in-JS framework: " + props.cssInJS : ""}
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"jsx": "react-jsx",
|
||||
"paths": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
bench("JSON.stringify({hello: 'world'})", () =>
|
||||
JSON.stringify({ hello: "world" })
|
||||
JSON.stringify({ hello: "world" }),
|
||||
);
|
||||
|
||||
const otherUint8Array = new Uint8Array(1024);
|
||||
bench("Uint8Array.from(otherUint8Array)", () =>
|
||||
Uint8Array.from(otherUint8Array)
|
||||
Uint8Array.from(otherUint8Array),
|
||||
);
|
||||
|
||||
run();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
bench("console.log('hello')", () => console.log("hello"));
|
||||
bench("console.log({ hello: 'object' })", () => console.log({ hello: "object" }));
|
||||
bench("console.log({ hello: 'object' })", () =>
|
||||
console.log({ hello: "object" }),
|
||||
);
|
||||
await run();
|
||||
|
||||
@@ -23,7 +23,7 @@ export const hello${i} = "hello${i}";
|
||||
${saveStack ? `globalThis.evaluationOrder.push("${file}");` : ""}
|
||||
globalThis.counter++;
|
||||
`,
|
||||
"utf8"
|
||||
"utf8",
|
||||
);
|
||||
var file2 = output + "/file" + i + ".js";
|
||||
|
||||
@@ -39,7 +39,7 @@ module.exports.hello${i} = "hello${i}";
|
||||
${saveStack ? `globalThis.evaluationOrder.push("${file2}");` : ""}
|
||||
globalThis.counter++;
|
||||
`,
|
||||
"utf8"
|
||||
"utf8",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ fs.writeFileSync(
|
||||
: ""
|
||||
}
|
||||
`,
|
||||
"utf8"
|
||||
"utf8",
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
@@ -66,7 +66,7 @@ fs.writeFileSync(
|
||||
: ""
|
||||
}
|
||||
`,
|
||||
"utf8"
|
||||
"utf8",
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
@@ -79,7 +79,7 @@ fs.writeFileSync(
|
||||
console.timeEnd("import");
|
||||
${saveStack ? `console.log(globalThis.evaluationOrder.join("\\n"));` : ""}
|
||||
console.log("Loaded", globalThis.counter, "files", "totaling", new Intl.NumberFormat().format(globalThis.exportCounter), 'exports');`,
|
||||
"utf8"
|
||||
"utf8",
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
@@ -92,7 +92,7 @@ export const THE_END = Foo.THE_END;
|
||||
console.timeEnd("import.meta.require");
|
||||
${saveStack ? `console.log(globalThis.evaluationOrder.join("\\n"));` : ""}
|
||||
console.log("Loaded", globalThis.counter, "files", "totaling", new Intl.NumberFormat().format(globalThis.exportCounter), 'exports');`,
|
||||
"utf8"
|
||||
"utf8",
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
@@ -106,7 +106,7 @@ fs.writeFileSync(
|
||||
console.timeEnd("import.meta.require");
|
||||
${saveStack ? `console.log(globalThis.evaluationOrder.join("\\n"));` : ""}
|
||||
console.log("Loaded", globalThis.counter, "files", "totaling", new Intl.NumberFormat().format(globalThis.exportCounter), 'exports');`,
|
||||
"utf8"
|
||||
"utf8",
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
||||
@@ -120,7 +120,7 @@ fs.writeFileSync(
|
||||
${saveStack ? `console.log(globalThis.evaluationOrder.join("\\n"));` : ""}
|
||||
console.log("Loaded", globalThis.counter, "files", "totaling", new Intl.NumberFormat().format(globalThis.exportCounter), 'exports');
|
||||
`,
|
||||
"utf8"
|
||||
"utf8",
|
||||
);
|
||||
|
||||
console.log(`
|
||||
|
||||
@@ -14,5 +14,8 @@
|
||||
"async": "cd async && bun run deps && bun run build && bun run bench",
|
||||
"sqlite": "cd sqlite && bun run deps && bun run build && bun run bench",
|
||||
"modules:node_os": "cd modules/node_os && bun run deps &&bun run build && bun run bench"
|
||||
},
|
||||
"devDependencies": {
|
||||
"fast-deep-equal": "^3.1.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { renderToReadableStream } from "https://esm.run/react-dom/server";
|
||||
import { serve } from "https://deno.land/std@0.146.0/http/server.ts";
|
||||
import * as React from "https://esm.run/react";
|
||||
|
||||
const App = () => (
|
||||
<html>
|
||||
<body>
|
||||
<h1>Hello World</h1>
|
||||
<p>This is an example.</p>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
@@ -17,7 +17,7 @@ const headers = {
|
||||
},
|
||||
};
|
||||
|
||||
await serve(
|
||||
Deno.serve(
|
||||
async (req) => {
|
||||
return new Response(await renderToReadableStream(<App />), headers);
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// to run this:
|
||||
// bun react-hello-world.jsx --jsx-production
|
||||
// bun --jsx-production react-hello-world.jsx
|
||||
|
||||
// This will become the official react-dom/server.bun build a little later
|
||||
// It will be the default when you import from "react-dom/server"
|
||||
@@ -24,7 +24,7 @@ const port = Number(process.env.PORT || 3001);
|
||||
Bun.serve({
|
||||
port,
|
||||
async fetch(req) {
|
||||
return new Response(await renderToReadableStream(<App />));
|
||||
return new Response(await renderToReadableStream(<App />), headers);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Binary file not shown.
12
bench/snippets/array-arguments-slice.mjs
Normal file
12
bench/snippets/array-arguments-slice.mjs
Normal file
@@ -0,0 +1,12 @@
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
function doIt(...args) {
|
||||
// we use .at() to prevent constant folding optimizations
|
||||
return args.slice().at(0);
|
||||
}
|
||||
|
||||
bench("Array.prototype.slice.call(arguments)", () => {
|
||||
return doIt(1, 2, 3, 4, 5, 6);
|
||||
});
|
||||
|
||||
await run();
|
||||
56
bench/snippets/array-map.mjs
Normal file
56
bench/snippets/array-map.mjs
Normal file
@@ -0,0 +1,56 @@
|
||||
// https://github.com/oven-sh/bun/issues/1096
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
const identity = (x) => x;
|
||||
|
||||
for (let i = 0; i < 20; i++) {
|
||||
var array = new Array(i);
|
||||
for (let j = 0; j < i; j++) {
|
||||
array[j] = 1;
|
||||
}
|
||||
|
||||
bench("Array.map x " + i, () => array.map(identity));
|
||||
}
|
||||
|
||||
bench("inline Array.map x 0", () => [].map(identity));
|
||||
bench("inline Array.map x 1", () => [1].map(identity));
|
||||
bench("inline Array.map x 2", () => [1, 1].map(identity));
|
||||
bench("inline Array.map x 3", () => [1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 4", () => [1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 5", () => [1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 6", () => [1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 7", () => [1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 8", () => [1, 1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 9", () => [1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 10", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 11", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 12", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 13", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 14", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 15", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 16", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 17", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 18", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 19", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
|
||||
await run();
|
||||
16
bench/snippets/array-shift.mjs
Normal file
16
bench/snippets/array-shift.mjs
Normal file
@@ -0,0 +1,16 @@
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
var myArray = new Array(5);
|
||||
bench("[1, 2, 3, 4, 5].shift()", () => {
|
||||
// we do this to prevent constant folding optimizations
|
||||
if (myArray.length !== 5) myArray.length = 5;
|
||||
myArray[0] = 1;
|
||||
myArray[1] = 2;
|
||||
myArray[2] = 3;
|
||||
myArray[3] = 4;
|
||||
myArray[4] = 5;
|
||||
|
||||
myArray.shift();
|
||||
});
|
||||
|
||||
await run();
|
||||
30
bench/snippets/arraybuffersink.mjs
Normal file
30
bench/snippets/arraybuffersink.mjs
Normal file
@@ -0,0 +1,30 @@
|
||||
import { ArrayBufferSink } from "bun";
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
var short = "Hello World!";
|
||||
var shortUTF16 = "Hello World 💕💕💕";
|
||||
var long = "Hello World!".repeat(1024);
|
||||
var longUTF16 = "Hello World 💕💕💕".repeat(1024);
|
||||
var encoder = new ArrayBufferSink({ stream: true, highWaterMark: 512 });
|
||||
|
||||
bench(`${short.length} ascii`, () => {
|
||||
encoder.write(short);
|
||||
encoder.start();
|
||||
});
|
||||
|
||||
bench(`${short.length} utf8`, () => {
|
||||
encoder.write(shortUTF16);
|
||||
encoder.start();
|
||||
});
|
||||
|
||||
bench(`${long.length} ascii`, () => {
|
||||
encoder.write(long);
|
||||
encoder.start();
|
||||
});
|
||||
|
||||
bench(`${longUTF16.length} utf8`, () => {
|
||||
encoder.write(longUTF16);
|
||||
encoder.start();
|
||||
});
|
||||
|
||||
await run();
|
||||
15
bench/snippets/assert.mjs
Normal file
15
bench/snippets/assert.mjs
Normal file
@@ -0,0 +1,15 @@
|
||||
import { bench, group, run } from "mitata";
|
||||
import * as assert from "assert";
|
||||
|
||||
bench("deepEqual", () => {
|
||||
assert.deepEqual({ foo: "123", bar: "baz" }, { foo: "123", bar: "baz" });
|
||||
});
|
||||
|
||||
bench("deepStrictEqual", () => {
|
||||
assert.deepStrictEqual(
|
||||
{ foo: "123", beep: "boop" },
|
||||
{ foo: "123", beep: "boop" },
|
||||
);
|
||||
});
|
||||
|
||||
await run();
|
||||
@@ -5,6 +5,19 @@ bench("async function(){}", async function () {});
|
||||
bench("await 1", async function () {
|
||||
return await 1;
|
||||
});
|
||||
|
||||
function callnextTick(resolve) {
|
||||
process.nextTick(resolve);
|
||||
}
|
||||
|
||||
function awaitNextTick() {
|
||||
return new Promise(callnextTick);
|
||||
}
|
||||
|
||||
bench("promise.nextTick", async function () {
|
||||
return awaitNextTick();
|
||||
});
|
||||
|
||||
bench("await new Promise(resolve => resolve())", async function () {
|
||||
await new Promise((resolve) => resolve());
|
||||
});
|
||||
@@ -12,7 +25,7 @@ bench(
|
||||
"Promise.all(Array.from({length: 100}, () => new Promise((resolve) => resolve())))",
|
||||
async function () {
|
||||
return Promise.all(Array.from({ length: 100 }, () => Promise.resolve(1)));
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
await run();
|
||||
|
||||
29
bench/snippets/buffer-create.mjs
Normal file
29
bench/snippets/buffer-create.mjs
Normal file
@@ -0,0 +1,29 @@
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
const N = parseInt(process.argv.slice(2).at(0) || "10", 10);
|
||||
|
||||
bench("new Buffer(0)", () => {
|
||||
return new Buffer(0);
|
||||
});
|
||||
|
||||
bench(`new Buffer(${N})`, () => {
|
||||
return new Buffer(N);
|
||||
});
|
||||
|
||||
bench(`Buffer.alloc(${N})`, () => {
|
||||
return Buffer.alloc(N);
|
||||
});
|
||||
|
||||
bench(`Buffer.allocUnsafe(${N})`, () => {
|
||||
return Buffer.allocUnsafe(N);
|
||||
});
|
||||
|
||||
bench("Buffer.allocUnsafe(24_000)", () => {
|
||||
return Buffer.allocUnsafe(24_000);
|
||||
});
|
||||
|
||||
bench("Buffer.alloc(24_000)", () => {
|
||||
return Buffer.alloc(24_000);
|
||||
});
|
||||
|
||||
await run();
|
||||
53
bench/snippets/console-log.mjs
Normal file
53
bench/snippets/console-log.mjs
Normal file
@@ -0,0 +1,53 @@
|
||||
import { bench, run } from "../node_modules/mitata/src/cli.mjs";
|
||||
|
||||
const json = {
|
||||
login: "wongmjane",
|
||||
id: 1332975,
|
||||
node_id: "MDQ6VXNlcjEzMzI5NzU=",
|
||||
avatar_url: "https://avatars.githubusercontent.com/u/1332975?v=4",
|
||||
gravatar_id: "",
|
||||
url: "https://api.github.com/users/wongmjane",
|
||||
html_url: "https://github.com/wongmjane",
|
||||
followers_url: "https://api.github.com/users/wongmjane/followers",
|
||||
following_url:
|
||||
"https://api.github.com/users/wongmjane/following{/other_user}",
|
||||
gists_url: "https://api.github.com/users/wongmjane/gists{/gist_id}",
|
||||
starred_url: "https://api.github.com/users/wongmjane/starred{/owner}{/repo}",
|
||||
subscriptions_url: "https://api.github.com/users/wongmjane/subscriptions",
|
||||
organizations_url: "https://api.github.com/users/wongmjane/orgs",
|
||||
repos_url: "https://api.github.com/users/wongmjane/repos",
|
||||
events_url: "https://api.github.com/users/wongmjane/events{/privacy}",
|
||||
received_events_url: "https://api.github.com/users/wongmjane/received_events",
|
||||
type: "User",
|
||||
site_admin: false,
|
||||
name: null,
|
||||
company: null,
|
||||
blog: "https://wongmjane.com",
|
||||
location: null,
|
||||
email: null,
|
||||
hireable: null,
|
||||
bio: null,
|
||||
twitter_username: "wongmjane",
|
||||
public_repos: 0,
|
||||
public_gists: 8,
|
||||
followers: 1197,
|
||||
following: 135,
|
||||
created_at: "2012-01-16T07:01:22Z",
|
||||
updated_at: "2022-11-23T16:12:24Z",
|
||||
};
|
||||
|
||||
const inspect =
|
||||
"Bun" in globalThis
|
||||
? Bun.inspect
|
||||
: "Deno" in globalThis
|
||||
? Deno.inspect
|
||||
: (await import("util")).inspect;
|
||||
bench("big json object", () => {
|
||||
console.error(json);
|
||||
});
|
||||
|
||||
bench("inspect big json object", () => {
|
||||
console.error(inspect(json));
|
||||
});
|
||||
|
||||
await run();
|
||||
30
bench/snippets/crypto-hasher.mjs
Normal file
30
bench/snippets/crypto-hasher.mjs
Normal file
@@ -0,0 +1,30 @@
|
||||
// so it can run in environments without node module resolution
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
import crypto from "node:crypto";
|
||||
|
||||
var foo = Buffer.allocUnsafe(16384);
|
||||
foo.fill(123);
|
||||
|
||||
// if ("Bun" in globalThis) {
|
||||
// const { CryptoHasher } = Bun;
|
||||
// bench("CryptoHasher Blake2b256", () => {
|
||||
// var hasher = new CryptoHasher("blake2b256");
|
||||
// hasher.update(foo);
|
||||
// hasher.digest();
|
||||
// });
|
||||
// }
|
||||
|
||||
bench('crypto.createHash("sha512")', () => {
|
||||
var hasher = crypto.createHash("sha512");
|
||||
hasher.update(foo);
|
||||
hasher.digest();
|
||||
});
|
||||
|
||||
bench('crypto.createHash("sha512")', () => {
|
||||
var hasher = crypto.createHash("sha512");
|
||||
hasher.update(foo);
|
||||
hasher.digest();
|
||||
});
|
||||
|
||||
await run();
|
||||
509
bench/snippets/deep-equals.js
Normal file
509
bench/snippets/deep-equals.js
Normal file
@@ -0,0 +1,509 @@
|
||||
import { bench, group, run } from "mitata";
|
||||
import fastDeepEquals from "fast-deep-equal/es6/index";
|
||||
// const Date = globalThis.Date;
|
||||
|
||||
function func1() {}
|
||||
function func2() {}
|
||||
|
||||
const s = Symbol("foo");
|
||||
const a1 = [1, 2, 3, 4];
|
||||
a1[s] = "f00";
|
||||
const a2 = [1, 2, 3, 4];
|
||||
a2[s] = "f00";
|
||||
|
||||
const e1 = new Set();
|
||||
e1.add([1, 2, 3]);
|
||||
e1.add("test1");
|
||||
e1.add(498);
|
||||
e1.add({ a: 1, b: 2 });
|
||||
e1.add({ a: 1, b: 434221 });
|
||||
e1.add({ a: 1, b: 25 });
|
||||
e1.add({ a: 1, b: 4 });
|
||||
e1.add({ a: 1, b: 2667 });
|
||||
e1.add({ a: 1, b: 2 });
|
||||
e1.add({ a: 1, b: 23426 });
|
||||
e1.add({ a: 1, b: 672 });
|
||||
e1.add({ a: 1, b: 28465 });
|
||||
|
||||
const e2 = new Set();
|
||||
e2.add([1, 2, 3]);
|
||||
e2.add("test1");
|
||||
e2.add(498);
|
||||
e1.add({ a: 1, b: 2 });
|
||||
e1.add({ a: 1, b: 434221 });
|
||||
e1.add({ a: 1, b: 25 });
|
||||
e1.add({ a: 1, b: 4 });
|
||||
e1.add({ a: 1, b: 2667 });
|
||||
e1.add({ a: 1, b: 2 });
|
||||
e1.add({ a: 1, b: 23426 });
|
||||
e1.add({ a: 1, b: 672 });
|
||||
e1.add({ a: 1, b: 28465 });
|
||||
|
||||
const d1 = new Set();
|
||||
d1.add({ a: 1, b: 2 });
|
||||
const d2 = new Set();
|
||||
d2.add({ a: 1, b: 2 });
|
||||
|
||||
const fixture = [
|
||||
{
|
||||
description: "scalars",
|
||||
tests: [
|
||||
{
|
||||
description: "equal numbers",
|
||||
value1: 1,
|
||||
value2: 1,
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "not equal numbers",
|
||||
value1: 1,
|
||||
value2: 2,
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "number and array are not equal",
|
||||
value1: 1,
|
||||
value2: [],
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "0 and null are not equal",
|
||||
value1: 0,
|
||||
value2: null,
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "equal strings",
|
||||
value1: "azzzz",
|
||||
value2: "azzzz",
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "not equal strings",
|
||||
value1: "azzzz",
|
||||
value2: "bzzzz",
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "empty string and null are not equal",
|
||||
value1: "",
|
||||
value2: null,
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "null is equal to null",
|
||||
value1: null,
|
||||
value2: null,
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "equal booleans (true)",
|
||||
value1: true,
|
||||
value2: true,
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "equal booleans (false)",
|
||||
value1: false,
|
||||
value2: false,
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "not equal booleans",
|
||||
value1: true,
|
||||
value2: false,
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "1 and true are not equal",
|
||||
value1: 1,
|
||||
value2: true,
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "0 and false are not equal",
|
||||
value1: 0,
|
||||
value2: false,
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "NaN and NaN are equal",
|
||||
value1: NaN,
|
||||
value2: NaN,
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "0 and -0 are equal",
|
||||
value1: 0,
|
||||
value2: -0,
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "Infinity and Infinity are equal",
|
||||
value1: Infinity,
|
||||
value2: Infinity,
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "Infinity and -Infinity are not equal",
|
||||
value1: Infinity,
|
||||
value2: -Infinity,
|
||||
equal: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
description: "objects",
|
||||
tests: [
|
||||
{
|
||||
description: "empty objects are equal",
|
||||
value1: {},
|
||||
value2: {},
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: 'equal objects (same properties "order")',
|
||||
value1: { a: 1, b: "2" },
|
||||
value2: { a: 1, b: "2" },
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: 'equal objects (different properties "order")',
|
||||
value1: { a: 1, b: "2" },
|
||||
value2: { b: "2", a: 1 },
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "not equal objects (extra property)",
|
||||
value1: { a: 1, b: "2" },
|
||||
value2: { a: 1, b: "2", c: [] },
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "not equal objects (different property values)",
|
||||
value1: { a: 1, b: "2", c: 3 },
|
||||
value2: { a: 1, b: "2", c: 4 },
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "not equal objects (different properties)",
|
||||
value1: { a: 1, b: "2", c: 3 },
|
||||
value2: { a: 1, b: "2", d: 3 },
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "equal objects (same sub-properties)",
|
||||
value1: { a: [{ b: "c" }] },
|
||||
value2: { a: [{ b: "c" }] },
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "not equal objects (different sub-property value)",
|
||||
value1: { a: [{ b: "c" }] },
|
||||
value2: { a: [{ b: "d" }] },
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "not equal objects (different sub-property)",
|
||||
value1: { a: [{ b: "c" }] },
|
||||
value2: { a: [{ c: "c" }] },
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "empty array and empty object are not equal",
|
||||
value1: {},
|
||||
value2: [],
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "object with extra undefined properties are not equal #1",
|
||||
value1: {},
|
||||
value2: { foo: undefined },
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "object with extra undefined properties are not equal #2",
|
||||
value1: { foo: undefined },
|
||||
value2: {},
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "object with extra undefined properties are not equal #3",
|
||||
value1: { foo: undefined },
|
||||
value2: { bar: undefined },
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "nulls are equal",
|
||||
value1: null,
|
||||
value2: null,
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "null and undefined are not equal",
|
||||
value1: null,
|
||||
value2: undefined,
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "null and empty object are not equal",
|
||||
value1: null,
|
||||
value2: {},
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "undefined and empty object are not equal",
|
||||
value1: undefined,
|
||||
value2: {},
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description:
|
||||
"objects with different `toString` functions returning same values are equal",
|
||||
value1: { toString: () => "Hello world!" },
|
||||
value2: { toString: () => "Hello world!" },
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description:
|
||||
"objects with `toString` functions returning different values are not equal",
|
||||
value1: { toString: () => "Hello world!" },
|
||||
value2: { toString: () => "Hi!" },
|
||||
equal: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
description: "arrays",
|
||||
tests: [
|
||||
{
|
||||
description: "two empty arrays are equal",
|
||||
value1: [],
|
||||
value2: [],
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "equal arrays",
|
||||
value1: [1, 2, 3],
|
||||
value2: [1, 2, 3],
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "equal arrays with symbols",
|
||||
value1: a1,
|
||||
value2: a2,
|
||||
equal: true,
|
||||
},
|
||||
// {
|
||||
// description: "not equal arrays (different item)",
|
||||
// value1: [1, 2, 3],
|
||||
// value2: [1, 2, 4],
|
||||
// equal: false,
|
||||
// },
|
||||
// {
|
||||
// description: "not equal arrays (different length)",
|
||||
// value1: [1, 2, 3],
|
||||
// value2: [1, 2],
|
||||
// equal: false,
|
||||
// },
|
||||
{
|
||||
description: "equal arrays of objects",
|
||||
value1: [
|
||||
...Array.from({ length: 200000 }, (i) => ({
|
||||
a: 1,
|
||||
b: 2,
|
||||
})),
|
||||
],
|
||||
value2: [
|
||||
...Array.from({ length: 200000 }, (i) => ({
|
||||
a: 1,
|
||||
b: 2,
|
||||
})),
|
||||
],
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "equal objects",
|
||||
value1: {
|
||||
a: 1,
|
||||
b: 2,
|
||||
c: 3,
|
||||
d: 4,
|
||||
// get foo() {
|
||||
// return 1;
|
||||
// },
|
||||
},
|
||||
value2: {
|
||||
a: 1,
|
||||
b: 2,
|
||||
c: 3,
|
||||
d: 4,
|
||||
// get foo() {
|
||||
// return 1;
|
||||
// },
|
||||
},
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "equal sets",
|
||||
value1: d1,
|
||||
value2: d2,
|
||||
equal: true,
|
||||
},
|
||||
// {
|
||||
// description: "not equal arrays of objects",
|
||||
// value1: [{ a: "a" }, { b: "b" }],
|
||||
// value2: [{ a: "a" }, { b: "c" }],
|
||||
// equal: false,
|
||||
// },
|
||||
// {
|
||||
// description: "pseudo array and equivalent array are not equal",
|
||||
// value1: { 0: 0, 1: 1, length: 2 },
|
||||
// value2: [0, 1],
|
||||
// equal: false,
|
||||
// },
|
||||
],
|
||||
},
|
||||
{
|
||||
description: "Date objects",
|
||||
tests: [
|
||||
{
|
||||
description: "equal date objects",
|
||||
value1: new Date("2017-06-16T21:36:48.362Z"),
|
||||
value2: new Date("2017-06-16T21:36:48.362Z"),
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "not equal date objects",
|
||||
value1: new Date("2017-06-16T21:36:48.362Z"),
|
||||
value2: new Date("2017-01-01T00:00:00.000Z"),
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "date and string are not equal",
|
||||
value1: new Date("2017-06-16T21:36:48.362Z"),
|
||||
value2: "2017-06-16T21:36:48.362Z",
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "date and object are not equal",
|
||||
value1: new Date("2017-06-16T21:36:48.362Z"),
|
||||
value2: {},
|
||||
equal: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
description: "RegExp objects",
|
||||
tests: [
|
||||
{
|
||||
description: "equal RegExp objects",
|
||||
value1: /foo/,
|
||||
value2: /foo/,
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "not equal RegExp objects (different pattern)",
|
||||
value1: /foo/,
|
||||
value2: /bar/,
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "not equal RegExp objects (different flags)",
|
||||
value1: /foo/,
|
||||
value2: /foo/i,
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "RegExp and string are not equal",
|
||||
value1: /foo/,
|
||||
value2: "foo",
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description: "RegExp and object are not equal",
|
||||
value1: /foo/,
|
||||
value2: {},
|
||||
equal: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
description: "functions",
|
||||
tests: [
|
||||
{
|
||||
description: "same function is equal",
|
||||
value1: func1,
|
||||
value2: func1,
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description: "different functions are not equal",
|
||||
value1: func1,
|
||||
value2: func2,
|
||||
equal: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
description: "sample objects",
|
||||
tests: [
|
||||
{
|
||||
description: "big object",
|
||||
value1: {
|
||||
prop1: "value1",
|
||||
prop2: "value2",
|
||||
prop3: "value3",
|
||||
prop4: {
|
||||
subProp1: "sub value1",
|
||||
subProp2: {
|
||||
subSubProp1: "sub sub value1",
|
||||
subSubProp2: [1, 2, { prop2: 1, prop: 2 }, 4, 5],
|
||||
},
|
||||
},
|
||||
prop5: 1000,
|
||||
// prop6: new Date(2016, 2, 10),
|
||||
},
|
||||
value2: {
|
||||
prop5: 1000,
|
||||
prop3: "value3",
|
||||
prop1: "value1",
|
||||
prop2: "value2",
|
||||
// prop6: new Date(2016, 2, 10),
|
||||
prop4: {
|
||||
subProp2: {
|
||||
subSubProp1: "sub sub value1",
|
||||
subSubProp2: [1, 2, { prop2: 1, prop: 2 }, 4, 5],
|
||||
},
|
||||
subProp1: "sub value1",
|
||||
},
|
||||
},
|
||||
equal: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
for (let { tests, description } of fixture) {
|
||||
// if (description === "sample objects") {
|
||||
for (let { description: describe, value1, value2, equal } of tests) {
|
||||
var expected;
|
||||
group(describe, () => {
|
||||
for (let equalsFn of [Bun.deepEquals, fastDeepEquals]) {
|
||||
bench(equalsFn.name, () => {
|
||||
expected = equalsFn(value1, value2);
|
||||
if (expected !== equal) {
|
||||
throw new Error(
|
||||
`Expected ${expected} to be ${equal} for ${description}`,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
await run();
|
||||
145
bench/snippets/define-properties.mjs
Normal file
145
bench/snippets/define-properties.mjs
Normal file
@@ -0,0 +1,145 @@
|
||||
import { bench, run } from "../node_modules/mitata/src/cli.mjs";
|
||||
|
||||
const properties = {
|
||||
closed: {
|
||||
get() {
|
||||
return this._writableState ? this._writableState.closed : false;
|
||||
},
|
||||
},
|
||||
destroyed: {
|
||||
get() {
|
||||
return this._writableState ? this._writableState.destroyed : false;
|
||||
},
|
||||
set(value) {
|
||||
if (this._writableState) {
|
||||
this._writableState.destroyed = value;
|
||||
}
|
||||
},
|
||||
},
|
||||
writable: {
|
||||
get() {
|
||||
const w = this._writableState;
|
||||
return (
|
||||
!!w &&
|
||||
w.writable !== false &&
|
||||
!w.destroyed &&
|
||||
!w.errored &&
|
||||
!w.ending &&
|
||||
!w.ended
|
||||
);
|
||||
},
|
||||
set(val) {
|
||||
if (this._writableState) {
|
||||
this._writableState.writable = !!val;
|
||||
}
|
||||
},
|
||||
},
|
||||
writableFinished: {
|
||||
get() {
|
||||
return this._writableState ? this._writableState.finished : false;
|
||||
},
|
||||
},
|
||||
writableObjectMode: {
|
||||
get() {
|
||||
return this._writableState ? this._writableState.objectMode : false;
|
||||
},
|
||||
},
|
||||
writableBuffer: {
|
||||
get() {
|
||||
return this._writableState && this._writableState.getBuffer();
|
||||
},
|
||||
},
|
||||
writableEnded: {
|
||||
get() {
|
||||
return this._writableState ? this._writableState.ending : false;
|
||||
},
|
||||
},
|
||||
writableNeedDrain: {
|
||||
get() {
|
||||
const wState = this._writableState;
|
||||
if (!wState) return false;
|
||||
return !wState.destroyed && !wState.ending && wState.needDrain;
|
||||
},
|
||||
},
|
||||
writableHighWaterMark: {
|
||||
get() {
|
||||
return this._writableState && this._writableState.highWaterMark;
|
||||
},
|
||||
},
|
||||
writableCorked: {
|
||||
get() {
|
||||
return this._writableState ? this._writableState.corked : 0;
|
||||
},
|
||||
},
|
||||
writableLength: {
|
||||
get() {
|
||||
return this._writableState && this._writableState.length;
|
||||
},
|
||||
},
|
||||
errored: {
|
||||
enumerable: false,
|
||||
get() {
|
||||
return this._writableState ? this._writableState.errored : null;
|
||||
},
|
||||
},
|
||||
writableAborted: {
|
||||
enumerable: false,
|
||||
get: function () {
|
||||
return !!(
|
||||
this._writableState.writable !== false &&
|
||||
(this._writableState.destroyed || this._writableState.errored) &&
|
||||
!this._writableState.finished
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
var count = 10_000;
|
||||
|
||||
bench("Object.defineProperty x " + count, () => {
|
||||
const prop = {
|
||||
enumerable: false,
|
||||
get: function () {
|
||||
return !!(
|
||||
this._writableState.writable !== false &&
|
||||
(this._writableState.destroyed || this._writableState.errored) &&
|
||||
!this._writableState.finished
|
||||
);
|
||||
},
|
||||
};
|
||||
for (let i = 0; i < count; i++) {
|
||||
function Hey() {
|
||||
return this;
|
||||
}
|
||||
Object.defineProperty(Hey.prototype, "writableAborted", prop);
|
||||
}
|
||||
});
|
||||
|
||||
bench("Object.defineProperties x " + count, () => {
|
||||
for (let i = 0; i < count; i++) {
|
||||
function Hey() {
|
||||
return this;
|
||||
}
|
||||
Object.defineProperties(Hey.prototype, properties);
|
||||
}
|
||||
});
|
||||
|
||||
bench("(all the keys) Object.defineProperties x " + count, () => {
|
||||
var first;
|
||||
{
|
||||
function Hey() {
|
||||
return this;
|
||||
}
|
||||
Object.defineProperties(Hey.prototype, properties);
|
||||
first = Object.getOwnPropertyDescriptors(Hey.prototype);
|
||||
}
|
||||
|
||||
for (let i = 0; i < count; i++) {
|
||||
function Hey() {
|
||||
return this;
|
||||
}
|
||||
Object.defineProperties(Hey.prototype, first);
|
||||
}
|
||||
});
|
||||
|
||||
await run();
|
||||
76
bench/snippets/dns.node.mjs
Normal file
76
bench/snippets/dns.node.mjs
Normal file
@@ -0,0 +1,76 @@
|
||||
import { lookup, resolve } from "node:dns/promises";
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
bench("(cached) dns.lookup remote x 50", async () => {
|
||||
var tld = "example.com";
|
||||
const run = () => lookup(tld).catch(() => {});
|
||||
const total = 50;
|
||||
var remain = total;
|
||||
var done;
|
||||
await new Promise((resolve) => {
|
||||
for (var i = 0; i < total; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
if (remain === 0) {
|
||||
done();
|
||||
}
|
||||
});
|
||||
done = resolve;
|
||||
});
|
||||
});
|
||||
|
||||
bench("(cached in batch) dns.lookup remote x 50", async () => {
|
||||
var tld = Math.random().toString(16) + ".example.com";
|
||||
const run = () => lookup(tld).catch(() => {});
|
||||
const total = 50;
|
||||
var remain = total;
|
||||
var done;
|
||||
await new Promise((resolve) => {
|
||||
for (var i = 0; i < total; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
if (remain === 0) {
|
||||
done();
|
||||
}
|
||||
});
|
||||
done = resolve;
|
||||
});
|
||||
});
|
||||
|
||||
bench("dns.lookup remote x 50", async () => {
|
||||
var remain = 50;
|
||||
var done;
|
||||
const run = () =>
|
||||
lookup(Math.random().toString() + ".example.com").catch(() => {});
|
||||
|
||||
await new Promise((resolve) => {
|
||||
for (var i = 0; i < 50; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
if (remain === 0) {
|
||||
done();
|
||||
}
|
||||
});
|
||||
done = resolve;
|
||||
});
|
||||
});
|
||||
|
||||
bench("dns.resolve remote x 50", async () => {
|
||||
var remain = 50;
|
||||
var done;
|
||||
const run = () =>
|
||||
resolve(Math.random().toString() + ".example.com").catch(() => {});
|
||||
|
||||
await new Promise((resolve) => {
|
||||
for (var i = 0; i < 50; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
if (remain === 0) {
|
||||
done();
|
||||
}
|
||||
});
|
||||
done = resolve;
|
||||
});
|
||||
});
|
||||
|
||||
await run();
|
||||
76
bench/snippets/dns.ts
Normal file
76
bench/snippets/dns.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
import { dns } from "bun";
|
||||
import { bench, run, group } from "mitata";
|
||||
|
||||
async function forEachBackend(name, fn) {
|
||||
group(name, () => {
|
||||
for (let backend of [
|
||||
"libc",
|
||||
"c-ares",
|
||||
process.platform === "darwin" ? "system" : "",
|
||||
].filter(Boolean))
|
||||
bench(backend, fn(backend));
|
||||
});
|
||||
}
|
||||
|
||||
forEachBackend("dns.lookup remote x 50", (backend) => async () => {
|
||||
const run = () =>
|
||||
dns
|
||||
.lookup(Math.random().toString(16) + ".example.com", { backend })
|
||||
.catch(() => {});
|
||||
var remain = 16;
|
||||
var done;
|
||||
await new Promise((resolve) => {
|
||||
for (var i = 0; i < 16; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
if (remain === 0) {
|
||||
done();
|
||||
}
|
||||
});
|
||||
done = resolve;
|
||||
});
|
||||
});
|
||||
|
||||
forEachBackend("(cached) dns.lookup remote x 50", (backend) => {
|
||||
var tld = "example.com";
|
||||
const run = () => dns.lookup(tld, { backend }).catch(() => {});
|
||||
|
||||
return async () => {
|
||||
const total = 50;
|
||||
var remain = total;
|
||||
var done;
|
||||
await new Promise((resolve) => {
|
||||
for (var i = 0; i < total; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
if (remain === 0) {
|
||||
done();
|
||||
}
|
||||
});
|
||||
done = resolve;
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
forEachBackend(
|
||||
"(cached in batch) dns.lookup remote x 50",
|
||||
(backend) => async () => {
|
||||
var tld = Math.random().toString(16) + ".example.com";
|
||||
const run = () => dns.lookup(tld, { backend }).catch(() => {});
|
||||
const total = 50;
|
||||
var remain = total;
|
||||
var done;
|
||||
await new Promise((resolve) => {
|
||||
for (var i = 0; i < total; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
if (remain === 0) {
|
||||
done();
|
||||
}
|
||||
});
|
||||
done = resolve;
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
await run();
|
||||
@@ -16,18 +16,55 @@ bench("EventEmitter.emit", () => {
|
||||
});
|
||||
});
|
||||
|
||||
var monkey = Object.assign({}, EventEmitter.prototype);
|
||||
monkey.on("hello", (event) => {
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
bench("[monkey] EventEmitter.emit", () => {
|
||||
var called = false;
|
||||
monkey.emit("hello", {
|
||||
preventDefault() {
|
||||
id++;
|
||||
called = true;
|
||||
},
|
||||
});
|
||||
|
||||
if (!called) {
|
||||
throw new Error("monkey failed");
|
||||
}
|
||||
});
|
||||
|
||||
bench("EventEmitter.on x 10_000 (handler)", () => {
|
||||
var cb = () => {
|
||||
var cb = (event) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
emitter.on("hey", cb);
|
||||
var called = false;
|
||||
for (let i = 0; i < 10_000; i++)
|
||||
emitter.emit("hey", {
|
||||
preventDefault() {
|
||||
id++;
|
||||
called = true;
|
||||
},
|
||||
});
|
||||
emitter.off("hey", cb);
|
||||
|
||||
if (!called) throw new Error("not called");
|
||||
});
|
||||
|
||||
bench("[monkey] EventEmitter.on x 10_000 (handler)", () => {
|
||||
var cb = () => {
|
||||
event.preventDefault();
|
||||
};
|
||||
monkey.on("hey", cb);
|
||||
for (let i = 0; i < 10_000; i++)
|
||||
monkey.emit("hey", {
|
||||
preventDefault() {
|
||||
id++;
|
||||
},
|
||||
});
|
||||
monkey.off("hey", cb);
|
||||
});
|
||||
|
||||
var target = new EventTarget();
|
||||
|
||||
10
bench/snippets/encode-into.mjs
Normal file
10
bench/snippets/encode-into.mjs
Normal file
@@ -0,0 +1,10 @@
|
||||
import { run, bench } from "../node_modules/mitata/src/cli.mjs";
|
||||
|
||||
const encoder = new TextEncoder();
|
||||
|
||||
const buffer = new Uint8Array(1024);
|
||||
bench("encodeInto", () => {
|
||||
encoder.encodeInto("Hello World!", buffer);
|
||||
});
|
||||
|
||||
await run();
|
||||
45
bench/snippets/headers.mjs
Normal file
45
bench/snippets/headers.mjs
Normal file
@@ -0,0 +1,45 @@
|
||||
import { bench, run } from "../node_modules/mitata/src/cli.mjs";
|
||||
|
||||
// pure JS implementation will optimze this out
|
||||
// bench("new Headers", function () {
|
||||
// return new Headers();
|
||||
// });
|
||||
|
||||
var big = new Headers({
|
||||
"Content-Type": "text/plain",
|
||||
"Content-Length": "123",
|
||||
hello: "there",
|
||||
"X-Custom-Header": "Hello World",
|
||||
"X-Another-Custom-Header": "Hello World",
|
||||
"X-Yet-Another-Custom-ader": "Hello World",
|
||||
"X-Yet-Another-Custom-Heder": "Hello World",
|
||||
"X-Yet-Another-Custom-Heade": "Hello World",
|
||||
"X-Yet-Another-Custom-Headz": "Hello Worlda",
|
||||
});
|
||||
|
||||
// bench("Header.get", function () {
|
||||
// return big.get("Content-Type");
|
||||
// });
|
||||
|
||||
// bench("Header.set (standard)", function () {
|
||||
// return big.set("Content-Type", "text/html");
|
||||
// });
|
||||
|
||||
// bench("Header.set (non-standard)", function () {
|
||||
// return big.set("X-My-Custom", "text/html123");
|
||||
// });
|
||||
|
||||
if (big.toJSON)
|
||||
bench("Headers.toJSON", function () {
|
||||
return big.toJSON();
|
||||
});
|
||||
|
||||
bench("Object.fromEntries(headers.entries())", function () {
|
||||
return Object.fromEntries(big.entries());
|
||||
});
|
||||
|
||||
bench("Object.fromEntries(headers)", function () {
|
||||
return Object.fromEntries(big);
|
||||
});
|
||||
|
||||
run();
|
||||
8
bench/snippets/http-hello.deno.js
Normal file
8
bench/snippets/http-hello.deno.js
Normal file
@@ -0,0 +1,8 @@
|
||||
var i = 0;
|
||||
Deno.serve({
|
||||
port: parseInt(Deno.env.get("PORT") || "3000", 10),
|
||||
handler(req) {
|
||||
if (i++ === 200_000 - 1) queueMicrotask(() => Deno.exit(0));
|
||||
return new Response("Hello, World!" + i);
|
||||
},
|
||||
});
|
||||
7
bench/snippets/http-hello.js
Normal file
7
bench/snippets/http-hello.js
Normal file
@@ -0,0 +1,7 @@
|
||||
var i = 0;
|
||||
export default {
|
||||
fetch(req) {
|
||||
if (i++ === 200_000 - 1) queueMicrotask(() => process.exit(0));
|
||||
return new Response("Hello, World!" + i);
|
||||
},
|
||||
};
|
||||
8
bench/snippets/http-hello.node.mjs
Normal file
8
bench/snippets/http-hello.node.mjs
Normal file
@@ -0,0 +1,8 @@
|
||||
import { createServer } from "node:http";
|
||||
var i = 0;
|
||||
|
||||
const server = createServer((req, res) => {
|
||||
res.writeHead(200);
|
||||
res.end("Hello, World!" + i);
|
||||
if (i++ === 200_000 - 1) queueMicrotask(() => process.exit(0));
|
||||
}).listen(parseInt(process.env.PORT || "3000", 10));
|
||||
12
bench/snippets/index-of.mjs
Normal file
12
bench/snippets/index-of.mjs
Normal file
@@ -0,0 +1,12 @@
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
const input =
|
||||
"Hello, World! foo bar baz qux quux corge grault garply waldo fred plugh xyzzy thud z a b c d e f g h i j k l m n o p q r s t u v w x y z".split(
|
||||
" "
|
||||
);
|
||||
|
||||
bench(`Array.indexOf`, () => {
|
||||
return input.indexOf("thud");
|
||||
});
|
||||
|
||||
await run();
|
||||
64
bench/snippets/object-entries.mjs
Normal file
64
bench/snippets/object-entries.mjs
Normal file
@@ -0,0 +1,64 @@
|
||||
// so it can run in environments without node module resolution
|
||||
import { bench, run } from "../../node_modules/mitata/src/cli.mjs";
|
||||
|
||||
const obj = {
|
||||
a: 1,
|
||||
b: 2,
|
||||
c: 3,
|
||||
d: 4,
|
||||
e: 5,
|
||||
f: 6,
|
||||
g: 7,
|
||||
h: 8,
|
||||
i: 9,
|
||||
j: 10,
|
||||
k: 11,
|
||||
l: 12,
|
||||
m: 13,
|
||||
n: 14,
|
||||
o: 15,
|
||||
p: 16,
|
||||
q: 17,
|
||||
r: 18,
|
||||
s: 19,
|
||||
t: 20,
|
||||
u: 21,
|
||||
v: 22,
|
||||
w: 23,
|
||||
x: 24,
|
||||
y: 25,
|
||||
z: 26,
|
||||
};
|
||||
|
||||
bench("Object.entries(26 keys)", () => {
|
||||
var k;
|
||||
for (let [key, value] of Object.entries(obj)) {
|
||||
value = key;
|
||||
}
|
||||
return k;
|
||||
});
|
||||
|
||||
bench("Object.keys(26 keys)", () => {
|
||||
var k;
|
||||
for (let [key, value] of Object.keys(obj)) {
|
||||
value = key;
|
||||
}
|
||||
return k;
|
||||
});
|
||||
|
||||
bench("Object.entries(2 keys)", () => {
|
||||
var k;
|
||||
for (let [key, value] of Object.entries({ a: 1, b: 2 })) {
|
||||
value = key;
|
||||
}
|
||||
return k;
|
||||
});
|
||||
|
||||
bench("Object.keys(2 keys)", () => {
|
||||
var k;
|
||||
for (let item of Object.keys({ a: 1, b: 2 })) {
|
||||
}
|
||||
return k;
|
||||
});
|
||||
|
||||
await run();
|
||||
47
bench/snippets/object-values.mjs
Normal file
47
bench/snippets/object-values.mjs
Normal file
@@ -0,0 +1,47 @@
|
||||
const obj = {
|
||||
a: 1,
|
||||
b: 2,
|
||||
c: 3,
|
||||
d: 4,
|
||||
e: 5,
|
||||
f: 6,
|
||||
g: 7,
|
||||
h: 8,
|
||||
i: 9,
|
||||
j: 10,
|
||||
k: 11,
|
||||
l: 12,
|
||||
m: 13,
|
||||
n: 14,
|
||||
o: 15,
|
||||
p: 16,
|
||||
q: 17,
|
||||
r: 18,
|
||||
s: 19,
|
||||
t: 20,
|
||||
u: 21,
|
||||
v: 22,
|
||||
w: 23,
|
||||
};
|
||||
|
||||
import { bench, group, run } from "mitata";
|
||||
|
||||
var val = 0;
|
||||
bench("Object.values(literal)", () => {
|
||||
obj.a = val++;
|
||||
Object.values(obj);
|
||||
});
|
||||
const objWithMethods = {
|
||||
...obj,
|
||||
toString() {},
|
||||
valueOf() {},
|
||||
[Symbol.iterator]() {},
|
||||
[Symbol.toPrimitive]() {},
|
||||
};
|
||||
var val = 0;
|
||||
bench("Object.values(literal with methods)", () => {
|
||||
objWithMethods.a = val++;
|
||||
Object.values(objWithMethods);
|
||||
});
|
||||
|
||||
await run();
|
||||
21
bench/snippets/process.mjs
Normal file
21
bench/snippets/process.mjs
Normal file
@@ -0,0 +1,21 @@
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
bench("process.stderr.write('hey')", () => {
|
||||
process.stderr.write("hey");
|
||||
});
|
||||
|
||||
const long = "hey".repeat(10000);
|
||||
bench("process.stderr.write('hey'.repeat(10_000))", () => {
|
||||
process.stderr.write(long);
|
||||
});
|
||||
|
||||
const longUTF16 = "🥟🐰".repeat(10000);
|
||||
bench("process.stderr.write('🥟🐰')", () => {
|
||||
process.stderr.write("🥟🐰");
|
||||
});
|
||||
|
||||
bench("process.stderr.write('🥟🐰'.repeat(10_000))", () => {
|
||||
process.stderr.write(longUTF16);
|
||||
});
|
||||
|
||||
await run();
|
||||
45
bench/snippets/read-file.mjs
Normal file
45
bench/snippets/read-file.mjs
Normal file
@@ -0,0 +1,45 @@
|
||||
import { readFileSync, writeFileSync } from "node:fs";
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
var short = (function () {
|
||||
const text = "Hello World!";
|
||||
const path = "/tmp/bun-bench-short.text";
|
||||
writeFileSync(path, text, "utf8");
|
||||
return { path, length: text.length };
|
||||
})();
|
||||
var shortUTF16 = (function () {
|
||||
const text = "Hello World 💕💕💕";
|
||||
const path = "/tmp/bun-bench-shortUTF16.text";
|
||||
writeFileSync(path, text, "utf8");
|
||||
return { path, length: text.length };
|
||||
})();
|
||||
var long = (function () {
|
||||
const text = "Hello World!".repeat(1024);
|
||||
const path = "/tmp/bun-bench-long.text";
|
||||
writeFileSync(path, text, "utf8");
|
||||
return { path, length: text.length };
|
||||
})();
|
||||
var longUTF16 = (function () {
|
||||
const text = "Hello World 💕💕💕".repeat(1024);
|
||||
const path = "/tmp/bun-bench-longUTF16.text";
|
||||
writeFileSync(path, text, "utf8");
|
||||
return { path, length: text.length };
|
||||
})();
|
||||
|
||||
bench(`${short.length} ascii`, () => {
|
||||
readFileSync(short.path, "utf-8");
|
||||
});
|
||||
|
||||
bench(`${short.length} utf8`, () => {
|
||||
readFileSync(shortUTF16.path, "utf-8");
|
||||
});
|
||||
|
||||
bench(`${long.length} ascii`, () => {
|
||||
readFileSync(long.path, "utf-8");
|
||||
});
|
||||
|
||||
bench(`${longUTF16.length} utf8`, () => {
|
||||
readFileSync(longUTF16.path, "utf-8");
|
||||
});
|
||||
|
||||
await run();
|
||||
13
bench/snippets/readdir.mjs
Normal file
13
bench/snippets/readdir.mjs
Normal file
@@ -0,0 +1,13 @@
|
||||
import { readdirSync } from "fs";
|
||||
import { bench, run } from "mitata";
|
||||
import { argv } from "process";
|
||||
|
||||
const dir = argv.length > 2 ? argv[2] : "/tmp";
|
||||
|
||||
const count = readdirSync(dir).length;
|
||||
bench(`readdir("${dir}")`, () => {
|
||||
readdirSync(dir, { withFileTypes: true });
|
||||
});
|
||||
|
||||
await run();
|
||||
console.log("\n\nFor", count, "files/dirs in", dir);
|
||||
16
bench/snippets/return-await.mjs
Normal file
16
bench/snippets/return-await.mjs
Normal file
@@ -0,0 +1,16 @@
|
||||
import { bench, run } from "../node_modules/mitata/src/cli.mjs";
|
||||
|
||||
bench("return await Promise.resolve(1)", async function () {
|
||||
return await Promise.resolve(1);
|
||||
});
|
||||
|
||||
bench("return Promise.resolve(1) (async fn)", async function () {
|
||||
return Promise.resolve(1);
|
||||
});
|
||||
|
||||
bench("return await 1", async function () {
|
||||
return await 1;
|
||||
});
|
||||
|
||||
|
||||
await run();
|
||||
13
bench/snippets/spawn-hugemem.mjs
Normal file
13
bench/snippets/spawn-hugemem.mjs
Normal file
@@ -0,0 +1,13 @@
|
||||
import { spawnSync } from "bun";
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
var memory = new Uint8Array(128 * 1024 * 1024);
|
||||
memory.fill(10);
|
||||
// prevent memory from being garbage collected
|
||||
globalThis.memory = memory;
|
||||
|
||||
bench("spawnSync echo hi", () => {
|
||||
spawnSync({ cmd: ["echo", "hi"] });
|
||||
});
|
||||
|
||||
await run();
|
||||
13
bench/snippets/spawn-hugemem.node.mjs
Normal file
13
bench/snippets/spawn-hugemem.node.mjs
Normal file
@@ -0,0 +1,13 @@
|
||||
import { spawnSync } from "child_process";
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
var memory = new Uint8Array(128 * 1024 * 1024);
|
||||
memory.fill(10);
|
||||
// prevent memory from being garbage collected
|
||||
globalThis.memory = memory;
|
||||
|
||||
bench("spawnSync echo hi", () => {
|
||||
spawnSync("echo", ["hi"], { encoding: "buffer", shell: false });
|
||||
});
|
||||
|
||||
await run();
|
||||
9
bench/snippets/spawn.deno.mjs
Normal file
9
bench/snippets/spawn.deno.mjs
Normal file
@@ -0,0 +1,9 @@
|
||||
import { bench, run } from "../node_modules/mitata/src/cli.mjs";
|
||||
|
||||
bench("spawnSync echo hi", () => {
|
||||
Deno.spawnSync("echo", {
|
||||
args: ["hi"],
|
||||
});
|
||||
});
|
||||
|
||||
await run();
|
||||
8
bench/snippets/spawn.mjs
Normal file
8
bench/snippets/spawn.mjs
Normal file
@@ -0,0 +1,8 @@
|
||||
import { spawnSync } from "bun";
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
bench("spawnSync echo hi", () => {
|
||||
spawnSync({ cmd: ["echo", "hi"] });
|
||||
});
|
||||
|
||||
await run();
|
||||
8
bench/snippets/spawn.node.mjs
Normal file
8
bench/snippets/spawn.node.mjs
Normal file
@@ -0,0 +1,8 @@
|
||||
import { spawnSync } from "child_process";
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
bench("spawnSync echo hi", () => {
|
||||
spawnSync("echo", ["hi"], { encoding: "buffer", shell: false });
|
||||
});
|
||||
|
||||
await run();
|
||||
24
bench/snippets/stderr.mjs
Normal file
24
bench/snippets/stderr.mjs
Normal file
@@ -0,0 +1,24 @@
|
||||
import { run, bench } from "mitata";
|
||||
|
||||
var writer = globalThis.Bun ? Bun.stderr.writer() : undefined;
|
||||
if (writer)
|
||||
bench('Bun.stderr.write("Hello World")', () => {
|
||||
writer.write("Hello World\n");
|
||||
writer.flush();
|
||||
});
|
||||
|
||||
if (process.stderr) {
|
||||
bench("process.stderr.write", () => {
|
||||
process.stderr.write("Hello World\n");
|
||||
});
|
||||
}
|
||||
|
||||
bench("console.error('Hello World')", () => {
|
||||
console.error("Hello World");
|
||||
});
|
||||
|
||||
bench("console.error('Hello World', 'wat')", () => {
|
||||
console.error("Hello World", "wat");
|
||||
});
|
||||
|
||||
await run({ percentiles: false });
|
||||
28
bench/snippets/string-decoder.mjs
Normal file
28
bench/snippets/string-decoder.mjs
Normal file
@@ -0,0 +1,28 @@
|
||||
import { bench, run } from "mitata";
|
||||
import { StringDecoder } from "string_decoder";
|
||||
|
||||
var short = Buffer.from("Hello World!");
|
||||
var shortUTF16 = Buffer.from("Hello World 💕💕💕");
|
||||
var long = Buffer.from("Hello World!".repeat(1024));
|
||||
var longUTF16 = Buffer.from("Hello World 💕💕💕".repeat(1024));
|
||||
bench(`${short.length} ascii`, () => {
|
||||
var decoder = new StringDecoder();
|
||||
decoder.write(short);
|
||||
});
|
||||
|
||||
bench(`${short.length} utf8`, () => {
|
||||
var decoder = new StringDecoder();
|
||||
decoder.write(shortUTF16);
|
||||
});
|
||||
|
||||
bench(`${long.length} ascii`, () => {
|
||||
var decoder = new StringDecoder();
|
||||
decoder.write(long);
|
||||
});
|
||||
|
||||
bench(`${longUTF16.length} utf8`, () => {
|
||||
var decoder = new StringDecoder();
|
||||
decoder.write(longUTF16);
|
||||
});
|
||||
|
||||
await run();
|
||||
51
bench/snippets/tcp-echo.bun.ts
Normal file
51
bench/snippets/tcp-echo.bun.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { listen, connect } from "bun";
|
||||
|
||||
var counter = 0;
|
||||
const msg = "Hello World!";
|
||||
|
||||
const handlers = {
|
||||
open(socket) {
|
||||
if (!socket.data?.isServer) {
|
||||
if (!socket.write(msg)) {
|
||||
socket.data = { pending: msg };
|
||||
}
|
||||
}
|
||||
},
|
||||
data(socket, buffer) {
|
||||
if (!socket.write(buffer)) {
|
||||
socket.data = { pending: buffer };
|
||||
return;
|
||||
}
|
||||
counter++;
|
||||
},
|
||||
drain(socket) {
|
||||
const pending = socket.data?.pending;
|
||||
if (!pending) return;
|
||||
if (socket.write(pending)) {
|
||||
socket.data = undefined;
|
||||
counter++;
|
||||
return;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
setInterval(() => {
|
||||
console.log("Wrote", counter, "messages");
|
||||
counter = 0;
|
||||
}, 1000);
|
||||
|
||||
if (process.env.IS_SERVER)
|
||||
listen({
|
||||
socket: handlers,
|
||||
hostname: "0.0.0.0",
|
||||
port: 8000,
|
||||
data: {
|
||||
isServer: true,
|
||||
},
|
||||
});
|
||||
else
|
||||
await connect({
|
||||
socket: handlers,
|
||||
hostname: "localhost",
|
||||
port: 8000,
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user