mirror of
https://github.com/oven-sh/bun
synced 2026-02-17 14:22:01 +00:00
Compare commits
1572 Commits
bun-v0.0.1
...
bun-v0.0.7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89fb624c5b | ||
|
|
6bcaa33751 | ||
|
|
8b73afad95 | ||
|
|
f63ddac287 | ||
|
|
21ac71f740 | ||
|
|
7df84b38b7 | ||
|
|
8ce7c83779 | ||
|
|
5de13e0038 | ||
|
|
09a7b01ee7 | ||
|
|
fe89fc8a64 | ||
|
|
1a7b546055 | ||
|
|
e92c832697 | ||
|
|
b633573ad0 | ||
|
|
c97ca4830e | ||
|
|
3b78cfe71a | ||
|
|
422bdf692a | ||
|
|
fa1d4c2d7f | ||
|
|
942c70c795 | ||
|
|
75fa87482d | ||
|
|
1fc9b93ed6 | ||
|
|
38430fbf0e | ||
|
|
64466e3259 | ||
|
|
6918e20f22 | ||
|
|
6b903de12c | ||
|
|
f1f3501628 | ||
|
|
e866fa1203 | ||
|
|
90940ec240 | ||
|
|
79caba9506 | ||
|
|
7083ef47bb | ||
|
|
234dd04c86 | ||
|
|
6f095a6394 | ||
|
|
8a52e09e8b | ||
|
|
2ea7970a82 | ||
|
|
069fce0033 | ||
|
|
57e42cc538 | ||
|
|
2498784d14 | ||
|
|
ec14a2ef5d | ||
|
|
8f93cc37d2 | ||
|
|
9a43eb903d | ||
|
|
5a6010deda | ||
|
|
a168c51395 | ||
|
|
5aae8726ef | ||
|
|
aff9d232b1 | ||
|
|
d0a9b404c3 | ||
|
|
e3b3631634 | ||
|
|
7b8113c7c7 | ||
|
|
2d1538e698 | ||
|
|
1316dd1a4f | ||
|
|
13f1cdca7b | ||
|
|
00977c75ba | ||
|
|
0e9056eca5 | ||
|
|
4ab4ae77ac | ||
|
|
4638871050 | ||
|
|
13cd18e614 | ||
|
|
0a8976c1e0 | ||
|
|
19515ca63a | ||
|
|
f4504292cf | ||
|
|
6d71749c70 | ||
|
|
777e5f47be | ||
|
|
e97934a225 | ||
|
|
e65c82a032 | ||
|
|
6f39b8f576 | ||
|
|
7b93123133 | ||
|
|
d6831cf801 | ||
|
|
64f1af0aa6 | ||
|
|
313ad01e42 | ||
|
|
44b0c8153a | ||
|
|
c8f6337f1f | ||
|
|
7998a43b04 | ||
|
|
17c1f403c1 | ||
|
|
1422055304 | ||
|
|
3ca113059d | ||
|
|
f4f07f8993 | ||
|
|
187fd9f61f | ||
|
|
69eeff1f76 | ||
|
|
4204baabe6 | ||
|
|
01b1fee284 | ||
|
|
bdb5e4aa56 | ||
|
|
026657d83b | ||
|
|
e35895888e | ||
|
|
90ead2d992 | ||
|
|
43622a8eb7 | ||
|
|
eeff004ec2 | ||
|
|
1bf898828b | ||
|
|
0a742506ff | ||
|
|
701d6ec45d | ||
|
|
787769ac39 | ||
|
|
33950c0ae7 | ||
|
|
99ebef0b2f | ||
|
|
880f6a17b8 | ||
|
|
0456845256 | ||
|
|
ce081f15e9 | ||
|
|
da9a19037f | ||
|
|
d43a645535 | ||
|
|
50d5b872f9 | ||
|
|
ccf57c7f3e | ||
|
|
2cc265361d | ||
|
|
5ee063f6b2 | ||
|
|
50c8747c97 | ||
|
|
3598f0ed8a | ||
|
|
7c5c6cd519 | ||
|
|
093807391a | ||
|
|
18c923596a | ||
|
|
d3de5ff017 | ||
|
|
f8f2ec8f35 | ||
|
|
af6c18ccc5 | ||
|
|
4f5aa438d6 | ||
|
|
bd2f818500 | ||
|
|
29f240ac79 | ||
|
|
c53dc308be | ||
|
|
cb8e5d2cd9 | ||
|
|
d8d5b1a071 | ||
|
|
bb64920cf0 | ||
|
|
427c39b858 | ||
|
|
b0d5903aba | ||
|
|
dbc28a24ac | ||
|
|
51fbbea1d3 | ||
|
|
696710fd7a | ||
|
|
5ace39e4cb | ||
|
|
b878f9054c | ||
|
|
871780fd28 | ||
|
|
4c5eb4b4db | ||
|
|
117ca5355d | ||
|
|
1a02782539 | ||
|
|
c7941bfab0 | ||
|
|
88b60e6f10 | ||
|
|
c5a2172c7b | ||
|
|
b2d847a273 | ||
|
|
4fb5e068bc | ||
|
|
4be4540acf | ||
|
|
a9d99dc0e5 | ||
|
|
d1922d4742 | ||
|
|
d85c59208c | ||
|
|
17d625a735 | ||
|
|
42f61ebf8a | ||
|
|
5e55c02bc6 | ||
|
|
ea7d38cea7 | ||
|
|
4b36efd50a | ||
|
|
c3b96c90d3 | ||
|
|
c0584c5102 | ||
|
|
87c71207e3 | ||
|
|
149bbc12b5 | ||
|
|
78cae049d2 | ||
|
|
7b4f239d33 | ||
|
|
80d4faa8ab | ||
|
|
4bb3f207ed | ||
|
|
2ccb063d20 | ||
|
|
710303be7a | ||
|
|
f337082c82 | ||
|
|
a306d4ae40 | ||
|
|
ea80cd1cd8 | ||
|
|
114c0e8ed2 | ||
|
|
9ccb520e9e | ||
|
|
fb3a262f4b | ||
|
|
50560e169c | ||
|
|
36c249e9c1 | ||
|
|
608b906bd5 | ||
|
|
09146d1c11 | ||
|
|
3f9c5edbf5 | ||
|
|
1ed74ab59b | ||
|
|
0d4a2539a8 | ||
|
|
4cedceaae2 | ||
|
|
7eeacfe672 | ||
|
|
0a86a4ea80 | ||
|
|
d91e897413 | ||
|
|
953ddef482 | ||
|
|
effcad912d | ||
|
|
26a9c1c47b | ||
|
|
e9b4e5a374 | ||
|
|
7576caa54a | ||
|
|
a6901fdac1 | ||
|
|
8c271e5640 | ||
|
|
7600e94ddc | ||
|
|
c5804cd6ff | ||
|
|
5e4b50dc6c | ||
|
|
152f63b019 | ||
|
|
1958f7adb5 | ||
|
|
789b17d333 | ||
|
|
d08aa46381 | ||
|
|
f90ea81d58 | ||
|
|
7e96e82cad | ||
|
|
64b0087e84 | ||
|
|
fe5ef864f1 | ||
|
|
0d56e91e00 | ||
|
|
293a9bc811 | ||
|
|
b8c6865ce0 | ||
|
|
1795b6570c | ||
|
|
152e3cb7bf | ||
|
|
2bc873d8b6 | ||
|
|
2e817195d2 | ||
|
|
12dbc5dfa4 | ||
|
|
026e75c46b | ||
|
|
f6ea59dbd9 | ||
|
|
986895f8c1 | ||
|
|
0694bbce00 | ||
|
|
3bd12180de | ||
|
|
208885e3d2 | ||
|
|
896195f5e3 | ||
|
|
23596b48ca | ||
|
|
0b7897f26c | ||
|
|
08c4f8b103 | ||
|
|
a9b32275f1 | ||
|
|
d1eba784b9 | ||
|
|
ead77e074d | ||
|
|
a3ee0bb291 | ||
|
|
a71c1288a6 | ||
|
|
3182c5d304 | ||
|
|
8effa39410 | ||
|
|
5f50de2b39 | ||
|
|
b37cb73802 | ||
|
|
806e406b67 | ||
|
|
3ad7c23221 | ||
|
|
5b9d5d55e8 | ||
|
|
5c9859e7f2 | ||
|
|
2e1e50486f | ||
|
|
27be64cf12 | ||
|
|
4dd6472908 | ||
|
|
dfa3e19cbf | ||
|
|
fbac824975 | ||
|
|
e77a8db546 | ||
|
|
77a3d791b1 | ||
|
|
bb8626e120 | ||
|
|
931670b7cb | ||
|
|
427de61702 | ||
|
|
1d58a7aadd | ||
|
|
f49c3416d5 | ||
|
|
4f2fc299a9 | ||
|
|
efb4baacdf | ||
|
|
59109a309f | ||
|
|
8f1b2b2350 | ||
|
|
1ecd66e55d | ||
|
|
06ac065d4d | ||
|
|
946404a365 | ||
|
|
ab871d771a | ||
|
|
e11f44e039 | ||
|
|
c27577147c | ||
|
|
79974e4d81 | ||
|
|
eeab75998d | ||
|
|
3a0577ba96 | ||
|
|
37aafb61be | ||
|
|
ad9ced2cc7 | ||
|
|
a0717e6fa7 | ||
|
|
9cecbf42a6 | ||
|
|
cafa9cc3e4 | ||
|
|
a7181cb222 | ||
|
|
aa8080f441 | ||
|
|
65aae0ddad | ||
|
|
90f1f326ca | ||
|
|
8383544bb5 | ||
|
|
65f1733d6f | ||
|
|
37e63eff22 | ||
|
|
24dd80e69a | ||
|
|
7b8de76267 | ||
|
|
17ab2c18eb | ||
|
|
3db3413929 | ||
|
|
32eb20702e | ||
|
|
17a7e2b241 | ||
|
|
83c0ad11ac | ||
|
|
6db46c6d00 | ||
|
|
4ba0e7b7d8 | ||
|
|
7637cfb0a6 | ||
|
|
f5c7c81780 | ||
|
|
44bad4b8e6 | ||
|
|
906a4bd75a | ||
|
|
f8b48ebec6 | ||
|
|
a7bfc48bcc | ||
|
|
6f1891462d | ||
|
|
d00fe1f8af | ||
|
|
5a80a2e216 | ||
|
|
3ab56cee8a | ||
|
|
6f78decf44 | ||
|
|
68e5b0d842 | ||
|
|
fa6bb0fc7c | ||
|
|
103a527128 | ||
|
|
054d873936 | ||
|
|
9f2f33e4e6 | ||
|
|
acb7439232 | ||
|
|
635d553b64 | ||
|
|
fe55720c6c | ||
|
|
08e8eabc6f | ||
|
|
665a359413 | ||
|
|
022e399bff | ||
|
|
2578f426b6 | ||
|
|
37bc3c8872 | ||
|
|
55825c0e33 | ||
|
|
6e735b710a | ||
|
|
8ec958ec01 | ||
|
|
e5a71462b8 | ||
|
|
423d208790 | ||
|
|
83659b898d | ||
|
|
7653a2338e | ||
|
|
8325db48ab | ||
|
|
eadca53e7b | ||
|
|
8cb9391534 | ||
|
|
106979876e | ||
|
|
b9d82ee402 | ||
|
|
776909a72d | ||
|
|
91026d4d1d | ||
|
|
4749df7c51 | ||
|
|
6bf3ae5a18 | ||
|
|
a6de6d630a | ||
|
|
b1e7d38f72 | ||
|
|
cf566ab785 | ||
|
|
9c54b0605d | ||
|
|
ff38312b7d | ||
|
|
b06e520ae4 | ||
|
|
f33d23c0b4 | ||
|
|
b9567eb193 | ||
|
|
7139316ef5 | ||
|
|
6b215dcbbf | ||
|
|
d7c75937a1 | ||
|
|
272f1dea33 | ||
|
|
b4c50d1d28 | ||
|
|
4244e74d96 | ||
|
|
f71c4bb8a4 | ||
|
|
3141b928f8 | ||
|
|
614d810ef4 | ||
|
|
ac91f98528 | ||
|
|
1252b6b7df | ||
|
|
7842da78bc | ||
|
|
dad8b16878 | ||
|
|
3881b7a69c | ||
|
|
0471fae54a | ||
|
|
a3d0b45cc0 | ||
|
|
e72264608b | ||
|
|
eb93ae0d26 | ||
|
|
73836e19b7 | ||
|
|
4257373654 | ||
|
|
297ddfd972 | ||
|
|
969fcd2213 | ||
|
|
18b1a36d84 | ||
|
|
89c99700f6 | ||
|
|
7c6386d81e | ||
|
|
757a1686f0 | ||
|
|
611cdd69b1 | ||
|
|
90c573cd42 | ||
|
|
71ca909008 | ||
|
|
8570b4a9d7 | ||
|
|
d67c95d8eb | ||
|
|
bfd7f3398c | ||
|
|
fce94e29a0 | ||
|
|
5d51b4c397 | ||
|
|
5ec5b657be | ||
|
|
3d057950b9 | ||
|
|
29f0159eae | ||
|
|
95c0f28dee | ||
|
|
185f74dfae | ||
|
|
9369663317 | ||
|
|
e7626b6e04 | ||
|
|
29a718e25d | ||
|
|
8fca3f2487 | ||
|
|
ce442aa3e1 | ||
|
|
6470f26be2 | ||
|
|
9018986600 | ||
|
|
25f15688f0 | ||
|
|
078a7c4c55 | ||
|
|
cc1e19ade0 | ||
|
|
27501a0576 | ||
|
|
2e2521c638 | ||
|
|
bcdd2cf220 | ||
|
|
e8394905d4 | ||
|
|
afe42bc327 | ||
|
|
86f6e30cca | ||
|
|
4a24240d9f | ||
|
|
347b348865 | ||
|
|
d4afa5477d | ||
|
|
7792ef1bde | ||
|
|
5dce6f63d0 | ||
|
|
d43f7aa6aa | ||
|
|
705325d6c5 | ||
|
|
1430cb5e34 | ||
|
|
71fcb7b86c | ||
|
|
3a48954586 | ||
|
|
49aee10cfa | ||
|
|
a571c56b4c | ||
|
|
7b5bf62ad5 | ||
|
|
869eea4bb2 | ||
|
|
ffc900e1b3 | ||
|
|
dded255306 | ||
|
|
9c5dead232 | ||
|
|
0191cabe6e | ||
|
|
e1747c0dd7 | ||
|
|
e50ccc25db | ||
|
|
3a788fa035 | ||
|
|
9715c9223a | ||
|
|
ca6cdb4e98 | ||
|
|
e431dbe5bd | ||
|
|
3063df9b78 | ||
|
|
d8f174e54c | ||
|
|
51abe58a1a | ||
|
|
7f1415c7ae | ||
|
|
6cf3a08780 | ||
|
|
2b45c8dffe | ||
|
|
860d7e93c0 | ||
|
|
dabcac2e96 | ||
|
|
c03b7a6f19 | ||
|
|
909e6a6bab | ||
|
|
a2f91b167d | ||
|
|
b2b8c7f0b7 | ||
|
|
29554f4de3 | ||
|
|
735dc8f1d6 | ||
|
|
a9577c9ba8 | ||
|
|
a89726b30c | ||
|
|
3225a4e7e8 | ||
|
|
432e823f7e | ||
|
|
62541f1ac8 | ||
|
|
faf137b9be | ||
|
|
3c9e30ffcd | ||
|
|
b22a3f5973 | ||
|
|
4232000020 | ||
|
|
475aab6cc3 | ||
|
|
dddd9c23e4 | ||
|
|
1064b9dada | ||
|
|
baffe26dd1 | ||
|
|
1993f9f9a5 | ||
|
|
7f00482cfe | ||
|
|
b2a69a35b8 | ||
|
|
a52a948a70 | ||
|
|
94cbfa4579 | ||
|
|
1a4ccd3f5c | ||
|
|
68cb6130d3 | ||
|
|
64b74ede87 | ||
|
|
213960a04a | ||
|
|
170e58a99d | ||
|
|
f3c4bfcbae | ||
|
|
fa971895a8 | ||
|
|
a5a9f8e821 | ||
|
|
0a547304a7 | ||
|
|
45e7bb0027 | ||
|
|
5d7c34093f | ||
|
|
9322cec8f2 | ||
|
|
047501999d | ||
|
|
30f5e0d37c | ||
|
|
205a6d45b5 | ||
|
|
d47e0de175 | ||
|
|
8c470194ce | ||
|
|
410a6bd32d | ||
|
|
af69b47c22 | ||
|
|
fb2c7e5f38 | ||
|
|
4a1c195b24 | ||
|
|
1489e48950 | ||
|
|
5922ba29ac | ||
|
|
1de275325e | ||
|
|
14301284af | ||
|
|
adeb880d7f | ||
|
|
857e9bee00 | ||
|
|
711e0cef78 | ||
|
|
73449bf433 | ||
|
|
4aabccfc79 | ||
|
|
1e2a61c6a0 | ||
|
|
844fae826f | ||
|
|
ef8d1a95a4 | ||
|
|
bf4943eec1 | ||
|
|
97d17904d3 | ||
|
|
98af486b89 | ||
|
|
8f27b27a0e | ||
|
|
aced5882d1 | ||
|
|
839fd03472 | ||
|
|
fb5a90cb1b | ||
|
|
64a83f1427 | ||
|
|
f684a16051 | ||
|
|
2666b45f2a | ||
|
|
aad33c2611 | ||
|
|
ff2335a910 | ||
|
|
32733210dc | ||
|
|
9f5a1705a5 | ||
|
|
b4c1cea735 | ||
|
|
2572636004 | ||
|
|
3a962f3bad | ||
|
|
bfa2bc6736 | ||
|
|
354ed2880c | ||
|
|
9db4d195a7 | ||
|
|
0808f29375 | ||
|
|
7dbfb3ef41 | ||
|
|
333bccee5d | ||
|
|
25c35e59b4 | ||
|
|
ff7785e023 | ||
|
|
0e138bcc8f | ||
|
|
ecea12d206 | ||
|
|
61d1c7b6b2 | ||
|
|
b5cec4b704 | ||
|
|
e895605e5f | ||
|
|
f5a79ea6d2 | ||
|
|
de0cf42111 | ||
|
|
ec9e4eb97e | ||
|
|
47b6a82920 | ||
|
|
28f77b9823 | ||
|
|
4ac8c1bd84 | ||
|
|
962b7fa8d9 | ||
|
|
d6ebb478e3 | ||
|
|
2b8893da53 | ||
|
|
744f52fb27 | ||
|
|
43b9f9462f | ||
|
|
d89aa9a9e6 | ||
|
|
084d78be29 | ||
|
|
9c627e884d | ||
|
|
da83583cdf | ||
|
|
4d9ae0df06 | ||
|
|
4d95e44317 | ||
|
|
4b7235ac5f | ||
|
|
4152c1b177 | ||
|
|
dc5745080d | ||
|
|
3dfac788fa | ||
|
|
c56ff7efb4 | ||
|
|
114c560912 | ||
|
|
1576d183c9 | ||
|
|
0e0bfe91d0 | ||
|
|
d3559d1cca | ||
|
|
222a1cc9e8 | ||
|
|
03103925bd | ||
|
|
9e470cb48e | ||
|
|
376602a65c | ||
|
|
8493cfe983 | ||
|
|
d11ac34dcb | ||
|
|
08bc06dfe0 | ||
|
|
f4fbf84294 | ||
|
|
56ae4bcb55 | ||
|
|
ec61dc0665 | ||
|
|
b21b0ea849 | ||
|
|
318c423e14 | ||
|
|
834ff71157 | ||
|
|
39a187d32e | ||
|
|
146d2cc231 | ||
|
|
87c95d45f7 | ||
|
|
f7f2f6e6b8 | ||
|
|
3e803b3a58 | ||
|
|
22c01ca14c | ||
|
|
111f0921f5 | ||
|
|
8c515c7077 | ||
|
|
04579909ff | ||
|
|
40ff3e4618 | ||
|
|
c0a446df02 | ||
|
|
8f7cf6bf47 | ||
|
|
4a7b5892af | ||
|
|
9a5aa95893 | ||
|
|
8d623e21b6 | ||
|
|
7a87e41ab8 | ||
|
|
f62f184241 | ||
|
|
8ea69cb5d1 | ||
|
|
97f0cef391 | ||
|
|
85084c6db9 | ||
|
|
a09b995651 | ||
|
|
4098484ff5 | ||
|
|
91b24c6032 | ||
|
|
38d0f0bbd0 | ||
|
|
d3e39632bf | ||
|
|
43ae61e095 | ||
|
|
bd31c88814 | ||
|
|
02c59df1b3 | ||
|
|
f6c05ef7a1 | ||
|
|
505e4b80fd | ||
|
|
cd8d88716f | ||
|
|
d3a93d5273 | ||
|
|
ed9637de50 | ||
|
|
4e744c057b | ||
|
|
4b717fe554 | ||
|
|
236a0fde35 | ||
|
|
306d309209 | ||
|
|
a8f4cd271e | ||
|
|
3cd129544e | ||
|
|
1004e924ff | ||
|
|
c013ede227 | ||
|
|
914b363a37 | ||
|
|
8ad349dcf0 | ||
|
|
7146bfc04a | ||
|
|
e852bc0980 | ||
|
|
8a9b1416ed | ||
|
|
9da7a1ff0a | ||
|
|
219aa57fbd | ||
|
|
5930ac09b7 | ||
|
|
8837c3c10b | ||
|
|
0d0dd65a6a | ||
|
|
0ac9c4276f | ||
|
|
0edf6fd1e4 | ||
|
|
c9d6c25f71 | ||
|
|
73fed6c093 | ||
|
|
75f238fcb3 | ||
|
|
8706f77eb7 | ||
|
|
3cf0689d46 | ||
|
|
623f77e097 | ||
|
|
61d6f8f18f | ||
|
|
6480193c65 | ||
|
|
23a31b3771 | ||
|
|
112b352b03 | ||
|
|
a48c20d470 | ||
|
|
5fd47bc613 | ||
|
|
6966d94d90 | ||
|
|
5311219de7 | ||
|
|
4119f60010 | ||
|
|
0960f3d6d1 | ||
|
|
64b49ddd95 | ||
|
|
2c27526a34 | ||
|
|
fe6b340382 | ||
|
|
8148b8824f | ||
|
|
be0c4b5451 | ||
|
|
168c6138d8 | ||
|
|
b9555a5775 | ||
|
|
b78fff9386 | ||
|
|
963c89cab2 | ||
|
|
d7ef6efd04 | ||
|
|
35fef33868 | ||
|
|
8a9e81d514 | ||
|
|
b17df61043 | ||
|
|
4e0cdf34b6 | ||
|
|
a97dec5c30 | ||
|
|
ad0834bedb | ||
|
|
b53c63910d | ||
|
|
5c0908ee52 | ||
|
|
7f33846005 | ||
|
|
4afda10b82 | ||
|
|
cc0e581bc3 | ||
|
|
df1aa76cc5 | ||
|
|
a3a2fb1e4f | ||
|
|
915dadd9d7 | ||
|
|
d899e0ac6f | ||
|
|
3915e01cfb | ||
|
|
2fc6da125f | ||
|
|
ba4013816d | ||
|
|
b64113b7d9 | ||
|
|
a9483dd8dc | ||
|
|
5f2fb86a76 | ||
|
|
386ba990bf | ||
|
|
7f1b5c09de | ||
|
|
fcfdd71c06 | ||
|
|
73336bbc00 | ||
|
|
e7fa50635f | ||
|
|
fddec80755 | ||
|
|
dac3389b27 | ||
|
|
c952eb7dea | ||
|
|
6a28cfd2ba | ||
|
|
e4693b8aaf | ||
|
|
87e78e2a48 | ||
|
|
6ac9b5fa9d | ||
|
|
71449c8638 | ||
|
|
a17088363f | ||
|
|
83004f0a0a | ||
|
|
c42fbbd10e | ||
|
|
d068d80ab9 | ||
|
|
eb142a6be5 | ||
|
|
9fde2b28e1 | ||
|
|
195723180b | ||
|
|
2e051cebaa | ||
|
|
795d0b056c | ||
|
|
d7c69d3b78 | ||
|
|
059aa425b7 | ||
|
|
aaf5c28c5b | ||
|
|
3083bbadc1 | ||
|
|
150ca5d686 | ||
|
|
58d1e2e1be | ||
|
|
090bae9a94 | ||
|
|
113f0427ab | ||
|
|
36520d6ec1 | ||
|
|
2a7d8df4c5 | ||
|
|
ac6a2bf2e5 | ||
|
|
3c1cb806d4 | ||
|
|
e5587c2b31 | ||
|
|
8128c79e81 | ||
|
|
ae5e2f5af2 | ||
|
|
a8b7b2a6b9 | ||
|
|
111bef7f06 | ||
|
|
6f1c6fbc1a | ||
|
|
31cd05191d | ||
|
|
efb8c4e36b | ||
|
|
ed71379aa1 | ||
|
|
b1c3fce49b | ||
|
|
e75c711c68 | ||
|
|
8d031f13c0 | ||
|
|
42a73f91fe | ||
|
|
c508fd9b13 | ||
|
|
c62949b98e | ||
|
|
0b640c785f | ||
|
|
fe17d51b03 | ||
|
|
565cf23d92 | ||
|
|
020e2e00c3 | ||
|
|
f4870050e0 | ||
|
|
f31e67b13d | ||
|
|
6f4d48cc6c | ||
|
|
fb34ebc674 | ||
|
|
6c867c34d7 | ||
|
|
70a56028b6 | ||
|
|
08327e2748 | ||
|
|
6d6b7f93f3 | ||
|
|
0d95cf8f5b | ||
|
|
471f9aec19 | ||
|
|
b5beb20e08 | ||
|
|
c8b6e2d5cd | ||
|
|
8ccb833421 | ||
|
|
93ec969005 | ||
|
|
5a42b59e91 | ||
|
|
266870fee8 | ||
|
|
ca5245bb9b | ||
|
|
84b3c952d9 | ||
|
|
6ef71a800f | ||
|
|
77778aeadf | ||
|
|
e8275b767e | ||
|
|
efdf7fb93e | ||
|
|
1fd2d26185 | ||
|
|
cac19d9e8b | ||
|
|
1d03df7d33 | ||
|
|
90ae5cd897 | ||
|
|
bb346c8d2b | ||
|
|
317932204e | ||
|
|
a48c7e1d83 | ||
|
|
336a4b6ac2 | ||
|
|
c9c7521f4f | ||
|
|
b455bc467d | ||
|
|
d1df057d08 | ||
|
|
062aebeba0 | ||
|
|
cff83a3fec | ||
|
|
b08d5267cb | ||
|
|
1ce37acde6 | ||
|
|
b7cd0c63e5 | ||
|
|
a866da84d9 | ||
|
|
6908f44aa2 | ||
|
|
181b8a2744 | ||
|
|
5a7bebc8b5 | ||
|
|
536d6ab302 | ||
|
|
99446ffa8a | ||
|
|
143973e031 | ||
|
|
bb5ad6e1ad | ||
|
|
6ae433249d | ||
|
|
5f5b824ade | ||
|
|
34abc8116c | ||
|
|
1efaaefd63 | ||
|
|
cfd635786a | ||
|
|
11e3faa8da | ||
|
|
1002990619 | ||
|
|
a94bbd8f3c | ||
|
|
46354da728 | ||
|
|
2c7c2b3fa6 | ||
|
|
938d866c1b | ||
|
|
42ff5415ba | ||
|
|
0e52be8427 | ||
|
|
5105614b83 | ||
|
|
77fc310a70 | ||
|
|
3541177d50 | ||
|
|
3c3ab57cf6 | ||
|
|
b73e7a9732 | ||
|
|
2047140dda | ||
|
|
b7e2f6c71a | ||
|
|
e1505d88b1 | ||
|
|
d04e5ea0ba | ||
|
|
3ebcd9bbe7 | ||
|
|
ab9ccc985a | ||
|
|
2188be219e | ||
|
|
a34792ce16 | ||
|
|
9160c9ae31 | ||
|
|
8e05fbf43f | ||
|
|
c59ff7416a | ||
|
|
c943072193 | ||
|
|
d39cc1fb5f | ||
|
|
005a0ec931 | ||
|
|
2cfdf29364 | ||
|
|
7254c71683 | ||
|
|
328534605f | ||
|
|
5eb7383613 | ||
|
|
75c2f4f394 | ||
|
|
6cbe506915 | ||
|
|
3d6ac8face | ||
|
|
14fe014fdf | ||
|
|
8f16eeb82a | ||
|
|
84e5072741 | ||
|
|
3f72da9d0b | ||
|
|
873e12c7c6 | ||
|
|
fecfb784ee | ||
|
|
5a7014a418 | ||
|
|
ceae7ef672 | ||
|
|
67b09911c1 | ||
|
|
3043bb70e1 | ||
|
|
ff99155f7d | ||
|
|
dc2dae5d87 | ||
|
|
76eeb5df42 | ||
|
|
185a985a85 | ||
|
|
834e8359ee | ||
|
|
503f70bba4 | ||
|
|
c3e45b662a | ||
|
|
4f16f87b4d | ||
|
|
9db1a5786d | ||
|
|
b9b150f147 | ||
|
|
0eecec75e2 | ||
|
|
581f3540b6 | ||
|
|
68dabd4d25 | ||
|
|
59b171db04 | ||
|
|
e97ebfb036 | ||
|
|
7380d03e00 | ||
|
|
5be558ef15 | ||
|
|
a7116cf353 | ||
|
|
3147f69435 | ||
|
|
0ef9b00dc7 | ||
|
|
bc05793cbe | ||
|
|
fd349f3020 | ||
|
|
df5a3c4da4 | ||
|
|
fe415a30c5 | ||
|
|
382208e59c | ||
|
|
ed02a24e0e | ||
|
|
e712d3458c | ||
|
|
685681dedc | ||
|
|
b412da6b8a | ||
|
|
03dc674c2d | ||
|
|
d0bcd3c6fb | ||
|
|
6649218e17 | ||
|
|
453fae4a5c | ||
|
|
3f32222360 | ||
|
|
479705e8ce | ||
|
|
e8fc9d5c9b | ||
|
|
38d3b200b5 | ||
|
|
a0551a9b8b | ||
|
|
be03fc273a | ||
|
|
ab496e9e34 | ||
|
|
81e7576150 | ||
|
|
2e69f15c20 | ||
|
|
0c7b35d0ab | ||
|
|
e12f10ae0e | ||
|
|
961b704a8e | ||
|
|
4ee8055f17 | ||
|
|
394335fa91 | ||
|
|
8125c05be0 | ||
|
|
059f01d23a | ||
|
|
5f80f9c814 | ||
|
|
0cee57f1d9 | ||
|
|
eab99b3bae | ||
|
|
a1e1509358 | ||
|
|
39d8b0c8c1 | ||
|
|
1356029bea | ||
|
|
b8af8a1af0 | ||
|
|
06c79cffae | ||
|
|
430fe09d6d | ||
|
|
5455c71f93 | ||
|
|
e2d6c692c4 | ||
|
|
501fab0bef | ||
|
|
1f1c337eb6 | ||
|
|
1c9131a5d7 | ||
|
|
fb758a32e1 | ||
|
|
d4c55557c3 | ||
|
|
0e39174c48 | ||
|
|
40401a6ed2 | ||
|
|
74ea36ac1c | ||
|
|
2d48674c5b | ||
|
|
42c7d887d3 | ||
|
|
8dcaaa9e09 | ||
|
|
267e926a38 | ||
|
|
11e6ffaae9 | ||
|
|
6a5dd6ed58 | ||
|
|
bcd68b937d | ||
|
|
9fab7ca06c | ||
|
|
4082a34599 | ||
|
|
f9debc72fa | ||
|
|
b363402f45 | ||
|
|
b0942fbc37 | ||
|
|
e3a12ea1a9 | ||
|
|
5dd6fb8547 | ||
|
|
8586d2e41c | ||
|
|
ba1e95fd43 | ||
|
|
e7538d7b26 | ||
|
|
2b7ebaceb2 | ||
|
|
3de3c3c143 | ||
|
|
0e0e325e5b | ||
|
|
e97106c770 | ||
|
|
50f8e0daa8 | ||
|
|
efcf846b2c | ||
|
|
afe3e13345 | ||
|
|
461c769ac4 | ||
|
|
0dc0d6c31c | ||
|
|
49d8ea4886 | ||
|
|
e66776a79f | ||
|
|
3036cbe552 | ||
|
|
393aa076bc | ||
|
|
0ef6f81843 | ||
|
|
339fe00dfe | ||
|
|
6382bb5333 | ||
|
|
41c60fb848 | ||
|
|
8df49bc823 | ||
|
|
ab4129061e | ||
|
|
021a670d86 | ||
|
|
fa27551428 | ||
|
|
538243dc3b | ||
|
|
d83c610002 | ||
|
|
196f7eb101 | ||
|
|
a1167d80b2 | ||
|
|
a765b13f52 | ||
|
|
45b3e9d03c | ||
|
|
5844166047 | ||
|
|
c6dcc1cd9e | ||
|
|
118ed4d2ab | ||
|
|
9fcd2c53c8 | ||
|
|
da80830bc5 | ||
|
|
b060056480 | ||
|
|
b71df3a3d4 | ||
|
|
128e9861f9 | ||
|
|
5d2cb27562 | ||
|
|
75e340bfbf | ||
|
|
b5744e5da4 | ||
|
|
7bad5770a1 | ||
|
|
809c1e46d8 | ||
|
|
c056093125 | ||
|
|
88ea1de80f | ||
|
|
7c8a835fa0 | ||
|
|
c6317888da | ||
|
|
9f1946ce70 | ||
|
|
32be2866f6 | ||
|
|
448d60ebbf | ||
|
|
c536370ab8 | ||
|
|
dccc6bf1af | ||
|
|
e331ebbf7d | ||
|
|
b1660fa468 | ||
|
|
4af743766d | ||
|
|
8f35f16c7e | ||
|
|
e08710e373 | ||
|
|
48b9af1298 | ||
|
|
cec59bc580 | ||
|
|
dff23f5a7b | ||
|
|
bcdff7f6f0 | ||
|
|
49dbf79e81 | ||
|
|
1610ff33ea | ||
|
|
b5fd121f26 | ||
|
|
c292ea7b94 | ||
|
|
de56f3a562 | ||
|
|
94e469c803 | ||
|
|
0d369baf9d | ||
|
|
0ab00df154 | ||
|
|
6167d95167 | ||
|
|
d582e42d4d | ||
|
|
6da14ae310 | ||
|
|
442f85e89e | ||
|
|
8cf8bf441e | ||
|
|
2cc25f64f2 | ||
|
|
035008cd9d | ||
|
|
e7f1ff14d6 | ||
|
|
c092d2ba70 | ||
|
|
d1783babd9 | ||
|
|
7519f364e5 | ||
|
|
7f9ab7dfce | ||
|
|
f9d87f28f6 | ||
|
|
dd7225fb2a | ||
|
|
134748a238 | ||
|
|
b57d890cbd | ||
|
|
50163e1385 | ||
|
|
fde4cd4d17 | ||
|
|
b6e164355b | ||
|
|
2e9af40bca | ||
|
|
2f45c3d2cd | ||
|
|
d763c0ab4e | ||
|
|
baa93d4b37 | ||
|
|
dd7659c643 | ||
|
|
aed6f89772 | ||
|
|
39af1ccc7c | ||
|
|
52f4ba767a | ||
|
|
0f853a2fee | ||
|
|
ca807afba2 | ||
|
|
e349e54cb8 | ||
|
|
39218ec0f7 | ||
|
|
908d9d86b3 | ||
|
|
92f3efeac2 | ||
|
|
a772b56cb6 | ||
|
|
bd6b9a58d3 | ||
|
|
873cacc15a | ||
|
|
55ff681976 | ||
|
|
618ecdb76c | ||
|
|
8af6ad7278 | ||
|
|
c07de8c4d3 | ||
|
|
e10fe8aaad | ||
|
|
feb45edf6d | ||
|
|
0a916543b3 | ||
|
|
2c53ff2980 | ||
|
|
b2fcc027a9 | ||
|
|
1dc78ba4b7 | ||
|
|
04e0910dea | ||
|
|
d19a6199ea | ||
|
|
e8925e47b0 | ||
|
|
cc712668f0 | ||
|
|
f7dbf5ac38 | ||
|
|
283a01493c | ||
|
|
f82aa92c38 | ||
|
|
7660f72745 | ||
|
|
4e4f2058c2 | ||
|
|
ca25e32c0f | ||
|
|
5a1f60c729 | ||
|
|
ac242f94ca | ||
|
|
9ab9b01a64 | ||
|
|
cdeb39bd7f | ||
|
|
1d01ffeb9e | ||
|
|
25a49005cc | ||
|
|
875b60dfe5 | ||
|
|
c071037485 | ||
|
|
4edfa171f0 | ||
|
|
0eb3cdc43c | ||
|
|
f747fd9dfa | ||
|
|
c06e34c687 | ||
|
|
7f62169b5e | ||
|
|
5b2c7ad1f3 | ||
|
|
c535cd7613 | ||
|
|
6e21c9927c | ||
|
|
c3d9804e85 | ||
|
|
30c79875a3 | ||
|
|
a79153f6e0 | ||
|
|
87319ba73d | ||
|
|
cb18bf7e5d | ||
|
|
304a36b814 | ||
|
|
6ee673095c | ||
|
|
cf4964c8f4 | ||
|
|
a1b88e85fd | ||
|
|
46a8215092 | ||
|
|
62694f0ee9 | ||
|
|
e8bdf1c7db | ||
|
|
2af4192756 | ||
|
|
fd80d0a22d | ||
|
|
86743ab361 | ||
|
|
cca8081f2e | ||
|
|
5c5b246cc3 | ||
|
|
469a36e3b6 | ||
|
|
f9d333bec2 | ||
|
|
38879cd3d9 | ||
|
|
eb3123adb8 | ||
|
|
2b4f20b94c | ||
|
|
19949c0743 | ||
|
|
8d03e0cf02 | ||
|
|
265b1035f4 | ||
|
|
8e0230b756 | ||
|
|
478273e044 | ||
|
|
d0c2f5495c | ||
|
|
4a09ad51f0 | ||
|
|
5bef1b46d3 | ||
|
|
3bec430192 | ||
|
|
18f0093b18 | ||
|
|
adfaa21d03 | ||
|
|
01d1f1d258 | ||
|
|
4e775d275c | ||
|
|
035f6fe5e1 | ||
|
|
bba74499e5 | ||
|
|
b61cbb1df8 | ||
|
|
1a60d7df98 | ||
|
|
89a7e3bf2f | ||
|
|
fe1a6cee10 | ||
|
|
6a66d9f7fb | ||
|
|
fadbcca99c | ||
|
|
0b48e7272d | ||
|
|
23bdc6f792 | ||
|
|
de7274fcff | ||
|
|
b126392a8e | ||
|
|
d2a9e31fd3 | ||
|
|
6d61bcc4e1 | ||
|
|
d8e3ca4a88 | ||
|
|
351184991a | ||
|
|
14b51ef57c | ||
|
|
7a836382b3 | ||
|
|
360dec4fb9 | ||
|
|
83cf1be2b9 | ||
|
|
241525947c | ||
|
|
76a99eaa18 | ||
|
|
4bceb57ad1 | ||
|
|
c7705a6325 | ||
|
|
4f78e2c47c | ||
|
|
6789aed119 | ||
|
|
291f26cba0 | ||
|
|
a3458ce6e3 | ||
|
|
a7eb5397a4 | ||
|
|
fc03ed2969 | ||
|
|
12f1991771 | ||
|
|
57946e114c | ||
|
|
8b3463e73f | ||
|
|
3cb7dbe921 | ||
|
|
d11102d858 | ||
|
|
183911514a | ||
|
|
bc3c17ffc8 | ||
|
|
3379289024 | ||
|
|
562a8df46b | ||
|
|
68e2869d64 | ||
|
|
c6818cc55c | ||
|
|
08b3bab2ec | ||
|
|
34771aad22 | ||
|
|
109d53d461 | ||
|
|
958520f557 | ||
|
|
12c311da3f | ||
|
|
d7d9df726b | ||
|
|
a368182769 | ||
|
|
2a9fd30d36 | ||
|
|
082a944e0b | ||
|
|
e1b68665db | ||
|
|
c64ef1e2f4 | ||
|
|
3063c2e64d | ||
|
|
38f46169d9 | ||
|
|
c1aa0323dc | ||
|
|
673b755987 | ||
|
|
3d6fab6e49 | ||
|
|
d0823beef5 | ||
|
|
b0e98892e5 | ||
|
|
0006d28cbb | ||
|
|
42dcc4e217 | ||
|
|
13582981e4 | ||
|
|
d4c1bf6c67 | ||
|
|
3ef55d10ae | ||
|
|
5ce171d92c | ||
|
|
e409148941 | ||
|
|
d44abd8e4d | ||
|
|
5c38b6c355 | ||
|
|
04ecfdd794 | ||
|
|
fc59a32b63 | ||
|
|
fd57e2d9a6 | ||
|
|
303a5ea898 | ||
|
|
d502d0bcd6 | ||
|
|
2018f5020a | ||
|
|
92a7849e98 | ||
|
|
59bdb62966 | ||
|
|
eab1938012 | ||
|
|
d97bd79c86 | ||
|
|
35c05f61e5 | ||
|
|
a5181c8ed1 | ||
|
|
aa545ac0dc | ||
|
|
ac9bd094f3 | ||
|
|
becf55febc | ||
|
|
c41cc80700 | ||
|
|
20b1a27d05 | ||
|
|
a027e9b6bc | ||
|
|
3fe676e9c9 | ||
|
|
bffe8e918b | ||
|
|
92e5fe9fd5 | ||
|
|
b107ac1659 | ||
|
|
5537c03569 | ||
|
|
4ab7c82405 | ||
|
|
6e8cd2e3e5 | ||
|
|
c0c7527497 | ||
|
|
e71cb5c8c9 | ||
|
|
cdbb4cf68a | ||
|
|
204d468ad2 | ||
|
|
1844212f34 | ||
|
|
fbb0342511 | ||
|
|
92b174b315 | ||
|
|
0ba9784be2 | ||
|
|
2c50cf7284 | ||
|
|
bea0dca55d | ||
|
|
1676af9de9 | ||
|
|
3d48bdaad1 | ||
|
|
1b474d4f97 | ||
|
|
4467167f99 | ||
|
|
36ec8bb99b | ||
|
|
bc5f99dc43 | ||
|
|
4d4966592e | ||
|
|
f1fff3af7e | ||
|
|
83e553d6a9 | ||
|
|
173724b402 | ||
|
|
64d3927879 | ||
|
|
49ad70b11c | ||
|
|
0d0b769bcc | ||
|
|
fb2aa186b7 | ||
|
|
ef94826f95 | ||
|
|
d79f34e960 | ||
|
|
4ce6e4a9cb | ||
|
|
9cf2771549 | ||
|
|
daf583e4cb | ||
|
|
51e55f4b6e | ||
|
|
f30527b6d9 | ||
|
|
17b186933d | ||
|
|
fd57edceff | ||
|
|
1876c0e11a | ||
|
|
cd5c740368 | ||
|
|
e2eef2bb25 | ||
|
|
ad3c19a160 | ||
|
|
07bb25f7b1 | ||
|
|
edd0223377 | ||
|
|
34a8a623f4 | ||
|
|
f854539ea9 | ||
|
|
cd1b8ccde7 | ||
|
|
cf3f8d2bb0 | ||
|
|
f1a0e718b3 | ||
|
|
08e0a51036 | ||
|
|
8e0f21cc91 | ||
|
|
ae7843f244 | ||
|
|
b5b47e6525 | ||
|
|
e7a4f9f507 | ||
|
|
658926189f | ||
|
|
154c8372e3 | ||
|
|
a68b5eef86 | ||
|
|
65ea1e4647 | ||
|
|
f8f85430c0 | ||
|
|
d8a2eb81e3 | ||
|
|
9a9c0df6b0 | ||
|
|
0a86beccc7 | ||
|
|
2fe9791127 | ||
|
|
b856d50c3f | ||
|
|
dde2b80e1d | ||
|
|
49b954462d | ||
|
|
c51dac1282 | ||
|
|
0d002c7057 | ||
|
|
1d03e90b5c | ||
|
|
25ac773cf3 | ||
|
|
ecb069ac85 | ||
|
|
a6cf6c4069 | ||
|
|
6854d83842 | ||
|
|
4aab78f619 | ||
|
|
95d2860930 | ||
|
|
70db76a798 | ||
|
|
07bf3eb1e9 | ||
|
|
237e672e70 | ||
|
|
61d436c29d | ||
|
|
22ea3e76f9 | ||
|
|
0089d04459 | ||
|
|
26ee46ad5b | ||
|
|
417c4e0faa | ||
|
|
b6675dd0ab | ||
|
|
dff40c5220 | ||
|
|
1fd426432e | ||
|
|
97c43ef787 | ||
|
|
a546e56669 | ||
|
|
4b52192974 | ||
|
|
fb10e0c4cb | ||
|
|
a44cb9708f | ||
|
|
c7fc08056a | ||
|
|
12ba37e43a | ||
|
|
928346b842 | ||
|
|
b81c895e1d | ||
|
|
d434e5aeac | ||
|
|
2250db41b4 | ||
|
|
826db9021e | ||
|
|
ad61279621 | ||
|
|
5ce1b36130 | ||
|
|
a1f17f70eb | ||
|
|
a0f086ba85 | ||
|
|
8d095a235f | ||
|
|
ff1417421b | ||
|
|
00fb04f309 | ||
|
|
a3cc17fbe6 | ||
|
|
fd27d403d7 | ||
|
|
6d29e314a0 | ||
|
|
902e438e6c | ||
|
|
096d668d83 | ||
|
|
49c5c32714 | ||
|
|
9a70d8daa2 | ||
|
|
79eb8d9d78 | ||
|
|
221b280856 | ||
|
|
933378ab80 | ||
|
|
bd51d194cf | ||
|
|
1e27c7d8ce | ||
|
|
7d554ed175 | ||
|
|
e72d765961 | ||
|
|
9ce38b86ab | ||
|
|
05bdda7b07 | ||
|
|
d68f18c77a | ||
|
|
ae6349e573 | ||
|
|
0541cff2ad | ||
|
|
e69f8c36d2 | ||
|
|
e7f191c08b | ||
|
|
6a2372b0b2 | ||
|
|
0592515639 | ||
|
|
a6c4bba6c2 | ||
|
|
5691bf385b | ||
|
|
a149f0abb9 | ||
|
|
eae7051111 | ||
|
|
adb6be05d1 | ||
|
|
4e889c7b47 | ||
|
|
2ed6605cc3 | ||
|
|
42c264bf7b | ||
|
|
fe6564b533 | ||
|
|
f6923f21b1 | ||
|
|
edfc61889c | ||
|
|
08c8ca18a7 | ||
|
|
9e4f16ac8b | ||
|
|
03ece0568d | ||
|
|
2dcb465d50 | ||
|
|
c93655c717 | ||
|
|
6f6510169e | ||
|
|
cfe159f636 | ||
|
|
213f361551 | ||
|
|
3582941791 | ||
|
|
a3cd9347e6 | ||
|
|
449c8b5f36 | ||
|
|
1f7af3754d | ||
|
|
72df6b9be2 | ||
|
|
044c0cfdc3 | ||
|
|
3c43f65234 | ||
|
|
bd2d284c53 | ||
|
|
ffea9c010b | ||
|
|
44351b57f7 | ||
|
|
4bbb938de8 | ||
|
|
437270e0af | ||
|
|
09b7f4c95d | ||
|
|
38f83c50c4 | ||
|
|
2f06dc5755 | ||
|
|
d6b66e2155 | ||
|
|
309298fa42 | ||
|
|
a0a2fa964b | ||
|
|
0c769d0f61 | ||
|
|
1b90619890 | ||
|
|
0ea34216de | ||
|
|
53374ac54a | ||
|
|
6355ac219e | ||
|
|
384ad96637 | ||
|
|
0361b0df70 | ||
|
|
a1b8c20c3f | ||
|
|
de01d581c1 | ||
|
|
f1bda194e0 | ||
|
|
a84b62452c | ||
|
|
e039ba5130 | ||
|
|
e67dd8947b | ||
|
|
2d6a4a4956 | ||
|
|
f394581ed8 | ||
|
|
33b0c89e7c | ||
|
|
4e3aa3c289 | ||
|
|
58b196c583 | ||
|
|
3dc53c3d13 | ||
|
|
4f2c1cfe85 | ||
|
|
6e16b3cf84 | ||
|
|
9f0ab479b0 | ||
|
|
884b5e13ee | ||
|
|
7d4aab4cf1 | ||
|
|
6bb0c03d8d | ||
|
|
797c94b0e9 | ||
|
|
e63fbcefe9 | ||
|
|
dcc29d3db6 | ||
|
|
be66c01829 | ||
|
|
21b9884606 | ||
|
|
fd6d93292c | ||
|
|
9000165718 | ||
|
|
54b313cc5a | ||
|
|
2461c11536 | ||
|
|
f17345ffe4 | ||
|
|
4908a63f61 | ||
|
|
da7de899e1 | ||
|
|
44108d6a26 | ||
|
|
c7fb978b7b | ||
|
|
0db94d94d6 | ||
|
|
92e489760d | ||
|
|
decee7616f | ||
|
|
deafd3d0d4 | ||
|
|
b9bbd819be | ||
|
|
b956ea5a5e | ||
|
|
cf2e81b036 | ||
|
|
bf2732599c | ||
|
|
10696680ff | ||
|
|
7e159cb5cd | ||
|
|
74cda61c88 | ||
|
|
9dfe57a3f7 | ||
|
|
f10dcd780c | ||
|
|
bee7efb5d9 | ||
|
|
0039b53d21 | ||
|
|
9f86acbe58 | ||
|
|
bbc1bcbed1 | ||
|
|
3ed824fe0f | ||
|
|
fe24b96d61 | ||
|
|
4b6d8a152f | ||
|
|
e21b9afdf2 | ||
|
|
901d7d8759 | ||
|
|
4b618f9ad1 | ||
|
|
0f7bc76f39 | ||
|
|
6d997ab201 | ||
|
|
8f7f4ae72f | ||
|
|
c85b5f6a87 | ||
|
|
ba5f9887fb | ||
|
|
9e3e9a2d6d | ||
|
|
88a5e2d34d | ||
|
|
afc346d6f1 | ||
|
|
4dd398ca7a | ||
|
|
756bfc9077 | ||
|
|
f646250a91 | ||
|
|
24c567086f | ||
|
|
05b1696df7 | ||
|
|
0baa3b511e | ||
|
|
d793088575 | ||
|
|
9aa7f9ed18 | ||
|
|
e7f6cf12a5 | ||
|
|
e2ba468924 | ||
|
|
85760c0a4c | ||
|
|
0db7af6166 | ||
|
|
5e3d1dd4b5 | ||
|
|
6eb9a36a22 | ||
|
|
e88e9401f1 | ||
|
|
829b4287dd | ||
|
|
2bf7b5a7ab | ||
|
|
1c83f3091c | ||
|
|
dfd08e7c55 | ||
|
|
3b28af17db | ||
|
|
5a03dfb9a4 | ||
|
|
fa1aa301e8 | ||
|
|
ae7b91efe2 | ||
|
|
6d9ccd9b8e | ||
|
|
0d79435ce2 | ||
|
|
4ee2fdf1c6 | ||
|
|
cd273daa1b | ||
|
|
c2e9d49f69 | ||
|
|
38a9c92eec | ||
|
|
1d0f442718 | ||
|
|
1e8babe185 | ||
|
|
69d3b5ca60 | ||
|
|
a493c18193 | ||
|
|
5370ea71c0 | ||
|
|
0afec7739b | ||
|
|
a7173d54ce | ||
|
|
3b10cfae80 | ||
|
|
bd14ad9e6e | ||
|
|
9507cd8ed6 | ||
|
|
dfe74cb5c4 | ||
|
|
00e7b7c3d5 | ||
|
|
d2be50bf4d | ||
|
|
f0f3d6d4eb | ||
|
|
21d918921a | ||
|
|
55095edee6 | ||
|
|
6a7deab74d | ||
|
|
7db27f11d0 | ||
|
|
3ebb4feb98 | ||
|
|
e8dab9bfcf | ||
|
|
dc3eee44a9 | ||
|
|
9e8463af33 | ||
|
|
dd2bdd09db | ||
|
|
0eb3c1d393 | ||
|
|
cb6a1b7225 | ||
|
|
38c73788e1 | ||
|
|
2c89122ce9 | ||
|
|
2eae013ebf | ||
|
|
1247a9c93d | ||
|
|
5c6dd19826 | ||
|
|
9d0ee5c5cd | ||
|
|
3affc2a2d8 | ||
|
|
02bdaa6d10 | ||
|
|
aee263d050 | ||
|
|
7ac4abf8a0 | ||
|
|
139622e0b8 | ||
|
|
aaa4aaf53f | ||
|
|
73c27a9a25 | ||
|
|
82bf89a946 | ||
|
|
f4a4e793aa | ||
|
|
cdabcfd9d0 | ||
|
|
ac7a96b088 | ||
|
|
6932f3d543 | ||
|
|
222027991f | ||
|
|
5bb5091fe0 | ||
|
|
c8127d0ae6 | ||
|
|
8764fa6d4e | ||
|
|
86b7b5b8d8 | ||
|
|
127426f506 | ||
|
|
09cc970b9e | ||
|
|
03f7c5be1f | ||
|
|
4ecf513662 | ||
|
|
76b450386f | ||
|
|
38a54898a3 | ||
|
|
147d1f3951 | ||
|
|
d47419f471 | ||
|
|
367f9c9674 | ||
|
|
f9a906873e | ||
|
|
4be8aaeab8 | ||
|
|
5fdaad9a2f | ||
|
|
5855fb7cc6 | ||
|
|
f226f52200 | ||
|
|
db24a27e61 | ||
|
|
f8297aee4d | ||
|
|
b267aace71 | ||
|
|
b4bd8e4169 | ||
|
|
fdda1078f8 | ||
|
|
88e7e12a50 | ||
|
|
4cdc8939ab | ||
|
|
ec256209a8 | ||
|
|
74db7809eb | ||
|
|
5dac4e6108 | ||
|
|
e51155d8e6 | ||
|
|
2bb7f71b9c | ||
|
|
2f8be4f13f | ||
|
|
8e9d85f10f | ||
|
|
70bae801dc | ||
|
|
37ffe4501c | ||
|
|
13f6297312 | ||
|
|
f9dfa226a5 | ||
|
|
0da19a25cf | ||
|
|
3b92a867e2 | ||
|
|
1ada4a2c67 | ||
|
|
97ad21dc68 | ||
|
|
54dc9cfc8b | ||
|
|
1ed51e8866 | ||
|
|
9e0511995a | ||
|
|
62d51f7d2e | ||
|
|
4f9558dd71 | ||
|
|
86109dcfd0 | ||
|
|
adf22db8b6 | ||
|
|
eb3473125c | ||
|
|
b3894994c0 | ||
|
|
e1306be4be | ||
|
|
002d46d0c4 | ||
|
|
018ba2c83b | ||
|
|
66ed7c1f30 | ||
|
|
a113603f10 | ||
|
|
6f6d62d915 | ||
|
|
ff8393ce32 | ||
|
|
8b209aecf9 | ||
|
|
a515a2d039 | ||
|
|
d0fec462c9 | ||
|
|
20e2040e7e | ||
|
|
538f73b2fa | ||
|
|
a0fb04d6e5 | ||
|
|
44497ef384 | ||
|
|
5fb38b92d9 | ||
|
|
4737588aac | ||
|
|
a5d3ce4e96 | ||
|
|
66b29654c0 | ||
|
|
940570af59 | ||
|
|
bdfb5a91b1 | ||
|
|
29b986684d | ||
|
|
e48a0877ef | ||
|
|
22837d69b7 | ||
|
|
af306b523b | ||
|
|
ba20fd7566 | ||
|
|
6d1330d601 | ||
|
|
f3be0c79c2 | ||
|
|
10c01af692 | ||
|
|
a68a1983cf | ||
|
|
90a647fb72 | ||
|
|
3cbf209d5b | ||
|
|
bee45c4fdc | ||
|
|
61202cb464 | ||
|
|
0091944161 | ||
|
|
78cd857bf6 | ||
|
|
4fe1b4df1c | ||
|
|
2a1235c9db | ||
|
|
4bb41b95a8 | ||
|
|
f78f4854a4 | ||
|
|
ff01dfa03d | ||
|
|
638b204d1e | ||
|
|
58e88c4aed | ||
|
|
8433919342 | ||
|
|
8150b9aeba | ||
|
|
01601fc8a7 | ||
|
|
7b24042d5f | ||
|
|
2177dda242 | ||
|
|
0585c86390 | ||
|
|
528caab47c | ||
|
|
b150df34e0 | ||
|
|
da80c3b309 | ||
|
|
e8804bd80f | ||
|
|
2300886008 | ||
|
|
57ed3c89a2 | ||
|
|
1a284a1c94 | ||
|
|
f12dd51c00 | ||
|
|
e00c1e99d6 | ||
|
|
39323b46ba | ||
|
|
9dff80aeee | ||
|
|
9f7d05bab4 | ||
|
|
53c0a4b568 | ||
|
|
8f460a9be3 | ||
|
|
204b07f46b | ||
|
|
a48a02bade | ||
|
|
2326a1e105 | ||
|
|
c4dc6d9bff | ||
|
|
6213a73e6f | ||
|
|
9c109b744f | ||
|
|
42c1d54b3f | ||
|
|
5e634cd612 | ||
|
|
79c7fe0f7a | ||
|
|
8e86d2cf1d | ||
|
|
4e12a4c013 | ||
|
|
e869cdca9f | ||
|
|
ab565f1a3c | ||
|
|
90cd3bf4cb | ||
|
|
9752ee8819 | ||
|
|
9f1e0660dd | ||
|
|
7c05bb7d1d | ||
|
|
bb0faacf06 | ||
|
|
9ae35ec581 | ||
|
|
b1ca1eb228 | ||
|
|
832502555c | ||
|
|
1176a07c93 | ||
|
|
3770102843 | ||
|
|
cf7c80d42d | ||
|
|
84632571c7 | ||
|
|
af1061e47a | ||
|
|
e1ce0e8467 | ||
|
|
468c475359 | ||
|
|
8902a19bb4 | ||
|
|
f4e72be58f | ||
|
|
c20b5414c4 | ||
|
|
1a0438b3b1 | ||
|
|
da2f85ba4b | ||
|
|
bc65e40313 | ||
|
|
a188c7d791 | ||
|
|
f2cccdd1fb | ||
|
|
3aef65597b | ||
|
|
c98e007ff7 |
65
.devcontainer/devcontainer.json
Normal file
65
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,65 @@
|
||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
||||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/docker-existing-dockerfile
|
||||
{
|
||||
"name": "bun (Ubuntu)",
|
||||
|
||||
// Sets the run context to one level up instead of the .devcontainer folder.
|
||||
"context": "..",
|
||||
|
||||
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
|
||||
"dockerFile": "../Dockerfile",
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/zsh",
|
||||
"zigLanguageClient.path": "/home/ubuntu/zls/zig-out/bin/zls",
|
||||
"zig.zigPath": "/build/zig/zig",
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"AugusteRame.zls-vscode",
|
||||
"ms-vscode.cpptools",
|
||||
"/home/ubuntu/vscode-zig.vsix",
|
||||
"vadimcn.vscode-lldb",
|
||||
"esbenp.prettier-vscode",
|
||||
"xaver.clang-format"
|
||||
],
|
||||
"postCreateCommand": "cd /build/bun; bash /build/getting-started.sh; zsh",
|
||||
|
||||
"build": {
|
||||
"target": "bun.devcontainer",
|
||||
"cacheFrom": ["bun.devcontainer:latest"],
|
||||
"args": {}
|
||||
},
|
||||
"runArgs": [
|
||||
"--ulimit",
|
||||
"memlock=-1:-1",
|
||||
"--ulimit",
|
||||
"nofile=65536:65536",
|
||||
"--cap-add=SYS_PTRACE",
|
||||
"--security-opt",
|
||||
"seccomp=unconfined"
|
||||
],
|
||||
"workspaceMount": "source=bun,target=/build/bun,type=volume",
|
||||
"workspaceFolder": "/build/bun",
|
||||
"mounts": [
|
||||
"source=bun-install,target=/home/ubuntu/.bun,type=volume",
|
||||
"source=bun-config,target=/home/ubuntu/.config,type=volume"
|
||||
],
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
"forwardPorts": [3000, 8081, 8080]
|
||||
|
||||
// Uncomment the next line to run commands after the container is created - for example installing curl.
|
||||
// "postCreateCommand": "apt-get update && apt-get install -y curl",
|
||||
|
||||
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
|
||||
|
||||
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
|
||||
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
|
||||
|
||||
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
|
||||
// "remoteUser": "vscode"
|
||||
}
|
||||
61
.devcontainer/limits.conf
Normal file
61
.devcontainer/limits.conf
Normal file
@@ -0,0 +1,61 @@
|
||||
# /etc/security/limits.conf
|
||||
#
|
||||
#Each line describes a limit for a user in the form:
|
||||
#
|
||||
#<domain> <type> <item> <value>
|
||||
#
|
||||
#Where:
|
||||
#<domain> can be:
|
||||
# - a user name
|
||||
# - a group name, with @group syntax
|
||||
# - the wildcard *, for default entry
|
||||
# - the wildcard %, can be also used with %group syntax,
|
||||
# for maxlogin limit
|
||||
# - NOTE: group and wildcard limits are not applied to root.
|
||||
# To apply a limit to the root user, <domain> must be
|
||||
# the literal username root.
|
||||
#
|
||||
#<type> can have the two values:
|
||||
# - "soft" for enforcing the soft limits
|
||||
# - "hard" for enforcing hard limits
|
||||
#
|
||||
#<item> can be one of the following:
|
||||
# - core - limits the core file size (KB)
|
||||
# - data - max data size (KB)
|
||||
# - fsize - maximum filesize (KB)
|
||||
# - memlock - max locked-in-memory address space (KB)
|
||||
# - nofile - max number of open file descriptors
|
||||
# - rss - max resident set size (KB)
|
||||
# - stack - max stack size (KB)
|
||||
# - cpu - max CPU time (MIN)
|
||||
# - nproc - max number of processes
|
||||
# - as - address space limit (KB)
|
||||
# - maxlogins - max number of logins for this user
|
||||
# - maxsyslogins - max number of logins on the system
|
||||
# - priority - the priority to run user process with
|
||||
# - locks - max number of file locks the user can hold
|
||||
# - sigpending - max number of pending signals
|
||||
# - msgqueue - max memory used by POSIX message queues (bytes)
|
||||
# - nice - max nice priority allowed to raise to values: [-20, 19]
|
||||
# - rtprio - max realtime priority
|
||||
# - chroot - change root to directory (Debian-specific)
|
||||
#
|
||||
#<domain> <type> <item> <value>
|
||||
#
|
||||
|
||||
* soft memlock 33554432
|
||||
* hard memlock 33554432
|
||||
* soft nofile 33554432
|
||||
* hard nofile 33554432
|
||||
|
||||
#* soft core 0
|
||||
#root hard core 100000
|
||||
#* hard rss 10000
|
||||
#@student hard nproc 20
|
||||
#@faculty soft nproc 20
|
||||
#@faculty hard nproc 50
|
||||
#ftp hard nproc 0
|
||||
#ftp - chroot /ftp
|
||||
#@student - maxlogins 4
|
||||
|
||||
# End of file
|
||||
445
.devcontainer/scripts/common-debian.sh
Normal file
445
.devcontainer/scripts/common-debian.sh
Normal file
@@ -0,0 +1,445 @@
|
||||
#!/usr/bin/env bash
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
#
|
||||
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/common.md
|
||||
# Maintainer: The VS Code and Codespaces Teams
|
||||
#
|
||||
# Syntax: ./common-debian.sh [install zsh flag] [username] [user UID] [user GID] [upgrade packages flag] [install Oh My Zsh! flag] [Add non-free packages]
|
||||
|
||||
set -e
|
||||
|
||||
INSTALL_ZSH=${1:-"true"}
|
||||
USERNAME=${2:-"automatic"}
|
||||
USER_UID=${3:-"automatic"}
|
||||
USER_GID=${4:-"automatic"}
|
||||
UPGRADE_PACKAGES=${5:-"true"}
|
||||
INSTALL_OH_MYS=${6:-"true"}
|
||||
ADD_NON_FREE_PACKAGES=${7:-"false"}
|
||||
SCRIPT_DIR="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)"
|
||||
MARKER_FILE="/usr/local/etc/vscode-dev-containers/common"
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure that login shells get the correct path if the user updated the PATH using ENV.
|
||||
rm -f /etc/profile.d/00-restore-env.sh
|
||||
echo "export PATH=${PATH//$(sh -lc 'echo $PATH')/\$PATH}" >/etc/profile.d/00-restore-env.sh
|
||||
chmod +x /etc/profile.d/00-restore-env.sh
|
||||
|
||||
# If in automatic mode, determine if a user already exists, if not use vscode
|
||||
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
|
||||
USERNAME=""
|
||||
POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
|
||||
for CURRENT_USER in ${POSSIBLE_USERS[@]}; do
|
||||
if id -u ${CURRENT_USER} >/dev/null 2>&1; then
|
||||
USERNAME=${CURRENT_USER}
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ "${USERNAME}" = "" ]; then
|
||||
USERNAME=vscode
|
||||
fi
|
||||
elif [ "${USERNAME}" = "none" ]; then
|
||||
USERNAME=root
|
||||
USER_UID=0
|
||||
USER_GID=0
|
||||
fi
|
||||
|
||||
# Load markers to see which steps have already run
|
||||
if [ -f "${MARKER_FILE}" ]; then
|
||||
echo "Marker file found:"
|
||||
cat "${MARKER_FILE}"
|
||||
source "${MARKER_FILE}"
|
||||
fi
|
||||
|
||||
# Ensure apt is in non-interactive to avoid prompts
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Function to call apt-get if needed
|
||||
apt_get_update_if_needed() {
|
||||
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
|
||||
echo "Running apt-get update..."
|
||||
apt-get update
|
||||
else
|
||||
echo "Skipping apt-get update."
|
||||
fi
|
||||
}
|
||||
|
||||
# Run install apt-utils to avoid debconf warning then verify presence of other common developer tools and dependencies
|
||||
if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
||||
|
||||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
htop \
|
||||
net-tools \
|
||||
psmisc \
|
||||
curl \
|
||||
wget \
|
||||
rsync \
|
||||
ca-certificates \
|
||||
unzip \
|
||||
zip \
|
||||
nano \
|
||||
vim-tiny \
|
||||
less \
|
||||
jq \
|
||||
lsb-release \
|
||||
apt-transport-https \
|
||||
dialog \
|
||||
libc6 \
|
||||
libgcc1 \
|
||||
libkrb5-3 \
|
||||
libgssapi-krb5-2 \
|
||||
libicu[0-9][0-9] \
|
||||
liblttng-ust0 \
|
||||
libstdc++6 \
|
||||
zlib1g \
|
||||
locales \
|
||||
sudo \
|
||||
ncdu \
|
||||
man-db \
|
||||
strace \
|
||||
manpages \
|
||||
manpages-dev \
|
||||
init-system-helpers"
|
||||
|
||||
# Needed for adding manpages-posix and manpages-posix-dev which are non-free packages in Debian
|
||||
if [ "${ADD_NON_FREE_PACKAGES}" = "true" ]; then
|
||||
# Bring in variables from /etc/os-release like VERSION_CODENAME
|
||||
. /etc/os-release
|
||||
sed -i -E "s/deb http:\/\/(deb|httpredir)\.debian\.org\/debian ${VERSION_CODENAME} main/deb http:\/\/\1\.debian\.org\/debian ${VERSION_CODENAME} main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i -E "s/deb-src http:\/\/(deb|httredir)\.debian\.org\/debian ${VERSION_CODENAME} main/deb http:\/\/\1\.debian\.org\/debian ${VERSION_CODENAME} main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i -E "s/deb http:\/\/(deb|httpredir)\.debian\.org\/debian ${VERSION_CODENAME}-updates main/deb http:\/\/\1\.debian\.org\/debian ${VERSION_CODENAME}-updates main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i -E "s/deb-src http:\/\/(deb|httpredir)\.debian\.org\/debian ${VERSION_CODENAME}-updates main/deb http:\/\/\1\.debian\.org\/debian ${VERSION_CODENAME}-updates main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i "s/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}\/updates main/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}\/updates main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i "s/deb-src http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}\/updates main/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}\/updates main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i "s/deb http:\/\/deb\.debian\.org\/debian ${VERSION_CODENAME}-backports main/deb http:\/\/deb\.debian\.org\/debian ${VERSION_CODENAME}-backports main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i "s/deb-src http:\/\/deb\.debian\.org\/debian ${VERSION_CODENAME}-backports main/deb http:\/\/deb\.debian\.org\/debian ${VERSION_CODENAME}-backports main contrib non-free/" /etc/apt/sources.list
|
||||
# Handle bullseye location for security https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.en.html
|
||||
sed -i "s/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}-security main/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}-security main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i "s/deb-src http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}-security main/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}-security main contrib non-free/" /etc/apt/sources.list
|
||||
echo "Running apt-get update..."
|
||||
apt-get update
|
||||
package_list="${package_list} manpages-posix manpages-posix-dev"
|
||||
else
|
||||
apt_get_update_if_needed
|
||||
fi
|
||||
|
||||
# Install libssl1.1 if available
|
||||
if [[ ! -z $(apt-cache --names-only search ^libssl1.1$) ]]; then
|
||||
package_list="${package_list} libssl1.1"
|
||||
fi
|
||||
|
||||
# Install appropriate version of libssl1.0.x if available
|
||||
libssl_package=$(dpkg-query -f '${db:Status-Abbrev}\t${binary:Package}\n' -W 'libssl1\.0\.?' 2>&1 || echo '')
|
||||
if [ "$(echo "$LIlibssl_packageBSSL" | grep -o 'libssl1\.0\.[0-9]:' | uniq | sort | wc -l)" -eq 0 ]; then
|
||||
if [[ ! -z $(apt-cache --names-only search ^libssl1.0.2$) ]]; then
|
||||
# Debian 9
|
||||
package_list="${package_list} libssl1.0.2"
|
||||
elif [[ ! -z $(apt-cache --names-only search ^libssl1.0.0$) ]]; then
|
||||
# Ubuntu 18.04, 16.04, earlier
|
||||
package_list="${package_list} libssl1.0.0"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Packages to verify are installed: ${package_list}"
|
||||
apt-get -y install --no-install-recommends ${package_list} 2> >(grep -v 'debconf: delaying package configuration, since apt-utils is not installed' >&2)
|
||||
|
||||
# Install git if not already installed (may be more recent than distro version)
|
||||
if ! type git >/dev/null 2>&1; then
|
||||
apt-get -y install --no-install-recommends git
|
||||
fi
|
||||
|
||||
PACKAGES_ALREADY_INSTALLED="true"
|
||||
fi
|
||||
|
||||
# Get to latest versions of all packages
|
||||
if [ "${UPGRADE_PACKAGES}" = "true" ]; then
|
||||
apt_get_update_if_needed
|
||||
apt-get -y upgrade --no-install-recommends
|
||||
apt-get autoremove -y
|
||||
fi
|
||||
|
||||
# Ensure at least the en_US.UTF-8 UTF-8 locale is available.
|
||||
# Common need for both applications and things like the agnoster ZSH theme.
|
||||
if [ "${LOCALE_ALREADY_SET}" != "true" ] && ! grep -o -E '^\s*en_US.UTF-8\s+UTF-8' /etc/locale.gen >/dev/null; then
|
||||
echo "en_US.UTF-8 UTF-8" >>/etc/locale.gen
|
||||
locale-gen
|
||||
LOCALE_ALREADY_SET="true"
|
||||
fi
|
||||
|
||||
# Create or update a non-root user to match UID/GID.
|
||||
group_name="${USERNAME}"
|
||||
if id -u ${USERNAME} >/dev/null 2>&1; then
|
||||
# User exists, update if needed
|
||||
if [ "${USER_GID}" != "automatic" ] && [ "$USER_GID" != "$(id -g $USERNAME)" ]; then
|
||||
group_name="$(id -gn $USERNAME)"
|
||||
groupmod --gid $USER_GID ${group_name}
|
||||
usermod --gid $USER_GID $USERNAME
|
||||
fi
|
||||
if [ "${USER_UID}" != "automatic" ] && [ "$USER_UID" != "$(id -u $USERNAME)" ]; then
|
||||
usermod --uid $USER_UID $USERNAME
|
||||
fi
|
||||
else
|
||||
# Create user
|
||||
if [ "${USER_GID}" = "automatic" ]; then
|
||||
groupadd $USERNAME
|
||||
else
|
||||
groupadd --gid $USER_GID $USERNAME
|
||||
fi
|
||||
if [ "${USER_UID}" = "automatic" ]; then
|
||||
useradd -s /bin/bash --gid $USERNAME -m $USERNAME
|
||||
else
|
||||
useradd -s /bin/bash --uid $USER_UID --gid $USERNAME -m $USERNAME
|
||||
fi
|
||||
fi
|
||||
|
||||
# Add add sudo support for non-root user
|
||||
if [ "${USERNAME}" != "root" ] && [ "${EXISTING_NON_ROOT_USER}" != "${USERNAME}" ]; then
|
||||
echo $USERNAME ALL=\(root\) NOPASSWD:ALL >/etc/sudoers.d/$USERNAME
|
||||
chmod 0440 /etc/sudoers.d/$USERNAME
|
||||
EXISTING_NON_ROOT_USER="${USERNAME}"
|
||||
fi
|
||||
|
||||
# ** Shell customization section **
|
||||
if [ "${USERNAME}" = "root" ]; then
|
||||
user_rc_path="/root"
|
||||
else
|
||||
user_rc_path="/home/${USERNAME}"
|
||||
fi
|
||||
|
||||
# Restore user .bashrc defaults from skeleton file if it doesn't exist or is empty
|
||||
if [ ! -f "${user_rc_path}/.bashrc" ] || [ ! -s "${user_rc_path}/.bashrc" ]; then
|
||||
cp /etc/skel/.bashrc "${user_rc_path}/.bashrc"
|
||||
fi
|
||||
|
||||
# Restore user .profile defaults from skeleton file if it doesn't exist or is empty
|
||||
if [ ! -f "${user_rc_path}/.profile" ] || [ ! -s "${user_rc_path}/.profile" ]; then
|
||||
cp /etc/skel/.profile "${user_rc_path}/.profile"
|
||||
fi
|
||||
|
||||
# .bashrc/.zshrc snippet
|
||||
rc_snippet="$(
|
||||
cat <<'EOF'
|
||||
if [ -z "${USER}" ]; then export USER=$(whoami); fi
|
||||
if [[ "${PATH}" != *"$HOME/.local/bin"* ]]; then export PATH="${PATH}:$HOME/.local/bin"; fi
|
||||
# Display optional first run image specific notice if configured and terminal is interactive
|
||||
if [ -t 1 ] && [[ "${TERM_PROGRAM}" = "vscode" || "${TERM_PROGRAM}" = "codespaces" ]] && [ ! -f "$HOME/.config/vscode-dev-containers/first-run-notice-already-displayed" ]; then
|
||||
if [ -f "/usr/local/etc/vscode-dev-containers/first-run-notice.txt" ]; then
|
||||
cat "/usr/local/etc/vscode-dev-containers/first-run-notice.txt"
|
||||
elif [ -f "/workspaces/.codespaces/shared/first-run-notice.txt" ]; then
|
||||
cat "/workspaces/.codespaces/shared/first-run-notice.txt"
|
||||
fi
|
||||
mkdir -p "$HOME/.config/vscode-dev-containers"
|
||||
# Mark first run notice as displayed after 10s to avoid problems with fast terminal refreshes hiding it
|
||||
((sleep 10s; touch "$HOME/.config/vscode-dev-containers/first-run-notice-already-displayed") &)
|
||||
fi
|
||||
# Set the default git editor if not already set
|
||||
if [ -z "$(git config --get core.editor)" ] && [ -z "${GIT_EDITOR}" ]; then
|
||||
if [ "${TERM_PROGRAM}" = "vscode" ]; then
|
||||
if [[ -n $(command -v code-insiders) && -z $(command -v code) ]]; then
|
||||
export GIT_EDITOR="code-insiders --wait"
|
||||
else
|
||||
export GIT_EDITOR="code --wait"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
EOF
|
||||
)"
|
||||
|
||||
# code shim, it fallbacks to code-insiders if code is not available
|
||||
cat <<'EOF' >/usr/local/bin/code
|
||||
#!/bin/sh
|
||||
get_in_path_except_current() {
|
||||
which -a "$1" | grep -A1 "$0" | grep -v "$0"
|
||||
}
|
||||
code="$(get_in_path_except_current code)"
|
||||
if [ -n "$code" ]; then
|
||||
exec "$code" "$@"
|
||||
elif [ "$(command -v code-insiders)" ]; then
|
||||
exec code-insiders "$@"
|
||||
else
|
||||
echo "code or code-insiders is not installed" >&2
|
||||
exit 127
|
||||
fi
|
||||
EOF
|
||||
chmod +x /usr/local/bin/code
|
||||
|
||||
# systemctl shim - tells people to use 'service' if systemd is not running
|
||||
cat <<'EOF' >/usr/local/bin/systemctl
|
||||
#!/bin/sh
|
||||
set -e
|
||||
if [ -d "/run/systemd/system" ]; then
|
||||
exec /bin/systemctl/systemctl "$@"
|
||||
else
|
||||
echo '\n"systemd" is not running in this container due to its overhead.\nUse the "service" command to start services intead. e.g.: \n\nservice --status-all'
|
||||
fi
|
||||
EOF
|
||||
chmod +x /usr/local/bin/systemctl
|
||||
|
||||
# Codespaces bash and OMZ themes - partly inspired by https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/robbyrussell.zsh-theme
|
||||
codespaces_bash="$(
|
||||
cat \
|
||||
<<'EOF'
|
||||
# Codespaces bash prompt theme
|
||||
__bash_prompt() {
|
||||
local userpart='`export XIT=$? \
|
||||
&& [ ! -z "${GITHUB_USER}" ] && echo -n "\[\033[0;32m\]@${GITHUB_USER} " || echo -n "\[\033[0;32m\]\u " \
|
||||
&& [ "$XIT" -ne "0" ] && echo -n "\[\033[1;31m\]➜" || echo -n "\[\033[0m\]➜"`'
|
||||
local gitbranch='`\
|
||||
if [ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ]; then \
|
||||
export BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD 2>/dev/null); \
|
||||
if [ "${BRANCH}" != "" ]; then \
|
||||
echo -n "\[\033[0;36m\](\[\033[1;31m\]${BRANCH}" \
|
||||
&& if git ls-files --error-unmatch -m --directory --no-empty-directory -o --exclude-standard ":/*" > /dev/null 2>&1; then \
|
||||
echo -n " \[\033[1;33m\]✗"; \
|
||||
fi \
|
||||
&& echo -n "\[\033[0;36m\]) "; \
|
||||
fi; \
|
||||
fi`'
|
||||
local lightblue='\[\033[1;34m\]'
|
||||
local removecolor='\[\033[0m\]'
|
||||
PS1="${userpart} ${lightblue}\w ${gitbranch}${removecolor}\$ "
|
||||
unset -f __bash_prompt
|
||||
}
|
||||
__bash_prompt
|
||||
EOF
|
||||
)"
|
||||
|
||||
codespaces_zsh="$(
|
||||
cat \
|
||||
<<'EOF'
|
||||
# Codespaces zsh prompt theme
|
||||
__zsh_prompt() {
|
||||
local prompt_username
|
||||
if [ ! -z "${GITHUB_USER}" ]; then
|
||||
prompt_username="@${GITHUB_USER}"
|
||||
else
|
||||
prompt_username="%n"
|
||||
fi
|
||||
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
|
||||
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
|
||||
PROMPT+='$([ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ] && git_prompt_info)' # Git status
|
||||
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
|
||||
unset -f __zsh_prompt
|
||||
}
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}(%{$fg_bold[red]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg_bold[yellow]%}✗%{$fg_bold[cyan]%})"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[cyan]%})"
|
||||
__zsh_prompt
|
||||
EOF
|
||||
)"
|
||||
|
||||
# Add RC snippet and custom bash prompt
|
||||
if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
|
||||
echo "${rc_snippet}" >>/etc/bash.bashrc
|
||||
echo "${codespaces_bash}" >>"${user_rc_path}/.bashrc"
|
||||
echo 'export PROMPT_DIRTRIM=4' >>"${user_rc_path}/.bashrc"
|
||||
if [ "${USERNAME}" != "root" ]; then
|
||||
echo "${codespaces_bash}" >>"/root/.bashrc"
|
||||
echo 'export PROMPT_DIRTRIM=4' >>"/root/.bashrc"
|
||||
fi
|
||||
chown ${USERNAME}:${group_name} "${user_rc_path}/.bashrc"
|
||||
RC_SNIPPET_ALREADY_ADDED="true"
|
||||
fi
|
||||
|
||||
# Optionally install and configure zsh and Oh My Zsh!
|
||||
if [ "${INSTALL_ZSH}" = "true" ]; then
|
||||
if ! type zsh >/dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get install -y zsh
|
||||
fi
|
||||
if [ "${ZSH_ALREADY_INSTALLED}" != "true" ]; then
|
||||
echo "${rc_snippet}" >>/etc/zsh/zshrc
|
||||
ZSH_ALREADY_INSTALLED="true"
|
||||
fi
|
||||
|
||||
# Adapted, simplified inline Oh My Zsh! install steps that adds, defaults to a codespaces theme.
|
||||
# See https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh for official script.
|
||||
oh_my_install_dir="${user_rc_path}/.oh-my-zsh"
|
||||
if [ ! -d "${oh_my_install_dir}" ] && [ "${INSTALL_OH_MYS}" = "true" ]; then
|
||||
template_path="${oh_my_install_dir}/templates/zshrc.zsh-template"
|
||||
user_rc_file="${user_rc_path}/.zshrc"
|
||||
umask g-w,o-w
|
||||
mkdir -p ${oh_my_install_dir}
|
||||
git clone --depth=1 \
|
||||
-c core.eol=lf \
|
||||
-c core.autocrlf=false \
|
||||
-c fsck.zeroPaddedFilemode=ignore \
|
||||
-c fetch.fsck.zeroPaddedFilemode=ignore \
|
||||
-c receive.fsck.zeroPaddedFilemode=ignore \
|
||||
"https://github.com/ohmyzsh/ohmyzsh" "${oh_my_install_dir}" 2>&1
|
||||
echo -e "$(cat "${template_path}")\nDISABLE_AUTO_UPDATE=true\nDISABLE_UPDATE_PROMPT=true" >${user_rc_file}
|
||||
sed -i -e 's/ZSH_THEME=.*/ZSH_THEME="codespaces"/g' ${user_rc_file}
|
||||
|
||||
mkdir -p ${oh_my_install_dir}/custom/themes
|
||||
echo "${codespaces_zsh}" >"${oh_my_install_dir}/custom/themes/codespaces.zsh-theme"
|
||||
# Shrink git while still enabling updates
|
||||
cd "${oh_my_install_dir}"
|
||||
git repack -a -d -f --depth=1 --window=1
|
||||
# Copy to non-root user if one is specified
|
||||
if [ "${USERNAME}" != "root" ]; then
|
||||
cp -rf "${user_rc_file}" "${oh_my_install_dir}" /root
|
||||
chown -R ${USERNAME}:${group_name} "${user_rc_path}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Persist image metadata info, script if meta.env found in same directory
|
||||
meta_info_script="$(
|
||||
cat <<'EOF'
|
||||
#!/bin/sh
|
||||
. /usr/local/etc/vscode-dev-containers/meta.env
|
||||
# Minimal output
|
||||
if [ "$1" = "version" ] || [ "$1" = "image-version" ]; then
|
||||
echo "${VERSION}"
|
||||
exit 0
|
||||
elif [ "$1" = "release" ]; then
|
||||
echo "${GIT_REPOSITORY_RELEASE}"
|
||||
exit 0
|
||||
elif [ "$1" = "content" ] || [ "$1" = "content-url" ] || [ "$1" = "contents" ] || [ "$1" = "contents-url" ]; then
|
||||
echo "${CONTENTS_URL}"
|
||||
exit 0
|
||||
fi
|
||||
#Full output
|
||||
echo
|
||||
echo "Development container image information"
|
||||
echo
|
||||
if [ ! -z "${VERSION}" ]; then echo "- Image version: ${VERSION}"; fi
|
||||
if [ ! -z "${DEFINITION_ID}" ]; then echo "- Definition ID: ${DEFINITION_ID}"; fi
|
||||
if [ ! -z "${VARIANT}" ]; then echo "- Variant: ${VARIANT}"; fi
|
||||
if [ ! -z "${GIT_REPOSITORY}" ]; then echo "- Source code repository: ${GIT_REPOSITORY}"; fi
|
||||
if [ ! -z "${GIT_REPOSITORY_RELEASE}" ]; then echo "- Source code release/branch: ${GIT_REPOSITORY_RELEASE}"; fi
|
||||
if [ ! -z "${BUILD_TIMESTAMP}" ]; then echo "- Timestamp: ${BUILD_TIMESTAMP}"; fi
|
||||
if [ ! -z "${CONTENTS_URL}" ]; then echo && echo "More info: ${CONTENTS_URL}"; fi
|
||||
echo
|
||||
EOF
|
||||
)"
|
||||
if [ -f "${SCRIPT_DIR}/meta.env" ]; then
|
||||
mkdir -p /usr/local/etc/vscode-dev-containers/
|
||||
cp -f "${SCRIPT_DIR}/meta.env" /usr/local/etc/vscode-dev-containers/meta.env
|
||||
echo "${meta_info_script}" >/usr/local/bin/devcontainer-info
|
||||
chmod +x /usr/local/bin/devcontainer-info
|
||||
fi
|
||||
|
||||
# Write marker file
|
||||
mkdir -p "$(dirname "${MARKER_FILE}")"
|
||||
echo -e "\
|
||||
PACKAGES_ALREADY_INSTALLED=${PACKAGES_ALREADY_INSTALLED}\n\
|
||||
LOCALE_ALREADY_SET=${LOCALE_ALREADY_SET}\n\
|
||||
EXISTING_NON_ROOT_USER=${EXISTING_NON_ROOT_USER}\n\
|
||||
RC_SNIPPET_ALREADY_ADDED=${RC_SNIPPET_ALREADY_ADDED}\n\
|
||||
ZSH_ALREADY_INSTALLED=${ZSH_ALREADY_INSTALLED}" >"${MARKER_FILE}"
|
||||
|
||||
echo "Done!"
|
||||
16
.devcontainer/scripts/getting-started.sh
Normal file
16
.devcontainer/scripts/getting-started.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "To get started, login to GitHub and clone bun's GitHub repo into /workspaces/bun"
|
||||
echo "Make sure to login with a Personal Access Token"
|
||||
echo "# First time setup"
|
||||
echo "gh auth login"
|
||||
echo "gh repo clone Jarred-Sumner/bun . -- --depth=1 --progress -j8"
|
||||
echo ""
|
||||
echo "# Compile bun dependencies (zig is already compiled)"
|
||||
echo "make devcontainer"
|
||||
echo ""
|
||||
echo "# Build bun for development"
|
||||
echo "make dev"
|
||||
echo ""
|
||||
echo "# Run bun"
|
||||
echo "bun-debug"
|
||||
185
.devcontainer/scripts/github.sh
Normal file
185
.devcontainer/scripts/github.sh
Normal file
@@ -0,0 +1,185 @@
|
||||
#!/usr/bin/env bash
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
#
|
||||
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/github.md
|
||||
# Maintainer: The VS Code and Codespaces Teams
|
||||
#
|
||||
# Syntax: ./github-debian.sh [version]
|
||||
|
||||
CLI_VERSION=${1:-"latest"}
|
||||
|
||||
GITHUB_CLI_ARCHIVE_GPG_KEY=C99B11DEB97541F0
|
||||
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com:80
|
||||
keyserver hkps://keys.openpgp.org
|
||||
keyserver hkp://keyserver.pgp.com"
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get central common setting
|
||||
get_common_setting() {
|
||||
if [ "${common_settings_file_loaded}" != "true" ]; then
|
||||
curl -sfL "https://aka.ms/vscode-dev-containers/script-library/settings.env" -o /tmp/vsdc-settings.env 2>/dev/null || echo "Could not download settings file. Skipping."
|
||||
common_settings_file_loaded=true
|
||||
fi
|
||||
if [ -f "/tmp/vsdc-settings.env" ]; then
|
||||
local multi_line=""
|
||||
if [ "$2" = "true" ]; then multi_line="-z"; fi
|
||||
local result="$(grep ${multi_line} -oP "$1=\"?\K[^\"]+" /tmp/vsdc-settings.env | tr -d '\0')"
|
||||
if [ ! -z "${result}" ]; then declare -g $1="${result}"; fi
|
||||
fi
|
||||
echo "$1=${!1}"
|
||||
}
|
||||
|
||||
# Import the specified key in a variable name passed in as
|
||||
receive_gpg_keys() {
|
||||
get_common_setting $1
|
||||
local keys=${!1}
|
||||
get_common_setting GPG_KEY_SERVERS true
|
||||
|
||||
# Use a temporary locaiton for gpg keys to avoid polluting image
|
||||
export GNUPGHOME="/tmp/tmp-gnupg"
|
||||
mkdir -p ${GNUPGHOME}
|
||||
chmod 700 ${GNUPGHOME}
|
||||
echo -e "disable-ipv6\n${GPG_KEY_SERVERS}" >${GNUPGHOME}/dirmngr.conf
|
||||
# GPG key download sometimes fails for some reason and retrying fixes it.
|
||||
local retry_count=0
|
||||
local gpg_ok="false"
|
||||
set +e
|
||||
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ]; do
|
||||
echo "(*) Downloading GPG key..."
|
||||
(echo "${keys}" | xargs -n 1 gpg --recv-keys) 2>&1 && gpg_ok="true"
|
||||
if [ "${gpg_ok}" != "true" ]; then
|
||||
echo "(*) Failed getting key, retring in 10s..."
|
||||
((retry_count++))
|
||||
sleep 10s
|
||||
fi
|
||||
done
|
||||
set -e
|
||||
if [ "${gpg_ok}" = "false" ]; then
|
||||
echo "(!) Failed to get gpg key."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Figure out correct version of a three part version number is not passed
|
||||
find_version_from_git_tags() {
|
||||
local variable_name=$1
|
||||
local requested_version=${!variable_name}
|
||||
if [ "${requested_version}" = "none" ]; then return; fi
|
||||
local repository=$2
|
||||
local prefix=${3:-"tags/v"}
|
||||
local separator=${4:-"."}
|
||||
local last_part_optional=${5:-"false"}
|
||||
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
|
||||
local escaped_separator=${separator//./\\.}
|
||||
local last_part
|
||||
if [ "${last_part_optional}" = "true" ]; then
|
||||
last_part="(${escaped_separator}[0-9]+)?"
|
||||
else
|
||||
last_part="${escaped_separator}[0-9]+"
|
||||
fi
|
||||
local regex="${prefix}\\K[0-9]+${escaped_separator}[0-9]+${last_part}$"
|
||||
local version_list="$(git ls-remote --tags ${repository} | grep -oP "${regex}" | tr -d ' ' | tr "${separator}" "." | sort -rV)"
|
||||
if [ "${requested_version}" = "latest" ] || [ "${requested_version}" = "current" ] || [ "${requested_version}" = "lts" ]; then
|
||||
declare -g ${variable_name}="$(echo "${version_list}" | head -n 1)"
|
||||
else
|
||||
set +e
|
||||
declare -g ${variable_name}="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")"
|
||||
set -e
|
||||
fi
|
||||
fi
|
||||
if [ -z "${!variable_name}" ] || ! echo "${version_list}" | grep "^${!variable_name//./\\.}$" >/dev/null 2>&1; then
|
||||
echo -e "Invalid ${variable_name} value: ${requested_version}\nValid values:\n${version_list}" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "${variable_name}=${!variable_name}"
|
||||
}
|
||||
|
||||
# Import the specified key in a variable name passed in as
|
||||
receive_gpg_keys() {
|
||||
get_common_setting $1
|
||||
local keys=${!1}
|
||||
get_common_setting GPG_KEY_SERVERS true
|
||||
local keyring_args=""
|
||||
if [ ! -z "$2" ]; then
|
||||
keyring_args="--no-default-keyring --keyring $2"
|
||||
fi
|
||||
|
||||
# Use a temporary locaiton for gpg keys to avoid polluting image
|
||||
export GNUPGHOME="/tmp/tmp-gnupg"
|
||||
mkdir -p ${GNUPGHOME}
|
||||
chmod 700 ${GNUPGHOME}
|
||||
echo -e "disable-ipv6\n${GPG_KEY_SERVERS}" >${GNUPGHOME}/dirmngr.conf
|
||||
# GPG key download sometimes fails for some reason and retrying fixes it.
|
||||
local retry_count=0
|
||||
local gpg_ok="false"
|
||||
set +e
|
||||
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ]; do
|
||||
echo "(*) Downloading GPG key..."
|
||||
(echo "${keys}" | xargs -n 1 gpg -q ${keyring_args} --recv-keys) 2>&1 && gpg_ok="true"
|
||||
if [ "${gpg_ok}" != "true" ]; then
|
||||
echo "(*) Failed getting key, retring in 10s..."
|
||||
((retry_count++))
|
||||
sleep 10s
|
||||
fi
|
||||
done
|
||||
set -e
|
||||
if [ "${gpg_ok}" = "false" ]; then
|
||||
echo "(!) Failed to get gpg key."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to run apt-get if needed
|
||||
apt_get_update_if_needed() {
|
||||
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
|
||||
echo "Running apt-get update..."
|
||||
apt-get update
|
||||
else
|
||||
echo "Skipping apt-get update."
|
||||
fi
|
||||
}
|
||||
|
||||
# Checks if packages are installed and installs them if not
|
||||
check_packages() {
|
||||
if ! dpkg -s "$@" >/dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get -y install --no-install-recommends "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install curl, apt-transport-https, curl, gpg, or dirmngr, git if missing
|
||||
check_packages curl ca-certificates apt-transport-https dirmngr gnupg2
|
||||
if ! type git >/dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get -y install --no-install-recommends git
|
||||
fi
|
||||
|
||||
# Soft version matching
|
||||
if [ "${CLI_VERSION}" != "latest" ] && [ "${CLI_VERSION}" != "lts" ] && [ "${CLI_VERSION}" != "stable" ]; then
|
||||
find_version_from_git_tags CLI_VERSION "https://github.com/cli/cli"
|
||||
version_suffix="=${CLI_VERSION}"
|
||||
else
|
||||
version_suffix=""
|
||||
fi
|
||||
|
||||
# Install the GitHub CLI
|
||||
echo "Downloading github CLI..."
|
||||
# Import key safely (new method rather than deprecated apt-key approach) and install
|
||||
. /etc/os-release
|
||||
receive_gpg_keys GITHUB_CLI_ARCHIVE_GPG_KEY /usr/share/keyrings/githubcli-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages ${VERSION_CODENAME} main" >/etc/apt/sources.list.d/github-cli.list
|
||||
apt-get update
|
||||
apt-get -y install "gh${version_suffix}"
|
||||
rm -rf "/tmp/gh/gnupg"
|
||||
echo "Done!"
|
||||
7
.devcontainer/scripts/nice.sh
Normal file
7
.devcontainer/scripts/nice.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
chsh -s $(which zsh)
|
||||
sh -c "$(curl -fsSL https://starship.rs/install.sh) -- --platform linux_musl"
|
||||
echo "eval \"$(starship init zsh)\"" >>~/.zshrc
|
||||
|
||||
curl https://github.com/Jarred-Sumner/vscode-zig/releases/download/fork-v1/zig-0.2.5.vsix >/home/ubuntu/vscode-zig.vsix
|
||||
7
.devcontainer/scripts/zig-env.sh
Normal file
7
.devcontainer/scripts/zig-env.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
curl -L https://github.com/Jarred-Sumner/vscode-zig/releases/download/fork-v1/zig-0.2.5.vsix >/home/ubuntu/vscode-zig.vsix
|
||||
git clone https://github.com/zigtools/zls /home/ubuntu/zls
|
||||
cd /home/ubuntu/zls
|
||||
git submodule update --init --recursive --progress --depth=1
|
||||
zig build -Drelease-fast
|
||||
9
.devcontainer/workspace.code-workspace
Normal file
9
.devcontainer/workspace.code-workspace
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
// Source code
|
||||
"name": "bun",
|
||||
"path": "bun"
|
||||
},
|
||||
]
|
||||
}
|
||||
9
.devcontainer/zls.json
Normal file
9
.devcontainer/zls.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"zig_exe_path": "/build/zig/zig",
|
||||
"enable_snippets": true,
|
||||
"warn_style": false,
|
||||
"enable_semantic_tokens": true,
|
||||
"operator_completions": true,
|
||||
"include_at_in_builtins": false,
|
||||
"max_detail_length": 1048576
|
||||
}
|
||||
15
.docker/build-base-images.sh
Normal file
15
.docker/build-base-images.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
export DOCKER_BUILDKIT=1
|
||||
|
||||
docker login --username bunbunbunbun
|
||||
|
||||
docker build -f Dockerfile.base -t bunbunbunbun/bun-test-base --target bun-test-base . --platform=linux/$BUILDARCH --build-arg BUILDARCH=$BUILDARCH
|
||||
docker build -f Dockerfile.base -t bunbunbunbun/bun-base-with-zig-and-webkit --target bun-base-with-zig-and-webkit . --platform=linux/$BUILDARCH --build-arg BUILDARCH=$BUILDARCH
|
||||
docker build -f Dockerfile.base -t bunbunbunbun/bun-base --target bun-base --platform=linux/$BUILDARCH . --build-arg BUILDARCH=$BUILDARCH
|
||||
|
||||
docker push bunbunbunbun/bun-test-base:latest
|
||||
docker push bunbunbunbun/bun-base-with-zig-and-webkit:latest
|
||||
docker push bunbunbunbun/bun-base:latest
|
||||
24
.docker/build-base.sh
Normal file
24
.docker/build-base.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
export DOCKER_BUILDKIT=1
|
||||
|
||||
docker buildx build \
|
||||
-t bunbunbunbun/bun-test-base:latest -f Dockerfile.base \
|
||||
--target bun-test-base \
|
||||
--platform=linux/$BUILDARCH --build-arg BUILDARCH=$BUILDARCH .
|
||||
docker buildx build \
|
||||
--target bun-base \
|
||||
-f Dockerfile.base \
|
||||
-t bunbunbunbun/bun-base:latest --platform=linux/$BUILDARCH \
|
||||
--build-arg BUILDARCH=$BUILDARCH .
|
||||
docker buildx build \
|
||||
-t bunbunbunbun/bun-base-with-zig-and-webkit:latest \
|
||||
-f Dockerfile.base \
|
||||
--target bun-base-with-zig-and-webkit \
|
||||
--platform=linux/$BUILDARCH --build-arg BUILDARCH=$BUILDARCH .
|
||||
|
||||
docker push bunbunbunbun/bun-test-base:latest
|
||||
docker push bunbunbunbun/bun-base:latest
|
||||
docker push bunbunbunbun/bun-base-with-zig-and-webkit:latest
|
||||
1539
.docker/chrome.json
Normal file
1539
.docker/chrome.json
Normal file
File diff suppressed because it is too large
Load Diff
14
.docker/chromium.pref
Normal file
14
.docker/chromium.pref
Normal file
@@ -0,0 +1,14 @@
|
||||
# Note: 2 blank lines are required between entries
|
||||
Package: *
|
||||
Pin: release a=eoan
|
||||
Pin-Priority: 500
|
||||
|
||||
Package: *
|
||||
Pin: origin "ftp.debian.org"
|
||||
Pin-Priority: 300
|
||||
|
||||
# Pattern includes 'chromium', 'chromium-browser' and similarly
|
||||
# named dependencies:
|
||||
Package: chromium*
|
||||
Pin: origin "ftp.debian.org"
|
||||
Pin-Priority: 700
|
||||
8
.docker/copy-bun-binary.sh
Normal file
8
.docker/copy-bun-binary.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
name=$(openssl rand -hex 12)
|
||||
id=$(docker create --name=bun-binary-$name $CONTAINER_TAG)
|
||||
docker container cp bun-binary-$name:$BUN_RELEASE_DIR bun-binary
|
||||
echo -e "bun-binary-$name"
|
||||
3
.docker/debian.list
Normal file
3
.docker/debian.list
Normal file
@@ -0,0 +1,3 @@
|
||||
deb http://deb.debian.org/debian buster main
|
||||
deb http://deb.debian.org/debian buster-updates main
|
||||
deb http://deb.debian.org/debian-security buster/updates main
|
||||
34
.docker/dockerfile-common.sh
Normal file
34
.docker/dockerfile-common.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
export DOCKER_BUILDKIT=1
|
||||
|
||||
export BUILDKIT_ARCH=$(uname -m)
|
||||
export ARCH=${BUILDKIT_ARCH}
|
||||
|
||||
if [ "$BUILDKIT_ARCH" == "amd64" ]; then
|
||||
export BUILDKIT_ARCH="amd64"
|
||||
export ARCH=x64
|
||||
fi
|
||||
|
||||
if [ "$BUILDKIT_ARCH" == "x86_64" ]; then
|
||||
export BUILDKIT_ARCH="amd64"
|
||||
export ARCH=x64
|
||||
fi
|
||||
|
||||
if [ "$BUILDKIT_ARCH" == "arm64" ]; then
|
||||
export BUILDKIT_ARCH="arm64"
|
||||
export ARCH=aarch64
|
||||
fi
|
||||
|
||||
if [ "$BUILDKIT_ARCH" == "aarch64" ]; then
|
||||
export BUILDKIT_ARCH="arm64"
|
||||
export ARCH=aarch64
|
||||
fi
|
||||
|
||||
if [ "$BUILDKIT_ARCH" == "armv7l" ]; then
|
||||
echo "Unsupported platform: $BUILDKIT_ARCH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export BUILD_ID=$(cat build-id)
|
||||
export CONTAINER_NAME=bun-linux-$ARCH
|
||||
export DEBUG_CONTAINER_NAME=debug-bun-linux-$ARCH
|
||||
export TEMP=/tmp/bun-0.0.$BUILD_ID
|
||||
11
.docker/pull.sh
Normal file
11
.docker/pull.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
docker pull bunbunbunbun/bun-test-base:latest --platform=linux/amd64
|
||||
docker pull bunbunbunbun/bun-base:latest --platform=linux/amd64
|
||||
docker pull bunbunbunbun/bun-base-with-zig-and-webkit:latest --platform=linux/amd64
|
||||
|
||||
docker tag bunbunbunbun/bun-test-base:latest bun-base:latest
|
||||
docker tag bunbunbunbun/bun-base:latest bun-base:latest
|
||||
docker tag bunbunbunbun/bun-base-with-zig-and-webkit:latest bun-base-with-zig-and-webkit:latest
|
||||
47
.docker/run-dockerfile.sh
Normal file
47
.docker/run-dockerfile.sh
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
source "dockerfile-common.sh"
|
||||
|
||||
export $CONTAINER_NAME=$CONTAINER_NAME-local
|
||||
|
||||
rm -rf $TEMP
|
||||
mkdir -p $TEMP
|
||||
|
||||
docker build . --target release --progress=plain -t $CONTAINER_NAME:latest --build-arg BUILDKIT_INLINE_CACHE=1 --platform=linux/$BUILDKIT_ARCH --cache-from $CONTAINER_NAME:latest
|
||||
|
||||
if (($?)); then
|
||||
echo "Failed to build container"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
id=$(docker create $CONTAINER_NAME:latest)
|
||||
docker cp $id:/home/ubuntu/bun-release $TEMP/$CONTAINER_NAME
|
||||
if (($?)); then
|
||||
echo "Failed to cp container"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd $TEMP
|
||||
mkdir -p $TEMP/$CONTAINER_NAME $TEMP/$DEBUG_CONTAINER_NAME
|
||||
mv $CONTAINER_NAME/bun-profile $DEBUG_CONTAINER_NAME/bun
|
||||
zip -r $CONTAINER_NAME.zip $CONTAINER_NAME
|
||||
zip -r $DEBUG_CONTAINER_NAME.zip $DEBUG_CONTAINER_NAME
|
||||
docker rm -v $id
|
||||
abs=$(realpath $TEMP/$CONTAINER_NAME.zip)
|
||||
debug_abs=$(realpath $TEMP/$DEBUG_CONTAINER_NAME.zip)
|
||||
|
||||
case $(uname -s) in
|
||||
"Linux") target="linux" ;;
|
||||
*) target="other" ;;
|
||||
esac
|
||||
|
||||
if [ "$target" = "linux" ]; then
|
||||
if command -v bun --version >/dev/null; then
|
||||
cp $TEMP/$CONTAINER_NAME/bun $(which bun)
|
||||
cp $TEMP/$DEBUG_CONTAINER_NAME/bun $(which bun-profile)
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Saved to:"
|
||||
echo $debug_abs
|
||||
echo $abs
|
||||
9
.docker/run-test.sh
Executable file
9
.docker/run-test.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
bun install
|
||||
bun install --cwd ./integration/snippets
|
||||
bun install --cwd ./integration/scripts
|
||||
|
||||
make $BUN_TEST_NAME
|
||||
5
.docker/runner.sh
Normal file
5
.docker/runner.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
docker container run --security-opt seccomp=.docker/chrome.json --env GITHUB_WORKSPACE=$GITHUB_WORKSPACE --env BUN_TEST_NAME=$BUN_TEST_NAME --ulimit memlock=-1:-1 --init --rm bun-test:latest
|
||||
5
.docker/unit-tests.sh
Normal file
5
.docker/unit-tests.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
docker container run --security-opt seccomp=.docker/chrome.json --env GITHUB_WORKSPACE=$GITHUB_WORKSPACE --ulimit memlock=-1:-1 --init --rm bun-unit-tests:latest
|
||||
17
.dockerignore
Normal file
17
.dockerignore
Normal file
@@ -0,0 +1,17 @@
|
||||
node_modules
|
||||
**/node_modules
|
||||
src/javascript/jsc/WebKit/LayoutTests
|
||||
zig-out
|
||||
zig-build
|
||||
**/*.o
|
||||
**/*.a
|
||||
|
||||
examples
|
||||
|
||||
**/.next
|
||||
.git
|
||||
src/javascript/jsc/WebKit
|
||||
**/CMakeCache.txt
|
||||
packages/**/bun
|
||||
packages/**/bun-profile
|
||||
zig-cache
|
||||
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
.vscode/launch.json linguist-generated
|
||||
src/api/schema.d.ts linguist-generated
|
||||
src/api/schema.js linguist-generated
|
||||
*.lockb binary diff=lockb
|
||||
41
.github/workflows/bun-framework-next.yml
vendored
Normal file
41
.github/workflows/bun-framework-next.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: bun-framework-next
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- packages/bun-framework-next/**/*
|
||||
branches: [main, bun-framework-next-actions]
|
||||
pull_request:
|
||||
paths:
|
||||
- packages/bun-framework-next/**/*
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: lint, test and build on Node ${{ matrix.node }} and ${{ matrix.os }}
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node: ["14.x"]
|
||||
os: [macOS-latest]
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node ${{ matrix.node }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
|
||||
- name: Install PNPM
|
||||
uses: pnpm/action-setup@v2.0.1
|
||||
with:
|
||||
version: 6.21.0
|
||||
|
||||
- name: Install dependencies
|
||||
run: cd packages/bun-framework-next && pnpm install
|
||||
|
||||
- name: Type check bun-framework-next
|
||||
run: cd packages/bun-framework-next && pnpm check
|
||||
167
.github/workflows/bun.yml
vendored
Normal file
167
.github/workflows/bun.yml
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
name: bun
|
||||
on:
|
||||
push:
|
||||
branches: [main, bun-actions]
|
||||
paths-ignore:
|
||||
- "examples/**"
|
||||
- "bench/**"
|
||||
- "README.*"
|
||||
- "LICENSE"
|
||||
- ".vscode"
|
||||
- ".devcontainer"
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths-ignore:
|
||||
- "examples/**"
|
||||
- "bench/**"
|
||||
- README.*
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
TEST_TAG: bun-test'
|
||||
|
||||
jobs:
|
||||
e2e:
|
||||
runs-on: self-hosted
|
||||
name: "Integration tests"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Checkout submodules
|
||||
run: git -c submodule."src/javascript/jsc/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j 8
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
- name: Login to Dockerhub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
- name: Pull Base Image
|
||||
run: bash .docker/pull.sh
|
||||
- name: Build tests
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
target: test_base
|
||||
tags: bun-test:latest
|
||||
load: true
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
- name: Run test-with-hmr
|
||||
env:
|
||||
BUN_TEST_NAME: test-with-hmr
|
||||
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
|
||||
RUNNER_TEMP: ${RUNNER_TEMP}
|
||||
run: bash .docker/runner.sh
|
||||
- name: Run test-no-hmr
|
||||
env:
|
||||
BUN_TEST_NAME: test-no-hmr
|
||||
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
|
||||
RUNNER_TEMP: ${RUNNER_TEMP}
|
||||
run: bash .docker/runner.sh
|
||||
- name: Run test-bun-create-next
|
||||
env:
|
||||
RUNNER_TEMP: ${RUNNER_TEMP}
|
||||
BUN_TEST_NAME: test-create-next
|
||||
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
|
||||
run: bash .docker/runner.sh
|
||||
- name: Run test-bun-create-react
|
||||
env:
|
||||
RUNNER_TEMP: ${RUNNER_TEMP}
|
||||
BUN_TEST_NAME: test-create-react
|
||||
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
|
||||
run: bash .docker/runner.sh
|
||||
- name: Run test-bun-run
|
||||
env:
|
||||
RUNNER_TEMP: ${RUNNER_TEMP}
|
||||
BUN_TEST_NAME: test-bun-run
|
||||
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
|
||||
run: bash .docker/runner.sh
|
||||
- name: Run test-bun-install
|
||||
env:
|
||||
RUNNER_TEMP: ${RUNNER_TEMP}
|
||||
BUN_TEST_NAME: test-bun-install
|
||||
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
|
||||
run: bash .docker/runner.sh
|
||||
# This is commented out because zig test does not work on the CI
|
||||
# Which sucks
|
||||
# zig-unit-tests:
|
||||
# runs-on: self-hosted
|
||||
# name: "Unit tests (Zig)"
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v2
|
||||
# - name: Checkout submodules
|
||||
# run: git -c submodule."src/javascript/jsc/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j 8
|
||||
# - name: Set up Docker Buildx
|
||||
# uses: docker/setup-buildx-action@v1
|
||||
# - name: Login to Dockerhub
|
||||
# uses: docker/login-action@v1
|
||||
# with:
|
||||
# username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
# - name: Pull Base Image
|
||||
# run: bash .docker/pull.sh
|
||||
# - name: Build tests
|
||||
# uses: docker/build-push-action@v2
|
||||
# with:
|
||||
# context: .
|
||||
# target: build_unit
|
||||
# tags: bun-unit-tests:latest
|
||||
# load: true
|
||||
# cache-from: type=gha
|
||||
# cache-to: type=gha,mode=max
|
||||
# builder: ${{ steps.buildx.outputs.name }}
|
||||
# - name: Run tests
|
||||
# env:
|
||||
# GITHUB_WORKSPACE: $GITHUB_WORKSPACE
|
||||
# RUNNER_TEMP: ${RUNNER_TEMP}
|
||||
# run: bash .docker/unit-tests.sh
|
||||
release:
|
||||
runs-on: self-hosted
|
||||
needs: ["e2e"]
|
||||
if: github.ref == 'refs/heads/main'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Checkout submodules
|
||||
run: git -c submodule."src/javascript/jsc/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j 8
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: jarredsumner
|
||||
password: ${{ secrets.DOCKERHUB_ALT }}
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
with:
|
||||
install: true
|
||||
- name: Pull Base Image
|
||||
run: bash .docker/pull.sh
|
||||
- name: Build release image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
target: release
|
||||
tags: |
|
||||
ghcr.io/jarred-sumner/bun:${{github.sha}}
|
||||
ghcr.io/jarred-sumner/bun:edge
|
||||
jarredsumner/bun:${{github.sha}}
|
||||
jarredsumner/bun:edge
|
||||
platforms: |
|
||||
linux/amd64
|
||||
labels: |
|
||||
org.opencontainers.image.title=bun
|
||||
org.opencontainers.image.description=bun is a fast bundler, transpiler, JavaScript Runtime environment and package manager for web software. The image is an Ubuntu 20.04 image with bun preinstalled into /opt/bun.
|
||||
org.opencontainers.image.vendor=bun
|
||||
org.opencontainers.image.source=https://github.com/Jarred-Sumner/bun
|
||||
org.opencontainers.image.url=https://bun.sh
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
push: true
|
||||
27
.gitignore
vendored
27
.gitignore
vendored
@@ -12,6 +12,7 @@ yarn.lock
|
||||
dist
|
||||
*.log
|
||||
*.out.js
|
||||
*.out.refresh.js
|
||||
/package-lock.json
|
||||
build
|
||||
*.wat
|
||||
@@ -30,7 +31,6 @@ cover
|
||||
coverage
|
||||
coverv
|
||||
*.trace
|
||||
bench
|
||||
github
|
||||
out.*
|
||||
out
|
||||
@@ -65,6 +65,27 @@ release/
|
||||
sign.*.json
|
||||
packages/debug-*
|
||||
packages/bun-cli/postinstall.js
|
||||
packages/bun-*/bin/*
|
||||
packages/bun-*/bun
|
||||
packages/bun-*/bun-profile
|
||||
packages/bun-*/debug-bun
|
||||
packages/bun-*/*.o
|
||||
packages/bun-cli/postinstall.js
|
||||
|
||||
packages/bun-cli/bin/*
|
||||
packages/bun-cli/bin/*
|
||||
bun-test-scratch
|
||||
misctools/fetch
|
||||
|
||||
src/deps/libiconv
|
||||
src/deps/openssl
|
||||
src/tests.zig
|
||||
*.blob
|
||||
src/deps/s2n-tls
|
||||
.npm
|
||||
.npm.gz
|
||||
|
||||
bun-binary
|
||||
|
||||
src/deps/PLCrashReporter/
|
||||
|
||||
*.dSYM
|
||||
*.crash
|
||||
|
||||
26
.gitmodules
vendored
26
.gitmodules
vendored
@@ -3,13 +3,33 @@
|
||||
# url = https://github.com/Hejsil/zig-clap
|
||||
[submodule "src/deps/picohttpparser"]
|
||||
path = src/deps/picohttpparser
|
||||
url = https://github.com/h2o/picohttpparser/
|
||||
url = https://github.com/h2o/picohttpparser.git
|
||||
ignore = dirty
|
||||
[submodule "src/javascript/jsc/WebKit"]
|
||||
path = src/javascript/jsc/WebKit
|
||||
url = git@github.com:/Jarred-Sumner/WebKit
|
||||
url = https://github.com/Jarred-Sumner/WebKit.git
|
||||
ignore = dirty
|
||||
[submodule "src/deps/mimalloc"]
|
||||
path = src/deps/mimalloc
|
||||
url = https://github.com/microsoft/mimalloc
|
||||
url = https://github.com/Jarred-Sumner/mimalloc.git
|
||||
ignore = dirty
|
||||
[submodule "src/deps/zlib"]
|
||||
path = src/deps/zlib
|
||||
url = https://github.com/cloudflare/zlib.git
|
||||
ignore = dirty
|
||||
[submodule "src/deps/libarchive"]
|
||||
path = src/deps/libarchive
|
||||
url = https://github.com/libarchive/libarchive.git
|
||||
ignore = dirty
|
||||
[submodule "src/deps/boringssl"]
|
||||
path = src/deps/boringssl
|
||||
url = https://github.com/google/boringssl.git
|
||||
ignore = dirty
|
||||
[submodule "src/deps/libbacktrace"]
|
||||
path = src/deps/libbacktrace
|
||||
url = https://github.com/ianlancetaylor/libbacktrace
|
||||
ignore = dirty
|
||||
[submodule "src/deps/lol-html"]
|
||||
path = src/deps/lol-html
|
||||
url = https://github.com/cloudflare/lol-html
|
||||
ignore = dirty
|
||||
|
||||
23
.scripts/write-versions.sh
Normal file
23
.scripts/write-versions.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
set -euxo pipefail
|
||||
|
||||
WEBKIT_VERSION=$(git rev-parse HEAD:./src/javascript/jsc/WebKit)
|
||||
MIMALLOC_VERSION=$(git rev-parse HEAD:./src/deps/mimalloc)
|
||||
LIBARCHIVE_VERSION=$(git rev-parse HEAD:./src/deps/libarchive)
|
||||
PICOHTTPPARSER_VERSION=$(git rev-parse HEAD:./src/deps/picohttpparser)
|
||||
BORINGSSL_VERSION=$(git rev-parse HEAD:./src/deps/boringssl)
|
||||
ZLIB_VERSION=$(git rev-parse HEAD:./src/deps/zlib)
|
||||
|
||||
rm -rf src/generated_versions_list.zig
|
||||
echo "// AUTO-GENERATED FILE. Created via .scripts/write-versions.sh" >src/generated_versions_list.zig
|
||||
echo "" >>src/generated_versions_list.zig
|
||||
echo "pub const webkit = \"$WEBKIT_VERSION\";" >>src/generated_versions_list.zig
|
||||
echo "pub const mimalloc = \"$MIMALLOC_VERSION\";" >>src/generated_versions_list.zig
|
||||
echo "pub const libarchive = \"$LIBARCHIVE_VERSION\";" >>src/generated_versions_list.zig
|
||||
echo "pub const picohttpparser = \"$PICOHTTPPARSER_VERSION\";" >>src/generated_versions_list.zig
|
||||
echo "pub const boringssl = \"$BORINGSSL_VERSION\";" >>src/generated_versions_list.zig
|
||||
echo "pub const zlib = \"$ZLIB_VERSION\";" >>src/generated_versions_list.zig
|
||||
echo "pub const zig = @import(\"std\").fmt.comptimePrint(\"{}\", .{@import(\"builtin\").zig_version});" >>src/generated_versions_list.zig
|
||||
echo "" >>src/generated_versions_list.zig
|
||||
|
||||
zig fmt src/generated_versions_list.zig
|
||||
438
.vscode/launch.json
generated
vendored
438
.vscode/launch.json
generated
vendored
@@ -4,14 +4,128 @@
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Transpile small",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"args": [
|
||||
// "/Users/jarred/Desktop/webpack4.js"
|
||||
// "/Users/jarred/Code/bun/examples/css-stress-test/nexty/node_modules/next/dist/build/utils.js"
|
||||
"./dotenv-load-check.ts"
|
||||
],
|
||||
"cwd": "${workspaceFolder}/examples/css-stress-test",
|
||||
"name": "HTTP bench",
|
||||
"program": "${workspaceFolder}/misctools/http_bench",
|
||||
"args": ["https://twitter.com", "--count=100"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "fetch debug",
|
||||
"program": "${workspaceFolder}/misctools/fetch",
|
||||
"args": ["https://example.com", "--verbose"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "fetch debug #2",
|
||||
"program": "${workspaceFolder}/misctools/fetch",
|
||||
"args": ["https://twitter.com", "--verbose"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "fetch debug #13w",
|
||||
"program": "${workspaceFolder}/misctools/fetch",
|
||||
"args": ["http://127.0.0.1:8080/next.json", "--quiet", "--verbose"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "fetch debug #12w",
|
||||
"program": "${workspaceFolder}/misctools/fetch",
|
||||
"args": ["https://registry.npmjs.org/next", "--quiet", "--verbose"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "hop",
|
||||
"program": "hop",
|
||||
"args": ["swc-linux-arm64-musl-12.0.3.tgz"],
|
||||
"cwd": "/Users/jarred/Downloads/hop-test",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "hop extract",
|
||||
"program": "hop",
|
||||
"args": ["swc-linux-arm64-musl-12.0.3.hop"],
|
||||
"cwd": "/Users/jarred/Downloads/hop-test",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "fetch debug #2",
|
||||
"program": "${workspaceFolder}/misctools/fetch",
|
||||
"args": ["https://registry.npmjs.org/react", "--verbose"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "fetch debug #3",
|
||||
"program": "${workspaceFolder}/misctools/fetch",
|
||||
"args": ["http://example.com/", "--verbose"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun create debug",
|
||||
"program": "bun-debug",
|
||||
"args": ["create", "next", "foo", "--open", "--force"],
|
||||
"cwd": "/tmp",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun dev debug",
|
||||
"program": "bun-debug",
|
||||
"args": ["dev"],
|
||||
"cwd": "/tmp/foo",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun run debug",
|
||||
"program": "bun-debug",
|
||||
"args": ["run", "/tmp/bar.js"],
|
||||
// "args": ["--version"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun a debug",
|
||||
"program": "bun-debug",
|
||||
"args": ["create", "https://github.com/ahfarmer/calculator", "--force"],
|
||||
"cwd": "/tmp/",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun routes",
|
||||
"program": "bun-debug",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/integration/apps/routing",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
@@ -32,7 +146,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": ".bun",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": [
|
||||
"./examples/hello-next/node_modules.server.bun"
|
||||
// "--origin=https://localhost:9000/"
|
||||
@@ -44,7 +158,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Discord",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": [
|
||||
"discord"
|
||||
// "--origin=https://localhost:9000/"
|
||||
@@ -69,7 +183,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Dev Launch",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": [
|
||||
"./simple.css",
|
||||
"--resolve=dev",
|
||||
@@ -79,6 +193,15 @@
|
||||
"cwd": "${workspaceFolder}/src/test/fixtures",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Linux Launch",
|
||||
"program": "${workspaceFolder}/packages/debug-bun-cli-linux-x64/bin/bun-debug",
|
||||
"args": ["--origin=http://jarred-desktop.local:3000/"],
|
||||
"cwd": "${workspaceFolder}/examples/hello-next",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
|
||||
{
|
||||
"type": "lldb",
|
||||
@@ -94,58 +217,107 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Demo Serve",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
// "args": ["--serve", "--origin=http://localhost:3000"],
|
||||
"args": ["dev", "--origin=http://localhost:3000"],
|
||||
"cwd": "${workspaceFolder}/examples/hello-next",
|
||||
"cwd": "/tmp/next-app",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Demo Serve aarch64",
|
||||
"program": "${workspaceFolder}/build/macos-aarch64/bun",
|
||||
"name": "Demo ",
|
||||
"program": "bun-debug",
|
||||
// "args": ["--serve", "--origin=http://localhost:3000"],
|
||||
"args": ["dev", "--origin=http://ci.local:3000"],
|
||||
"cwd": "${workspaceFolder}/examples/hello-next",
|
||||
"args": ["/Users/jarred/Desktop/text-encoder-hello.js"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Demo Lazy Build",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"args": [
|
||||
"./src/index.tsx",
|
||||
"--resolve=lazy",
|
||||
"--origin=http://localhost:9000/"
|
||||
],
|
||||
"cwd": "${workspaceFolder}/examples/simple-react",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Demo Build",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"args": [
|
||||
"./src/index.tsx",
|
||||
"--resolve=dev",
|
||||
"--outdir=outcss",
|
||||
"--platform=browser",
|
||||
"--origin=http://localhost:9000/"
|
||||
],
|
||||
"cwd": "${workspaceFolder}/examples/css-stress-test",
|
||||
"name": "wiptest",
|
||||
"program": "bun-debug",
|
||||
"args": ["wiptest", "transpiler"],
|
||||
"cwd": "${workspaceFolder}/integration",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Fixture serve",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/src/test/fixtures",
|
||||
"name": "debug test",
|
||||
"program": "bun-debug",
|
||||
"args": ["build", "/tmp/foo.ts"],
|
||||
"cwd": "/tmp",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Dazzle serve",
|
||||
"program": "bun-debug",
|
||||
"args": ["dev"],
|
||||
"cwd": "/Users/jarred/Build/lattice/apps/dazzle",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Dazzle bun",
|
||||
"program": "bun-debug",
|
||||
"args": ["bun"],
|
||||
"cwd": "/Users/jarred/Build/lattice/apps/dazzle",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun run",
|
||||
"program": "bun-debug",
|
||||
"args": ["cat.js", "./node_modules/@babel/standalone/babel.js"],
|
||||
"cwd": "/Users/jarred/Build/foobar",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun run callback bench",
|
||||
"program": "bun-debug",
|
||||
"args": ["/Users/jarred/Code/bun/bench/snippets/callbacks-overhead.mjs"],
|
||||
"cwd": "/Users/jarred/Build/foobar",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun test",
|
||||
"program": "bun-debug",
|
||||
"args": ["wiptest", "transpiler"],
|
||||
"cwd": "${workspaceFolder}/integration",
|
||||
"env": {
|
||||
"FORCE_COLOR": "1"
|
||||
},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun tes2t",
|
||||
"program": "bun-debug",
|
||||
"args": ["build", "hello.jsx", "--platform=bun"],
|
||||
"cwd": "/Users/jarred/Desktop/",
|
||||
"env": {
|
||||
"FORCE_COLOR": "1"
|
||||
},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "unicode check",
|
||||
"args": ["--disable-hmr"],
|
||||
"program": "bun-debug",
|
||||
"cwd": "/Users/jarred/Build/app994",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
|
||||
@@ -153,7 +325,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Demo .bun",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": ["bun", "--use=bun-framework-next"],
|
||||
"cwd": "${workspaceFolder}/examples/hello-next",
|
||||
"console": "internalConsole"
|
||||
@@ -162,7 +334,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "PNPM .bun",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": ["bun", "./pages/index.js"],
|
||||
"cwd": "/Users/jarred/Build/pnpm-bun/packages/app",
|
||||
"console": "internalConsole"
|
||||
@@ -172,7 +344,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "PNPM serve",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": [],
|
||||
"cwd": "/Users/jarred/Build/pnpm-bun/packages/app",
|
||||
"console": "internalConsole"
|
||||
@@ -181,7 +353,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Mixed case resolve",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": [
|
||||
"build",
|
||||
"./index.js",
|
||||
@@ -196,7 +368,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Build .bun lotta-modules",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": ["bun", "./index.js", "--platform=browser"],
|
||||
"cwd": "${workspaceFolder}/examples/lotta-modules/",
|
||||
"console": "internalConsole"
|
||||
@@ -205,7 +377,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Dev CRA",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": ["dev", "--platform=browser"],
|
||||
"cwd": "${workspaceFolder}/examples/hello-create-react-app/",
|
||||
"console": "internalConsole"
|
||||
@@ -214,7 +386,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Fragment",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/src/test/fixtures",
|
||||
"console": "internalConsole"
|
||||
@@ -222,8 +394,8 @@
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Context Bun Bug",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"name": "Context bun Bug",
|
||||
"program": "bun-debug",
|
||||
"args": ["bun", "./code.js"],
|
||||
"cwd": "/Users/jarred/Build/context/www",
|
||||
"console": "internalConsole"
|
||||
@@ -231,8 +403,8 @@
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Context Bun",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"name": "Context bun",
|
||||
"program": "bun-debug",
|
||||
"args": ["bun", "--use=next"],
|
||||
"cwd": "/Users/jarred/Build/context/www",
|
||||
"console": "internalConsole"
|
||||
@@ -240,17 +412,116 @@
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Fixtures Dev",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"args": ["dev"],
|
||||
"cwd": "${workspaceFolder}/src/test/fixtures",
|
||||
"name": "bun-hello",
|
||||
"program": "bun-debug",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/packages/bun-hello",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "cppvsdbg",
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Fixtures Rel",
|
||||
"program": "${workspaceFolder}/build/macos-x86_64/bun",
|
||||
"name": "Integration Test Dev",
|
||||
"program": "bun-debug",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/integration/snippets",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun.sh dev",
|
||||
"program": "bun-debug",
|
||||
"args": ["dev"],
|
||||
"cwd": "${workspaceFolder}/../bun.sh",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Instal 1l",
|
||||
"program": "bun-debug",
|
||||
"args": ["install", "-g", "which"],
|
||||
"cwd": "/tmp/new-app",
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Instal 32",
|
||||
"program": "bun-debug",
|
||||
"args": ["install"],
|
||||
"cwd": "/tmp/foo",
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Install",
|
||||
"program": "bun-debug",
|
||||
"args": ["install", "--backend=clonefile", "--force"],
|
||||
"cwd": "/Users/jarred/Build/octokit-test",
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Install #2",
|
||||
"program": "bun-debug",
|
||||
"args": ["add", "typescript"],
|
||||
"cwd": "/tmp/wow-such-npm",
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Add",
|
||||
"program": "bun-debug",
|
||||
"args": ["add", "react"],
|
||||
"cwd": "/tmp/wow-such-npm",
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Remove",
|
||||
"program": "bun-debug",
|
||||
"args": ["remove", "foo"],
|
||||
"cwd": "/Users/jarred/Build/athena.yarn",
|
||||
"env": {},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Print Lockfile",
|
||||
"program": "bun-debug",
|
||||
"args": ["./bun.lockb"],
|
||||
"cwd": "/tmp/wow-such-npm",
|
||||
"env": {
|
||||
"BUN_CONFIG_SKIP_SAVE_LOCKFILE": "1"
|
||||
},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Integration Test Dev (no hmr)",
|
||||
"program": "bun-debug",
|
||||
"args": ["--disable-hmr"],
|
||||
"cwd": "${workspaceFolder}/integration/snippets",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Fixtures Dev",
|
||||
"program": "a",
|
||||
"args": ["dev"],
|
||||
"cwd": "${workspaceFolder}/src/test/fixtures",
|
||||
"console": "internalConsole"
|
||||
@@ -260,7 +531,7 @@
|
||||
|
||||
"request": "launch",
|
||||
"name": "Context Dev",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": [],
|
||||
"cwd": "/Users/jarred/Build/context/www",
|
||||
"console": "internalConsole"
|
||||
@@ -279,16 +550,16 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Debug Dev",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": ["dev"],
|
||||
"cwd": "${workspaceFolder}/examples/hello-next/bun-framework-next",
|
||||
"cwd": "${workspaceFolder}/examples/hello-next",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Type-only import",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": [
|
||||
"bun",
|
||||
"./src/test/fixtures/type-only-import.ts",
|
||||
@@ -301,7 +572,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Dev lotta-modules",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": ["dev", "./index.js", "--platform=browser"],
|
||||
"cwd": "${workspaceFolder}/examples/lotta-modules/",
|
||||
"console": "internalConsole"
|
||||
@@ -310,7 +581,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Demo Build .bun",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": [
|
||||
"bun",
|
||||
// "./index.js",
|
||||
@@ -325,7 +596,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "PNPM Resolve symlink",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": ["--resolve=dev", "test-pnpm.js", "--platform=browser"],
|
||||
"cwd": "${workspaceFolder}/examples/css-stress-test",
|
||||
"console": "internalConsole"
|
||||
@@ -334,7 +605,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Demo Print .bun",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "bun-debug",
|
||||
"args": ["./node_modules.bun"],
|
||||
"cwd": "${workspaceFolder}/examples/simple-react",
|
||||
"console": "internalConsole"
|
||||
@@ -349,21 +620,12 @@
|
||||
"cwd": "${workspaceFolder}/src/test/fixtures",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"name": "esbuild",
|
||||
"type": "go",
|
||||
"request": "launch",
|
||||
"mode": "debug",
|
||||
"program": "/Users/jarred/Code/esbuild/cmd/esbuild",
|
||||
"cwd": "/Users/jarred/Code/bun/src/test/fixtures",
|
||||
"args": ["--bundle", "--outfile=out.esbuild.js", "await.ts"]
|
||||
},
|
||||
|
||||
// {
|
||||
// "type": "lldb",
|
||||
// "request": "launch",
|
||||
// "name": "Dev Launch (other)",
|
||||
// "program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
// "program": "bun-debug",
|
||||
// "args": ["./simple.jsx", "--resolve=disable"],
|
||||
// "cwd": "${workspaceFolder}/src/test/fixtures",
|
||||
// "console": "internalConsole"
|
||||
@@ -372,7 +634,7 @@
|
||||
// "type": "lldb",
|
||||
// "request": "launch",
|
||||
// "name": "Dev Launch",
|
||||
// "program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
// "program": "bun-debug",
|
||||
// "preLaunchTask": "build",
|
||||
// "args": [
|
||||
// "--resolve=disable",
|
||||
@@ -387,7 +649,7 @@
|
||||
// "type": "lldb",
|
||||
// "request": "launch",
|
||||
// "name": "Dev Launch",
|
||||
// "program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
// "program": "bun-debug",
|
||||
// "preLaunchTask": "build",
|
||||
// "args": [
|
||||
// "--resolve=dev",
|
||||
@@ -404,7 +666,7 @@
|
||||
// "type": "lldb",
|
||||
// "request": "launch",
|
||||
// "name": "Dev Launch",
|
||||
// "program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
// "program": "bun-debug",
|
||||
// "preLaunchTask": "build",
|
||||
// "args": [
|
||||
// "--resolve=dev",
|
||||
@@ -421,7 +683,7 @@
|
||||
// "type": "lldb",
|
||||
// "request": "launch",
|
||||
// "name": "Dev Launch",
|
||||
// "program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
// "program": "bun-debug",
|
||||
// // "preLaunchTask": "build",
|
||||
// "args": [
|
||||
// "--resolve=dev",
|
||||
@@ -440,7 +702,7 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Rome",
|
||||
// "program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
// "program": "bun-debug",
|
||||
"program": "${workspaceFolder}/build/macos-x86_64/bun",
|
||||
// "preLaunchTask": "build",
|
||||
"args": [
|
||||
@@ -462,8 +724,8 @@
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Rome Dev",
|
||||
// "program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
"program": "${workspaceFolder}/build/debug/macos-x86_64/bun",
|
||||
// "program": "bun-debug",
|
||||
"program": "bun-debug",
|
||||
// "preLaunchTask": "build",
|
||||
"args": [
|
||||
"--resolve=dev",
|
||||
|
||||
40
.vscode/settings.json
vendored
40
.vscode/settings.json
vendored
@@ -3,14 +3,46 @@
|
||||
"search.quickOpen.includeSymbols": false,
|
||||
"search.seedWithNearestWord": true,
|
||||
"search.smartCase": true,
|
||||
"search.exclude": {
|
||||
"src/javascript/jsc/WebKit/**/*": true
|
||||
},
|
||||
"search.exclude": {},
|
||||
"search.followSymlinks": false,
|
||||
"search.useIgnoreFiles": true,
|
||||
"zig.buildOnSave": false,
|
||||
"[zig]": {
|
||||
"editor.defaultFormatter": "tiehuis.zig"
|
||||
"editor.defaultFormatter": "AugusteRame.zls-vscode"
|
||||
},
|
||||
"[ts]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[tsx]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"zig.beforeDebugCmd": "make build-unit ${file} ${filter} ${bin}",
|
||||
"zig.testCmd": "make test ${file} ${filter} ${bin}",
|
||||
|
||||
"lldb.verboseLogging": false,
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
"**/.svn": true,
|
||||
"**/.hg": true,
|
||||
"**/CVS": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/Thumbs.db": true,
|
||||
"**/*.xcworkspacedata": true,
|
||||
"**/*.xcscheme": true,
|
||||
"**/*.pem": true,
|
||||
"**/*.xcodeproj": true,
|
||||
|
||||
"integration/snapshots": true,
|
||||
"integration/snapshots-no-hmr": true,
|
||||
"src/javascript/jsc/WebKit": true,
|
||||
"src/deps/libarchive": true,
|
||||
"src/deps/mimalloc": true,
|
||||
"src/deps/s2n-tls": true,
|
||||
"src/deps/boringssl": true,
|
||||
"src/deps/openssl": true,
|
||||
"src/deps/zlib": true,
|
||||
"src/deps/lol-html": true,
|
||||
"integration/snippets/package-json-exports/_node_modules_copy": true
|
||||
},
|
||||
"C_Cpp.files.exclude": {
|
||||
"**/.vscode": true,
|
||||
|
||||
381
Dockerfile
Normal file
381
Dockerfile
Normal file
@@ -0,0 +1,381 @@
|
||||
|
||||
FROM bunbunbunbun/bun-base:latest as lolhtml
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/deps/lol-html ${BUN_DIR}/src/deps/lol-html
|
||||
|
||||
RUN cd ${BUN_DIR} && \
|
||||
make lolhtml && rm -rf src/deps/lol-html Makefile
|
||||
|
||||
FROM bunbunbunbun/bun-base:latest as mimalloc
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/deps/mimalloc ${BUN_DIR}/src/deps/mimalloc
|
||||
|
||||
RUN cd ${BUN_DIR} && \
|
||||
make mimalloc && rm -rf src/deps/mimalloc Makefile
|
||||
|
||||
FROM bunbunbunbun/bun-base:latest as zlib
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/deps/zlib ${BUN_DIR}/src/deps/zlib
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
RUN cd $BUN_DIR && \
|
||||
make zlib && rm -rf src/deps/zlib Makefile
|
||||
|
||||
FROM bunbunbunbun/bun-base:latest as libarchive
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/deps/libarchive ${BUN_DIR}/src/deps/libarchive
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
RUN cd $BUN_DIR && \
|
||||
make libarchive && rm -rf src/deps/libarchive Makefile
|
||||
|
||||
FROM bunbunbunbun/bun-base:latest as libbacktrace
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
COPY 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 bunbunbunbun/bun-base:latest as boringssl
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/deps/boringssl ${BUN_DIR}/src/deps/boringssl
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
RUN cd $BUN_DIR && \
|
||||
make boringssl && rm -rf src/deps/boringssl Makefile
|
||||
|
||||
FROM bunbunbunbun/bun-base:latest as picohttp
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/deps/picohttpparser ${BUN_DIR}/src/deps/picohttpparser
|
||||
COPY src/deps/*.c ${BUN_DIR}/src/deps
|
||||
COPY src/deps/*.h ${BUN_DIR}/src/deps
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
RUN cd $BUN_DIR && \
|
||||
make picohttp
|
||||
|
||||
FROM bunbunbunbun/bun-base-with-zig-and-webkit:latest as identifier_cache
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/js_lexer/identifier_data.zig ${BUN_DIR}/src/js_lexer/identifier_data.zig
|
||||
COPY src/js_lexer/identifier_cache.zig ${BUN_DIR}/src/js_lexer/identifier_cache.zig
|
||||
|
||||
RUN cd $BUN_DIR && \
|
||||
make identifier-cache && rm -rf zig-cache Makefile
|
||||
|
||||
FROM bunbunbunbun/bun-base-with-zig-and-webkit:latest as node_fallbacks
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/node-fallbacks ${BUN_DIR}/src/node-fallbacks
|
||||
RUN cd $BUN_DIR && \
|
||||
make node-fallbacks && rm -rf src/node-fallbacks/node_modules Makefile
|
||||
|
||||
FROM bunbunbunbun/bun-base-with-zig-and-webkit:latest as prepare_release
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
COPY ./src ${BUN_DIR}/src
|
||||
COPY ./build.zig ${BUN_DIR}/build.zig
|
||||
COPY ./completions ${BUN_DIR}/completions
|
||||
COPY ./packages ${BUN_DIR}/packages
|
||||
COPY ./build-id ${BUN_DIR}/build-id
|
||||
COPY ./package.json ${BUN_DIR}/package.json
|
||||
COPY ./misctools ${BUN_DIR}/misctools
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
|
||||
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=libbacktrace ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=zlib ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/
|
||||
COPY --from=identifier_cache ${BUN_DIR}/src/js_lexer/*.blob ${BUN_DIR}/src/js_lexer
|
||||
COPY --from=node_fallbacks ${BUN_DIR}/src/node-fallbacks/out ${BUN_DIR}/src/node-fallbacks/out
|
||||
|
||||
WORKDIR ${BUN_DIR}
|
||||
|
||||
|
||||
FROM prepare_release as build_release
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
RUN cd $BUN_DIR && rm -rf $HOME/.cache zig-cache && make \
|
||||
jsc-bindings-headers \
|
||||
api \
|
||||
analytics \
|
||||
bun_error \
|
||||
fallback_decoder && rm -rf $HOME/.cache zig-cache && \
|
||||
mkdir -p $BUN_RELEASE_DIR && \
|
||||
make release copy-to-bun-release-dir && \
|
||||
rm -rf $HOME/.cache zig-cache misctools package.json build-id completions build.zig $(BUN_DIR)/packages
|
||||
|
||||
FROM prepare_release as build_unit
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
ENV PATH "$ZIG_PATH:$PATH"
|
||||
|
||||
CMD make jsc-bindings-headers \
|
||||
api \
|
||||
analytics \
|
||||
bun_error \
|
||||
fallback_decoder \
|
||||
jsc-bindings-mac && \
|
||||
make \
|
||||
run-all-unit-tests
|
||||
|
||||
FROM bunbunbunbun/bun-base-with-zig-and-webkit:latest as bun.devcontainer
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
ENV WEBKIT_OUT_DIR ${WEBKIT_DIR}
|
||||
ENV PATH "$ZIG_PATH:$PATH"
|
||||
ENV JSC_BASE_DIR $WEBKIT_OUT_DIR
|
||||
ENV LIB_ICU_PATH ${GITHUB_WORKSPACE}/icu/source/lib
|
||||
ENV BUN_RELEASE_DIR ${BUN_RELEASE_DIR}
|
||||
ENV PATH "${GITHUB_WORKSPACE}/packages/bun-linux-x64:${GITHUB_WORKSPACE}/packages/bun-linux-aarch64:${GITHUB_WORKSPACE}/packages/debug-bun-linux-x64:${GITHUB_WORKSPACE}/packages/debug-bun-linux-aarch64:$PATH"
|
||||
ENV PATH "/home/ubuntu/zls/zig-out/bin:$PATH"
|
||||
|
||||
ENV BUN_INSTALL /home/ubuntu/.bun
|
||||
ENV XDG_CONFIG_HOME /home/ubuntu/.config
|
||||
|
||||
RUN apt-get -y update && update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-13 90
|
||||
|
||||
COPY .devcontainer/workspace.code-workspace $GITHUB_WORKSPACE/workspace.code-workspace
|
||||
COPY .devcontainer/zls.json $GITHUB_WORKSPACE/workspace.code-workspace
|
||||
COPY .devcontainer/limits.conf /etc/security/limits.conf
|
||||
COPY ".devcontainer/scripts/" /scripts/
|
||||
COPY ".devcontainer/scripts/getting-started.sh" $GITHUB_WORKSPACE/getting-started.sh
|
||||
RUN mkdir -p /home/ubuntu/.bun /home/ubuntu/.config $GITHUB_WORKSPACE/bun && \
|
||||
bash /scripts/common-debian.sh && \
|
||||
bash /scripts/github.sh && \
|
||||
bash /scripts/nice.sh && \
|
||||
bash /scripts/zig-env.sh
|
||||
COPY .devcontainer/zls.json /home/ubuntu/.config/zls.json
|
||||
|
||||
FROM ubuntu:20.04 as release_with_debug_info
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
COPY .devcontainer/limits.conf /etc/security/limits.conf
|
||||
|
||||
ENV BUN_INSTALL /opt/bun
|
||||
ENV PATH "/opt/bun/bin:$PATH"
|
||||
ARG BUILDARCH=amd64
|
||||
LABEL org.opencontainers.image.title="bun ${BUILDARCH} (glibc)"
|
||||
LABEL org.opencontainers.image.source=https://github.com/jarred-sumner/bun
|
||||
COPY --from=build_release ${BUN_RELEASE_DIR}/bun /opt/bun/bin/bun
|
||||
COPY --from=build_release ${BUN_RELEASE_DIR}/bun-profile /opt/bun/bin/bun-profile
|
||||
|
||||
WORKDIR /opt/bun
|
||||
|
||||
ENTRYPOINT [ "/opt/bun/bin/bun" ]
|
||||
|
||||
FROM ubuntu:20.04 as release
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
COPY .devcontainer/limits.conf /etc/security/limits.conf
|
||||
|
||||
ENV BUN_INSTALL /opt/bun
|
||||
ENV PATH "/opt/bun/bin:$PATH"
|
||||
ARG BUILDARCH=amd64
|
||||
LABEL org.opencontainers.image.title="bun ${BUILDARCH} (glibc)"
|
||||
LABEL org.opencontainers.image.source=https://github.com/jarred-sumner/bun
|
||||
COPY --from=build_release ${BUN_RELEASE_DIR}/bun /opt/bun/bin/bun
|
||||
WORKDIR /opt/bun
|
||||
|
||||
ENTRYPOINT [ "/opt/bun/bin/bun" ]
|
||||
|
||||
|
||||
FROM bunbunbunbun/bun-test-base as test_base
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
ARG BUILDARCH=amd64
|
||||
RUN groupadd -r chromium && useradd -d ${BUN_DIR} -M -r -g chromium -G audio,video chromium \
|
||||
&& mkdir -p /home/chromium/Downloads && chown -R chromium:chromium /home/chromium
|
||||
|
||||
USER chromium
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
ENV NPM_CLIENT bun
|
||||
ENV PATH "${BUN_DIR}/packages/bun-linux-x64:${BUN_DIR}/packages/bun-linux-aarch64:$PATH"
|
||||
ENV CI 1
|
||||
ENV BROWSER_EXECUTABLE /usr/bin/chromium
|
||||
|
||||
COPY ./integration ${BUN_DIR}/integration
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY package.json ${BUN_DIR}/package.json
|
||||
COPY .docker/run-test.sh ${BUN_DIR}/run-test.sh
|
||||
COPY ./bun.lockb ${BUN_DIR}/bun.lockb
|
||||
|
||||
# # We don't want to worry about architecture differences in this image
|
||||
COPY --from=release /opt/bun/bin/bun ${BUN_DIR}/packages/bun-linux-aarch64/bun
|
||||
COPY --from=release /opt/bun/bin/bun ${BUN_DIR}/packages/bun-linux-x64/bun
|
||||
|
||||
USER root
|
||||
RUN chgrp -R chromium ${BUN_DIR} && chmod g+rwx ${BUN_DIR} && chown -R chromium:chromium ${BUN_DIR}
|
||||
USER chromium
|
||||
|
||||
CMD [ "bash", "run-test.sh" ]
|
||||
|
||||
FROM release
|
||||
147
Dockerfile.base
Normal file
147
Dockerfile.base
Normal file
@@ -0,0 +1,147 @@
|
||||
FROM ubuntu:20.04 as bun-base-with-args
|
||||
|
||||
FROM bun-base-with-args as bun-base
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
|
||||
WORKDIR ${GITHUB_WORKSPACE}
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install --no-install-recommends -y wget gnupg2 curl lsb-release wget software-properties-common && \
|
||||
add-apt-repository ppa:longsleep/golang-backports && \
|
||||
wget https://apt.llvm.org/llvm.sh --no-check-certificate && \
|
||||
chmod +x llvm.sh && \
|
||||
./llvm.sh 13 && \
|
||||
apt-get update && \
|
||||
apt-get install --no-install-recommends -y \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg2 \
|
||||
software-properties-common \
|
||||
cmake \
|
||||
build-essential \
|
||||
git \
|
||||
libssl-dev \
|
||||
ruby \
|
||||
liblld-13-dev \
|
||||
libclang-13-dev \
|
||||
nodejs \
|
||||
gcc \
|
||||
g++ \
|
||||
npm \
|
||||
clang-13 \
|
||||
clang-format-13 \
|
||||
libc++-13-dev \
|
||||
libc++abi-13-dev \
|
||||
lld-13 \
|
||||
libicu-dev \
|
||||
wget \
|
||||
rustc \
|
||||
cargo \
|
||||
unzip \
|
||||
tar \
|
||||
golang-go ninja-build pkg-config automake autoconf libtool curl && \
|
||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-13 90 && \
|
||||
update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-13 90 && \
|
||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-13 90 && \
|
||||
npm install -g esbuild
|
||||
|
||||
ENV CC=clang-13
|
||||
ENV CXX=clang++-13
|
||||
|
||||
|
||||
ARG BUILDARCH=amd64
|
||||
|
||||
|
||||
WORKDIR $GITHUB_WORKSPACE
|
||||
|
||||
ENV WEBKIT_OUT_DIR ${WEBKIT_DIR}
|
||||
|
||||
ENV JSC_BASE_DIR $WEBKIT_OUT_DIR
|
||||
ENV LIB_ICU_PATH ${GITHUB_WORKSPACE}/icu/source/lib
|
||||
ENV BUN_RELEASE_DIR ${BUN_RELEASE_DIR}
|
||||
ENV BUN_DEPS_OUT_DIR ${BUN_DEPS_OUT_DIR}
|
||||
|
||||
RUN cd / && mkdir -p $BUN_RELEASE_DIR $BUN_DEPS_OUT_DIR ${BUN_DIR} ${BUN_DEPS_OUT_DIR}
|
||||
|
||||
LABEL org.opencontainers.image.title="bun base image ${BUILDARCH} (glibc)"
|
||||
LABEL org.opencontainers.image.source=https://github.com/jarred-sumner/bun
|
||||
|
||||
|
||||
FROM bun-base as bun-base-with-zig-and-webkit
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
# Directory extracts to "bun-webkit"
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
ARG BUILDARCH=amd64
|
||||
|
||||
WORKDIR $GITHUB_WORKSPACE
|
||||
|
||||
RUN cd $GITHUB_WORKSPACE && \
|
||||
curl -o zig-linux-$BUILDARCH.zip -L https://github.com/Jarred-Sumner/zig/releases/download/mar4/zig-linux-$BUILDARCH.zip && \
|
||||
unzip -q zig-linux-$BUILDARCH.zip && \
|
||||
rm zig-linux-$BUILDARCH.zip;
|
||||
|
||||
RUN cd $GITHUB_WORKSPACE && \
|
||||
curl -o bun-webkit-linux-$BUILDARCH.tar.gz -L https://github.com/Jarred-Sumner/WebKit/releases/download/Mar15/bun-webkit-linux-$BUILDARCH.tar.gz && \
|
||||
tar -xzf bun-webkit-linux-$BUILDARCH.tar.gz && \
|
||||
rm bun-webkit-linux-$BUILDARCH.tar.gz && \
|
||||
cat $WEBKIT_OUT_DIR/include/cmakeconfig.h > /dev/null
|
||||
|
||||
RUN cd $GITHUB_WORKSPACE && \
|
||||
curl -o icu4c-66_1-src.tgz -L https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-src.tgz && \
|
||||
tar -xzf icu4c-66_1-src.tgz && \
|
||||
rm icu4c-66_1-src.tgz && \
|
||||
cd icu/source && \
|
||||
./configure --enable-static --disable-shared && \
|
||||
make -j$(nproc)
|
||||
|
||||
ENV ZIG "${ZIG_PATH}/zig"
|
||||
|
||||
LABEL org.opencontainers.image.title="bun base image with zig & webkit ${BUILDARCH} (glibc)"
|
||||
LABEL org.opencontainers.image.source=https://github.com/jarred-sumner/bun
|
||||
|
||||
|
||||
FROM debian:bullseye-slim as bun-test-base
|
||||
# Original creator:
|
||||
# LABEL maintainer "Jessie Frazelle <jess@linux.com>"
|
||||
|
||||
# Install Chromium
|
||||
# Yes, including the Google API Keys sucks but even debian does the same: https://packages.debian.org/stretch/amd64/chromium/filelist
|
||||
RUN apt-get update && apt-get install -y \
|
||||
chromium \
|
||||
chromium-l10n \
|
||||
fonts-liberation \
|
||||
fonts-roboto \
|
||||
hicolor-icon-theme \
|
||||
libcanberra-gtk-module \
|
||||
libexif-dev \
|
||||
libgl1-mesa-dri \
|
||||
libgl1-mesa-glx \
|
||||
libpangox-1.0-0 \
|
||||
libv4l-0 \
|
||||
fonts-symbola \
|
||||
bash \
|
||||
make \
|
||||
psmisc \
|
||||
curl \
|
||||
--no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& mkdir -p /etc/chromium.d/ \
|
||||
&& /bin/echo -e 'export GOOGLE_API_KEY="AIzaSyCkfPOPZXDKNn8hhgu3JrA62wIgC93d44k"\nexport GOOGLE_DEFAULT_CLIENT_ID="811574891467.apps.googleusercontent.com"\nexport GOOGLE_DEFAULT_CLIENT_SECRET="kdloedMFGdGla2P1zacGjAQh"' > /etc/chromium.d/googleapikeys && \
|
||||
curl -L https://deb.nodesource.com/setup_16.x | bash - && \
|
||||
apt-get update && \
|
||||
apt-get install -y nodejs npm
|
||||
|
||||
139
Dockerfile.musl
Normal file
139
Dockerfile.musl
Normal file
@@ -0,0 +1,139 @@
|
||||
|
||||
# This doesn't work
|
||||
# Specifically: there are a number of crashes and segfaults when using musl
|
||||
# The cause is likely related to differences in pthreads implementations
|
||||
# It is not just the stack size thing. It's something more complicated and importantly
|
||||
# There was no meaningful file size difference between musl and glibc
|
||||
|
||||
|
||||
# ARG BUILDARCH=aarch64
|
||||
# ARG zig_base_image=ghcr.io/jarred-sumner/zig-linux-musl-${BUILDARCH}
|
||||
# ARG webkit_base_image=ghcr.io/jarred-sumner/bun-webkit-musl-${BUILDARCH}
|
||||
# FROM ${zig_base_image}:latest AS zig
|
||||
# FROM ${webkit_base_image}:latest AS webkit
|
||||
|
||||
# FROM zig as bun_base
|
||||
|
||||
# COPY --from=webkit /webkit /webkit
|
||||
|
||||
# ENV PATH "/zig/bin:$PATH"
|
||||
# ENV JSC_BASE_DIR=/webkit
|
||||
# ENV LIB_ICU_PATH=/webkit/lib
|
||||
# ENV BUN_DEPS_OUT_DIR /bun-deps
|
||||
# ENV STATIC_MUSL_FLAG=-static
|
||||
# ENV MIMALLOC_OVERRIDE_FLAG="-DMI_OVERRIDE=OFF"
|
||||
|
||||
# RUN apk add --no-cache nodejs npm go libtool autoconf pkgconfig automake ninja
|
||||
# RUN mkdir -p $BUN_DEPS_OUT_DIR;
|
||||
|
||||
# WORKDIR /bun
|
||||
# COPY Makefile /bun/Makefile
|
||||
|
||||
# FROM bun_base as mimalloc
|
||||
|
||||
# COPY src/deps/mimalloc /bun/src/deps/mimalloc
|
||||
|
||||
# RUN make mimalloc;
|
||||
|
||||
# FROM bun_base as zlib
|
||||
|
||||
# COPY src/deps/zlib /bun/src/deps/zlib
|
||||
|
||||
# RUN make zlib;
|
||||
|
||||
# FROM bun_base as libarchive
|
||||
|
||||
# COPY src/deps/libarchive /bun/src/deps/libarchive
|
||||
|
||||
# RUN make libarchive;
|
||||
|
||||
# FROM bun_base as boringssl
|
||||
|
||||
# COPY src/deps/boringssl /bun/src/deps/boringssl
|
||||
|
||||
# RUN make boringssl;
|
||||
|
||||
# FROM bun_base as picohttp
|
||||
|
||||
# COPY src/deps/picohttpparser /bun/src/deps/picohttpparser
|
||||
# COPY src/deps/*.c /bun/src/deps
|
||||
# COPY src/deps/*.h /bun/src/deps
|
||||
|
||||
# RUN make picohttp
|
||||
|
||||
# FROM bun_base as identifier_cache
|
||||
|
||||
# COPY src/js_lexer/identifier_data.zig /bun/src/js_lexer/identifier_data.zig
|
||||
# COPY src/js_lexer/identifier_cache.zig /bun/src/js_lexer/identifier_cache.zig
|
||||
|
||||
# RUN make identifier-cache
|
||||
|
||||
# FROM bun_base as node_fallbacks
|
||||
|
||||
# COPY src/node-fallbacks /bun/src/node-fallbacks
|
||||
# RUN make node-fallbacks
|
||||
|
||||
# FROM bun_base as prebuild
|
||||
|
||||
# WORKDIR /bun
|
||||
|
||||
# COPY ./src /bun/src
|
||||
# COPY ./build.zig /bun/build.zig
|
||||
# COPY ./completions /bun/completions
|
||||
# COPY ./packages /bun/packages
|
||||
# COPY ./build-id /bun/build-id
|
||||
# COPY ./package.json /bun/package.json
|
||||
# COPY ./misctools /bun/misctools
|
||||
|
||||
# COPY --from=mimalloc /bun-deps/*.o /bun-deps
|
||||
# COPY --from=libarchive /bun-deps/*.a /bun-deps
|
||||
# COPY --from=picohttp /bun-deps/*.o /bun-deps
|
||||
# COPY --from=boringssl /bun-deps/*.a /bun-deps
|
||||
# COPY --from=zlib /bun-deps/*.a /bun-deps
|
||||
# COPY --from=node_fallbacks /bun/src/node-fallbacks /bun/src/node-fallbacks
|
||||
# COPY --from=identifier_cache /bun/src/js_lexer/*.blob /bun/src/js_lexer/
|
||||
|
||||
# ENV ICU_FLAGS="-I/webkit/include/wtf $ICU_FLAGS"
|
||||
|
||||
# RUN apk add --no-cache chromium && npm install -g esbuild && make \
|
||||
# jsc-bindings-headers \
|
||||
# api \
|
||||
# analytics \
|
||||
# bun_error \
|
||||
# fallback_decoder
|
||||
|
||||
|
||||
|
||||
# FROM prebuild as release
|
||||
|
||||
# ENV BUN_RELEASE_DIR /opt/bun
|
||||
|
||||
# ENV LIB_ICU_PATH /usr/lib
|
||||
|
||||
# RUN apk add icu-static icu-dev && mkdir -p $BUN_RELEASE_DIR; make release \
|
||||
# copy-to-bun-release-dir
|
||||
|
||||
# FROM alpine:3.15 as bun
|
||||
|
||||
# COPY --from=release /opt/bun/bun /opt/bun/bin/bun
|
||||
# ENV BUN_INSTALL /opt/bun
|
||||
# ENV PATH /opt/bun/bin:$PATH
|
||||
|
||||
# LABEL org.opencontainers.image.title="bun - Linux ${BUILDARCH} (musl)"
|
||||
# LABEL org.opencontainers.image.source=https://github.com/jarred-sumner/bun
|
||||
|
||||
# FROM release as test
|
||||
|
||||
# ENV PATH /opt/bun/bin:$PATH
|
||||
# ENV PATH /bun/packages/bun-linux-aarch64:/bun/packages/bun-linux-x64:$PATH
|
||||
# ENV BUN_INSTALL /opt/bun
|
||||
|
||||
# WORKDIR /bun
|
||||
|
||||
# COPY ./integration /bun/integration
|
||||
# COPY ./integration/snippets/package-json-exports/_node_modules_copy /bun/integration/snippets/package-json-exports/_node_modules_copy
|
||||
# CMD [ "bash", "-c", "npm install && cd /bun/integration/snippets && npm install && cd /bun && make copy-test-node-modules test-all"]
|
||||
|
||||
|
||||
# # FROM bun
|
||||
|
||||
5
bench/hot-module-reloading/css-stress-test/.gitignore
vendored
Normal file
5
bench/hot-module-reloading/css-stress-test/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
bun
|
||||
next
|
||||
src/*.mov
|
||||
src/*.blob
|
||||
|
||||
77
bench/hot-module-reloading/css-stress-test/Makefile
Normal file
77
bench/hot-module-reloading/css-stress-test/Makefile
Normal file
@@ -0,0 +1,77 @@
|
||||
SLEEP_INTERVAL ?= 32
|
||||
SCREEN_WIDTH ?= $(shell system_profiler -json SPDisplaysDataType 2>/dev/null | jq -r '.. | objects | select(.spdisplays_main) | ._spdisplays_pixels | split(" ")[0]')
|
||||
SCREEN_HEIGHT ?= $(shell system_profiler -json SPDisplaysDataType 2>/dev/null | jq -r '.. | objects | select(.spdisplays_main) | ._spdisplays_pixels | split(" ")[2]')
|
||||
PROJECT ?= bun
|
||||
PACKAGE_NAME ?= bun-cli
|
||||
RUN_COUNT ?= 128
|
||||
ENDPOINT ?= /
|
||||
|
||||
ifeq ($(PROJECT),bun)
|
||||
PACKAGE_NAME := bun-cli
|
||||
endif
|
||||
|
||||
ifeq ($(PROJECT),next)
|
||||
PACKAGE_NAME := next
|
||||
endif
|
||||
|
||||
generate:
|
||||
@killall -9 bun next node || echo ""
|
||||
PROJECT=$(PROJECT) SCREEN_WIDTH=$(SCREEN_WIDTH) SCREEN_HEIGHT=$(SCREEN_HEIGHT) ENDPOINT=$(ENDPOINT) node browser.js
|
||||
|
||||
generate-css-in-js:
|
||||
@killall -9 bun next node || echo ""
|
||||
PROJECT=$(PROJECT) SCREEN_WIDTH=$(SCREEN_WIDTH) SCREEN_HEIGHT=$(SCREEN_HEIGHT) ENDPOINT=/css-in-js node browser.js
|
||||
loop:
|
||||
cp src/colors.css.0 src/colors.css
|
||||
sleep 3
|
||||
osascript -e 'tell application "System Events" to tell process "Chromium"' \
|
||||
-e 'set frontmost to true' \
|
||||
-e 'if windows is not {} then perform action "AXRaise" of item 1 of windows' \
|
||||
-e 'end tell'
|
||||
sleep 0.5
|
||||
cd src; zig run -Drelease-fast ../color-looper.zig -- ./colors.css:0 $(SLEEP_INTERVAL)
|
||||
cp src/colors.css.blob $(PROJECT)/colors.css.blob
|
||||
|
||||
loop-emotion:
|
||||
cp src/css-in-js-styles.0 src/css-in-js-styles.tsx
|
||||
sleep 3
|
||||
osascript -e 'tell application "System Events" to tell process "Chromium"' \
|
||||
-e 'set frontmost to true' \
|
||||
-e 'if windows is not {} then perform action "AXRaise" of item 1 of windows' \
|
||||
-e 'end tell'
|
||||
sleep 0.5
|
||||
cd src; zig run -Drelease-fast ../color-looper.emotion.zig -- ./css-in-js-styles.tsx:0 $(SLEEP_INTERVAL)
|
||||
cp src/css-in-js-styles.tsx.blob $(PROJECT)/css-in-js-styles.blob
|
||||
|
||||
process_video:
|
||||
rm -rf $(FRAMES_DIR); mkdir -p $(FRAMES_DIR); ffmpeg -i src/colors.css.mov -vf fps=120,format=gray $(FRAMES_DIR)/%d.tif
|
||||
|
||||
FRAMES_DIR ?= $(shell mkdir -p ./$(PROJECT)/frames; realpath ./$(PROJECT)/frames)
|
||||
|
||||
TIF_FILES := $(wildcard $(FRAMES_DIR)/*.tif)
|
||||
TXT_FILES := $(wildcard $(FRAMES_DIR)/*.txt)
|
||||
|
||||
OBJ_FILES := $(patsubst $(SRC_DIR)/%.tif,$(OBJ_DIR)/%.txt,$(TIF_FILES))
|
||||
TRIM_FILES := $(patsubst $(SRC_DIR)/%.txt,$(OBJ_DIR)/%.trim,$(TXT_FILES))
|
||||
|
||||
frames: $(OBJ_FILES)
|
||||
|
||||
|
||||
$(FRAMES_DIR)/%.txt: $(FRAMES_DIR)/%.tif
|
||||
tesseract -l eng $< $@
|
||||
|
||||
trim: $(TRIM_FILES) cleanup print
|
||||
|
||||
|
||||
|
||||
$(FRAMES_DIR)/%.trim: $(FRAMES_DIR)/%.txt
|
||||
(grep "Ran:" $< || echo "\n") >> $(PROJECT)/frames.all
|
||||
|
||||
cleanup:
|
||||
sed 's/^Ran: *//' $(PROJECT)/frames.all | tr -d ' ' | sort | uniq > $(PROJECT)/frames.all.clean
|
||||
|
||||
print:
|
||||
PACKAGE_NAME=$(PACKAGE_NAME) SLEEP_INTERVAL=$(SLEEP_INTERVAL) PROJECT=$(PROJECT) OUTFILE=timings/$(PACKAGE_NAME) node read-frames.js
|
||||
|
||||
print-emotion:
|
||||
PACKAGE_NAME=$(PACKAGE_NAME) SLEEP_INTERVAL=$(SLEEP_INTERVAL) PROJECT=$(PROJECT) OUTFILE=timings/emotion_$(PACKAGE_NAME) node read-frames.js
|
||||
62
bench/hot-module-reloading/css-stress-test/README.md
Normal file
62
bench/hot-module-reloading/css-stress-test/README.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# CSS Stress Test
|
||||
|
||||
This benchmarks bundler performance for CSS hot reloading.
|
||||
|
||||
## Results
|
||||
|
||||
bun is 14x faster than Next.js at hot reloading CSS.
|
||||
|
||||
```
|
||||
bun v0.0.34
|
||||
Saving every 16ms
|
||||
|
||||
Frame time:
|
||||
50th percentile: 22.2ms
|
||||
75th percentile: 23.9ms
|
||||
90th percentile: 25.3ms
|
||||
95th percentile: 43.6ms
|
||||
99th percentile: 49.1ms
|
||||
Rendered frames: 922 / 1024 (90%)
|
||||
```
|
||||
|
||||
```
|
||||
Next.js v11.1.2
|
||||
Saving every 16ms
|
||||
|
||||
Frame time:
|
||||
50th percentile: 312ms
|
||||
75th percentile: 337.6ms
|
||||
90th percentile: 387.7ms
|
||||
95th percentile: 446.9ms
|
||||
99th percentile: 591.7ms
|
||||
Rendered frames: 64 / 1024 (6%)
|
||||
```
|
||||
|
||||
## How it works
|
||||
|
||||
It times pixels instead of builds. `color-looper.zig` writes color updates and the timestamp to a css file, while simultaneously screen recording a non-headless Chromium instance. After it finishes, it OCRs the video frames and verifies the scanned timestamps against the actual data. This data measures (1) how long each update took from saving to disk up to the pixels visible on the screen and (2) what % of frames were rendered.
|
||||
|
||||
The intent is to be as accurate as possible. Measuring times reported client-side is simpler, but lower accuracy since those times may not correspond to pixels on the screen and do not start from when the data was written to disk (at best, they measure when the filesystem watcher detected the update, but often not that either). `color-looper.zig` must run separately from `browser.js` or the results will be innaccurate.
|
||||
|
||||
It works like this:
|
||||
|
||||
1. `browser.js` loads either bun or Next.js and a Chromium instance opened to the correct webpage
|
||||
2. `color-looper.zig` updates [`./src/colors.css`](./src/colors.css) in a loop up to `1024` times (1024 is arbitrary), sleeping every `16`ms or `32`ms (a CLI arg you can pass it). The `var(--timestamp)` CSS variable contains the UTC timestamp with precision of milliseconds and one extra decimal point
|
||||
3. `color-looper.zig` automatically records the screen via `screencapture` (builtin on macOS) and saves it, along with a `BigUint64Array` containing all the expected timestamps. When it's done, it writes to a designated file on disk which `browser.js` picks up as the signal to close the browser.
|
||||
4. `ffmpeg` converts each frame into a black and white `.tif` file, which `tesseract` then OCRs
|
||||
5. Various cleanup scripts extract the timestamp from each of those OCR'd frames into a single file
|
||||
6. Using the OCR'd data, `./read-frames.js` calculates the 50th, 75th, 90th, 95th, and 99th percentile frame time, along with how many frames were skipped. Frame time is the metric here that matters here because that's how much time elapsed between each update. It includes the artificial sleep interval, so it will not be faster than the sleep interval.
|
||||
|
||||
The script `run.sh` runs all the commands necessary to do this work unattended. It takes awhile though. The slow part is OCR'ing all the frames.
|
||||
|
||||
To run this, you need:
|
||||
|
||||
- `zig`
|
||||
- `bun-cli`
|
||||
- `node`
|
||||
- `tesseract`
|
||||
- `screencapture` (macOS builtin)
|
||||
- `ffmpeg`
|
||||
- `puppeteer` (from the package.json)
|
||||
|
||||
You will need to run `bun bun --use next` first, with `next@11.1.2`. It will only run on macOS due to the dependencies on `screencapture`, how it detects screen resolution (so that Chromium is maximized), and how it auto-focuses Chromium (apple script)
|
||||
118
bench/hot-module-reloading/css-stress-test/browser.js
Normal file
118
bench/hot-module-reloading/css-stress-test/browser.js
Normal file
@@ -0,0 +1,118 @@
|
||||
const puppeteer = require("puppeteer");
|
||||
const http = require("http");
|
||||
const path = require("path");
|
||||
const url = require("url");
|
||||
const fs = require("fs");
|
||||
const child_process = require("child_process");
|
||||
const serverURL = process.env.TEST_SERVER_URL || "http://localhost:8080";
|
||||
|
||||
if (process.env.PROJECT === "bun") {
|
||||
const bunFlags = [`--origin=${serverURL}`].filter(Boolean);
|
||||
const bunExec = process.env.BUN_BIN || "bun";
|
||||
const bunProcess = child_process.spawn(bunExec, bunFlags, {
|
||||
cwd: process.cwd(),
|
||||
stdio: "ignore",
|
||||
env: {
|
||||
...process.env,
|
||||
DISABLE_BUN_ANALYTICS: "1",
|
||||
},
|
||||
|
||||
shell: false,
|
||||
});
|
||||
console.log("$", bunExec, bunFlags.join(" "));
|
||||
const isDebug = bunExec.endsWith("-debug");
|
||||
|
||||
// bunProcess.stderr.pipe(process.stderr);
|
||||
// bunProcess.stdout.pipe(process.stdout);
|
||||
bunProcess.once("error", (err) => {
|
||||
console.error("❌ bun error", err);
|
||||
process.exit(1);
|
||||
});
|
||||
process.on("beforeExit", () => {
|
||||
bunProcess?.kill(0);
|
||||
});
|
||||
} else if (process.env.PROJECT === "next") {
|
||||
const bunProcess = child_process.spawn(
|
||||
"./node_modules/.bin/next",
|
||||
["--port", "8080"],
|
||||
{
|
||||
cwd: process.cwd(),
|
||||
stdio: "ignore",
|
||||
env: {
|
||||
...process.env,
|
||||
},
|
||||
|
||||
shell: false,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const delay = new Promise((resolve, reject) => {
|
||||
const watcher = fs.watch(path.resolve(process.cwd(), "src/colors.css.blob"));
|
||||
watcher.once("change", () => {
|
||||
setTimeout(() => {
|
||||
resolve();
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
|
||||
async function main() {
|
||||
const browser = await puppeteer.launch({
|
||||
headless: false,
|
||||
waitForInitialPage: true,
|
||||
args: [
|
||||
`--window-size=${parseInt(process.env.SCREEN_WIDTH || "1024", 10) / 2},${
|
||||
parseInt(process.env.SCREEN_HEIGHT || "1024", 10) / 2
|
||||
}`,
|
||||
],
|
||||
defaultViewport: {
|
||||
width: parseInt(process.env.SCREEN_WIDTH || "1024", 10) / 2,
|
||||
height: parseInt(process.env.SCREEN_HEIGHT || "1024", 10) / 2,
|
||||
},
|
||||
});
|
||||
const promises = [];
|
||||
let allTestsPassed = true;
|
||||
|
||||
async function runPage(key) {
|
||||
var page;
|
||||
|
||||
try {
|
||||
console.log("Opening page");
|
||||
page = await browser.newPage();
|
||||
|
||||
console.log(`Navigating to "http://localhost:8080/"`);
|
||||
|
||||
while (true) {
|
||||
try {
|
||||
await page.goto("http://localhost:8080/", { waitUntil: "load" });
|
||||
break;
|
||||
} catch (exception) {
|
||||
if (!exception.toString().includes("ERR_CONNECTION_REFUSED")) break;
|
||||
}
|
||||
}
|
||||
|
||||
await page.bringToFront();
|
||||
|
||||
await delay;
|
||||
|
||||
// runner.stdout.pipe(process.stdout);
|
||||
// runner.stderr.pipe(process.stderr);
|
||||
var didResolve = false;
|
||||
|
||||
console.log(`Completed. Done.`);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
await page.close();
|
||||
await browser.close();
|
||||
}
|
||||
}
|
||||
|
||||
return runPage();
|
||||
}
|
||||
|
||||
main().catch((error) =>
|
||||
setTimeout(() => {
|
||||
throw error;
|
||||
})
|
||||
);
|
||||
@@ -0,0 +1,11 @@
|
||||
SLEEP_INTERVAL=16 PROJECT=bun node read-frames.js
|
||||
bun
|
||||
--------------------------------------------------
|
||||
CSS HMR FRAME TIME
|
||||
|
||||
50th percentile: 22.2ms
|
||||
75th percentile: 23.9ms
|
||||
90th percentile: 25.3ms
|
||||
95th percentile: 43.6ms
|
||||
99th percentile: 49.1ms
|
||||
Rendered frames: 922 / 1024 (90%)
|
||||
@@ -0,0 +1,11 @@
|
||||
SLEEP_INTERVAL=24 PROJECT=bun node read-frames.js
|
||||
bun
|
||||
--------------------------------------------------
|
||||
CSS HMR FRAME TIME
|
||||
|
||||
50th percentile: 33.4ms
|
||||
75th percentile: 34.5ms
|
||||
90th percentile: 35.8ms
|
||||
95th percentile: 65.5ms
|
||||
99th percentile: 87.9ms
|
||||
Rendered frames: 937 / 1024 (92%)
|
||||
@@ -0,0 +1,11 @@
|
||||
SLEEP_INTERVAL=32 PROJECT=bun node read-frames.js
|
||||
bun
|
||||
--------------------------------------------------
|
||||
CSS HMR FRAME TIME
|
||||
|
||||
50th percentile: 40.7ms
|
||||
75th percentile: 42.3ms
|
||||
90th percentile: 43.5ms
|
||||
95th percentile: 76.4ms
|
||||
99th percentile: 118.8ms
|
||||
Rendered frames: 958 / 1024 (94%)
|
||||
@@ -0,0 +1,11 @@
|
||||
SLEEP_INTERVAL=8 PROJECT=bun node read-frames.js
|
||||
bun
|
||||
--------------------------------------------------
|
||||
CSS HMR FRAME TIME
|
||||
|
||||
50th percentile: 20ms
|
||||
75th percentile: 24.4ms
|
||||
90th percentile: 41ms
|
||||
95th percentile: 53.9ms
|
||||
99th percentile: 90.4ms
|
||||
Rendered frames: 475 / 1024 (46%)
|
||||
@@ -0,0 +1,218 @@
|
||||
const std = @import("std");
|
||||
|
||||
pub const Counter = extern struct {
|
||||
timestamp: usize,
|
||||
percent: f64,
|
||||
rotate: u32,
|
||||
color_values: [8 * 3]u32,
|
||||
};
|
||||
|
||||
const RUN_COUNT = 1024;
|
||||
|
||||
var counters: [RUN_COUNT]Counter = undefined;
|
||||
|
||||
pub const Blob = extern struct {
|
||||
run_count: u32,
|
||||
interval: u64,
|
||||
};
|
||||
|
||||
pub var all_timestamps: [RUN_COUNT + 1]usize = undefined;
|
||||
|
||||
// usage:
|
||||
// ./file-path:0 10
|
||||
// 1 2 3
|
||||
|
||||
// 1. file path
|
||||
// 2. Byte offset in file
|
||||
// 3. ms update interval
|
||||
var color_buf: [8096 + SIMULATE_LONG_FILE.len]u8 = undefined;
|
||||
|
||||
pub fn main() anyerror!void {
|
||||
var allocator = std.heap.c_allocator;
|
||||
var timer = try std.time.Timer.start();
|
||||
|
||||
var args = std.mem.span(try std.process.argsAlloc(allocator));
|
||||
|
||||
var basepath_with_colon: []u8 = args[args.len - 2];
|
||||
var basepath: []u8 = "";
|
||||
var position_str: []u8 = "";
|
||||
if (std.mem.lastIndexOfScalar(u8, basepath_with_colon, ':')) |colon| {
|
||||
basepath = basepath_with_colon[0..colon];
|
||||
position_str = basepath_with_colon[colon + 1 ..];
|
||||
}
|
||||
var position = try std.fmt.parseInt(u32, position_str, 10);
|
||||
const filepath = try std.fs.path.resolve(allocator, &.{basepath});
|
||||
var file = try std.fs.openFileAbsolute(filepath, .{ .write = true });
|
||||
var ms = @truncate(u64, (try std.fmt.parseInt(u128, args[args.len - 1], 10)) * std.time.ns_per_ms);
|
||||
std.debug.assert(ms > 0);
|
||||
// std.debug.assert(std.math.isFinite(position));
|
||||
var prng = std.rand.DefaultPrng.init(0);
|
||||
var stdout = std.io.getStdOut();
|
||||
var log = stdout.writer();
|
||||
var colors = std.mem.zeroes([4][3]u32);
|
||||
var progress_bar: f64 = 0.0;
|
||||
var destination_count: f64 = 18.0;
|
||||
|
||||
// Randomize initial colors
|
||||
colors[0][0] = prng.random.int(u32);
|
||||
colors[0][1] = prng.random.int(u32);
|
||||
colors[0][2] = prng.random.int(u32);
|
||||
|
||||
colors[1][0] = prng.random.int(u32);
|
||||
colors[1][1] = prng.random.int(u32);
|
||||
colors[1][2] = prng.random.int(u32);
|
||||
|
||||
colors[2][0] = prng.random.int(u32);
|
||||
colors[2][1] = prng.random.int(u32);
|
||||
colors[2][2] = prng.random.int(u32);
|
||||
|
||||
colors[3][0] = prng.random.int(u32);
|
||||
colors[3][1] = prng.random.int(u32);
|
||||
colors[3][2] = prng.random.int(u32);
|
||||
var rotate: u32 = 0;
|
||||
var counter: usize = 0;
|
||||
const video = std.fmt.allocPrint(allocator, "{s}.mov", .{filepath}) catch unreachable;
|
||||
std.fs.deleteFileAbsolute(video) catch {};
|
||||
var screen_recorder_argv = [_][]const u8{ "screencapture", "-v", video };
|
||||
|
||||
var recorder = try std.ChildProcess.init(&screen_recorder_argv, allocator);
|
||||
recorder.stdin_behavior = .Pipe;
|
||||
try recorder.spawn();
|
||||
std.time.sleep(std.time.ns_per_s);
|
||||
var wrote: []u8 = undefined;
|
||||
while (counter < RUN_COUNT) {
|
||||
colors[0][0] += 1;
|
||||
colors[0][1] += 1;
|
||||
colors[0][2] += 1;
|
||||
colors[1][0] += 1;
|
||||
colors[1][1] += 1;
|
||||
colors[1][2] += 1;
|
||||
colors[2][0] += 1;
|
||||
colors[2][1] += 1;
|
||||
colors[2][2] += 1;
|
||||
colors[3][0] += 1;
|
||||
colors[3][1] += 1;
|
||||
colors[3][2] += 1;
|
||||
rotate += 1;
|
||||
const fmtd: []const u8 = comptime brk: {
|
||||
break :brk (
|
||||
\\
|
||||
\\import {{ Global }} from "@emotion/react";
|
||||
\\export function CSSInJSStyles() {{
|
||||
\\ return (
|
||||
\\ <Global
|
||||
\\ styles={{`
|
||||
\\:root {{
|
||||
\\ --timestamp: "{d}";
|
||||
\\ --interval: "{s}";
|
||||
\\ --progress-bar: {d}%;
|
||||
\\ --spinner-1-muted: rgb({d}, {d}, {d});
|
||||
\\ --spinner-1-primary: rgb({d}, {d}, {d});
|
||||
\\ --spinner-2-muted: rgb({d}, {d}, {d});
|
||||
\\ --spinner-2-primary: rgb({d}, {d}, {d});
|
||||
\\ --spinner-3-muted: rgb({d}, {d}, {d});
|
||||
\\ --spinner-3-primary: rgb({d}, {d}, {d});
|
||||
\\ --spinner-4-muted: rgb({d}, {d}, {d});
|
||||
\\ --spinner-4-primary: rgb({d}, {d}, {d});
|
||||
\\ --spinner-rotate: {d}deg;
|
||||
\\}}
|
||||
++ SIMULATE_LONG_FILE ++
|
||||
\\ `}}
|
||||
\\ />
|
||||
\\ );
|
||||
\\}}
|
||||
\\
|
||||
);
|
||||
};
|
||||
|
||||
counters[counter].timestamp = @truncate(u64, @intCast(u128, std.time.nanoTimestamp()) / (std.time.ns_per_ms / 10));
|
||||
counters[counter].rotate = rotate % 360;
|
||||
counters[counter].percent = std.math.mod(f64, std.math.round(((progress_bar + 1.0) / destination_count) * 1000) / 1000, 100) catch 0;
|
||||
counters[counter].color_values[0] = @floatToInt(u32, std.math.round(@intToFloat(f64, ((colors[0][0] + 1) % 256)) * 0.8));
|
||||
counters[counter].color_values[1] = @floatToInt(u32, std.math.round(@intToFloat(f64, ((colors[0][1] + 1) % 256)) * 0.8));
|
||||
counters[counter].color_values[2] = @floatToInt(u32, std.math.round(@intToFloat(f64, ((colors[0][2] + 1) % 256)) * 0.8));
|
||||
counters[counter].color_values[3] = (colors[0][0] + 1) % 256;
|
||||
counters[counter].color_values[4] = (colors[0][1] + 1) % 256;
|
||||
counters[counter].color_values[5] = (colors[0][2] + 1) % 256;
|
||||
counters[counter].color_values[6] = @floatToInt(u32, std.math.round(@intToFloat(f64, ((colors[1][0] + 1) % 256)) * 0.8));
|
||||
counters[counter].color_values[7] = @floatToInt(u32, std.math.round(@intToFloat(f64, ((colors[1][1] + 1) % 256)) * 0.8));
|
||||
counters[counter].color_values[8] = @floatToInt(u32, std.math.round(@intToFloat(f64, ((colors[1][2] + 1) % 256)) * 0.8));
|
||||
counters[counter].color_values[9] = (colors[1][0] + 1) % 256;
|
||||
counters[counter].color_values[10] = (colors[1][1] + 1) % 256;
|
||||
counters[counter].color_values[11] = (colors[1][2] + 1) % 256;
|
||||
counters[counter].color_values[12] = @floatToInt(u32, std.math.round(@intToFloat(f64, ((colors[2][0] + 1) % 256)) * 0.8));
|
||||
counters[counter].color_values[13] = @floatToInt(u32, std.math.round(@intToFloat(f64, ((colors[2][1] + 1) % 256)) * 0.8));
|
||||
counters[counter].color_values[14] = @floatToInt(u32, std.math.round(@intToFloat(f64, ((colors[2][2] + 1) % 256)) * 0.8));
|
||||
counters[counter].color_values[15] = (colors[2][0] + 1) % 256;
|
||||
counters[counter].color_values[16] = (colors[2][1] + 1) % 256;
|
||||
counters[counter].color_values[17] = (colors[2][2] + 1) % 256;
|
||||
counters[counter].color_values[18] = @floatToInt(u32, std.math.round(@intToFloat(f64, ((colors[3][0] + 1) % 256)) * 0.8));
|
||||
counters[counter].color_values[19] = @floatToInt(u32, std.math.round(@intToFloat(f64, ((colors[3][1] + 1) % 256)) * 0.8));
|
||||
counters[counter].color_values[20] = @floatToInt(u32, std.math.round(@intToFloat(f64, ((colors[3][2] + 1) % 256)) * 0.8));
|
||||
counters[counter].color_values[21] = (colors[3][0] + 1) % 256;
|
||||
counters[counter].color_values[22] = (colors[3][1] + 1) % 256;
|
||||
counters[counter].color_values[23] = (colors[3][2] + 1) % 256;
|
||||
|
||||
file = try std.fs.createFileAbsolute(filepath, .{ .truncate = true });
|
||||
wrote = try std.fmt.bufPrint(&color_buf, fmtd, .{
|
||||
counters[counter].timestamp,
|
||||
args[args.len - 1],
|
||||
counters[counter].percent,
|
||||
counters[counter].color_values[0],
|
||||
counters[counter].color_values[1],
|
||||
counters[counter].color_values[2],
|
||||
counters[counter].color_values[3],
|
||||
counters[counter].color_values[4],
|
||||
counters[counter].color_values[5],
|
||||
counters[counter].color_values[6],
|
||||
counters[counter].color_values[7],
|
||||
counters[counter].color_values[8],
|
||||
counters[counter].color_values[9],
|
||||
counters[counter].color_values[10],
|
||||
counters[counter].color_values[11],
|
||||
counters[counter].color_values[12],
|
||||
counters[counter].color_values[13],
|
||||
counters[counter].color_values[14],
|
||||
counters[counter].color_values[15],
|
||||
counters[counter].color_values[16],
|
||||
counters[counter].color_values[17],
|
||||
counters[counter].color_values[18],
|
||||
counters[counter].color_values[19],
|
||||
counters[counter].color_values[20],
|
||||
counters[counter].color_values[21],
|
||||
counters[counter].color_values[22],
|
||||
counters[counter].color_values[23],
|
||||
counters[counter].rotate,
|
||||
});
|
||||
progress_bar += 1.0;
|
||||
_ = try file.writeAll(wrote);
|
||||
|
||||
try log.print("[{d}] \"{s}\":{d}\n", .{
|
||||
std.time.nanoTimestamp(),
|
||||
filepath,
|
||||
position,
|
||||
});
|
||||
counter += 1;
|
||||
// If we don't close the file, Parcel seems to never recognize it
|
||||
file.close();
|
||||
std.time.sleep(ms);
|
||||
}
|
||||
|
||||
try recorder.stdin.?.writeAll(&[_]u8{ 3, ';' });
|
||||
|
||||
_ = try recorder.wait();
|
||||
|
||||
all_timestamps[0] = wrote.len;
|
||||
for (counters) |count, i| {
|
||||
all_timestamps[i + 1] = count.timestamp;
|
||||
}
|
||||
|
||||
std.time.sleep(std.time.ns_per_s);
|
||||
var blob_file = try std.fs.createFileAbsolute(std.fmt.allocPrint(std.heap.c_allocator, "{s}.blob", .{filepath}) catch unreachable, .{ .truncate = true });
|
||||
try blob_file.writeAll(std.mem.asBytes(&all_timestamps));
|
||||
blob_file.close();
|
||||
}
|
||||
|
||||
const SIMULATE_LONG_FILE =
|
||||
\\
|
||||
;
|
||||
7194
bench/hot-module-reloading/css-stress-test/color-looper.zig
Normal file
7194
bench/hot-module-reloading/css-stress-test/color-looper.zig
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
experimental: {
|
||||
swcLoader: true,
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
SLEEP_INTERVAL=16 PROJECT=next node read-frames.js
|
||||
next
|
||||
--------------------------------------------------
|
||||
CSS HMR FRAME TIME
|
||||
|
||||
50th percentile: 312ms
|
||||
75th percentile: 337.6ms
|
||||
90th percentile: 387.7ms
|
||||
95th percentile: 446.9ms
|
||||
99th percentile: 591.7ms
|
||||
Rendered frames: 64 / 1024 (6%)
|
||||
@@ -0,0 +1,11 @@
|
||||
SLEEP_INTERVAL=24 PROJECT=next node read-frames.js
|
||||
next
|
||||
--------------------------------------------------
|
||||
CSS HMR FRAME TIME
|
||||
|
||||
50th percentile: 310.1ms
|
||||
75th percentile: 360.3ms
|
||||
90th percentile: 461.6ms
|
||||
95th percentile: 660.4ms
|
||||
99th percentile: 1009.9ms
|
||||
Rendered frames: 78 / 1024 (8%)
|
||||
@@ -0,0 +1,11 @@
|
||||
SLEEP_INTERVAL=32 PROJECT=next node read-frames.js
|
||||
next
|
||||
--------------------------------------------------
|
||||
CSS HMR FRAME TIME
|
||||
|
||||
50th percentile: 306.7ms
|
||||
75th percentile: 324.7ms
|
||||
90th percentile: 380ms
|
||||
95th percentile: 483.6ms
|
||||
99th percentile: 933.6ms
|
||||
Rendered frames: 116 / 1024 (11%)
|
||||
@@ -0,0 +1,11 @@
|
||||
SLEEP_INTERVAL=8 PROJECT=next node read-frames.js
|
||||
next
|
||||
--------------------------------------------------
|
||||
CSS HMR FRAME TIME
|
||||
|
||||
50th percentile: 320.4ms
|
||||
75th percentile: 368.8ms
|
||||
90th percentile: 527.2ms
|
||||
95th percentile: 532.4ms
|
||||
99th percentile: 532.4ms
|
||||
Rendered frames: 32 / 1024 (3%)
|
||||
@@ -3,13 +3,19 @@
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@emotion/css": "^11.1.3",
|
||||
"@emotion/core": "latest",
|
||||
"@emotion/css": "latest",
|
||||
"@emotion/react": "latest",
|
||||
"@vitejs/plugin-react-refresh": "^1.3.3",
|
||||
"antd": "^4.16.1",
|
||||
"bun-framework-next": "latest",
|
||||
"left-pad": "^1.3.0",
|
||||
"next": "^11.0.1",
|
||||
"next": "^12",
|
||||
"parcel": "2.0.0-beta.3",
|
||||
"path-browserify": "^1.0.1",
|
||||
"percentile": "^1.5.0",
|
||||
"puppeteer": "^10.4.0",
|
||||
"puppeteer-video-recorder": "^1.0.5",
|
||||
"react": "^17.0.2",
|
||||
"react-bootstrap": "^1.6.1",
|
||||
"react-dom": "^17.0.2",
|
||||
@@ -1,4 +1,4 @@
|
||||
// import "../src/index.css";
|
||||
import "../src/index.css";
|
||||
|
||||
import App from "next/app";
|
||||
|
||||
12
bench/hot-module-reloading/css-stress-test/pages/index.tsx
Normal file
12
bench/hot-module-reloading/css-stress-test/pages/index.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Main } from "src/main";
|
||||
export function IndexPage() {
|
||||
return (
|
||||
<Main
|
||||
productName={
|
||||
typeof location !== "undefined" ? location.search.substring(1) : ""
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default IndexPage;
|
||||
107
bench/hot-module-reloading/css-stress-test/read-frames.js
Normal file
107
bench/hot-module-reloading/css-stress-test/read-frames.js
Normal file
@@ -0,0 +1,107 @@
|
||||
const fs = require("fs");
|
||||
|
||||
const path = require("path");
|
||||
const PROJECT = process.env.PROJECT || "bun";
|
||||
const percentile = require("percentile");
|
||||
const PACKAGE_NAME = process.env.PACKAGE_NAME;
|
||||
const label = `${PACKAGE_NAME}@${
|
||||
require(PACKAGE_NAME + "/package.json").version
|
||||
}`;
|
||||
|
||||
const BASEFOLDER = path.resolve(PROJECT);
|
||||
const OUTFILE = path.join(process.cwd(), process.env.OUTFILE);
|
||||
|
||||
const buf = fs.readFileSync(BASEFOLDER + "/colors.css.blob");
|
||||
const VALID_TIMES = new BigUint64Array(buf.buffer).subarray(1);
|
||||
const cssFileSize = new BigUint64Array(buf.buffer)[0];
|
||||
|
||||
const TOTAL_FRAMES = VALID_TIMES.length;
|
||||
|
||||
const timings = fs
|
||||
.readFileSync(BASEFOLDER + "/frames.all.clean", "utf8")
|
||||
.split("\n")
|
||||
.map((a) => a.replace(/[Ran:'\.]?/gm, "").trim())
|
||||
.filter((a) => parseInt(a, 10))
|
||||
.filter((a) => a.length > 0 && VALID_TIMES.includes(BigInt(parseInt(a, 10))))
|
||||
.map((num) => BigInt(num));
|
||||
|
||||
timings.sort();
|
||||
|
||||
const frameTimesCount = timings.length;
|
||||
|
||||
var frameTime = new Array(Math.floor(frameTimesCount / 2));
|
||||
|
||||
for (let i = 0; i < frameTime.length; i++) {
|
||||
const i1 = i * 2;
|
||||
const i2 = i * 2 + 1;
|
||||
|
||||
frameTime[i] = Math.max(Number(timings[i2] - timings[i1]), 0);
|
||||
}
|
||||
|
||||
const report = {
|
||||
label,
|
||||
cssFileSize: Number(cssFileSize),
|
||||
at: new Date().toISOString(),
|
||||
sleep: process.env.SLEEP_INTERVAL,
|
||||
package: {
|
||||
name: PACKAGE_NAME,
|
||||
version: require(PACKAGE_NAME + "/package.json").version,
|
||||
},
|
||||
timestamps: timings.map((a) => Number(a)),
|
||||
frameTimes: frameTime,
|
||||
percentileMs: {
|
||||
50: percentile(50, frameTime) / 10,
|
||||
75: percentile(75, frameTime) / 10,
|
||||
90: percentile(90, frameTime) / 10,
|
||||
95: percentile(95, frameTime) / 10,
|
||||
99: percentile(99, frameTime) / 10,
|
||||
},
|
||||
};
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(
|
||||
path.dirname(OUTFILE),
|
||||
path.basename(OUTFILE) +
|
||||
"@" +
|
||||
report.package.version +
|
||||
"." +
|
||||
process.env.SLEEP_INTERVAL +
|
||||
"ms." +
|
||||
`${process.platform}-${
|
||||
process.arch === "arm64" ? "aarch64" : process.arch
|
||||
}` +
|
||||
".json"
|
||||
),
|
||||
JSON.stringify(report, null, 2)
|
||||
);
|
||||
|
||||
console.log(
|
||||
label + "\n",
|
||||
"-".repeat(50) + "\n",
|
||||
"CSS HMR FRAME TIME\n" + "\n",
|
||||
|
||||
"50th percentile:",
|
||||
percentile(50, frameTime) / 10 + "ms",
|
||||
"\n",
|
||||
"75th percentile:",
|
||||
percentile(75, frameTime) / 10 + "ms",
|
||||
"\n",
|
||||
"90th percentile:",
|
||||
percentile(90, frameTime) / 10 + "ms",
|
||||
"\n",
|
||||
"95th percentile:",
|
||||
percentile(95, frameTime) / 10 + "ms",
|
||||
"\n",
|
||||
"99th percentile:",
|
||||
percentile(99, frameTime) / 10 + "ms",
|
||||
"\n",
|
||||
"Rendered frames:",
|
||||
timings.length,
|
||||
"/",
|
||||
TOTAL_FRAMES,
|
||||
"(" +
|
||||
Math.round(
|
||||
Math.max(Math.min(1.0, timings.length / TOTAL_FRAMES), 0) * 100
|
||||
) +
|
||||
"%)"
|
||||
);
|
||||
83
bench/hot-module-reloading/css-stress-test/run.sh
Normal file
83
bench/hot-module-reloading/css-stress-test/run.sh
Normal file
@@ -0,0 +1,83 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Running next at 24ms"
|
||||
PROJECT=next SLEEP_INTERVAL=24 make generate &
|
||||
PROJECT=next SLEEP_INTERVAL=24 make loop
|
||||
killall Chromium || echo "";
|
||||
PROJECT=next SLEEP_INTERVAL=24 make process_video
|
||||
PROJECT=next SLEEP_INTERVAL=24 make frames -j$(nproc)
|
||||
PROJECT=next SLEEP_INTERVAL=24 make trim
|
||||
cp src/colors.css.blob next/colors.css.blob
|
||||
PROJECT=next SLEEP_INTERVAL=24 make print > "next.latest.24ms.txt"
|
||||
|
||||
echo "Running bun at 24ms"
|
||||
PROJECT=bun SLEEP_INTERVAL=24 make generate &
|
||||
PROJECT=bun SLEEP_INTERVAL=24 make loop
|
||||
killall Chromium || echo "";
|
||||
PROJECT=bun SLEEP_INTERVAL=24 make process_video
|
||||
PROJECT=bun SLEEP_INTERVAL=24 make frames -j$(nproc)
|
||||
PROJECT=bun SLEEP_INTERVAL=24 make trim
|
||||
cp src/colors.css.blob bun/colors.css.blob
|
||||
PROJECT=bun SLEEP_INTERVAL=24 make print > "bun.latest.24ms.txt"
|
||||
|
||||
echo "Running next at 16ms"
|
||||
PROJECT=next SLEEP_INTERVAL=16 make generate &
|
||||
PROJECT=next SLEEP_INTERVAL=16 make loop
|
||||
killall Chromium || echo "";
|
||||
PROJECT=next SLEEP_INTERVAL=16 make process_video
|
||||
PROJECT=next SLEEP_INTERVAL=16 make frames -j$(nproc)
|
||||
PROJECT=next SLEEP_INTERVAL=16 make trim
|
||||
cp src/colors.css.blob next/colors.css.blob
|
||||
PROJECT=next SLEEP_INTERVAL=16 make print > "next.latest.16ms.txt"
|
||||
|
||||
echo "Running bun at 16ms"
|
||||
PROJECT=bun SLEEP_INTERVAL=16 make generate &
|
||||
PROJECT=bun SLEEP_INTERVAL=16 make loop
|
||||
killall Chromium || echo "";
|
||||
PROJECT=bun SLEEP_INTERVAL=16 make process_video
|
||||
PROJECT=bun SLEEP_INTERVAL=16 make frames -j$(nproc)
|
||||
PROJECT=bun SLEEP_INTERVAL=16 make trim
|
||||
cp src/colors.css.blob bun/colors.css.blob
|
||||
PROJECT=bun SLEEP_INTERVAL=16 make print > "bun.latest.16ms.txt"
|
||||
|
||||
echo "Running bun at 8ms"
|
||||
PROJECT=bun SLEEP_INTERVAL=8 make generate &
|
||||
PROJECT=bun SLEEP_INTERVAL=8 make loop
|
||||
killall Chromium || echo "";
|
||||
PROJECT=bun SLEEP_INTERVAL=8 make process_video
|
||||
PROJECT=bun SLEEP_INTERVAL=8 make frames -j$(nproc)
|
||||
PROJECT=bun SLEEP_INTERVAL=8 make trim
|
||||
cp src/colors.css.blob bun/colors.css.blob
|
||||
PROJECT=bun SLEEP_INTERVAL=8 make print > "bun.latest.8ms.txt"
|
||||
|
||||
|
||||
echo "Running next at 8ms"
|
||||
PROJECT=next SLEEP_INTERVAL=8 make generate &
|
||||
PROJECT=next SLEEP_INTERVAL=8 make loop
|
||||
killall Chromium || echo "";
|
||||
PROJECT=next SLEEP_INTERVAL=8 make process_video
|
||||
PROJECT=next SLEEP_INTERVAL=8 make frames -j$(nproc)
|
||||
PROJECT=next SLEEP_INTERVAL=8 make trim
|
||||
cp src/colors.css.blob next/colors.css.blob
|
||||
PROJECT=next SLEEP_INTERVAL=8 make print > "next.latest.8ms.txt"
|
||||
|
||||
echo "Running bun at 32ms"
|
||||
PROJECT=bun SLEEP_INTERVAL=32 make generate &
|
||||
PROJECT=bun SLEEP_INTERVAL=32 make loop
|
||||
killall Chromium || echo "";
|
||||
PROJECT=bun SLEEP_INTERVAL=32 make process_video
|
||||
PROJECT=bun SLEEP_INTERVAL=32 make frames -j$(nproc)
|
||||
PROJECT=bun SLEEP_INTERVAL=32 make trim
|
||||
cp src/colors.css.blob bun/colors.css.blob
|
||||
PROJECT=bun SLEEP_INTERVAL=32 make print > "bun.latest.32ms.txt"
|
||||
|
||||
echo "Running next at 32ms"
|
||||
PROJECT=next SLEEP_INTERVAL=32 make generate &
|
||||
PROJECT=next SLEEP_INTERVAL=32 make loop
|
||||
killall Chromium || echo "";
|
||||
PROJECT=next SLEEP_INTERVAL=32 make process_video
|
||||
PROJECT=next SLEEP_INTERVAL=32 make frames -j$(nproc)
|
||||
PROJECT=next SLEEP_INTERVAL=32 make trim
|
||||
cp src/colors.css.blob next/colors.css.blob
|
||||
PROJECT=next SLEEP_INTERVAL=32 make print > "next.latest.32ms.txt"
|
||||
|
||||
14
bench/hot-module-reloading/css-stress-test/src/colors.css.0
Normal file
14
bench/hot-module-reloading/css-stress-test/src/colors.css.0
Normal file
@@ -0,0 +1,14 @@
|
||||
:root {
|
||||
--timestamp: "0";
|
||||
--interval: "8";
|
||||
--progress-bar: 0%;
|
||||
--spinner-1-muted: rgb(179, 6, 202);
|
||||
--spinner-1-primary: rgb(224, 8, 253);
|
||||
--spinner-2-muted: rgb(22, 188, 124);
|
||||
--spinner-2-primary: rgb(27, 235, 155);
|
||||
--spinner-3-muted: rgb(89, 72, 0);
|
||||
--spinner-3-primary: rgb(111, 90, 0);
|
||||
--spinner-4-muted: rgb(18, 84, 202);
|
||||
--spinner-4-primary: rgb(23, 105, 253);
|
||||
--spinner-rotate: 304deg;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { Global } from "@emotion/react";
|
||||
export function CSSInJSStyles() {
|
||||
return (
|
||||
<Global
|
||||
styles={`
|
||||
:root {
|
||||
--timestamp: "0";
|
||||
--interval: "8";
|
||||
--progress-bar: 11.83299999999997%;
|
||||
--spinner-1-muted: rgb(142, 6, 182);
|
||||
--spinner-1-primary: rgb(177, 8, 227);
|
||||
--spinner-2-muted: rgb(110, 148, 190);
|
||||
--spinner-2-primary: rgb(138, 185, 238);
|
||||
--spinner-3-muted: rgb(75, 45, 64);
|
||||
--spinner-3-primary: rgb(94, 56, 80);
|
||||
--spinner-4-muted: rgb(155, 129, 108);
|
||||
--spinner-4-primary: rgb(194, 161, 135);
|
||||
--spinner-rotate: 213deg;
|
||||
}
|
||||
`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
import { Global } from "@emotion/react";
|
||||
export function CSSInJSStyles() {
|
||||
return (
|
||||
<Global
|
||||
styles={`
|
||||
:root {
|
||||
--timestamp: "16336621338281";
|
||||
--interval: "16";
|
||||
--progress-bar: 56.889%;
|
||||
--spinner-1-muted: rgb(179, 6, 202);
|
||||
--spinner-1-primary: rgb(224, 8, 253);
|
||||
--spinner-2-muted: rgb(22, 188, 124);
|
||||
--spinner-2-primary: rgb(27, 235, 155);
|
||||
--spinner-3-muted: rgb(89, 72, 0);
|
||||
--spinner-3-primary: rgb(111, 90, 0);
|
||||
--spinner-4-muted: rgb(18, 84, 202);
|
||||
--spinner-4-primary: rgb(23, 105, 253);
|
||||
--spinner-rotate: 304deg;
|
||||
} `}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -112,15 +112,26 @@ section {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.ran,
|
||||
.timer {
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
font-weight: bold;
|
||||
-webkit-text-stroke: white;
|
||||
-webkit-text-stroke-width: 2px;
|
||||
color: white;
|
||||
font-size: 100px;
|
||||
}
|
||||
.ran {
|
||||
}
|
||||
|
||||
.ProgressBar-container {
|
||||
width: 100%;
|
||||
display: block;
|
||||
position: relative;
|
||||
border: 1px solid var(--color-brand-muted);
|
||||
border-left: 10px solid red;
|
||||
border-right: 10px solid pink;
|
||||
border-top: 10px solid yellow;
|
||||
border-bottom: 10px solid orange;
|
||||
border-radius: 4px;
|
||||
|
||||
height: 92px;
|
||||
@@ -7,7 +7,7 @@ const Base = ({}) => {
|
||||
typeof location !== "undefined"
|
||||
? decodeURIComponent(location.search.substring(1))
|
||||
: null;
|
||||
return <Main productName={name || "asdasdasdasdasdasd"} />;
|
||||
return <Main productName={name} />;
|
||||
};
|
||||
|
||||
function startReact() {
|
||||
@@ -1,17 +1,17 @@
|
||||
export const Main = ({ productName }) => {
|
||||
export const Main = ({ productName, cssInJS }) => {
|
||||
return (
|
||||
<>
|
||||
<header>
|
||||
<div className="Title">CSS HMR Stress Test!</div>
|
||||
<p className="Description">
|
||||
This page visually tests how quickly a bundler can update CSS over Hot
|
||||
Module Reloading.
|
||||
This page visually tests how quickly a bundler can update{" "}
|
||||
{cssInJS ? "CSS-in-JS" : "CSS"} over Hot Module Reloading.
|
||||
</p>
|
||||
</header>
|
||||
<main className="main">
|
||||
<section className="ProgressSection">
|
||||
<p className="Subtitle">
|
||||
<span className="Subtitle-part">
|
||||
<span className="Subtitle-part ran">
|
||||
Ran: <span className="timer"></span>
|
||||
</span>
|
||||
</p>
|
||||
@@ -55,10 +55,7 @@ export const Main = ({ productName }) => {
|
||||
<div className="Bundler-container">
|
||||
<div className="Bundler">{productName}</div>
|
||||
<div className="Bundler-updateRate">
|
||||
{/* This should loose all the styles
|
||||
<span className="highlight">
|
||||
<span className="interval"></span>ms
|
||||
</span> */}
|
||||
{cssInJS ? "CSS-in-JS framework: " + cssInJS : ""}
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
@@ -0,0 +1,292 @@
|
||||
{
|
||||
"label": "bun-cli@0.0.34",
|
||||
"at": "2021-10-08T01:01:18.129Z",
|
||||
"sleep": "32",
|
||||
"package": {
|
||||
"name": "bun-cli",
|
||||
"version": "0.0.34"
|
||||
},
|
||||
"timestamps": [
|
||||
16336202536562, 16336202536908, 16336202537294, 16336202537705,
|
||||
16336202538114, 16336202538534, 16336202538941, 16336202539323,
|
||||
16336202539742, 16336202540159, 16336202540877, 16336202541310,
|
||||
16336202541749, 16336202542159, 16336202542565, 16336202542996,
|
||||
16336202543333, 16336202543761, 16336202544159, 16336202544534,
|
||||
16336202544944, 16336202545345, 16336202545744, 16336202546159,
|
||||
16336202546573, 16336202546986, 16336202547399, 16336202547781,
|
||||
16336202548202, 16336202548564, 16336202548949, 16336202549329,
|
||||
16336202549762, 16336202550168, 16336202550534, 16336202550887,
|
||||
16336202551305, 16336202551659, 16336202552060, 16336202552449,
|
||||
16336202552854, 16336202553270, 16336202553609, 16336202554034,
|
||||
16336202554437, 16336202554783, 16336202555191, 16336202555623,
|
||||
16336202556034, 16336202556449, 16336202556890, 16336202557283,
|
||||
16336202557669, 16336202558084, 16336202558496, 16336202558863,
|
||||
16336202559271, 16336202559659, 16336202560051, 16336202560452,
|
||||
16336202560873, 16336202561290, 16336202561659, 16336202562035,
|
||||
16336202562440, 16336202562862, 16336202563284, 16336202563659,
|
||||
16336202564034, 16336202564444, 16336202564853, 16336202565245,
|
||||
16336202565659, 16336202566034, 16336202566455, 16336202566873,
|
||||
16336202567284, 16336202567659, 16336202568034, 16336202568386,
|
||||
16336202568790, 16336202569204, 16336202569620, 16336202570384,
|
||||
16336202570768, 16336202571188, 16336202571551, 16336202572327,
|
||||
16336202572717, 16336202573116, 16336202573541, 16336202573959,
|
||||
16336202574319, 16336202574682, 16336202575040, 16336202575375,
|
||||
16336202577001, 16336202577342, 16336202577680, 16336202578066,
|
||||
16336202578451, 16336202579166, 16336202579534, 16336202579960,
|
||||
16336202580370, 16336202580789, 16336202581159, 16336202581576,
|
||||
16336202581949, 16336202582294, 16336202583087, 16336202583496,
|
||||
16336202583858, 16336202584203, 16336202584606, 16336202585034,
|
||||
16336202585386, 16336202585788, 16336202586211, 16336202586604,
|
||||
16336202587034, 16336202587459, 16336202587869, 16336202588295,
|
||||
16336202588668, 16336202589092, 16336202589452, 16336202589831,
|
||||
16336202590197, 16336202590608, 16336202591034, 16336202591460,
|
||||
16336202591880, 16336202592295, 16336202592727, 16336202593172,
|
||||
16336202593567, 16336202593994, 16336202594397, 16336202594795,
|
||||
16336202595224, 16336202595659, 16336202596058, 16336202596463,
|
||||
16336202596890, 16336202597322, 16336202597732, 16336202598159,
|
||||
16336202598534, 16336202598951, 16336202599365, 16336202599785,
|
||||
16336202600159, 16336202600593, 16336202601005, 16336202601402,
|
||||
16336202601807, 16336202602214, 16336202602556, 16336202602895,
|
||||
16336202603307, 16336202603661, 16336202604075, 16336202604491,
|
||||
16336202604853, 16336202605268, 16336202605670, 16336202606034,
|
||||
16336202606393, 16336202606748, 16336202607170, 16336202607568,
|
||||
16336202607982, 16336202608411, 16336202608836, 16336202609197,
|
||||
16336202609596, 16336202609965, 16336202610333, 16336202610740,
|
||||
16336202611159, 16336202611573, 16336202611975, 16336202612317,
|
||||
16336202612691, 16336202613060, 16336202613474, 16336202613903,
|
||||
16336202614341, 16336202614707, 16336202615094, 16336202615534,
|
||||
16336202615883, 16336202616296, 16336202616671, 16336202617034,
|
||||
16336202617391, 16336202617727, 16336202618159, 16336202618534,
|
||||
16336202618937, 16336202619360, 16336202619770, 16336202620179,
|
||||
16336202620716, 16336202621143, 16336202621534, 16336202622303,
|
||||
16336202622659, 16336202623085, 16336202623498, 16336202623850,
|
||||
16336202624220, 16336202624606, 16336202625034, 16336202625387,
|
||||
16336202625805, 16336202626210, 16336202626599, 16336202627034,
|
||||
16336202627386, 16336202627748, 16336202628159, 16336202628534,
|
||||
16336202628954, 16336202629373, 16336202629809, 16336202630197,
|
||||
16336202630535, 16336202630916, 16336202631290, 16336202631666,
|
||||
16336202632034, 16336202632369, 16336202633152, 16336202633534,
|
||||
16336202633883, 16336202634309, 16336202634717, 16336202635106,
|
||||
16336202635871, 16336202636253, 16336202636671, 16336202637070,
|
||||
16336202637434, 16336202637798, 16336202638184, 16336202638539,
|
||||
16336202638938, 16336202639307, 16336202639666, 16336202640095,
|
||||
16336202640534, 16336202640962, 16336202641307, 16336202641659,
|
||||
16336202642087, 16336202642521, 16336202642886, 16336202643309,
|
||||
16336202643662, 16336202644067, 16336202644491, 16336202644853,
|
||||
16336202645226, 16336202645659, 16336202646074, 16336202646497,
|
||||
16336202646890, 16336202647311, 16336202647749, 16336202648169,
|
||||
16336202648976, 16336202649378, 16336202649810, 16336202650165,
|
||||
16336202650534, 16336202650875, 16336202651250, 16336202651659,
|
||||
16336202652093, 16336202652516, 16336202652921, 16336202653332,
|
||||
16336202653722, 16336202654142, 16336202654534, 16336202654880,
|
||||
16336202655221, 16336202655562, 16336202655997, 16336202656378,
|
||||
16336202656811, 16336202657161, 16336202657588, 16336202657944,
|
||||
16336202658360, 16336202658708, 16336202659089, 16336202659428,
|
||||
16336202659849, 16336202660273, 16336202660685, 16336202661105,
|
||||
16336202661534, 16336202661873, 16336202662228, 16336202662658,
|
||||
16336202663438, 16336202663843, 16336202664219, 16336202664646,
|
||||
16336202665050, 16336202665487, 16336202665838, 16336202666211,
|
||||
16336202666573, 16336202666927, 16336202667334, 16336202667746,
|
||||
16336202668158, 16336202668563, 16336202668980, 16336202669406,
|
||||
16336202669753, 16336202670192, 16336202670554, 16336202670903,
|
||||
16336202671324, 16336202671734, 16336202672159, 16336202672573,
|
||||
16336202672982, 16336202673346, 16336202673680, 16336202674087,
|
||||
16336202674499, 16336202674909, 16336202675260, 16336202676110,
|
||||
16336202676535, 16336202676913, 16336202677312, 16336202677658,
|
||||
16336202678044, 16336202678413, 16336202678793, 16336202679208,
|
||||
16336202679604, 16336202680034, 16336202680385, 16336202680799,
|
||||
16336202681213, 16336202681595, 16336202682004, 16336202682346,
|
||||
16336202682726, 16336202683158, 16336202683586, 16336202683990,
|
||||
16336202684323, 16336202684742, 16336202685175, 16336202685578,
|
||||
16336202685979, 16336202686805, 16336202687206, 16336202687614,
|
||||
16336202688038, 16336202688473, 16336202688848, 16336202689221,
|
||||
16336202689559, 16336202689971, 16336202690368, 16336202690776,
|
||||
16336202691159, 16336202691585, 16336202692010, 16336202692373,
|
||||
16336202692780, 16336202693179, 16336202693580, 16336202693991,
|
||||
16336202694324, 16336202694727, 16336202695159, 16336202695588,
|
||||
16336202695991, 16336202696335, 16336202697160, 16336202697542,
|
||||
16336202697929, 16336202698323, 16336202698674, 16336202699060,
|
||||
16336202699492, 16336202699835, 16336202700238, 16336202700658,
|
||||
16336202701059, 16336202701420, 16336202701815, 16336202702229,
|
||||
16336202702659, 16336202703857, 16336202704256, 16336202704659,
|
||||
16336202705497, 16336202706309, 16336202706660, 16336202707085,
|
||||
16336202707511, 16336202707866, 16336202708210, 16336202708552,
|
||||
16336202708925, 16336202709287, 16336202709670, 16336202710045,
|
||||
16336202710402, 16336202710802, 16336202711167, 16336202711533,
|
||||
16336202712249, 16336202712660, 16336202713088, 16336202713519,
|
||||
16336202713936, 16336202714355, 16336202714740, 16336202715160,
|
||||
16336202715533, 16336202715878, 16336202716290, 16336202716708,
|
||||
16336202717102, 16336202718290, 16336202718699, 16336202719052,
|
||||
16336202719388, 16336202719808, 16336202720225, 16336202720659,
|
||||
16336202721052, 16336202721414, 16336202721828, 16336202722925,
|
||||
16336202723664, 16336202724063, 16336202724405, 16336202726003,
|
||||
16336202726736, 16336202727158, 16336202727543, 16336202727930,
|
||||
16336202728336, 16336202728703, 16336202729061, 16336202729483,
|
||||
16336202729832, 16336202730222, 16336202730659, 16336202731084,
|
||||
16336202731500, 16336202731911, 16336202732326, 16336202733158,
|
||||
16336202733585, 16336202734001, 16336202734691, 16336202735042,
|
||||
16336202735442, 16336202735863, 16336202736255, 16336202736671,
|
||||
16336202737043, 16336202737884, 16336202738671, 16336202739110,
|
||||
16336202739533, 16336202739886, 16336202740283, 16336202740706,
|
||||
16336202741143, 16336202741534, 16336202741942, 16336202742352,
|
||||
16336202742697, 16336202743103, 16336202743940, 16336202745172,
|
||||
16336202745542, 16336202745937, 16336202746339, 16336202746758,
|
||||
16336202747531, 16336202747877, 16336202748232, 16336202748658,
|
||||
16336202749055, 16336202749468, 16336202749859, 16336202750416,
|
||||
16336202750839, 16336202751178, 16336202751572, 16336202752002,
|
||||
16336202752419, 16336202753269, 16336202753678, 16336202754086,
|
||||
16336202754432, 16336202754835, 16336202755260, 16336202755683,
|
||||
16336202756059, 16336202756402, 16336202756837, 16336202758084,
|
||||
16336202758507, 16336202758879, 16336202759270, 16336202759674,
|
||||
16336202760044, 16336202760400, 16336202760801, 16336202761659,
|
||||
16336202762053, 16336202762397, 16336202763199, 16336202763547,
|
||||
16336202763948, 16336202764714, 16336202765113, 16336202765947,
|
||||
16336202766329, 16336202766664, 16336202767085, 16336202768233,
|
||||
16336202769056, 16336202769758, 16336202770178, 16336202770585,
|
||||
16336202770929, 16336202771325, 16336202772158, 16336202772594,
|
||||
16336202773033, 16336202773403, 16336202773801, 16336202774179,
|
||||
16336202774555, 16336202774989, 16336202775393, 16336202775809,
|
||||
16336202776209, 16336202776618, 16336202777033, 16336202777421,
|
||||
16336202777845, 16336202778246, 16336202778658, 16336202779055,
|
||||
16336202779411, 16336202779761, 16336202780175, 16336202780594,
|
||||
16336202781002, 16336202781848, 16336202782658, 16336202783033,
|
||||
16336202783857, 16336202784211, 16336202784557, 16336202784972,
|
||||
16336202785377, 16336202785810, 16336202786172, 16336202786934,
|
||||
16336202787343, 16336202787765, 16336202788201, 16336202788563,
|
||||
16336202788970, 16336202789329, 16336202789672, 16336202790055,
|
||||
16336202790456, 16336202790802, 16336202791580, 16336202791920,
|
||||
16336202792326, 16336202793158, 16336202793953, 16336202794368,
|
||||
16336202795187, 16336202795622, 16336202796033, 16336202796393,
|
||||
16336202796777, 16336202797173, 16336202797540, 16336202797975,
|
||||
16336202798317, 16336202798739, 16336202799158, 16336202799567,
|
||||
16336202799966, 16336202800378, 16336202800803, 16336202801232,
|
||||
16336202801658, 16336202802033, 16336202802374, 16336202802759,
|
||||
16336202803158, 16336202803533, 16336202803947, 16336202804354,
|
||||
16336202804729, 16336202805158, 16336202805534, 16336202805950,
|
||||
16336202806390, 16336202806805, 16336202807219, 16336202807643,
|
||||
16336202808033, 16336202808377, 16336202808790, 16336202809211,
|
||||
16336202809560, 16336202809920, 16336202810355, 16336202810758,
|
||||
16336202811187, 16336202811596, 16336202811943, 16336202812348,
|
||||
16336202812710, 16336202813060, 16336202813398, 16336202813791,
|
||||
16336202814158, 16336202814533, 16336202814878, 16336202815246,
|
||||
16336202815658, 16336202816079, 16336202816851, 16336202817202,
|
||||
16336202817540, 16336202817905, 16336202818244, 16336202818663,
|
||||
16336202819068, 16336202819418, 16336202819777, 16336202820193,
|
||||
16336202820599, 16336202821033, 16336202821395, 16336202821745,
|
||||
16336202822158, 16336202822590, 16336202822996, 16336202823396,
|
||||
16336202823804, 16336202824210, 16336202824581, 16336202824991,
|
||||
16336202825406, 16336202825806, 16336202826210, 16336202826598,
|
||||
16336202827033, 16336202827446, 16336202827839, 16336202828201,
|
||||
16336202828577, 16336202828968, 16336202829362, 16336202829709,
|
||||
16336202830096, 16336202830533, 16336202830917, 16336202831290,
|
||||
16336202831699, 16336202832035, 16336202832406, 16336202832804,
|
||||
16336202833200, 16336202833604, 16336202834033, 16336202834386,
|
||||
16336202834759, 16336202835190, 16336202835621, 16336202836033,
|
||||
16336202836405, 16336202837191, 16336202837613, 16336202838033,
|
||||
16336202838374, 16336202838798, 16336202839200, 16336202839603,
|
||||
16336202840034, 16336202840389, 16336202840783, 16336202841200,
|
||||
16336202841617, 16336202842034, 16336202842390, 16336202842737,
|
||||
16336202843158, 16336202843585, 16336202843923, 16336202844313,
|
||||
16336202844724, 16336202845158, 16336202845576, 16336202845939,
|
||||
16336202846368, 16336202846728, 16336202847158, 16336202847568,
|
||||
16336202847911, 16336202848291, 16336202848695, 16336202849103,
|
||||
16336202849533, 16336202849942, 16336202850368, 16336202850747,
|
||||
16336202851158, 16336202851549, 16336202851978, 16336202852383,
|
||||
16336202852725, 16336202853158, 16336202853554, 16336202853961,
|
||||
16336202854308, 16336202854704, 16336202855060, 16336202855418,
|
||||
16336202855776, 16336202856203, 16336202856617, 16336202857036,
|
||||
16336202857455, 16336202857884, 16336202858262, 16336202858658,
|
||||
16336202859071, 16336202859847, 16336202860237, 16336202860658,
|
||||
16336202861037, 16336202861452, 16336202861869, 16336202862218,
|
||||
16336202862590, 16336202863001, 16336202863422, 16336202863857,
|
||||
16336202864219, 16336202864658, 16336202865047, 16336202865404,
|
||||
16336202865789, 16336202866210, 16336202866624, 16336202867033,
|
||||
16336202867380, 16336202867797, 16336202868227, 16336202868658,
|
||||
16336202869083, 16336202869500, 16336202869906, 16336202870246,
|
||||
16336202870658, 16336202871086, 16336202871441, 16336202871820,
|
||||
16336202872204, 16336202872546, 16336202872943, 16336202873380,
|
||||
16336202873811, 16336202874213, 16336202874566, 16336202874918,
|
||||
16336202875261, 16336202875655, 16336202876047, 16336202876771,
|
||||
16336202877202, 16336202877612, 16336202878033, 16336202878412,
|
||||
16336202878846, 16336202879241, 16336202879658, 16336202880072,
|
||||
16336202880508, 16336202880901, 16336202881308, 16336202881725,
|
||||
16336202882158, 16336202882579, 16336202882945, 16336202883286,
|
||||
16336202883657, 16336202884048, 16336202884404, 16336202884752,
|
||||
16336202885158, 16336202885533, 16336202885938, 16336202886364,
|
||||
16336202886759, 16336202887175, 16336202887585, 16336202887929,
|
||||
16336202888345, 16336202888743, 16336202889157, 16336202889570,
|
||||
16336202889970, 16336202890382, 16336202890761, 16336202891187,
|
||||
16336202891600, 16336202892033, 16336202892454, 16336202892794,
|
||||
16336202893178, 16336202893533, 16336202893903, 16336202894264,
|
||||
16336202894668, 16336202895049, 16336202895400, 16336202895774,
|
||||
16336202896157, 16336202896537, 16336202896883, 16336202897232,
|
||||
16336202897658, 16336202898065, 16336202898493, 16336202898884,
|
||||
16336202899251, 16336202899673, 16336202900047, 16336202900467,
|
||||
16336202900883, 16336202901300, 16336202901676, 16336202902068,
|
||||
16336202902479, 16336202902902, 16336202903260, 16336202903675,
|
||||
16336202904094, 16336202904476, 16336202904824, 16336202905158,
|
||||
16336202905533, 16336202905934, 16336202906289, 16336202906717,
|
||||
16336202907158, 16336202907547, 16336202907904, 16336202908294,
|
||||
16336202908717, 16336202909157, 16336202909582, 16336202910005,
|
||||
16336202910399, 16336202910800, 16336202911220, 16336202911657,
|
||||
16336202912064, 16336202912405, 16336202912779, 16336202913158,
|
||||
16336202913553, 16336202913966, 16336202914376, 16336202914719,
|
||||
16336202915091, 16336202915515, 16336202915887, 16336202916293,
|
||||
16336202916649, 16336202917438, 16336202917869, 16336202918221,
|
||||
16336202919053, 16336202919425, 16336202919833, 16336202920234,
|
||||
16336202920658, 16336202921033, 16336202921433, 16336202921801,
|
||||
16336202922161, 16336202922589, 16336202923017, 16336202923418,
|
||||
16336202923804, 16336202924199, 16336202924593, 16336202925033,
|
||||
16336202925449, 16336202925818, 16336202926223, 16336202926662,
|
||||
16336202927431, 16336202927812, 16336202928227, 16336202928658,
|
||||
16336202929061, 16336202929473, 16336202929891, 16336202930241,
|
||||
16336202930657, 16336202931057, 16336202931396, 16336202931811,
|
||||
16336202932225, 16336202932657, 16336202933058, 16336202933445,
|
||||
16336202933790, 16336202934157, 16336202934562, 16336202934988,
|
||||
16336202935391, 16336202935777, 16336202936160, 16336202936562,
|
||||
16336202936986, 16336202937396, 16336202937751, 16336202938158,
|
||||
16336202938578, 16336202938985, 16336202939396, 16336202939752,
|
||||
16336202940157, 16336202940585
|
||||
],
|
||||
"frameTimes": [
|
||||
346, 411, 420, 382, 417, 433, 410, 431, 428, 375, 401, 415, 413, 382, 362,
|
||||
380, 406, 353, 354, 389, 416, 425, 346, 432, 415, 393, 415, 367, 388, 401,
|
||||
417, 376, 422, 375, 410, 392, 375, 418, 375, 352, 414, 764, 420, 776, 399,
|
||||
418, 363, 335, 341, 386, 715, 426, 419, 417, 345, 409, 345, 428, 402, 393,
|
||||
425, 426, 424, 379, 411, 426, 415, 445, 427, 398, 435, 405, 432, 427, 417,
|
||||
420, 434, 397, 407, 339, 354, 416, 415, 364, 355, 398, 429, 361, 369, 407,
|
||||
414, 342, 369, 429, 366, 440, 413, 363, 336, 375, 423, 409, 427, 769, 426,
|
||||
352, 386, 353, 405, 435, 362, 375, 419, 388, 381, 376, 335, 382, 426, 389,
|
||||
382, 399, 364, 355, 369, 429, 428, 352, 434, 423, 405, 362, 433, 423, 421,
|
||||
420, 402, 355, 341, 409, 423, 411, 420, 346, 341, 381, 350, 356, 348, 339,
|
||||
424, 420, 339, 430, 405, 427, 437, 373, 354, 412, 405, 426, 439, 349, 410,
|
||||
414, 364, 407, 410, 850, 378, 346, 369, 415, 430, 414, 382, 342, 432, 404,
|
||||
419, 403, 826, 408, 435, 373, 412, 408, 426, 363, 399, 411, 403, 429, 344,
|
||||
382, 394, 386, 343, 420, 361, 414, 1198, 403, 812, 425, 355, 342, 362, 375,
|
||||
400, 366, 411, 431, 419, 420, 345, 418, 1188, 353, 420, 434, 362, 1097, 399,
|
||||
1598, 422, 387, 367, 422, 390, 425, 411, 832, 416, 351, 421, 416, 841, 439,
|
||||
353, 423, 391, 410, 406, 1232, 395, 419, 346, 426, 413, 557, 339, 430, 850,
|
||||
408, 403, 423, 343, 1247, 372, 404, 356, 858, 344, 348, 766, 834, 335, 1148,
|
||||
702, 407, 396, 436, 370, 378, 434, 416, 409, 388, 401, 397, 350, 419, 846,
|
||||
375, 354, 415, 433, 762, 422, 362, 359, 383, 346, 340, 832, 415, 435, 360,
|
||||
396, 435, 422, 409, 412, 429, 375, 385, 375, 407, 429, 416, 415, 424, 344,
|
||||
421, 360, 403, 409, 405, 350, 393, 375, 368, 421, 351, 365, 419, 350, 416,
|
||||
434, 350, 432, 400, 406, 410, 400, 388, 413, 362, 391, 347, 437, 373, 336,
|
||||
398, 404, 353, 431, 412, 786, 420, 424, 403, 355, 417, 417, 347, 427, 390,
|
||||
434, 363, 360, 410, 380, 408, 409, 379, 391, 405, 433, 407, 396, 358, 427,
|
||||
419, 429, 396, 776, 421, 415, 349, 411, 435, 439, 357, 421, 409, 417, 431,
|
||||
417, 340, 428, 379, 342, 437, 402, 352, 394, 724, 410, 379, 395, 414, 393,
|
||||
417, 421, 341, 391, 348, 375, 426, 416, 344, 398, 413, 412, 426, 433, 340,
|
||||
355, 361, 381, 374, 380, 349, 407, 391, 422, 420, 417, 392, 423, 415, 382,
|
||||
334, 401, 428, 389, 390, 440, 423, 401, 437, 341, 379, 413, 343, 424, 406,
|
||||
789, 352, 372, 401, 375, 368, 428, 401, 395, 440, 369, 439, 381, 431, 412,
|
||||
350, 400, 415, 432, 387, 367, 426, 386, 402, 410, 407, 407, 356, 428
|
||||
],
|
||||
"percentileMs": {
|
||||
"50": 40.7,
|
||||
"75": 42.3,
|
||||
"90": 43.5,
|
||||
"95": 76.4,
|
||||
"99": 118.8
|
||||
}
|
||||
}
|
||||
6
bench/hot-module-reloading/css-stress-test/tsconfig.json
Normal file
6
bench/hot-module-reloading/css-stress-test/tsconfig.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {}
|
||||
}
|
||||
}
|
||||
15
bench/hot-module-reloading/readme.md
Normal file
15
bench/hot-module-reloading/readme.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Benchmarking hot module reloading
|
||||
|
||||
## Methodology
|
||||
|
||||
How do you benchmark hot module reloading? What do you call "done" and what do you call "start"?
|
||||
|
||||
The answer for "done" is certainly not compilation time. Compilation time is one step.
|
||||
|
||||
I think the answer should be different depending on the type of content loaded.
|
||||
|
||||
For CSS, the answer should be "when the updated stylesheet was drawn on the screen"
|
||||
For JavaScript, the answer should be "when the rebuilt code completed execution such that any changes are applied"
|
||||
For images & assets, the answer should be "when the updated asset finished loading"
|
||||
|
||||
The start time should be defined as "the timestamp the filesystem set as the write time". As in, the time the developer pressed save in their editor.
|
||||
78
bench/snippets/callbacks-overhead.mjs
Normal file
78
bench/snippets/callbacks-overhead.mjs
Normal file
@@ -0,0 +1,78 @@
|
||||
const iterations = 1_000;
|
||||
|
||||
export var report = {
|
||||
async: 0,
|
||||
callback: 0,
|
||||
sync: 0,
|
||||
then: 0,
|
||||
};
|
||||
|
||||
const tests = {
|
||||
callback(n, cb) {
|
||||
if (n === iterations) return cb();
|
||||
tests.callback(1 + n, () => cb());
|
||||
},
|
||||
|
||||
sync(n) {
|
||||
if (n === iterations) return;
|
||||
|
||||
tests.sync(1 + n);
|
||||
},
|
||||
|
||||
async async(n) {
|
||||
if (n === iterations) return;
|
||||
|
||||
await tests.async(1 + n);
|
||||
},
|
||||
|
||||
then(n) {
|
||||
if (n === iterations) return;
|
||||
return Promise.resolve(1 + n).then(tests.then);
|
||||
},
|
||||
};
|
||||
|
||||
async function test(log) {
|
||||
{
|
||||
const a = performance.now();
|
||||
await tests.async(0);
|
||||
if (log)
|
||||
console.log(
|
||||
`async/await: ${(report.async = (performance.now() - a).toFixed(4))}ms`
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
const a = performance.now();
|
||||
tests.callback(0, function () {
|
||||
if (log)
|
||||
console.log(
|
||||
`callback: ${(report.callback = (performance.now() - a).toFixed(
|
||||
4
|
||||
))}ms`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
const a = performance.now();
|
||||
await tests.then(0);
|
||||
if (log)
|
||||
console.log(
|
||||
`then: ${(report.then = (performance.now() - a).toFixed(4))}ms`
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
const a = performance.now();
|
||||
tests.sync(0);
|
||||
if (log)
|
||||
console.log(
|
||||
`sync: ${(report.sync = (performance.now() - a).toFixed(4))}ms`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
let warmup = 10;
|
||||
while (warmup--) await test();
|
||||
|
||||
await test(true);
|
||||
5
bench/snippets/cat.mjs
Normal file
5
bench/snippets/cat.mjs
Normal file
@@ -0,0 +1,5 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
const count = parseInt(process.env.ITERATIONS || "1", 10) || 1;
|
||||
const arg = process.argv.slice(1);
|
||||
for (let i = 0; i < count; i++)
|
||||
console.log(arg.map((file) => readFileSync(file, "utf8")).join(""));
|
||||
3
bench/snippets/copyfile.mjs
Normal file
3
bench/snippets/copyfile.mjs
Normal file
@@ -0,0 +1,3 @@
|
||||
import { copyFileSync } from "node:fs";
|
||||
const arg = process.argv.slice(2);
|
||||
copyFileSync(arg[0], arg[1]);
|
||||
6
bench/snippets/exists.js
Normal file
6
bench/snippets/exists.js
Normal file
@@ -0,0 +1,6 @@
|
||||
const { existsSync } = require("fs");
|
||||
const cwd = process.cwd();
|
||||
|
||||
const count = parseInt(process.env.ITERATIONS || "1", 10) || 1;
|
||||
|
||||
for (let i = 0; i < count; i++) existsSync(cwd);
|
||||
29
bench/snippets/jsx-entity-decoding.jsx
Normal file
29
bench/snippets/jsx-entity-decoding.jsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import React from "react";
|
||||
|
||||
export default (
|
||||
<>
|
||||
‍‍‍‍‍‍&zwjϑ≅≅≅≅≅≅≅≅
|
||||
üüüüüüü£åååååååå
|
||||
óóóóóóóΠμμμμμμμμ
|
||||
♣♣♣♣♣♣&clubs⊕¢¢¢¢¢¢¢¢
|
||||
ÏÏÏÏÏÏÏ‌þþþþþþþþ
|
||||
………………&hellip°<<<<<<<<
|
||||
λλλλλλ&lambdaρ⇓⇓⇓⇓⇓⇓⇓⇓
|
||||
⇔⇔⇔⇔⇔⇔&hArrΤ≠≠≠≠≠≠≠≠
|
||||
ûûûûûûû•⊥⊥⊥⊥⊥⊥⊥⊥
|
||||
ôôôôôôô¶óóóóóóóó
|
||||
⊂⊂⊂⊂⊂⊂&subáíííííííí
|
||||
¸¸¸¸¸¸¸«§§§§§§§§
|
||||
¨¨¨¨¨¨¨ς""""""""
|
||||
ÔÔÔÔÔÔÔ∫¥¥¥¥¥¥¥¥
|
||||
ςςςςςς&sigmafΕ««««««««
|
||||
♦♦♦♦♦♦&diamsÓªªªªªªªª
|
||||
∞∞∞∞∞∞&infin⇔⋅⋅⋅⋅⋅⋅⋅⋅
|
||||
òòòòòòòý××××××××
|
||||
⌈⌈⌈⌈⌈⌈&lceilωßßßßßßßß
|
||||
≥≥≥≥≥≥&geßüüüüüüüü
|
||||
ρρρρρρ&rhoš∝∝∝∝∝∝∝∝
|
||||
◊◊◊◊◊◊&lozχ↵↵↵↵↵↵↵↵
|
||||
ÈÈÈÈÈÈÈ ÅÅÅÅÅÅÅÅ
|
||||
</>
|
||||
);
|
||||
12
bench/snippets/package.json
Normal file
12
bench/snippets/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "snippets",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.16.10",
|
||||
"@babel/preset-react": "^7.16.7",
|
||||
"@swc/core": "^1.2.133",
|
||||
"esbuild": "^0.14.12"
|
||||
}
|
||||
}
|
||||
4
bench/snippets/realpath.mjs
Normal file
4
bench/snippets/realpath.mjs
Normal file
@@ -0,0 +1,4 @@
|
||||
import { realpathSync } from "node:fs";
|
||||
const count = parseInt(process.env.ITERATIONS || "1", 10) || 1;
|
||||
const arg = process.argv[process.argv.length - 1];
|
||||
for (let i = 0; i < count; i++) realpathSync(arg);
|
||||
4
bench/snippets/render.js
Normal file
4
bench/snippets/render.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import decoding from "./jsx-entity-decoding";
|
||||
import ReactDOMServer from "react-dom/server.browser";
|
||||
|
||||
console.log(ReactDOMServer.renderToString(decoding));
|
||||
BIN
bench/snippets/scanner/bun.lockb
Executable file
BIN
bench/snippets/scanner/bun.lockb
Executable file
Binary file not shown.
6
bench/snippets/scanner/package.json
Normal file
6
bench/snippets/scanner/package.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "scan",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.14.11"
|
||||
}
|
||||
}
|
||||
15
bench/snippets/scanner/remix-route.ts
Normal file
15
bench/snippets/scanner/remix-route.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { useParams } from "remix";
|
||||
import type { LoaderFunction, ActionFunction } from "remix";
|
||||
|
||||
export const loader: LoaderFunction = async ({ params }) => {
|
||||
console.log(params.postId);
|
||||
};
|
||||
|
||||
export const action: ActionFunction = async ({ params }) => {
|
||||
console.log(params.postId);
|
||||
};
|
||||
|
||||
export default function PostRoute() {
|
||||
const params = useParams();
|
||||
console.log(params.postId);
|
||||
}
|
||||
15
bench/snippets/scanner/scan-imports-only.js
Normal file
15
bench/snippets/scanner/scan-imports-only.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { readFileSync } from "fs";
|
||||
const fixture = ["action", "default", "loader"];
|
||||
|
||||
const transpiler = new Bun.Transpiler({
|
||||
loader: "ts",
|
||||
});
|
||||
|
||||
console.time("Get exports");
|
||||
const ITERATIONS = parseInt(process.env.ITERATIONS || "1") || 1;
|
||||
for (let i = 0; i < ITERATIONS; i++) {
|
||||
const imports = transpiler.scanImports(
|
||||
readFileSync("remix-route.ts", "utf8")
|
||||
);
|
||||
}
|
||||
console.timeEnd("Get exports");
|
||||
21
bench/snippets/scanner/scan.bun.js
Normal file
21
bench/snippets/scanner/scan.bun.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { readFileSync } from "fs";
|
||||
const fixture = ["action", "default", "loader"];
|
||||
const ITERATIONS = parseInt(process.env.ITERATIONS || "1") || 1;
|
||||
|
||||
const transpiler = new Bun.Transpiler({
|
||||
loader: "ts",
|
||||
});
|
||||
|
||||
console.time("Get exports");
|
||||
const file = readFileSync("remix-route.ts", "utf8");
|
||||
for (let i = 0; i < ITERATIONS; i++) {
|
||||
const { imports, exports } = transpiler.scan(file);
|
||||
|
||||
for (let j = 0; j < fixture.length; j++) {
|
||||
if (fixture[j] !== exports[j]) {
|
||||
throw new Error("Mismatch");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.timeEnd("Get exports");
|
||||
42
bench/snippets/scanner/scan.node-esbuild.mjs
Normal file
42
bench/snippets/scanner/scan.node-esbuild.mjs
Normal file
@@ -0,0 +1,42 @@
|
||||
import { build, buildSync } from "esbuild";
|
||||
import { readFileSync } from "fs";
|
||||
const fixture = ["action", "default", "loader"];
|
||||
const ITERATIONS = parseInt(process.env.ITERATIONS || "1") || 1;
|
||||
|
||||
const opts = {
|
||||
metafile: true,
|
||||
format: "esm",
|
||||
platform: "neutral",
|
||||
write: false,
|
||||
logLevel: "silent",
|
||||
stdin: {
|
||||
contents: readFileSync("remix-route.ts", "utf8"),
|
||||
loader: "ts",
|
||||
sourcefile: "remix-route.js",
|
||||
},
|
||||
};
|
||||
|
||||
const getExports = ({ metafile }) => {
|
||||
for (let i = 0; i < fixture.length; i++) {
|
||||
if (fixture[i] !== metafile.outputs["stdin.js"].exports[i]) {
|
||||
throw new Error("Mismatch");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
console.time("Get exports");
|
||||
|
||||
if (!process.env.SYNC) {
|
||||
var promises = new Array(ITERATIONS);
|
||||
for (let i = 0; i < ITERATIONS; i++) {
|
||||
promises[i] = build(opts).then(getExports);
|
||||
}
|
||||
|
||||
await Promise.all(promises);
|
||||
} else {
|
||||
for (let i = 0; i < ITERATIONS; i++) {
|
||||
getExports(buildSync(opts));
|
||||
}
|
||||
}
|
||||
|
||||
console.timeEnd("Get exports");
|
||||
58
bench/snippets/transpiler.mjs
Normal file
58
bench/snippets/transpiler.mjs
Normal file
@@ -0,0 +1,58 @@
|
||||
import { readFileSync } from "fs";
|
||||
|
||||
var transformSync;
|
||||
var transform;
|
||||
var opts;
|
||||
if (process.isBun) {
|
||||
const transpiler = new Bun.Transpiler({ loader: "jsx" });
|
||||
transformSync = transpiler.transformSync.bind(transpiler);
|
||||
transform = transpiler.transform.bind(transpiler);
|
||||
opts = "jsx";
|
||||
} else if (process.env["esbuild"]) {
|
||||
try {
|
||||
const esbuild = await import("esbuild");
|
||||
transformSync = esbuild.transformSync;
|
||||
transform = esbuild.transform;
|
||||
opts = { loader: "jsx" };
|
||||
} catch (exception) {
|
||||
throw exception;
|
||||
}
|
||||
} else if (process.env["swc"]) {
|
||||
try {
|
||||
const swc = await import("@swc/core");
|
||||
transformSync = swc.transformSync;
|
||||
transform = swc.transform;
|
||||
opts = {
|
||||
sourceMaps: false,
|
||||
inlineSourcesContent: false,
|
||||
jsc: {
|
||||
target: "es2022",
|
||||
parser: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
} catch (exception) {
|
||||
throw exception;
|
||||
}
|
||||
} else if (process.env["babel"]) {
|
||||
try {
|
||||
const swc = await import("@babel/core");
|
||||
transformSync = swc.transformSync;
|
||||
transform = swc.transform;
|
||||
opts = {
|
||||
sourceMaps: false,
|
||||
presets: [(await import("@babel/preset-react")).default],
|
||||
};
|
||||
} catch (exception) {
|
||||
throw exception;
|
||||
}
|
||||
}
|
||||
|
||||
const code = readFileSync("src/test/fixtures/simple.jsx", "utf8");
|
||||
|
||||
if (process.env.ASYNC) {
|
||||
console.log(await transform(code, opts));
|
||||
} else {
|
||||
console.log(transformSync(code, opts));
|
||||
}
|
||||
758
build.zig
758
build.zig
@@ -1,50 +1,237 @@
|
||||
const std = @import("std");
|
||||
const resolve_path = @import("./src/resolver/resolve_path.zig");
|
||||
|
||||
fn pkgPath(comptime out: []const u8) std.build.FileSource {
|
||||
const outpath = comptime std.fs.path.dirname(@src().file).? ++ std.fs.path.sep_str ++ out;
|
||||
return .{ .path = outpath };
|
||||
}
|
||||
pub fn addPicoHTTP(step: *std.build.LibExeObjStep, comptime with_obj: bool) void {
|
||||
const picohttp = step.addPackage(.{
|
||||
.name = "picohttp",
|
||||
.path = .{ .path = "src/deps/picohttp.zig" },
|
||||
});
|
||||
|
||||
_ = step.addPackage(.{
|
||||
.name = "iguanaTLS",
|
||||
.path = .{ .path = "src/deps/iguanaTLS/src/main.zig" },
|
||||
});
|
||||
|
||||
step.addIncludeDir("src/deps");
|
||||
|
||||
if (with_obj) {
|
||||
step.addObjectFile("src/deps/picohttpparser.o");
|
||||
}
|
||||
|
||||
step.addIncludeDir("src/deps");
|
||||
|
||||
if (with_obj) {
|
||||
step.addObjectFile(panicIfNotFound("src/deps/picohttpparser.o"));
|
||||
step.addObjectFile(panicIfNotFound("src/deps/libssl.a"));
|
||||
step.addObjectFile(panicIfNotFound("src/deps/libcrypto.a"));
|
||||
}
|
||||
|
||||
// step.add("/Users/jarred/Code/WebKit/WebKitBuild/Release/lib/libWTF.a");
|
||||
|
||||
// ./Tools/Scripts/build-jsc --jsc-only --cmakeargs="-DENABLE_STATIC_JSC=ON"
|
||||
// set -gx ICU_INCLUDE_DIRS "/usr/local/opt/icu4c/include"
|
||||
// homebrew-provided icu4c
|
||||
}
|
||||
|
||||
const color_map = std.ComptimeStringMap([]const u8, .{
|
||||
&.{ "black", "30m" },
|
||||
&.{ "blue", "34m" },
|
||||
&.{ "b", "1m" },
|
||||
&.{ "d", "2m" },
|
||||
&.{ "cyan", "36m" },
|
||||
&.{ "green", "32m" },
|
||||
&.{ "magenta", "35m" },
|
||||
&.{ "red", "31m" },
|
||||
&.{ "white", "37m" },
|
||||
&.{ "yellow", "33m" },
|
||||
});
|
||||
|
||||
fn addInternalPackages(step: *std.build.LibExeObjStep, _: std.mem.Allocator, target: anytype) !void {
|
||||
var boringssl: std.build.Pkg = .{
|
||||
.name = "boringssl",
|
||||
.path = pkgPath("src/deps/boringssl.zig"),
|
||||
};
|
||||
|
||||
var datetime: std.build.Pkg = .{
|
||||
.name = "datetime",
|
||||
.path = pkgPath("src/deps/zig-datetime/src/datetime.zig"),
|
||||
};
|
||||
|
||||
var thread_pool: std.build.Pkg = .{
|
||||
.name = "thread_pool",
|
||||
.path = pkgPath("src/thread_pool.zig"),
|
||||
};
|
||||
|
||||
var crash_reporter: std.build.Pkg = .{
|
||||
.name = "crash_reporter",
|
||||
.path = pkgPath("src/deps/backtrace.zig"),
|
||||
};
|
||||
|
||||
var picohttp: std.build.Pkg = .{
|
||||
.name = "picohttp",
|
||||
.path = pkgPath("src/deps/picohttp.zig"),
|
||||
};
|
||||
|
||||
var io_darwin: std.build.Pkg = .{
|
||||
.name = "io",
|
||||
.path = pkgPath("src/io/io_darwin.zig"),
|
||||
};
|
||||
var io_linux: std.build.Pkg = .{
|
||||
.name = "io",
|
||||
.path = pkgPath("src/io/io_linux.zig"),
|
||||
};
|
||||
var io_stub: std.build.Pkg = .{
|
||||
.name = "io",
|
||||
.path = pkgPath("src/io/io_stub.zig"),
|
||||
};
|
||||
|
||||
var lol_html: std.build.Pkg = .{
|
||||
.name = "lolhtml",
|
||||
.path = pkgPath("src/deps/lol-html.zig"),
|
||||
};
|
||||
|
||||
var io = if (target.isDarwin())
|
||||
io_darwin
|
||||
else if (target.isLinux())
|
||||
io_linux
|
||||
else
|
||||
io_stub;
|
||||
|
||||
var strings: std.build.Pkg = .{
|
||||
.name = "strings",
|
||||
.path = pkgPath("src/string_immutable.zig"),
|
||||
};
|
||||
|
||||
var clap: std.build.Pkg = .{
|
||||
.name = "clap",
|
||||
.path = pkgPath("src/deps/zig-clap/clap.zig"),
|
||||
};
|
||||
|
||||
var http: std.build.Pkg = .{
|
||||
.name = "http",
|
||||
.path = pkgPath("src/http_client_async.zig"),
|
||||
};
|
||||
|
||||
var javascript_core_real: std.build.Pkg = .{
|
||||
.name = "javascript_core",
|
||||
.path = pkgPath("src/jsc.zig"),
|
||||
};
|
||||
|
||||
var javascript_core_stub: std.build.Pkg = .{
|
||||
.name = "javascript_core",
|
||||
.path = pkgPath("src/jsc_stub.zig"),
|
||||
};
|
||||
|
||||
var javascript_core = if (target.getOsTag() == .freestanding)
|
||||
javascript_core_stub
|
||||
else
|
||||
javascript_core_real;
|
||||
|
||||
var analytics: std.build.Pkg = .{
|
||||
.name = "analytics",
|
||||
.path = pkgPath("src/analytics.zig"),
|
||||
};
|
||||
|
||||
io.dependencies = &.{analytics};
|
||||
|
||||
javascript_core.dependencies = &.{ http, strings, picohttp, io };
|
||||
http.dependencies = &.{
|
||||
strings,
|
||||
picohttp,
|
||||
io,
|
||||
boringssl,
|
||||
thread_pool,
|
||||
};
|
||||
thread_pool.dependencies = &.{ io, http };
|
||||
http.dependencies = &.{
|
||||
strings,
|
||||
picohttp,
|
||||
io,
|
||||
boringssl,
|
||||
thread_pool,
|
||||
};
|
||||
thread_pool.dependencies = &.{ io, http };
|
||||
|
||||
thread_pool.dependencies = &.{
|
||||
io,
|
||||
http,
|
||||
};
|
||||
|
||||
step.addPackage(thread_pool);
|
||||
step.addPackage(picohttp);
|
||||
step.addPackage(io);
|
||||
step.addPackage(strings);
|
||||
step.addPackage(clap);
|
||||
step.addPackage(http);
|
||||
step.addPackage(boringssl);
|
||||
step.addPackage(javascript_core);
|
||||
step.addPackage(crash_reporter);
|
||||
step.addPackage(datetime);
|
||||
step.addPackage(lol_html);
|
||||
}
|
||||
var output_dir: []const u8 = "";
|
||||
fn panicIfNotFound(comptime filepath: []const u8) []const u8 {
|
||||
var file = std.fs.cwd().openFile(filepath, .{ .mode = .read_only }) catch |err| {
|
||||
std.debug.panic("error: {s} opening {s}. Please ensure you've downloaded git submodules, and ran `make vendor`, `make jsc`.", .{ filepath, @errorName(err) });
|
||||
};
|
||||
file.close();
|
||||
|
||||
return filepath;
|
||||
}
|
||||
|
||||
fn updateRuntime() anyerror!void {
|
||||
var runtime_out_file = try std.fs.cwd().openFile("src/runtime.out.js", .{ .mode = .read_only });
|
||||
const runtime_hash = std.hash.Wyhash.hash(
|
||||
0,
|
||||
try runtime_out_file.readToEndAlloc(std.heap.page_allocator, try runtime_out_file.getEndPos()),
|
||||
);
|
||||
const runtime_version_file = std.fs.cwd().createFile("src/runtime.version", .{ .truncate = true }) catch std.debug.panic("Failed to create src/runtime.version", .{});
|
||||
defer runtime_version_file.close();
|
||||
runtime_version_file.writer().print("{x}", .{runtime_hash}) catch unreachable;
|
||||
var fallback_out_file = try std.fs.cwd().openFile("src/fallback.out.js", .{ .mode = .read_only });
|
||||
const fallback_hash = std.hash.Wyhash.hash(
|
||||
0,
|
||||
try fallback_out_file.readToEndAlloc(std.heap.page_allocator, try fallback_out_file.getEndPos()),
|
||||
);
|
||||
|
||||
const fallback_version_file = std.fs.cwd().createFile("src/fallback.version", .{ .truncate = true }) catch std.debug.panic("Failed to create src/fallback.version", .{});
|
||||
|
||||
fallback_version_file.writer().print("{x}", .{fallback_hash}) catch unreachable;
|
||||
|
||||
fallback_version_file.close();
|
||||
}
|
||||
|
||||
var x64 = "x64";
|
||||
var mode: std.builtin.Mode = undefined;
|
||||
|
||||
const Builder = std.build.Builder;
|
||||
const CrossTarget = std.zig.CrossTarget;
|
||||
const Mode = std.builtin.Mode;
|
||||
const fs = std.fs;
|
||||
|
||||
pub fn build(b: *std.build.Builder) !void {
|
||||
// Standard target options allows the person running `zig build` to choose
|
||||
// what target to build for. Here we do not override the defaults, which
|
||||
// means any target is allowed, and the default is native. Other options
|
||||
// for restricting supported target set are available.
|
||||
const target = b.standardTargetOptions(.{});
|
||||
var target = b.standardTargetOptions(.{});
|
||||
// Standard release options allow the person running `zig build` to select
|
||||
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
|
||||
const mode = b.standardReleaseOptions();
|
||||
mode = b.standardReleaseOptions();
|
||||
|
||||
var cwd_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
|
||||
const cwd: []const u8 = b.pathFromRoot(".");
|
||||
var exe: *std.build.LibExeObjStep = undefined;
|
||||
var output_dir_buf = std.mem.zeroes([4096]u8);
|
||||
var bin_label = if (mode == std.builtin.Mode.Debug) "packages/debug-bun-cli-" else "packages/bun-cli-";
|
||||
var bin_label = if (mode == std.builtin.Mode.Debug) "packages/debug-bun-" else "packages/bun-";
|
||||
|
||||
var triplet_buf: [64]u8 = undefined;
|
||||
var os_tagname = @tagName(target.getOs().tag);
|
||||
|
||||
const arch: std.Target.Cpu.Arch = target.getCpuArch();
|
||||
|
||||
if (std.mem.eql(u8, os_tagname, "macos")) {
|
||||
os_tagname = "darwin";
|
||||
if (arch.isAARCH64()) {
|
||||
target.os_version_min = std.zig.CrossTarget.OsVersion{ .semver = .{ .major = 11, .minor = 0, .patch = 0 } };
|
||||
} else if (arch.isX86()) {
|
||||
target.os_version_min = std.zig.CrossTarget.OsVersion{ .semver = .{ .major = 10, .minor = 14, .patch = 0 } };
|
||||
}
|
||||
} else if (target.isLinux()) {
|
||||
target.setGnuLibCVersion(2, 27, 0);
|
||||
}
|
||||
|
||||
std.mem.copy(
|
||||
@@ -65,317 +252,312 @@ pub fn build(b: *std.build.Builder) !void {
|
||||
|
||||
var triplet = triplet_buf[0 .. osname.len + cpuArchName.len + 1];
|
||||
|
||||
const output_dir_base = try std.fmt.bufPrint(&output_dir_buf, "{s}{s}/bin", .{ bin_label, triplet });
|
||||
const output_dir = b.pathFromRoot(output_dir_base);
|
||||
const output_dir_base = try std.fmt.bufPrint(&output_dir_buf, "{s}{s}", .{ bin_label, triplet });
|
||||
output_dir = b.pathFromRoot(output_dir_base);
|
||||
const bun_executable_name = if (mode == std.builtin.Mode.Debug) "bun-debug" else "bun";
|
||||
|
||||
if (target.getOsTag() == .wasi) {
|
||||
exe.enable_wasmtime = true;
|
||||
exe = b.addExecutable(bun_executable_name, "src/main_wasi.zig");
|
||||
exe.linkage = .dynamic;
|
||||
exe.setOutputDir(output_dir);
|
||||
} else if (target.getCpuArch().isWasm()) {
|
||||
// exe = b.addExecutable(
|
||||
// "bun",
|
||||
// "src/main_wasm.zig",
|
||||
// );
|
||||
// exe.is_linking_libc = false;
|
||||
// exe.is_dynamic = true;
|
||||
var lib = b.addExecutable(bun_executable_name, "src/main_wasm.zig");
|
||||
lib.single_threaded = true;
|
||||
// exe.want_lto = true;
|
||||
// exe.linkLibrary(lib);
|
||||
|
||||
if (mode == std.builtin.Mode.Debug) {
|
||||
// exception_handling
|
||||
var features = target.getCpuFeatures();
|
||||
features.addFeature(2);
|
||||
target.updateCpuFeatures(&features);
|
||||
} else {
|
||||
// lib.strip = true;
|
||||
}
|
||||
|
||||
lib.setOutputDir(output_dir);
|
||||
lib.want_lto = true;
|
||||
b.install_path = lib.getOutputSource().getPath(b);
|
||||
|
||||
std.debug.print("Build: ./{s}\n", .{b.install_path});
|
||||
b.default_step.dependOn(&lib.step);
|
||||
b.verbose_link = true;
|
||||
lib.setTarget(target);
|
||||
lib.setBuildMode(mode);
|
||||
|
||||
std.fs.deleteTreeAbsolute(std.fs.path.join(b.allocator, &.{ cwd, lib.getOutputSource().getPath(b) }) catch unreachable) catch {};
|
||||
var install = b.getInstallStep();
|
||||
lib.strip = false;
|
||||
lib.install();
|
||||
|
||||
const run_cmd = lib.run();
|
||||
run_cmd.step.dependOn(b.getInstallStep());
|
||||
if (b.args) |args| {
|
||||
run_cmd.addArgs(args);
|
||||
}
|
||||
|
||||
const run_step = b.step("run", "Run the app");
|
||||
run_step.dependOn(&run_cmd.step);
|
||||
|
||||
return;
|
||||
} else {
|
||||
exe = b.addExecutable(bun_executable_name, "src/main.zig");
|
||||
}
|
||||
exe = b.addExecutable(bun_executable_name, if (target.getOsTag() == std.Target.Os.Tag.freestanding)
|
||||
"src/main_wasm.zig"
|
||||
else
|
||||
"src/main.zig");
|
||||
// exe.setLibCFile("libc.txt");
|
||||
exe.linkLibC();
|
||||
// exe.linkLibCpp();
|
||||
exe.addPackage(.{
|
||||
.name = "clap",
|
||||
.path = .{ .path = "src/deps/zig-clap/clap.zig" },
|
||||
});
|
||||
|
||||
exe.setOutputDir(output_dir);
|
||||
var cwd_dir = std.fs.cwd();
|
||||
if (std.builtin.is_test) {
|
||||
var walker = cwd_dir.walk(std.heap.c_allocator) catch unreachable;
|
||||
|
||||
while (walker.next() catch unreachable) |entry| {
|
||||
if (std.mem.endsWith(u8, entry.basename, "_test.zig")) {
|
||||
std.debug.print("[test] Added {s}", .{entry.basename});
|
||||
_ = b.addTest(entry.path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const runtime_hash = std.hash.Wyhash.hash(0, @embedFile("./src/runtime.out.js"));
|
||||
const runtime_version_file = std.fs.cwd().openFile("src/runtime.version", .{ .write = true }) catch unreachable;
|
||||
runtime_version_file.writer().print("{x}", .{runtime_hash}) catch unreachable;
|
||||
defer runtime_version_file.close();
|
||||
|
||||
const fallback_hash = std.hash.Wyhash.hash(0, @embedFile("./src/fallback.out.js"));
|
||||
const fallback_version_file = std.fs.cwd().openFile("src/fallback.version", .{ .write = true }) catch unreachable;
|
||||
fallback_version_file.writer().print("{x}", .{fallback_hash}) catch unreachable;
|
||||
defer fallback_version_file.close();
|
||||
updateRuntime() catch {};
|
||||
|
||||
exe.setTarget(target);
|
||||
exe.setBuildMode(mode);
|
||||
b.install_path = output_dir;
|
||||
|
||||
var javascript = b.addExecutable("spjs", "src/main_javascript.zig");
|
||||
var typings_exe = b.addExecutable("typescript-decls", "src/javascript/jsc/typescript.zig");
|
||||
javascript.setMainPkgPath(b.pathFromRoot("."));
|
||||
typings_exe.setMainPkgPath(b.pathFromRoot("."));
|
||||
exe.setMainPkgPath(b.pathFromRoot("."));
|
||||
var typings_exe = b.addExecutable("typescript-decls", "src/typegen.zig");
|
||||
|
||||
const min_version: std.builtin.Version = if (target.getOsTag() != .freestanding)
|
||||
target.getOsVersionMin().semver
|
||||
else .{ .major = 0, .minor = 0, .patch = 0 };
|
||||
|
||||
const max_version: std.builtin.Version = if (target.getOsTag() != .freestanding)
|
||||
target.getOsVersionMax().semver
|
||||
else .{ .major = 0, .minor = 0, .patch = 0 };
|
||||
|
||||
// exe.want_lto = true;
|
||||
if (!target.getCpuArch().isWasm()) {
|
||||
b.default_step.dependOn(&exe.step);
|
||||
defer b.default_step.dependOn(&b.addLog("Output: {s}/{s}\n", .{ output_dir, bun_executable_name }).step);
|
||||
defer b.default_step.dependOn(&b.addLog(
|
||||
"Build {s} v{} - v{}\n",
|
||||
.{
|
||||
triplet,
|
||||
min_version,
|
||||
max_version,
|
||||
},
|
||||
).step);
|
||||
|
||||
const bindings_dir = std.fs.path.join(
|
||||
b.allocator,
|
||||
&.{
|
||||
cwd,
|
||||
"src",
|
||||
"javascript",
|
||||
"jsc",
|
||||
"bindings-obj",
|
||||
},
|
||||
) catch unreachable;
|
||||
var obj_step = b.step("obj", "Build bun as a .o file");
|
||||
var obj = b.addObject(bun_executable_name, exe.root_src.?.path);
|
||||
|
||||
var bindings_dir_ = cwd_dir.openDir(bindings_dir, .{ .iterate = true }) catch unreachable;
|
||||
var bindings_walker = bindings_dir_.walk(b.allocator) catch unreachable;
|
||||
|
||||
var bindings_files = std.ArrayList([]const u8).init(b.allocator);
|
||||
|
||||
while (bindings_walker.next() catch unreachable) |entry| {
|
||||
if (std.mem.eql(u8, std.fs.path.extension(entry.basename), ".o")) {
|
||||
bindings_files.append(bindings_dir_.realpathAlloc(b.allocator, entry.path) catch unreachable) catch unreachable;
|
||||
}
|
||||
}
|
||||
|
||||
// // References:
|
||||
// // - https://github.com/mceSystems/node-jsc/blob/master/deps/jscshim/webkit.gyp
|
||||
// // - https://github.com/mceSystems/node-jsc/blob/master/deps/jscshim/docs/webkit_fork_and_compilation.md#webkit-port-and-compilation
|
||||
// const flags = [_][]const u8{
|
||||
// "-Isrc/JavaScript/jsc/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders",
|
||||
// "-Isrc/JavaScript/jsc/WebKit/WebKitBuild/Release/WTF/Headers",
|
||||
// "-Isrc/javascript/jsc/WebKit/WebKitBuild/Release/ICU/Headers",
|
||||
// "-DSTATICALLY_LINKED_WITH_JavaScriptCore=1",
|
||||
// "-DSTATICALLY_LINKED_WITH_WTF=1",
|
||||
// "-DBUILDING_WITH_CMAKE=1",
|
||||
// "-DNOMINMAX",
|
||||
// "-DENABLE_INSPECTOR_ALTERNATE_DISPATCHERS=0",
|
||||
// "-DBUILDING_JSCONLY__",
|
||||
// "-DASSERT_ENABLED=0", // missing symbol errors like this will happen "JSC::DFG::DoesGCCheck::verifyCanGC(JSC::VM&)"
|
||||
// "-Isrc/JavaScript/jsc/WebKit/WebKitBuild/Release/", // config.h,
|
||||
// "-Isrc/JavaScript/jsc/bindings/",
|
||||
// "-Isrc/javascript/jsc/WebKit/Source/bmalloc",
|
||||
// "-std=gnu++17",
|
||||
// if (target.getOsTag() == .macos) "-DUSE_FOUNDATION=1" else "",
|
||||
// if (target.getOsTag() == .macos) "-DUSE_CF_RETAIN_PTR=1" else "",
|
||||
// };
|
||||
const headers_step = b.step("headers", "JSC headers");
|
||||
var headers_exec: *std.build.LibExeObjStep = b.addExecutable("headers", "src/javascript/jsc/bindings/bindings-generator.zig");
|
||||
var headers_runner = headers_exec.run();
|
||||
headers_exec.setMainPkgPath(javascript.main_pkg_path.?);
|
||||
headers_step.dependOn(&headers_runner.step);
|
||||
var translate_c: *std.build.TranslateCStep = b.addTranslateC(.{ .path = b.pathFromRoot("src/javascript/jsc/bindings/headers.h") });
|
||||
translate_c.out_basename = "headers";
|
||||
translate_c.output_dir = b.pathFromRoot("src/javascript/jsc/bindings/");
|
||||
headers_step.dependOn(&translate_c.step);
|
||||
headers_zig_file = b.pathFromRoot("src/javascript/jsc/bindings/headers.zig");
|
||||
|
||||
original_make_fn = headers_step.makeFn;
|
||||
headers_step.makeFn = HeadersMaker.make;
|
||||
b.default_step.dependOn(&exe.step);
|
||||
var steps = [_]*std.build.LibExeObjStep{ exe, javascript, typings_exe, headers_exec };
|
||||
|
||||
// const single_threaded = b.option(bool, "single-threaded", "Build single-threaded") orelse false;
|
||||
|
||||
for (steps) |step, i| {
|
||||
step.linkLibC();
|
||||
step.linkLibCpp();
|
||||
addPicoHTTP(
|
||||
step,
|
||||
true,
|
||||
);
|
||||
|
||||
step.addObjectFile("src/deps/libJavaScriptCore.a");
|
||||
step.addObjectFile("src/deps/libWTF.a");
|
||||
step.addObjectFile("src/deps/libbmalloc.a");
|
||||
|
||||
step.addObjectFile("src/deps/mimalloc/libmimalloc.a");
|
||||
step.addLibPath("src/deps/mimalloc");
|
||||
step.addIncludeDir("src/deps/mimalloc");
|
||||
|
||||
// step.single_threaded = single_threaded;
|
||||
|
||||
if (target.getOsTag() == .macos) {
|
||||
const homebrew_prefix = comptime if (std.Target.current.cpu.arch == .aarch64)
|
||||
"/opt/homebrew/"
|
||||
else
|
||||
"/usr/local/";
|
||||
|
||||
// We must link ICU statically
|
||||
step.addObjectFile(homebrew_prefix ++ "opt/icu4c/lib/libicudata.a");
|
||||
step.addObjectFile(homebrew_prefix ++ "opt/icu4c/lib/libicui18n.a");
|
||||
step.addObjectFile(homebrew_prefix ++ "opt/icu4c/lib/libicuuc.a");
|
||||
// icucore is a weird macOS only library
|
||||
step.linkSystemLibrary("icucore");
|
||||
step.addLibPath(homebrew_prefix ++ "opt/icu4c/lib");
|
||||
step.addIncludeDir(homebrew_prefix ++ "opt/icu4c/include");
|
||||
}
|
||||
|
||||
for (bindings_files.items) |binding| {
|
||||
step.addObjectFile(
|
||||
binding,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
var obj_step = b.step("obj", "Build Bun as a .o file");
|
||||
var obj = b.addObject(bun_executable_name, exe.root_src.?.path);
|
||||
obj.bundle_compiler_rt = true;
|
||||
{
|
||||
obj.setTarget(target);
|
||||
addPicoHTTP(obj, false);
|
||||
obj.addPackage(.{
|
||||
.name = "clap",
|
||||
.path = .{ .path = "src/deps/zig-clap/clap.zig" },
|
||||
});
|
||||
obj.setMainPkgPath(b.pathFromRoot("."));
|
||||
|
||||
var opts = b.addOptions();
|
||||
opts.addOption(
|
||||
bool,
|
||||
"bindgen",
|
||||
false,
|
||||
);
|
||||
obj.addOptions("build_options", opts);
|
||||
|
||||
try addInternalPackages(
|
||||
obj,
|
||||
b.allocator,
|
||||
target,
|
||||
);
|
||||
|
||||
{
|
||||
obj_step.dependOn(&b.addLog(
|
||||
"Build {s} v{} - v{}\n",
|
||||
.{
|
||||
triplet,
|
||||
min_version,
|
||||
max_version,
|
||||
},
|
||||
).step);
|
||||
}
|
||||
|
||||
obj_step.dependOn(&obj.step);
|
||||
|
||||
obj.setOutputDir(output_dir);
|
||||
obj.setBuildMode(mode);
|
||||
obj.setTarget(target);
|
||||
} else {
|
||||
b.default_step.dependOn(&exe.step);
|
||||
obj.linkLibC();
|
||||
if (mode == std.builtin.Mode.Debug)
|
||||
obj.emit_llvm_ir = .{
|
||||
.emit_to = try std.fmt.allocPrint(b.allocator, "{s}/{s}.ll", .{ output_dir, bun_executable_name }),
|
||||
};
|
||||
|
||||
obj.strip = false;
|
||||
obj.bundle_compiler_rt = true;
|
||||
obj.omit_frame_pointer = false;
|
||||
|
||||
b.default_step.dependOn(&obj.step);
|
||||
|
||||
if (target.getOsTag() == .linux) {
|
||||
// obj.want_lto = tar;
|
||||
obj.link_emit_relocs = true;
|
||||
obj.link_eh_frame_hdr = true;
|
||||
obj.link_function_sections = true;
|
||||
}
|
||||
|
||||
var log_step = b.addLog("Destination: {s}/{s}\n", .{ output_dir, bun_executable_name });
|
||||
log_step.step.dependOn(&obj.step);
|
||||
}
|
||||
|
||||
javascript.strip = false;
|
||||
javascript.packages = std.ArrayList(std.build.Pkg).fromOwnedSlice(b.allocator, b.allocator.dupe(std.build.Pkg, exe.packages.items) catch unreachable);
|
||||
|
||||
javascript.setOutputDir(output_dir);
|
||||
javascript.setBuildMode(mode);
|
||||
|
||||
const run_cmd = exe.run();
|
||||
run_cmd.step.dependOn(b.getInstallStep());
|
||||
if (b.args) |args| {
|
||||
run_cmd.addArgs(args);
|
||||
{
|
||||
const headers_step = b.step("headers-obj", "Build JavaScriptCore headers");
|
||||
var headers_obj: *std.build.LibExeObjStep = b.addObject("headers", "src/bindgen.zig");
|
||||
defer headers_step.dependOn(&headers_obj.step);
|
||||
try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
|
||||
var opts = b.addOptions();
|
||||
opts.addOption(
|
||||
bool,
|
||||
"bindgen",
|
||||
true,
|
||||
);
|
||||
headers_obj.addOptions("build_options", opts);
|
||||
headers_obj.linkLibCpp();
|
||||
}
|
||||
|
||||
const run_step = b.step("run", "Run the app");
|
||||
run_step.dependOn(&run_cmd.step);
|
||||
{
|
||||
const wasm = b.step("bun-wasm", "Build WASM");
|
||||
var wasm_step: *std.build.LibExeObjStep = b.addStaticLibrary("bun-wasm", "src/main_wasm.zig");
|
||||
defer wasm.dependOn(&wasm_step.step);
|
||||
wasm_step.strip = false;
|
||||
// wasm_step.link_function_sections = true;
|
||||
// wasm_step.link_emit_relocs = true;
|
||||
// wasm_step.single_threaded = true;
|
||||
try configureObjectStep(b, wasm_step, target, obj.main_pkg_path.?);
|
||||
}
|
||||
|
||||
var log_step = b.addLog("Destination: {s}/{s}\n", .{ output_dir, bun_executable_name });
|
||||
log_step.step.dependOn(&exe.step);
|
||||
{
|
||||
const headers_step = b.step("httpbench-obj", "Build HTTPBench tool (object files)");
|
||||
var headers_obj: *std.build.LibExeObjStep = b.addObject("httpbench", "misctools/http_bench.zig");
|
||||
defer headers_step.dependOn(&headers_obj.step);
|
||||
try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
|
||||
}
|
||||
|
||||
{
|
||||
const headers_step = b.step("fetch-obj", "Build fetch (object files)");
|
||||
var headers_obj: *std.build.LibExeObjStep = b.addObject("fetch", "misctools/fetch.zig");
|
||||
defer headers_step.dependOn(&headers_obj.step);
|
||||
try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
|
||||
}
|
||||
|
||||
{
|
||||
const headers_step = b.step("string-bench", "Build string bench");
|
||||
var headers_obj: *std.build.LibExeObjStep = b.addExecutable("string-bench", "src/bench/string-handling.zig");
|
||||
defer headers_step.dependOn(&headers_obj.step);
|
||||
try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
|
||||
}
|
||||
|
||||
{
|
||||
const headers_step = b.step("vlq-bench", "Build vlq bench");
|
||||
var headers_obj: *std.build.LibExeObjStep = b.addExecutable("vlq-bench", "src/sourcemap/vlq_bench.zig");
|
||||
defer headers_step.dependOn(&headers_obj.step);
|
||||
try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
|
||||
}
|
||||
|
||||
{
|
||||
const headers_step = b.step("tgz-obj", "Build tgz (object files)");
|
||||
var headers_obj: *std.build.LibExeObjStep = b.addObject("tgz", "misctools/tgz.zig");
|
||||
defer headers_step.dependOn(&headers_obj.step);
|
||||
try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
|
||||
}
|
||||
|
||||
{
|
||||
const headers_step = b.step("test", "Build test");
|
||||
|
||||
var test_file = b.option([]const u8, "test-file", "Input file for test");
|
||||
var test_bin_ = b.option([]const u8, "test-bin", "Emit bin to");
|
||||
var test_filter = b.option([]const u8, "test-filter", "Filter for test");
|
||||
|
||||
var headers_obj: *std.build.LibExeObjStep = b.addTest(test_file orelse "src/main.zig");
|
||||
headers_obj.setFilter(test_filter);
|
||||
if (test_bin_) |test_bin| {
|
||||
headers_obj.name = std.fs.path.basename(test_bin);
|
||||
if (std.fs.path.dirname(test_bin)) |dir| headers_obj.setOutputDir(dir);
|
||||
}
|
||||
|
||||
try configureObjectStep(b, headers_obj, target, obj.main_pkg_path.?);
|
||||
try linkObjectFiles(b, headers_obj, target);
|
||||
{
|
||||
var before = b.addLog("\x1b[" ++ color_map.get("magenta").? ++ "\x1b[" ++ color_map.get("b").? ++ "[{s} tests]" ++ "\x1b[" ++ color_map.get("d").? ++ " ----\n\n" ++ "\x1b[0m", .{"bun"});
|
||||
var after = b.addLog("\x1b[" ++ color_map.get("d").? ++ "–––---\n\n" ++ "\x1b[0m", .{});
|
||||
headers_step.dependOn(&before.step);
|
||||
headers_step.dependOn(&headers_obj.step);
|
||||
headers_step.dependOn(&after.step);
|
||||
}
|
||||
|
||||
for (headers_obj.packages.items) |pkg_| {
|
||||
const pkg: std.build.Pkg = pkg_;
|
||||
if (std.mem.eql(u8, pkg.name, "clap")) continue;
|
||||
var test_ = b.addTestSource(pkg.path);
|
||||
|
||||
test_.setMainPkgPath(obj.main_pkg_path.?);
|
||||
test_.setTarget(target);
|
||||
try linkObjectFiles(b, test_, target);
|
||||
if (pkg.dependencies) |children| {
|
||||
test_.packages = std.ArrayList(std.build.Pkg).init(b.allocator);
|
||||
try test_.packages.appendSlice(children);
|
||||
}
|
||||
|
||||
var before = b.addLog("\x1b[" ++ color_map.get("magenta").? ++ "\x1b[" ++ color_map.get("b").? ++ "[{s} tests]" ++ "\x1b[" ++ color_map.get("d").? ++ " ----\n\n" ++ "\x1b[0m", .{pkg.name});
|
||||
var after = b.addLog("\x1b[" ++ color_map.get("d").? ++ "–––---\n\n" ++ "\x1b[0m", .{});
|
||||
headers_step.dependOn(&before.step);
|
||||
headers_step.dependOn(&test_.step);
|
||||
headers_step.dependOn(&after.step);
|
||||
}
|
||||
}
|
||||
|
||||
try configureObjectStep(b, typings_exe, target, obj.main_pkg_path.?);
|
||||
try linkObjectFiles(b, typings_exe, target);
|
||||
|
||||
var typings_cmd: *std.build.RunStep = typings_exe.run();
|
||||
typings_cmd.cwd = cwd;
|
||||
typings_cmd.addArg(cwd);
|
||||
typings_cmd.addArg("types");
|
||||
typings_cmd.step.dependOn(&typings_exe.step);
|
||||
|
||||
typings_exe.linkLibC();
|
||||
typings_exe.linkLibCpp();
|
||||
typings_exe.setMainPkgPath(cwd);
|
||||
if (target.getOsTag() == .macos) {
|
||||
typings_exe.linkSystemLibrary("icucore");
|
||||
typings_exe.linkSystemLibrary("iconv");
|
||||
typings_exe.addLibPath(
|
||||
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib",
|
||||
);
|
||||
}
|
||||
|
||||
var typings_step = b.step("types", "Build TypeScript types");
|
||||
typings_step.dependOn(&typings_cmd.step);
|
||||
|
||||
var javascript_cmd = b.step("spjs", "Build standalone JavaScript runtime. Must run \"make jsc\" first.");
|
||||
javascript_cmd.dependOn(&javascript.step);
|
||||
}
|
||||
|
||||
pub var original_make_fn: ?fn (step: *std.build.Step) anyerror!void = null;
|
||||
pub var headers_zig_file: ?[]const u8 = null;
|
||||
const HeadersMaker = struct {
|
||||
pub fn make(self: *std.build.Step) anyerror!void {
|
||||
try original_make_fn.?(self);
|
||||
var headers_zig: std.fs.File = try std.fs.openFileAbsolute(headers_zig_file.?, .{ .write = true });
|
||||
var contents = try headers_zig.readToEndAlloc(std.heap.page_allocator, headers_zig.getEndPos() catch unreachable);
|
||||
const last_extern_i = std.mem.lastIndexOf(u8, contents, "pub extern fn") orelse @panic("Expected contents");
|
||||
const last_newline = std.mem.indexOf(u8, contents[last_extern_i..], "\n") orelse @panic("Expected newline");
|
||||
const to_splice = "usingnamespace @import(\"./headers-replacements.zig\");\n";
|
||||
var new_contents = try std.heap.page_allocator.alloc(u8, contents.len + to_splice.len);
|
||||
std.mem.copy(u8, new_contents, to_splice);
|
||||
std.mem.copy(u8, new_contents[to_splice.len..], contents);
|
||||
var i: usize = to_splice.len;
|
||||
var remainder = new_contents[i..];
|
||||
while (remainder.len > 0) {
|
||||
i = std.mem.indexOf(u8, remainder, "\npub const struct_b") orelse break + "\npub const struct_b".len;
|
||||
var begin = remainder[i..];
|
||||
const end_line = std.mem.indexOf(u8, begin, "extern struct {") orelse break;
|
||||
const end_struct = std.mem.indexOf(u8, begin, "\n};\n") orelse break + "\n};\n".len;
|
||||
|
||||
std.mem.set(u8, begin[1 .. end_struct + 3], ' ');
|
||||
remainder = begin[end_struct..];
|
||||
// Due to limitations in std.build.Builder
|
||||
// we cannot use this with debugging
|
||||
// so I am leaving this here for now, with the eventual intent to switch to std.build.Builder
|
||||
// but it is dead code
|
||||
pub fn linkObjectFiles(b: *std.build.Builder, obj: *std.build.LibExeObjStep, target: anytype) !void {
|
||||
if (target.getOsTag() == .freestanding)
|
||||
return;
|
||||
var dirs_to_search = std.BoundedArray([]const u8, 32).init(0) catch unreachable;
|
||||
const arm_brew_prefix: []const u8 = "/opt/homebrew";
|
||||
const x86_brew_prefix: []const u8 = "/usr/local";
|
||||
try dirs_to_search.append(b.env_map.get("BUN_DEPS_OUT_DIR") orelse b.env_map.get("BUN_DEPS_DIR") orelse @as([]const u8, b.pathFromRoot("src/deps")));
|
||||
if (target.getOsTag() == .macos) {
|
||||
if (target.getCpuArch().isAARCH64()) {
|
||||
try dirs_to_search.append(comptime arm_brew_prefix ++ "/opt/icu4c/lib/");
|
||||
} else {
|
||||
try dirs_to_search.append(comptime x86_brew_prefix ++ "/opt/icu4c/lib/");
|
||||
}
|
||||
i = to_splice.len;
|
||||
remainder = new_contents[i..];
|
||||
while (remainder.len > 0) {
|
||||
i = std.mem.indexOf(u8, remainder, "\npub const struct_") orelse break + "\npub const struct_".len;
|
||||
var begin = remainder[i..];
|
||||
var end_struct = std.mem.indexOf(u8, begin, "opaque {};") orelse break;
|
||||
end_struct += std.mem.indexOf(u8, begin[end_struct..], "\n") orelse break;
|
||||
i = 0;
|
||||
|
||||
std.mem.set(u8, begin[1..end_struct], ' ');
|
||||
remainder = begin[end_struct..];
|
||||
}
|
||||
|
||||
const HARDCODE = [_][]const u8{
|
||||
"[*c][*c]JSC__Exception",
|
||||
"*?*JSC__Exception ",
|
||||
"[*c]?*c_void",
|
||||
"[*c]*c_void",
|
||||
};
|
||||
i = 0;
|
||||
while (i < HARDCODE.len) : (i += 2) {
|
||||
_ = std.mem.replace(u8, new_contents, HARDCODE[i], HARDCODE[i + 1], new_contents);
|
||||
}
|
||||
|
||||
const js_value_start = std.mem.indexOf(u8, new_contents, "pub const JSC__JSValue") orelse unreachable;
|
||||
const js_value_end = std.mem.indexOf(u8, new_contents[js_value_start..], "\n") orelse unreachable;
|
||||
std.mem.set(u8, new_contents[js_value_start..][0..js_value_end], ' ');
|
||||
|
||||
try headers_zig.seekTo(0);
|
||||
try headers_zig.writeAll(new_contents);
|
||||
try headers_zig.setEndPos(last_newline + last_extern_i + to_splice.len);
|
||||
}
|
||||
};
|
||||
|
||||
if (b.env_map.get("JSC_LIB")) |jsc| {
|
||||
try dirs_to_search.append(jsc);
|
||||
}
|
||||
|
||||
var added = std.AutoHashMap(u64, void).init(b.allocator);
|
||||
|
||||
const files_we_care_about = std.ComptimeStringMap([]const u8, .{
|
||||
.{ "libmimalloc.o", "libmimalloc.o" },
|
||||
.{ "libz.a", "libz.a" },
|
||||
.{ "libarchive.a", "libarchive.a" },
|
||||
.{ "libssl.a", "libssl.a" },
|
||||
.{ "picohttpparser.o", "picohttpparser.o" },
|
||||
.{ "libcrypto.boring.a", "libcrypto.boring.a" },
|
||||
.{ "libicuuc.a", "libicuuc.a" },
|
||||
.{ "libicudata.a", "libicudata.a" },
|
||||
.{ "libicui18n.a", "libicui18n.a" },
|
||||
.{ "libJavaScriptCore.a", "libJavaScriptCore.a" },
|
||||
.{ "libWTF.a", "libWTF.a" },
|
||||
.{ "libbmalloc.a", "libbmalloc.a" },
|
||||
.{ "libbacktrace.a", "libbacktrace.a" },
|
||||
.{ "liblolhtml.a", "liblolhtml.a" },
|
||||
});
|
||||
|
||||
for (dirs_to_search.slice()) |deps_path| {
|
||||
var deps_dir = std.fs.cwd().openDir(deps_path, .{ .iterate = true }) catch @panic("Failed to open dependencies directory");
|
||||
var iterator = deps_dir.iterate();
|
||||
obj.addIncludeDir(deps_path);
|
||||
obj.addLibPath(deps_path);
|
||||
|
||||
while (iterator.next() catch null) |entr| {
|
||||
const entry: std.fs.Dir.Entry = entr;
|
||||
if (files_we_care_about.get(entry.name)) |obj_name| {
|
||||
var has_added = try added.getOrPut(std.hash.Wyhash.hash(0, obj_name));
|
||||
if (!has_added.found_existing) {
|
||||
var paths = [_][]const u8{ deps_path, obj_name };
|
||||
obj.addObjectFile(try std.fs.path.join(b.allocator, &paths));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn configureObjectStep(_: *std.build.Builder, obj: *std.build.LibExeObjStep, target: anytype, main_pkg_path: []const u8) !void {
|
||||
obj.setMainPkgPath(main_pkg_path);
|
||||
|
||||
obj.setTarget(target);
|
||||
try addInternalPackages(obj, std.heap.page_allocator, target);
|
||||
if (target.getOsTag() != .freestanding)
|
||||
addPicoHTTP(obj, false);
|
||||
|
||||
obj.strip = false;
|
||||
obj.setOutputDir(output_dir);
|
||||
obj.setBuildMode(mode);
|
||||
if (target.getOsTag() != .freestanding) obj.linkLibC();
|
||||
if (target.getOsTag() != .freestanding) obj.bundle_compiler_rt = true;
|
||||
|
||||
if (target.getOsTag() == .linux) {
|
||||
// obj.want_lto = tar;
|
||||
obj.link_emit_relocs = true;
|
||||
obj.link_eh_frame_hdr = true;
|
||||
obj.link_function_sections = true;
|
||||
}
|
||||
}
|
||||
|
||||
8
completions/bun.bash
Normal file
8
completions/bun.bash
Normal file
@@ -0,0 +1,8 @@
|
||||
#/usr/bin/env bash
|
||||
|
||||
# This is not implemented yet.
|
||||
# But a PR implementing it would be very welcome!
|
||||
_bun_completions() {
|
||||
}
|
||||
|
||||
complete -F _bun_completions bun
|
||||
149
completions/bun.fish
Normal file
149
completions/bun.fish
Normal file
@@ -0,0 +1,149 @@
|
||||
# This is terribly complicated
|
||||
# It's because:
|
||||
# 1. bun run has to have dynamic completions
|
||||
# 2. there are global options
|
||||
# 3. bun {install add remove} gets special options
|
||||
# 4. I don't know how to write fish completions well
|
||||
# Contributions very welcome!!
|
||||
|
||||
function __fish__get_bun_bins
|
||||
string split ' ' (bun getcompletes b)
|
||||
end
|
||||
|
||||
function __fish__get_bun_scripts
|
||||
set -lx SHELL bash
|
||||
set -lx MAX_DESCRIPTION_LEN 40
|
||||
string trim (string split '\n' (string split '\t' (bun getcompletes z)))
|
||||
end
|
||||
|
||||
function __fish__get_bun_packages
|
||||
if test (commandline -ct) != ""
|
||||
set -lx SHELL fish
|
||||
string split ' ' (bun getcompletes a (commandline -ct))
|
||||
end
|
||||
end
|
||||
|
||||
function __history_completions
|
||||
set -l tokens (commandline --current-process --tokenize)
|
||||
history --prefix (commandline) | string replace -r \^$tokens[1]\\s\* "" | string replace -r \^$tokens[2]\\s\* "" | string split ' '
|
||||
end
|
||||
|
||||
function __fish__get_bun_bun_js_files
|
||||
string split ' ' (bun getcompletes j)
|
||||
end
|
||||
|
||||
function bun_fish_is_nth_token --description 'Test if current token is on Nth place' --argument-names n
|
||||
set -l tokens (commandline -poc)
|
||||
set -l tokens (string replace -r --filter '^([^-].*)' '$1' -- $tokens)
|
||||
test (count $tokens) -eq "$n"
|
||||
end
|
||||
|
||||
function __bun_command_count --argument-names n
|
||||
set -l cmds (commandline -poc)
|
||||
|
||||
test (count cmds) -eq "$n"
|
||||
end
|
||||
|
||||
function __bun_last_cmd --argument-names n
|
||||
set -l cmds (commandline -poc)
|
||||
|
||||
test "(cmds[-1])" = "$n"
|
||||
end
|
||||
|
||||
set -l bun_install_boolean_flags yarn production optional development no-save dry-run force no-cache silent verbose global
|
||||
set -l bun_install_boolean_flags_descriptions "Write a yarn.lock file (yarn v1)" "Don't install devDependencies" "Add dependency to optionalDependencies" "Add dependency to devDependencies" "Don't install devDependencies" "Don't install anything" "Always request the latest versions from the registry & reinstall all dependenices" "Ignore manifest cache entirely" "Don't output anything" "Excessively verbose logging" "Use global folder"
|
||||
|
||||
set -l bun_builtin_cmds dev create help bun upgrade discord run install remove add
|
||||
set -l bun_builtin_cmds_without_run dev create help bun upgrade discord install remove add
|
||||
set -l bun_builtin_cmds_without_bun dev create help upgrade run discord install remove add
|
||||
set -l bun_builtin_cmds_without_create dev help bun upgrade discord run install remove add
|
||||
set -l bun_builtin_cmds_without_install create dev help bun upgrade discord run remove add
|
||||
set -l bun_builtin_cmds_without_remove create dev help bun upgrade discord run install add
|
||||
set -l bun_builtin_cmds_without_add create dev help bun upgrade discord run remove install
|
||||
set -l bun_builtin_cmds_without_pm create dev help bun upgrade discord run
|
||||
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a '(__fish__get_bun_scripts)' -d 'script'
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run" -a '(__fish__get_bun_bins)' -d 'package bin'
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run" -a '(__fish__get_bun_scripts)' -d 'script'
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run" -a '(__fish__get_bun_bun_js_files)' -d 'Bun.js'
|
||||
complete -c bun \
|
||||
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __fish_use_subcommand" -a 'run' -f -d 'Run a script or bin'
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'u' -l 'origin' -r -d 'Server URL. Rewrites import paths'
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'p' -l 'port' -r -d 'Port number to start server from'
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'd' -l 'define' -r -d 'Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:\"development\"'
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'e' -l 'external' -r -d 'Exclude module from transpilation (can use * wildcards). ex: -e react'
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -l 'use' -r -d 'Use a framework (ex: next)'
|
||||
complete -c bun \
|
||||
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __fish_use_subcommand" -a 'dev' -d 'Start dev server'
|
||||
complete -c bun \
|
||||
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'create' -f -d 'Create a new project'
|
||||
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_create next react; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from create;" -a 'next' -d 'new Next.js project'
|
||||
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_create next react; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from create;" -a 'react' -d 'new React project'
|
||||
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a 'upgrade' -d 'Upgrade bun to the latest version' -x
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a '--help' -d 'See all commands and flags' -x
|
||||
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -l "version" -s "v" -a '--version' -d 'bun\'s version' -x
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a 'discord' -d 'Open bun\'s Discord server' -x
|
||||
|
||||
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_bun; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); __fish_use_subcommand" -a 'bun' -d 'Generate a new bundle'
|
||||
|
||||
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_bun; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from bun" -F -d 'Bundle this'
|
||||
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_create; and not __fish_seen_subcommand_from (__fish__get_bun_bins); and not __fish_seen_subcommand_from (__fish__get_bun_scripts); and __fish_seen_subcommand_from react; or __fish_seen_subcommand_from next" -F -d "Create in directory"
|
||||
|
||||
|
||||
|
||||
complete -c bun \
|
||||
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'install' -f -d 'Install packages from package.json'
|
||||
|
||||
complete -c bun \
|
||||
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'add' -F -d 'Add a package to package.json'
|
||||
|
||||
complete -c bun \
|
||||
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'remove' -F -d 'Remove a package from package.json'
|
||||
|
||||
complete -c bun \
|
||||
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand add remove" -F
|
||||
|
||||
|
||||
for i in (seq (count $bun_install_boolean_flags))
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;" -l "$bun_install_boolean_flags[$i]" -d "$bun_install_boolean_flags_descriptions[$i]"
|
||||
end
|
||||
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;" -l 'cwd' -d 'Change working directory'
|
||||
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;" -l 'cache-dir' -d 'Choose a cache directory (default: $HOME/.bun/install/cache)'
|
||||
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from add;" -d 'Popular' -a '(__fish__get_bun_packages)'
|
||||
|
||||
complete -c bun \
|
||||
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from add;" -d 'History' -a '(__history_completions)'
|
||||
|
||||
complete -c bun --no-files
|
||||
562
completions/bun.zsh
Normal file
562
completions/bun.zsh
Normal file
@@ -0,0 +1,562 @@
|
||||
_bun() {
|
||||
local program=bun
|
||||
typeset -A opt_args
|
||||
local curcontext="$curcontext" state line context
|
||||
|
||||
# ---- Command:
|
||||
_arguments -s \
|
||||
'1: :->cmd' \
|
||||
'*: :->args' &&
|
||||
ret=0
|
||||
|
||||
case $state in
|
||||
cmd)
|
||||
local -a scripts_list
|
||||
IFS=$'\n' scripts_list=($(SHELL=zsh bun getcompletes i))
|
||||
compadd $scripts_list && ret=0
|
||||
|
||||
main_commands=('add\:"Add a dependency to package.json" bun\:"Generate a bundle" create\:"Create a new project" dev\:"Start a dev server" help\:"Show command help" install\:"Install packages from package.json" remove\:"Remove a dependency from package.json" run\:"Run a script or package bin" upgrade\:"Upgrade to the latest version of bun"')
|
||||
main_commands=($main_commands)
|
||||
_alternative "args:bun:(($main_commands))"
|
||||
;;
|
||||
args)
|
||||
case $line[1] in
|
||||
add)
|
||||
|
||||
# ---- Command: add
|
||||
_arguments -s -C \
|
||||
'1: :->cmd1' \
|
||||
'*: :->package' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' \
|
||||
'--registry[Change default registry (default: \$BUN_CONFIG_REGISTRY || \$npm_config_registry)]:registry' \
|
||||
'--token[Authentication token used for npm registry requests (default: \$npm_config_token)]:token' \
|
||||
'-y[Write a yarn.lock file (yarn v1)]' \
|
||||
'--yarn[Write a yarn.lock file (yarn v1)]' \
|
||||
'-g[Add a package globally]' \
|
||||
'--global[Add a package globally]' \
|
||||
'--production[Don'"'"'t install devDependencies]' \
|
||||
'--optional[Add dependency to optionalDependencies]' \
|
||||
'--development[Add dependency to devDependencies]' \
|
||||
'-d[Add dependency to devDependencies]' \
|
||||
'-p[Don'"'"'t install devDependencies]' \
|
||||
'--no-save[]' \
|
||||
'--dry-run[Don'"'"'t install anything]' \
|
||||
'--force[Always request the latest versions from the registry & reinstall all dependenices]' \
|
||||
'--lockfile[Store & load a lockfile at a specific filepath]:lockfile' \
|
||||
'--cache-dir[Store & load cached data from a specific directory path]:cache-dir' \
|
||||
'--no-cache[Ignore manifest cache entirely]' \
|
||||
'--silent[Don'"'"'t output anything]' \
|
||||
'--verbose[Excessively verbose logging]' \
|
||||
'--cwd[Set a specific cwd]:cwd' \
|
||||
'--backend[Platform-specific optimizations for installing dependencies]:backend:("clonefile" "copyfile" "hardlink" "clonefile_each_dir")' \
|
||||
'--link-native-bins[Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo]:link-native-bins' &&
|
||||
ret=0
|
||||
|
||||
case $state in
|
||||
package)
|
||||
_bun_add_param_package_completion
|
||||
;;
|
||||
esac
|
||||
|
||||
;;
|
||||
bun)
|
||||
|
||||
# ---- Command: bun
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'*: :->file' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' \
|
||||
'--use[Use a framework, e.g. "next"]:use' &&
|
||||
ret=0
|
||||
|
||||
case $state in
|
||||
file)
|
||||
_files
|
||||
;;
|
||||
esac
|
||||
|
||||
;;
|
||||
create)
|
||||
|
||||
# ---- Command: create
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'2: :->cmd2' \
|
||||
'*: :->args' &&
|
||||
ret=0
|
||||
|
||||
case $state in
|
||||
cmd2)
|
||||
_alternative 'args:create:((next\:"Next.js app" react\:"React app"))'
|
||||
;;
|
||||
|
||||
args)
|
||||
case $line[2] in
|
||||
next)
|
||||
|
||||
# ---- Command: create next
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'2: :->cmd2' \
|
||||
'3: :->file' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' &&
|
||||
ret=0
|
||||
|
||||
case $state in
|
||||
file)
|
||||
_files
|
||||
;;
|
||||
esac
|
||||
|
||||
;;
|
||||
react)
|
||||
|
||||
# ---- Command: create react
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'2: :->cmd2' \
|
||||
'3: :->file' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' &&
|
||||
ret=0
|
||||
|
||||
case $state in
|
||||
file)
|
||||
_files
|
||||
;;
|
||||
esac
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
;;
|
||||
|
||||
esac
|
||||
;;
|
||||
dev)
|
||||
|
||||
# ---- Command: dev
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' \
|
||||
'--bunfile[Use a specific .bun file (default: node_modules.bun)]:bunfile' \
|
||||
'--origin[Rewrite import paths to start from a different url. Default: http://localhost:3000]:origin' \
|
||||
'-u[Rewrite import paths to start from a different url. Default: http://localhost:3000]:u' \
|
||||
'--server-bunfile[Use a specific .bun file for SSR in bun dev (default: node_modules.server.bun)]:server-bunfile' \
|
||||
'--extension-order[defaults to: .tsx,.ts,.jsx,.js,.json]:extension-order' \
|
||||
'--jsx-runtime[JSX runtime to use. Defaults to "automatic"]:jsx-runtime:("automatic" "classic")' \
|
||||
'--main-fields[Main fields to lookup in package.json. Defaults to --platform dependent]:main-fields' \
|
||||
'--disable-react-fast-refresh[Disable React Fast Refresh]' \
|
||||
'--disable-hmr[Disable Hot Module Reloading]' \
|
||||
'--jsx-factory[Changes the function called when compiling JSX elements using the classic JSX runtime]:jsx-factory' \
|
||||
'--jsx-fragment[Changes the function called when compiling JSX fragments]:jsx-fragment' \
|
||||
'--jsx-import-source[Declares the module specifier to be used for importing the jsx and jsxs factory functions. Default: "react"]:jsx-import-source' \
|
||||
'--port[Port number]:port' &&
|
||||
ret=0
|
||||
|
||||
;;
|
||||
|
||||
help)
|
||||
|
||||
# ---- Command: help
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'2: :->cmd2' \
|
||||
'*: :->args' &&
|
||||
ret=0
|
||||
|
||||
case $state in
|
||||
cmd2)
|
||||
_alternative 'args:cmd3:((bun create dev run upgrade))'
|
||||
;;
|
||||
|
||||
args)
|
||||
case $line[2] in
|
||||
bun)
|
||||
|
||||
# ---- Command: help bun
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'2: :->cmd2' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' \
|
||||
'--all[]' &&
|
||||
ret=0
|
||||
|
||||
;;
|
||||
install)
|
||||
|
||||
# ---- Command: help install
|
||||
_arguments -s -C \
|
||||
'1: :->cmd1' \
|
||||
'2: :->cmd2' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-g[Add a package globally]' \
|
||||
'--global[Add a package globally]' \
|
||||
'-h[Show command help]' \
|
||||
'--all[]' &&
|
||||
ret=0
|
||||
|
||||
;;
|
||||
|
||||
remove)
|
||||
|
||||
# ---- Command: help remove
|
||||
_arguments -s -C \
|
||||
'1: :->cmd1' \
|
||||
'2: :->cmd2' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'-g[Remove a package globally]' \
|
||||
'--global[Remove a package globally]' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' \
|
||||
'--all[]' &&
|
||||
ret=0
|
||||
|
||||
;;
|
||||
|
||||
run)
|
||||
|
||||
# ---- Command: help run
|
||||
_arguments -s -C \
|
||||
'1: :->cmd1' \
|
||||
'2: :->cmd2' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' \
|
||||
'--all[]' &&
|
||||
ret=0
|
||||
|
||||
;;
|
||||
|
||||
create)
|
||||
|
||||
# ---- Command: help create
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'2: :->cmd2' \
|
||||
'3: :->cmd3' \
|
||||
'*: :->args' &&
|
||||
ret=0
|
||||
|
||||
case $state in
|
||||
cmd3)
|
||||
_alternative 'args:create:((next react))'
|
||||
;;
|
||||
|
||||
args)
|
||||
case $line[3] in
|
||||
next)
|
||||
|
||||
# ---- Command: help create next
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'2: :->cmd2' \
|
||||
'3: :->cmd3' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' \
|
||||
'--all[]' &&
|
||||
ret=0
|
||||
|
||||
;;
|
||||
|
||||
react)
|
||||
|
||||
# ---- Command: help create react
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'2: :->cmd2' \
|
||||
'3: :->cmd3' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' \
|
||||
'--all[]' &&
|
||||
ret=0
|
||||
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
;;
|
||||
|
||||
esac
|
||||
;;
|
||||
dev)
|
||||
|
||||
# ---- Command: help dev
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'2: :->cmd2' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' \
|
||||
'--all[]' &&
|
||||
ret=0
|
||||
|
||||
;;
|
||||
|
||||
run)
|
||||
|
||||
# ---- Command: help run
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'2: :->cmd2' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' \
|
||||
'--all[]' &&
|
||||
ret=0
|
||||
|
||||
;;
|
||||
|
||||
upgrade)
|
||||
|
||||
# ---- Command: help upgrade
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'2: :->cmd2' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' \
|
||||
'--all[]' &&
|
||||
ret=0
|
||||
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
;;
|
||||
|
||||
esac
|
||||
;;
|
||||
install)
|
||||
|
||||
# ---- Command: install
|
||||
_arguments -s -C \
|
||||
'1: :->cmd1' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' \
|
||||
'--registry[Change default registry (default: \$BUN_CONFIG_REGISTRY || \$npm_config_registry)]:registry' \
|
||||
'--token[Authentication token used for npm registry requests (default: \$npm_config_token)]:token' \
|
||||
'-y[Write a yarn.lock file (yarn v1)]' \
|
||||
'--yarn[Write a yarn.lock file (yarn v1)]' \
|
||||
'--production[Don'"'"'t install devDependencies]' \
|
||||
'-p[Don'"'"'t install devDependencies]' \
|
||||
'--no-save[]' \
|
||||
'--dry-run[Don'"'"'t install anything]' \
|
||||
'--force[Always request the latest versions from the registry & reinstall all dependenices]' \
|
||||
'--lockfile[Store & load a lockfile at a specific filepath]:lockfile' \
|
||||
'--cache-dir[Store & load cached data from a specific directory path]:cache-dir' \
|
||||
'--no-cache[Ignore manifest cache entirely]' \
|
||||
'--silent[Don'"'"'t output anything]' \
|
||||
'--verbose[Excessively verbose logging]' \
|
||||
'--cwd[Set a specific cwd]:cwd' \
|
||||
'-g[Add a package globally]' \
|
||||
'--global[Add a package globally]' \
|
||||
'--backend[Platform-specific optimizations for installing dependencies]:backend:("clonefile" "copyfile" "hardlink" "clonefile_each_dir")' \
|
||||
'--link-native-bins[Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo]:link-native-bins' &&
|
||||
ret=0
|
||||
|
||||
;;
|
||||
|
||||
remove)
|
||||
|
||||
# ---- Command: remove
|
||||
_arguments -s -C \
|
||||
'1: :->cmd1' \
|
||||
'*: :->package' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' \
|
||||
'--registry[Change default registry (default: \$BUN_CONFIG_REGISTRY || \$npm_config_registry)]:registry' \
|
||||
'--token[Authentication token used for npm registry requests (default: \$npm_config_token)]:token' \
|
||||
'-y[Write a yarn.lock file (yarn v1)]' \
|
||||
'--yarn[Write a yarn.lock file (yarn v1)]' \
|
||||
'--production[Don'"'"'t install devDependencies]' \
|
||||
'-p[Don'"'"'t install devDependencies]' \
|
||||
'--no-save[]' \
|
||||
'--dry-run[Don'"'"'t install anything]' \
|
||||
'-g[Remove a package globally]' \
|
||||
'--global[Remove a package globally]' \
|
||||
'--force[Always request the latest versions from the registry & reinstall all dependenices]' \
|
||||
'--lockfile[Store & load a lockfile at a specific filepath]:lockfile' \
|
||||
'--cache-dir[Store & load cached data from a specific directory path]:cache-dir' \
|
||||
'--no-cache[Ignore manifest cache entirely]' \
|
||||
'--silent[Don'"'"'t output anything]' \
|
||||
'--verbose[Excessively verbose logging]' \
|
||||
'--backend[Platform-specific optimizations for installing dependencies]:backend:("clonefile" "copyfile" "hardlink" "clonefile_each_dir")' \
|
||||
'--link-native-bins[Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo]:link-native-bins' &&
|
||||
ret=0
|
||||
|
||||
case $state in
|
||||
package) ;;
|
||||
|
||||
esac
|
||||
|
||||
;;
|
||||
run)
|
||||
|
||||
# ---- Command: run
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'2: :->script' \
|
||||
'*: :->other' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' \
|
||||
'--silent[Don'"'"'t echo the command]' &&
|
||||
ret=0
|
||||
|
||||
case $state in
|
||||
script)
|
||||
_bun_run_param_script_completion
|
||||
;;
|
||||
other)
|
||||
_files
|
||||
;;
|
||||
esac
|
||||
|
||||
;;
|
||||
upgrade)
|
||||
|
||||
# ---- Command: upgrade
|
||||
_arguments -s -C \
|
||||
'1: :->cmd' \
|
||||
'--version[Show version and exit]' \
|
||||
'-V[Show version and exit]' \
|
||||
'--cwd[Change directory]:cwd' \
|
||||
'--help[Show command help]' \
|
||||
'-h[Show command help]' &&
|
||||
ret=0
|
||||
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
_bun_run_param_script_completion() {
|
||||
local -a scripts_list
|
||||
IFS=$'\n' scripts_list=($(SHELL=zsh bun getcompletes s))
|
||||
compadd $scripts_list && ret=0
|
||||
|
||||
IFS=$'\n' bunjs=($(SHELL=zsh bun getcompletes j))
|
||||
IFS=$'\n' bins=($(SHELL=zsh bun getcompletes b))
|
||||
|
||||
if [ ! -z "$bunjs" -a "$bunjs" != " " ]; then
|
||||
if [ ! -z "$bins" -a "$bins" != " " ]; then
|
||||
compadd $bunjs && ret=0
|
||||
_alternative "args:bin:(($bins))"
|
||||
return 1
|
||||
fi
|
||||
|
||||
_alternative "args:Bun.js:(($bunjs))"
|
||||
fi
|
||||
|
||||
if [ ! -z "$bins" -a "$bins" != " " ]; then
|
||||
_alternative "args:bin:(($bins))"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
_set_remove() {
|
||||
comm -23 <(echo $1 | sort | tr " " "\n") <(echo $2 | sort | tr " " "\n") 2>/dev/null
|
||||
}
|
||||
|
||||
_bun_add_param_package_completion() {
|
||||
|
||||
IFS=$'\n' inexact=($(history -n bun | grep -E "^bun add " | cut -c 9- | uniq))
|
||||
IFS=$'\n' exact=($($inexact | grep -E "^$words[$CURRENT]"))
|
||||
IFS=$'\n' packages=($(SHELL=zsh bun getcompletes a $words[$CURRENT]))
|
||||
|
||||
to_print=$inexact
|
||||
if [ ! -z "$exact" -a "$exact" != " " ]; then
|
||||
to_print=$exact
|
||||
fi
|
||||
|
||||
if [ ! -z "$to_print" -a "$to_print" != " " ]; then
|
||||
if [ ! -z "$packages" -a "$packages" != " " ]; then
|
||||
_describe -1 -t to_print 'History' to_print
|
||||
_describe -1 -t packages "Popular" packages
|
||||
return
|
||||
fi
|
||||
|
||||
_describe -1 -t to_print 'History' to_print
|
||||
return
|
||||
fi
|
||||
|
||||
if [ ! -z "$packages" -a "$packages" != " " ]; then
|
||||
_describe -1 -t packages "Popular" packages
|
||||
return
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
__bun_dynamic_comp() {
|
||||
local comp=""
|
||||
|
||||
for arg in scripts; do
|
||||
local line
|
||||
while read -r line; do
|
||||
local name="$line"
|
||||
local desc="$line"
|
||||
name="${name%$'\t'*}"
|
||||
desc="${desc/*$'\t'/}"
|
||||
echo
|
||||
done <<<"$arg"
|
||||
done
|
||||
|
||||
return $comp
|
||||
}
|
||||
|
||||
autoload -U compinit && compinit
|
||||
compdef _bun bun
|
||||
229
completions/spec.yaml
Normal file
229
completions/spec.yaml
Normal file
@@ -0,0 +1,229 @@
|
||||
---
|
||||
name: bun
|
||||
appspec: { version: "0.001" }
|
||||
plugins: [-Meta]
|
||||
title: A tool for installing and managing Python packages
|
||||
|
||||
options:
|
||||
- version|V --Show version and exit
|
||||
- name: cwd
|
||||
type: string
|
||||
summary: "Change directory"
|
||||
|
||||
# subcommands:
|
||||
# bun:
|
||||
|
||||
subcommands:
|
||||
run:
|
||||
summary: Run a script or package bin
|
||||
parameters:
|
||||
- name: script
|
||||
multiple: false
|
||||
completion:
|
||||
command_string: >
|
||||
SHELL=zsh bun getcompletes r
|
||||
|
||||
options:
|
||||
- silent --Don't echo the command
|
||||
|
||||
create:
|
||||
summary: Create a new project
|
||||
subcommands:
|
||||
next:
|
||||
summary: "Next.js app"
|
||||
parameters:
|
||||
- name: file
|
||||
multiple: false
|
||||
type: file
|
||||
required: true
|
||||
|
||||
react:
|
||||
summary: "React app"
|
||||
parameters:
|
||||
- name: file
|
||||
multiple: false
|
||||
type: file
|
||||
required: true
|
||||
|
||||
bun:
|
||||
summary: Generate a bundle
|
||||
parameters:
|
||||
- name: file
|
||||
multiple: true
|
||||
type: file
|
||||
required: false
|
||||
options:
|
||||
- name: use
|
||||
type: string
|
||||
summary: Use a framework, e.g. "next"
|
||||
|
||||
upgrade:
|
||||
summary: Upgrade to the latest version of bun
|
||||
|
||||
dev:
|
||||
summary: Start a dev server
|
||||
options:
|
||||
- name: bunfile
|
||||
type: string
|
||||
summary: "Use a specific .bun file (default: node_modules.bun)"
|
||||
|
||||
- name: origin
|
||||
type: string
|
||||
summary: "Rewrite import paths to start from a different url. Default: http://localhost:3000"
|
||||
|
||||
- name: u
|
||||
type: string
|
||||
summary: "Rewrite import paths to start from a different url. Default: http://localhost:3000"
|
||||
|
||||
- name: server-bunfile
|
||||
type: string
|
||||
summary: "Use a specific .bun file for SSR in bun dev (default: node_modules.server.bun)"
|
||||
- name: extension-order
|
||||
type: string
|
||||
summary: "defaults to: .tsx,.ts,.jsx,.js,.json"
|
||||
- name: "jsx-runtime"
|
||||
type: string
|
||||
enum: ["automatic", "classic"]
|
||||
summary: 'JSX runtime to use. Defaults to "automatic"'
|
||||
- name: main-fields
|
||||
type: string
|
||||
summary: Main fields to lookup in package.json. Defaults to --platform dependent
|
||||
- disable-react-fast-refresh --Disable React Fast Refresh
|
||||
- disable-hmr --Disable Hot Module Reloading
|
||||
- &jsx_factory name: jsx-factory
|
||||
type: string
|
||||
summary: "Changes the function called when compiling JSX elements using the classic JSX runtime"
|
||||
- &jsx_fragment name: jsx-fragment
|
||||
type: string
|
||||
summary: "Changes the function called when compiling JSX fragments"
|
||||
- &jsx_import_source name: jsx-import-source
|
||||
type: string
|
||||
summary: 'Declares the module specifier to be used for importing the jsx and jsxs factory functions. Default: "react"'
|
||||
- &port name: port
|
||||
type: int
|
||||
summary: Port number
|
||||
install:
|
||||
summary: Install packages from package.json
|
||||
options:
|
||||
- name: registry
|
||||
type: string
|
||||
summary: "Change default registry (default: $BUN_CONFIG_REGISTRY || $npm_config_registry)"
|
||||
- name: token
|
||||
type: string
|
||||
summary: "Authentication token used for npm registry requests (default: $npm_config_token)"
|
||||
- y -- "Write a yarn.lock file (yarn v1)"
|
||||
- yarn -- "Write a yarn.lock file (yarn v1)"
|
||||
- production -- "Don't install devDependencies"
|
||||
- p -- "Don't install devDependencies"
|
||||
- no-save --
|
||||
- dry-run -- "Don't install anything"
|
||||
- force -- "Always request the latest versions from the registry & reinstall all dependenices"
|
||||
- name: lockfile
|
||||
type: string
|
||||
summary: "Store & load a lockfile at a specific filepath"
|
||||
- name: cache-dir
|
||||
type: string
|
||||
summary: "Store & load cached data from a specific directory path"
|
||||
- no-cache -- "Ignore manifest cache entirely"
|
||||
- silent -- "Don't output anything"
|
||||
- verbose -- "Excessively verbose logging"
|
||||
- name: cwd
|
||||
type: string
|
||||
summary: "Set a specific cwd"
|
||||
- name: backend
|
||||
summary: "Platform-specific optimizations for installing dependencies"
|
||||
type: string
|
||||
enum: ["clonefile", "copyfile", "hardlink", "clonefile_each_dir"]
|
||||
- name: link-native-bins
|
||||
summary: 'Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo'
|
||||
add:
|
||||
summary: Add a dependency to package.json
|
||||
options:
|
||||
- name: registry
|
||||
type: string
|
||||
summary: "Change default registry (default: $BUN_CONFIG_REGISTRY || $npm_config_registry)"
|
||||
- name: token
|
||||
type: string
|
||||
summary: "Authentication token used for npm registry requests (default: $npm_config_token)"
|
||||
- y -- "Write a yarn.lock file (yarn v1)"
|
||||
- yarn -- "Write a yarn.lock file (yarn v1)"
|
||||
- production -- "Don't install devDependencies"
|
||||
- optional -- "Add dependency to optionalDependencies"
|
||||
- development -- "Add dependency to devDependencies"
|
||||
- d -- "Add dependency to devDependencies"
|
||||
- p -- "Don't install devDependencies"
|
||||
- no-save --
|
||||
- dry-run -- "Don't install anything"
|
||||
- force -- "Always request the latest versions from the registry & reinstall all dependenices"
|
||||
- no-cache -- "Ignore manifest cache entirely"
|
||||
- silent -- "Don't output anything"
|
||||
- verbose -- "Excessively verbose logging"
|
||||
- name: lockfile
|
||||
type: string
|
||||
summary: "Store & load a lockfile at a specific filepath"
|
||||
- name: cache-dir
|
||||
type: string
|
||||
summary: "Store & load cached data from a specific directory path"
|
||||
|
||||
- name: cwd
|
||||
type: string
|
||||
summary: "Set a specific cwd"
|
||||
- name: backend
|
||||
summary: "Platform-specific optimizations for installing dependencies"
|
||||
type: string
|
||||
enum: ["clonefile", "copyfile", "hardlink", "clonefile_each_dir"]
|
||||
- name: link-native-bins
|
||||
summary: 'Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo'
|
||||
parameters:
|
||||
- name: package
|
||||
multiple: true
|
||||
type: string
|
||||
required: true
|
||||
remove:
|
||||
summary: Remove a dependency from package.json
|
||||
options:
|
||||
- name: registry
|
||||
type: string
|
||||
summary: "Change default registry (default: $BUN_CONFIG_REGISTRY || $npm_config_registry)"
|
||||
- name: token
|
||||
type: string
|
||||
summary: "Authentication token used for npm registry requests (default: $npm_config_token)"
|
||||
- y -- "Write a yarn.lock file (yarn v1)"
|
||||
- yarn -- "Write a yarn.lock file (yarn v1)"
|
||||
- production -- "Don't install devDependencies"
|
||||
- p -- "Don't install devDependencies"
|
||||
- no-save --
|
||||
- dry-run -- "Don't install anything"
|
||||
- force -- "Always request the latest versions from the registry & reinstall all dependenices"
|
||||
- name: lockfile
|
||||
type: string
|
||||
summary: "Store & load a lockfile at a specific filepath"
|
||||
- name: cache-dir
|
||||
type: string
|
||||
summary: "Store & load cached data from a specific directory path"
|
||||
- no-cache -- "Ignore manifest cache entirely"
|
||||
- silent -- "Don't output anything"
|
||||
- verbose -- "Excessively verbose logging"
|
||||
- name: cwd
|
||||
type: string
|
||||
summary: "Set a specific cwd"
|
||||
- name: backend
|
||||
summary: "Platform-specific optimizations for installing dependencies"
|
||||
type: string
|
||||
enum: ["clonefile", "copyfile", "hardlink", "clonefile_each_dir"]
|
||||
- name: link-native-bins
|
||||
summary: 'Link "bin" from a matching platform-specific dependency instead. Default: esbuild, turbo'
|
||||
parameters:
|
||||
- name: package
|
||||
multiple: true
|
||||
type: string
|
||||
required: true
|
||||
|
||||
parameters:
|
||||
- name: sasdasdds
|
||||
completion:
|
||||
command_string: >
|
||||
SHELL=zsh bun getcompletes r
|
||||
|
||||
# vim:et:sts=2:sws=2:sw=2:foldmethod=indent
|
||||
|
||||
44
docs/bun-flavored-toml.md
Normal file
44
docs/bun-flavored-toml.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Bun-flavored TOML
|
||||
|
||||
[TOML](https://toml.io/) is a minimal configuration file format designed to be easy for humans to read.
|
||||
|
||||
Bun implements a TOML parser with a few tweaks designed for better interopability with INI files and with JavaScript.
|
||||
|
||||
### ; and # are comments
|
||||
|
||||
In Bun-flavored TOML, comments start with `#` or `;`
|
||||
|
||||
```ini
|
||||
# This is a comment
|
||||
; This is also a comment
|
||||
```
|
||||
|
||||
This matches the behavior of INI files.
|
||||
|
||||
In TOML, comments start with `#`
|
||||
|
||||
```toml
|
||||
# This is a comment
|
||||
```
|
||||
|
||||
### String escape characters
|
||||
|
||||
Bun-flavored adds a few more escape sequences to TOML to work better with JavaScript strings.
|
||||
|
||||
```
|
||||
# Bun-flavored TOML extras
|
||||
\x{XX} - ASCII (U+00XX)
|
||||
\u{x+} - unicode (U+0000000X) - (U+XXXXXXXX)
|
||||
\v - vertical tab
|
||||
|
||||
# Regular TOML
|
||||
\b - backspace (U+0008)
|
||||
\t - tab (U+0009)
|
||||
\n - linefeed (U+000A)
|
||||
\f - form feed (U+000C)
|
||||
\r - carriage return (U+000D)
|
||||
\" - quote (U+0022)
|
||||
\\ - backslash (U+005C)
|
||||
\uXXXX - unicode (U+XXXX)
|
||||
\UXXXXXXXX - unicode (U+XXXXXXXX)
|
||||
```
|
||||
18
entitlements.debug.plist
Normal file
18
entitlements.debug.plist
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-executable-page-protection</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-library-validation</key>
|
||||
<true/>
|
||||
<key>com.apple.security.get-task-allow</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -2,13 +2,15 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-executable-page-protection</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-executable-page-protection</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-library-validation</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
1
examples/.gitignore
vendored
Normal file
1
examples/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
bun-examples-all
|
||||
@@ -1,11 +0,0 @@
|
||||
import { Main } from "../../src/main";
|
||||
|
||||
function IndexRoute() {
|
||||
return (
|
||||
<div>
|
||||
<Main productName={"Boom id"} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export { IndexRoute as default };
|
||||
@@ -1,7 +0,0 @@
|
||||
import { Main } from "src/main";
|
||||
|
||||
export function IndexPage() {
|
||||
return <Main />;
|
||||
}
|
||||
|
||||
export default IndexPage;
|
||||
@@ -1,9 +0,0 @@
|
||||
import { Main } from "../../src/main";
|
||||
|
||||
export default function IndexRoute() {
|
||||
return (
|
||||
<div>
|
||||
<Main productName={"nested!"} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user