Compare commits
632 Commits
v7.0.0-bet
...
v7.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f03adbadf4 | ||
|
|
97145ad01e | ||
|
|
25810d2609 | ||
|
|
5f58117790 | ||
|
|
dca2631ef0 | ||
|
|
ba11d9fa7c | ||
|
|
e06cf20d2e | ||
|
|
df1afa3160 | ||
|
|
cec93c01ce | ||
|
|
0a8367c979 | ||
|
|
ac5d2ba984 | ||
|
|
040ba2bf53 | ||
|
|
98f0808a22 | ||
|
|
bdcfb697a6 | ||
|
|
0341d299c8 | ||
|
|
1a7765712e | ||
|
|
b87c43d894 | ||
|
|
02c4a28608 | ||
|
|
4260ffd7ec | ||
|
|
25c3f0d689 | ||
|
|
21b03c35d3 | ||
|
|
ee1ee0e7ae | ||
|
|
73f8059ea0 | ||
|
|
70e3454d7a | ||
|
|
9dab691302 | ||
|
|
95fc38cecf | ||
|
|
84e76e2d49 | ||
|
|
0d9eef4750 | ||
|
|
d2ed7bbc8d | ||
|
|
5b5ac1f366 | ||
|
|
fa1547d8f8 | ||
|
|
b42b21f25c | ||
|
|
6dca0ff9bf | ||
|
|
3e9b59c0f1 | ||
|
|
3f6c475aae | ||
|
|
5c31e501d7 | ||
|
|
ed6b4e0e40 | ||
|
|
8615b6fe57 | ||
|
|
95fa5a66b1 | ||
|
|
c94355c1c9 | ||
|
|
839bf68d1f | ||
|
|
8198b1b334 | ||
|
|
d608535719 | ||
|
|
0353ce9ed5 | ||
|
|
65ca968f8b | ||
|
|
77445cb044 | ||
|
|
7c4509e280 | ||
|
|
87ae286bc3 | ||
|
|
9c1b3e8dc1 | ||
|
|
39d07638cf | ||
|
|
e887eecda4 | ||
|
|
a3e622ad15 | ||
|
|
494a56df5f | ||
|
|
8060ae5dae | ||
|
|
bd4ebc11c1 | ||
|
|
80cefaff2f | ||
|
|
e9d5073af1 | ||
|
|
c8fb48ffd6 | ||
|
|
55ef39eb87 | ||
|
|
91e1e1728c | ||
|
|
acf509bab5 | ||
|
|
4f312f5739 | ||
|
|
696f84468e | ||
|
|
71fd37067e | ||
|
|
7142a79eb9 | ||
|
|
1a6855eff2 | ||
|
|
1de36948ac | ||
|
|
b28ffedead | ||
|
|
a5edab7393 | ||
|
|
725e6a01c0 | ||
|
|
224ce38882 | ||
|
|
8c46fd159f | ||
|
|
47201db61e | ||
|
|
138d60922c | ||
|
|
cfb386ff03 | ||
|
|
9e7fe0ab49 | ||
|
|
e31e907d5f | ||
|
|
4da4728bf5 | ||
|
|
0112479ba9 | ||
|
|
408124438a | ||
|
|
eab4c0e93e | ||
|
|
d06bf993db | ||
|
|
1076018c4c | ||
|
|
07ff8f30f5 | ||
|
|
e6ba0ab82c | ||
|
|
2afe9404fe | ||
|
|
037fee8ffb | ||
|
|
3a2aa9b862 | ||
|
|
c8b57f777a | ||
|
|
b414387bb1 | ||
|
|
0bb71caad3 | ||
|
|
d6dcbdad48 | ||
|
|
8606b76438 | ||
|
|
34d73ebef0 | ||
|
|
890a45216f | ||
|
|
0a257e8972 | ||
|
|
3616137864 | ||
|
|
f8ab9466d3 | ||
|
|
8f24f91166 | ||
|
|
dbdce0e4e4 | ||
|
|
4595c7fdfd | ||
|
|
1f97b91655 | ||
|
|
b0e1e84471 | ||
|
|
f7c26bf2bf | ||
|
|
a67eb25547 | ||
|
|
485e37fcb0 | ||
|
|
f013dab5fb | ||
|
|
e45b58dcb1 | ||
|
|
339dfddca5 | ||
|
|
0cd868a5f2 | ||
|
|
29db23ed87 | ||
|
|
2679d6775c | ||
|
|
96316dcf88 | ||
|
|
42244123e1 | ||
|
|
4b97e837ea | ||
|
|
3299086955 | ||
|
|
2bded404f3 | ||
|
|
21c7ff3f37 | ||
|
|
341bdab90c | ||
|
|
81149a5cc9 | ||
|
|
5166eef103 | ||
|
|
0ee9a4e612 | ||
|
|
858a2c74e7 | ||
|
|
668358c4d0 | ||
|
|
39b05598a0 | ||
|
|
29eafbbf44 | ||
|
|
7a106025ea | ||
|
|
4f1473da3d | ||
|
|
c62b202e6a | ||
|
|
a084339a15 | ||
|
|
d7987fbbd2 | ||
|
|
8a31eabf5e | ||
|
|
80428dec47 | ||
|
|
61ec5ce957 | ||
|
|
1e41f613bb | ||
|
|
a86d14de61 | ||
|
|
a62cfe9045 | ||
|
|
f797454a18 | ||
|
|
ec882be44d | ||
|
|
ecbf0dd53c | ||
|
|
af3d6526e7 | ||
|
|
95894397eb | ||
|
|
b1c9af3f05 | ||
|
|
ec3722b3f9 | ||
|
|
7ae724f553 | ||
|
|
6597a472b3 | ||
|
|
fdd0789936 | ||
|
|
5b1332457c | ||
|
|
3177f05904 | ||
|
|
9dc178df9a | ||
|
|
75bc9422b8 | ||
|
|
bd98041321 | ||
|
|
6a8c4ab433 | ||
|
|
637bfe76b1 | ||
|
|
3f72f1d637 | ||
|
|
20de23f895 | ||
|
|
d17adf40df | ||
|
|
450a1678f2 | ||
|
|
e9ed0f5f21 | ||
|
|
29d249e3b7 | ||
|
|
6f9b0546ef | ||
|
|
fa2c6c5164 | ||
|
|
43040a4181 | ||
|
|
01f4c2368e | ||
|
|
56cb4baf46 | ||
|
|
b051243a63 | ||
|
|
e808b63c15 | ||
|
|
a6df92f245 | ||
|
|
f4b81ab101 | ||
|
|
360b632881 | ||
|
|
bdfeeb38c6 | ||
|
|
47ada5ab3a | ||
|
|
59ba3959dc | ||
|
|
0200e6256a | ||
|
|
9a26c2b07a | ||
|
|
901571d72f | ||
|
|
b09c729675 | ||
|
|
a36525be45 | ||
|
|
a10c91790f | ||
|
|
ab7d1231ad | ||
|
|
a5df709bc3 | ||
|
|
1dbed5f458 | ||
|
|
40e38646e4 | ||
|
|
9e4dd861ee | ||
|
|
a7bddc02ba | ||
|
|
023f8bd1cb | ||
|
|
c9b99af5a6 | ||
|
|
c8d82d6483 | ||
|
|
db42a5d70f | ||
|
|
0856f89882 | ||
|
|
921702ef8c | ||
|
|
8b57a3e3b9 | ||
|
|
21309cc8d4 | ||
|
|
19708e0154 | ||
|
|
f98dff9189 | ||
|
|
840ba187a7 | ||
|
|
de00d939f0 | ||
|
|
e80488f1d5 | ||
|
|
81c1b49f6a | ||
|
|
55bf55398a | ||
|
|
f0d681a238 | ||
|
|
6d6fe844fd | ||
|
|
edb0a70e14 | ||
|
|
669f6b97b2 | ||
|
|
e2c5f25e97 | ||
|
|
8eee435cd6 | ||
|
|
d260bfaec4 | ||
|
|
c662c2ada2 | ||
|
|
b6e54800b4 | ||
|
|
ae210a46d1 | ||
|
|
017d0e7078 | ||
|
|
b8d1d221f8 | ||
|
|
fed530f6bf | ||
|
|
29d44193cd | ||
|
|
82994ce087 | ||
|
|
586d3b5929 | ||
|
|
d682e32529 | ||
|
|
07ab02f6b2 | ||
|
|
91a114f74a | ||
|
|
6d9887fc0f | ||
|
|
d2a3a8151e | ||
|
|
270ea17fed | ||
|
|
da2aea31f5 | ||
|
|
1d69cd41ca | ||
|
|
a7ec312cfe | ||
|
|
6ff91cfdae | ||
|
|
dfb3795a97 | ||
|
|
353d3199c2 | ||
|
|
bdd70c37e0 | ||
|
|
9d2d499760 | ||
|
|
29807837bb | ||
|
|
c14a6a7735 | ||
|
|
3a7881379a | ||
|
|
f3f0197890 | ||
|
|
8e030e28b3 | ||
|
|
3c8e9acd4a | ||
|
|
958551fd89 | ||
|
|
b5e6536f26 | ||
|
|
0389035e15 | ||
|
|
4f4dd3d4a6 | ||
|
|
4da3f3bc64 | ||
|
|
7901e7d1b9 | ||
|
|
4b6c7ac0f6 | ||
|
|
24a07fc790 | ||
|
|
1c9b0ff49e | ||
|
|
828e9a8538 | ||
|
|
f97d4313c9 | ||
|
|
2a0071028d | ||
|
|
2c0d492674 | ||
|
|
e42cbb40a4 | ||
|
|
74ab2798e2 | ||
|
|
fef5c7e523 | ||
|
|
53825f8152 | ||
|
|
40819f112c | ||
|
|
2d36549541 | ||
|
|
7e423de911 | ||
|
|
8317f8ab14 | ||
|
|
65dcc4eabe | ||
|
|
c8992e4155 | ||
|
|
50b9fbb570 | ||
|
|
5d615dd198 | ||
|
|
eb2a0b0fcd | ||
|
|
eaa31b6ec3 | ||
|
|
4d76d5dddc | ||
|
|
a86d311986 | ||
|
|
a340a2614f | ||
|
|
f9857ca6ba | ||
|
|
f43bf7fcd5 | ||
|
|
653318b7e4 | ||
|
|
d187c26748 | ||
|
|
fc64ab5725 | ||
|
|
5cd8b5b7f0 | ||
|
|
a328b6ad1a | ||
|
|
15a80f0df8 | ||
|
|
a4795408b4 | ||
|
|
5f6e3122a0 | ||
|
|
7f8f4e86dc | ||
|
|
5c3092d86f | ||
|
|
7cc00cce0d | ||
|
|
beb99dfda1 | ||
|
|
5f9539e9cc | ||
|
|
aa669ef902 | ||
|
|
c92e8be612 | ||
|
|
ab1e295c74 | ||
|
|
ae0df86340 | ||
|
|
41bf66bca2 | ||
|
|
212058148c | ||
|
|
785131d8e6 | ||
|
|
81532103da | ||
|
|
cc6e739f15 | ||
|
|
3e95830646 | ||
|
|
53208d6998 | ||
|
|
fdfbd9a6f7 | ||
|
|
007f8d19b3 | ||
|
|
586ba35950 | ||
|
|
1a454f666c | ||
|
|
a07f96ce3f | ||
|
|
2c3eb3096f | ||
|
|
148e6dfc26 | ||
|
|
ddd40bf5c7 | ||
|
|
bf8b25289b | ||
|
|
b19b7fd2cf | ||
|
|
f004972625 | ||
|
|
5459c75d64 | ||
|
|
8e3e6e0a88 | ||
|
|
d4a8c7672c | ||
|
|
600106b9cb | ||
|
|
dffcef785a | ||
|
|
cb4f4f4d5f | ||
|
|
7ff4a73916 | ||
|
|
8823e4247e | ||
|
|
6f3be3a543 | ||
|
|
6f6c8dabba | ||
|
|
960fa66c9e | ||
|
|
df50cddd63 | ||
|
|
455c04e60a | ||
|
|
182fe7b04e | ||
|
|
959865b48d | ||
|
|
62c1046249 | ||
|
|
70627ac92c | ||
|
|
a99e9614a6 | ||
|
|
cfb830b5bd | ||
|
|
84de90e572 | ||
|
|
d283324f8a | ||
|
|
d75a6b8468 | ||
|
|
dad05ed503 | ||
|
|
7e90d56024 | ||
|
|
3d49766f6b | ||
|
|
4d17a96d50 | ||
|
|
6cbc585cf4 | ||
|
|
ee6dfd1580 | ||
|
|
e732ee0c5b | ||
|
|
128fc6864e | ||
|
|
6aed8e944f | ||
|
|
4d164bd8e6 | ||
|
|
ea3f2d9299 | ||
|
|
88a0f52230 | ||
|
|
4a2e1dbbc3 | ||
|
|
2979dd99ac | ||
|
|
534ee4734c | ||
|
|
a01007a3d3 | ||
|
|
493996e02a | ||
|
|
c03a34e509 | ||
|
|
92580e750d | ||
|
|
213805f21e | ||
|
|
28d13cb09b | ||
|
|
9a8ba76e1f | ||
|
|
d88173b9f8 | ||
|
|
85174b6ce1 | ||
|
|
ec2e0b664a | ||
|
|
a3ad518ce1 | ||
|
|
dd0337cc85 | ||
|
|
4887d81929 | ||
|
|
22555cd15d | ||
|
|
593c1a0861 | ||
|
|
7234442fde | ||
|
|
5ea1bfe780 | ||
|
|
2254ed45d2 | ||
|
|
278cd5e572 | ||
|
|
96c0415c86 | ||
|
|
ed98d2491e | ||
|
|
eb38ea2b10 | ||
|
|
f19d559ff3 | ||
|
|
73e64c6cb0 | ||
|
|
3deb246c7d | ||
|
|
1ebc229fa5 | ||
|
|
cc4913699b | ||
|
|
82b6ee734b | ||
|
|
22c8f6376c | ||
|
|
023550c87b | ||
|
|
8e0d247e8c | ||
|
|
65ae4ff15b | ||
|
|
2185256589 | ||
|
|
3316a554bf | ||
|
|
252ea5a966 | ||
|
|
912bcc186d | ||
|
|
63ae923987 | ||
|
|
dde9274986 | ||
|
|
ba111c13b5 | ||
|
|
967414d926 | ||
|
|
92fc26d399 | ||
|
|
fa5eb4f605 | ||
|
|
d6a782b09c | ||
|
|
567d25cfa5 | ||
|
|
1da831baa4 | ||
|
|
b0d8c62d1c | ||
|
|
0e570eceb2 | ||
|
|
ca18ea5e79 | ||
|
|
63d9998aa4 | ||
|
|
88e550c733 | ||
|
|
b96fdf8780 | ||
|
|
180eda3211 | ||
|
|
b3969d35fa | ||
|
|
dccfed3601 | ||
|
|
5759c33b4c | ||
|
|
193bccc93c | ||
|
|
5ce54799ff | ||
|
|
064c17e03f | ||
|
|
f9804e6beb | ||
|
|
47ce7e71c9 | ||
|
|
5ac8ba19a4 | ||
|
|
b5d20ab171 | ||
|
|
539009a980 | ||
|
|
c3654d83c8 | ||
|
|
667f5815c1 | ||
|
|
4f39e6ea4a | ||
|
|
64dfb7574e | ||
|
|
d36b142e30 | ||
|
|
3c8d831fe4 | ||
|
|
0a517b51cd | ||
|
|
79c84f2f9b | ||
|
|
ca86648726 | ||
|
|
2d05487293 | ||
|
|
c3352ad2e0 | ||
|
|
26e4911eb2 | ||
|
|
aa888e666a | ||
|
|
8659e1a88c | ||
|
|
9e384f3915 | ||
|
|
f694b5d034 | ||
|
|
d765573c0b | ||
|
|
64161fa0b5 | ||
|
|
52f22e9e1e | ||
|
|
3e5fce07e4 | ||
|
|
0f42accb87 | ||
|
|
07e69c009b | ||
|
|
ce420ba51c | ||
|
|
9fe30b98a1 | ||
|
|
0a9f136d5f | ||
|
|
e9ed687666 | ||
|
|
63157159ab | ||
|
|
74682f33bc | ||
|
|
b1bf7798ab | ||
|
|
7c99f4653f | ||
|
|
a19349a22a | ||
|
|
b93184e430 | ||
|
|
bb17b72f4f | ||
|
|
a76709cabc | ||
|
|
c292140254 | ||
|
|
f4a24a38ca | ||
|
|
193e841d89 | ||
|
|
1ded1d7ff6 | ||
|
|
aec6e5c370 | ||
|
|
152e95fb52 | ||
|
|
8250ff963e | ||
|
|
82c6ca2f96 | ||
|
|
820edd1e23 | ||
|
|
e872f0d975 | ||
|
|
c3f6f7fe28 | ||
|
|
49775e2f12 | ||
|
|
f3410e761c | ||
|
|
ebbd5c7321 | ||
|
|
4208099f5b | ||
|
|
068c65a1dd | ||
|
|
3956b3ee0e | ||
|
|
2297e2d764 | ||
|
|
d761d765bd | ||
|
|
ad2019aa30 | ||
|
|
f9e0805337 | ||
|
|
0f60d42fdf | ||
|
|
7d798952d2 | ||
|
|
ed2b88830e | ||
|
|
d25918aa5d | ||
|
|
035286a810 | ||
|
|
c9a00fbae8 | ||
|
|
758fd0369c | ||
|
|
7b861796cf | ||
|
|
f9825394a7 | ||
|
|
43e7d1d2cc | ||
|
|
de63443762 | ||
|
|
6a73f39199 | ||
|
|
2190e10e9a | ||
|
|
ae3f5b9149 | ||
|
|
0c885b3200 | ||
|
|
148fe7d3ff | ||
|
|
cabdf3769d | ||
|
|
1178799f07 | ||
|
|
b2f1d01965 | ||
|
|
4f53496546 | ||
|
|
1312a30d54 | ||
|
|
4afbc02476 | ||
|
|
080c7f1e2d | ||
|
|
3cea9f412a | ||
|
|
cd10ea03b4 | ||
|
|
5f8a1a2613 | ||
|
|
44da8201a5 | ||
|
|
2b065350b5 | ||
|
|
68476b6ddd | ||
|
|
17b37b5013 | ||
|
|
56638e1370 | ||
|
|
f0e46772a6 | ||
|
|
398bc43656 | ||
|
|
44ea9433c0 | ||
|
|
53826aaaa0 | ||
|
|
b900a3e5c2 | ||
|
|
ed4d90b33d | ||
|
|
209a598d51 | ||
|
|
9a146d01b0 | ||
|
|
f2437583ba | ||
|
|
a24c9f8ed6 | ||
|
|
6a7223af29 | ||
|
|
a66845169f | ||
|
|
8a4124b2ff | ||
|
|
05b22d2597 | ||
|
|
9cc0a26694 | ||
|
|
f5ef928586 | ||
|
|
42f66782be | ||
|
|
12ac1bccd7 | ||
|
|
82357d79a7 | ||
|
|
2958548c2c | ||
|
|
468aecca21 | ||
|
|
c7980b2b90 | ||
|
|
d6db5fb1e1 | ||
|
|
ac745ded0d | ||
|
|
a2aabbd33d | ||
|
|
fcfa987926 | ||
|
|
509dbb7302 | ||
|
|
e270fbe7f0 | ||
|
|
aa38c47160 | ||
|
|
62bbee97d7 | ||
|
|
ac72bfbd33 | ||
|
|
a7c9264c79 | ||
|
|
c41eb0d052 | ||
|
|
de5ab72c49 | ||
|
|
607916880d | ||
|
|
8270903ba2 | ||
|
|
95fe785354 | ||
|
|
413aa79711 | ||
|
|
1a3a502f97 | ||
|
|
5761eb0bb4 | ||
|
|
a992d06c41 | ||
|
|
d8bbaaae0a | ||
|
|
9d9710c765 | ||
|
|
18b91a8388 | ||
|
|
0a2a37c31f | ||
|
|
d731acc351 | ||
|
|
fba19295b4 | ||
|
|
8fc8a1f2ee | ||
|
|
18c8d97c3d | ||
|
|
58962c35b5 | ||
|
|
881fc14329 | ||
|
|
7d8932b6be | ||
|
|
6330a152ce | ||
|
|
189c56628a | ||
|
|
8be488652f | ||
|
|
cdf420d4d8 | ||
|
|
cf62908bbd | ||
|
|
66ee192a7f | ||
|
|
c635ff9c32 | ||
|
|
6cb9d20a0a | ||
|
|
b5cb78d33a | ||
|
|
1d0a3d6772 | ||
|
|
18ea5aca51 | ||
|
|
db28c18458 | ||
|
|
a89171910f | ||
|
|
0056fb1cfb | ||
|
|
041dd4a536 | ||
|
|
428e294ded | ||
|
|
0a3c2a0c4c | ||
|
|
917e3ede31 | ||
|
|
6d820a2757 | ||
|
|
1ef7e0f48e | ||
|
|
9206df964d | ||
|
|
c583a04a55 | ||
|
|
edbf5d33dc | ||
|
|
8393a6d089 | ||
|
|
464df13c69 | ||
|
|
80b4b7120b | ||
|
|
ccd7c25174 | ||
|
|
4384d38b90 | ||
|
|
3fae022320 | ||
|
|
70361f1200 | ||
|
|
d72d567d43 | ||
|
|
4a455639e7 | ||
|
|
ba441c5ce4 | ||
|
|
7064b298d7 | ||
|
|
f3004d0d4d | ||
|
|
037b2025a6 | ||
|
|
7d534dc32c | ||
|
|
2b710d0387 | ||
|
|
e67cfc5b31 | ||
|
|
4552ee9962 | ||
|
|
3c64554716 | ||
|
|
cee9ae48e0 | ||
|
|
39dae28d5c | ||
|
|
16e898c692 | ||
|
|
bb89364813 | ||
|
|
57e2c45cbe | ||
|
|
63397d0aad | ||
|
|
48906604f2 | ||
|
|
0f2ab2fe20 | ||
|
|
de3597983a | ||
|
|
aa2d415507 | ||
|
|
4c584ae341 | ||
|
|
74439889d8 | ||
|
|
74ea70718e | ||
|
|
bbff566024 | ||
|
|
3942862a2a | ||
|
|
f3fd2ee3b2 | ||
|
|
6a19c2299a | ||
|
|
6371200215 | ||
|
|
47d5f0c20c | ||
|
|
262d7518bd | ||
|
|
287b485d0e | ||
|
|
9ae23639ad | ||
|
|
3c359698a7 | ||
|
|
056a995dd8 | ||
|
|
84fe8e4181 | ||
|
|
e44cef3473 | ||
|
|
44c2791849 | ||
|
|
0e88156d0c | ||
|
|
394ad93d22 | ||
|
|
82a4919c11 | ||
|
|
186f04a3e9 | ||
|
|
42c740ca0a | ||
|
|
7ae6e1e5a0 | ||
|
|
097ff40001 | ||
|
|
b79e3c0e99 | ||
|
|
88c1b4ef1c | ||
|
|
6b417a8ecb | ||
|
|
cd8a869a18 | ||
|
|
f3f005c67e | ||
|
|
7dfa79f4c8 | ||
|
|
3e34162092 | ||
|
|
b93800d3cb | ||
|
|
233e60c765 | ||
|
|
72a90cb63d | ||
|
|
b51ac5e60a | ||
|
|
8b206b2c3b | ||
|
|
a2ed843636 | ||
|
|
b95810f4b4 | ||
|
|
abb4850709 | ||
|
|
459e289d63 |
@@ -1,4 +0,0 @@
|
||||
# Ensure babel-register won't compile fixtures, or try to recompile compiled code.
|
||||
packages/*/test/fixtures
|
||||
packages/*/lib
|
||||
packages/babel-standalone/babel.js
|
||||
64
.babelrc.js
64
.babelrc.js
@@ -1,64 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
// Blame Logan for this.
|
||||
// This works around https://github.com/istanbuljs/istanbuljs/issues/92 until
|
||||
// we have a version of Istanbul that actually works with 7.x.
|
||||
function istanbulHacks() {
|
||||
return {
|
||||
inherits: require("babel-plugin-istanbul").default,
|
||||
visitor: {
|
||||
Program: {
|
||||
exit: function(path) {
|
||||
if (!this.__dv__) return
|
||||
|
||||
const node = path.node.body[0];
|
||||
if (
|
||||
node.type !== "VariableDeclaration" ||
|
||||
node.declarations[0].id.type !== "Identifier" ||
|
||||
!node.declarations[0].id.name.match(/cov_/) ||
|
||||
node._blockHoist !== 3
|
||||
) {
|
||||
throw new Error("Something has gone wrong in Logan's hacks.");
|
||||
}
|
||||
|
||||
// Gross hacks to put the code coverage block above all compiled
|
||||
// import statement output.
|
||||
node._blockHoist = 5;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
let envOpts = {
|
||||
loose: true,
|
||||
exclude: ["transform-typeof-symbol"],
|
||||
};
|
||||
|
||||
const config = {
|
||||
comments: false,
|
||||
presets: [
|
||||
["@babel/env", envOpts],
|
||||
"@babel/flow"
|
||||
],
|
||||
plugins: [
|
||||
["@babel/proposal-class-properties", { loose: true }],
|
||||
"@babel/proposal-export-namespace",
|
||||
"@babel/proposal-numeric-separator",
|
||||
["@babel/proposal-object-rest-spread", { useBuiltIns: true}],
|
||||
]
|
||||
};
|
||||
|
||||
if (process.env.BABEL_ENV === "cov") {
|
||||
config.auxiliaryCommentBefore = "istanbul ignore next";
|
||||
config.plugins.push(istanbulHacks);
|
||||
}
|
||||
|
||||
if (process.env.BABEL_ENV === "development") {
|
||||
envOpts.targets = {
|
||||
node: "current"
|
||||
};
|
||||
envOpts.debug = true;
|
||||
}
|
||||
|
||||
module.exports = config;
|
||||
56
.circleci/config.yml
Normal file
56
.circleci/config.yml
Normal file
@@ -0,0 +1,56 @@
|
||||
version: 2
|
||||
aliases:
|
||||
- &restore-node-modules-cache
|
||||
keys:
|
||||
- v1-yarn-deps-{{ checksum "yarn.lock" }}
|
||||
|
||||
- &restore-yarn-cache
|
||||
keys:
|
||||
- v1-yarn-cache
|
||||
|
||||
- &save-node-modules-cache
|
||||
paths:
|
||||
- node_modules
|
||||
key: v1-yarn-deps-{{ checksum "yarn.lock" }}
|
||||
|
||||
- &save-yarn-cache
|
||||
paths:
|
||||
- ~/.yarn-cache
|
||||
key: v1-yarn-cache
|
||||
|
||||
- &artifact_babel
|
||||
path: ~/babel/packages/babel-standalone/babel.js
|
||||
|
||||
- &artifact_babel_min
|
||||
path: ~/babel/packages/babel-standalone/babel.min.js
|
||||
|
||||
- &artifact_env
|
||||
path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.js
|
||||
|
||||
- &artifact_env_min
|
||||
path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.min.js
|
||||
|
||||
jobs:
|
||||
build:
|
||||
working_directory: ~/babel
|
||||
docker:
|
||||
- image: circleci/node:9
|
||||
steps:
|
||||
- checkout
|
||||
- restore-cache: *restore-yarn-cache
|
||||
- restore-cache: *restore-node-modules-cache
|
||||
- run: yarn --version
|
||||
- run: make test-ci-coverage
|
||||
# Builds babel-standalone with the regular Babel config
|
||||
- run: make build
|
||||
# test-ci-coverage doesn't test babel-standalone, as trying to gather coverage
|
||||
# data for a JS file that's several megabytes large is bound to fail. Here,
|
||||
# we just run the babel-standalone test separately.
|
||||
- run: ./node_modules/.bin/jest packages/babel-standalone/test/
|
||||
- run: ./node_modules/.bin/jest packages/babel-preset-env-standalone/test/
|
||||
- store_artifacts: *artifact_babel
|
||||
- store_artifacts: *artifact_babel_min
|
||||
- store_artifacts: *artifact_env
|
||||
- store_artifacts: *artifact_env_min
|
||||
- save_cache: *save-node-modules-cache
|
||||
- save_cache: *save-yarn-cache
|
||||
@@ -9,3 +9,6 @@ end_of_line = lf
|
||||
[*.{js,json}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{md,markdown}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
/lib
|
||||
/build
|
||||
/.git
|
||||
package.json
|
||||
lerna.json
|
||||
packages/babel-runtime
|
||||
!packages/babel-runtime/scripts
|
||||
!packages/babel-runtime/core-js.js
|
||||
@@ -12,13 +16,10 @@ codemods/*/lib
|
||||
codemods/*/dist
|
||||
codemods/*/test/fixtures
|
||||
codemods/*/test/tmp
|
||||
experimental/*/lib
|
||||
experimental/*/node_modules
|
||||
experimental/*/test/fixtures
|
||||
experimental/*/test/tmp
|
||||
experimental/babel-preset-env/data
|
||||
experimental/babel-preset-env/test/debug-fixtures
|
||||
packages/babel-preset-env/data
|
||||
packages/babel-preset-env/test/debug-fixtures
|
||||
packages/babel-preset-env-standalone/babel-preset-env.js
|
||||
packages/babel-preset-env-standalone/babel-preset-env.min.js
|
||||
packages/babel-standalone/babel.js
|
||||
packages/babel-standalone/babel.min.js
|
||||
packages/babylon/build
|
||||
packages/babylon/test/expressions
|
||||
|
||||
32
.eslintrc
32
.eslintrc
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"extends": "babel",
|
||||
"plugins": [
|
||||
"prettier"
|
||||
],
|
||||
"rules": {
|
||||
"curly": ["error", "multi-line"],
|
||||
"prettier/prettier": "error",
|
||||
"no-case-declarations": "error"
|
||||
},
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"packages/*/src/**/*.js",
|
||||
"experimental/*/src/**/*.js",
|
||||
"codemods/*/src/**/*.js"
|
||||
],
|
||||
"rules": {
|
||||
"no-undefined-identifier": "error"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [ "packages/*/test/**/*.js", "test/**/*.js" ],
|
||||
"env": {
|
||||
"mocha": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
33
.eslintrc.json
Normal file
33
.eslintrc.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"root": true,
|
||||
"extends": "babel",
|
||||
"plugins": ["prettier"],
|
||||
"rules": {
|
||||
"curly": ["error", "multi-line"],
|
||||
"prettier/prettier": "error",
|
||||
"no-case-declarations": "error"
|
||||
},
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["packages/*/src/**/*.js", "codemods/*/src/**/*.js"],
|
||||
"rules": {
|
||||
"no-undefined-identifier": "error",
|
||||
"no-deprecated-clone": "error"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"packages/*/test/**/*.js",
|
||||
"codemods/*/test/**/*.js",
|
||||
"packages/babel-helper-transform-fixture-test-runner/src/helpers.js",
|
||||
"test/**/*.js"
|
||||
],
|
||||
"env": {
|
||||
"jest": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -4,22 +4,20 @@
|
||||
.*/packages/.*/test
|
||||
.*/codemods/.*/lib
|
||||
.*/codemods/.*/test
|
||||
.*/experimental/.*/lib
|
||||
.*/experimental/.*/test
|
||||
.*/node_modules/conventional-changelog-core/
|
||||
|
||||
[include]
|
||||
packages/*/src
|
||||
codemods/*/src
|
||||
experimental/*/src
|
||||
|
||||
[libs]
|
||||
lib/file.js
|
||||
lib/parser.js
|
||||
lib/types.js
|
||||
lib/third-party-libs.js.flow
|
||||
packages/babel-types/lib/index.js.flow
|
||||
|
||||
[options]
|
||||
include_warnings=true
|
||||
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
|
||||
suppress_comment= \\(.\\|\n\\)*\\$FlowIssue
|
||||
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore
|
||||
|
||||
59
.github/ISSUE_TEMPLATE.md
vendored
59
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,63 +1,6 @@
|
||||
<!---
|
||||
Thanks for filing an issue 😄 ! Before you submit, please read the following:
|
||||
|
||||
Check the other issue templates if you are trying to submit a bug report, feature request, or question
|
||||
Search open/closed issues before submitting since someone might have asked the same thing before!
|
||||
|
||||
If you have a support request or question please submit them to one of this resources:
|
||||
|
||||
* Slack Community: https://slack.babeljs.io/
|
||||
* StackOverflow: http://stackoverflow.com/questions/tagged/babeljs using the tag `babeljs`
|
||||
* Also have a look at the readme for more information on how to get support:
|
||||
https://github.com/babel/babel/blob/master/README.md
|
||||
|
||||
Issues on GitHub are only related to problems of Babel itself and we cannot answer
|
||||
support questions here.
|
||||
-->
|
||||
|
||||
Choose one: is this a bug report or feature request?
|
||||
|
||||
<!--- Provide a general summary of the issue in the title above -->
|
||||
|
||||
### Input Code
|
||||
<!--- If you're describing a bug, please let us know which sample code reproduces your problem -->
|
||||
<!--- If you have link to our REPL or a standalone repo please link that! -->
|
||||
|
||||
```js
|
||||
var your => (code) => here;
|
||||
```
|
||||
|
||||
### Babel/Babylon Configuration (.babelrc, package.json, cli command)
|
||||
<!--- If describing a bug, tell us what your babel configuration looks like -->
|
||||
|
||||
```js
|
||||
{
|
||||
"your": { "config": "here" }
|
||||
}
|
||||
```
|
||||
|
||||
### Expected Behavior
|
||||
<!--- If you're describing a bug, tell us what should happen -->
|
||||
<!--- If you're suggesting a change/improvement, tell us how it should work -->
|
||||
|
||||
### Current Behavior
|
||||
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
|
||||
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
|
||||
|
||||
### Possible Solution
|
||||
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
||||
<!--- or ideas how to implement the addition or change -->
|
||||
|
||||
### Context
|
||||
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
||||
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
||||
|
||||
### Your Environment
|
||||
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
||||
|
||||
| software | version(s)
|
||||
| ---------------- | -------
|
||||
| Babel |
|
||||
| Babylon | <!-- This is only needed if you are using Babylon directly -->
|
||||
| node |
|
||||
| npm |
|
||||
| Operating System |
|
||||
|
||||
41
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
Normal file
41
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
name: 🐛 Bug Report
|
||||
about: If something isn't working as expected 🤔.
|
||||
|
||||
---
|
||||
|
||||
## Bug Report
|
||||
|
||||
**Current Behavior**
|
||||
A clear and concise description of the behavior.
|
||||
|
||||
**Input Code**
|
||||
- REPL or Repo link if applicable:
|
||||
|
||||
```js
|
||||
var your => (code) => here;
|
||||
```
|
||||
|
||||
**Expected behavior/code**
|
||||
A clear and concise description of what you expected to happen (or code).
|
||||
|
||||
**Babel Configuration (.babelrc, package.json, cli command)**
|
||||
|
||||
```js
|
||||
{
|
||||
"your": { "config": "here" }
|
||||
}
|
||||
```
|
||||
|
||||
**Environment**
|
||||
- Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]
|
||||
- Node/npm version: [e.g. Node 8/npm 5]
|
||||
- OS: [e.g. OSX 10.13.4, Windows 10]
|
||||
- Monorepo [e.g. yes/no/Lerna]
|
||||
- How you are using Babel: [e.g. `cli`, `register`, `loader`]
|
||||
|
||||
**Possible Solution**
|
||||
<!--- Only if you have suggestions on a fix for the bug -->
|
||||
|
||||
**Additional context/Screenshots**
|
||||
Add any other context about the problem here. If applicable, add screenshots to help explain.
|
||||
20
.github/ISSUE_TEMPLATE/Feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/Feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: 🚀 Feature Request
|
||||
about: I have a suggestion (and may want to implement it 🙂)!
|
||||
|
||||
---
|
||||
|
||||
## Feature Request
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I have an issue when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen. Add any considered drawbacks.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Teachability, Documentation, Adoption, Migration Strategy**
|
||||
If you can, explain how users will be able to use this and possibly write out a version the docs.
|
||||
Maybe a screenshot or design?
|
||||
41
.github/ISSUE_TEMPLATE/Regression-v7.md
vendored
Normal file
41
.github/ISSUE_TEMPLATE/Regression-v7.md
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
name: 💥 v7 Regression
|
||||
about: Report an unexpected behavior in v7 from v6 (Check the upgrade guide first ✌️)
|
||||
|
||||
---
|
||||
|
||||
# v7 Regression
|
||||
|
||||
> First check out: https://new.babeljs.io/docs/en/next/v7-migration.html
|
||||
> Also a partial upgrade tool: https://github.com/babel/babel-upgrade
|
||||
|
||||
**Potential Commit/PR that introduced the regression**
|
||||
If you have time to investigate, what PR/date introduced this issue.
|
||||
|
||||
**Describe the regression**
|
||||
A clear and concise description of what the regression is.
|
||||
|
||||
**Input Code**
|
||||
<!--- If you have link to our REPL or a standalone repo please link that! -->
|
||||
|
||||
```js
|
||||
var your => (code) => here;
|
||||
```
|
||||
|
||||
**Babel Configuration (.babelrc, package.json, cli command)**
|
||||
|
||||
```js
|
||||
{
|
||||
"your": { "config": "here" }
|
||||
}
|
||||
```
|
||||
|
||||
**Expected behavior/code**
|
||||
A clear and concise description of what you expected to happen (or code).
|
||||
|
||||
**Environment**
|
||||
- Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]
|
||||
- Node/npm version: [e.g. Node 8/npm 5]
|
||||
- OS: [e.g. OSX 10.13.4, Windows 10]
|
||||
- Monorepo [e.g. yes/no/Lerna]
|
||||
- How you are using Babel: [e.g. `cli`, `register`, `loader`]
|
||||
16
.github/ISSUE_TEMPLATE/Support_question.md
vendored
Normal file
16
.github/ISSUE_TEMPLATE/Support_question.md
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
name: 🤗 Support Question
|
||||
about: If you have a question 💬, please check out our Slack or StackOverflow!
|
||||
|
||||
---
|
||||
|
||||
--------------^ Click "Preview" for a nicer view!
|
||||
We primarily use GitHub as an issue tracker; for usage and support questions, please check out these resources below. Thanks! 😁.
|
||||
|
||||
---
|
||||
|
||||
* Slack Community Chat: https://babeljs.slack.com (you can sign-up at https://slack.babeljs.io/ for an invite)
|
||||
* StackOverflow: https://stackoverflow.com/questions/tagged/babeljs using the tag `babeljs`
|
||||
* Twitter: If it's just a quick question you can ping our Twitter: https://twitter.com/babeljs
|
||||
* Also have a look at the readme for more information on how to get support:
|
||||
https://github.com/babel/babel/blob/master/README.md
|
||||
24
.github/ISSUE_TEMPLATE/Support_us.md
vendored
Normal file
24
.github/ISSUE_TEMPLATE/Support_us.md
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: 🤝 Support us on Babel
|
||||
about: If you would like to support our efforts in maintaining this community-driven project 🙌!
|
||||
|
||||
---
|
||||
|
||||
--------------^ Click "Preview" for a nicer view!
|
||||
> Open Collective: https://opencollective.com/babel
|
||||
> Henry's Patreon: https://www.patreon.com/henryzhu
|
||||
|
||||
Help support Babel!
|
||||
|
||||
Babel has always been a community project, not really backed or owned by any single (or group) of companies. While some maintainers used to work at Facebook (and Henry at Adobe) no one was working on it full time and there certainly isn't a huge company or team anywhere doing all this work.
|
||||
|
||||
---
|
||||
|
||||
As a group of volunteers you can help us in a few ways
|
||||
|
||||
- Giving developer time on the project. (Message us on [Twitter](https://twitter.com/babeljs) or [Slack](https://slack.babeljs.io/) for guidance). Companies should be paying their employees to contribute back to the open source projects they use everyday.
|
||||
- Giving funds by becoming one of our sponsors/donators!
|
||||
|
||||
If you'd like to sustain the future of the project as a whole, we have an [Open Collective](https://opencollective.com/babel) that you can donate to. This is a way for funds to be allocated to the core team.
|
||||
|
||||
You can also support [Henry](https://github.com/hzoo) directly since I [left my job to work on Babel and Open Source full time](https://twitter.com/left_pad/status/969793227862790144) at my [Patreon](https://www.patreon.com/henryzhu).
|
||||
12
.github/lock.yml
vendored
Normal file
12
.github/lock.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# Configuration for lock-threads - https://github.com/dessant/lock-threads
|
||||
|
||||
# Number of days of inactivity before a closed issue or pull request is locked
|
||||
daysUntilLock: 91
|
||||
# Comment to post before locking. Set to `false` to disable
|
||||
lockComment: false
|
||||
only: issues
|
||||
lockLabel: 'outdated'
|
||||
|
||||
# Issues or pull requests with these labels will not be locked
|
||||
# exemptLabels:
|
||||
# - no-locking
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -16,15 +16,19 @@ package-lock.json
|
||||
!/packages/babel-runtime/core-js/map.js
|
||||
/packages/babel-runtime/helpers/*.js
|
||||
!/packages/babel-runtime/helpers/toArray.js
|
||||
!/packages/babel-runtime/helpers/iterableToArray.js
|
||||
!/packages/babel-runtime/helpers/temporalRef.js
|
||||
/packages/babel-runtime/helpers/builtin/*.js
|
||||
!/packages/babel-runtime/helpers/builtin/toArray.js
|
||||
!/packages/babel-runtime/helpers/builtin/iterableToArray.js
|
||||
!/packages/babel-runtime/helpers/builtin/temporalRef.js
|
||||
/packages/babel-runtime/helpers/builtin/es6/*.js
|
||||
!/packages/babel-runtime/helpers/builtin/es6/toArray.js
|
||||
!/packages/babel-runtime/helpers/builtin/es6/iterableToArray.js
|
||||
!/packages/babel-runtime/helpers/builtin/es6/temporalRef.js
|
||||
/packages/babel-runtime/helpers/es6/*.js
|
||||
!/packages/babel-runtime/helpers/es6/toArray.js
|
||||
!/packages/babel-runtime/helpers/es6/iterableToArray.js
|
||||
!/packages/babel-runtime/helpers/es6/temporalRef.js
|
||||
/packages/babel-register/test/.babel
|
||||
/packages/babel-cli/test/tmp
|
||||
@@ -34,6 +38,10 @@ package-lock.json
|
||||
/babel.sublime-workspace
|
||||
packages/babel-standalone/babel.js
|
||||
packages/babel-standalone/babel.min.js
|
||||
packages/babel-preset-env-standalone/babel-preset-env.js
|
||||
packages/babel-preset-env-standalone/babel-preset-env.min.js
|
||||
/codemods/*/lib
|
||||
/codemods/*/node_modules
|
||||
/packages/babylon/build
|
||||
.idea/
|
||||
/.changelog
|
||||
|
||||
2
.prettierignore
Normal file
2
.prettierignore
Normal file
@@ -0,0 +1,2 @@
|
||||
package.json
|
||||
packages/babel-preset-env/data
|
||||
11
.prettierrc
11
.prettierrc
@@ -1,9 +1,16 @@
|
||||
{
|
||||
"arrowParens": "avoid",
|
||||
"trailingComma": "es5",
|
||||
"useTabs": false,
|
||||
"semi": true,
|
||||
"singleQuote": false,
|
||||
"bracketSpacing": true,
|
||||
"jsxBracketSameLine": false,
|
||||
"tabWidth": 2,
|
||||
"parser": "babylon",
|
||||
"printWidth": 80,
|
||||
"overrides": [{
|
||||
"files": [
|
||||
"**/experimental/*/src/**/*.js",
|
||||
"**/experimental/*/test/**/*.js",
|
||||
"**/codemods/*/src/**/*.js",
|
||||
"**/codemods/*/test/**/*.js",
|
||||
"**/packages/*/src/**/*.js",
|
||||
|
||||
@@ -5,11 +5,11 @@ language: node_js
|
||||
cache:
|
||||
yarn: true
|
||||
directories:
|
||||
- node_modules
|
||||
- node_modules
|
||||
node_js:
|
||||
# We test the latest version on circleci
|
||||
- '8'
|
||||
- '6'
|
||||
- '4'
|
||||
|
||||
env:
|
||||
global:
|
||||
@@ -19,6 +19,8 @@ env:
|
||||
before_install:
|
||||
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||
|
||||
install: yarn --ignore-engines
|
||||
|
||||
before_script:
|
||||
- 'if [ "$JOB" = "babylon-flow-tests" ]; then make bootstrap-flow; fi'
|
||||
- 'if [ "$JOB" = "babylon-test262-tests" ]; then make bootstrap-test262; fi'
|
||||
|
||||
@@ -24,23 +24,24 @@ contributing, please read the
|
||||
## Not sure where to start?
|
||||
|
||||
- If you aren't just making a documentation change, you'll probably want to learn a bit about a few topics.
|
||||
- [ASTs](https://en.wikipedia.org/wiki/Abstract_syntax_tree) (Abstract Syntax Tree): The Babel AST [spec](https://github.com/babel/babel/tree/master/packages/babylon/blob/master/ast/spec.md) is a bit different from [ESTree](https://github.com/estree/estree). The differences are listed [here](https://github.com/babel/babel/tree/master/packages/babylon#output).
|
||||
- [ASTs](https://en.wikipedia.org/wiki/Abstract_syntax_tree) (Abstract Syntax Tree): The Babel AST [spec](https://github.com/babel/babel/blob/master/packages/babylon/ast/spec.md) is a bit different from [ESTree](https://github.com/estree/estree). The differences are listed [here](https://github.com/babel/babel/tree/master/packages/babylon#output).
|
||||
- Check out [`/doc`](https://github.com/babel/babel/tree/master/doc) for information about Babel's internals
|
||||
- Check out [the Babel Plugin Handbook](https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-plugin-handbook) - core plugins are written the same way as any other plugin!
|
||||
- Check out [AST Explorer](http://astexplorer.net/#/scUfOmVOG5) to learn more about ASTs or make your own plugin in the browser
|
||||
- When you feel ready to jump into the Babel source code, a good place to start is to look for issues tagged with [help wanted](https://github.com/babel/babel/labels/help%20wanted) and/or [good first issue](https://github.com/babel/babel/labels/good%20first%20issue).
|
||||
- Follow along with what we are working on by joining our Slack, following our announcements on [Twitter](https://twitter.com/babeljs), and reading (or participating!) in our [meeting notes](https://github.com/babel/notes).
|
||||
- Follow along with what we are working on by joining our [Slack](https://babeljs.slack.com) (you can sign-up [here](https://slack.babeljs.io/)
|
||||
for an invite), following our announcements on [Twitter](https://twitter.com/babeljs), and reading (or participating!) in our [meeting notes](https://github.com/babel/notes).
|
||||
- Check out our [website](http://babeljs.io/) and the [repo](https://github.com/babel/website)
|
||||
|
||||
## Chat
|
||||
|
||||
Feel free to check out the `#discussion`/`#development` channels on our [Slack](https://slack.babeljs.io). Some of us are always online to chat!
|
||||
Feel free to check out the `#discussion`/`#development` channels on our [Slack](https://slack.babeljs.io) (you can sign-up [here](https://slack.babeljs.io/) for an invite). Some of us are always online to chat!
|
||||
|
||||
## Developing
|
||||
|
||||
**Note:** Versions `< 5.1.10` can't be built.
|
||||
|
||||
Babel is built for Node 4 and up but we develop using Node 8 and yarn. You can check this with `node -v`.
|
||||
Babel is built for Node 6 and up but we develop using Node 8 and yarn. You can check this with `node -v`.
|
||||
|
||||
Make sure that Yarn is installed with version >= `0.28.0`.
|
||||
Installation instructions can be found here: https://yarnpkg.com/en/docs/install.
|
||||
@@ -115,8 +116,8 @@ $ TEST_ONLY=babel-cli make test
|
||||
`TEST_ONLY` will also match substrings of the package name:
|
||||
|
||||
```sh
|
||||
# Run tests for the babel-plugin-transform-classes package.
|
||||
$ TEST_ONLY=es2015-class make test
|
||||
# Run tests for the @babel/plugin-transform-classes package.
|
||||
$ TEST_ONLY=babel-plugin-transform-classes make test
|
||||
```
|
||||
|
||||
Use the `TEST_GREP` variable to run a subset of tests by name:
|
||||
@@ -139,6 +140,12 @@ $ TEST_DEBUG=true make test
|
||||
|
||||
You can combine `TEST_DEBUG` with `TEST_GREP` or `TEST_ONLY` to debug a subset of tests. If you plan to stay long in the debugger (which you'll likely do!), you may increase the test timeout by editing [test/mocha.opts](https://github.com/babel/babel/blob/master/test/mocha.opts).
|
||||
|
||||
To overwrite any test fixtures when fixing a bug or anything, add the env variable `OVERWRITE=true`
|
||||
|
||||
```sh
|
||||
$ OVERWRITE=true TEST_ONLY=babel-plugin-transform-classes make test-only
|
||||
```
|
||||
|
||||
To test the code coverage, use:
|
||||
|
||||
```sh
|
||||
@@ -161,43 +168,43 @@ In case you're locally getting errors which are not on the CI, it may be due to
|
||||
|
||||
Most packages in [`/packages`](https://github.com/babel/babel/tree/master/packages) have a `test` folder, however some tests might be in other packages or in [`/packages/babel-core`](https://github.com/babel/babel/tree/master/packages/babel-core/test/fixtures).
|
||||
|
||||
#### `babel-plugin-x`
|
||||
#### `@babel/plugin-x`
|
||||
|
||||
All the Babel plugins (and other packages) that have a `/test/fixtures` are written in a similar way.
|
||||
|
||||
For example, in [`babel-plugin-transform-exponentiation-operator/test`](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test):
|
||||
For example, in [`@babel/plugin-transform-exponentiation-operator/test`](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test):
|
||||
|
||||
- There is an `index.js` file. It imports our [test helper](https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-test-runner). (You don't have to worry about this).
|
||||
- There can be multiple folders under [`/fixtures`](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures)
|
||||
- There is an [`options.json`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/options.json) file whose function is similar to a `.babelrc` file, allowing you to pass in the plugins and settings you need for your tests.
|
||||
- For this test, we only need the relevant plugin, so it's just `{ "plugins": ["@babel/transform-exponentiation-operator"] }`.
|
||||
- For this test, we only need the relevant plugin, so it's just `{ "plugins": ["@babel/plugin-transform-exponentiation-operator"] }`.
|
||||
- If necessary, you can have an `options.json` with different options in each subfolder.
|
||||
|
||||
- In each subfolder, you can organize your directory structure by categories of tests. (Example: these folders can be named after the feature you are testing or can reference the issue number they fix)
|
||||
- Generally, there are two kinds of tests for plugins
|
||||
- The first is a simple test of the input and output produced by running Babel on some code. We do this by creating an [`actual.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/actual.js) file and an [`expected.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/expected.js) file.
|
||||
- If you need to expect an error, you can ignore creating the `expected.js` file and pass a new `throws` key to the `options.json` that contains the error string that is created.
|
||||
- The first is a simple test of the input and output produced by running Babel on some code. We do this by creating an [`input.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/input.js) file and an [`output.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/output.js) file. This kind of test only works in sub-subdirectories of `/fixtures`, i.e. `/fixtures/exponentian-operator/binary/input.js` and **not** `/fixtures/exponentian-operator/input.js`.
|
||||
- If you need to expect an error, you can ignore creating the `output.js` file and pass a new `throws` key to the `options.json` that contains the error string that is created.
|
||||
- The second and preferred type is a test that actually evaluates the produced code and asserts that certain properties are true or false. We do this by creating an [`exec.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/comprehensive/exec.js) file.
|
||||
|
||||
In an actual/expected test, you simply write out the code you want transformed in `actual.js`.
|
||||
In a fixture test, you simply write out the code you want transformed in `input.js`.
|
||||
|
||||
```js
|
||||
// actual.js
|
||||
// input.js
|
||||
2 ** 2;
|
||||
```
|
||||
|
||||
and the expected output after transforming it with your `options.json` in `expected.js`.
|
||||
and the expected output after transforming it with your `options.json` in `output.js`.
|
||||
|
||||
```js
|
||||
// expected.js
|
||||
// output.js
|
||||
Math.pow(2, 2);
|
||||
```
|
||||
In an `exec.js` test, we run or check that the code actually does what it's supposed to do rather than just check the static output.
|
||||
|
||||
```js
|
||||
// exec.js
|
||||
assert.equal(8, 2 ** 3);
|
||||
assert.equal(24, 3 * 2 ** 3);
|
||||
expect(2 ** 3).toBe(8);
|
||||
expect(3 * 2 ** 3).toBe(24);
|
||||
```
|
||||
|
||||
If you need to check for an error that is thrown you can add to the `options.json`
|
||||
@@ -205,8 +212,8 @@ If you need to check for an error that is thrown you can add to the `options.jso
|
||||
```js
|
||||
// options.json example
|
||||
{
|
||||
"plugins": [["@babel/proposal-object-rest-spread", { "useBuiltIns": "invalidOption" }]],
|
||||
"throws": "@babel/proposal-object-rest-spread currently only accepts a boolean option for useBuiltIns (defaults to false)"
|
||||
"plugins": [["@babel/plugin-proposal-object-rest-spread", { "useBuiltIns": "invalidOption" }]],
|
||||
"throws": "@babel/plugin-proposal-object-rest-spread currently only accepts a boolean option for useBuiltIns (defaults to false)"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -227,13 +234,25 @@ Inside the `packages/babylon/tests/fixtures` folder are categories/groupings of
|
||||
etc.). To add a test, create a folder under one of these groupings (or create a new one) with a
|
||||
descriptive name, and add the following:
|
||||
|
||||
* Create an `actual.js` file that contains the code you want Babylon to parse.
|
||||
* Create an `input.js` file that contains the code you want Babylon to parse.
|
||||
|
||||
* Add an `expected.json` file with the expected parser output. For added convenience, if there is no `expected.json` present, the test runner will generate one for you.
|
||||
* Add an `output.json` file with the expected parser output. For added convenience, if there is no `output.json` present, the test runner will generate one for you.
|
||||
|
||||
After writing tests for babylon, just build it by running:
|
||||
|
||||
```sh
|
||||
$ make build
|
||||
```
|
||||
|
||||
Then, to run the tests, use:
|
||||
|
||||
```sh
|
||||
$ TEST_ONLY=babylon make test-only
|
||||
```
|
||||
|
||||
#### Bootstrapping expected output
|
||||
|
||||
For both `babel-plugin-x` and `babylon`, you can easily generate an `expected.js`/`expected.json` automatically by just providing `actual.js` and running the tests as you usually would.
|
||||
For both `@babel/plugin-x` and `babylon`, you can easily generate an `output.js`/`output.json` automatically by just providing `input.js` and running the tests as you usually would.
|
||||
|
||||
```
|
||||
// Example
|
||||
@@ -244,8 +263,8 @@ For both `babel-plugin-x` and `babylon`, you can easily generate an `expected.js
|
||||
- comments
|
||||
- basic
|
||||
- block-trailing-comment
|
||||
- actual.js
|
||||
- expected.json (will be generated if not created)
|
||||
- input.js
|
||||
- output.json (will be generated if not created)
|
||||
```
|
||||
|
||||
### Debugging code
|
||||
@@ -267,7 +286,7 @@ To include the changes, we have to make sure to build Babel:
|
||||
$ make build
|
||||
```
|
||||
|
||||
Next, we need to execute `Generator.generate()`, which can be achieved by running a test case in the `babel-generator` package.
|
||||
Next, we need to execute `Generator.generate()`, which can be achieved by running a test case in the `@babel/generator` package.
|
||||
For example, we can run the test case that tests the generation of class declarations:
|
||||
|
||||
```bash
|
||||
@@ -275,7 +294,6 @@ $ TEST_DEBUG=true TEST_GREP=ClassDeclaration make test-only
|
||||
|
||||
./scripts/test.sh
|
||||
Debugger listening on port 9229.
|
||||
Warning: This is an experimental feature and could change at any time.
|
||||
To start debugging, open the following URL in Chrome:
|
||||
chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/3cdaebd2-be88-4e7b-a94b-432950ab72d0
|
||||
```
|
||||
@@ -298,8 +316,8 @@ Note that the code shown in Chrome DevTools is compiled code and therefore diffe
|
||||
- Start working about the Babel transform itself!
|
||||
|
||||
## Internals
|
||||
- AST spec ([babylon/ast/spec.md](https://github.com/babel/babel/tree/master/packages/babylon/blob/master/ast/spec.md))
|
||||
- Versioning ([doc/design/versioning.md](https://github.com/babel/babel/blob/master/doc/design/versioning.md)
|
||||
- AST spec ([babylon/ast/spec.md](https://github.com/babel/babel/blob/master/packages/babylon/ast/spec.md))
|
||||
- Versioning ([doc/design/versioning.md](https://github.com/babel/babel/blob/master/doc/design/versioning.md))
|
||||
- Monorepo ([doc/design/monorepo.md](https://github.com/babel/babel/blob/master/doc/design/monorepo.md))
|
||||
- Compiler environment support ([doc/design/compiler-environment-support.md](https://github.com/babel/babel/blob/master/doc/design/compiler-environment-support.md))
|
||||
- Compiler assumptions ([doc/design/compiler-assumptions.md](https://github.com/babel/babel/blob/master/doc/design/compiler-assumptions.md))
|
||||
|
||||
294
Gulpfile.js
294
Gulpfile.js
@@ -3,23 +3,24 @@
|
||||
const plumber = require("gulp-plumber");
|
||||
const through = require("through2");
|
||||
const chalk = require("chalk");
|
||||
const pump = require("pump");
|
||||
const uglify = require("gulp-uglify");
|
||||
const rename = require("gulp-rename");
|
||||
const newer = require("gulp-newer");
|
||||
const babel = require("gulp-babel");
|
||||
const watch = require("gulp-watch");
|
||||
const gulpWatch = require("gulp-watch");
|
||||
const gutil = require("gulp-util");
|
||||
const filter = require("gulp-filter");
|
||||
const gulp = require("gulp");
|
||||
const path = require("path");
|
||||
const merge = require("merge-stream");
|
||||
const RootMostResolvePlugin = require("webpack-dependency-suite")
|
||||
.RootMostResolvePlugin;
|
||||
const webpack = require("webpack");
|
||||
const webpackStream = require("webpack-stream");
|
||||
const merge = require("merge-stream");
|
||||
const rollup = require("rollup-stream");
|
||||
const source = require("vinyl-source-stream");
|
||||
const buffer = require("vinyl-buffer");
|
||||
const rollupBabel = require("rollup-plugin-babel");
|
||||
const rollupNodeResolve = require("rollup-plugin-node-resolve");
|
||||
const registerStandalonePackageTask = require("./scripts/gulp-tasks")
|
||||
.registerStandalonePackageTask;
|
||||
|
||||
const sources = ["codemods", "packages", "experimental"];
|
||||
const sources = ["codemods", "packages"];
|
||||
|
||||
function swapSrcWithLib(srcPath) {
|
||||
const parts = srcPath.split(path.sep);
|
||||
@@ -31,164 +32,141 @@ function getGlobFromSource(source) {
|
||||
return `./${source}/*/src/**/*.js`;
|
||||
}
|
||||
|
||||
gulp.task("default", ["build"]);
|
||||
function getIndexFromPackage(name) {
|
||||
return `${name}/src/index.js`;
|
||||
}
|
||||
|
||||
gulp.task("build", function() {
|
||||
function compilationLogger(rollup) {
|
||||
return through.obj(function(file, enc, callback) {
|
||||
gutil.log(
|
||||
`Compiling '${chalk.cyan(file.relative)}'${
|
||||
rollup ? " with rollup " : ""
|
||||
}...`
|
||||
);
|
||||
callback(null, file);
|
||||
});
|
||||
}
|
||||
|
||||
function errorsLogger() {
|
||||
return plumber({
|
||||
errorHandler(err) {
|
||||
gutil.log(err.stack);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function rename(fn) {
|
||||
return through.obj(function(file, enc, callback) {
|
||||
file.path = fn(file);
|
||||
callback(null, file);
|
||||
});
|
||||
}
|
||||
|
||||
function buildBabel(exclude) {
|
||||
return merge(
|
||||
sources.map(source => {
|
||||
const base = path.join(__dirname, source);
|
||||
const f = filter(["**", "!**/packages/babylon/**"]);
|
||||
|
||||
return gulp
|
||||
.src(getGlobFromSource(source), { base: base })
|
||||
.pipe(f)
|
||||
.pipe(
|
||||
plumber({
|
||||
errorHandler: function(err) {
|
||||
gutil.log(err.stack);
|
||||
},
|
||||
})
|
||||
)
|
||||
.pipe(
|
||||
newer({
|
||||
dest: base,
|
||||
map: swapSrcWithLib,
|
||||
})
|
||||
)
|
||||
.pipe(
|
||||
through.obj(function(file, enc, callback) {
|
||||
gutil.log("Compiling", "'" + chalk.cyan(file.relative) + "'...");
|
||||
callback(null, file);
|
||||
})
|
||||
)
|
||||
let stream = gulp.src(getGlobFromSource(source), { base: base });
|
||||
|
||||
if (exclude) {
|
||||
const filters = exclude.map(p => `!**/${p}/**`);
|
||||
filters.unshift("**");
|
||||
stream = stream.pipe(filter(filters));
|
||||
}
|
||||
|
||||
return stream
|
||||
.pipe(errorsLogger())
|
||||
.pipe(newer({ dest: base, map: swapSrcWithLib }))
|
||||
.pipe(compilationLogger())
|
||||
.pipe(babel())
|
||||
.pipe(
|
||||
through.obj(function(file, enc, callback) {
|
||||
// Passing 'file.relative' because newer() above uses a relative
|
||||
// path and this keeps it consistent.
|
||||
file.path = path.resolve(file.base, swapSrcWithLib(file.relative));
|
||||
callback(null, file);
|
||||
})
|
||||
// Passing 'file.relative' because newer() above uses a relative
|
||||
// path and this keeps it consistent.
|
||||
rename(file => path.resolve(file.base, swapSrcWithLib(file.relative)))
|
||||
)
|
||||
.pipe(gulp.dest(base));
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
gulp.task("watch", ["build"], function() {
|
||||
watch(sources.map(getGlobFromSource), { debounceDelay: 200 }, function() {
|
||||
gulp.start("build");
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task("build-babel-standalone", cb => {
|
||||
pump(
|
||||
[
|
||||
gulp.src(__dirname + "/packages/babel-standalone/src/index.js"),
|
||||
webpackBuild(),
|
||||
gulp.dest(__dirname + "/packages/babel-standalone"),
|
||||
uglify(),
|
||||
rename({ extname: ".min.js" }),
|
||||
gulp.dest(__dirname + "/packages/babel-standalone"),
|
||||
],
|
||||
cb
|
||||
);
|
||||
});
|
||||
|
||||
function webpackBuild() {
|
||||
let version = require("./packages/babel-core/package.json").version;
|
||||
|
||||
// If this build is part of a pull request, include the pull request number in
|
||||
// the version number.
|
||||
if (process.env.CIRCLE_PR_NUMBER) {
|
||||
version += "+pr." + process.env.CIRCLE_PR_NUMBER;
|
||||
}
|
||||
|
||||
const config = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: /node_modules/,
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
// Some of the node_modules may have their own "babel" section in
|
||||
// their project.json (or a ".babelrc" file). We need to ignore
|
||||
// those as we're using our own Babel options.
|
||||
babelrc: false,
|
||||
presets: [
|
||||
[
|
||||
"@babel/env",
|
||||
{
|
||||
loose: true,
|
||||
exclude: ["transform-typeof-symbol"],
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
// Some of the node_modules may have their own "babel" section in
|
||||
// their project.json (or a ".babelrc" file). We need to ignore
|
||||
// those as we're using our own Babel options.
|
||||
babelrc: false,
|
||||
presets: [
|
||||
[
|
||||
"@babel/env",
|
||||
{
|
||||
loose: true,
|
||||
exclude: ["transform-typeof-symbol"],
|
||||
},
|
||||
],
|
||||
["@babel/stage-0", { loose: true }],
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
// babylon is already bundled and does not require parsing
|
||||
noParse: [/babylon\/lib/],
|
||||
},
|
||||
node: {
|
||||
// Mock Node.js modules that Babel require()s but that we don't
|
||||
// particularly care about.
|
||||
fs: "empty",
|
||||
module: "empty",
|
||||
net: "empty",
|
||||
},
|
||||
output: {
|
||||
filename: "babel.js",
|
||||
library: "Babel",
|
||||
libraryTarget: "umd",
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
"process.env.NODE_ENV": '"production"',
|
||||
BABEL_VERSION: JSON.stringify(version),
|
||||
VERSION: JSON.stringify(version),
|
||||
}),
|
||||
/*new webpack.NormalModuleReplacementPlugin(
|
||||
/..\/..\/package/,
|
||||
"../../../../src/babel-package-shim"
|
||||
),*/
|
||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||
],
|
||||
resolve: {
|
||||
plugins: [
|
||||
// Dedupe packages that are used across multiple plugins.
|
||||
// This replaces DedupePlugin from Webpack 1.x
|
||||
new RootMostResolvePlugin(__dirname, true),
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
return webpackStream(config, webpack);
|
||||
// To write JSON for debugging:
|
||||
/*return webpackStream(config, webpack, (err, stats) => {
|
||||
require('gulp-util').log(stats.toString({colors: true}));
|
||||
require('fs').writeFileSync('webpack-debug.json', JSON.stringify(stats.toJson()));
|
||||
});*/
|
||||
}
|
||||
|
||||
function buildRollup(packages) {
|
||||
return merge(
|
||||
packages.map(pkg => {
|
||||
return rollup({
|
||||
input: getIndexFromPackage(pkg),
|
||||
format: "cjs",
|
||||
plugins: [
|
||||
rollupBabel({
|
||||
envName: "babylon",
|
||||
}),
|
||||
rollupNodeResolve(),
|
||||
],
|
||||
})
|
||||
.pipe(source("index.js"))
|
||||
.pipe(buffer())
|
||||
.pipe(errorsLogger())
|
||||
.pipe(compilationLogger(/* rollup */ true))
|
||||
.pipe(gulp.dest(path.join(pkg, "lib")));
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
gulp.task("build", function() {
|
||||
const bundles = ["packages/babylon"];
|
||||
|
||||
return merge([buildBabel(/* exclude */ bundles), buildRollup(bundles)]);
|
||||
});
|
||||
|
||||
gulp.task("default", gulp.series("build"));
|
||||
|
||||
gulp.task("build-no-bundle", () => buildBabel());
|
||||
|
||||
gulp.task(
|
||||
"watch",
|
||||
gulp.series("build-no-bundle", function watch() {
|
||||
gulpWatch(
|
||||
sources.map(getGlobFromSource),
|
||||
{ debounceDelay: 200 },
|
||||
gulp.task("build-no-bundle")
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
registerStandalonePackageTask(
|
||||
gulp,
|
||||
"babel",
|
||||
"Babel",
|
||||
path.join(__dirname, "packages"),
|
||||
require("./packages/babel-core/package.json").version
|
||||
);
|
||||
|
||||
const presetEnvWebpackPlugins = [
|
||||
new webpack.NormalModuleReplacementPlugin(
|
||||
/\.\/available-plugins/,
|
||||
require.resolve(
|
||||
path.join(
|
||||
__dirname,
|
||||
"./packages/babel-preset-env-standalone/src/available-plugins"
|
||||
)
|
||||
)
|
||||
),
|
||||
new webpack.NormalModuleReplacementPlugin(
|
||||
/caniuse-lite\/data\/regions\/.+/,
|
||||
require.resolve(
|
||||
path.join(
|
||||
__dirname,
|
||||
"./packages/babel-preset-env-standalone/src/caniuse-lite-regions"
|
||||
)
|
||||
)
|
||||
),
|
||||
];
|
||||
|
||||
registerStandalonePackageTask(
|
||||
gulp,
|
||||
"babel-preset-env",
|
||||
"babelPresetEnv",
|
||||
path.join(__dirname, "packages"),
|
||||
require("./packages/babel-preset-env/package.json").version,
|
||||
presetEnvWebpackPlugins
|
||||
);
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-2017 Sebastian McKenzie <sebmck@gmail.com>
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
77
Makefile
77
Makefile
@@ -1,57 +1,64 @@
|
||||
MAKEFLAGS = -j1
|
||||
FLOW_COMMIT = 4cc2b9f7fadf2e9e445ee9b7b980c65d69d3fbc0
|
||||
TEST262_COMMIT = 1282e842febf418ca27df13fa4b32f7e5021b470
|
||||
|
||||
export NODE_ENV = test
|
||||
FLOW_COMMIT = 395e045c18d537fcbbc552a96ef2cdcd70b4ab52
|
||||
TEST262_COMMIT = 40883f4c6ae17e073dfd03e34f73a6bf8c855595
|
||||
|
||||
# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967
|
||||
export FORCE_COLOR = true
|
||||
|
||||
SOURCES = packages codemods experimental
|
||||
SOURCES = packages codemods
|
||||
|
||||
.PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap
|
||||
|
||||
build: clean
|
||||
make clean-lib
|
||||
# Build babylon before building all other projects
|
||||
make build-babylon
|
||||
build: clean clean-lib
|
||||
./node_modules/.bin/gulp build
|
||||
ifneq ("$(BABEL_ENV)", "cov")
|
||||
node ./packages/babel-types/scripts/generateTypeHelpers.js
|
||||
# call build again as the generated files might need to be compiled again.
|
||||
./node_modules/.bin/gulp build
|
||||
# generate flow and typescript typings
|
||||
node scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow
|
||||
node scripts/generators/typescript.js > ./packages/babel-types/lib/index.d.ts
|
||||
# generate docs
|
||||
node scripts/generators/docs.js > ./packages/babel-types/README.md
|
||||
ifneq ("$(BABEL_COVERAGE)", "true")
|
||||
make build-standalone
|
||||
make build-preset-env-standalone
|
||||
endif
|
||||
|
||||
build-babylon:
|
||||
cd packages/babylon; \
|
||||
./node_modules/.bin/rollup -c
|
||||
|
||||
build-standalone:
|
||||
./node_modules/.bin/gulp build-babel-standalone
|
||||
|
||||
build-preset-env-standalone:
|
||||
./node_modules/.bin/gulp build-babel-preset-env-standalone
|
||||
|
||||
build-dist: build
|
||||
cd packages/babel-polyfill; \
|
||||
scripts/build-dist.sh
|
||||
cd packages/babel-runtime; \
|
||||
node scripts/build-dist.js
|
||||
node scripts/generate-babel-types-docs.js
|
||||
|
||||
watch: clean
|
||||
make clean-lib
|
||||
watch: clean clean-lib
|
||||
|
||||
# Ensure that build artifacts for types are created during local
|
||||
# development too.
|
||||
BABEL_ENV=development ./node_modules/.bin/gulp build-no-bundle
|
||||
node ./packages/babel-types/scripts/generateTypeHelpers.js
|
||||
node scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow
|
||||
BABEL_ENV=development ./node_modules/.bin/gulp watch
|
||||
|
||||
flow:
|
||||
./node_modules/.bin/flow check --strip-root
|
||||
|
||||
lint:
|
||||
./node_modules/.bin/eslint scripts $(SOURCES) *.js --format=codeframe --rulesdir="./scripts/eslint_rules"
|
||||
./node_modules/.bin/eslint scripts $(SOURCES) '*.js' '**/.*.js' --format=codeframe --rulesdir="./scripts/eslint_rules"
|
||||
|
||||
fix:
|
||||
./node_modules/.bin/eslint scripts $(SOURCES) *.js --format=codeframe --fix --rulesdir="./scripts/eslint_rules"
|
||||
# The config is hardcoded because otherwise prettier searches for it and also picks up some broken package.json files from tests
|
||||
./node_modules/.bin/prettier --config .prettierrc --write --ignore-path .eslintignore '**/*.json'
|
||||
./node_modules/.bin/eslint scripts $(SOURCES) '*.js' '**/.*.js' --format=codeframe --fix --rulesdir="./scripts/eslint_rules"
|
||||
|
||||
clean: test-clean
|
||||
rm -rf packages/babel-polyfill/browser*
|
||||
rm -rf packages/babel-polyfill/dist
|
||||
# rm -rf packages/babel-runtime/helpers
|
||||
# rm -rf packages/babel-runtime/core-js
|
||||
rm -rf coverage
|
||||
rm -rf packages/*/npm-debug*
|
||||
|
||||
@@ -60,19 +67,17 @@ test-clean:
|
||||
$(call clean-source-test, $(source)))
|
||||
|
||||
test-only:
|
||||
./scripts/test.sh
|
||||
BABEL_ENV=test ./scripts/test.sh
|
||||
make test-clean
|
||||
|
||||
test: lint test-only
|
||||
|
||||
test-ci:
|
||||
make bootstrap
|
||||
make test-only
|
||||
test-ci: bootstrap test-only
|
||||
|
||||
test-ci-coverage: SHELL:=/bin/bash
|
||||
test-ci-coverage:
|
||||
BABEL_ENV=cov make bootstrap
|
||||
./scripts/test-cov.sh
|
||||
BABEL_COVERAGE=true BABEL_ENV=test make bootstrap
|
||||
BABEL_ENV=test TEST_TYPE=cov ./scripts/test-cov.sh
|
||||
bash <(curl -s https://codecov.io/bash) -f coverage/coverage-final.json
|
||||
|
||||
bootstrap-flow:
|
||||
@@ -84,9 +89,7 @@ bootstrap-flow:
|
||||
test-flow:
|
||||
node scripts/tests/flow/run_babylon_flow_tests.js
|
||||
|
||||
test-flow-ci:
|
||||
make bootstrap
|
||||
make test-flow
|
||||
test-flow-ci: bootstrap test-flow
|
||||
|
||||
test-flow-update-whitelist:
|
||||
node scripts/tests/flow/run_babylon_flow_tests.js --update-whitelist
|
||||
@@ -100,9 +103,7 @@ bootstrap-test262:
|
||||
test-test262:
|
||||
node scripts/tests/test262/run_babylon_test262.js
|
||||
|
||||
test-test262-ci:
|
||||
make bootstrap
|
||||
make test-test262
|
||||
test-test262-ci: bootstrap test-test262
|
||||
|
||||
test-test262-update-whitelist:
|
||||
node scripts/tests/test262/run_babylon_test262.js --update-whitelist
|
||||
@@ -110,6 +111,8 @@ test-test262-update-whitelist:
|
||||
publish:
|
||||
git pull --rebase
|
||||
make clean-lib
|
||||
rm -rf packages/babel-runtime/helpers
|
||||
rm -rf packages/babel-runtime/core-js
|
||||
BABEL_ENV=production make build-dist
|
||||
make test
|
||||
# not using lerna independent mode atm, so only update packages that have changed since we use ^
|
||||
@@ -117,10 +120,9 @@ publish:
|
||||
./node_modules/.bin/lerna publish --force-publish=* --exact --skip-temp-tag
|
||||
make clean
|
||||
|
||||
bootstrap:
|
||||
make clean-all
|
||||
yarn
|
||||
./node_modules/.bin/lerna bootstrap
|
||||
bootstrap: clean-all
|
||||
yarn --ignore-engines
|
||||
./node_modules/.bin/lerna bootstrap -- --ignore-engines
|
||||
make build
|
||||
cd packages/babel-runtime; \
|
||||
node scripts/build-dist.js
|
||||
@@ -132,6 +134,7 @@ clean-lib:
|
||||
clean-all:
|
||||
rm -rf node_modules
|
||||
rm -rf package-lock.json
|
||||
rm -rf .changelog
|
||||
|
||||
$(foreach source, $(SOURCES), \
|
||||
$(call clean-source-all, $(source)))
|
||||
|
||||
142
README.md
142
README.md
@@ -24,10 +24,55 @@
|
||||
<a href="https://medium.com/friendship-dot-js/i-peeked-into-my-node-modules-directory-and-you-wont-believe-what-happened-next-b89f63d21558"><img alt="Business Strategy Status" src="https://img.shields.io/badge/business%20model-flavortown-green.svg"></a>
|
||||
</p>
|
||||
|
||||
Babel is community-driven and thus mostly maintained by a group of [volunteers](https://babeljs.io/team). It has a lot of [companies and projects](http://babeljs.io/users) using it but almost no sponsors/people funded to work on it. If you'd like to help maintain the future of the project, please consider:
|
||||
Babel is a community-driven project used by many companies and projects, and is maintained by a group of [volunteers](https://babeljs.io/team). If you'd like to help support the future of the project, please consider:
|
||||
|
||||
- Giving developer time on the project. (Message us on [Twitter](https://twitter.com/babeljs) or [Slack](slack.babeljs.io))
|
||||
- [Giving funds by becoming a backer/sponsor on OpenCollective](https://opencollective.com/babel)
|
||||
- Giving developer time on the project. (Message us on [Twitter](https://twitter.com/babeljs) or [Slack](https://slack.babeljs.io/) for guidance!)
|
||||
- Giving funds by becoming a sponsor (see below)!
|
||||
|
||||
## Open Collective Sponsors
|
||||
|
||||
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/babel#sponsor)]
|
||||
|
||||
<a href="https://opencollective.com/babel/sponsor/0/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/1/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/2/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/3/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/4/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/5/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/6/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/7/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/8/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/9/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/9/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/10/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/10/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/11/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/11/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/12/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/12/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/13/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/13/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/14/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/14/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/15/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/15/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/16/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/16/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/17/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/17/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/18/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/18/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/19/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/19/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/20/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/20/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/21/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/21/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/22/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/22/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/23/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/23/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/24/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/24/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/25/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/25/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/26/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/26/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/27/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/27/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/28/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/29/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/29/avatar.svg"></a>
|
||||
|
||||
## Patreon Sponsors
|
||||
|
||||
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://www.patreon.com/henryzhu)]
|
||||
|
||||
## Bronze
|
||||
|
||||
<a href="http://teamextension.io/" target="_blank"><img src="https://teamextension.io/dist/img/logo/te-logo-compact.png" height="64"></a>
|
||||
<a href="https://webflow.com/" target="_blank"><img src="https://opencollective.com/proxy/images/?src=https%3A%2F%2Fopencollective-production.s3-us-west-1.amazonaws.com%2F4a5024b0-8cf2-11e7-b1a2-b30b1de1463c.png&height=64"></a>
|
||||
<p><a href="https://twitter.com/mikesherov">Mike Sherov</a></p>
|
||||
|
||||
## Intro
|
||||
|
||||
@@ -50,11 +95,6 @@ Babel is a tool that helps you write code in the latest version of JavaScript. W
|
||||
|
||||
Try it out at our [REPL](https://babeljs.io/repl/build/master#?code_lz=NoRgNATGDMC6B0BbAhgBwBQDsAEBeAfNjgNTYgCUA3EA&lineWrap=true&presets=es2015%2Ces2016%2Ces2017&version=7.0.0-beta.2).
|
||||
|
||||
- [FAQ](#faq)
|
||||
- [Backers](#backers)
|
||||
- [Sponsors](#sponsors)
|
||||
- [License](#license)
|
||||
|
||||
## FAQ
|
||||
|
||||
### Who maintains Babel?
|
||||
@@ -63,19 +103,23 @@ Mostly a handful of volunteers! Please check out our [team page](https://babeljs
|
||||
|
||||
### Looking for support?
|
||||
|
||||
For questions and support please visit join our [Slack Community](https://slack.babeljs.io/), ask a question on [Stack Overflow](http://stackoverflow.com/questions/tagged/babeljs), or ping us on [Twitter](https://twitter.com/babeljs/).
|
||||
For questions and support please visit join our [Slack Community](https://slack.babeljs.io/) (you can sign-up [here](https://slack.babeljs.io/) for an invite), ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/babeljs), or ping us on [Twitter](https://twitter.com/babeljs).
|
||||
|
||||
### Is there a Babel song?
|
||||
|
||||
I'm so glad you asked: [Hallelujah —— In Praise of Babel](SONG.md) by [@angus-c](https://github.com/angus-c). Tweet us your recordings!
|
||||
|
||||
### Where are the docs?
|
||||
|
||||
Check out our website: [babeljs.io](http://babeljs.io/), and report issues/features at [babel/website](https://github.com/babel/website/issues).
|
||||
Check out our website: [babeljs.io](https://babeljs.io/), and report issues/features at [babel/website](https://github.com/babel/website/issues).
|
||||
|
||||
### Want to report a bug or request a feature?
|
||||
|
||||
Please read through our [CONTRIBUTING.md](https://github.com/babel/babel/blob/master/CONTRIBUTING.md) and fill out the issue template at [babel/issues](https://github.com/babel/babel/issues)!
|
||||
Please read through our [CONTRIBUTING.md](CONTRIBUTING.md) and fill out the issue template at [babel/issues](https://github.com/babel/babel/issues)!
|
||||
|
||||
### Want to contribute to Babel?
|
||||
|
||||
Check out our [CONTRIBUTING.md](https://github.com/babel/babel/blob/master/CONTRIBUTING.md) to get started with setting up the repo.
|
||||
Check out our [CONTRIBUTING.md](CONTRIBUTING.md) to get started with setting up the repo.
|
||||
|
||||
- If you have already joined Slack, join our [#development](https://babeljs.slack.com/messages/development) channel and say hi!
|
||||
- Check out the issues with the [good first issue](https://github.com/babel/babel/labels/good%20first%20issue) and [help wanted](https://github.com/babel/babel/labels/help%20wanted) label. We suggest also looking at the closed ones to get a sense of the kinds of issues you can tackle.
|
||||
@@ -84,78 +128,8 @@ Check out our [CONTRIBUTING.md](https://github.com/babel/babel/blob/master/CONTR
|
||||
|
||||
### How is the repo structured?
|
||||
|
||||
The Babel repo is managed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md) that is composed of many [npm packages](/packages#readme).
|
||||
|
||||
## Backers
|
||||
|
||||
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/babel#backer)]
|
||||
|
||||
<a href="https://opencollective.com/babel/backer/0/website" target="_blank"><img src="https://opencollective.com/babel/backer/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/1/website" target="_blank"><img src="https://opencollective.com/babel/backer/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/2/website" target="_blank"><img src="https://opencollective.com/babel/backer/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/3/website" target="_blank"><img src="https://opencollective.com/babel/backer/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/4/website" target="_blank"><img src="https://opencollective.com/babel/backer/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/5/website" target="_blank"><img src="https://opencollective.com/babel/backer/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/6/website" target="_blank"><img src="https://opencollective.com/babel/backer/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/7/website" target="_blank"><img src="https://opencollective.com/babel/backer/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/8/website" target="_blank"><img src="https://opencollective.com/babel/backer/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/9/website" target="_blank"><img src="https://opencollective.com/babel/backer/9/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/10/website" target="_blank"><img src="https://opencollective.com/babel/backer/10/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/11/website" target="_blank"><img src="https://opencollective.com/babel/backer/11/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/12/website" target="_blank"><img src="https://opencollective.com/babel/backer/12/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/13/website" target="_blank"><img src="https://opencollective.com/babel/backer/13/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/14/website" target="_blank"><img src="https://opencollective.com/babel/backer/14/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/15/website" target="_blank"><img src="https://opencollective.com/babel/backer/15/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/16/website" target="_blank"><img src="https://opencollective.com/babel/backer/16/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/17/website" target="_blank"><img src="https://opencollective.com/babel/backer/17/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/18/website" target="_blank"><img src="https://opencollective.com/babel/backer/18/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/19/website" target="_blank"><img src="https://opencollective.com/babel/backer/19/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/20/website" target="_blank"><img src="https://opencollective.com/babel/backer/20/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/21/website" target="_blank"><img src="https://opencollective.com/babel/backer/21/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/22/website" target="_blank"><img src="https://opencollective.com/babel/backer/22/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/23/website" target="_blank"><img src="https://opencollective.com/babel/backer/23/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/24/website" target="_blank"><img src="https://opencollective.com/babel/backer/24/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/25/website" target="_blank"><img src="https://opencollective.com/babel/backer/25/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/26/website" target="_blank"><img src="https://opencollective.com/babel/backer/26/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/27/website" target="_blank"><img src="https://opencollective.com/babel/backer/27/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/28/website" target="_blank"><img src="https://opencollective.com/babel/backer/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/29/website" target="_blank"><img src="https://opencollective.com/babel/backer/29/avatar.svg"></a>
|
||||
|
||||
## Sponsors
|
||||
|
||||
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/babel#sponsor)]
|
||||
|
||||
<a href="https://opencollective.com/babel/sponsor/0/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/1/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/2/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/3/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/4/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/5/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/6/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/7/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/8/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/9/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/9/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/10/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/10/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/11/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/11/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/12/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/12/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/13/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/13/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/14/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/14/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/15/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/15/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/16/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/16/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/17/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/17/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/18/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/18/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/19/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/19/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/20/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/20/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/21/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/21/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/22/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/22/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/23/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/23/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/24/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/24/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/25/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/25/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/26/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/26/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/27/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/27/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/28/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/29/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/29/avatar.svg"></a>
|
||||
The Babel repo is managed as a [monorepo](doc/design/monorepo.md) that is composed of many [npm packages](packages/README.md).
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/babel/babel/blob/master/LICENSE)
|
||||
[MIT](LICENSE)
|
||||
|
||||
67
SONG.md
Normal file
67
SONG.md
Normal file
@@ -0,0 +1,67 @@
|
||||
## Hallelujah—In Praise of Babel
|
||||
|
||||
I heard there was a clever trick
|
||||
That rewrote all your JavaScript
|
||||
But you don’t really care for magic, do you
|
||||
Well it goes like this: the source, the dist
|
||||
The ES five, the ES six
|
||||
The sacred script transforming Hallelujah
|
||||
|
||||
Hallelujah, Hallelujah
|
||||
Hallelujah, Hallelujah
|
||||
|
||||
So I added all the shiny things
|
||||
Classes, spreads and template strings
|
||||
Through syntax sugared code I tried to woo you
|
||||
Generators, const and let
|
||||
I used them all without regret
|
||||
And it’s a terse and a destructured Hallelujah
|
||||
|
||||
Hallelujah etc.
|
||||
|
||||
Well my faith was strong but I needed proof
|
||||
The standard was my source of truth
|
||||
But TC39 meant nothing to you
|
||||
So even though you weren’t impressed
|
||||
I checked the build against the spec
|
||||
And it’s a more-or-less compliant Hallelujah
|
||||
|
||||
Hallelujah etc.
|
||||
|
||||
Now you say the build step’s too complex
|
||||
And you claim no need for ES Next
|
||||
Well I used to think that way before I knew you
|
||||
But your code grows older with each line
|
||||
It’s a joyless dirge on a withered vine
|
||||
It’s a threnody for a bygone Hallelujah
|
||||
|
||||
Hallelujah etc.
|
||||
|
||||
Yes I learned about the danger signs
|
||||
How they’d polyfilled a thousand lines
|
||||
The cost of using Maps and Symbols threw you
|
||||
Still I disregarded common sense
|
||||
Now my source is small but the build’s immense
|
||||
And it’s a slow and unresponsive Hallelujah
|
||||
|
||||
Hallelujah etc.
|
||||
|
||||
There was a time when they let me know
|
||||
What’s really going on below
|
||||
But now there’s only source maps there to school you
|
||||
And debugging’s not a progress march
|
||||
It’s a frenzied fumble in the dark
|
||||
It’s a labyrinthine search for Hallelujah
|
||||
|
||||
Hallelujah etc.
|
||||
|
||||
Well, maybe there’s a god up there
|
||||
But all I ever got from prayers
|
||||
Was broken builds and errors that would spook you
|
||||
And that anguished cry you hear at night
|
||||
Is the plugin I forgot to write
|
||||
It’s a cold and it’s a broken Hallelujah
|
||||
|
||||
Hallelujah etc.
|
||||
|
||||
[Angus Croll](https://github.com/angus-c)
|
||||
97
babel.config.js
Normal file
97
babel.config.js
Normal file
@@ -0,0 +1,97 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function(api) {
|
||||
const env = api.env();
|
||||
|
||||
const includeCoverage = process.env.BABEL_COVERAGE === "true";
|
||||
|
||||
const envOpts = {
|
||||
loose: true,
|
||||
modules: false,
|
||||
exclude: ["transform-typeof-symbol"],
|
||||
};
|
||||
|
||||
let convertESM = true;
|
||||
let ignoreLib = true;
|
||||
|
||||
switch (env) {
|
||||
// Configs used during bundling builds.
|
||||
case "babylon":
|
||||
case "standalone":
|
||||
convertESM = false;
|
||||
ignoreLib = false;
|
||||
break;
|
||||
case "production":
|
||||
// Config during builds before publish.
|
||||
envOpts.targets = {
|
||||
node: 6,
|
||||
};
|
||||
break;
|
||||
case "development":
|
||||
envOpts.debug = true;
|
||||
envOpts.targets = {
|
||||
node: "current",
|
||||
};
|
||||
break;
|
||||
case "test":
|
||||
envOpts.targets = {
|
||||
node: "current",
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
const config = {
|
||||
comments: false,
|
||||
ignore: [
|
||||
// These may not be strictly necessary with the newly-limited scope of
|
||||
// babelrc searching, but including them for now because we had them
|
||||
// in our .babelignore before.
|
||||
"packages/*/test/fixtures",
|
||||
ignoreLib ? "packages/*/lib" : null,
|
||||
"packages/babel-standalone/babel.js",
|
||||
"packages/babel-preset-env-standalone/babel-preset-env.js",
|
||||
].filter(Boolean),
|
||||
presets: [["@babel/env", envOpts]],
|
||||
plugins: [
|
||||
// TODO: Use @babel/preset-flow when
|
||||
// https://github.com/babel/babel/issues/7233 is fixed
|
||||
"@babel/plugin-transform-flow-strip-types",
|
||||
["@babel/proposal-class-properties", { loose: true }],
|
||||
"@babel/proposal-export-namespace-from",
|
||||
"@babel/proposal-numeric-separator",
|
||||
[
|
||||
"@babel/proposal-object-rest-spread",
|
||||
{ useBuiltIns: true, loose: true },
|
||||
],
|
||||
|
||||
// Explicitly use the lazy version of CommonJS modules.
|
||||
convertESM ? ["@babel/transform-modules-commonjs", { lazy: true }] : null,
|
||||
].filter(Boolean),
|
||||
overrides: [
|
||||
{
|
||||
test: "packages/babylon",
|
||||
plugins: [
|
||||
"babel-plugin-transform-charcodes",
|
||||
["@babel/transform-for-of", { assumeArray: true }],
|
||||
],
|
||||
},
|
||||
{
|
||||
test: "./packages/babel-register",
|
||||
plugins: [
|
||||
// Override the root options to disable lazy imports for babel-register
|
||||
// because otherwise the require hook will try to lazy-import things
|
||||
// leading to dependency cycles.
|
||||
convertESM ? "@babel/transform-modules-commonjs" : null,
|
||||
].filter(Boolean),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
// we need to do this as long as we do not test everything from source
|
||||
if (includeCoverage) {
|
||||
config.auxiliaryCommentBefore = "istanbul ignore next";
|
||||
config.plugins.push("babel-plugin-istanbul");
|
||||
}
|
||||
|
||||
return config;
|
||||
};
|
||||
27
circle.yml
27
circle.yml
@@ -1,27 +0,0 @@
|
||||
general:
|
||||
artifacts:
|
||||
- "packages/babel-standalone/babel.js"
|
||||
- "packages/babel-standalone/babel.min.js"
|
||||
|
||||
machine:
|
||||
node:
|
||||
version:
|
||||
8
|
||||
|
||||
dependencies:
|
||||
pre:
|
||||
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||
cache_directories:
|
||||
- ~/.yarn-cache
|
||||
override:
|
||||
- yarn
|
||||
|
||||
test:
|
||||
override:
|
||||
- make test-ci-coverage
|
||||
# Builds babel-standalone with the regular Babel config
|
||||
- make build
|
||||
# test-ci-coverage doesn't test babel-standalone, as trying to gather coverage
|
||||
# data for a JS file that's several megabytes large is bound to fail. Here,
|
||||
# we just run the babel-standalone test separately.
|
||||
- ./node_modules/mocha/bin/_mocha packages/babel-standalone/test/ --opts test/mocha.opts
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"prettier/prettier": ["error", { "trailingComma": "all" }],
|
||||
"no-undefined-identifier": 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
# @babel/plugin-codemod-object-assign-to-object-spread
|
||||
|
||||
Transforms old code that uses `Object.assign` with an Object Literal as
|
||||
the first param to use Object Spread syntax.
|
||||
|
||||
## Examples
|
||||
|
||||
```js
|
||||
const obj = Object.assign({
|
||||
test1: 1,
|
||||
}, other, {
|
||||
test2: 2,
|
||||
}, other2);
|
||||
```
|
||||
|
||||
Is transformed to:
|
||||
|
||||
```js
|
||||
const obj = {
|
||||
test1: 1,
|
||||
...other,
|
||||
test2: 2,
|
||||
...other2,
|
||||
};
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-codemod-object-assign-to-object-spread
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Via `.babelrc` (Recommended)
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["@babel/plugin-codemod-object-assign-to-object-spread"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
babel --plugins @babel/plugin-codemod-object-assign-to-object-spread script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("@babel/core").transform("code", {
|
||||
plugins: ["@babel/plugin-codemod-object-assign-to-object-spread"]
|
||||
});
|
||||
```
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@babel/plugin-codemod-object-assign-to-object-spread",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Transforms Object.assign into object spread syntax",
|
||||
"repository": "https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-object-assign-to-object-spread",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"@babel/codemod",
|
||||
"@babel/plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.47"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.47"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.47",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.47"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import syntaxObjectRestSpread from "@babel/plugin-syntax-object-rest-spread";
|
||||
|
||||
export default function({ types: t }) {
|
||||
return {
|
||||
inherits: syntaxObjectRestSpread,
|
||||
|
||||
visitor: {
|
||||
CallExpression(path) {
|
||||
if (!path.get("callee").matchesPattern("Object.assign")) return;
|
||||
|
||||
const args = path.get("arguments");
|
||||
if (args.length === 0) return;
|
||||
|
||||
const [objPath] = args;
|
||||
if (!objPath.isObjectExpression()) return;
|
||||
|
||||
const obj = objPath.node;
|
||||
const { properties } = obj;
|
||||
|
||||
for (let i = 1; i < args.length; i++) {
|
||||
const arg = args[i];
|
||||
const { node } = arg;
|
||||
|
||||
if (arg.isObjectExpression()) {
|
||||
properties.push(...node.properties);
|
||||
} else {
|
||||
properties.push(t.spreadElement(node));
|
||||
}
|
||||
}
|
||||
|
||||
path.replaceWith(obj);
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign({test: 1}, {test: 2});
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["../../../../lib"]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
({
|
||||
test: 1,
|
||||
test: 2
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign({test: 1}, test2, {test: 2}, test3);
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["../../../../lib"]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
({
|
||||
test: 1,
|
||||
...test2,
|
||||
test: 2,
|
||||
...test3
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign(test);
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["../../../../lib"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign(test);
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign({test: 1});
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["../../../../lib"]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
({
|
||||
test: 1
|
||||
});
|
||||
@@ -36,21 +36,21 @@ npm install --save-dev @babel/plugin-codemod-optional-catch-binding
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["@babel/codemod-optional-catch-binding"]
|
||||
"plugins": ["@babel/plugin-codemod-optional-catch-binding"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
babel --plugins @babel/codemod-optional-catch-binding script.js
|
||||
babel --plugins @babel/plugin-codemod-optional-catch-binding script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("@babel/core").transform("code", {
|
||||
plugins: ["@babel/codemod-optional-catch-binding"]
|
||||
plugins: ["@babel/plugin-codemod-optional-catch-binding"]
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
{
|
||||
"name": "@babel/plugin-codemod-optional-catch-binding",
|
||||
"version": "7.0.0-beta.32",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Remove unused catch bindings",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-remove-unused-catch-binding",
|
||||
"repository": "https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-remove-unused-catch-binding",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"@babel/codemod",
|
||||
"@babel/plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.32"
|
||||
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.47"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.32"
|
||||
"@babel/core": "7.0.0-beta.47"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.32",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.32"
|
||||
"@babel/core": "7.0.0-beta.47",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import syntaxOptionalCatchBinding from "@babel/plugin-syntax-optional-catch-binding";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
export default function({ types: t }) {
|
||||
return {
|
||||
inherits: syntaxOptionalCatchBinding,
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
The Babel compiler is **only** supported in these environments:
|
||||
|
||||
- Modern browsers such as Chrome, Firefox, Safari, Edge etc.
|
||||
- Node.js 4 and upper versions
|
||||
- Node.js 6 and newer versions
|
||||
|
||||
## Unsupported environments
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ This is quite taboo but let's look at the pros and cons:
|
||||
* Easy to coordinate changes across modules.
|
||||
* Single place to report issues.
|
||||
* Easier to setup a development environment.
|
||||
* Tests across modules are ran together which finds bugs that touch multiple modules easier.
|
||||
* Tests across modules are run together which finds bugs that touch multiple modules easier.
|
||||
|
||||
**Cons:**
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"prettier/prettier": ["error", { "trailingComma": "all" }],
|
||||
"no-undefined-identifier": 2
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
/lib
|
||||
debug-fixtures
|
||||
fixtures
|
||||
/data
|
||||
/flow-typed
|
||||
test/tmp
|
||||
@@ -1,15 +0,0 @@
|
||||
coverage
|
||||
src
|
||||
test
|
||||
lib/types.js
|
||||
node_modules
|
||||
scripts
|
||||
.eslintignore
|
||||
.travis.yml
|
||||
codecov.yml
|
||||
yarn.lock
|
||||
.nyc_output
|
||||
.vscode
|
||||
.eslintrc
|
||||
babel-preset-env-*.tgz
|
||||
flow-typed
|
||||
@@ -1,572 +0,0 @@
|
||||
# @babel/preset-env [](https://www.npmjs.com/package/babel-preset-env) [](https://travis-ci.org/babel/babel-preset-env) [](https://www.npmjs.com/package/babel-preset-env) [](https://codecov.io/github/babel/babel-preset-env)
|
||||
|
||||
> A Babel preset that compiles [ES2015+](https://github.com/tc39/proposals/blob/master/finished-proposals.md) down to ES5 by automatically determining the Babel plugins and polyfills you need based on your targeted browser or runtime environments.
|
||||
|
||||
```sh
|
||||
npm install @babel/preset-env --save-dev
|
||||
```
|
||||
|
||||
Without any configuration options, @babel/preset-env behaves exactly the same as @babel/preset-latest (or @babel/preset-es2015, @babel/preset-es2016, and @babel/preset-es2017 together).
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": ["@babel/env"]
|
||||
}
|
||||
```
|
||||
|
||||
You can also configure it to only include the polyfills and transforms needed for the browsers you support. Compiling only what's needed can make your bundles smaller and your life easier.
|
||||
|
||||
This example only includes the polyfills and code transforms needed for the last two versions of each browser, and versions of Safari greater than or equal to 7. We use [browserslist](https://github.com/ai/browserslist) to parse this information, so you can use [any valid query format supported by browserslist](https://github.com/ai/browserslist#queries).
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"browsers": ["last 2 versions", "safari >= 7"]
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Similarly, if you're targeting Node.js instead of the browser, you can configure babel-preset-env to only include the polyfills and transforms necessary for a particular version:
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"node": "6.10"
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
For convenience, you can use `"node": "current"` to only include the necessary polyfills and transforms for the Node.js version that you use to run Babel:
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"node": "current"
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
- [How it Works](#how-it-works)
|
||||
- [Install](#install)
|
||||
- [Usage](#usage)
|
||||
- [Options](#options)
|
||||
- [Examples](#examples)
|
||||
- [Issues](#issues)
|
||||
|
||||
## How it Works
|
||||
|
||||
### Determine environment support for ECMAScript features
|
||||
|
||||
Use external data such as [`compat-table`](https://github.com/kangax/compat-table) to determine browser support. (We should create PRs there when necessary)
|
||||
|
||||

|
||||
|
||||
We can periodically run [build-data.js](https://github.com/babel/babel-preset-env/blob/master/scripts/build-data.js) which generates [plugins.json](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json).
|
||||
|
||||
Ref: [#7](https://github.com/babel/babel-preset-env/issues/7)
|
||||
|
||||
### Maintain a mapping between JavaScript features and Babel plugins
|
||||
|
||||
> Currently located at [plugin-features.js](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js).
|
||||
|
||||
This should be straightforward to do in most cases. There might be cases where plugins should be split up more or certain plugins aren't standalone enough (or impossible to do).
|
||||
|
||||
### Support all plugins in Babel that are considered `latest`
|
||||
|
||||
> Default behavior without options is the same as `@babel/preset-latest`.
|
||||
|
||||
It won't include `stage-x` plugins. env will support all plugins in what we consider the latest version of JavaScript (by matching what we do in [`@babel/preset-latest`](http://babeljs.io/docs/plugins/preset-latest/)).
|
||||
|
||||
Ref: [#14](https://github.com/babel/babel-preset-env/issues/14)
|
||||
|
||||
### Determine the lowest common denominator of plugins to be included in the preset
|
||||
|
||||
If you are targeting IE 8 and Chrome 55 it will include all plugins required by IE 8 since you would need to support both still.
|
||||
|
||||
### Support a target option `"node": "current"` to compile for the currently running node version.
|
||||
|
||||
For example, if you are building on Node 6, arrow functions won't be converted, but they will if you build on Node 0.12.
|
||||
|
||||
### Support a `browsers` option like autoprefixer.
|
||||
|
||||
Use [browserslist](https://github.com/ai/browserslist) to declare supported environments by performing queries like `> 1%, last 2 versions`.
|
||||
|
||||
Ref: [#19](https://github.com/babel/babel-preset-env/pull/19)
|
||||
|
||||
### Browserslist support.
|
||||
|
||||
[Browserslist](https://github.com/ai/browserslist) is a library used to share a supported list of browsers between different front-end tools like [autoprefixer](https://github.com/postcss/autoprefixer), [stylelint](https://stylelint.io/), [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat) and many others.
|
||||
|
||||
By default, @babel/preset-env will use [browserslist config sources](https://github.com/ai/browserslist#queries).
|
||||
|
||||
For example, to enable only the polyfills and plugins needed for a project targeting *last 2 versions* and *IE10*:
|
||||
|
||||
**.babelrc**
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"useBuiltIns": "entry"
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**browserslist**
|
||||
```
|
||||
Last 2 versions
|
||||
IE 10
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
**package.json**
|
||||
```
|
||||
"browserslist": "last 2 versions, ie 10"
|
||||
```
|
||||
|
||||
Browserslist config will be ignored if: 1) `targets.browsers` was specified 2) or with `ignoreBrowserslistConfig: true` option ([see more](#ignoreBrowserslistConfig)):
|
||||
|
||||
#### Targets merging.
|
||||
|
||||
1. If [targets.browsers](#targetsbrowsers) is defined - the browserslist config will be ignored. The browsers specified in `targets` will be merged with [any other explicitly defined targets](#targets). If merged, targets defined explicitly will override the same targets received from `targets.browsers`.
|
||||
|
||||
2. If [targets.browsers](#targetsbrowsers) is _not_ defined - the program will search browserslist file or `package.json` with `browserslist` field. The search will start from the working directory of the process or from the path specified by the `configPath` option, and go up to the system root. If both a browserslist file and configuration inside a `package.json` are found, an exception will be thrown.
|
||||
|
||||
3. If a browserslist config was found and other targets are defined (but not [targets.browsers](#targetsbrowsers)), the targets will be merged in the same way as `targets` defined explicitly with `targets.browsers`.
|
||||
|
||||
## Install
|
||||
|
||||
With [npm](https://www.npmjs.com):
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/preset-env
|
||||
```
|
||||
|
||||
Or [yarn](https://yarnpkg.com):
|
||||
|
||||
```sh
|
||||
yarn add @babel/preset-env --dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The default behavior without options runs all transforms (behaves the same as [@babel/preset-latest](https://babeljs.io/docs/plugins/preset-latest/)).
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": ["@babel/env"]
|
||||
}
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
For more information on setting options for a preset, refer to the [plugin/preset options](http://babeljs.io/docs/plugins/#plugin-preset-options) documentation.
|
||||
|
||||
### `targets`
|
||||
|
||||
`{ [string]: number | string }`, defaults to `{}`.
|
||||
|
||||
Takes an object of environment versions to support.
|
||||
|
||||
Each target environment takes a number or a string (we recommend using a string when specifying minor versions like `node: "6.10"`).
|
||||
|
||||
Example environments: `chrome`, `opera`, `edge`, `firefox`, `safari`, `ie`, `ios`, `android`, `node`, `electron`.
|
||||
|
||||
The [data](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json) for this is generated by running the [build-data script](https://github.com/babel/babel-preset-env/blob/master/scripts/build-data.js) which pulls in data from [compat-table](https://kangax.github.io/compat-table).
|
||||
|
||||
### `targets.node`
|
||||
|
||||
`number | string | "current" | true`
|
||||
|
||||
If you want to compile against the current node version, you can specify `"node": true` or `"node": "current"`, which would be the same as `"node": process.versions.node`.
|
||||
|
||||
### `targets.browsers`
|
||||
|
||||
`Array<string> | string`
|
||||
|
||||
A query to select browsers (ex: last 2 versions, > 5%) using [browserslist](https://github.com/ai/browserslist).
|
||||
|
||||
Note, browsers' results are overridden by explicit items from `targets`.
|
||||
|
||||
### `spec`
|
||||
|
||||
`boolean`, defaults to `false`.
|
||||
|
||||
Enable more spec compliant, but potentially slower, transformations for any plugins in this preset that support them.
|
||||
|
||||
### `loose`
|
||||
|
||||
`boolean`, defaults to `false`.
|
||||
|
||||
Enable "loose" transformations for any plugins in this preset that allow them.
|
||||
|
||||
### `modules`
|
||||
|
||||
`"amd" | "umd" | "systemjs" | "commonjs" | false`, defaults to `"commonjs"`.
|
||||
|
||||
Enable transformation of ES6 module syntax to another module type.
|
||||
|
||||
Setting this to `false` will not transform modules.
|
||||
|
||||
### `debug`
|
||||
|
||||
`boolean`, defaults to `false`.
|
||||
|
||||
Outputs the targets/plugins used and the version specified in [plugin data version](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json) to `console.log`.
|
||||
|
||||
### `include`
|
||||
|
||||
`Array<string>`, defaults to `[]`.
|
||||
|
||||
An array of plugins to always include.
|
||||
|
||||
Valid options include any:
|
||||
|
||||
- [Babel plugins](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js) - both with (`@babel/plugin-transform-spread`) and without prefix (`transform-spread`) are supported.
|
||||
|
||||
- [Built-ins](https://github.com/babel/babel-preset-env/blob/master/data/built-in-features.js), such as `map`, `set`, or `object.assign`.
|
||||
|
||||
This option is useful if there is a bug in a native implementation, or a combination of a non-supported feature + a supported one doesn't work.
|
||||
|
||||
For example, Node 4 supports native classes but not spread. If `super` is used with a spread argument, then the `transform-classes` transform needs to be `include`d, as it is not possible to transpile a spread with `super` otherwise.
|
||||
|
||||
> NOTE: The `include` and `exclude` options _only_ work with the [plugins included with this preset](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js); so, for example, including `proposal-do-expressions` or excluding `proposal-function-bind` will throw errors. To use a plugin _not_ included with this preset, add them to your [config](https://babeljs.io/docs/usage/babelrc/) directly.
|
||||
|
||||
### `exclude`
|
||||
|
||||
`Array<string>`, defaults to `[]`.
|
||||
|
||||
An array of plugins to always exclude/remove.
|
||||
|
||||
The possible options are the same as the `include` option.
|
||||
|
||||
This option is useful for "blacklisting" a transform like `transform-regenerator` if you don't use generators and don't want to include `regeneratorRuntime` (when using `useBuiltIns`) or for using another plugin like [fast-async](https://github.com/MatAtBread/fast-async) instead of [Babel's async-to-gen](http://babeljs.io/docs/plugins/proposal-async-generator-functions/).
|
||||
|
||||
### `useBuiltIns`
|
||||
|
||||
`"usage"` | `"entry"` | `false`, defaults to `false`.
|
||||
|
||||
A way to apply `@babel/preset-env` for polyfills (via `@babel/polyfill`).
|
||||
|
||||
```sh
|
||||
npm install @babel/polyfill --save
|
||||
```
|
||||
|
||||
#### `useBuiltIns: 'usage'`
|
||||
|
||||
Adds specific imports for polyfills when they are used in each file. We take advantage of the fact that a bundler will load the same polyfill only once.
|
||||
|
||||
**In**
|
||||
|
||||
a.js
|
||||
|
||||
```js
|
||||
var a = new Promise();
|
||||
```
|
||||
|
||||
b.js
|
||||
|
||||
```js
|
||||
var b = new Map();
|
||||
```
|
||||
|
||||
**Out (if environment doesn't support it)**
|
||||
|
||||
```js
|
||||
import "core-js/modules/es6.promise";
|
||||
var a = new Promise();
|
||||
```
|
||||
|
||||
```js
|
||||
import "core-js/modules/es6.map";
|
||||
var b = new Map();
|
||||
```
|
||||
|
||||
**Out (if environment supports it)**
|
||||
|
||||
```js
|
||||
var a = new Promise();
|
||||
```
|
||||
|
||||
```js
|
||||
var b = new Map();
|
||||
```
|
||||
|
||||
#### `useBuiltIns: 'entry'`
|
||||
|
||||
> NOTE: Only use `require("@babel/polyfill");` once in your whole app.
|
||||
> Multiple imports or requires of `@babel/polyfill` will throw an error since it can cause global collisions and other issues that are hard to trace.
|
||||
> We recommend creating a single entry file that only contains the `require` statement.
|
||||
|
||||
This option enables a new plugin that replaces the statement `import "@babel/polyfill"` or `require("@babel/polyfill")` with individual requires for `@babel/polyfill` based on environment.
|
||||
|
||||
**In**
|
||||
|
||||
```js
|
||||
import "@babel/polyfill";
|
||||
```
|
||||
|
||||
**Out (different based on environment)**
|
||||
|
||||
```js
|
||||
import "core-js/modules/es7.string.pad-start";
|
||||
import "core-js/modules/es7.string.pad-end";
|
||||
```
|
||||
|
||||
#### `useBuiltIns: false`
|
||||
|
||||
Don't add polyfills automatically per file, or transform `import "@babel/polyfill"` to individual polyfills.
|
||||
|
||||
### `forceAllTransforms`
|
||||
|
||||
`boolean`, defaults to `false`.
|
||||
|
||||
<p><details>
|
||||
<summary><b>Example</b></summary>
|
||||
|
||||
With Babel 7's .babelrc.js support, you can force all transforms to be run if env is set to `production`.
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
presets: [
|
||||
["@babel/env", {
|
||||
targets: {
|
||||
chrome: 59,
|
||||
edge: 13,
|
||||
firefox: 50,
|
||||
},
|
||||
// for uglifyjs...
|
||||
forceAllTransforms: process.env === "production"
|
||||
}],
|
||||
],
|
||||
};
|
||||
```
|
||||
</details></p>
|
||||
|
||||
|
||||
> NOTE: `targets.uglify` is deprecated and will be removed in the next major in
|
||||
favor of this.
|
||||
|
||||
By default, this preset will run all the transforms needed for the targeted
|
||||
environment(s). Enable this option if you want to force running _all_
|
||||
transforms, which is useful if the output will be run through UglifyJS or an
|
||||
environment that only supports ES5.
|
||||
|
||||
> NOTE: Uglify has a work-in-progress "Harmony" branch to address the lack of
|
||||
ES6 support, but it is not yet stable. You can follow its progress in
|
||||
[UglifyJS2 issue #448](https://github.com/mishoo/UglifyJS2/issues/448). If you
|
||||
require an alternative minifier which _does_ support ES6 syntax, we recommend
|
||||
using [babel-minify](https://github.com/babel/minify).
|
||||
|
||||
### `configPath`
|
||||
|
||||
`string`, defaults to `process.cwd()`
|
||||
|
||||
The starting point where the config search for browserslist will start, and ascend to the system root until found.
|
||||
|
||||
### `ignoreBrowserslistConfig`
|
||||
|
||||
`boolean`, defaults to `false`
|
||||
|
||||
Toggles whether or not [browserslist config sources](https://github.com/ai/browserslist#queries) are used, which includes searching for any browserslist files or referencing the browserslist key inside package.json. This is useful for projects that use a browserslist config for files that won't be compiled with Babel.
|
||||
|
||||
### `shippedProposals`
|
||||
|
||||
`boolean`, defaults to `false`
|
||||
|
||||
Toggles enabling support for builtin/feature proposals that have shipped in browsers. If your target environments have native support for a feature proposal, its matching parser syntax plugin is enabled instead of performing any transform. Note that this _does not_ enable the same transformations as [`@babel/preset-stage3`](https://babeljs.io/docs/plugins/preset-stage-3/), since proposals can continue to change before landing in browsers.
|
||||
|
||||
The following are currently supported:
|
||||
|
||||
**Builtins**
|
||||
|
||||
- [Promise.prototype.finally](https://github.com/tc39/proposal-promise-finally)
|
||||
|
||||
**Features**
|
||||
|
||||
- [Asynchronous Iterators](https://github.com/tc39/proposal-async-iteration)
|
||||
- [Object rest/spread properties](https://github.com/tc39/proposal-object-rest-spread)
|
||||
- [Optional catch binding](https://github.com/tc39/proposal-optional-catch-binding)
|
||||
- [Unicode property escapes in regular expressions](https://github.com/tc39/proposal-regexp-unicode-property-escapes)
|
||||
|
||||
---
|
||||
|
||||
## Examples
|
||||
|
||||
### Export with various targets
|
||||
|
||||
```js
|
||||
export class A {}
|
||||
```
|
||||
|
||||
#### Target only Chrome 52
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"chrome": 52
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Out**
|
||||
|
||||
```js
|
||||
class A {}
|
||||
exports.A = A;
|
||||
```
|
||||
|
||||
#### Target Chrome 52 with webpack 2/rollup and loose mode
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"chrome": 52
|
||||
},
|
||||
"modules": false,
|
||||
"loose": true
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Out**
|
||||
|
||||
```js
|
||||
export class A {}
|
||||
```
|
||||
|
||||
#### Target specific browsers via browserslist
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"chrome": 52,
|
||||
"browsers": ["last 2 versions", "safari 7"]
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Out**
|
||||
|
||||
```js
|
||||
export var A = function A() {
|
||||
_classCallCheck(this, A);
|
||||
};
|
||||
```
|
||||
|
||||
#### Target latest node via `node: true` or `node: "current"`
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"node": "current"
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Out**
|
||||
|
||||
```js
|
||||
class A {}
|
||||
exports.A = A;
|
||||
```
|
||||
|
||||
### Show debug output
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"safari": 10
|
||||
},
|
||||
"modules": false,
|
||||
"useBuiltIns": "entry",
|
||||
"debug": true
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**stdout**
|
||||
|
||||
```sh
|
||||
Using targets:
|
||||
{
|
||||
"safari": 10
|
||||
}
|
||||
|
||||
Modules transform: false
|
||||
|
||||
Using plugins:
|
||||
transform-exponentiation-operator {}
|
||||
transform-async-to-generator {}
|
||||
|
||||
Using polyfills:
|
||||
es7.object.values {}
|
||||
es7.object.entries {}
|
||||
es7.object.get-own-property-descriptors {}
|
||||
web.timers {}
|
||||
web.immediate {}
|
||||
web.dom.iterable {}
|
||||
```
|
||||
|
||||
### Include and exclude specific plugins/built-ins
|
||||
|
||||
> always include arrow functions, explicitly exclude generators
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"browsers": ["last 2 versions", "safari >= 7"]
|
||||
},
|
||||
"include": ["@babel/transform-arrow-functions", "es6.map"],
|
||||
"exclude": ["@babel/transform-regenerator", "es6.set"]
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Issues
|
||||
|
||||
If you get a `SyntaxError: Unexpected token ...` error when using the [object-rest-spread](https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread) transform then make sure the plugin has been updated to, at least, `v6.19.0`.
|
||||
@@ -1,206 +0,0 @@
|
||||
const typedArrayMethods = [
|
||||
"typed arrays / %TypedArray%.from",
|
||||
"typed arrays / %TypedArray%.of",
|
||||
"typed arrays / %TypedArray%.prototype.subarray",
|
||||
"typed arrays / %TypedArray%.prototype.join",
|
||||
"typed arrays / %TypedArray%.prototype.indexOf",
|
||||
"typed arrays / %TypedArray%.prototype.lastIndexOf",
|
||||
"typed arrays / %TypedArray%.prototype.slice",
|
||||
"typed arrays / %TypedArray%.prototype.every",
|
||||
"typed arrays / %TypedArray%.prototype.filter",
|
||||
"typed arrays / %TypedArray%.prototype.forEach",
|
||||
"typed arrays / %TypedArray%.prototype.map",
|
||||
"typed arrays / %TypedArray%.prototype.reduce",
|
||||
"typed arrays / %TypedArray%.prototype.reduceRight",
|
||||
"typed arrays / %TypedArray%.prototype.reverse",
|
||||
"typed arrays / %TypedArray%.prototype.some",
|
||||
"typed arrays / %TypedArray%.prototype.sort",
|
||||
"typed arrays / %TypedArray%.prototype.copyWithin",
|
||||
"typed arrays / %TypedArray%.prototype.find",
|
||||
"typed arrays / %TypedArray%.prototype.findIndex",
|
||||
"typed arrays / %TypedArray%.prototype.fill",
|
||||
"typed arrays / %TypedArray%.prototype.keys",
|
||||
"typed arrays / %TypedArray%.prototype.values",
|
||||
"typed arrays / %TypedArray%.prototype.entries",
|
||||
"typed arrays / %TypedArray%.prototype[Symbol.iterator]",
|
||||
"typed arrays / %TypedArray%[Symbol.species]",
|
||||
];
|
||||
|
||||
const es2015 = {
|
||||
"es6.typed.array-buffer": "typed arrays / ArrayBuffer[Symbol.species]",
|
||||
"es6.typed.data-view": "typed arrays / DataView",
|
||||
"es6.typed.int8-array": {
|
||||
features: ["typed arrays / Int8Array"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.uint8-array": {
|
||||
features: ["typed arrays / Uint8Array"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.uint8-clamped-array": {
|
||||
features: ["typed arrays / Uint8ClampedArray"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.int16-array": {
|
||||
features: ["typed arrays / Int16Array"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.uint16-array": {
|
||||
features: ["typed arrays / Uint16Array"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.int32-array": {
|
||||
features: ["typed arrays / Int32Array"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.uint32-array": {
|
||||
features: ["typed arrays / Uint32Array"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.float32-array": {
|
||||
features: ["typed arrays / Float32Array"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.float64-array": {
|
||||
features: ["typed arrays / Float64Array"].concat(typedArrayMethods)
|
||||
},
|
||||
|
||||
"es6.map": "Map",
|
||||
"es6.set": "Set",
|
||||
"es6.weak-map": "WeakMap",
|
||||
"es6.weak-set": "WeakSet",
|
||||
|
||||
// Proxy not implementable
|
||||
|
||||
"es6.reflect.apply": "Reflect / Reflect.apply",
|
||||
"es6.reflect.construct": "Reflect / Reflect.construct",
|
||||
"es6.reflect.define-property": "Reflect / Reflect.defineProperty",
|
||||
"es6.reflect.delete-property": "Reflect / Reflect.deleteProperty",
|
||||
"es6.reflect.get": "Reflect / Reflect.get",
|
||||
"es6.reflect.get-own-property-descriptor": "Reflect / Reflect.getOwnPropertyDescriptor",
|
||||
"es6.reflect.get-prototype-of": "Reflect / Reflect.getPrototypeOf",
|
||||
"es6.reflect.has": "Reflect / Reflect.has",
|
||||
"es6.reflect.is-extensible": "Reflect / Reflect.isExtensible",
|
||||
"es6.reflect.own-keys": "Reflect / Reflect.ownKeys",
|
||||
"es6.reflect.prevent-extensions": "Reflect / Reflect.preventExtensions",
|
||||
"es6.reflect.set": "Reflect / Reflect.set",
|
||||
"es6.reflect.set-prototype-of": "Reflect / Reflect.setPrototypeOf",
|
||||
|
||||
"es6.promise": {
|
||||
features: [
|
||||
"Promise / basic functionality",
|
||||
"Promise / constructor requires new",
|
||||
"Promise / Promise.prototype isn\'t an instance",
|
||||
"Promise / Promise.all",
|
||||
"Promise / Promise.all, generic iterables",
|
||||
"Promise / Promise.race",
|
||||
"Promise / Promise.race, generic iterables",
|
||||
"Promise / Promise[Symbol.species]"
|
||||
]
|
||||
},
|
||||
|
||||
"es6.symbol": {
|
||||
features: [
|
||||
"Symbol",
|
||||
"Object static methods / Object.getOwnPropertySymbols",
|
||||
"well-known symbols / Symbol.hasInstance",
|
||||
"well-known symbols / Symbol.isConcatSpreadable",
|
||||
"well-known symbols / Symbol.iterator",
|
||||
"well-known symbols / Symbol.match",
|
||||
"well-known symbols / Symbol.replace",
|
||||
"well-known symbols / Symbol.search",
|
||||
"well-known symbols / Symbol.species",
|
||||
"well-known symbols / Symbol.split",
|
||||
"well-known symbols / Symbol.toPrimitive",
|
||||
"well-known symbols / Symbol.toStringTag",
|
||||
"well-known symbols / Symbol.unscopables",
|
||||
]
|
||||
},
|
||||
|
||||
"es6.object.freeze": "Object static methods accept primitives / Object.freeze",
|
||||
"es6.object.seal": "Object static methods accept primitives / Object.seal",
|
||||
"es6.object.prevent-extensions": "Object static methods accept primitives / Object.preventExtensions",
|
||||
"es6.object.is-frozen": "Object static methods accept primitives / Object.isFrozen",
|
||||
"es6.object.is-sealed": "Object static methods accept primitives / Object.isSealed",
|
||||
"es6.object.is-extensible": "Object static methods accept primitives / Object.isExtensible",
|
||||
"es6.object.get-own-property-descriptor":
|
||||
"Object static methods accept primitives / Object.getOwnPropertyDescriptor",
|
||||
"es6.object.get-prototype-of": "Object static methods accept primitives / Object.getPrototypeOf",
|
||||
"es6.object.keys": "Object static methods accept primitives / Object.keys",
|
||||
"es6.object.get-own-property-names": "Object static methods accept primitives / Object.getOwnPropertyNames",
|
||||
|
||||
"es6.object.assign": "Object static methods / Object.assign",
|
||||
"es6.object.is": "Object static methods / Object.is",
|
||||
"es6.object.set-prototype-of": "Object static methods / Object.setPrototypeOf",
|
||||
|
||||
"es6.function.name": "function \"name\" property",
|
||||
|
||||
"es6.string.raw": "String static methods / String.raw",
|
||||
"es6.string.from-code-point": "String static methods / String.fromCodePoint",
|
||||
|
||||
"es6.string.code-point-at": "String.prototype methods / String.prototype.codePointAt",
|
||||
// "String.prototype methods / String.prototype.normalize" not implemented
|
||||
"es6.string.repeat": "String.prototype methods / String.prototype.repeat",
|
||||
"es6.string.starts-with": "String.prototype methods / String.prototype.startsWith",
|
||||
"es6.string.ends-with": "String.prototype methods / String.prototype.endsWith",
|
||||
"es6.string.includes": "String.prototype methods / String.prototype.includes",
|
||||
|
||||
"es6.regexp.flags": "RegExp.prototype properties / RegExp.prototype.flags",
|
||||
"es6.regexp.match": "RegExp.prototype properties / RegExp.prototype[Symbol.match]",
|
||||
"es6.regexp.replace": "RegExp.prototype properties / RegExp.prototype[Symbol.replace]",
|
||||
"es6.regexp.split": "RegExp.prototype properties / RegExp.prototype[Symbol.split]",
|
||||
"es6.regexp.search": "RegExp.prototype properties / RegExp.prototype[Symbol.search]",
|
||||
|
||||
"es6.array.from": "Array static methods / Array.from",
|
||||
"es6.array.of": "Array static methods / Array.of",
|
||||
|
||||
"es6.array.copy-within": "Array.prototype methods / Array.prototype.copyWithin",
|
||||
"es6.array.find": "Array.prototype methods / Array.prototype.find",
|
||||
"es6.array.find-index": "Array.prototype methods / Array.prototype.findIndex",
|
||||
"es6.array.fill": "Array.prototype methods / Array.prototype.fill",
|
||||
|
||||
"es6.array.iterator": {
|
||||
features: [
|
||||
"Array.prototype methods / Array.prototype.keys",
|
||||
// can use Symbol.iterator, not implemented in many environments
|
||||
// "Array.prototype methods / Array.prototype.values",
|
||||
"Array.prototype methods / Array.prototype.entries",
|
||||
]
|
||||
},
|
||||
|
||||
"es6.number.is-finite": "Number properties / Number.isFinite",
|
||||
"es6.number.is-integer": "Number properties / Number.isInteger",
|
||||
"es6.number.is-safe-integer": "Number properties / Number.isSafeInteger",
|
||||
"es6.number.is-nan": "Number properties / Number.isNaN",
|
||||
"es6.number.epsilon": "Number properties / Number.EPSILON",
|
||||
"es6.number.min-safe-integer": "Number properties / Number.MIN_SAFE_INTEGER",
|
||||
"es6.number.max-safe-integer": "Number properties / Number.MAX_SAFE_INTEGER",
|
||||
"es6.number.parse-float": "Number properties / Number.parseFloat",
|
||||
"es6.number.parse-int": "Number properties / Number.parseInt",
|
||||
|
||||
"es6.math.acosh": "Math methods / Math.acosh",
|
||||
"es6.math.asinh": "Math methods / Math.asinh",
|
||||
"es6.math.atanh": "Math methods / Math.atanh",
|
||||
"es6.math.cbrt": "Math methods / Math.cbrt",
|
||||
"es6.math.clz32": "Math methods / Math.clz32",
|
||||
"es6.math.cosh": "Math methods / Math.cosh",
|
||||
"es6.math.expm1": "Math methods / Math.expm1",
|
||||
"es6.math.fround": "Math methods / Math.fround",
|
||||
"es6.math.hypot": "Math methods / Math.hypot",
|
||||
"es6.math.imul": "Math methods / Math.imul",
|
||||
"es6.math.log1p": "Math methods / Math.log1p",
|
||||
"es6.math.log10": "Math methods / Math.log10",
|
||||
"es6.math.log2": "Math methods / Math.log2",
|
||||
"es6.math.sign": "Math methods / Math.sign",
|
||||
"es6.math.sinh": "Math methods / Math.sinh",
|
||||
"es6.math.tanh": "Math methods / Math.tanh",
|
||||
"es6.math.trunc": "Math methods / Math.trunc",
|
||||
};
|
||||
|
||||
const es2016 = {
|
||||
"es7.array.includes": "Array.prototype.includes",
|
||||
};
|
||||
|
||||
const es2017 = {
|
||||
"es7.object.values": "Object static methods / Object.values",
|
||||
"es7.object.entries": "Object static methods / Object.entries",
|
||||
"es7.object.get-own-property-descriptors": "Object static methods / Object.getOwnPropertyDescriptors",
|
||||
"es7.string.pad-start": "String padding / String.prototype.padStart",
|
||||
"es7.string.pad-end": "String padding / String.prototype.padEnd",
|
||||
};
|
||||
|
||||
const proposals = require("./shipped-proposals").builtIns;
|
||||
|
||||
module.exports = Object.assign({}, es2015, es2016, es2017, proposals);
|
||||
@@ -1,953 +0,0 @@
|
||||
{
|
||||
"es6.typed.array-buffer": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.data-view": {
|
||||
"chrome": "5",
|
||||
"opera": "12",
|
||||
"edge": "12",
|
||||
"firefox": "15",
|
||||
"safari": "5.1",
|
||||
"node": "0.12",
|
||||
"ie": "10",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"es6.typed.int8-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.uint8-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.uint8-clamped-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.int16-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.uint16-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.int32-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.uint32-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.float32-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.float64-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.map": {
|
||||
"chrome": "51",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.set": {
|
||||
"chrome": "51",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.weak-map": {
|
||||
"chrome": "51",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "9",
|
||||
"node": "6.5",
|
||||
"ios": "9",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.weak-set": {
|
||||
"chrome": "51",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "9",
|
||||
"node": "6.5",
|
||||
"ios": "9",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.reflect.apply": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.construct": {
|
||||
"chrome": "49",
|
||||
"edge": "13",
|
||||
"firefox": "44",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.define-property": {
|
||||
"chrome": "49",
|
||||
"edge": "13",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.delete-property": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.get": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.get-own-property-descriptor": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.get-prototype-of": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.has": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.is-extensible": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.own-keys": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.prevent-extensions": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.set": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.set-prototype-of": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.promise": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "45",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.symbol": {
|
||||
"chrome": "51",
|
||||
"firefox": "51",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.object.freeze": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.seal": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.prevent-extensions": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.is-frozen": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.is-sealed": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.is-extensible": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.get-own-property-descriptor": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.get-prototype-of": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "3.5",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.keys": {
|
||||
"chrome": "40",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "27",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"es6.object.get-own-property-names": {
|
||||
"chrome": "40",
|
||||
"edge": "12",
|
||||
"firefox": "33",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "27",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"es6.object.assign": {
|
||||
"chrome": "45",
|
||||
"edge": "12",
|
||||
"firefox": "34",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "32",
|
||||
"electron": "0.35"
|
||||
},
|
||||
"es6.object.is": {
|
||||
"chrome": "19",
|
||||
"edge": "12",
|
||||
"firefox": "22",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"android": "4.1",
|
||||
"ios": "9",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.object.set-prototype-of": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "31",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ie": "11",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.function.name": {
|
||||
"chrome": "51",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.string.raw": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "34",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"es6.string.from-code-point": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "29",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"es6.string.code-point-at": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "29",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"es6.string.repeat": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "24",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"es6.string.starts-with": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "29",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"es6.string.ends-with": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "29",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"es6.string.includes": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "40",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"es6.regexp.flags": {
|
||||
"chrome": "49",
|
||||
"firefox": "37",
|
||||
"safari": "9",
|
||||
"node": "6",
|
||||
"ios": "9",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.regexp.match": {
|
||||
"chrome": "50",
|
||||
"firefox": "49",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"es6.regexp.replace": {
|
||||
"chrome": "50",
|
||||
"firefox": "49",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"es6.regexp.split": {
|
||||
"chrome": "50",
|
||||
"firefox": "49",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"es6.regexp.search": {
|
||||
"chrome": "50",
|
||||
"firefox": "49",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"es6.array.from": {
|
||||
"chrome": "51",
|
||||
"edge": "15",
|
||||
"firefox": "36",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.array.of": {
|
||||
"chrome": "45",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "32",
|
||||
"electron": "0.35"
|
||||
},
|
||||
"es6.array.copy-within": {
|
||||
"chrome": "45",
|
||||
"edge": "12",
|
||||
"firefox": "32",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "32",
|
||||
"electron": "0.35"
|
||||
},
|
||||
"es6.array.find": {
|
||||
"chrome": "45",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "4",
|
||||
"ios": "8",
|
||||
"opera": "32",
|
||||
"electron": "0.35"
|
||||
},
|
||||
"es6.array.find-index": {
|
||||
"chrome": "45",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "4",
|
||||
"ios": "8",
|
||||
"opera": "32",
|
||||
"electron": "0.35"
|
||||
},
|
||||
"es6.array.fill": {
|
||||
"chrome": "45",
|
||||
"edge": "12",
|
||||
"firefox": "31",
|
||||
"safari": "7.1",
|
||||
"node": "4",
|
||||
"ios": "8",
|
||||
"opera": "32",
|
||||
"electron": "0.35"
|
||||
},
|
||||
"es6.array.iterator": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "28",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.is-finite": {
|
||||
"chrome": "19",
|
||||
"edge": "12",
|
||||
"firefox": "16",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"android": "4.1",
|
||||
"ios": "9",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.is-integer": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "16",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.is-safe-integer": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "32",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.is-nan": {
|
||||
"chrome": "19",
|
||||
"edge": "12",
|
||||
"firefox": "15",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"android": "4.1",
|
||||
"ios": "9",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.epsilon": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.min-safe-integer": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "31",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.max-safe-integer": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "31",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.parse-float": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.parse-int": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.acosh": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.asinh": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.atanh": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.cbrt": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.clz32": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "31",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.cosh": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.expm1": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.fround": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "26",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.hypot": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "27",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.imul": {
|
||||
"chrome": "30",
|
||||
"edge": "12",
|
||||
"firefox": "23",
|
||||
"safari": "7",
|
||||
"node": "0.12",
|
||||
"android": "4.4",
|
||||
"ios": "7",
|
||||
"opera": "17",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.log1p": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.log10": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.log2": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.sign": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.sinh": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.tanh": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.trunc": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es7.array.includes": {
|
||||
"chrome": "47",
|
||||
"edge": "14",
|
||||
"firefox": "43",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "34",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"es7.object.values": {
|
||||
"chrome": "54",
|
||||
"edge": "14",
|
||||
"firefox": "47",
|
||||
"safari": "10.1",
|
||||
"node": "7",
|
||||
"ios": "10.3",
|
||||
"opera": "41",
|
||||
"electron": "1.5"
|
||||
},
|
||||
"es7.object.entries": {
|
||||
"chrome": "54",
|
||||
"edge": "14",
|
||||
"firefox": "47",
|
||||
"safari": "10.1",
|
||||
"node": "7",
|
||||
"ios": "10.3",
|
||||
"opera": "41",
|
||||
"electron": "1.5"
|
||||
},
|
||||
"es7.object.get-own-property-descriptors": {
|
||||
"chrome": "54",
|
||||
"edge": "15",
|
||||
"firefox": "50",
|
||||
"safari": "10.1",
|
||||
"node": "7",
|
||||
"ios": "10.3",
|
||||
"opera": "41",
|
||||
"electron": "1.5"
|
||||
},
|
||||
"es7.string.pad-start": {
|
||||
"chrome": "57",
|
||||
"edge": "15",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "8",
|
||||
"ios": "10",
|
||||
"opera": "44",
|
||||
"electron": "1.7"
|
||||
},
|
||||
"es7.string.pad-end": {
|
||||
"chrome": "57",
|
||||
"edge": "15",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "8",
|
||||
"ios": "10",
|
||||
"opera": "44",
|
||||
"electron": "1.7"
|
||||
},
|
||||
"es7.promise.finally": {
|
||||
"chrome": "63",
|
||||
"opera": "50"
|
||||
}
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
const es2015 = {
|
||||
"check-constants": {
|
||||
features: [
|
||||
"const",
|
||||
],
|
||||
},
|
||||
"transform-arrow-functions": {
|
||||
features: [
|
||||
"arrow functions",
|
||||
],
|
||||
},
|
||||
"transform-block-scoped-functions": {
|
||||
features: [
|
||||
"block-level function declaration"
|
||||
],
|
||||
},
|
||||
"transform-block-scoping": {
|
||||
features: [
|
||||
"const",
|
||||
"let",
|
||||
],
|
||||
},
|
||||
"transform-classes": {
|
||||
features: [
|
||||
"class",
|
||||
"super",
|
||||
],
|
||||
},
|
||||
"transform-computed-properties": {
|
||||
features: [
|
||||
"object literal extensions / computed properties",
|
||||
],
|
||||
},
|
||||
"transform-destructuring": {
|
||||
features: [
|
||||
"destructuring, assignment",
|
||||
"destructuring, declarations",
|
||||
"destructuring, parameters",
|
||||
],
|
||||
},
|
||||
"transform-duplicate-keys": {
|
||||
features: [
|
||||
"miscellaneous / duplicate property names in strict mode",
|
||||
],
|
||||
},
|
||||
"transform-for-of": {
|
||||
features: [
|
||||
"for..of loops",
|
||||
],
|
||||
},
|
||||
"transform-function-name": {
|
||||
features: [
|
||||
"function \"name\" property",
|
||||
]
|
||||
},
|
||||
"transform-literals": {
|
||||
features: [
|
||||
"Unicode code point escapes",
|
||||
],
|
||||
},
|
||||
"transform-object-super": {
|
||||
features: [
|
||||
"super",
|
||||
],
|
||||
},
|
||||
"transform-parameters": {
|
||||
features: [
|
||||
"default function parameters",
|
||||
"rest parameters",
|
||||
],
|
||||
},
|
||||
"transform-shorthand-properties": {
|
||||
features: [
|
||||
"object literal extensions / shorthand properties",
|
||||
],
|
||||
},
|
||||
"transform-spread": {
|
||||
features: [
|
||||
"spread (...) operator",
|
||||
],
|
||||
},
|
||||
"transform-sticky-regex": {
|
||||
features: [
|
||||
"RegExp \"y\" and \"u\" flags / \"y\" flag, lastIndex",
|
||||
"RegExp \"y\" and \"u\" flags / \"y\" flag",
|
||||
],
|
||||
},
|
||||
"transform-template-literals": {
|
||||
features: [
|
||||
"template literals",
|
||||
],
|
||||
},
|
||||
"transform-typeof-symbol": {
|
||||
features: [
|
||||
"Symbol / typeof support"
|
||||
],
|
||||
},
|
||||
"transform-unicode-regex": {
|
||||
features: [
|
||||
"RegExp \"y\" and \"u\" flags / \"u\" flag, case folding",
|
||||
"RegExp \"y\" and \"u\" flags / \"u\" flag, Unicode code point escapes",
|
||||
"RegExp \"y\" and \"u\" flags / \"u\" flag",
|
||||
],
|
||||
},
|
||||
"transform-new-target": {
|
||||
features: [
|
||||
"new.target",
|
||||
],
|
||||
},
|
||||
"transform-regenerator": {
|
||||
features: [
|
||||
"generators",
|
||||
],
|
||||
}
|
||||
};
|
||||
|
||||
const es2016 = {
|
||||
"transform-exponentiation-operator": {
|
||||
features: [
|
||||
"exponentiation (**) operator",
|
||||
],
|
||||
}
|
||||
};
|
||||
|
||||
const es2017 = {
|
||||
"transform-async-to-generator": {
|
||||
features: [
|
||||
"async functions",
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
const proposals = require("./shipped-proposals").features;
|
||||
|
||||
module.exports = Object.assign({}, es2015, es2016, es2017, proposals);
|
||||
@@ -1,22 +0,0 @@
|
||||
// These mappings represent the builtin/feature proposals that have been
|
||||
// shipped by browsers, and are enabled by the `shippedProposals` option.
|
||||
|
||||
const builtIns = {
|
||||
"es7.promise.finally": "Promise.prototype.finally"
|
||||
};
|
||||
|
||||
const features = {
|
||||
"proposal-async-generator-functions": "Asynchronous Iterators",
|
||||
"proposal-object-rest-spread": "object rest/spread properties",
|
||||
"proposal-optional-catch-binding": "optional catch binding",
|
||||
"proposal-unicode-property-regex": "RegExp Unicode Property Escapes",
|
||||
};
|
||||
|
||||
const pluginSyntaxMap = new Map([
|
||||
["proposal-async-generator-functions", "syntax-async-generators"],
|
||||
["proposal-object-rest-spread", "syntax-object-rest-spread"],
|
||||
["proposal-optional-catch-binding", "syntax-optional-catch-binding"],
|
||||
["proposal-unicode-property-regex", null],
|
||||
]);
|
||||
|
||||
module.exports = { builtIns, features, pluginSyntaxMap };
|
||||
@@ -1,63 +0,0 @@
|
||||
{
|
||||
"name": "@babel/preset-env",
|
||||
"version": "7.0.0-beta.32",
|
||||
"description": "A Babel preset for each environment.",
|
||||
"author": "Henry Zhu <hi@henryzoo.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/babel/babel/tree/master/experimental/babel-preset-env",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
"build-data": "node ./scripts/build-data.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/plugin-check-constants": "7.0.0-beta.32",
|
||||
"@babel/plugin-proposal-async-generator-functions": "7.0.0-beta.32",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.32",
|
||||
"@babel/plugin-proposal-optional-catch-binding": "7.0.0-beta.32",
|
||||
"@babel/plugin-proposal-unicode-property-regex": "7.0.0-beta.32",
|
||||
"@babel/plugin-syntax-async-generators": "7.0.0-beta.32",
|
||||
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.32",
|
||||
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-arrow-functions": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-async-to-generator": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-block-scoped-functions": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-block-scoping": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-classes": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-computed-properties": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-destructuring": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-duplicate-keys": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-exponentiation-operator": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-for-of": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-function-name": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-literals": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-modules-amd": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-modules-commonjs": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-modules-systemjs": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-modules-umd": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-new-target": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-object-super": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-parameters": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-regenerator": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-shorthand-properties": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-spread": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-sticky-regex": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-template-literals": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-typeof-symbol": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-unicode-regex": "7.0.0-beta.32",
|
||||
"browserslist": "^2.4.0",
|
||||
"invariant": "^2.2.2",
|
||||
"semver": "^5.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.32"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "7.0.0-beta.32",
|
||||
"@babel/core": "7.0.0-beta.32",
|
||||
"@babel/helper-fixtures": "7.0.0-beta.32",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.32",
|
||||
"compat-table": "kangax/compat-table#957f1ff15972e8fb2892a172f985e9af27bf1c75",
|
||||
"electron-to-chromium": "^1.3.27"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"prettier/prettier": ["error", { "trailingComma": "es5" }]
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
export default {
|
||||
"check-constants": require("@babel/plugin-check-constants"),
|
||||
"syntax-async-generators": require("@babel/plugin-syntax-async-generators"),
|
||||
"syntax-object-rest-spread": require("@babel/plugin-syntax-object-rest-spread"),
|
||||
"syntax-optional-catch-binding": require("@babel/plugin-syntax-optional-catch-binding"),
|
||||
"transform-async-to-generator": require("@babel/plugin-transform-async-to-generator"),
|
||||
"proposal-async-generator-functions": require("@babel/plugin-proposal-async-generator-functions"),
|
||||
"transform-arrow-functions": require("@babel/plugin-transform-arrow-functions"),
|
||||
"transform-block-scoped-functions": require("@babel/plugin-transform-block-scoped-functions"),
|
||||
"transform-block-scoping": require("@babel/plugin-transform-block-scoping"),
|
||||
"transform-classes": require("@babel/plugin-transform-classes"),
|
||||
"transform-computed-properties": require("@babel/plugin-transform-computed-properties"),
|
||||
"transform-destructuring": require("@babel/plugin-transform-destructuring"),
|
||||
"transform-duplicate-keys": require("@babel/plugin-transform-duplicate-keys"),
|
||||
"transform-for-of": require("@babel/plugin-transform-for-of"),
|
||||
"transform-function-name": require("@babel/plugin-transform-function-name"),
|
||||
"transform-literals": require("@babel/plugin-transform-literals"),
|
||||
"transform-modules-amd": require("@babel/plugin-transform-modules-amd"),
|
||||
"transform-modules-commonjs": require("@babel/plugin-transform-modules-commonjs"),
|
||||
"transform-modules-systemjs": require("@babel/plugin-transform-modules-systemjs"),
|
||||
"transform-modules-umd": require("@babel/plugin-transform-modules-umd"),
|
||||
"transform-object-super": require("@babel/plugin-transform-object-super"),
|
||||
"transform-parameters": require("@babel/plugin-transform-parameters"),
|
||||
"transform-shorthand-properties": require("@babel/plugin-transform-shorthand-properties"),
|
||||
"transform-spread": require("@babel/plugin-transform-spread"),
|
||||
"transform-sticky-regex": require("@babel/plugin-transform-sticky-regex"),
|
||||
"transform-template-literals": require("@babel/plugin-transform-template-literals"),
|
||||
"transform-typeof-symbol": require("@babel/plugin-transform-typeof-symbol"),
|
||||
"transform-unicode-regex": require("@babel/plugin-transform-unicode-regex"),
|
||||
"transform-exponentiation-operator": require("@babel/plugin-transform-exponentiation-operator"),
|
||||
"transform-new-target": require("@babel/plugin-transform-new-target"),
|
||||
"proposal-object-rest-spread": require("@babel/plugin-proposal-object-rest-spread"),
|
||||
"proposal-optional-catch-binding": require("@babel/plugin-proposal-optional-catch-binding"),
|
||||
"transform-regenerator": require("@babel/plugin-transform-regenerator"),
|
||||
"proposal-unicode-property-regex": require("@babel/plugin-proposal-unicode-property-regex"),
|
||||
};
|
||||
@@ -1,109 +0,0 @@
|
||||
// TODO: this is the opposite of built-in-features so maybe generate one from the other?
|
||||
export const definitions = {
|
||||
builtins: {
|
||||
DataView: "es6.typed.data-view",
|
||||
Int8Array: "es6.typed.int8-array",
|
||||
Uint8Array: "es6.typed.uint8-array",
|
||||
Uint8ClampedArray: "es6.typed.uint8-clamped-array",
|
||||
Int16Array: "es6.typed.int16-array",
|
||||
Uint16Array: "es6.typed.uint16-array",
|
||||
Int32Array: "es6.typed.int32-array",
|
||||
Uint32Array: "es6.typed.uint32-array",
|
||||
Float32Array: "es6.typed.float32-array",
|
||||
Float64Array: "es6.typed.float64-array",
|
||||
Map: "es6.map",
|
||||
Set: "es6.set",
|
||||
WeakMap: "es6.weak-map",
|
||||
WeakSet: "es6.weak-set",
|
||||
Promise: "es6.promise",
|
||||
Symbol: "es6.symbol",
|
||||
},
|
||||
|
||||
instanceMethods: {
|
||||
name: ["es6.function.name"],
|
||||
fromCodePoint: ["es6.string.from-code-point"],
|
||||
codePointAt: ["es6.string.code-point-at"],
|
||||
repeat: ["es6.string.repeat"],
|
||||
startsWith: ["es6.string.starts-with"],
|
||||
endsWith: ["es6.string.ends-with"],
|
||||
includes: ["es6.string.includes", "es7.array.includes"],
|
||||
flags: ["es6.regexp.flags"],
|
||||
match: ["es6.regexp.match"],
|
||||
replace: ["es6.regexp.replace"],
|
||||
split: ["es6.regexp.split"],
|
||||
search: ["es6.regexp.search"],
|
||||
copyWithin: ["es6.array.copy-within"],
|
||||
find: ["es6.array.find"],
|
||||
findIndex: ["es6.array.find-index"],
|
||||
fill: ["es6.array.fill"],
|
||||
padStart: ["es7.string.pad-start"],
|
||||
padEnd: ["es7.string.pad-end"],
|
||||
},
|
||||
|
||||
staticMethods: {
|
||||
Array: {
|
||||
from: "es6.array.from",
|
||||
of: "es6.array.of",
|
||||
},
|
||||
|
||||
Object: {
|
||||
assign: "es6.object.assign",
|
||||
is: "es6.object.is",
|
||||
getOwnPropertySymbols: "es6.object.get-own-property-symbols",
|
||||
setPrototypeOf: "es6.object.set-prototype-of",
|
||||
values: "es7.object.values",
|
||||
entries: "es7.object.entries",
|
||||
getOwnPropertyDescriptors: "es7.object.get-own-property-descriptors",
|
||||
},
|
||||
|
||||
Math: {
|
||||
acosh: "es6.math.acosh",
|
||||
asinh: "es6.math.asinh",
|
||||
atanh: "es6.math.atanh",
|
||||
cbrt: "es6.math.cbrt",
|
||||
clz32: "es6.math.clz32",
|
||||
cosh: "es6.math.cosh",
|
||||
expm1: "es6.math.expm1",
|
||||
fround: "es6.math.fround",
|
||||
hypot: "es6.math.hypot",
|
||||
imul: "es6.math.imul",
|
||||
log1p: "es6.math.log1p",
|
||||
log10: "es6.math.log10",
|
||||
log2: "es6.math.log2",
|
||||
sign: "es6.math.sign",
|
||||
sinh: "es6.math.sinh",
|
||||
tanh: "es6.math.tanh",
|
||||
trunc: "es6.math.trunc",
|
||||
},
|
||||
|
||||
String: {
|
||||
raw: "es6.string.raw",
|
||||
},
|
||||
|
||||
Number: {
|
||||
isFinite: "es6.number.is-finite",
|
||||
isInteger: "es6.number.is-integer",
|
||||
isSafeInteger: "es6.number.is-safe-integer",
|
||||
isNaN: "es6.number.is-nan",
|
||||
EPSILON: "es6.number.epsilon",
|
||||
MIN_SAFE_INTEGER: "es6.number.min-safe-integer",
|
||||
MAX_SAFE_INTEGER: "es6.number.max-safe-integer",
|
||||
},
|
||||
|
||||
Reflect: {
|
||||
apply: "es6.reflect.apply",
|
||||
construct: "es6.reflect.construct",
|
||||
defineProperty: "es6.reflect.define-property",
|
||||
deleteProperty: "es6.reflect.delete-property",
|
||||
get: "es6.reflect.get",
|
||||
getOwnPropertyDescriptor: "es6.reflect.get-own-property-descriptor",
|
||||
getPrototypeOf: "es6.reflect.get-prototype-of",
|
||||
has: "es6.reflect.has",
|
||||
isExtensible: "es6.reflect.is-extensible",
|
||||
ownKeys: "es6.reflect.own-keys",
|
||||
preventExtensions: "es6.reflect.prevent-extensions",
|
||||
set: "es6.reflect.set",
|
||||
setPrototypeOf: "es6.reflect.set-prototype-of",
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -1,75 +0,0 @@
|
||||
/*eslint quotes: ["error", "double", { "avoidEscape": true }]*/
|
||||
import semver from "semver";
|
||||
import { prettifyVersion, semverify } from "./utils";
|
||||
|
||||
const wordEnds = size => {
|
||||
return size > 1 ? "s" : "";
|
||||
};
|
||||
|
||||
export const logMessage = (message, context) => {
|
||||
const pre = context ? `[${context}] ` : "";
|
||||
const logStr = ` ${pre}${message}`;
|
||||
console.log(logStr);
|
||||
};
|
||||
|
||||
export const logPlugin = (plugin, targets, list, context) => {
|
||||
const envList = list[plugin] || {};
|
||||
const filteredList = Object.keys(targets).reduce((a, b) => {
|
||||
if (!envList[b] || semver.lt(targets[b], semverify(envList[b]))) {
|
||||
a[b] = prettifyVersion(targets[b]);
|
||||
}
|
||||
return a;
|
||||
}, {});
|
||||
|
||||
const formattedTargets = JSON.stringify(filteredList)
|
||||
.replace(/,/g, ", ")
|
||||
.replace(/^\{"/, '{ "')
|
||||
.replace(/"\}$/, '" }');
|
||||
|
||||
logMessage(`${plugin} ${formattedTargets}`, context);
|
||||
};
|
||||
|
||||
export const logEntryPolyfills = (
|
||||
importPolyfillIncluded,
|
||||
polyfills,
|
||||
filename,
|
||||
onDebug,
|
||||
) => {
|
||||
if (!importPolyfillIncluded) {
|
||||
console.log(
|
||||
`
|
||||
[${filename}] \`import '@babel/polyfill'\` was not found.`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (!polyfills.size) {
|
||||
console.log(
|
||||
`
|
||||
[${filename}] Based on your targets, none were added.`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(
|
||||
`
|
||||
[${filename}] Replaced \`@babel/polyfill\` with the following polyfill${wordEnds(
|
||||
polyfills.size,
|
||||
)}:`,
|
||||
);
|
||||
onDebug(polyfills);
|
||||
};
|
||||
|
||||
export const logUsagePolyfills = (polyfills, filename, onDebug) => {
|
||||
if (!polyfills.size) {
|
||||
console.log(
|
||||
`
|
||||
[${filename}] Based on your code and targets, none were added.`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
console.log(
|
||||
`
|
||||
[${filename}] Added following polyfill${wordEnds(polyfills.size)}:`,
|
||||
);
|
||||
onDebug(polyfills);
|
||||
};
|
||||
@@ -1,272 +0,0 @@
|
||||
//@flow
|
||||
|
||||
import semver from "semver";
|
||||
import builtInsList from "../data/built-ins.json";
|
||||
import { logPlugin } from "./debug";
|
||||
import { defaultWebIncludes } from "./default-includes";
|
||||
import moduleTransformations from "./module-transformations";
|
||||
import normalizeOptions from "./normalize-options.js";
|
||||
import pluginList from "../data/plugins.json";
|
||||
import {
|
||||
builtIns as proposalBuiltIns,
|
||||
features as proposalPlugins,
|
||||
pluginSyntaxMap,
|
||||
} from "../data/shipped-proposals.js";
|
||||
import useBuiltInsEntryPlugin from "./use-built-ins-entry-plugin";
|
||||
import addUsedBuiltInsPlugin from "./use-built-ins-plugin";
|
||||
import getTargets from "./targets-parser";
|
||||
import availablePlugins from "./available-plugins";
|
||||
import { filterStageFromList, prettifyTargets, semverify } from "./utils";
|
||||
import type { Plugin, Targets } from "./types";
|
||||
|
||||
const getPlugin = (pluginName: string) => {
|
||||
const plugin = availablePlugins[pluginName];
|
||||
|
||||
if (!plugin) {
|
||||
throw new Error(
|
||||
`Could not find plugin "${pluginName}". Ensure there is an entry in ./available-plugins.js for it.`,
|
||||
);
|
||||
}
|
||||
|
||||
return plugin;
|
||||
};
|
||||
|
||||
const builtInsListWithoutProposals = filterStageFromList(
|
||||
builtInsList,
|
||||
proposalBuiltIns,
|
||||
);
|
||||
|
||||
const pluginListWithoutProposals = filterStageFromList(
|
||||
pluginList,
|
||||
proposalPlugins,
|
||||
);
|
||||
|
||||
export const isPluginRequired = (
|
||||
supportedEnvironments: Targets,
|
||||
plugin: Targets,
|
||||
): boolean => {
|
||||
const targetEnvironments: Array<string> = Object.keys(supportedEnvironments);
|
||||
|
||||
if (targetEnvironments.length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const isRequiredForEnvironments: Array<
|
||||
string,
|
||||
> = targetEnvironments.filter(environment => {
|
||||
// Feature is not implemented in that environment
|
||||
if (!plugin[environment]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const lowestImplementedVersion: string = plugin[environment];
|
||||
const lowestTargetedVersion: string = supportedEnvironments[environment];
|
||||
|
||||
if (!semver.valid(lowestTargetedVersion)) {
|
||||
throw new Error(
|
||||
// eslint-disable-next-line max-len
|
||||
`Invalid version passed for target "${environment}": "${lowestTargetedVersion}". Versions must be in semver format (major.minor.patch)`,
|
||||
);
|
||||
}
|
||||
|
||||
return semver.gt(
|
||||
semverify(lowestImplementedVersion),
|
||||
lowestTargetedVersion,
|
||||
);
|
||||
});
|
||||
|
||||
return isRequiredForEnvironments.length > 0;
|
||||
};
|
||||
|
||||
let hasBeenLogged = false;
|
||||
|
||||
const getBuiltInTargets = targets => {
|
||||
const builtInTargets = Object.assign({}, targets);
|
||||
if (builtInTargets.uglify != null) {
|
||||
delete builtInTargets.uglify;
|
||||
}
|
||||
return builtInTargets;
|
||||
};
|
||||
|
||||
export const transformIncludesAndExcludes = (opts: Array<string>): Object => {
|
||||
return opts.reduce(
|
||||
(result, opt) => {
|
||||
const target = opt.match(/^(es\d+|web)\./) ? "builtIns" : "plugins";
|
||||
result[target].add(opt);
|
||||
return result;
|
||||
},
|
||||
{
|
||||
all: opts,
|
||||
plugins: new Set(),
|
||||
builtIns: new Set(),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
const getPlatformSpecificDefaultFor = (targets: Targets): ?Array<string> => {
|
||||
const targetNames = Object.keys(targets);
|
||||
const isAnyTarget = !targetNames.length;
|
||||
const isWebTarget = targetNames.some(name => name !== "node");
|
||||
|
||||
return isAnyTarget || isWebTarget ? defaultWebIncludes : null;
|
||||
};
|
||||
|
||||
const filterItems = (
|
||||
list,
|
||||
includes,
|
||||
excludes,
|
||||
targets,
|
||||
defaultItems,
|
||||
): Set<string> => {
|
||||
const result = new Set();
|
||||
|
||||
for (const item in list) {
|
||||
const excluded = excludes.has(item);
|
||||
|
||||
if (!excluded) {
|
||||
if (isPluginRequired(targets, list[item])) {
|
||||
result.add(item);
|
||||
} else {
|
||||
const shippedProposalsSyntax = pluginSyntaxMap.get(item);
|
||||
|
||||
if (shippedProposalsSyntax) {
|
||||
result.add(shippedProposalsSyntax);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (defaultItems) {
|
||||
defaultItems.forEach(item => !excludes.has(item) && result.add(item));
|
||||
}
|
||||
|
||||
includes.forEach(item => result.add(item));
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
export default function buildPreset(
|
||||
api: Object,
|
||||
opts: Object = {},
|
||||
): { plugins: Array<Plugin> } {
|
||||
const {
|
||||
configPath,
|
||||
debug,
|
||||
exclude: optionsExclude,
|
||||
forceAllTransforms,
|
||||
ignoreBrowserslistConfig,
|
||||
include: optionsInclude,
|
||||
loose,
|
||||
modules,
|
||||
shippedProposals,
|
||||
spec,
|
||||
targets: optionsTargets,
|
||||
useBuiltIns,
|
||||
} = normalizeOptions(opts);
|
||||
// TODO: remove this in next major
|
||||
let hasUglifyTarget = false;
|
||||
|
||||
if (optionsTargets && optionsTargets.uglify) {
|
||||
hasUglifyTarget = true;
|
||||
delete optionsTargets.uglify;
|
||||
|
||||
console.log("");
|
||||
console.log("The uglify target has been deprecated. Set the top level");
|
||||
console.log("option `forceAllTransforms: true` instead.");
|
||||
console.log("");
|
||||
}
|
||||
|
||||
const targets = getTargets(optionsTargets, {
|
||||
ignoreBrowserslistConfig,
|
||||
configPath,
|
||||
});
|
||||
const include = transformIncludesAndExcludes(optionsInclude);
|
||||
const exclude = transformIncludesAndExcludes(optionsExclude);
|
||||
|
||||
const transformTargets = forceAllTransforms || hasUglifyTarget ? {} : targets;
|
||||
|
||||
const transformations = filterItems(
|
||||
shippedProposals ? pluginList : pluginListWithoutProposals,
|
||||
include.plugins,
|
||||
exclude.plugins,
|
||||
transformTargets,
|
||||
);
|
||||
|
||||
let polyfills;
|
||||
let polyfillTargets;
|
||||
|
||||
if (useBuiltIns) {
|
||||
polyfillTargets = getBuiltInTargets(targets);
|
||||
|
||||
polyfills = filterItems(
|
||||
shippedProposals ? builtInsList : builtInsListWithoutProposals,
|
||||
include.builtIns,
|
||||
exclude.builtIns,
|
||||
polyfillTargets,
|
||||
getPlatformSpecificDefaultFor(polyfillTargets),
|
||||
);
|
||||
}
|
||||
|
||||
const plugins = [];
|
||||
const pluginUseBuiltIns = useBuiltIns !== false;
|
||||
|
||||
// NOTE: not giving spec here yet to avoid compatibility issues when
|
||||
// transform-modules-commonjs gets its spec mode
|
||||
if (modules !== false && moduleTransformations[modules]) {
|
||||
plugins.push([getPlugin(moduleTransformations[modules]), { loose }]);
|
||||
}
|
||||
|
||||
transformations.forEach(pluginName =>
|
||||
plugins.push([
|
||||
getPlugin(pluginName),
|
||||
{ spec, loose, useBuiltIns: pluginUseBuiltIns },
|
||||
]),
|
||||
);
|
||||
|
||||
const regenerator = transformations.has("transform-regenerator");
|
||||
|
||||
if (debug && !hasBeenLogged) {
|
||||
hasBeenLogged = true;
|
||||
console.log("@babel/preset-env: `DEBUG` option");
|
||||
console.log("\nUsing targets:");
|
||||
console.log(JSON.stringify(prettifyTargets(targets), null, 2));
|
||||
console.log(`\nUsing modules transform: ${modules.toString()}`);
|
||||
console.log("\nUsing plugins:");
|
||||
transformations.forEach(transform => {
|
||||
logPlugin(transform, targets, pluginList);
|
||||
});
|
||||
|
||||
if (!useBuiltIns) {
|
||||
console.log(
|
||||
"\nUsing polyfills: No polyfills were added, since the `useBuiltIns` option was not set.",
|
||||
);
|
||||
} else {
|
||||
console.log(
|
||||
`
|
||||
Using polyfills with \`${useBuiltIns}\` option:`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (useBuiltIns === "usage" || useBuiltIns === "entry") {
|
||||
const pluginOptions = {
|
||||
debug,
|
||||
polyfills,
|
||||
regenerator,
|
||||
onDebug: (polyfills, context) => {
|
||||
polyfills.forEach(polyfill =>
|
||||
logPlugin(polyfill, polyfillTargets, builtInsList, context),
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
plugins.push([
|
||||
useBuiltIns === "usage" ? addUsedBuiltInsPlugin : useBuiltInsEntryPlugin,
|
||||
pluginOptions,
|
||||
]);
|
||||
}
|
||||
|
||||
return {
|
||||
plugins,
|
||||
};
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
//@flow
|
||||
|
||||
// Targets
|
||||
export type Target = string;
|
||||
export type Targets = {
|
||||
[target: string]: Target,
|
||||
};
|
||||
|
||||
// Options
|
||||
// Use explicit modules to prevent typo errors.
|
||||
export type ModuleOption = false | "amd" | "commonjs" | "systemjs" | "umd";
|
||||
export type BuiltInsOption = false | "entry" | "usage";
|
||||
|
||||
export type Options = {
|
||||
configPath: string,
|
||||
debug: boolean,
|
||||
exclude: Array<string>,
|
||||
forceAllTransforms: boolean,
|
||||
ignoreBrowserslistConfig: boolean,
|
||||
include: Array<string>,
|
||||
loose: boolean,
|
||||
modules: ModuleOption,
|
||||
shippedProposals: boolean,
|
||||
spec: boolean,
|
||||
targets: Targets,
|
||||
useBuiltIns: BuiltInsOption,
|
||||
};
|
||||
|
||||
// Babel
|
||||
export type Plugin = [Object, Object];
|
||||
@@ -1,82 +0,0 @@
|
||||
// @flow
|
||||
import { logEntryPolyfills } from "./debug";
|
||||
import {
|
||||
createImport,
|
||||
isPolyfillSource,
|
||||
isRequire,
|
||||
type RequireType,
|
||||
} from "./utils";
|
||||
|
||||
type Plugin = {
|
||||
visitor: Object,
|
||||
pre: Function,
|
||||
post: Function,
|
||||
name: string,
|
||||
};
|
||||
|
||||
export default function({ types: t }: { types: Object }): Plugin {
|
||||
function createImports(
|
||||
polyfills: Array<string>,
|
||||
requireType: RequireType,
|
||||
regenerator: boolean,
|
||||
): Array<Object> {
|
||||
const items = Array.isArray(polyfills) ? new Set(polyfills) : polyfills;
|
||||
const imports = [];
|
||||
|
||||
items.forEach(p => imports.push(createImport(t, p, requireType)));
|
||||
|
||||
if (regenerator) {
|
||||
imports.push(createImport(t, "regenerator-runtime", requireType));
|
||||
}
|
||||
|
||||
return imports;
|
||||
}
|
||||
|
||||
const isPolyfillImport = {
|
||||
ImportDeclaration(path, state) {
|
||||
if (
|
||||
path.node.specifiers.length === 0 &&
|
||||
isPolyfillSource(path.node.source.value)
|
||||
) {
|
||||
this.importPolyfillIncluded = true;
|
||||
path.replaceWithMultiple(
|
||||
createImports(state.opts.polyfills, "import", state.opts.regenerator),
|
||||
);
|
||||
}
|
||||
},
|
||||
Program(path, state) {
|
||||
path.get("body").forEach(bodyPath => {
|
||||
if (isRequire(t, bodyPath)) {
|
||||
bodyPath.replaceWithMultiple(
|
||||
createImports(
|
||||
state.opts.polyfills,
|
||||
"require",
|
||||
state.opts.regenerator,
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
return {
|
||||
name: "transform-polyfill-require",
|
||||
visitor: isPolyfillImport,
|
||||
pre() {
|
||||
this.numPolyfillImports = 0;
|
||||
this.importPolyfillIncluded = false;
|
||||
},
|
||||
post() {
|
||||
const { debug, onDebug, polyfills } = this.opts;
|
||||
|
||||
if (debug) {
|
||||
logEntryPolyfills(
|
||||
this.importPolyfillIncluded,
|
||||
polyfills,
|
||||
this.file.opts.filename,
|
||||
onDebug,
|
||||
);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
// @flow
|
||||
|
||||
import semver from "semver";
|
||||
import type { Targets } from "./types";
|
||||
|
||||
// Convert version to a semver value.
|
||||
// 2.5 -> 2.5.0; 1 -> 1.0.0;
|
||||
export const semverify = (version: string | number): string => {
|
||||
if (typeof version === "string" && semver.valid(version)) {
|
||||
return version;
|
||||
}
|
||||
|
||||
const split = version.toString().split(".");
|
||||
|
||||
while (split.length < 3) {
|
||||
split.push("0");
|
||||
}
|
||||
|
||||
return split.join(".");
|
||||
};
|
||||
|
||||
export const prettifyVersion = (version: string): string => {
|
||||
if (typeof version !== "string") {
|
||||
return version;
|
||||
}
|
||||
|
||||
const parts = [semver.major(version)];
|
||||
const minor = semver.minor(version);
|
||||
const patch = semver.patch(version);
|
||||
|
||||
if (minor || patch) {
|
||||
parts.push(minor);
|
||||
}
|
||||
|
||||
if (patch) {
|
||||
parts.push(patch);
|
||||
}
|
||||
|
||||
return parts.join(".");
|
||||
};
|
||||
|
||||
export const prettifyTargets = (targets: Targets): Object => {
|
||||
return Object.keys(targets).reduce((results, target) => {
|
||||
let value = targets[target];
|
||||
|
||||
if (typeof value === "string") {
|
||||
value = prettifyVersion(value);
|
||||
}
|
||||
|
||||
results[target] = value;
|
||||
return results;
|
||||
}, {});
|
||||
};
|
||||
|
||||
export const filterStageFromList = (list: any, stageList: any) => {
|
||||
return Object.keys(list).reduce((result, item) => {
|
||||
if (!stageList[item]) {
|
||||
result[item] = list[item];
|
||||
}
|
||||
|
||||
return result;
|
||||
}, {});
|
||||
};
|
||||
|
||||
export const isPolyfillSource = (source: string): boolean =>
|
||||
source === "@babel/polyfill";
|
||||
|
||||
export const isRequire = (t: Object, path: Object): boolean =>
|
||||
t.isExpressionStatement(path.node) &&
|
||||
t.isCallExpression(path.node.expression) &&
|
||||
t.isIdentifier(path.node.expression.callee) &&
|
||||
path.node.expression.callee.name === "require" &&
|
||||
path.node.expression.arguments.length === 1 &&
|
||||
t.isStringLiteral(path.node.expression.arguments[0]) &&
|
||||
isPolyfillSource(path.node.expression.arguments[0].value);
|
||||
|
||||
const modulePathMap = {
|
||||
"regenerator-runtime": "regenerator-runtime/runtime",
|
||||
};
|
||||
|
||||
export const getModulePath = (mod: string) =>
|
||||
modulePathMap[mod] || `core-js/modules/${mod}`;
|
||||
|
||||
export type RequireType = "require" | "import";
|
||||
|
||||
export const createImport = (
|
||||
t: Object,
|
||||
polyfill: string,
|
||||
requireType?: RequireType = "import",
|
||||
): Object => {
|
||||
const modulePath = getModulePath(polyfill);
|
||||
|
||||
if (requireType === "import") {
|
||||
const declar = t.importDeclaration([], t.stringLiteral(modulePath));
|
||||
declar._blockHoist = 3;
|
||||
return declar;
|
||||
}
|
||||
|
||||
return t.expressionStatement(
|
||||
t.callExpression(t.identifier("require"), [t.stringLiteral(modulePath)]),
|
||||
);
|
||||
};
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"mocha": true
|
||||
},
|
||||
"rules": {
|
||||
"max-len": 0
|
||||
}
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
@babel/preset-env: `DEBUG` option
|
||||
|
||||
Using targets:
|
||||
{
|
||||
"android": "4"
|
||||
}
|
||||
|
||||
Using modules transform: commonjs
|
||||
|
||||
Using plugins:
|
||||
check-constants { "android":"4" }
|
||||
transform-arrow-functions { "android":"4" }
|
||||
transform-block-scoped-functions { "android":"4" }
|
||||
transform-block-scoping { "android":"4" }
|
||||
transform-classes { "android":"4" }
|
||||
transform-computed-properties { "android":"4" }
|
||||
transform-destructuring { "android":"4" }
|
||||
transform-duplicate-keys { "android":"4" }
|
||||
transform-for-of { "android":"4" }
|
||||
transform-function-name { "android":"4" }
|
||||
transform-literals { "android":"4" }
|
||||
transform-object-super { "android":"4" }
|
||||
transform-parameters { "android":"4" }
|
||||
transform-shorthand-properties { "android":"4" }
|
||||
transform-spread { "android":"4" }
|
||||
transform-sticky-regex { "android":"4" }
|
||||
transform-template-literals { "android":"4" }
|
||||
transform-typeof-symbol { "android":"4" }
|
||||
transform-unicode-regex { "android":"4" }
|
||||
transform-new-target { "android":"4" }
|
||||
transform-regenerator { "android":"4" }
|
||||
transform-exponentiation-operator { "android":"4" }
|
||||
transform-async-to-generator { "android":"4" }
|
||||
|
||||
Using polyfills with `entry` option:
|
||||
|
||||
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
|
||||
es6.typed.array-buffer { "android":"4" }
|
||||
es6.typed.int8-array { "android":"4" }
|
||||
es6.typed.uint8-array { "android":"4" }
|
||||
es6.typed.uint8-clamped-array { "android":"4" }
|
||||
es6.typed.int16-array { "android":"4" }
|
||||
es6.typed.uint16-array { "android":"4" }
|
||||
es6.typed.int32-array { "android":"4" }
|
||||
es6.typed.uint32-array { "android":"4" }
|
||||
es6.typed.float32-array { "android":"4" }
|
||||
es6.typed.float64-array { "android":"4" }
|
||||
es6.map { "android":"4" }
|
||||
es6.set { "android":"4" }
|
||||
es6.weak-map { "android":"4" }
|
||||
es6.weak-set { "android":"4" }
|
||||
es6.reflect.apply { "android":"4" }
|
||||
es6.reflect.construct { "android":"4" }
|
||||
es6.reflect.define-property { "android":"4" }
|
||||
es6.reflect.delete-property { "android":"4" }
|
||||
es6.reflect.get { "android":"4" }
|
||||
es6.reflect.get-own-property-descriptor { "android":"4" }
|
||||
es6.reflect.get-prototype-of { "android":"4" }
|
||||
es6.reflect.has { "android":"4" }
|
||||
es6.reflect.is-extensible { "android":"4" }
|
||||
es6.reflect.own-keys { "android":"4" }
|
||||
es6.reflect.prevent-extensions { "android":"4" }
|
||||
es6.reflect.set { "android":"4" }
|
||||
es6.reflect.set-prototype-of { "android":"4" }
|
||||
es6.promise { "android":"4" }
|
||||
es6.symbol { "android":"4" }
|
||||
es6.object.freeze { "android":"4" }
|
||||
es6.object.seal { "android":"4" }
|
||||
es6.object.prevent-extensions { "android":"4" }
|
||||
es6.object.is-frozen { "android":"4" }
|
||||
es6.object.is-sealed { "android":"4" }
|
||||
es6.object.is-extensible { "android":"4" }
|
||||
es6.object.get-own-property-descriptor { "android":"4" }
|
||||
es6.object.get-prototype-of { "android":"4" }
|
||||
es6.object.keys { "android":"4" }
|
||||
es6.object.get-own-property-names { "android":"4" }
|
||||
es6.object.assign { "android":"4" }
|
||||
es6.object.is { "android":"4" }
|
||||
es6.object.set-prototype-of { "android":"4" }
|
||||
es6.function.name { "android":"4" }
|
||||
es6.string.raw { "android":"4" }
|
||||
es6.string.from-code-point { "android":"4" }
|
||||
es6.string.code-point-at { "android":"4" }
|
||||
es6.string.repeat { "android":"4" }
|
||||
es6.string.starts-with { "android":"4" }
|
||||
es6.string.ends-with { "android":"4" }
|
||||
es6.string.includes { "android":"4" }
|
||||
es6.regexp.flags { "android":"4" }
|
||||
es6.regexp.match { "android":"4" }
|
||||
es6.regexp.replace { "android":"4" }
|
||||
es6.regexp.split { "android":"4" }
|
||||
es6.regexp.search { "android":"4" }
|
||||
es6.array.from { "android":"4" }
|
||||
es6.array.of { "android":"4" }
|
||||
es6.array.copy-within { "android":"4" }
|
||||
es6.array.find { "android":"4" }
|
||||
es6.array.find-index { "android":"4" }
|
||||
es6.array.fill { "android":"4" }
|
||||
es6.array.iterator { "android":"4" }
|
||||
es6.number.is-finite { "android":"4" }
|
||||
es6.number.is-integer { "android":"4" }
|
||||
es6.number.is-safe-integer { "android":"4" }
|
||||
es6.number.is-nan { "android":"4" }
|
||||
es6.number.epsilon { "android":"4" }
|
||||
es6.number.min-safe-integer { "android":"4" }
|
||||
es6.number.max-safe-integer { "android":"4" }
|
||||
es6.number.parse-float { "android":"4" }
|
||||
es6.number.parse-int { "android":"4" }
|
||||
es6.math.acosh { "android":"4" }
|
||||
es6.math.asinh { "android":"4" }
|
||||
es6.math.atanh { "android":"4" }
|
||||
es6.math.cbrt { "android":"4" }
|
||||
es6.math.clz32 { "android":"4" }
|
||||
es6.math.cosh { "android":"4" }
|
||||
es6.math.expm1 { "android":"4" }
|
||||
es6.math.fround { "android":"4" }
|
||||
es6.math.hypot { "android":"4" }
|
||||
es6.math.imul { "android":"4" }
|
||||
es6.math.log1p { "android":"4" }
|
||||
es6.math.log10 { "android":"4" }
|
||||
es6.math.log2 { "android":"4" }
|
||||
es6.math.sign { "android":"4" }
|
||||
es6.math.sinh { "android":"4" }
|
||||
es6.math.tanh { "android":"4" }
|
||||
es6.math.trunc { "android":"4" }
|
||||
es7.array.includes { "android":"4" }
|
||||
es7.object.values { "android":"4" }
|
||||
es7.object.entries { "android":"4" }
|
||||
es7.object.get-own-property-descriptors { "android":"4" }
|
||||
es7.string.pad-start { "android":"4" }
|
||||
es7.string.pad-end { "android":"4" }
|
||||
web.timers { "android":"4" }
|
||||
web.immediate { "android":"4" }
|
||||
web.dom.iterable { "android":"4" }
|
||||
src/in.js -> lib/in.js
|
||||
@@ -1,20 +0,0 @@
|
||||
@babel/preset-env: `DEBUG` option
|
||||
|
||||
Using targets:
|
||||
{
|
||||
"node": "6"
|
||||
}
|
||||
|
||||
Using modules transform: commonjs
|
||||
|
||||
Using plugins:
|
||||
transform-destructuring { "node":"6" }
|
||||
transform-for-of { "node":"6" }
|
||||
transform-function-name { "node":"6" }
|
||||
transform-exponentiation-operator { "node":"6" }
|
||||
transform-async-to-generator { "node":"6" }
|
||||
|
||||
Using polyfills with `entry` option:
|
||||
|
||||
[src/in.js] `import '@babel/polyfill'` was not found.
|
||||
src/in.js -> lib/in.js
|
||||
@@ -1,46 +0,0 @@
|
||||
The uglify target has been deprecated. Set the top level
|
||||
option `forceAllTransforms: true` instead.
|
||||
|
||||
@babel/preset-env: `DEBUG` option
|
||||
|
||||
Using targets:
|
||||
{
|
||||
"chrome": "55"
|
||||
}
|
||||
|
||||
Using modules transform: false
|
||||
|
||||
Using plugins:
|
||||
check-constants {}
|
||||
transform-arrow-functions {}
|
||||
transform-block-scoped-functions {}
|
||||
transform-block-scoping {}
|
||||
transform-classes {}
|
||||
transform-computed-properties {}
|
||||
transform-destructuring {}
|
||||
transform-duplicate-keys {}
|
||||
transform-for-of {}
|
||||
transform-function-name {}
|
||||
transform-literals {}
|
||||
transform-object-super {}
|
||||
transform-parameters {}
|
||||
transform-shorthand-properties {}
|
||||
transform-spread {}
|
||||
transform-sticky-regex {}
|
||||
transform-template-literals {}
|
||||
transform-typeof-symbol {}
|
||||
transform-unicode-regex {}
|
||||
transform-new-target {}
|
||||
transform-regenerator {}
|
||||
transform-exponentiation-operator {}
|
||||
transform-async-to-generator {}
|
||||
|
||||
Using polyfills with `entry` option:
|
||||
|
||||
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
|
||||
es7.string.pad-start { "chrome":"55" }
|
||||
es7.string.pad-end { "chrome":"55" }
|
||||
web.timers { "chrome":"55" }
|
||||
web.immediate { "chrome":"55" }
|
||||
web.dom.iterable { "chrome":"55" }
|
||||
src/in.js -> lib/in.js
|
||||
@@ -1,137 +0,0 @@
|
||||
@babel/preset-env: `DEBUG` option
|
||||
|
||||
Using targets:
|
||||
{
|
||||
"chrome": "54",
|
||||
"ie": "10",
|
||||
"node": "6"
|
||||
}
|
||||
|
||||
Using modules transform: commonjs
|
||||
|
||||
Using plugins:
|
||||
check-constants { "ie":"10" }
|
||||
transform-arrow-functions { "ie":"10" }
|
||||
transform-block-scoped-functions { "ie":"10" }
|
||||
transform-block-scoping { "ie":"10" }
|
||||
transform-classes { "ie":"10" }
|
||||
transform-computed-properties { "ie":"10" }
|
||||
transform-destructuring { "ie":"10", "node":"6" }
|
||||
transform-duplicate-keys { "ie":"10" }
|
||||
transform-for-of { "ie":"10", "node":"6" }
|
||||
transform-function-name { "ie":"10", "node":"6" }
|
||||
transform-literals { "ie":"10" }
|
||||
transform-object-super { "ie":"10" }
|
||||
transform-parameters { "ie":"10" }
|
||||
transform-shorthand-properties { "ie":"10" }
|
||||
transform-spread { "ie":"10" }
|
||||
transform-sticky-regex { "ie":"10" }
|
||||
transform-template-literals { "ie":"10" }
|
||||
transform-typeof-symbol { "ie":"10" }
|
||||
transform-unicode-regex { "ie":"10" }
|
||||
transform-new-target { "ie":"10" }
|
||||
transform-regenerator { "ie":"10" }
|
||||
transform-exponentiation-operator { "ie":"10", "node":"6" }
|
||||
transform-async-to-generator { "chrome":"54", "ie":"10", "node":"6" }
|
||||
|
||||
Using polyfills with `entry` option:
|
||||
|
||||
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
|
||||
es6.typed.array-buffer { "ie":"10", "node":"6" }
|
||||
es6.typed.int8-array { "ie":"10", "node":"6" }
|
||||
es6.typed.uint8-array { "ie":"10", "node":"6" }
|
||||
es6.typed.uint8-clamped-array { "ie":"10", "node":"6" }
|
||||
es6.typed.int16-array { "ie":"10", "node":"6" }
|
||||
es6.typed.uint16-array { "ie":"10", "node":"6" }
|
||||
es6.typed.int32-array { "ie":"10", "node":"6" }
|
||||
es6.typed.uint32-array { "ie":"10", "node":"6" }
|
||||
es6.typed.float32-array { "ie":"10", "node":"6" }
|
||||
es6.typed.float64-array { "ie":"10", "node":"6" }
|
||||
es6.map { "ie":"10", "node":"6" }
|
||||
es6.set { "ie":"10", "node":"6" }
|
||||
es6.weak-map { "ie":"10", "node":"6" }
|
||||
es6.weak-set { "ie":"10", "node":"6" }
|
||||
es6.reflect.apply { "ie":"10" }
|
||||
es6.reflect.construct { "ie":"10" }
|
||||
es6.reflect.define-property { "ie":"10" }
|
||||
es6.reflect.delete-property { "ie":"10" }
|
||||
es6.reflect.get { "ie":"10" }
|
||||
es6.reflect.get-own-property-descriptor { "ie":"10" }
|
||||
es6.reflect.get-prototype-of { "ie":"10" }
|
||||
es6.reflect.has { "ie":"10" }
|
||||
es6.reflect.is-extensible { "ie":"10" }
|
||||
es6.reflect.own-keys { "ie":"10" }
|
||||
es6.reflect.prevent-extensions { "ie":"10" }
|
||||
es6.reflect.set { "ie":"10" }
|
||||
es6.reflect.set-prototype-of { "ie":"10" }
|
||||
es6.promise { "ie":"10", "node":"6" }
|
||||
es6.symbol { "ie":"10", "node":"6" }
|
||||
es6.object.freeze { "ie":"10" }
|
||||
es6.object.seal { "ie":"10" }
|
||||
es6.object.prevent-extensions { "ie":"10" }
|
||||
es6.object.is-frozen { "ie":"10" }
|
||||
es6.object.is-sealed { "ie":"10" }
|
||||
es6.object.is-extensible { "ie":"10" }
|
||||
es6.object.get-own-property-descriptor { "ie":"10" }
|
||||
es6.object.get-prototype-of { "ie":"10" }
|
||||
es6.object.keys { "ie":"10" }
|
||||
es6.object.get-own-property-names { "ie":"10" }
|
||||
es6.object.assign { "ie":"10" }
|
||||
es6.object.is { "ie":"10" }
|
||||
es6.object.set-prototype-of { "ie":"10" }
|
||||
es6.function.name { "ie":"10", "node":"6" }
|
||||
es6.string.raw { "ie":"10" }
|
||||
es6.string.from-code-point { "ie":"10" }
|
||||
es6.string.code-point-at { "ie":"10" }
|
||||
es6.string.repeat { "ie":"10" }
|
||||
es6.string.starts-with { "ie":"10" }
|
||||
es6.string.ends-with { "ie":"10" }
|
||||
es6.string.includes { "ie":"10" }
|
||||
es6.regexp.flags { "ie":"10" }
|
||||
es6.regexp.match { "ie":"10" }
|
||||
es6.regexp.replace { "ie":"10" }
|
||||
es6.regexp.split { "ie":"10" }
|
||||
es6.regexp.search { "ie":"10" }
|
||||
es6.array.from { "ie":"10", "node":"6" }
|
||||
es6.array.of { "ie":"10" }
|
||||
es6.array.copy-within { "ie":"10" }
|
||||
es6.array.find { "ie":"10" }
|
||||
es6.array.find-index { "ie":"10" }
|
||||
es6.array.fill { "ie":"10" }
|
||||
es6.array.iterator { "ie":"10" }
|
||||
es6.number.is-finite { "ie":"10" }
|
||||
es6.number.is-integer { "ie":"10" }
|
||||
es6.number.is-safe-integer { "ie":"10" }
|
||||
es6.number.is-nan { "ie":"10" }
|
||||
es6.number.epsilon { "ie":"10" }
|
||||
es6.number.min-safe-integer { "ie":"10" }
|
||||
es6.number.max-safe-integer { "ie":"10" }
|
||||
es6.number.parse-float { "ie":"10" }
|
||||
es6.number.parse-int { "ie":"10" }
|
||||
es6.math.acosh { "ie":"10" }
|
||||
es6.math.asinh { "ie":"10" }
|
||||
es6.math.atanh { "ie":"10" }
|
||||
es6.math.cbrt { "ie":"10" }
|
||||
es6.math.clz32 { "ie":"10" }
|
||||
es6.math.cosh { "ie":"10" }
|
||||
es6.math.expm1 { "ie":"10" }
|
||||
es6.math.fround { "ie":"10" }
|
||||
es6.math.hypot { "ie":"10" }
|
||||
es6.math.imul { "ie":"10" }
|
||||
es6.math.log1p { "ie":"10" }
|
||||
es6.math.log10 { "ie":"10" }
|
||||
es6.math.log2 { "ie":"10" }
|
||||
es6.math.sign { "ie":"10" }
|
||||
es6.math.sinh { "ie":"10" }
|
||||
es6.math.tanh { "ie":"10" }
|
||||
es6.math.trunc { "ie":"10" }
|
||||
es7.array.includes { "ie":"10" }
|
||||
es7.object.values { "ie":"10", "node":"6" }
|
||||
es7.object.entries { "ie":"10", "node":"6" }
|
||||
es7.object.get-own-property-descriptors { "ie":"10", "node":"6" }
|
||||
es7.string.pad-start { "chrome":"54", "ie":"10", "node":"6" }
|
||||
es7.string.pad-end { "chrome":"54", "ie":"10", "node":"6" }
|
||||
web.timers { "chrome":"54", "ie":"10", "node":"6" }
|
||||
web.immediate { "chrome":"54", "ie":"10", "node":"6" }
|
||||
web.dom.iterable { "chrome":"54", "ie":"10", "node":"6" }
|
||||
src/in.js -> lib/in.js
|
||||
@@ -1,78 +0,0 @@
|
||||
Warning, the following targets are using a decimal version:
|
||||
|
||||
electron: 0.36
|
||||
|
||||
We recommend using a string for minor/patch versions to avoid numbers like 6.10
|
||||
getting parsed as 6.1, which can lead to unexpected behavior.
|
||||
|
||||
@babel/preset-env: `DEBUG` option
|
||||
|
||||
Using targets:
|
||||
{
|
||||
"electron": "0.36"
|
||||
}
|
||||
|
||||
Using modules transform: commonjs
|
||||
|
||||
Using plugins:
|
||||
check-constants { "electron":"0.36" }
|
||||
transform-block-scoping { "electron":"0.36" }
|
||||
transform-destructuring { "electron":"0.36" }
|
||||
transform-for-of { "electron":"0.36" }
|
||||
transform-function-name { "electron":"0.36" }
|
||||
transform-parameters { "electron":"0.36" }
|
||||
transform-sticky-regex { "electron":"0.36" }
|
||||
transform-unicode-regex { "electron":"0.36" }
|
||||
transform-regenerator { "electron":"0.36" }
|
||||
transform-exponentiation-operator { "electron":"0.36" }
|
||||
transform-async-to-generator { "electron":"0.36" }
|
||||
|
||||
Using polyfills with `entry` option:
|
||||
|
||||
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
|
||||
es6.typed.array-buffer { "electron":"0.36" }
|
||||
es6.typed.data-view { "electron":"0.36" }
|
||||
es6.typed.int8-array { "electron":"0.36" }
|
||||
es6.typed.uint8-array { "electron":"0.36" }
|
||||
es6.typed.uint8-clamped-array { "electron":"0.36" }
|
||||
es6.typed.int16-array { "electron":"0.36" }
|
||||
es6.typed.uint16-array { "electron":"0.36" }
|
||||
es6.typed.int32-array { "electron":"0.36" }
|
||||
es6.typed.uint32-array { "electron":"0.36" }
|
||||
es6.typed.float32-array { "electron":"0.36" }
|
||||
es6.typed.float64-array { "electron":"0.36" }
|
||||
es6.map { "electron":"0.36" }
|
||||
es6.set { "electron":"0.36" }
|
||||
es6.weak-map { "electron":"0.36" }
|
||||
es6.weak-set { "electron":"0.36" }
|
||||
es6.reflect.apply { "electron":"0.36" }
|
||||
es6.reflect.construct { "electron":"0.36" }
|
||||
es6.reflect.define-property { "electron":"0.36" }
|
||||
es6.reflect.delete-property { "electron":"0.36" }
|
||||
es6.reflect.get { "electron":"0.36" }
|
||||
es6.reflect.get-own-property-descriptor { "electron":"0.36" }
|
||||
es6.reflect.get-prototype-of { "electron":"0.36" }
|
||||
es6.reflect.has { "electron":"0.36" }
|
||||
es6.reflect.is-extensible { "electron":"0.36" }
|
||||
es6.reflect.own-keys { "electron":"0.36" }
|
||||
es6.reflect.prevent-extensions { "electron":"0.36" }
|
||||
es6.reflect.set { "electron":"0.36" }
|
||||
es6.reflect.set-prototype-of { "electron":"0.36" }
|
||||
es6.promise { "electron":"0.36" }
|
||||
es6.symbol { "electron":"0.36" }
|
||||
es6.function.name { "electron":"0.36" }
|
||||
es6.regexp.flags { "electron":"0.36" }
|
||||
es6.regexp.match { "electron":"0.36" }
|
||||
es6.regexp.replace { "electron":"0.36" }
|
||||
es6.regexp.split { "electron":"0.36" }
|
||||
es6.regexp.search { "electron":"0.36" }
|
||||
es6.array.from { "electron":"0.36" }
|
||||
es7.object.values { "electron":"0.36" }
|
||||
es7.object.entries { "electron":"0.36" }
|
||||
es7.object.get-own-property-descriptors { "electron":"0.36" }
|
||||
es7.string.pad-start { "electron":"0.36" }
|
||||
es7.string.pad-end { "electron":"0.36" }
|
||||
web.timers { "electron":"0.36" }
|
||||
web.immediate { "electron":"0.36" }
|
||||
web.dom.iterable { "electron":"0.36" }
|
||||
src/in.js -> lib/in.js
|
||||
@@ -1,43 +0,0 @@
|
||||
@babel/preset-env: `DEBUG` option
|
||||
|
||||
Using targets:
|
||||
{
|
||||
"chrome": "55"
|
||||
}
|
||||
|
||||
Using modules transform: false
|
||||
|
||||
Using plugins:
|
||||
check-constants {}
|
||||
transform-arrow-functions {}
|
||||
transform-block-scoped-functions {}
|
||||
transform-block-scoping {}
|
||||
transform-classes {}
|
||||
transform-computed-properties {}
|
||||
transform-destructuring {}
|
||||
transform-duplicate-keys {}
|
||||
transform-for-of {}
|
||||
transform-function-name {}
|
||||
transform-literals {}
|
||||
transform-object-super {}
|
||||
transform-parameters {}
|
||||
transform-shorthand-properties {}
|
||||
transform-spread {}
|
||||
transform-sticky-regex {}
|
||||
transform-template-literals {}
|
||||
transform-typeof-symbol {}
|
||||
transform-unicode-regex {}
|
||||
transform-new-target {}
|
||||
transform-regenerator {}
|
||||
transform-exponentiation-operator {}
|
||||
transform-async-to-generator {}
|
||||
|
||||
Using polyfills with `entry` option:
|
||||
|
||||
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
|
||||
es7.string.pad-start { "chrome":"55" }
|
||||
es7.string.pad-end { "chrome":"55" }
|
||||
web.timers { "chrome":"55" }
|
||||
web.immediate { "chrome":"55" }
|
||||
web.dom.iterable { "chrome":"55" }
|
||||
src/in.js -> lib/in.js
|
||||
@@ -1,25 +0,0 @@
|
||||
Warning, the following targets are using a decimal version:
|
||||
|
||||
node: 7.4
|
||||
|
||||
We recommend using a string for minor/patch versions to avoid numbers like 6.10
|
||||
getting parsed as 6.1, which can lead to unexpected behavior.
|
||||
|
||||
@babel/preset-env: `DEBUG` option
|
||||
|
||||
Using targets:
|
||||
{
|
||||
"firefox": "52",
|
||||
"node": "7.4"
|
||||
}
|
||||
|
||||
Using modules transform: commonjs
|
||||
|
||||
Using plugins:
|
||||
transform-destructuring { "firefox":"52" }
|
||||
transform-for-of { "firefox":"52" }
|
||||
transform-function-name { "firefox":"52" }
|
||||
transform-literals { "firefox":"52" }
|
||||
|
||||
Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
|
||||
src/in.js -> lib/in.js
|
||||
@@ -1,23 +0,0 @@
|
||||
@babel/preset-env: `DEBUG` option
|
||||
|
||||
Using targets:
|
||||
{
|
||||
"chrome": "60"
|
||||
}
|
||||
|
||||
Using modules transform: commonjs
|
||||
|
||||
Using plugins:
|
||||
proposal-async-generator-functions { "chrome":"60" }
|
||||
syntax-object-rest-spread { "chrome":"60" }
|
||||
proposal-optional-catch-binding { "chrome":"60" }
|
||||
proposal-unicode-property-regex { "chrome":"60" }
|
||||
|
||||
Using polyfills with `entry` option:
|
||||
|
||||
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
|
||||
es7.promise.finally { "chrome":"60" }
|
||||
web.timers { "chrome":"60" }
|
||||
web.immediate { "chrome":"60" }
|
||||
web.dom.iterable { "chrome":"60" }
|
||||
src/in.js -> lib/in.js
|
||||
@@ -1,139 +0,0 @@
|
||||
@babel/preset-env: `DEBUG` option
|
||||
|
||||
Using targets:
|
||||
{}
|
||||
|
||||
Using modules transform: commonjs
|
||||
|
||||
Using plugins:
|
||||
check-constants {}
|
||||
transform-arrow-functions {}
|
||||
transform-block-scoped-functions {}
|
||||
transform-block-scoping {}
|
||||
transform-classes {}
|
||||
transform-computed-properties {}
|
||||
transform-destructuring {}
|
||||
transform-duplicate-keys {}
|
||||
transform-for-of {}
|
||||
transform-function-name {}
|
||||
transform-literals {}
|
||||
transform-object-super {}
|
||||
transform-parameters {}
|
||||
transform-shorthand-properties {}
|
||||
transform-spread {}
|
||||
transform-sticky-regex {}
|
||||
transform-template-literals {}
|
||||
transform-typeof-symbol {}
|
||||
transform-unicode-regex {}
|
||||
transform-new-target {}
|
||||
transform-regenerator {}
|
||||
transform-exponentiation-operator {}
|
||||
transform-async-to-generator {}
|
||||
proposal-async-generator-functions {}
|
||||
proposal-object-rest-spread {}
|
||||
proposal-optional-catch-binding {}
|
||||
proposal-unicode-property-regex {}
|
||||
|
||||
Using polyfills with `entry` option:
|
||||
|
||||
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
|
||||
es6.typed.array-buffer {}
|
||||
es6.typed.data-view {}
|
||||
es6.typed.int8-array {}
|
||||
es6.typed.uint8-array {}
|
||||
es6.typed.uint8-clamped-array {}
|
||||
es6.typed.int16-array {}
|
||||
es6.typed.uint16-array {}
|
||||
es6.typed.int32-array {}
|
||||
es6.typed.uint32-array {}
|
||||
es6.typed.float32-array {}
|
||||
es6.typed.float64-array {}
|
||||
es6.map {}
|
||||
es6.set {}
|
||||
es6.weak-map {}
|
||||
es6.weak-set {}
|
||||
es6.reflect.apply {}
|
||||
es6.reflect.construct {}
|
||||
es6.reflect.define-property {}
|
||||
es6.reflect.delete-property {}
|
||||
es6.reflect.get {}
|
||||
es6.reflect.get-own-property-descriptor {}
|
||||
es6.reflect.get-prototype-of {}
|
||||
es6.reflect.has {}
|
||||
es6.reflect.is-extensible {}
|
||||
es6.reflect.own-keys {}
|
||||
es6.reflect.prevent-extensions {}
|
||||
es6.reflect.set {}
|
||||
es6.reflect.set-prototype-of {}
|
||||
es6.promise {}
|
||||
es6.symbol {}
|
||||
es6.object.freeze {}
|
||||
es6.object.seal {}
|
||||
es6.object.prevent-extensions {}
|
||||
es6.object.is-frozen {}
|
||||
es6.object.is-sealed {}
|
||||
es6.object.is-extensible {}
|
||||
es6.object.get-own-property-descriptor {}
|
||||
es6.object.get-prototype-of {}
|
||||
es6.object.keys {}
|
||||
es6.object.get-own-property-names {}
|
||||
es6.object.assign {}
|
||||
es6.object.is {}
|
||||
es6.object.set-prototype-of {}
|
||||
es6.function.name {}
|
||||
es6.string.raw {}
|
||||
es6.string.from-code-point {}
|
||||
es6.string.code-point-at {}
|
||||
es6.string.repeat {}
|
||||
es6.string.starts-with {}
|
||||
es6.string.ends-with {}
|
||||
es6.string.includes {}
|
||||
es6.regexp.flags {}
|
||||
es6.regexp.match {}
|
||||
es6.regexp.replace {}
|
||||
es6.regexp.split {}
|
||||
es6.regexp.search {}
|
||||
es6.array.from {}
|
||||
es6.array.of {}
|
||||
es6.array.copy-within {}
|
||||
es6.array.find {}
|
||||
es6.array.find-index {}
|
||||
es6.array.fill {}
|
||||
es6.array.iterator {}
|
||||
es6.number.is-finite {}
|
||||
es6.number.is-integer {}
|
||||
es6.number.is-safe-integer {}
|
||||
es6.number.is-nan {}
|
||||
es6.number.epsilon {}
|
||||
es6.number.min-safe-integer {}
|
||||
es6.number.max-safe-integer {}
|
||||
es6.number.parse-float {}
|
||||
es6.number.parse-int {}
|
||||
es6.math.acosh {}
|
||||
es6.math.asinh {}
|
||||
es6.math.atanh {}
|
||||
es6.math.cbrt {}
|
||||
es6.math.clz32 {}
|
||||
es6.math.cosh {}
|
||||
es6.math.expm1 {}
|
||||
es6.math.fround {}
|
||||
es6.math.hypot {}
|
||||
es6.math.imul {}
|
||||
es6.math.log1p {}
|
||||
es6.math.log10 {}
|
||||
es6.math.log2 {}
|
||||
es6.math.sign {}
|
||||
es6.math.sinh {}
|
||||
es6.math.tanh {}
|
||||
es6.math.trunc {}
|
||||
es7.array.includes {}
|
||||
es7.object.values {}
|
||||
es7.object.entries {}
|
||||
es7.object.get-own-property-descriptors {}
|
||||
es7.string.pad-start {}
|
||||
es7.string.pad-end {}
|
||||
es7.promise.finally {}
|
||||
web.timers {}
|
||||
web.immediate {}
|
||||
web.dom.iterable {}
|
||||
src/in.js -> lib/in.js
|
||||
@@ -1,140 +0,0 @@
|
||||
@babel/preset-env: `DEBUG` option
|
||||
|
||||
Using targets:
|
||||
{
|
||||
"chrome": "54",
|
||||
"edge": "13",
|
||||
"firefox": "49",
|
||||
"ie": "10",
|
||||
"ios": "9",
|
||||
"safari": "7"
|
||||
}
|
||||
|
||||
Using modules transform: commonjs
|
||||
|
||||
Using plugins:
|
||||
check-constants { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-arrow-functions { "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-block-scoped-functions { "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-block-scoping { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-classes { "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-computed-properties { "ie":"10", "safari":"7" }
|
||||
transform-destructuring { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-duplicate-keys { "ie":"10", "safari":"7" }
|
||||
transform-for-of { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-function-name { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-literals { "firefox":"49", "ie":"10", "safari":"7" }
|
||||
transform-object-super { "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-parameters { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-shorthand-properties { "ie":"10", "safari":"7" }
|
||||
transform-spread { "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-sticky-regex { "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-template-literals { "ie":"10", "safari":"7" }
|
||||
transform-typeof-symbol { "ie":"10", "safari":"7" }
|
||||
transform-unicode-regex { "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-new-target { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-regenerator { "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-exponentiation-operator { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
transform-async-to-generator { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
|
||||
Using polyfills with `entry` option:
|
||||
|
||||
[src/in.js] Replaced `@babel/polyfill` with the following polyfills:
|
||||
es6.typed.array-buffer { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.typed.int8-array { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.typed.uint8-array { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.typed.uint8-clamped-array { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.typed.int16-array { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.typed.uint16-array { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.typed.int32-array { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.typed.uint32-array { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.typed.float32-array { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.typed.float64-array { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.map { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.set { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.weak-map { "edge":"13", "firefox":"49", "ie":"10", "safari":"7" }
|
||||
es6.weak-set { "edge":"13", "firefox":"49", "ie":"10", "safari":"7" }
|
||||
es6.reflect.apply { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.reflect.construct { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.reflect.define-property { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.reflect.delete-property { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.reflect.get { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.reflect.get-own-property-descriptor { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.reflect.get-prototype-of { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.reflect.has { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.reflect.is-extensible { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.reflect.own-keys { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.reflect.prevent-extensions { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.reflect.set { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.reflect.set-prototype-of { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.promise { "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.symbol { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.object.freeze { "ie":"10", "safari":"7" }
|
||||
es6.object.seal { "ie":"10", "safari":"7" }
|
||||
es6.object.prevent-extensions { "ie":"10", "safari":"7" }
|
||||
es6.object.is-frozen { "ie":"10", "safari":"7" }
|
||||
es6.object.is-sealed { "ie":"10", "safari":"7" }
|
||||
es6.object.is-extensible { "ie":"10", "safari":"7" }
|
||||
es6.object.get-own-property-descriptor { "ie":"10", "safari":"7" }
|
||||
es6.object.get-prototype-of { "ie":"10", "safari":"7" }
|
||||
es6.object.keys { "ie":"10", "safari":"7" }
|
||||
es6.object.get-own-property-names { "ie":"10", "safari":"7" }
|
||||
es6.object.assign { "ie":"10", "safari":"7" }
|
||||
es6.object.is { "ie":"10", "safari":"7" }
|
||||
es6.object.set-prototype-of { "ie":"10", "safari":"7" }
|
||||
es6.function.name { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.string.raw { "ie":"10", "safari":"7" }
|
||||
es6.string.from-code-point { "ie":"10", "safari":"7" }
|
||||
es6.string.code-point-at { "ie":"10", "safari":"7" }
|
||||
es6.string.repeat { "ie":"10", "safari":"7" }
|
||||
es6.string.starts-with { "ie":"10", "safari":"7" }
|
||||
es6.string.ends-with { "ie":"10", "safari":"7" }
|
||||
es6.string.includes { "ie":"10", "safari":"7" }
|
||||
es6.regexp.flags { "edge":"13", "ie":"10", "safari":"7" }
|
||||
es6.regexp.match { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.regexp.replace { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.regexp.split { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.regexp.search { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.array.from { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
|
||||
es6.array.of { "ie":"10", "safari":"7" }
|
||||
es6.array.copy-within { "ie":"10", "safari":"7" }
|
||||
es6.array.find { "ie":"10", "safari":"7" }
|
||||
es6.array.find-index { "ie":"10", "safari":"7" }
|
||||
es6.array.fill { "ie":"10", "safari":"7" }
|
||||
es6.array.iterator { "ie":"10", "safari":"7" }
|
||||
es6.number.is-finite { "ie":"10", "safari":"7" }
|
||||
es6.number.is-integer { "ie":"10", "safari":"7" }
|
||||
es6.number.is-safe-integer { "ie":"10", "safari":"7" }
|
||||
es6.number.is-nan { "ie":"10", "safari":"7" }
|
||||
es6.number.epsilon { "ie":"10", "safari":"7" }
|
||||
es6.number.min-safe-integer { "ie":"10", "safari":"7" }
|
||||
es6.number.max-safe-integer { "ie":"10", "safari":"7" }
|
||||
es6.number.parse-float { "ie":"10", "safari":"7" }
|
||||
es6.number.parse-int { "ie":"10", "safari":"7" }
|
||||
es6.math.acosh { "ie":"10", "safari":"7" }
|
||||
es6.math.asinh { "ie":"10", "safari":"7" }
|
||||
es6.math.atanh { "ie":"10", "safari":"7" }
|
||||
es6.math.cbrt { "ie":"10", "safari":"7" }
|
||||
es6.math.clz32 { "ie":"10", "safari":"7" }
|
||||
es6.math.cosh { "ie":"10", "safari":"7" }
|
||||
es6.math.expm1 { "ie":"10", "safari":"7" }
|
||||
es6.math.fround { "ie":"10", "safari":"7" }
|
||||
es6.math.hypot { "ie":"10", "safari":"7" }
|
||||
es6.math.imul { "ie":"10" }
|
||||
es6.math.log1p { "ie":"10", "safari":"7" }
|
||||
es6.math.log10 { "ie":"10", "safari":"7" }
|
||||
es6.math.log2 { "ie":"10", "safari":"7" }
|
||||
es6.math.sign { "ie":"10", "safari":"7" }
|
||||
es6.math.sinh { "ie":"10", "safari":"7" }
|
||||
es6.math.tanh { "ie":"10", "safari":"7" }
|
||||
es6.math.trunc { "ie":"10", "safari":"7" }
|
||||
es7.array.includes { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
|
||||
es7.object.values { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
|
||||
es7.object.entries { "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
|
||||
es7.object.get-own-property-descriptors { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
es7.string.pad-start { "chrome":"54", "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
|
||||
es7.string.pad-end { "chrome":"54", "edge":"13", "ie":"10", "ios":"9", "safari":"7" }
|
||||
web.timers { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
web.immediate { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
web.dom.iterable { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
|
||||
src/in.js -> lib/in.js
|
||||
@@ -1,42 +0,0 @@
|
||||
@babel/preset-env: `DEBUG` option
|
||||
|
||||
Using targets:
|
||||
{
|
||||
"chrome": "52",
|
||||
"firefox": "50",
|
||||
"ie": "11"
|
||||
}
|
||||
|
||||
Using modules transform: commonjs
|
||||
|
||||
Using plugins:
|
||||
check-constants { "firefox":"50", "ie":"11" }
|
||||
transform-arrow-functions { "ie":"11" }
|
||||
transform-block-scoping { "firefox":"50", "ie":"11" }
|
||||
transform-classes { "ie":"11" }
|
||||
transform-computed-properties { "ie":"11" }
|
||||
transform-destructuring { "firefox":"50", "ie":"11" }
|
||||
transform-duplicate-keys { "ie":"11" }
|
||||
transform-for-of { "firefox":"50", "ie":"11" }
|
||||
transform-function-name { "firefox":"50", "ie":"11" }
|
||||
transform-literals { "firefox":"50", "ie":"11" }
|
||||
transform-object-super { "ie":"11" }
|
||||
transform-parameters { "firefox":"50", "ie":"11" }
|
||||
transform-shorthand-properties { "ie":"11" }
|
||||
transform-spread { "ie":"11" }
|
||||
transform-sticky-regex { "ie":"11" }
|
||||
transform-template-literals { "ie":"11" }
|
||||
transform-typeof-symbol { "ie":"11" }
|
||||
transform-unicode-regex { "ie":"11" }
|
||||
transform-new-target { "ie":"11" }
|
||||
transform-regenerator { "firefox":"50", "ie":"11" }
|
||||
transform-exponentiation-operator { "firefox":"50", "ie":"11" }
|
||||
transform-async-to-generator { "chrome":"52", "firefox":"50", "ie":"11" }
|
||||
|
||||
Using polyfills with `usage` option:
|
||||
|
||||
[src/in.js] Based on your code and targets, none were added.
|
||||
src/in.js -> lib/in.js
|
||||
|
||||
[src/in2.js] Based on your code and targets, none were added.
|
||||
src/in2.js -> lib/in2.js
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user